From f0eb94a9659f306c78898230e368edad6afbfa73 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Sat, 10 May 2025 15:43:30 -0500 Subject: [PATCH 01/47] Follow Me: Make it interactive! --- .prettierignore | 1 - build/follow-me/block.json | 13 +- build/follow-me/index.asset.php | 2 +- build/follow-me/index.js | 5 +- build/follow-me/index.js.map | 1 + build/follow-me/render.php | 196 ++++++++++++++++++++++ build/follow-me/style-view-rtl.css | 1 - build/follow-me/style-view.css | 2 +- build/follow-me/style-view.css.map | 1 + build/follow-me/view.asset.php | 2 +- build/follow-me/view.js | 3 +- build/follow-me/view.js.map | 1 + includes/class-blocks.php | 43 +---- package.json | 9 +- src/follow-me/block.json | 117 ++++++------- src/follow-me/button-style.js | 104 ++++++++---- src/follow-me/edit.js | 133 ++++++++++++--- src/follow-me/follow-me.js | 26 +-- src/follow-me/index.js | 9 +- src/follow-me/render.php | 196 ++++++++++++++++++++++ src/follow-me/style.scss | 245 ++++++++++++++++++++++----- src/follow-me/view.js | 259 +++++++++++++++++++++++++++-- 22 files changed, 1117 insertions(+), 252 deletions(-) create mode 100644 build/follow-me/index.js.map create mode 100644 build/follow-me/render.php delete mode 100644 build/follow-me/style-view-rtl.css create mode 100644 build/follow-me/style-view.css.map create mode 100644 build/follow-me/view.js.map create mode 100644 src/follow-me/render.php diff --git a/.prettierignore b/.prettierignore index cdcf0e0d9..385ee1609 100644 --- a/.prettierignore +++ b/.prettierignore @@ -6,7 +6,6 @@ vendor # Temporary ignores while breaking out each component. assets src/editor-plugin -src/follow-me src/followers src/reactions src/remote-reply diff --git a/build/follow-me/block.json b/build/follow-me/block.json index e799fbb58..2ffb7676a 100644 --- a/build/follow-me/block.json +++ b/build/follow-me/block.json @@ -10,6 +10,7 @@ "icon": "groups", "supports": { "html": false, + "interactivity": true, "color": { "gradients": true, "link": true, @@ -60,9 +61,11 @@ "postId" ], "editorScript": "file:./index.js", - "viewScript": "file:./view.js", - "style": [ - "file:./style-view.css", - "wp-components" - ] + "viewScriptModule": "file:./view.js", + "viewScriptDependencies": [ + "wp-api-fetch", + "wp-i18n" + ], + "style": "file:./style-view.css", + "render": "file:./render.php" } \ No newline at end of file diff --git a/build/follow-me/index.asset.php b/build/follow-me/index.asset.php index 486313470..1e638f83f 100644 --- a/build/follow-me/index.asset.php +++ b/build/follow-me/index.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '8f1a6f7e5f76d58a3204'); + array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'faa65c23487cda14a94f'); diff --git a/build/follow-me/index.js b/build/follow-me/index.js index e6dae5591..3dfc1288b 100644 --- a/build/follow-me/index.js +++ b/build/follow-me/index.js @@ -1,3 +1,2 @@ -(()=>{"use strict";var e,t={919:(e,t,o)=>{const r=window.wp.blocks,n=window.wp.primitives;var l=o(848);const a=(0,l.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(n.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})});var i=o(609);const c=window.wp.blockEditor,u=window.wp.i18n,s=window.wp.data,p=window.wp.coreData,d=window.wp.components,m=window.wp.element;function v(){return window._activityPubOptions||{}}const b=window.wp.apiFetch;var f=o.n(b);function y(e){return`var(--wp--preset--color--${e})`}function _(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|");return y(t)}function h(e,t,o=null,r=""){return o?`${e}${r} { ${t}: ${o}; }\n`:""}function w(e,t,o,r){return h(e,"background-color",t)+h(e,"color",o)+h(e,"background-color",r,":hover")+h(e,"background-color",r,":focus")}function g({selector:e,style:t,backgroundColor:o}){const r=function(e,t,o){const r=`${e} .components-button`,n=("string"==typeof(l=o)?y(l):l?.color?.background||null)||t?.color?.background;var l;return w(r,_(t?.elements?.link?.color?.text),n,_(t?.elements?.link?.[":hover"]?.color?.text))}(e,t,o);return(0,i.createElement)("style",null,r)}const E=(0,l.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})}),x=(0,l.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(n.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})}),S=(0,m.forwardRef)((function({icon:e,size:t=24,...o},r){return(0,m.cloneElement)(e,{width:t,height:t,...o,ref:r})})),k=window.wp.compose,C="fediverse-remote-user";function O(e){try{return new URL(e),!0}catch(e){return!1}}function T({actionText:e,copyDescription:t,handle:o,resourceUrl:r,myProfile:n="",rememberProfile:l=!1}){const c=(0,u.__)("Loading...","activitypub"),s=(0,u.__)("Opening...","activitypub"),p=(0,u.__)("Error","activitypub"),v=(0,u.__)("Invalid","activitypub"),b=n||(0,u.__)("My Profile","activitypub"),[y,_]=(0,m.useState)(e),[h,w]=(0,m.useState)(E),g=(0,k.useCopyToClipboard)(o,(()=>{w(x),setTimeout((()=>w(E)),1e3)})),[T,N]=(0,m.useState)(""),[I,R]=(0,m.useState)(!0),{setRemoteUser:U}=function(){const[e,t]=(0,m.useState)(function(){const e=localStorage.getItem(C);return e?JSON.parse(e):{}}()),o=(0,m.useCallback)((e=>{!function(e){localStorage.setItem(C,JSON.stringify(e))}(e),t(e)}),[]),r=(0,m.useCallback)((()=>{localStorage.removeItem(C),t({})}),[]);return{template:e?.template||!1,profileURL:e?.profileURL||!1,setRemoteUser:o,deleteRemoteUser:r}}(),z=(0,m.useCallback)((()=>{let t;if(!O(T)&&!function(e){const t=e.replace(/^@/,"").split("@");return 2===t.length&&O(`https://${t[1]}`)}(T))return _(v),t=setTimeout((()=>_(e)),2e3),()=>clearTimeout(t);const o=r+T;_(c),f()({path:o}).then((({url:t,template:o})=>{I&&U({profileURL:T,template:o}),_(s),setTimeout((()=>{window.open(t,"_blank"),_(e)}),200)})).catch((()=>{_(p),setTimeout((()=>_(e)),2e3)}))}),[T]);return(0,i.createElement)("div",{className:"activitypub__dialog",role:"dialog","aria-labelledby":"dialog-title"},(0,i.createElement)("div",{className:"activitypub-dialog__section"},(0,i.createElement)("h4",{id:"dialog-title"},b),(0,i.createElement)("div",{className:"activitypub-dialog__description",id:"copy-description"},t),(0,i.createElement)("div",{className:"activitypub-dialog__button-group"},(0,i.createElement)("label",{htmlFor:"profile-handle",className:"screen-reader-text"},t),(0,i.createElement)("input",{type:"text",id:"profile-handle",value:o,readOnly:!0}),(0,i.createElement)(d.Button,{ref:g,"aria-label":(0,u.__)("Copy handle to clipboard","activitypub")},(0,i.createElement)(S,{icon:h}),(0,u.__)("Copy","activitypub")))),(0,i.createElement)("div",{className:"activitypub-dialog__section"},(0,i.createElement)("h4",{id:"remote-profile-title"},(0,u.__)("Your Profile","activitypub")),(0,i.createElement)("div",{className:"activitypub-dialog__description",id:"remote-profile-description"},(0,m.createInterpolateElement)((0,u.__)("Or, if you know your own profile, we can start things that way! (eg @yourusername@example.com)","activitypub"),{code:(0,i.createElement)("code",null)})),(0,i.createElement)("div",{className:"activitypub-dialog__button-group"},(0,i.createElement)("label",{htmlFor:"remote-profile",className:"screen-reader-text"},(0,u.__)("Enter your ActivityPub profile","activitypub")),(0,i.createElement)("input",{type:"text",id:"remote-profile",value:T,onKeyDown:e=>{"Enter"===e?.code&&z()},onChange:e=>N(e.target.value),"aria-invalid":y===v}),(0,i.createElement)(d.Button,{onClick:z,"aria-label":(0,u.__)("Submit profile","activitypub")},(0,i.createElement)(S,{icon:a}),y)),l&&(0,i.createElement)("div",{className:"activitypub-dialog__remember"},(0,i.createElement)(d.CheckboxControl,{checked:I,label:(0,u.__)("Remember me for easier comments","activitypub"),onChange:()=>{R(!I)}}))))}const N={avatar:"",webfinger:"@well@hello.dolly",name:(0,u.__)("Hello Dolly Fan Account","activitypub"),url:"#"};function I(e){if(!e)return N;const t={...N,...e};return t.avatar=t?.icon?.url,t}function R({profile:e,popupStyles:t,userId:o,buttonText:r,buttonOnly:n,buttonSize:l}){const{webfinger:a,avatar:c,name:u}=e,s=a.startsWith("@")?a:`@${a}`;return n?(0,i.createElement)("div",{className:"activitypub-profile"},(0,i.createElement)(U,{profile:e,popupStyles:t,userId:o,buttonText:r,buttonSize:l})):(0,i.createElement)("div",{className:"activitypub-profile"},(0,i.createElement)("img",{className:"activitypub-profile__avatar",src:c,alt:u}),(0,i.createElement)("div",{className:"activitypub-profile__content"},(0,i.createElement)("div",{className:"activitypub-profile__name"},u),(0,i.createElement)("div",{className:"activitypub-profile__handle",title:s},s)),(0,i.createElement)(U,{profile:e,popupStyles:t,userId:o,buttonText:r,buttonSize:l}))}function U({profile:e,popupStyles:t,userId:o,buttonText:r,buttonSize:n}){const[l,a]=(0,m.useState)(!1),c=(0,u.sprintf)(/* translators: %s: profile name */ /* translators: %s: profile name */ -(0,u.__)("Follow %s","activitypub"),e?.name);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(d.Button,{className:"activitypub-profile__follow",onClick:()=>a(!0),"aria-haspopup":"dialog","aria-expanded":l,"aria-label":(0,u.__)("Follow me on the Fediverse","activitypub"),size:n},r),l&&(0,i.createElement)(d.Modal,{className:"activitypub-profile__confirm activitypub__modal",onRequestClose:()=>a(!1),title:c,"aria-label":c,role:"dialog"},(0,i.createElement)(z,{profile:e,userId:o}),(0,i.createElement)("style",null,t)))}function z({profile:e,userId:t}){const{namespace:o}=v(),{webfinger:r}=e,n=(0,u.__)("Follow","activitypub"),l=`/${o}/actors/${t}/remote-follow?resource=`,a=(0,u.__)("Copy and paste my profile into the search field of your favorite fediverse app or server.","activitypub"),c=r.startsWith("@")?r:`@${r}`;return(0,i.createElement)(T,{actionText:n,copyDescription:a,handle:c,resourceUrl:l})}function $({selectedUser:e,style:t,backgroundColor:o,id:r,useId:n=!1,profileData:l=!1,buttonOnly:a=!1,buttonText:c=(0,u.__)("Follow","activitypub"),buttonSize:s="default"}){const[p,d]=(0,m.useState)(I()),b="site"===e?0:e,y=function(e){return w(".apfmd__button-group .components-button",_(e?.elements?.link?.color?.text)||"#111","#fff",_(e?.elements?.link?.[":hover"]?.color?.text)||"#333")}(t),h=n?{id:r}:{};return(0,m.useEffect)((()=>{l?d(I(l)):function(e){const{namespace:t}=v(),o={headers:{Accept:"application/activity+json"},path:`/${t}/actors/${e}`};return f()(o)}(b).then((e=>{d(I(e))}))}),[b,l]),(0,i.createElement)("div",{...h,className:"activitypub-follow-me-block-wrapper"},(0,i.createElement)(g,{selector:`#${r}`,style:t,backgroundColor:o}),(0,i.createElement)(R,{profile:p,userId:b,popupStyles:y,buttonText:c,buttonOnly:a,buttonSize:s}))}function P({name:e}){const{enabled:t}=v(),o=t?.site?"":(0,u.__)("It will be empty in other non-author contexts.","activitypub"),r=(0,u.sprintf)(/* translators: %1$s: block name, %2$s: extra information for non-author context */ /* translators: %1$s: block name, %2$s: extra information for non-author context */ -(0,u.__)("This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s","activitypub"),e,o).trim();return(0,i.createElement)(d.Card,null,(0,i.createElement)(d.CardBody,null,(0,m.createInterpolateElement)(r,{strong:(0,i.createElement)("strong",null)})))}(0,r.registerBlockType)("activitypub/follow-me",{edit:function({attributes:e,setAttributes:t,context:{postType:o,postId:r}}){const n=(0,c.useBlockProps)({className:"activitypub-follow-me-block-wrapper"}),l=function({withInherit:e=!1}){const{enabled:t}=v(),o=t?.users?(0,s.useSelect)((e=>e("core").getUsers({who:"authors"}))):[];return(0,m.useMemo)((()=>{if(!o)return[];const r=[];return t?.site&&r.push({label:(0,u.__)("Site","activitypub"),value:"site"}),e&&t?.users&&r.push({label:(0,u.__)("Dynamic User","activitypub"),value:"inherit"}),o.reduce(((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e)),r)}),[o])}({withInherit:!0}),{selectedUser:a,buttonOnly:b,buttonText:f,buttonSize:y}=e,_="inherit"===a,h=(0,s.useSelect)((e=>{const{getEditedEntityRecord:t}=e(p.store),n=t("postType",o,r)?.author;return null!=n?n:null}),[o,r]);return(0,m.useEffect)((()=>{l.length&&(l.find((({value:e})=>e===a))||t({selectedUser:l[0].value}))}),[a,l]),(0,i.createElement)("div",{...n},(0,i.createElement)(c.InspectorControls,{key:"activitypub-follow-me"},(0,i.createElement)(d.PanelBody,{title:(0,u.__)("Follow Me Options","activitypub")},l.length>1&&(0,i.createElement)(d.SelectControl,{label:(0,u.__)("Select User","activitypub"),value:e.selectedUser,options:l,onChange:e=>t({selectedUser:e})}),(0,i.createElement)(d.ToggleControl,{label:(0,u.__)("Button Only Mode","activitypub"),checked:b,onChange:e=>t({buttonOnly:e}),help:(0,u.__)("Only show the follow button without profile information","activitypub")}),(0,i.createElement)(d.TextControl,{label:(0,u.__)("Button Text","activitypub"),value:f,onChange:e=>t({buttonText:e})}),(0,i.createElement)(d.SelectControl,{label:(0,u.__)("Button Size","activitypub"),value:y,options:[{label:(0,u.__)("Default","activitypub"),value:"default"},{label:(0,u.__)("Compact","activitypub"),value:"compact"},{label:(0,u.__)("Small","activitypub"),value:"small"}],onChange:e=>t({buttonSize:e}),help:(0,u.__)("Choose the size of the follow button","activitypub")}))),_?h?(0,i.createElement)($,{...e,id:n.id,selectedUser:h}):(0,i.createElement)(P,{name:(0,u.__)("Follow Me","activitypub")}):(0,i.createElement)($,{...e,id:n.id}))},save:()=>null,icon:a})},20:(e,t,o)=>{var r=o(609),n=Symbol.for("react.element"),l=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,o){var r,c={},u=null,s=null;for(r in void 0!==o&&(u=""+o),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(s=t.ref),t)l.call(t,r)&&!i.hasOwnProperty(r)&&(c[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===c[r]&&(c[r]=t[r]);return{$$typeof:n,type:e,key:u,ref:s,props:c,_owner:a.current}}},848:(e,t,o)=>{e.exports=o(20)},609:e=>{e.exports=window.React}},o={};function r(e){var n=o[e];if(void 0!==n)return n.exports;var l=o[e]={exports:{}};return t[e](l,l.exports,r),l.exports}r.m=t,e=[],r.O=(t,o,n,l)=>{if(!o){var a=1/0;for(s=0;s=l)&&Object.keys(r.O).every((e=>r.O[e](o[c])))?o.splice(c--,1):(i=!1,l0&&e[s-1][2]>l;s--)e[s]=e[s-1];e[s]=[o,n,l]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={338:0,301:0};r.O.j=t=>0===e[t];var t=(t,o)=>{var n,l,a=o[0],i=o[1],c=o[2],u=0;if(a.some((t=>0!==e[t]))){for(n in i)r.o(i,n)&&(r.m[n]=i[n]);if(c)var s=c(r)}for(t&&t(o);ur(919)));n=r.O(n)})(); \ No newline at end of file +(()=>{"use strict";var e={20:(e,t,o)=>{var n=o(609),a=Symbol.for("react.element"),l=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),r=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,o){var n,c={},s=null,u=null;for(n in void 0!==o&&(s=""+o),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,n)&&!i.hasOwnProperty(n)&&(c[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===c[n]&&(c[n]=t[n]);return{$$typeof:a,type:e,key:s,ref:u,props:c,_owner:r.current}}},848:(e,t,o)=>{e.exports=o(20)},609:e=>{e.exports=window.React}},t={};function o(n){var a=t[n];if(void 0!==a)return a.exports;var l=t[n]={exports:{}};return e[n](l,l.exports,o),l.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const n=window.wp.blocks,a=window.wp.primitives;var l=o(848);const r=(0,l.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(a.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})});var i=o(609);const c=window.wp.blockEditor,s=window.wp.i18n,u=window.wp.data,p=window.wp.coreData,v=window.wp.components,b=window.wp.element;function m(){return window._activityPubOptions||{}}function d({name:e}){const{enabled:t}=m(),o=t?.site?"":(0,s.__)("It will be empty in other non-author contexts.","activitypub"),n=(0,s.sprintf)(/* translators: %1$s: block name, %2$s: extra information for non-author context */ /* translators: %1$s: block name, %2$s: extra information for non-author context */ +(0,s.__)("This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s","activitypub"),e,o).trim();return(0,i.createElement)(v.Card,null,(0,i.createElement)(v.CardBody,null,(0,b.createInterpolateElement)(n,{strong:(0,i.createElement)("strong",null)})))}const y=window.wp.apiFetch;var _=o.n(y);const f={avatar:"https://secure.gravatar.com/avatar/default?s=120",webfinger:"@well@hello.dolly",name:(0,s.__)("Hello Dolly Fan Account","activitypub"),url:"#"};function w(e){if(!e)return f;const t={...f,...e};return t.avatar=t?.icon?.url,t}function h({profile:e,userId:t,buttonText:o,buttonOnly:n,buttonSize:a}){const{webfinger:l,avatar:r,name:c}=e,s=l.startsWith("@")?l:`@${l}`;return n?(0,i.createElement)("div",{className:"activitypub-profile"},(0,i.createElement)("button",{className:"activitypub-profile__follow components-button is-primary",size:a},o)):(0,i.createElement)("div",{className:"activitypub-profile"},(0,i.createElement)("img",{className:"activitypub-profile__avatar",src:r,alt:c}),(0,i.createElement)("div",{className:"activitypub-profile__content"},(0,i.createElement)("div",{className:"activitypub-profile__name"},c),(0,i.createElement)("div",{className:"activitypub-profile__handle",title:s},s)),(0,i.createElement)("button",{className:"activitypub-profile__follow components-button is-primary",size:a},o))}(0,n.registerBlockType)("activitypub/follow-me",{edit:function({attributes:e,setAttributes:t,context:{postType:o,postId:n}}){const a=(0,c.useBlockProps)({className:"activitypub-follow-me-block-wrapper"}),l=function({withInherit:e=!1}){const{enabled:t}=m(),o=t?.users?(0,u.useSelect)((e=>e("core").getUsers({who:"authors"}))):[];return(0,b.useMemo)((()=>{if(!o)return[];const n=[];return t?.site&&n.push({label:(0,s.__)("Site","activitypub"),value:"site"}),e&&t?.users&&n.push({label:(0,s.__)("Dynamic User","activitypub"),value:"inherit"}),o.reduce(((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e)),n)}),[o])}({withInherit:!0}),{selectedUser:r,buttonOnly:y,buttonText:f,buttonSize:E}=e,g="inherit"===r,[x,O]=(0,b.useState)(w()),S="site"===r?0:r,C=(0,u.useSelect)((e=>{const{getEditedEntityRecord:t}=e(p.store),a=t("postType",o,n)?.author;return null!=a?a:null}),[o,n]);return(0,b.useEffect)((()=>{g&&!C||function(e){const{namespace:t}=m(),o={headers:{Accept:"application/activity+json"},path:`/${t}/actors/${e}`};return _()(o)}(g?C:S).then((e=>{O(w(e))}))}),[S,C,g]),(0,b.useEffect)((()=>{l.length&&(l.find((({value:e})=>e===r))||t({selectedUser:l[0].value}))}),[r,l]),(0,i.createElement)("div",{...a},(0,i.createElement)(c.InspectorControls,{key:"activitypub-follow-me"},(0,i.createElement)(v.PanelBody,{title:(0,s.__)("Follow Me Options","activitypub")},l.length>1&&(0,i.createElement)(v.SelectControl,{label:(0,s.__)("Select User","activitypub"),value:e.selectedUser,options:l,onChange:e=>t({selectedUser:e})}),(0,i.createElement)(v.ToggleControl,{label:(0,s.__)("Button Only Mode","activitypub"),checked:y,onChange:e=>t({buttonOnly:e}),help:(0,s.__)("Only show the follow button without profile information","activitypub")}),(0,i.createElement)(v.TextControl,{label:(0,s.__)("Button Text","activitypub"),value:f,onChange:e=>t({buttonText:e})}),(0,i.createElement)(v.SelectControl,{label:(0,s.__)("Button Size","activitypub"),value:E,options:[{label:(0,s.__)("Default","activitypub"),value:"default"},{label:(0,s.__)("Compact","activitypub"),value:"compact"},{label:(0,s.__)("Small","activitypub"),value:"small"}],onChange:e=>t({buttonSize:e}),help:(0,s.__)("Choose the size of the follow button","activitypub")}))),g&&!C?(0,i.createElement)(d,{name:(0,s.__)("Follow Me","activitypub")}):(0,i.createElement)(h,{profile:x,userId:g?C:S,buttonText:f,buttonOnly:y,buttonSize:E}))},icon:r,save:()=>null})})(); \ No newline at end of file diff --git a/build/follow-me/index.js.map b/build/follow-me/index.js.map new file mode 100644 index 000000000..c05f010ed --- /dev/null +++ b/build/follow-me/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"follow-me/index.js","mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACkD;AACF;AAChD,4BAA4B,sDAAI,CAAC,sDAAG;AACpC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA;AACA,GAAG;AACH,CAAC;AACD,iEAAe,MAAM,EAAC;AACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACd2E;AACtC;AACO;AACc;AACmC;AACjC;AACH;AACmB;AAChC;AACO;;AAEnD;AACA;AACA;AACA;AACA;AACA,MAAMgB,oBAAoB,GAAG;EAC5BC,MAAM,EAAE,kDAAkD;EAC1DC,SAAS,EAAE,mBAAmB;EAC9BC,IAAI,EAAEjB,mDAAE,CAAE,yBAAyB,EAAE,aAAc,CAAC;EACpDkB,GAAG,EAAE;AACN,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,oBAAoBA,CAAEC,OAAO,EAAG;EACxC,IAAK,CAAEA,OAAO,EAAG;IAChB,OAAON,oBAAoB;EAC5B;EACA,MAAMO,IAAI,GAAG;IAAE,GAAGP,oBAAoB;IAAE,GAAGM;EAAQ,CAAC;EACpDC,IAAI,CAACN,MAAM,GAAGM,IAAI,EAAEC,IAAI,EAAEJ,GA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IAAI;;;AAGJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;;AAGF;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,sBAAsB;AACtB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,iCAAiC;AACjC;AACA,SAAS;AACT,2BAA2B;AAC3B;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;;AAE3D;AACA;;AAEA;AACA,yDAAyD;AACzD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA,gFAAgF;AAChF;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;;;AAGlB;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA,IAAI;;;AAGJ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2HAA2H;AAC3H;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA,oEAAoE;;AAEpE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC;;AAEjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,eAAe;AAC1B,WAAW,GAAG;AACd,WAAW,GAAG;AACd;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;;AAER;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;;AAEA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA,oBAAoB;AACpB,2DAA2D,UAAU;AACrE,yBAAyB,UAAU;AACnC;AACA,aAAa,UAAU;AACvB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,YAAY,SAAS;AACrB;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,6DAA6D;AAC7D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,iBAAiB;AACvC;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN,4CAA4C;;AAE5C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,8CAA8C;AAC9C;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA,0DAA0D;AAC1D;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,gDAAgD,gDAAgD,MAAM,aAAa;;AAEnH;AACA,iDAAiD,kCAAkC,OAAO;;AAE1F,yGAAyG,cAAc,UAAU,gGAAgG,kBAAkB,UAAU,UAAU;;AAEvQ;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;AACtC;;AAEA;;AAEA,gBAAgB;AAChB,WAAW;AACX,YAAY;AACZ,GAAG;AACH;;;;;;;;;;;ACpzCa;;AAEb,IAAI,KAAqC,EAAE,EAE1C,CAAC;AACF,EAAE,+IAAkE;AACpE;;;;;;;;;;;ACNA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;ACNsD;AACZ;AAChB;;AAE1B;AACAS,oEAAiB,CAAC,uBAAuB,EAAE;EACvCE,IAAI;EACJxE,IAAI,EAAEuE,wDAAM;EACZE,IAAI,EAAEA,CAAA,KAAM;AAChB,CAAC,CAAC,C","sources":["webpack://wordpress-activitypub/./node_modules/@wordpress/icons/build-module/library/people.js","webpack://wordpress-activitypub/./src/follow-me/edit.js","webpack://wordpress-activitypub/./src/shared/inherit-block-fallback.js","webpack://wordpress-activitypub/./src/shared/use-options.js","webpack://wordpress-activitypub/./src/shared/use-user-options.js","webpack://wordpress-activitypub/./node_modules/react/cjs/react-jsx-runtime.development.js","webpack://wordpress-activitypub/./node_modules/react/jsx-runtime.js","webpack://wordpress-activitypub/external window \"React\"","webpack://wordpress-activitypub/external window [\"wp\",\"apiFetch\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blockEditor\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blocks\"]","webpack://wordpress-activitypub/external window [\"wp\",\"components\"]","webpack://wordpress-activitypub/external window [\"wp\",\"coreData\"]","webpack://wordpress-activitypub/external window [\"wp\",\"data\"]","webpack://wordpress-activitypub/external window [\"wp\",\"element\"]","webpack://wordpress-activitypub/external window [\"wp\",\"i18n\"]","webpack://wordpress-activitypub/external window [\"wp\",\"primitives\"]","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/compat get default export","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/./src/follow-me/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst people = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z\",\n fillRule: \"evenodd\"\n })\n});\nexport default people;\n//# sourceMappingURL=people.js.map","import { InspectorControls, useBlockProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { SelectControl, PanelBody, ToggleControl, TextControl } from '@wordpress/components';\nimport { useUserOptions } from '../shared/use-user-options';\nimport { useEffect, useState } from '@wordpress/element';\nimport { InheritModeBlockFallback } from '../shared/inherit-block-fallback';\nimport apiFetch from '@wordpress/api-fetch';\nimport { useOptions } from '../shared/use-options';\n\n/**\n * Default profile data.\n *\n * @type {Object}\n */\nconst DEFAULT_PROFILE_DATA = {\n\tavatar: 'https://secure.gravatar.com/avatar/default?s=120',\n\twebfinger: '@well@hello.dolly',\n\tname: __( 'Hello Dolly Fan Account', 'activitypub' ),\n\turl: '#',\n};\n\n/**\n * Get normalized profile data.\n *\n * @param {Object} profile Profile data.\n * @return {Object} Normalized profile data.\n */\nfunction getNormalizedProfile( profile ) {\n\tif ( ! profile ) {\n\t\treturn DEFAULT_PROFILE_DATA;\n\t}\n\tconst data = { ...DEFAULT_PROFILE_DATA, ...profile };\n\tdata.avatar = data?.icon?.url;\n\treturn data;\n}\n\n/**\n * Fetch profile data.\n *\n * @param {number} userId User ID.\n * @return {Promise} Promise resolving with profile data.\n */\nfunction fetchProfile( userId ) {\n\tconst { namespace } = useOptions();\n\tconst fetchOptions = {\n\t\theaders: { Accept: 'application/activity+json' },\n\t\tpath: `/${ namespace }/actors/${ userId }`,\n\t};\n\treturn apiFetch( fetchOptions );\n}\n\n/**\n * Profile component for the editor.\n *\n * @param {Object} props Component props.\n * @return {JSX.Element} Profile component.\n */\nfunction EditorProfile({ profile, userId, buttonText, buttonOnly, buttonSize }) {\n\tconst { webfinger, avatar, name } = profile;\n\tconst webfingerWithAt = webfinger.startsWith('@') ? webfinger : `@${webfinger}`;\n\n\tif (buttonOnly) {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t);\n\t}\n\n\treturn (\n\t\t
\n\t\t\t{name}\n\t\t\t
\n\t\t\t\t
{name}
\n\t\t\t\t
{webfingerWithAt}
\n\t\t\t
\n\t\t\t\n\t\t
\n\t);\n}\n\n/**\n * Edit component.\n *\n * @param {Object} props Component props.\n * @param {Object} props.attributes Block attributes.\n * @param {Function} props.setAttributes Set block attributes.\n * @param {Object} props.context Block context.\n * @param {string} props.context.postType Post type.\n * @param {number} props.context.postId Post ID.\n * @return {JSX.Element} Edit component.\n */\nexport default function Edit( {\n\tattributes,\n\tsetAttributes,\n\tcontext: {\n\t\tpostType,\n\t\tpostId,\n\t},\n} ) {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'activitypub-follow-me-block-wrapper',\n\t} );\n\tconst usersOptions = useUserOptions( { withInherit: true } );\n\tconst { selectedUser, buttonOnly, buttonText, buttonSize } = attributes;\n\tconst isInheritMode = selectedUser === 'inherit';\n\tconst [profile, setProfile] = useState(getNormalizedProfile());\n\tconst userId = selectedUser === 'site' ? 0 : selectedUser;\n\n\tconst authorId = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t)?.author;\n\n\t\t\treturn _authorId ?? null;\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tuseEffect(() => {\n\t\t// Fetch profile data when userId changes\n\t\tif (isInheritMode && !authorId) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst effectiveUserId = isInheritMode ? authorId : userId;\n\t\tfetchProfile(effectiveUserId).then((data) => {\n\t\t\tsetProfile(getNormalizedProfile(data));\n\t\t});\n\t}, [userId, authorId, isInheritMode]);\n\n\tuseEffect( () => {\n\t\t// if there are no users yet, do nothing\n\t\tif ( ! usersOptions.length ) {\n\t\t\treturn;\n\t\t}\n\t\t// ensure that the selected user is in the list of options, if not, select the first available user\n\t\tif ( ! usersOptions.find( ( { value } ) => value === selectedUser ) ) {\n\t\t\tsetAttributes( { selectedUser: usersOptions[ 0 ].value } );\n\t\t}\n\t}, [ selectedUser, usersOptions ] );\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{ usersOptions.length > 1 && (\n\t\t\t\t\t\t setAttributes( { selectedUser: value } ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t setAttributes( { buttonOnly: value } ) }\n\t\t\t\t\t\thelp={ __( 'Only show the follow button without profile information', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t setAttributes( { buttonText: value } ) }\n\t\t\t\t\t/>\n\t\t\t\t\t setAttributes( { buttonSize: value } ) }\n\t\t\t\t\t\thelp={ __( 'Choose the size of the follow button', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\n\t\t\t{isInheritMode && !authorId ? (\n\t\t\t\t\n\t\t\t) : (\n\t\t\t\t\n\t\t\t)}\n\t\t
\n\t);\n}\n","import { Card, CardBody } from '@wordpress/components';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\nexport function InheritModeBlockFallback( { name } ) {\n\tconst { enabled } = useOptions();\n\tconst nonAuthorExtra = enabled?.site ? '' : __( 'It will be empty in other non-author contexts.', 'activitypub' );\n\tconst text = sprintf(\n\t\t/* translators: %1$s: block name, %2$s: extra information for non-author context */\n\t\t__( 'This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s', 'activitypub' ),\n\t\tname,\n\t\tnonAuthorExtra\n\t).trim();\n\n\treturn (\n\t\t\n\t\t\t{ createInterpolateElement( text, { strong: } ) }\n\t\t\n\t);\n}\n","/**\n * Returns the ActivityPub options object.\n *\n * @return {Object} The options object.\n */\nexport function useOptions() {\n\treturn window._activityPubOptions || {};\n}\n","import { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\nexport function useUserOptions( { withInherit = false } ) {\n\tconst { enabled } = useOptions();\n\tconst users = enabled?.users ? useSelect( ( select ) => select( 'core' ).getUsers( { who: 'authors' } ) ) : [];\n\treturn useMemo( () => {\n\t\tif ( ! users ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst userKeywords = [];\n\n\t\tif ( enabled?.site ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Site', 'activitypub' ),\n\t\t\t\tvalue: 'site'\n\t\t\t} );\n\t\t}\n\n\t\t// Only show inherit option when explicitly asked for and users are enabled.\n\t\tif ( withInherit && enabled?.users ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Dynamic User', 'activitypub' ),\n\t\t\t\tvalue: 'inherit'\n\t\t\t} );\n\t\t}\n\n\t\treturn users.reduce( ( acc, user ) => {\n\t\t\tacc.push({\n\t\t\t\tlabel: user.name,\n\t\t\t\tvalue: `${ user.id }` // casting to string because that's how the attribute is stored by Gutenberg\n\t\t\t} );\n\t\t\treturn acc;\n\t\t}, userKeywords );\n\t}, [ users ] );\n}","/**\n * @license React\n * react-jsx-runtime.development.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\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'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","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","// 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\t// no module.id needed\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport { people } from '@wordpress/icons';\nimport edit from './edit';\n\n// Register the block\nregisterBlockType('activitypub/follow-me', {\n edit,\n icon: people,\n save: () => null\n});\n"],"names":["InspectorControls","useBlockProps","__","useSelect","store","coreStore","SelectControl","PanelBody","ToggleControl","TextControl","useUserOptions","useEffect","useState","InheritModeBlockFallback","apiFetch","useOptions","DEFAULT_PROFILE_DATA","avatar","webfinger","name","url","getNormalizedProfile","profile","data","icon","fetchProfile","userId","namespace","fetchOptions","headers","Accept","path","EditorProfile","buttonText","buttonOnly","buttonSize","webfingerWithAt","startsWith","createElement","className","size","src","alt","title","Edit","attributes","setAttributes","context","postType","postId","blockProps","usersOptions","withInherit","selectedUser","isInheritMode","setProfile","authorId","select","getEditedEntityRecord","_authorId","author","effectiveUserId","then","length","find","value","key","label","options","onChange","checked","help","Card","CardBody","sprintf","createInterpolateElement","enabled","nonAuthorExtra","site","text","trim","strong","window","_activityPubOptions","useMemo","users","getUsers","who","userKeywords","push","reduce","acc","user","id","registerBlockType","people","edit","save"],"sourceRoot":""} \ No newline at end of file diff --git a/build/follow-me/render.php b/build/follow-me/render.php new file mode 100644 index 000000000..e5e4ce1cf --- /dev/null +++ b/build/follow-me/render.php @@ -0,0 +1,196 @@ + array( + 'loading' => true, + 'data' => array( + 'avatar' => 'https://secure.gravatar.com/avatar/default?s=120', + 'webfinger' => '@well@hello.dolly', + 'name' => __( 'Hello Dolly Fan Account', 'activitypub' ), + 'url' => '#', + ), + ), + 'userId' => $user_id, + 'namespace' => ACTIVITYPUB_REST_NAMESPACE, + 'buttonOnly' => $button_only, + 'buttonText' => $button_text, + 'buttonSize' => $button_size, + 'buttonStyle' => $button_style, + 'backgroundColor' => $background_color, + ) +); + +// Add the block wrapper attributes. +$wrapper_attributes = get_block_wrapper_attributes( + array( + 'id' => $block_id, + 'class' => 'activitypub-follow-me-block-wrapper', + 'data-wp-interactive' => 'activitypub/follow-me', + 'data-wp-init' => 'callbacks.init', + 'data-wp-on-document--keydown' => 'callbacks.documentKeydown', + 'data-wp-on-document--click' => 'callbacks.documentClick', + ) +); + +$wrapper_context = wp_interactivity_data_wp_context( + array( + 'blockId' => $block_id, + 'isModalOpen' => false, + 'remoteProfile' => '', + 'isLoading' => false, + 'isError' => false, + 'errorMessage' => '', + 'copyButtonText' => __( 'Copy', 'activitypub' ), + ) +); + +?> +
+ +> +
+ + +
+
+
+
+ + + +
+ + + +
+ array('react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '635ed3e6db3230ae865f'); + array('@wordpress/interactivity'), 'version' => '45aca98e705f802dbd94', 'type' => 'module'); diff --git a/build/follow-me/view.js b/build/follow-me/view.js index fd9c268ee..0146ce54e 100644 --- a/build/follow-me/view.js +++ b/build/follow-me/view.js @@ -1,2 +1 @@ -(()=>{"use strict";var e,t={5:(e,t,r)=>{var o=r(609);const a=window.wp.element,n=window.wp.domReady;var i=r.n(n);const l=window.wp.apiFetch;var c=r.n(l);const u=window.wp.components,s=window.wp.i18n;function p(e){return`var(--wp--preset--color--${e})`}function m(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|");return p(t)}function d(e,t,r=null,o=""){return r?`${e}${o} { ${t}: ${r}; }\n`:""}function v(e,t,r,o){return d(e,"background-color",t)+d(e,"color",r)+d(e,"background-color",o,":hover")+d(e,"background-color",o,":focus")}function f({selector:e,style:t,backgroundColor:r}){const a=function(e,t,r){const o=`${e} .components-button`,a=("string"==typeof(n=r)?p(n):n?.color?.background||null)||t?.color?.background;var n;return v(o,m(t?.elements?.link?.color?.text),a,m(t?.elements?.link?.[":hover"]?.color?.text))}(e,t,r);return(0,o.createElement)("style",null,a)}const b=window.wp.primitives;var y=r(848);const _=(0,y.jsx)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,y.jsx)(b.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})}),w=(0,y.jsx)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,y.jsx)(b.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})}),h=(0,a.forwardRef)((function({icon:e,size:t=24,...r},o){return(0,a.cloneElement)(e,{width:t,height:t,...r,ref:o})})),g=(0,y.jsx)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,y.jsx)(b.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})}),E=window.wp.compose,x="fediverse-remote-user";function S(e){try{return new URL(e),!0}catch(e){return!1}}function k({actionText:e,copyDescription:t,handle:r,resourceUrl:n,myProfile:i="",rememberProfile:l=!1}){const p=(0,s.__)("Loading...","activitypub"),m=(0,s.__)("Opening...","activitypub"),d=(0,s.__)("Error","activitypub"),v=(0,s.__)("Invalid","activitypub"),f=i||(0,s.__)("My Profile","activitypub"),[b,y]=(0,a.useState)(e),[k,O]=(0,a.useState)(_),N=(0,E.useCopyToClipboard)(r,(()=>{O(w),setTimeout((()=>O(_)),1e3)})),[C,R]=(0,a.useState)(""),[I,T]=(0,a.useState)(!0),{setRemoteUser:$}=function(){const[e,t]=(0,a.useState)(function(){const e=localStorage.getItem(x);return e?JSON.parse(e):{}}()),r=(0,a.useCallback)((e=>{!function(e){localStorage.setItem(x,JSON.stringify(e))}(e),t(e)}),[]),o=(0,a.useCallback)((()=>{localStorage.removeItem(x),t({})}),[]);return{template:e?.template||!1,profileURL:e?.profileURL||!1,setRemoteUser:r,deleteRemoteUser:o}}(),z=(0,a.useCallback)((()=>{let t;if(!S(C)&&!function(e){const t=e.replace(/^@/,"").split("@");return 2===t.length&&S(`https://${t[1]}`)}(C))return y(v),t=setTimeout((()=>y(e)),2e3),()=>clearTimeout(t);const r=n+C;y(p),c()({path:r}).then((({url:t,template:r})=>{I&&$({profileURL:C,template:r}),y(m),setTimeout((()=>{window.open(t,"_blank"),y(e)}),200)})).catch((()=>{y(d),setTimeout((()=>y(e)),2e3)}))}),[C]);return(0,o.createElement)("div",{className:"activitypub__dialog",role:"dialog","aria-labelledby":"dialog-title"},(0,o.createElement)("div",{className:"activitypub-dialog__section"},(0,o.createElement)("h4",{id:"dialog-title"},f),(0,o.createElement)("div",{className:"activitypub-dialog__description",id:"copy-description"},t),(0,o.createElement)("div",{className:"activitypub-dialog__button-group"},(0,o.createElement)("label",{htmlFor:"profile-handle",className:"screen-reader-text"},t),(0,o.createElement)("input",{type:"text",id:"profile-handle",value:r,readOnly:!0}),(0,o.createElement)(u.Button,{ref:N,"aria-label":(0,s.__)("Copy handle to clipboard","activitypub")},(0,o.createElement)(h,{icon:k}),(0,s.__)("Copy","activitypub")))),(0,o.createElement)("div",{className:"activitypub-dialog__section"},(0,o.createElement)("h4",{id:"remote-profile-title"},(0,s.__)("Your Profile","activitypub")),(0,o.createElement)("div",{className:"activitypub-dialog__description",id:"remote-profile-description"},(0,a.createInterpolateElement)((0,s.__)("Or, if you know your own profile, we can start things that way! (eg @yourusername@example.com)","activitypub"),{code:(0,o.createElement)("code",null)})),(0,o.createElement)("div",{className:"activitypub-dialog__button-group"},(0,o.createElement)("label",{htmlFor:"remote-profile",className:"screen-reader-text"},(0,s.__)("Enter your ActivityPub profile","activitypub")),(0,o.createElement)("input",{type:"text",id:"remote-profile",value:C,onKeyDown:e=>{"Enter"===e?.code&&z()},onChange:e=>R(e.target.value),"aria-invalid":b===v}),(0,o.createElement)(u.Button,{onClick:z,"aria-label":(0,s.__)("Submit profile","activitypub")},(0,o.createElement)(h,{icon:g}),b)),l&&(0,o.createElement)("div",{className:"activitypub-dialog__remember"},(0,o.createElement)(u.CheckboxControl,{checked:I,label:(0,s.__)("Remember me for easier comments","activitypub"),onChange:()=>{T(!I)}}))))}function O(){return window._activityPubOptions||{}}const N={avatar:"",webfinger:"@well@hello.dolly",name:(0,s.__)("Hello Dolly Fan Account","activitypub"),url:"#"};function C(e){if(!e)return N;const t={...N,...e};return t.avatar=t?.icon?.url,t}function R({profile:e,popupStyles:t,userId:r,buttonText:a,buttonOnly:n,buttonSize:i}){const{webfinger:l,avatar:c,name:u}=e,s=l.startsWith("@")?l:`@${l}`;return n?(0,o.createElement)("div",{className:"activitypub-profile"},(0,o.createElement)(I,{profile:e,popupStyles:t,userId:r,buttonText:a,buttonSize:i})):(0,o.createElement)("div",{className:"activitypub-profile"},(0,o.createElement)("img",{className:"activitypub-profile__avatar",src:c,alt:u}),(0,o.createElement)("div",{className:"activitypub-profile__content"},(0,o.createElement)("div",{className:"activitypub-profile__name"},u),(0,o.createElement)("div",{className:"activitypub-profile__handle",title:s},s)),(0,o.createElement)(I,{profile:e,popupStyles:t,userId:r,buttonText:a,buttonSize:i}))}function I({profile:e,popupStyles:t,userId:r,buttonText:n,buttonSize:i}){const[l,c]=(0,a.useState)(!1),p=(0,s.sprintf)(/* translators: %s: profile name */ /* translators: %s: profile name */ -(0,s.__)("Follow %s","activitypub"),e?.name);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(u.Button,{className:"activitypub-profile__follow",onClick:()=>c(!0),"aria-haspopup":"dialog","aria-expanded":l,"aria-label":(0,s.__)("Follow me on the Fediverse","activitypub"),size:i},n),l&&(0,o.createElement)(u.Modal,{className:"activitypub-profile__confirm activitypub__modal",onRequestClose:()=>c(!1),title:p,"aria-label":p,role:"dialog"},(0,o.createElement)(T,{profile:e,userId:r}),(0,o.createElement)("style",null,t)))}function T({profile:e,userId:t}){const{namespace:r}=O(),{webfinger:a}=e,n=(0,s.__)("Follow","activitypub"),i=`/${r}/actors/${t}/remote-follow?resource=`,l=(0,s.__)("Copy and paste my profile into the search field of your favorite fediverse app or server.","activitypub"),c=a.startsWith("@")?a:`@${a}`;return(0,o.createElement)(k,{actionText:n,copyDescription:l,handle:c,resourceUrl:i})}function $({selectedUser:e,style:t,backgroundColor:r,id:n,useId:i=!1,profileData:l=!1,buttonOnly:u=!1,buttonText:p=(0,s.__)("Follow","activitypub"),buttonSize:d="default"}){const[b,y]=(0,a.useState)(C()),_="site"===e?0:e,w=function(e){return v(".apfmd__button-group .components-button",m(e?.elements?.link?.color?.text)||"#111","#fff",m(e?.elements?.link?.[":hover"]?.color?.text)||"#333")}(t),h=i?{id:n}:{};return(0,a.useEffect)((()=>{l?y(C(l)):function(e){const{namespace:t}=O(),r={headers:{Accept:"application/activity+json"},path:`/${t}/actors/${e}`};return c()(r)}(_).then((e=>{y(C(e))}))}),[_,l]),(0,o.createElement)("div",{...h,className:"activitypub-follow-me-block-wrapper"},(0,o.createElement)(f,{selector:`#${n}`,style:t,backgroundColor:r}),(0,o.createElement)(R,{profile:b,userId:_,popupStyles:w,buttonText:p,buttonOnly:u,buttonSize:d}))}let z=1;i()((()=>{[].forEach.call(document.querySelectorAll(".activitypub-follow-me-block-wrapper"),(e=>{const t=JSON.parse(e.dataset.attrs);(0,a.createRoot)(e).render((0,o.createElement)($,{...t,id:"activitypub-follow-me-block-"+z++,useId:!0}))}))}))},20:(e,t,r)=>{var o=r(609),a=Symbol.for("react.element"),n=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,r){var o,c={},u=null,s=null;for(o in void 0!==r&&(u=""+r),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(s=t.ref),t)n.call(t,o)&&!l.hasOwnProperty(o)&&(c[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===c[o]&&(c[o]=t[o]);return{$$typeof:a,type:e,key:u,ref:s,props:c,_owner:i.current}}},848:(e,t,r)=>{e.exports=r(20)},609:e=>{e.exports=window.React}},r={};function o(e){var a=r[e];if(void 0!==a)return a.exports;var n=r[e]={exports:{}};return t[e](n,n.exports,o),n.exports}o.m=t,e=[],o.O=(t,r,a,n)=>{if(!r){var i=1/0;for(s=0;s=n)&&Object.keys(o.O).every((e=>o.O[e](r[c])))?r.splice(c--,1):(l=!1,n0&&e[s-1][2]>n;s--)e[s]=e[s-1];e[s]=[r,a,n]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={41:0,301:0};o.O.j=t=>0===e[t];var t=(t,r)=>{var a,n,i=r[0],l=r[1],c=r[2],u=0;if(i.some((t=>0!==e[t]))){for(a in l)o.o(l,a)&&(o.m[a]=l[a]);if(c)var s=c(o)}for(t&&t(r);uo(5)));a=o.O(a)})(); \ No newline at end of file +import*as e from"@wordpress/interactivity";var t,o,r={825:(t,o,r)=>{const n=(i={getContext:()=>e.getContext,store:()=>e.store},a={},r.d(a,i),a);var i,a;function l(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|");return`var(--wp--preset--color--${t})`}function c(e,t,o=null,r=""){return o?`${e}${r} { ${t}: ${o}; }\n`:""}function s(e,t,o,r){return c(e,"background-color",t)+c(e,"color",o)+c(e,"background-color",r,":hover")+c(e,"background-color",r,":focus")}const{apiFetch:d,i18n:{__}}=window.wp,{state:p,actions:u,callbacks:f}=(0,n.store)("activitypub/follow-me",{actions:{openModal(){(0,n.getContext)().isModalOpen=!0,document.body.classList.add("modal-open")},closeModal(){(0,n.getContext)().isModalOpen=!1,document.body.classList.remove("modal-open")},toggleModal(){(0,n.getContext)().isModalOpen?u.closeModal():u.openModal()},copyToClipboard(){const e=p.profile.data.webfinger,t=(0,n.getContext)();navigator.clipboard.writeText(e).then((()=>{t.copyButtonText=__("Copied!","activitypub"),setTimeout((()=>{t.copyButtonText=__("Copy","activitypub")}),1e3)}),(e=>{console.error("Could not copy text: ",e)}))},updateRemoteProfile(e){const t=(0,n.getContext)();t.remoteProfile=e.target.value,t.isError=!1,t.errorMessage=""},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),u.submitRemoteProfile())},submitRemoteProfile:function*(){const e=(0,n.getContext)(),{userId:t,namespace:o}=p,r=e.remoteProfile.trim();if(!r)return e.isError=!0,void(e.errorMessage=__("Please enter a profile URL or handle.","activitypub"));if(!/^(https?:\/\/|@)/.test(r))return e.isError=!0,void(e.errorMessage=__("Please enter a valid URL or handle.","activitypub"));e.isLoading=!0,e.isError=!1;const i=`/${o}/actors/${t}/remote-follow?resource=${encodeURIComponent(r)}`;try{const t=yield d({path:i});e.isLoading=!1,window.open(t.url,"_blank"),u.closeModal()}catch(t){console.error("Error submitting profile:",t),e.isLoading=!1,e.isError=!0,e.errorMessage=t.message||__("An error occurred. Please try again.","activitypub")}}},callbacks:{init:function*(){f.initButtonStyles(),yield f.fetchProfile()},fetchProfile:function*(){const{userId:e,namespace:t}=p;try{const o={headers:{Accept:"application/activity+json"},path:`/${t}/actors/${e}`},r=yield d(o);p.profile.data=function(e){if(!e)return p.profile.data;const t={...p.profile.data,...e};return t.avatar=t?.icon?.url,t.webfinger&&!t.webfinger.startsWith("@")&&(t.webfinger="@"+t.webfinger),t}(r),p.profile.loading=!1}catch(e){console.error("Error fetching profile:",e),p.profile.loading=!1}},initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:t}=p,{blockId:o}=(0,n.getContext)();if(o&&e){const n=document.createElement("style"),i=`#${o}`;n.textContent=function(e,t,o){const r=`${e} .components-button`,n=("string"==typeof(i=o)?`var(--wp--preset--color--${i})`:i?.color?.background||null)||t?.color?.background;var i;return s(r,l(t?.elements?.link?.color?.text),n,l(t?.elements?.link?.[":hover"]?.color?.text))}(i,e,t),document.head.appendChild(n);const a=document.createElement("style");a.textContent=(r=e,s(".activitypub-dialog__button-group .components-button",l(r?.elements?.link?.color?.text)||"#111","#fff",l(r?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(a)}var r},documentKeydown:e=>{(0,n.getContext)().isModalOpen&&"Escape"===e.key&&u.closeModal()},documentClick:e=>{!(0,n.getContext)().isModalOpen||e.target.closest(".activitypub-modal__frame")||e.target.closest(".activitypub-profile__follow")||u.closeModal()}}})}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return r[e](o,o.exports,i),o.exports}i.m=r,t=[],i.O=(e,o,r,n)=>{if(!o){var a=1/0;for(d=0;d=n)&&Object.keys(i.O).every((e=>i.O[e](o[c])))?o.splice(c--,1):(l=!1,n0&&t[d-1][2]>n;d--)t[d]=t[d-1];t[d]=[o,r,n]},i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={41:0,301:0},i.O.j=e=>0===o[e];var a=i.O(void 0,[301],(()=>i(825)));a=i.O(a); \ No newline at end of file diff --git a/build/follow-me/view.js.map b/build/follow-me/view.js.map new file mode 100644 index 000000000..63c8c6a2e --- /dev/null +++ b/build/follow-me/view.js.map @@ -0,0 +1 @@ +{"version":3,"file":"follow-me/view.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,kBAAkBA,CAACC,KAAK,EAAE;EAClC;EACA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC9B,OAAO,4BAA4BA,KAAK,GAAG;EAC5C;EAEA,OAAOA,KAAK,EAAEA,KAAK,EAAEC,UAAU,IAAI,IAAI;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAACC,IAAI,EAAE;EAC3B,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;IAC7B,OAAO,IAAI;EACZ;EACA;EACA,IAAIA,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;IACrB;IACA,OAAOD,IAAI,CAACE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;EAC5B;EACA;EACA;EACA;EACA,MAAM,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AC,CAAC;MACrB;IACD,CAAC;IAED;AACF;AACA;AACA;AACA;IACEkD,aAAa,EAAGrC,KAAK,IAAK;MACzB,MAAMnB,OAAO,GAAGlB,oEAAU,CAAC,CAAC;MAC5B;MACA,IAAIkB,OAAO,CAACC,WAAW,IACtB,CAACkB,KAAK,CAACE,MAAM,CAACoC,OAAO,CAAC,2BAA2B,CAAC,IAClD,CAACtC,KAAK,CAACE,MAAM,CAACoC,OAAO,CAAC,8BAA8B,CAAC,EAAE;QACvD5D,OAAO,CAACS,UAAU,CAAC,CAAC;MACrB;IACD;EACD;AACD,CAAC,CAAC;;;;;;;;;;;ACpPF;;;;;;;;;;;ACAA;;;;;;SCAA;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;SAEA;SACA;;;;;UCzBA;UACA;UACA;UACA;UACA,+BAA+B,wCAAwC;UACvE;UACA;UACA;UACA;UACA,iBAAiB,qBAAqB;UACtC;UACA;UACA,kBAAkB,qBAAqB;UACvC;UACA;UACA,KAAK;UACL;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;;;;UC3BA;UACA;UACA;UACA;UACA,yCAAyC,wCAAwC;UACjF;UACA;UACA;;;;;UCPA;;;;;UCAA;UACA;UACA;UACA,uDAAuD,iBAAiB;UACxE;UACA,gDAAgD,aAAa;UAC7D;;;;;UCNA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;;;;SEpBA;SACA;SACA;SACA;SACA","sources":["webpack://wordpress-activitypub/./src/follow-me/button-style.js","webpack://wordpress-activitypub/./src/follow-me/view.js","webpack://wordpress-activitypub/./src/follow-me/style.scss","webpack://wordpress-activitypub/external module \"@wordpress/interactivity\"","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/chunk loaded","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/webpack/runtime/import chunk loading","webpack://wordpress-activitypub/webpack/before-startup","webpack://wordpress-activitypub/webpack/startup","webpack://wordpress-activitypub/webpack/after-startup"],"sourcesContent":["/**\n * Gets the background color from a style object.\n *\n * @param {Object|string} color Color object or string.\n * @return {string|null} Background color.\n */\nfunction getBackgroundColor(color) {\n\t// If color is a string, it's a var like this.\n\tif (typeof color === 'string') {\n\t\treturn `var(--wp--preset--color--${color})`;\n\t}\n\n\treturn color?.color?.background || null;\n}\n\n/**\n * Gets the link color from a style object.\n *\n * @param {string} text Text color.\n * @return {string|null} Link color.\n */\nfunction getLinkColor(text) {\n\tif (typeof text !== 'string') {\n\t\treturn null;\n\t}\n\t// If it starts with a hash, leave it be.\n\tif (text.match(/^#/)) {\n\t\t// We don't handle the alpha channel if present.\n\t\treturn text.substring(0, 7);\n\t}\n\t// var:preset|color|luminous-vivid-amber\n\t// var(--wp--preset--color--luminous-vivid-amber)\n\t// We will receive the top format, we need to output the bottom format.\n\tconst [, , color] = text.split('|');\n\treturn `var(--wp--preset--color--${color})`;\n}\n\n/**\n * Generates a CSS selector.\n *\n * @param {string} selector CSS selector.\n * @param {string} prop CSS property.\n * @param {string|null} value CSS value.\n * @param {string} pseudo Pseudo-selector.\n * @return {string} CSS selector.\n */\nfunction generateSelector(selector, prop, value = null, pseudo = '') {\n\tif (!value) {\n\t\treturn '';\n\t}\n\treturn `${selector}${pseudo} { ${prop}: ${value}; }\\n`;\n}\n\n/**\n * Gets styles for a button.\n *\n * @param {string} selector CSS selector.\n * @param {string} button Button color.\n * @param {string} text Text color.\n * @param {string} hover Hover color.\n * @return {string} CSS styles.\n */\nfunction getStyles(selector, button, text, hover) {\n\treturn generateSelector(selector, 'background-color', button)\n\t\t+ generateSelector(selector, 'color', text)\n\t\t+ generateSelector(selector, 'background-color', hover, ':hover')\n\t\t+ generateSelector(selector, 'background-color', hover, ':focus');\n}\n\n/**\n * Gets block styles.\n *\n * @param {string} base Base selector.\n * @param {Object} style Style object.\n * @param {Object|string} backgroundColor Background color.\n * @return {string} CSS styles.\n */\nexport function getBlockStyles(base, style, backgroundColor) {\n\tconst selector = `${base} .components-button`;\n\t// We grab the background color if set as a good color for our button text.\n\tconst buttonTextColor = getBackgroundColor(backgroundColor)\n\t\t// Background might be in this form.\n\t\t|| style?.color?.background;\n\t// We misuse the link color for the button background.\n\tconst buttonColor = getLinkColor(style?.elements?.link?.color?.text);\n\t// Hover!\n\tconst buttonHoverColor = getLinkColor(style?.elements?.link?.[':hover']?.color?.text);\n\n\treturn getStyles(selector, buttonColor, buttonTextColor, buttonHoverColor);\n}\n\n/**\n * Gets popup styles.\n *\n * @param {Object} style Style object.\n * @return {string} CSS styles.\n */\nexport function getPopupStyles(style) {\n\t// We don't accept backgroundColor because the popup is always white (right?).\n\tconst buttonColor = getLinkColor(style?.elements?.link?.color?.text) || '#111';\n\tconst buttonTextColor = '#fff';\n\tconst buttonHoverColor = getLinkColor(style?.elements?.link?.[':hover']?.color?.text) || '#333';\n\tconst selector = '.activitypub-dialog__button-group .components-button';\n\n\treturn getStyles(selector, buttonColor, buttonTextColor, buttonHoverColor);\n}\n","import { store, getContext } from '@wordpress/interactivity';\nimport { getBlockStyles, getPopupStyles } from './button-style';\nimport './style.scss';\n\n// Get dependencies from the window.wp object.\nconst { apiFetch, i18n: { __ } } = window.wp;\n\n/**\n * Normalizes profile data.\n *\n * @param {Object} profile Profile data.\n *\n * @return {Object} Normalized profile data.\n */\nfunction normalizeProfile(profile) {\n\tif (!profile) {\n\t\treturn state.profile.data;\n\t}\n\n\tconst data = { ...state.profile.data, ...profile };\n\tdata.avatar = data?.icon?.url;\n\n\t// Ensure webfinger always has the @ prefix.\n\tif (data.webfinger && !data.webfinger.startsWith('@')) {\n\t\tdata.webfinger = '@' + data.webfinger;\n\t}\n\n\treturn data;\n}\n\nconst { state, actions, callbacks } = store( 'activitypub/follow-me', {\n\n\tactions: {\n\t\t/**\n\t\t * Open the modal.\n\t\t */\n\t\topenModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = true;\n\t\t\tdocument.body.classList.add('modal-open');\n\t\t},\n\n\t\t/**\n\t\t * Close the modal.\n\t\t */\n\t\tcloseModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = false;\n\t\t\tdocument.body.classList.remove('modal-open');\n\t\t},\n\n\t\ttoggleModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen ? actions.closeModal() : actions.openModal();\n\t\t},\n\n\t\t/**\n\t\t * Copy the webfinger to clipboard.\n\t\t */\n\t\tcopyToClipboard() {\n\t\t\tconst webfinger = state.profile.data.webfinger;\n\t\t\tconst context = getContext();\n\n\t\t\t// Use the Clipboard API to copy text.\n\t\t\tnavigator.clipboard.writeText(webfinger).then(\n\t\t\t\t() => {\n\t\t\t\t\t// Update button text to show success.\n\t\t\t\t\tcontext.copyButtonText = __('Copied!', 'activitypub');\n\n\t\t\t\t\t// Reset button text after 2 seconds.\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tcontext.copyButtonText = __('Copy', 'activitypub');\n\t\t\t\t\t}, 1000);\n\t\t\t\t},\n\t\t\t\t(error) => {\n\t\t\t\t\t// Log error if copying fails.\n\t\t\t\t\tconsole.error('Could not copy text: ', error);\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the remote profile value.\n\t\t *\n\t\t * @param {Event} event Input event.\n\t\t */\n\t\tupdateRemoteProfile(event) {\n\t\t\tconst context = getContext();\n\t\t\tcontext.remoteProfile = event.target.value;\n\t\t\t// Reset error state when input changes.\n\t\t\tcontext.isError = false;\n\t\t\tcontext.errorMessage = '';\n\t\t},\n\n\t\t/**\n\t\t * Handle keydown event for remote profile input.\n\t\t *\n\t\t * @param {Event} event Keydown event.\n\t\t */\n\t\thandleKeyDown(event) {\n\t\t\tif (event.key === 'Enter') {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tactions.submitRemoteProfile();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Submit the remote profile.\n\t\t */\n\t\tsubmitRemoteProfile: function* () {\n\t\t\tconst context = getContext();\n\t\t\tconst { userId, namespace } = state;\n\t\t\tconst input = context.remoteProfile.trim();\n\n\t\t\t// Validate input.\n\t\t\tif (!input) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = __( 'Please enter a profile URL or handle.', 'activitypub' );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! /^(https?:\\/\\/|@)/.test(input) ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = __( 'Please enter a valid URL or handle.', 'activitypub' );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set loading state.\n\t\t\tcontext.isLoading = true;\n\t\t\tcontext.isError = false;\n\n\t\t\t// Construct the API path.\n\t\t\tconst path = `/${namespace}/actors/${userId}/remote-follow?resource=${encodeURIComponent(input)}`;\n\n\t\t\ttry {\n\t\t\t\t// Make the API request.\n\t\t\t\tconst response = yield apiFetch({ path });\n\n\t\t\t\t// Set opening state.\n\t\t\t\tcontext.isLoading = false;\n\n\t\t\t\t// Open the remote follow URL in a new tab.\n\t\t\t\twindow.open(response.url, '_blank');\n\n\t\t\t\t// Close the modal after opening the URL.\n\t\t\t\tactions.closeModal();\n\t\t\t} catch (error) {\n\t\t\t\t// Handle error.\n\t\t\t\tconsole.error('Error submitting profile:', error);\n\t\t\t\tcontext.isLoading = false;\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = error.message || __( 'An error occurred. Please try again.', 'activitypub' );\n\t\t\t}\n\t\t},\n\t},\n\tcallbacks: {\n\t\t/**\n\t\t * Initialize the block.\n\t\t *\n\t\t * This function combines multiple initialization tasks.\n\t\t */\n\t\tinit: function* () {\n\t\t\t// First initialize button styles.\n\t\t\tcallbacks.initButtonStyles();\n\n\t\t\t// Then fetch the profile data.\n\t\t\tyield callbacks.fetchProfile();\n\t\t},\n\n\t\t/**\n\t\t * Fetch profile data.\n\t\t *\n\t\t * @return {Promise} Promise resolving with profile data.\n\t\t */\n\t\tfetchProfile: function* () {\n\t\t\tconst { userId, namespace } = state;\n\n\t\t\ttry {\n\t\t\t\tconst fetchOptions = {\n\t\t\t\t\theaders: { Accept: 'application/activity+json' },\n\t\t\t\t\tpath: `/${namespace}/actors/${userId}`,\n\t\t\t\t};\n\n\t\t\t\tconst profileData = yield apiFetch(fetchOptions);\n\t\t\t\tstate.profile.data = normalizeProfile(profileData);\n\t\t\t\tstate.profile.loading = false;\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Error fetching profile:', error);\n\t\t\t\tstate.profile.loading = false;\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Initialize button styles.\n\t\t */\n\t\tinitButtonStyles: () => {\n\t\t\tconst { buttonStyle, backgroundColor } = state;\n\t\t\tconst { blockId } = getContext();\n\n\t\t\t// Add dynamic button styles to the document.\n\t\t\tif (blockId && buttonStyle) {\n\t\t\t\tconst styleElement = document.createElement('style');\n\t\t\t\tconst selector = `#${blockId}`;\n\n\t\t\t\t// Use getBlockStyles from button-style.js to get the CSS string.\n\t\t\t\tstyleElement.textContent = getBlockStyles(selector, buttonStyle, backgroundColor);\n\n\t\t\t\tdocument.head.appendChild(styleElement);\n\n\t\t\t\t// Add popup styles.\n\t\t\t\tconst popupStyleElement = document.createElement('style');\n\t\t\t\tpopupStyleElement.textContent = getPopupStyles(buttonStyle);\n\n\t\t\t\tdocument.head.appendChild(popupStyleElement);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when pressing ESC key.\n\t\t *\n\t\t * @param {Event} event Keyboard event.\n\t\t */\n\t\tdocumentKeydown: (event) => {\n\t\t\tconst context = getContext();\n\t\t\tif (context.isModalOpen && event.key === 'Escape') {\n\t\t\t\tactions.closeModal();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when clicking outside.\n\t\t *\n\t\t * @param {Event} event Click event.\n\t\t */\n\t\tdocumentClick: (event) => {\n\t\t\tconst context = getContext();\n\t\t\t// Update selector to match the new modal structure.\n\t\t\tif (context.isModalOpen &&\n\t\t\t\t!event.target.closest('.activitypub-modal__frame') &&\n\t\t\t\t!event.target.closest('.activitypub-profile__follow')) {\n\t\t\t\tactions.closeModal();\n\t\t\t}\n\t\t},\n\t},\n});\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;","// 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\t// no module.id needed\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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"follow-me/view\": 0,\n\t\"follow-me/style-view\": 0\n};\n\n// no install chunk\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no external install chunk\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"follow-me/style-view\"], () => (__webpack_require__(\"./src/follow-me/view.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["getBackgroundColor","color","background","getLinkColor","text","match","substring","split","generateSelector","selector","prop","value","pseudo","getStyles","button","hover","getBlockStyles","base","style","backgroundColor","buttonTextColor","buttonColor","elements","link","buttonHoverColor","getPopupStyles","store","getContext","apiFetch","i18n","__","window","wp","normalizeProfile","profile","state","data","avatar","icon","url","webfinger","startsWith","actions","callbacks","openModal","context","isModalOpen","document","body","classList","add","closeModal","remove","toggleModal","copyToClipboard","navigator","clipboard","writeText","then","copyButtonText","setTimeout","error","console","updateRemoteProfile","event","remoteProfile","target","isError","errorMessage","handleKeyDown","key","preventDefault","submitRemoteProfile","userId","namespace","input","trim","test","isLoading","path","encodeURIComponent","response","open","message","init","initButtonStyles","fetchProfile","fetchOptions","headers","Accept","profileData","loading","buttonStyle","blockId","styleElement","createElement","textContent","head","appendChild","popupStyleElement","documentKeydown","documentClick","closest"],"sourceRoot":""} \ No newline at end of file diff --git a/includes/class-blocks.php b/includes/class-blocks.php index 83060b8e0..6cb43ddf2 100644 --- a/includes/class-blocks.php +++ b/includes/class-blocks.php @@ -151,12 +151,9 @@ public static function register_blocks() { 'render_callback' => array( self::class, 'render_follower_block' ), ) ); - \register_block_type_from_metadata( - ACTIVITYPUB_PLUGIN_DIR . '/build/follow-me', - array( - 'render_callback' => array( self::class, 'render_follow_me_block' ), - ) - ); + + \register_block_type_from_metadata( ACTIVITYPUB_PLUGIN_DIR . '/build/follow-me' ); + \register_block_type_from_metadata( ACTIVITYPUB_PLUGIN_DIR . '/build/reply', array( @@ -260,40 +257,6 @@ protected static function filter_array_by_keys( $data, $keys ) { return array_intersect_key( $data, array_flip( $keys ) ); } - /** - * Render the follow me block. - * - * @param array $attrs The block attributes. - * @return string The HTML to render. - */ - public static function render_follow_me_block( $attrs ) { - $user_id = self::get_user_id( $attrs['selectedUser'] ); - $user = Actors::get_by_id( $user_id ); - if ( is_wp_error( $user ) ) { - if ( 'inherit' === $attrs['selectedUser'] ) { - // If the user is 'inherit' and we couldn't determine the user, don't render anything. - return ''; - } else { - // If the user is a specific ID and we couldn't find it, render an error message. - return ''; - } - } - - $attrs['profileData'] = self::filter_array_by_keys( - $user->to_array(), - array( 'icon', 'name', 'webfinger' ) - ); - - $wrapper_attributes = get_block_wrapper_attributes( - array( - 'class' => 'activitypub-follow-me-block-wrapper', - 'data-attrs' => wp_json_encode( $attrs ), - ) - ); - // todo: render more than an empty div? - return '
'; - } - /** * Render the follower block. * diff --git a/package.json b/package.json index d12b6ed2b..6bcb28c6c 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "web": "https://notiz.blog" }, "scripts": { - "dev": "wp-scripts start", - "build": "wp-scripts format && wp-scripts build", + "dev": "wp-scripts start --experimental-modules", + "build": "wp-scripts format && wp-scripts build --experimental-modules", "format": "wp-scripts format", "lint:css": "wp-scripts lint-style", "lint:js": "wp-scripts lint-js", @@ -27,7 +27,7 @@ }, "homepage": "https://github.com/automattic/wordpress-activitypub#readme", "devDependencies": { - "@wordpress/api-fetch": "^7.22.0", + "@wordpress/api-fetch": "^7.23.0", "@wordpress/block-editor": "^14.17.0", "@wordpress/blocks": "^14.0.0", "@wordpress/components": "^29.1.1", @@ -46,5 +46,8 @@ "@wordpress/scripts": "^27.0.0", "@wordpress/url": "^4.22.0", "classnames": "^2.3.2" + }, + "dependencies": { + "@wordpress/interactivity": "^6.23.0" } } diff --git a/src/follow-me/block.json b/src/follow-me/block.json index 2abe9de5d..ab3197351 100644 --- a/src/follow-me/block.json +++ b/src/follow-me/block.json @@ -1,58 +1,61 @@ { - "$schema": "https://schemas.wp.org/trunk/block.json", - "name": "activitypub/follow-me", - "apiVersion": 3, - "version": "1.0.0", - "title": "Follow me on the Fediverse", - "category": "widgets", - "description": "Display your Fediverse profile so that visitors can follow you.", - "textdomain": "activitypub", - "icon": "groups", - "supports": { - "html": false, - "color": { - "gradients": true, - "link": true, - "__experimentalDefaultControls": { - "background": true, - "text": true, - "link": true - } - }, - "__experimentalBorder": { - "radius": true, - "width": true, - "color": true, - "style": true - }, - "typography": { - "fontSize": true, - "__experimentalDefaultControls": { - "fontSize": true - } - } - }, - "attributes": { - "selectedUser": { - "type": "string", - "default": "site" - }, - "buttonOnly": { - "type": "boolean", - "default": false - }, - "buttonText": { - "type": "string", - "default": "Follow" - }, - "buttonSize": { - "type": "string", - "default": "default", - "enum": ["small", "default", "compact"] - } - }, - "usesContext": [ "postType", "postId" ], - "editorScript": "file:./index.js", - "viewScript": "file:./view.js", - "style": ["file:./style-view.css", "wp-components"] -} \ No newline at end of file + "$schema": "https://schemas.wp.org/trunk/block.json", + "name": "activitypub/follow-me", + "apiVersion": 3, + "version": "1.0.0", + "title": "Follow me on the Fediverse", + "category": "widgets", + "description": "Display your Fediverse profile so that visitors can follow you.", + "textdomain": "activitypub", + "icon": "groups", + "supports": { + "html": false, + "interactivity": true, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true, + "link": true + } + }, + "__experimentalBorder": { + "radius": true, + "width": true, + "color": true, + "style": true + }, + "typography": { + "fontSize": true, + "__experimentalDefaultControls": { + "fontSize": true + } + } + }, + "attributes": { + "selectedUser": { + "type": "string", + "default": "site" + }, + "buttonOnly": { + "type": "boolean", + "default": false + }, + "buttonText": { + "type": "string", + "default": "Follow" + }, + "buttonSize": { + "type": "string", + "default": "default", + "enum": [ "small", "default", "compact" ] + } + }, + "usesContext": [ "postType", "postId" ], + "editorScript": "file:./index.js", + "viewScriptModule": "file:./view.js", + "viewScriptDependencies": [ "wp-api-fetch", "wp-i18n" ], + "style": "file:./style-view.css", + "render": "file:./render.php" +} diff --git a/src/follow-me/button-style.js b/src/follow-me/button-style.js index 0c33ca2a3..c71cf49cb 100644 --- a/src/follow-me/button-style.js +++ b/src/follow-me/button-style.js @@ -1,32 +1,49 @@ -function presetVarColorCss( color ) { - return `var(--wp--preset--color--${ color })`; -} - +/** + * Gets the background color from a style object. + * + * @param {Object|string} color Color object or string. + * @return {string|null} Background color. + */ function getBackgroundColor( color ) { - // if color is a string, it's a var like this. + // If color is a string, it's a var like this. if ( typeof color === 'string' ) { - return presetVarColorCss( color ); + return `var(--wp--preset--color--${ color })`; } return color?.color?.background || null; } +/** + * Gets the link color from a style object. + * + * @param {string} text Text color. + * @return {string|null} Link color. + */ function getLinkColor( text ) { if ( typeof text !== 'string' ) { return null; } - // if it starts with a hash, leave it be + // If it starts with a hash, leave it be. if ( text.match( /^#/ ) ) { - // we don't handle the alpha channel if present. + // We don't handle the alpha channel if present. return text.substring( 0, 7 ); } // var:preset|color|luminous-vivid-amber // var(--wp--preset--color--luminous-vivid-amber) - // we will receive the top format, we need to output the bottom format + // We will receive the top format, we need to output the bottom format. const [ , , color ] = text.split( '|' ); - return presetVarColorCss( color ); + return `var(--wp--preset--color--${ color })`; } +/** + * Generates a CSS selector. + * + * @param {string} selector CSS selector. + * @param {string} prop CSS property. + * @param {string|null} value CSS value. + * @param {string} pseudo Pseudo-selector. + * @return {string} CSS selector. + */ function generateSelector( selector, prop, value = null, pseudo = '' ) { if ( ! value ) { return ''; @@ -34,42 +51,59 @@ function generateSelector( selector, prop, value = null, pseudo = '' ) { return `${ selector }${ pseudo } { ${ prop }: ${ value }; }\n`; } +/** + * Gets styles for a button. + * + * @param {string} selector CSS selector. + * @param {string} button Button color. + * @param {string} text Text color. + * @param {string} hover Hover color. + * @return {string} CSS styles. + */ function getStyles( selector, button, text, hover ) { - return generateSelector( selector, 'background-color', button ) - + generateSelector( selector, 'color', text ) - + generateSelector( selector, 'background-color', hover, ':hover' ) - + generateSelector( selector, 'background-color', hover, ':focus' ); + return ( + generateSelector( selector, 'background-color', button ) + + generateSelector( selector, 'color', text ) + + generateSelector( selector, 'background-color', hover, ':hover' ) + + generateSelector( selector, 'background-color', hover, ':focus' ) + ); } -function getBlockStyles( base, style, backgroundColor ) { +/** + * Gets block styles. + * + * @param {string} base Base selector. + * @param {Object} style Style object. + * @param {Object|string} backgroundColor Background color. + * @return {string} CSS styles. + */ +export function getBlockStyles( base, style, backgroundColor ) { const selector = `${ base } .components-button`; - // we grab the background color if set as a good color for our button text - const buttonTextColor = getBackgroundColor( backgroundColor ) - // bg might be in this form. - || style?.color?.background; - // we misuse the link color for the button background + // We grab the background color if set as a good color for our button text. + const buttonTextColor = + getBackgroundColor( backgroundColor ) || + // Background might be in this form. + style?.color?.background; + // We misuse the link color for the button background. const buttonColor = getLinkColor( style?.elements?.link?.color?.text ); - // hover! - const buttonHoverColor = getLinkColor( style?.elements?.link?.[':hover']?.color?.text ); + // Hover! + const buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text ); return getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor ); } +/** + * Gets popup styles. + * + * @param {Object} style Style object. + * @return {string} CSS styles. + */ export function getPopupStyles( style ) { - // we don't acept backgroundColor because the popup is always white (right?) - const buttonColor = getLinkColor( style?.elements?.link?.color?.text ) - || '#111'; + // We don't accept backgroundColor because the popup is always white (right?). + const buttonColor = getLinkColor( style?.elements?.link?.color?.text ) || '#111'; const buttonTextColor = '#fff'; - const buttonHoverColor = getLinkColor( style?.elements?.link?.[':hover']?.color?.text ) - || '#333'; - const selector = '.apfmd__button-group .components-button'; + const buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text ) || '#333'; + const selector = '.activitypub-dialog__button-group .components-button'; return getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor ); } - -export function ButtonStyle( { selector, style, backgroundColor } ) { - const css = getBlockStyles( selector, style, backgroundColor ); - return ( - - ); -} \ No newline at end of file diff --git a/src/follow-me/edit.js b/src/follow-me/edit.js index b41d0f0fb..ad9d894a5 100644 --- a/src/follow-me/edit.js +++ b/src/follow-me/edit.js @@ -4,9 +4,88 @@ import { useSelect } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; import { SelectControl, PanelBody, ToggleControl, TextControl } from '@wordpress/components'; import { useUserOptions } from '../shared/use-user-options'; -import FollowMe from './follow-me'; -import { useEffect } from '@wordpress/element'; +import { useEffect, useState } from '@wordpress/element'; import { InheritModeBlockFallback } from '../shared/inherit-block-fallback'; +import apiFetch from '@wordpress/api-fetch'; +import { useOptions } from '../shared/use-options'; + +/** + * Default profile data. + * + * @type {Object} + */ +const DEFAULT_PROFILE_DATA = { + avatar: 'https://secure.gravatar.com/avatar/default?s=120', + webfinger: '@well@hello.dolly', + name: __( 'Hello Dolly Fan Account', 'activitypub' ), + url: '#', +}; + +/** + * Get normalized profile data. + * + * @param {Object} profile Profile data. + * @return {Object} Normalized profile data. + */ +function getNormalizedProfile( profile ) { + if ( ! profile ) { + return DEFAULT_PROFILE_DATA; + } + const data = { ...DEFAULT_PROFILE_DATA, ...profile }; + data.avatar = data?.icon?.url; + return data; +} + +/** + * Fetch profile data. + * + * @param {number} userId User ID. + * @return {Promise} Promise resolving with profile data. + */ +function fetchProfile( userId ) { + const { namespace } = useOptions(); + const fetchOptions = { + headers: { Accept: 'application/activity+json' }, + path: `/${ namespace }/actors/${ userId }`, + }; + return apiFetch( fetchOptions ); +} + +/** + * Profile component for the editor. + * + * @param {Object} props Component props. + * @return {JSX.Element} Profile component. + */ +function EditorProfile( { profile, userId, buttonText, buttonOnly, buttonSize } ) { + const { webfinger, avatar, name } = profile; + const webfingerWithAt = webfinger.startsWith( '@' ) ? webfinger : `@${ webfinger }`; + + if ( buttonOnly ) { + return ( +
+ +
+ ); + } + + return ( +
+ { +
+
{ name }
+
+ { webfingerWithAt } +
+
+ +
+ ); +} /** * Edit component. @@ -19,35 +98,38 @@ import { InheritModeBlockFallback } from '../shared/inherit-block-fallback'; * @param {number} props.context.postId Post ID. * @return {JSX.Element} Edit component. */ -export default function Edit( { - attributes, - setAttributes, - context: { - postType, - postId, - }, -} ) { +export default function Edit( { attributes, setAttributes, context: { postType, postId } } ) { const blockProps = useBlockProps( { className: 'activitypub-follow-me-block-wrapper', } ); const usersOptions = useUserOptions( { withInherit: true } ); const { selectedUser, buttonOnly, buttonText, buttonSize } = attributes; const isInheritMode = selectedUser === 'inherit'; + const [ profile, setProfile ] = useState( getNormalizedProfile() ); + const userId = selectedUser === 'site' ? 0 : selectedUser; const authorId = useSelect( ( select ) => { const { getEditedEntityRecord } = select( coreStore ); - const _authorId = getEditedEntityRecord( - 'postType', - postType, - postId - )?.author; + const _authorId = getEditedEntityRecord( 'postType', postType, postId )?.author; return _authorId ?? null; }, [ postType, postId ] ); + useEffect( () => { + // Fetch profile data when userId changes + if ( isInheritMode && ! authorId ) { + return; + } + + const effectiveUserId = isInheritMode ? authorId : userId; + fetchProfile( effectiveUserId ).then( ( data ) => { + setProfile( getNormalizedProfile( data ) ); + } ); + }, [ userId, authorId, isInheritMode ] ); + useEffect( () => { // if there are no users yet, do nothing if ( ! usersOptions.length ) { @@ -95,15 +177,18 @@ export default function Edit( { /> - { isInheritMode ? - authorId ? ( - - ) : ( - - ) - : ( - - ) } + + { isInheritMode && ! authorId ? ( + + ) : ( + + ) }
); } diff --git a/src/follow-me/follow-me.js b/src/follow-me/follow-me.js index aba7e0bc4..1587b044b 100644 --- a/src/follow-me/follow-me.js +++ b/src/follow-me/follow-me.js @@ -61,14 +61,7 @@ function fetchProfile( userId ) { * @param {string} props.buttonSize Button size. * @return {JSX.Element} Profile component. */ -function Profile( { - profile, - popupStyles, - userId, - buttonText, - buttonOnly, - buttonSize, -} ) { +function Profile( { profile, popupStyles, userId, buttonText, buttonOnly, buttonSize } ) { const { webfinger, avatar, name } = profile; // check if webfinger starts with @ and add it if it doesn't const webfingerWithAt = webfinger.startsWith( '@' ) ? webfinger : `@${ webfinger }`; @@ -92,7 +85,9 @@ function Profile( { {
{ name }
-
{ webfingerWithAt }
+
+ { webfingerWithAt } +
null; -registerBlockType( 'activitypub/follow-me', { edit, save, icon: people } ); \ No newline at end of file + +// Register the block +registerBlockType( 'activitypub/follow-me', { + edit, + icon: people, + save: () => null, +} ); diff --git a/src/follow-me/render.php b/src/follow-me/render.php new file mode 100644 index 000000000..e5e4ce1cf --- /dev/null +++ b/src/follow-me/render.php @@ -0,0 +1,196 @@ + array( + 'loading' => true, + 'data' => array( + 'avatar' => 'https://secure.gravatar.com/avatar/default?s=120', + 'webfinger' => '@well@hello.dolly', + 'name' => __( 'Hello Dolly Fan Account', 'activitypub' ), + 'url' => '#', + ), + ), + 'userId' => $user_id, + 'namespace' => ACTIVITYPUB_REST_NAMESPACE, + 'buttonOnly' => $button_only, + 'buttonText' => $button_text, + 'buttonSize' => $button_size, + 'buttonStyle' => $button_style, + 'backgroundColor' => $background_color, + ) +); + +// Add the block wrapper attributes. +$wrapper_attributes = get_block_wrapper_attributes( + array( + 'id' => $block_id, + 'class' => 'activitypub-follow-me-block-wrapper', + 'data-wp-interactive' => 'activitypub/follow-me', + 'data-wp-init' => 'callbacks.init', + 'data-wp-on-document--keydown' => 'callbacks.documentKeydown', + 'data-wp-on-document--click' => 'callbacks.documentClick', + ) +); + +$wrapper_context = wp_interactivity_data_wp_context( + array( + 'blockId' => $block_id, + 'isModalOpen' => false, + 'remoteProfile' => '', + 'isLoading' => false, + 'isError' => false, + 'errorMessage' => '', + 'copyButtonText' => __( 'Copy', 'activitypub' ), + ) +); + +?> +
+ +> +
+ + +
+
+
+
+ + + +
+ + + +
+ { - // iterate over a nodelist - [].forEach.call( document.querySelectorAll( '.activitypub-follow-me-block-wrapper' ), ( element ) => { - const attrs = JSON.parse( element.dataset.attrs ); - createRoot( element ).render( ); - } ); -} ); \ No newline at end of file +const { state, actions, callbacks } = store( 'activitypub/follow-me', { + actions: { + /** + * Open the modal. + */ + openModal() { + const context = getContext(); + context.isModalOpen = true; + document.body.classList.add( 'modal-open' ); + }, + + /** + * Close the modal. + */ + closeModal() { + const context = getContext(); + context.isModalOpen = false; + document.body.classList.remove( 'modal-open' ); + }, + + toggleModal() { + const context = getContext(); + context.isModalOpen ? actions.closeModal() : actions.openModal(); + }, + + /** + * Copy the webfinger to clipboard. + */ + copyToClipboard() { + const webfinger = state.profile.data.webfinger; + const context = getContext(); + + // Use the Clipboard API to copy text. + navigator.clipboard.writeText( webfinger ).then( + () => { + // Update button text to show success. + context.copyButtonText = __( 'Copied!', 'activitypub' ); + + // Reset button text after 2 seconds. + setTimeout( () => { + context.copyButtonText = __( 'Copy', 'activitypub' ); + }, 1000 ); + }, + ( error ) => { + // Log error if copying fails. + console.error( 'Could not copy text: ', error ); + } + ); + }, + + /** + * Update the remote profile value. + * + * @param {Event} event Input event. + */ + updateRemoteProfile( event ) { + const context = getContext(); + context.remoteProfile = event.target.value; + // Reset error state when input changes. + context.isError = false; + context.errorMessage = ''; + }, + + /** + * Handle keydown event for remote profile input. + * + * @param {Event} event Keydown event. + */ + handleKeyDown( event ) { + if ( event.key === 'Enter' ) { + event.preventDefault(); + actions.submitRemoteProfile(); + } + }, + + /** + * Submit the remote profile. + */ + submitRemoteProfile: function* () { + const context = getContext(); + const { userId, namespace } = state; + const input = context.remoteProfile.trim(); + + // Validate input. + if ( ! input ) { + context.isError = true; + context.errorMessage = __( 'Please enter a profile URL or handle.', 'activitypub' ); + return; + } + + if ( ! /^(https?:\/\/|@)/.test( input ) ) { + context.isError = true; + context.errorMessage = __( 'Please enter a valid URL or handle.', 'activitypub' ); + return; + } + + // Set loading state. + context.isLoading = true; + context.isError = false; + + // Construct the API path. + const path = `/${ namespace }/actors/${ userId }/remote-follow?resource=${ encodeURIComponent( input ) }`; + + try { + // Make the API request. + const response = yield apiFetch( { path } ); + + // Set opening state. + context.isLoading = false; + + // Open the remote follow URL in a new tab. + window.open( response.url, '_blank' ); + + // Close the modal after opening the URL. + actions.closeModal(); + } catch ( error ) { + // Handle error. + console.error( 'Error submitting profile:', error ); + context.isLoading = false; + context.isError = true; + context.errorMessage = error.message || __( 'An error occurred. Please try again.', 'activitypub' ); + } + }, + }, + callbacks: { + /** + * Initialize the block. + * + * This function combines multiple initialization tasks. + */ + init: function* () { + // First initialize button styles. + callbacks.initButtonStyles(); + + // Then fetch the profile data. + yield callbacks.fetchProfile(); + }, + + /** + * Fetch profile data. + * + * @return {Promise} Promise resolving with profile data. + */ + fetchProfile: function* () { + const { userId, namespace } = state; + + try { + const fetchOptions = { + headers: { Accept: 'application/activity+json' }, + path: `/${ namespace }/actors/${ userId }`, + }; + + const profileData = yield apiFetch( fetchOptions ); + state.profile.data = normalizeProfile( profileData ); + state.profile.loading = false; + } catch ( error ) { + console.error( 'Error fetching profile:', error ); + state.profile.loading = false; + } + }, + + /** + * Initialize button styles. + */ + initButtonStyles: () => { + const { buttonStyle, backgroundColor } = state; + const { blockId } = getContext(); + + // Add dynamic button styles to the document. + if ( blockId && buttonStyle ) { + const styleElement = document.createElement( 'style' ); + const selector = `#${ blockId }`; + + // Use getBlockStyles from button-style.js to get the CSS string. + styleElement.textContent = getBlockStyles( selector, buttonStyle, backgroundColor ); + + document.head.appendChild( styleElement ); + + // Add popup styles. + const popupStyleElement = document.createElement( 'style' ); + popupStyleElement.textContent = getPopupStyles( buttonStyle ); + + document.head.appendChild( popupStyleElement ); + } + }, + + /** + * Close modal when pressing ESC key. + * + * @param {Event} event Keyboard event. + */ + documentKeydown: ( event ) => { + const context = getContext(); + if ( context.isModalOpen && event.key === 'Escape' ) { + actions.closeModal(); + } + }, + + /** + * Close modal when clicking outside. + * + * @param {Event} event Click event. + */ + documentClick: ( event ) => { + const context = getContext(); + // Update selector to match the new modal structure. + if ( + context.isModalOpen && + ! event.target.closest( '.activitypub-modal__frame' ) && + ! event.target.closest( '.activitypub-profile__follow' ) + ) { + actions.closeModal(); + } + }, + }, +} ); From 8508ac427695f5543b66af4f06dff39eb76ec620 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Sat, 10 May 2025 15:56:51 -0500 Subject: [PATCH 02/47] Remove i18n dependency from view --- build/follow-me/render.php | 12 ++++++++++-- build/follow-me/view.asset.php | 2 +- build/follow-me/view.js | 2 +- src/follow-me/block.json | 2 +- src/follow-me/render.php | 12 ++++++++++-- src/follow-me/view.js | 15 ++++++--------- 6 files changed, 29 insertions(+), 16 deletions(-) diff --git a/build/follow-me/render.php b/build/follow-me/render.php index e5e4ce1cf..47a197173 100644 --- a/build/follow-me/render.php +++ b/build/follow-me/render.php @@ -45,6 +45,13 @@ 'buttonSize' => $button_size, 'buttonStyle' => $button_style, 'backgroundColor' => $background_color, + 'i18n' => array( + 'copied' => __( 'Copied!', 'activitypub' ), + 'copy' => __( 'Copy', 'activitypub' ), + 'emptyProfileError' => __( 'Please enter a profile URL or handle.', 'activitypub' ), + 'invalidProfileError' => __( 'Please enter a valid URL or handle.', 'activitypub' ), + 'genericError' => __( 'An error occurred. Please try again.', 'activitypub' ), + ), ) ); @@ -74,8 +81,8 @@ ?>
- + + >
@@ -83,6 +90,7 @@ class="activitypub-profile__avatar" data-wp-bind--src="state.profile.data.avatar" data-wp-bind--alt="state.profile.data.name" + alt="" />
array('@wordpress/interactivity'), 'version' => '45aca98e705f802dbd94', 'type' => 'module'); + array('@wordpress/interactivity'), 'version' => '6f57edf9f31194461264', 'type' => 'module'); diff --git a/build/follow-me/view.js b/build/follow-me/view.js index 0146ce54e..5ea70b47e 100644 --- a/build/follow-me/view.js +++ b/build/follow-me/view.js @@ -1 +1 @@ -import*as e from"@wordpress/interactivity";var t,o,r={825:(t,o,r)=>{const n=(i={getContext:()=>e.getContext,store:()=>e.store},a={},r.d(a,i),a);var i,a;function l(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|");return`var(--wp--preset--color--${t})`}function c(e,t,o=null,r=""){return o?`${e}${r} { ${t}: ${o}; }\n`:""}function s(e,t,o,r){return c(e,"background-color",t)+c(e,"color",o)+c(e,"background-color",r,":hover")+c(e,"background-color",r,":focus")}const{apiFetch:d,i18n:{__}}=window.wp,{state:p,actions:u,callbacks:f}=(0,n.store)("activitypub/follow-me",{actions:{openModal(){(0,n.getContext)().isModalOpen=!0,document.body.classList.add("modal-open")},closeModal(){(0,n.getContext)().isModalOpen=!1,document.body.classList.remove("modal-open")},toggleModal(){(0,n.getContext)().isModalOpen?u.closeModal():u.openModal()},copyToClipboard(){const e=p.profile.data.webfinger,t=(0,n.getContext)();navigator.clipboard.writeText(e).then((()=>{t.copyButtonText=__("Copied!","activitypub"),setTimeout((()=>{t.copyButtonText=__("Copy","activitypub")}),1e3)}),(e=>{console.error("Could not copy text: ",e)}))},updateRemoteProfile(e){const t=(0,n.getContext)();t.remoteProfile=e.target.value,t.isError=!1,t.errorMessage=""},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),u.submitRemoteProfile())},submitRemoteProfile:function*(){const e=(0,n.getContext)(),{userId:t,namespace:o}=p,r=e.remoteProfile.trim();if(!r)return e.isError=!0,void(e.errorMessage=__("Please enter a profile URL or handle.","activitypub"));if(!/^(https?:\/\/|@)/.test(r))return e.isError=!0,void(e.errorMessage=__("Please enter a valid URL or handle.","activitypub"));e.isLoading=!0,e.isError=!1;const i=`/${o}/actors/${t}/remote-follow?resource=${encodeURIComponent(r)}`;try{const t=yield d({path:i});e.isLoading=!1,window.open(t.url,"_blank"),u.closeModal()}catch(t){console.error("Error submitting profile:",t),e.isLoading=!1,e.isError=!0,e.errorMessage=t.message||__("An error occurred. Please try again.","activitypub")}}},callbacks:{init:function*(){f.initButtonStyles(),yield f.fetchProfile()},fetchProfile:function*(){const{userId:e,namespace:t}=p;try{const o={headers:{Accept:"application/activity+json"},path:`/${t}/actors/${e}`},r=yield d(o);p.profile.data=function(e){if(!e)return p.profile.data;const t={...p.profile.data,...e};return t.avatar=t?.icon?.url,t.webfinger&&!t.webfinger.startsWith("@")&&(t.webfinger="@"+t.webfinger),t}(r),p.profile.loading=!1}catch(e){console.error("Error fetching profile:",e),p.profile.loading=!1}},initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:t}=p,{blockId:o}=(0,n.getContext)();if(o&&e){const n=document.createElement("style"),i=`#${o}`;n.textContent=function(e,t,o){const r=`${e} .components-button`,n=("string"==typeof(i=o)?`var(--wp--preset--color--${i})`:i?.color?.background||null)||t?.color?.background;var i;return s(r,l(t?.elements?.link?.color?.text),n,l(t?.elements?.link?.[":hover"]?.color?.text))}(i,e,t),document.head.appendChild(n);const a=document.createElement("style");a.textContent=(r=e,s(".activitypub-dialog__button-group .components-button",l(r?.elements?.link?.color?.text)||"#111","#fff",l(r?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(a)}var r},documentKeydown:e=>{(0,n.getContext)().isModalOpen&&"Escape"===e.key&&u.closeModal()},documentClick:e=>{!(0,n.getContext)().isModalOpen||e.target.closest(".activitypub-modal__frame")||e.target.closest(".activitypub-profile__follow")||u.closeModal()}}})}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return r[e](o,o.exports,i),o.exports}i.m=r,t=[],i.O=(e,o,r,n)=>{if(!o){var a=1/0;for(d=0;d=n)&&Object.keys(i.O).every((e=>i.O[e](o[c])))?o.splice(c--,1):(l=!1,n0&&t[d-1][2]>n;d--)t[d]=t[d-1];t[d]=[o,r,n]},i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={41:0,301:0},i.O.j=e=>0===o[e];var a=i.O(void 0,[301],(()=>i(825)));a=i.O(a); \ No newline at end of file +import*as e from"@wordpress/interactivity";var o,t,r={825:(o,t,r)=>{const n=(i={getContext:()=>e.getContext,store:()=>e.store},l={},r.d(l,i),l);var i,l;function a(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,o]=e.split("|");return`var(--wp--preset--color--${o})`}function c(e,o,t=null,r=""){return t?`${e}${r} { ${o}: ${t}; }\n`:""}function s(e,o,t,r){return c(e,"background-color",o)+c(e,"color",t)+c(e,"background-color",r,":hover")+c(e,"background-color",r,":focus")}const{apiFetch:d}=window.wp,{state:p,actions:u,callbacks:f}=(0,n.store)("activitypub/follow-me",{actions:{openModal(){(0,n.getContext)().isModalOpen=!0,document.body.classList.add("modal-open")},closeModal(){(0,n.getContext)().isModalOpen=!1,document.body.classList.remove("modal-open")},toggleModal(){(0,n.getContext)().isModalOpen?u.closeModal():u.openModal()},copyToClipboard(){const e=p.profile.data.webfinger,o=(0,n.getContext)();navigator.clipboard.writeText(e).then((()=>{o.copyButtonText=p.i18n.copied,setTimeout((()=>{o.copyButtonText=p.i18n.copy}),1e3)}),(e=>{console.error("Could not copy text: ",e)}))},updateRemoteProfile(e){const o=(0,n.getContext)();o.remoteProfile=e.target.value,o.isError=!1,o.errorMessage=""},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),u.submitRemoteProfile())},submitRemoteProfile:function*(){const e=(0,n.getContext)(),{userId:o,namespace:t}=p,r=e.remoteProfile.trim();if(!r)return e.isError=!0,void(e.errorMessage=p.i18n.emptyProfileError);if(!/^(https?:\/\/|@)/.test(r))return e.isError=!0,void(e.errorMessage=p.i18n.invalidProfileError);e.isLoading=!0,e.isError=!1;const i=`/${t}/actors/${o}/remote-follow?resource=${encodeURIComponent(r)}`;try{const o=yield d({path:i});e.isLoading=!1,window.open(o.url,"_blank"),u.closeModal()}catch(o){console.error("Error submitting profile:",o),e.isLoading=!1,e.isError=!0,e.errorMessage=o.message||p.i18n.genericError}}},callbacks:{init:function*(){f.initButtonStyles(),yield f.fetchProfile()},fetchProfile:function*(){const{userId:e,namespace:o}=p;try{const t={headers:{Accept:"application/activity+json"},path:`/${o}/actors/${e}`},r=yield d(t);p.profile.data=function(e){if(!e)return p.profile.data;const o={...p.profile.data,...e};return o.avatar=o?.icon?.url,o.webfinger&&!o.webfinger.startsWith("@")&&(o.webfinger="@"+o.webfinger),o}(r),p.profile.loading=!1}catch(e){console.error("Error fetching profile:",e),p.profile.loading=!1}},initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:o}=p,{blockId:t}=(0,n.getContext)();if(t&&e){const n=document.createElement("style"),i=`#${t}`;n.textContent=function(e,o,t){const r=`${e} .components-button`,n=("string"==typeof(i=t)?`var(--wp--preset--color--${i})`:i?.color?.background||null)||o?.color?.background;var i;return s(r,a(o?.elements?.link?.color?.text),n,a(o?.elements?.link?.[":hover"]?.color?.text))}(i,e,o),document.head.appendChild(n);const l=document.createElement("style");l.textContent=(r=e,s(".activitypub-dialog__button-group .components-button",a(r?.elements?.link?.color?.text)||"#111","#fff",a(r?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(l)}var r},documentKeydown:e=>{(0,n.getContext)().isModalOpen&&"Escape"===e.key&&u.closeModal()},documentClick:e=>{!(0,n.getContext)().isModalOpen||e.target.closest(".activitypub-modal__frame")||e.target.closest(".activitypub-profile__follow")||u.closeModal()}}})}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var t=n[e]={exports:{}};return r[e](t,t.exports,i),t.exports}i.m=r,o=[],i.O=(e,t,r,n)=>{if(!t){var l=1/0;for(d=0;d=n)&&Object.keys(i.O).every((e=>i.O[e](t[c])))?t.splice(c--,1):(a=!1,n0&&o[d-1][2]>n;d--)o[d]=o[d-1];o[d]=[t,r,n]},i.d=(e,o)=>{for(var t in o)i.o(o,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},i.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),t={41:0,301:0},i.O.j=e=>0===t[e];var l=i.O(void 0,[301],(()=>i(825)));l=i.O(l); \ No newline at end of file diff --git a/src/follow-me/block.json b/src/follow-me/block.json index ab3197351..df67dd616 100644 --- a/src/follow-me/block.json +++ b/src/follow-me/block.json @@ -55,7 +55,7 @@ "usesContext": [ "postType", "postId" ], "editorScript": "file:./index.js", "viewScriptModule": "file:./view.js", - "viewScriptDependencies": [ "wp-api-fetch", "wp-i18n" ], + "viewScriptDependencies": [ "wp-api-fetch" ], "style": "file:./style-view.css", "render": "file:./render.php" } diff --git a/src/follow-me/render.php b/src/follow-me/render.php index e5e4ce1cf..47a197173 100644 --- a/src/follow-me/render.php +++ b/src/follow-me/render.php @@ -45,6 +45,13 @@ 'buttonSize' => $button_size, 'buttonStyle' => $button_style, 'backgroundColor' => $background_color, + 'i18n' => array( + 'copied' => __( 'Copied!', 'activitypub' ), + 'copy' => __( 'Copy', 'activitypub' ), + 'emptyProfileError' => __( 'Please enter a profile URL or handle.', 'activitypub' ), + 'invalidProfileError' => __( 'Please enter a valid URL or handle.', 'activitypub' ), + 'genericError' => __( 'An error occurred. Please try again.', 'activitypub' ), + ), ) ); @@ -74,8 +81,8 @@ ?>
- + + >
@@ -83,6 +90,7 @@ class="activitypub-profile__avatar" data-wp-bind--src="state.profile.data.avatar" data-wp-bind--alt="state.profile.data.name" + alt="" />
{ // Update button text to show success. - context.copyButtonText = __( 'Copied!', 'activitypub' ); + context.copyButtonText = state.i18n.copied; // Reset button text after 2 seconds. setTimeout( () => { - context.copyButtonText = __( 'Copy', 'activitypub' ); + context.copyButtonText = state.i18n.copy; }, 1000 ); }, ( error ) => { @@ -117,13 +114,13 @@ const { state, actions, callbacks } = store( 'activitypub/follow-me', { // Validate input. if ( ! input ) { context.isError = true; - context.errorMessage = __( 'Please enter a profile URL or handle.', 'activitypub' ); + context.errorMessage = state.i18n.emptyProfileError; return; } if ( ! /^(https?:\/\/|@)/.test( input ) ) { context.isError = true; - context.errorMessage = __( 'Please enter a valid URL or handle.', 'activitypub' ); + context.errorMessage = state.i18n.invalidProfileError; return; } @@ -151,7 +148,7 @@ const { state, actions, callbacks } = store( 'activitypub/follow-me', { console.error( 'Error submitting profile:', error ); context.isLoading = false; context.isError = true; - context.errorMessage = error.message || __( 'An error occurred. Please try again.', 'activitypub' ); + context.errorMessage = error.message || state.i18n.genericError; } }, }, From 2c46a449d87e5367f495b8d59f9b52f360b9b45f Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Sat, 10 May 2025 16:11:55 -0500 Subject: [PATCH 03/47] Account for button size setting --- build/follow-me/block.json | 3 +-- build/follow-me/index.asset.php | 2 +- build/follow-me/index.js | 2 +- build/follow-me/index.js.map | 2 +- build/follow-me/render.php | 9 ++++++++- build/follow-me/view.js.map | 2 +- src/follow-me/edit.js | 3 ++- src/follow-me/render.php | 9 ++++++++- 8 files changed, 23 insertions(+), 9 deletions(-) diff --git a/build/follow-me/block.json b/build/follow-me/block.json index 2ffb7676a..9071ef15c 100644 --- a/build/follow-me/block.json +++ b/build/follow-me/block.json @@ -63,8 +63,7 @@ "editorScript": "file:./index.js", "viewScriptModule": "file:./view.js", "viewScriptDependencies": [ - "wp-api-fetch", - "wp-i18n" + "wp-api-fetch" ], "style": "file:./style-view.css", "render": "file:./render.php" diff --git a/build/follow-me/index.asset.php b/build/follow-me/index.asset.php index 1e638f83f..1df3be7fe 100644 --- a/build/follow-me/index.asset.php +++ b/build/follow-me/index.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'faa65c23487cda14a94f'); + array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '1bf50740bde133c9eac9'); diff --git a/build/follow-me/index.js b/build/follow-me/index.js index 3dfc1288b..58fc6b876 100644 --- a/build/follow-me/index.js +++ b/build/follow-me/index.js @@ -1,2 +1,2 @@ (()=>{"use strict";var e={20:(e,t,o)=>{var n=o(609),a=Symbol.for("react.element"),l=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),r=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,o){var n,c={},s=null,u=null;for(n in void 0!==o&&(s=""+o),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,n)&&!i.hasOwnProperty(n)&&(c[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===c[n]&&(c[n]=t[n]);return{$$typeof:a,type:e,key:s,ref:u,props:c,_owner:r.current}}},848:(e,t,o)=>{e.exports=o(20)},609:e=>{e.exports=window.React}},t={};function o(n){var a=t[n];if(void 0!==a)return a.exports;var l=t[n]={exports:{}};return e[n](l,l.exports,o),l.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const n=window.wp.blocks,a=window.wp.primitives;var l=o(848);const r=(0,l.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(a.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})});var i=o(609);const c=window.wp.blockEditor,s=window.wp.i18n,u=window.wp.data,p=window.wp.coreData,v=window.wp.components,b=window.wp.element;function m(){return window._activityPubOptions||{}}function d({name:e}){const{enabled:t}=m(),o=t?.site?"":(0,s.__)("It will be empty in other non-author contexts.","activitypub"),n=(0,s.sprintf)(/* translators: %1$s: block name, %2$s: extra information for non-author context */ /* translators: %1$s: block name, %2$s: extra information for non-author context */ -(0,s.__)("This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s","activitypub"),e,o).trim();return(0,i.createElement)(v.Card,null,(0,i.createElement)(v.CardBody,null,(0,b.createInterpolateElement)(n,{strong:(0,i.createElement)("strong",null)})))}const y=window.wp.apiFetch;var _=o.n(y);const f={avatar:"https://secure.gravatar.com/avatar/default?s=120",webfinger:"@well@hello.dolly",name:(0,s.__)("Hello Dolly Fan Account","activitypub"),url:"#"};function w(e){if(!e)return f;const t={...f,...e};return t.avatar=t?.icon?.url,t}function h({profile:e,userId:t,buttonText:o,buttonOnly:n,buttonSize:a}){const{webfinger:l,avatar:r,name:c}=e,s=l.startsWith("@")?l:`@${l}`;return n?(0,i.createElement)("div",{className:"activitypub-profile"},(0,i.createElement)("button",{className:"activitypub-profile__follow components-button is-primary",size:a},o)):(0,i.createElement)("div",{className:"activitypub-profile"},(0,i.createElement)("img",{className:"activitypub-profile__avatar",src:r,alt:c}),(0,i.createElement)("div",{className:"activitypub-profile__content"},(0,i.createElement)("div",{className:"activitypub-profile__name"},c),(0,i.createElement)("div",{className:"activitypub-profile__handle",title:s},s)),(0,i.createElement)("button",{className:"activitypub-profile__follow components-button is-primary",size:a},o))}(0,n.registerBlockType)("activitypub/follow-me",{edit:function({attributes:e,setAttributes:t,context:{postType:o,postId:n}}){const a=(0,c.useBlockProps)({className:"activitypub-follow-me-block-wrapper"}),l=function({withInherit:e=!1}){const{enabled:t}=m(),o=t?.users?(0,u.useSelect)((e=>e("core").getUsers({who:"authors"}))):[];return(0,b.useMemo)((()=>{if(!o)return[];const n=[];return t?.site&&n.push({label:(0,s.__)("Site","activitypub"),value:"site"}),e&&t?.users&&n.push({label:(0,s.__)("Dynamic User","activitypub"),value:"inherit"}),o.reduce(((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e)),n)}),[o])}({withInherit:!0}),{selectedUser:r,buttonOnly:y,buttonText:f,buttonSize:E}=e,g="inherit"===r,[x,O]=(0,b.useState)(w()),S="site"===r?0:r,C=(0,u.useSelect)((e=>{const{getEditedEntityRecord:t}=e(p.store),a=t("postType",o,n)?.author;return null!=a?a:null}),[o,n]);return(0,b.useEffect)((()=>{g&&!C||function(e){const{namespace:t}=m(),o={headers:{Accept:"application/activity+json"},path:`/${t}/actors/${e}`};return _()(o)}(g?C:S).then((e=>{O(w(e))}))}),[S,C,g]),(0,b.useEffect)((()=>{l.length&&(l.find((({value:e})=>e===r))||t({selectedUser:l[0].value}))}),[r,l]),(0,i.createElement)("div",{...a},(0,i.createElement)(c.InspectorControls,{key:"activitypub-follow-me"},(0,i.createElement)(v.PanelBody,{title:(0,s.__)("Follow Me Options","activitypub")},l.length>1&&(0,i.createElement)(v.SelectControl,{label:(0,s.__)("Select User","activitypub"),value:e.selectedUser,options:l,onChange:e=>t({selectedUser:e})}),(0,i.createElement)(v.ToggleControl,{label:(0,s.__)("Button Only Mode","activitypub"),checked:y,onChange:e=>t({buttonOnly:e}),help:(0,s.__)("Only show the follow button without profile information","activitypub")}),(0,i.createElement)(v.TextControl,{label:(0,s.__)("Button Text","activitypub"),value:f,onChange:e=>t({buttonText:e})}),(0,i.createElement)(v.SelectControl,{label:(0,s.__)("Button Size","activitypub"),value:E,options:[{label:(0,s.__)("Default","activitypub"),value:"default"},{label:(0,s.__)("Compact","activitypub"),value:"compact"},{label:(0,s.__)("Small","activitypub"),value:"small"}],onChange:e=>t({buttonSize:e}),help:(0,s.__)("Choose the size of the follow button","activitypub")}))),g&&!C?(0,i.createElement)(d,{name:(0,s.__)("Follow Me","activitypub")}):(0,i.createElement)(h,{profile:x,userId:g?C:S,buttonText:f,buttonOnly:y,buttonSize:E}))},icon:r,save:()=>null})})(); \ No newline at end of file +(0,s.__)("This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s","activitypub"),e,o).trim();return(0,i.createElement)(v.Card,null,(0,i.createElement)(v.CardBody,null,(0,b.createInterpolateElement)(n,{strong:(0,i.createElement)("strong",null)})))}const y=window.wp.apiFetch;var _=o.n(y);const f={avatar:"https://secure.gravatar.com/avatar/default?s=120",webfinger:"@well@hello.dolly",name:(0,s.__)("Hello Dolly Fan Account","activitypub"),url:"#"};function w(e){if(!e)return f;const t={...f,...e};return t.avatar=t?.icon?.url,t}function h({profile:e,userId:t,buttonText:o,buttonOnly:n,buttonSize:a}){const{webfinger:l,avatar:r,name:c}=e,s=l.startsWith("@")?l:`@${l}`,u="small"===a?"is-small":"compact"===a?"is-compact":"";return n?(0,i.createElement)("div",{className:"activitypub-profile"},(0,i.createElement)("button",{className:"activitypub-profile__follow components-button is-primary",size:a},o)):(0,i.createElement)("div",{className:"activitypub-profile"},(0,i.createElement)("img",{className:"activitypub-profile__avatar",src:r,alt:c}),(0,i.createElement)("div",{className:"activitypub-profile__content"},(0,i.createElement)("div",{className:"activitypub-profile__name"},c),(0,i.createElement)("div",{className:"activitypub-profile__handle",title:s},s)),(0,i.createElement)("button",{className:`activitypub-profile__follow components-button is-primary ${u}`},o))}(0,n.registerBlockType)("activitypub/follow-me",{edit:function({attributes:e,setAttributes:t,context:{postType:o,postId:n}}){const a=(0,c.useBlockProps)({className:"activitypub-follow-me-block-wrapper"}),l=function({withInherit:e=!1}){const{enabled:t}=m(),o=t?.users?(0,u.useSelect)((e=>e("core").getUsers({who:"authors"}))):[];return(0,b.useMemo)((()=>{if(!o)return[];const n=[];return t?.site&&n.push({label:(0,s.__)("Site","activitypub"),value:"site"}),e&&t?.users&&n.push({label:(0,s.__)("Dynamic User","activitypub"),value:"inherit"}),o.reduce(((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e)),n)}),[o])}({withInherit:!0}),{selectedUser:r,buttonOnly:y,buttonText:f,buttonSize:E}=e,g="inherit"===r,[x,O]=(0,b.useState)(w()),S="site"===r?0:r,C=(0,u.useSelect)((e=>{const{getEditedEntityRecord:t}=e(p.store),a=t("postType",o,n)?.author;return null!=a?a:null}),[o,n]);return(0,b.useEffect)((()=>{g&&!C||function(e){const{namespace:t}=m(),o={headers:{Accept:"application/activity+json"},path:`/${t}/actors/${e}`};return _()(o)}(g?C:S).then((e=>{O(w(e))}))}),[S,C,g]),(0,b.useEffect)((()=>{l.length&&(l.find((({value:e})=>e===r))||t({selectedUser:l[0].value}))}),[r,l]),(0,i.createElement)("div",{...a},(0,i.createElement)(c.InspectorControls,{key:"activitypub-follow-me"},(0,i.createElement)(v.PanelBody,{title:(0,s.__)("Follow Me Options","activitypub")},l.length>1&&(0,i.createElement)(v.SelectControl,{label:(0,s.__)("Select User","activitypub"),value:e.selectedUser,options:l,onChange:e=>t({selectedUser:e})}),(0,i.createElement)(v.ToggleControl,{label:(0,s.__)("Button Only Mode","activitypub"),checked:y,onChange:e=>t({buttonOnly:e}),help:(0,s.__)("Only show the follow button without profile information","activitypub")}),(0,i.createElement)(v.TextControl,{label:(0,s.__)("Button Text","activitypub"),value:f,onChange:e=>t({buttonText:e})}),(0,i.createElement)(v.SelectControl,{label:(0,s.__)("Button Size","activitypub"),value:E,options:[{label:(0,s.__)("Default","activitypub"),value:"default"},{label:(0,s.__)("Compact","activitypub"),value:"compact"},{label:(0,s.__)("Small","activitypub"),value:"small"}],onChange:e=>t({buttonSize:e}),help:(0,s.__)("Choose the size of the follow button","activitypub")}))),g&&!C?(0,i.createElement)(d,{name:(0,s.__)("Follow Me","activitypub")}):(0,i.createElement)(h,{profile:x,userId:g?C:S,buttonText:f,buttonOnly:y,buttonSize:E}))},icon:r,save:()=>null})})(); \ No newline at end of file diff --git a/build/follow-me/index.js.map b/build/follow-me/index.js.map index c05f010ed..7357de508 100644 --- a/build/follow-me/index.js.map +++ b/build/follow-me/index.js.map @@ -1 +1 @@ -{"version":3,"file":"follow-me/index.js","mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACkD;AACF;AAChD,4BAA4B,sDAAI,CAAC,sDAAG;AACpC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA;AACA,GAAG;AACH,CAAC;AACD,iEAAe,MAAM,EAAC;AACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACd2E;AACtC;AACO;AACc;AACmC;AACjC;AACH;AACmB;AAChC;AACO;;AAEnD;AACA;AACA;AACA;AACA;AACA,MAAMgB,oBAAoB,GAAG;EAC5BC,MAAM,EAAE,kDAAkD;EAC1DC,SAAS,EAAE,mBAAmB;EAC9BC,IAAI,EAAEjB,mDAAE,CAAE,yBAAyB,EAAE,aAAc,CAAC;EACpDkB,GAAG,EAAE;AACN,CAAC;;AAED;AACA;A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AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA,KAAK,GAAG;;AAER,kDAAkD;AAClD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,4BAA4B;AAC5B;AACA,qCAAqC;;AAErC,gCAAgC;AAChC;AACA;;AAEA,gCAAgC;;AAEhC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;;AAGJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;;AAGF;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,sBAAsB;AACtB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,iCAAiC;AACjC;AACA,SAAS;AACT,2BAA2B;AAC3B;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;;AAE3D;AACA;;AAEA;AACA,yDAAyD;AACzD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA,gFAAgF;AAChF;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;;;AAGlB;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA,IAAI;;;AAGJ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2HAA2H;AAC3H;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA,oEAAoE;;AAEpE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC;;AAEjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,eAAe;AAC1B,WAAW,GAAG;AACd,WAAW,GAAG;AACd;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;;AAER;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;;AAEA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA,oBAAoB;AACpB,2DAA2D,UAAU;AACrE,yBAAyB,UAAU;AACnC;AACA,aAAa,UAAU;AACvB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,YAAY,SAAS;AACrB;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,6DAA6D;AAC7D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,iBAAiB;AACvC;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN,4CAA4C;;AAE5C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,8CAA8C;AAC9C;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA,0DAA0D;AAC1D;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;;AAGA;AACA;;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,KAAM;AAChB,CAAC,CAAC,C","sources":["webpack://wordpress-activitypub/./node_modules/@wordpress/icons/build-module/library/people.js","webpack://wordpress-activitypub/./src/follow-me/edit.js","webpack://wordpress-activitypub/./src/shared/inherit-block-fallback.js","webpack://wordpress-activitypub/./src/shared/use-options.js","webpack://wordpress-activitypub/./src/shared/use-user-options.js","webpack://wordpress-activitypub/./node_modules/react/cjs/react-jsx-runtime.development.js","webpack://wordpress-activitypub/./node_modules/react/jsx-runtime.js","webpack://wordpress-activitypub/external window \"React\"","webpack://wordpress-activitypub/external window [\"wp\",\"apiFetch\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blockEditor\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blocks\"]","webpack://wordpress-activitypub/external window [\"wp\",\"components\"]","webpack://wordpress-activitypub/external window [\"wp\",\"coreData\"]","webpack://wordpress-activitypub/external window [\"wp\",\"data\"]","webpack://wordpress-activitypub/external window [\"wp\",\"element\"]","webpack://wordpress-activitypub/external window [\"wp\",\"i18n\"]","webpack://wordpress-activitypub/external window [\"wp\",\"primitives\"]","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/compat get default export","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/./src/follow-me/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst people = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z\",\n fillRule: \"evenodd\"\n })\n});\nexport default people;\n//# sourceMappingURL=people.js.map","import { InspectorControls, useBlockProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { SelectControl, PanelBody, ToggleControl, TextControl } from '@wordpress/components';\nimport { useUserOptions } from '../shared/use-user-options';\nimport { useEffect, useState } from '@wordpress/element';\nimport { InheritModeBlockFallback } from '../shared/inherit-block-fallback';\nimport apiFetch from '@wordpress/api-fetch';\nimport { useOptions } from '../shared/use-options';\n\n/**\n * Default profile data.\n *\n * @type {Object}\n */\nconst DEFAULT_PROFILE_DATA = {\n\tavatar: 'https://secure.gravatar.com/avatar/default?s=120',\n\twebfinger: '@well@hello.dolly',\n\tname: __( 'Hello Dolly Fan Account', 'activitypub' ),\n\turl: '#',\n};\n\n/**\n * Get normalized profile data.\n *\n * @param {Object} profile Profile data.\n * @return {Object} Normalized profile data.\n */\nfunction getNormalizedProfile( profile ) {\n\tif ( ! profile ) {\n\t\treturn DEFAULT_PROFILE_DATA;\n\t}\n\tconst data = { ...DEFAULT_PROFILE_DATA, ...profile };\n\tdata.avatar = data?.icon?.url;\n\treturn data;\n}\n\n/**\n * Fetch profile data.\n *\n * @param {number} userId User ID.\n * @return {Promise} Promise resolving with profile data.\n */\nfunction fetchProfile( userId ) {\n\tconst { namespace } = useOptions();\n\tconst fetchOptions = {\n\t\theaders: { Accept: 'application/activity+json' },\n\t\tpath: `/${ namespace }/actors/${ userId }`,\n\t};\n\treturn apiFetch( fetchOptions );\n}\n\n/**\n * Profile component for the editor.\n *\n * @param {Object} props Component props.\n * @return {JSX.Element} Profile component.\n */\nfunction EditorProfile({ profile, userId, buttonText, buttonOnly, buttonSize }) {\n\tconst { webfinger, avatar, name } = profile;\n\tconst webfingerWithAt = webfinger.startsWith('@') ? webfinger : `@${webfinger}`;\n\n\tif (buttonOnly) {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t);\n\t}\n\n\treturn (\n\t\t
\n\t\t\t{name}\n\t\t\t
\n\t\t\t\t
{name}
\n\t\t\t\t
{webfingerWithAt}
\n\t\t\t
\n\t\t\t\n\t\t
\n\t);\n}\n\n/**\n * Edit component.\n *\n * @param {Object} props Component props.\n * @param {Object} props.attributes Block attributes.\n * @param {Function} props.setAttributes Set block attributes.\n * @param {Object} props.context Block context.\n * @param {string} props.context.postType Post type.\n * @param {number} props.context.postId Post ID.\n * @return {JSX.Element} Edit component.\n */\nexport default function Edit( {\n\tattributes,\n\tsetAttributes,\n\tcontext: {\n\t\tpostType,\n\t\tpostId,\n\t},\n} ) {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'activitypub-follow-me-block-wrapper',\n\t} );\n\tconst usersOptions = useUserOptions( { withInherit: true } );\n\tconst { selectedUser, buttonOnly, buttonText, buttonSize } = attributes;\n\tconst isInheritMode = selectedUser === 'inherit';\n\tconst [profile, setProfile] = useState(getNormalizedProfile());\n\tconst userId = selectedUser === 'site' ? 0 : selectedUser;\n\n\tconst authorId = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t)?.author;\n\n\t\t\treturn _authorId ?? null;\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tuseEffect(() => {\n\t\t// Fetch profile data when userId changes\n\t\tif (isInheritMode && !authorId) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst effectiveUserId = isInheritMode ? authorId : userId;\n\t\tfetchProfile(effectiveUserId).then((data) => {\n\t\t\tsetProfile(getNormalizedProfile(data));\n\t\t});\n\t}, [userId, authorId, isInheritMode]);\n\n\tuseEffect( () => {\n\t\t// if there are no users yet, do nothing\n\t\tif ( ! usersOptions.length ) {\n\t\t\treturn;\n\t\t}\n\t\t// ensure that the selected user is in the list of options, if not, select the first available user\n\t\tif ( ! usersOptions.find( ( { value } ) => value === selectedUser ) ) {\n\t\t\tsetAttributes( { selectedUser: usersOptions[ 0 ].value } );\n\t\t}\n\t}, [ selectedUser, usersOptions ] );\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{ usersOptions.length > 1 && (\n\t\t\t\t\t\t setAttributes( { selectedUser: value } ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t setAttributes( { buttonOnly: value } ) }\n\t\t\t\t\t\thelp={ __( 'Only show the follow button without profile information', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t setAttributes( { buttonText: value } ) }\n\t\t\t\t\t/>\n\t\t\t\t\t setAttributes( { buttonSize: value } ) }\n\t\t\t\t\t\thelp={ __( 'Choose the size of the follow button', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\n\t\t\t{isInheritMode && !authorId ? (\n\t\t\t\t\n\t\t\t) : (\n\t\t\t\t\n\t\t\t)}\n\t\t
\n\t);\n}\n","import { Card, CardBody } from '@wordpress/components';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\nexport function InheritModeBlockFallback( { name } ) {\n\tconst { enabled } = useOptions();\n\tconst nonAuthorExtra = enabled?.site ? '' : __( 'It will be empty in other non-author contexts.', 'activitypub' );\n\tconst text = sprintf(\n\t\t/* translators: %1$s: block name, %2$s: extra information for non-author context */\n\t\t__( 'This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s', 'activitypub' ),\n\t\tname,\n\t\tnonAuthorExtra\n\t).trim();\n\n\treturn (\n\t\t\n\t\t\t{ createInterpolateElement( text, { strong: } ) }\n\t\t\n\t);\n}\n","/**\n * Returns the ActivityPub options object.\n *\n * @return {Object} The options object.\n */\nexport function useOptions() {\n\treturn window._activityPubOptions || {};\n}\n","import { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\nexport function useUserOptions( { withInherit = false } ) {\n\tconst { enabled } = useOptions();\n\tconst users = enabled?.users ? useSelect( ( select ) => select( 'core' ).getUsers( { who: 'authors' } ) ) : [];\n\treturn useMemo( () => {\n\t\tif ( ! users ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst userKeywords = [];\n\n\t\tif ( enabled?.site ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Site', 'activitypub' ),\n\t\t\t\tvalue: 'site'\n\t\t\t} );\n\t\t}\n\n\t\t// Only show inherit option when explicitly asked for and users are enabled.\n\t\tif ( withInherit && enabled?.users ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Dynamic User', 'activitypub' ),\n\t\t\t\tvalue: 'inherit'\n\t\t\t} );\n\t\t}\n\n\t\treturn users.reduce( ( acc, user ) => {\n\t\t\tacc.push({\n\t\t\t\tlabel: user.name,\n\t\t\t\tvalue: `${ user.id }` // casting to string because that's how the attribute is stored by Gutenberg\n\t\t\t} );\n\t\t\treturn acc;\n\t\t}, userKeywords );\n\t}, [ users ] );\n}","/**\n * @license React\n * react-jsx-runtime.development.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\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'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","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","// 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\t// no module.id needed\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport { people } from '@wordpress/icons';\nimport edit from './edit';\n\n// Register the block\nregisterBlockType('activitypub/follow-me', {\n edit,\n icon: people,\n save: () => null\n});\n"],"names":["InspectorControls","useBlockProps","__","useSelect","store","coreStore","SelectControl","PanelBody","ToggleControl","TextControl","useUserOptions","useEffect","useState","InheritModeBlockFallback","apiFetch","useOptions","DEFAULT_PROFILE_DATA","avatar","webfinger","name","url","getNormalizedProfile","profile","data","icon","fetchProfile","userId","namespace","fetchOptions","headers","Accept","path","EditorProfile","buttonText","buttonOnly","buttonSize","webfingerWithAt","startsWith","createElement","className","size","src","alt","title","Edit","attributes","setAttributes","context","postType","postId","blockProps","usersOptions","withInherit","selectedUser","isInheritMode","setProfile","authorId","select","getEditedEntityRecord","_authorId","author","effectiveUserId","then","length","find","value","key","label","options","onChange","checked","help","Card","CardBody","sprintf","createInterpolateElement","enabled","nonAuthorExtra","site","text","trim","strong","window","_activityPubOptions","useMemo","users","getUsers","who","userKeywords","push","reduce","acc","user","id","registerBlockType","people","edit","save"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"follow-me/index.js","mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACkD;AACF;AAChD,4BAA4B,sDAAI,CAAC,sDAAG;AACpC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA;AACA,GAAG;AACH,CAAC;AACD,iEAAe,MAAM,EAAC;AACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACd2E;AACtC;AACO;AACc;AACmC;AACjC;AACH;AACmB;AAChC;AACO;;AAEnD;AACA;AACA;AACA;AACA;AACA,MAAMgB,oBAAoB,GAAG;EAC5BC,MAAM,EAAE,kDAAkD;EAC1DC,SAAS,EAAE,mBAAmB;EAC9BC,IAAI,EAAEjB,mDAAE,CAAE,yBAAyB,EAAE,aAAc,CAAC;EACpDkB,GAAG,EAAE;AACN,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,oBAAoBA,CAAEC,OAAO,EAAG;EACxC,IAAK,CAAEA,OAAO,EAAG;IAChB,OAAON,oBAAoB;EAC5B;EACA,MAAMO,IAAI,GAAG;IAAE,GAAGP,oBAAoB;IAAE,GAAGM;EAAQ,CAAC;EACpDC,IAAI,CAACN,MAAM,GAAGM,IAAI,EAAEC,IAAI,EAAEJ,GAAG;EAC7B,OAAOG,IAAI;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,YAAYA,CAAEC,MAAM,EAAG;EAC/B,MAAM;IAAEC;EAAU,CAAC,GAAGZ,gE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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;;AAGF;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,sBAAsB;AACtB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,iCAAiC;AACjC;AACA,SAAS;AACT,2BAA2B;AAC3B;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;;AAE3D;AACA;;AAEA;AACA,yDAAyD;AACzD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA,gFAAgF;AAChF;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;;;AAGlB;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA,IAAI;;;AAGJ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2HAA2H;AAC3H;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA,oEAAoE;;AAEpE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC;;AAEjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,eAAe;AAC1B,WAAW,GAAG;AACd,WAAW,GAAG;AACd;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;;AAER;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;;AAEA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA,oBAAoB;AACpB,2DAA2D,UAAU;AACrE,yBAAyB,UAAU;AACnC;AACA,aAAa,UAAU;AACvB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,YAAY,SAAS;AACrB;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,6DAA6D;AAC7D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,iBAAiB;AACvC;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN,4CAA4C;;AAE5C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,8CAA8C;AAC9C;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA,0DAA0D;AAC1D;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,gDAAgD,gDAAgD,MAAM,aAAa;;AAEnH;AACA,iDAAiD,kCAAkC,OAAO;;AAE1F,yGAAyG,cAAc,UAAU,gGAAgG,kBAAkB,UAAU,UAAU;;AAEvQ;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;AACtC;;AAEA;;AAEA,gBAAgB;AAChB,WAAW;AACX,YAAY;AACZ,GAAG;AACH;;;;;;;;;;;ACpzCa;;AAEb,IAAI,KAAqC,EAAE,EAE1C,CAAC;AACF,EAAE,+IAAkE;AACpE;;;;;;;;;;;ACNA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;ACNsD;AACZ;AAChB;;AAE1B;AACAS,oEAAiB,CAAE,uBAAuB,EAAE;EAC3CE,IAAI;EACJzE,IAAI,EAAEwE,wDAAM;EACZE,IAAI,EAAEA,CAAA,KAAM;AACb,CAAE,CAAC,C","sources":["webpack://wordpress-activitypub/./node_modules/@wordpress/icons/build-module/library/people.js","webpack://wordpress-activitypub/./src/follow-me/edit.js","webpack://wordpress-activitypub/./src/shared/inherit-block-fallback.js","webpack://wordpress-activitypub/./src/shared/use-options.js","webpack://wordpress-activitypub/./src/shared/use-user-options.js","webpack://wordpress-activitypub/./node_modules/react/cjs/react-jsx-runtime.development.js","webpack://wordpress-activitypub/./node_modules/react/jsx-runtime.js","webpack://wordpress-activitypub/external window \"React\"","webpack://wordpress-activitypub/external window [\"wp\",\"apiFetch\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blockEditor\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blocks\"]","webpack://wordpress-activitypub/external window [\"wp\",\"components\"]","webpack://wordpress-activitypub/external window [\"wp\",\"coreData\"]","webpack://wordpress-activitypub/external window [\"wp\",\"data\"]","webpack://wordpress-activitypub/external window [\"wp\",\"element\"]","webpack://wordpress-activitypub/external window [\"wp\",\"i18n\"]","webpack://wordpress-activitypub/external window [\"wp\",\"primitives\"]","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/compat get default export","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/./src/follow-me/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst people = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z\",\n fillRule: \"evenodd\"\n })\n});\nexport default people;\n//# sourceMappingURL=people.js.map","import { InspectorControls, useBlockProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { SelectControl, PanelBody, ToggleControl, TextControl } from '@wordpress/components';\nimport { useUserOptions } from '../shared/use-user-options';\nimport { useEffect, useState } from '@wordpress/element';\nimport { InheritModeBlockFallback } from '../shared/inherit-block-fallback';\nimport apiFetch from '@wordpress/api-fetch';\nimport { useOptions } from '../shared/use-options';\n\n/**\n * Default profile data.\n *\n * @type {Object}\n */\nconst DEFAULT_PROFILE_DATA = {\n\tavatar: 'https://secure.gravatar.com/avatar/default?s=120',\n\twebfinger: '@well@hello.dolly',\n\tname: __( 'Hello Dolly Fan Account', 'activitypub' ),\n\turl: '#',\n};\n\n/**\n * Get normalized profile data.\n *\n * @param {Object} profile Profile data.\n * @return {Object} Normalized profile data.\n */\nfunction getNormalizedProfile( profile ) {\n\tif ( ! profile ) {\n\t\treturn DEFAULT_PROFILE_DATA;\n\t}\n\tconst data = { ...DEFAULT_PROFILE_DATA, ...profile };\n\tdata.avatar = data?.icon?.url;\n\treturn data;\n}\n\n/**\n * Fetch profile data.\n *\n * @param {number} userId User ID.\n * @return {Promise} Promise resolving with profile data.\n */\nfunction fetchProfile( userId ) {\n\tconst { namespace } = useOptions();\n\tconst fetchOptions = {\n\t\theaders: { Accept: 'application/activity+json' },\n\t\tpath: `/${ namespace }/actors/${ userId }`,\n\t};\n\treturn apiFetch( fetchOptions );\n}\n\n/**\n * Profile component for the editor.\n *\n * @param {Object} props Component props.\n * @return {JSX.Element} Profile component.\n */\nfunction EditorProfile( { profile, userId, buttonText, buttonOnly, buttonSize } ) {\n\tconst { webfinger, avatar, name } = profile;\n\tconst webfingerWithAt = webfinger.startsWith( '@' ) ? webfinger : `@${ webfinger }`;\n\tconst buttonClass = buttonSize === 'small' ? 'is-small' : buttonSize === 'compact' ? 'is-compact' : '';\n\n\tif ( buttonOnly ) {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t);\n\t}\n\n\treturn (\n\t\t
\n\t\t\t{\n\t\t\t
\n\t\t\t\t
{ name }
\n\t\t\t\t
\n\t\t\t\t\t{ webfingerWithAt }\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t
\n\t);\n}\n\n/**\n * Edit component.\n *\n * @param {Object} props Component props.\n * @param {Object} props.attributes Block attributes.\n * @param {Function} props.setAttributes Set block attributes.\n * @param {Object} props.context Block context.\n * @param {string} props.context.postType Post type.\n * @param {number} props.context.postId Post ID.\n * @return {JSX.Element} Edit component.\n */\nexport default function Edit( { attributes, setAttributes, context: { postType, postId } } ) {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'activitypub-follow-me-block-wrapper',\n\t} );\n\tconst usersOptions = useUserOptions( { withInherit: true } );\n\tconst { selectedUser, buttonOnly, buttonText, buttonSize } = attributes;\n\tconst isInheritMode = selectedUser === 'inherit';\n\tconst [ profile, setProfile ] = useState( getNormalizedProfile() );\n\tconst userId = selectedUser === 'site' ? 0 : selectedUser;\n\n\tconst authorId = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord( 'postType', postType, postId )?.author;\n\n\t\t\treturn _authorId ?? null;\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tuseEffect( () => {\n\t\t// Fetch profile data when userId changes\n\t\tif ( isInheritMode && ! authorId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst effectiveUserId = isInheritMode ? authorId : userId;\n\t\tfetchProfile( effectiveUserId ).then( ( data ) => {\n\t\t\tsetProfile( getNormalizedProfile( data ) );\n\t\t} );\n\t}, [ userId, authorId, isInheritMode ] );\n\n\tuseEffect( () => {\n\t\t// if there are no users yet, do nothing\n\t\tif ( ! usersOptions.length ) {\n\t\t\treturn;\n\t\t}\n\t\t// ensure that the selected user is in the list of options, if not, select the first available user\n\t\tif ( ! usersOptions.find( ( { value } ) => value === selectedUser ) ) {\n\t\t\tsetAttributes( { selectedUser: usersOptions[ 0 ].value } );\n\t\t}\n\t}, [ selectedUser, usersOptions ] );\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{ usersOptions.length > 1 && (\n\t\t\t\t\t\t setAttributes( { selectedUser: value } ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t setAttributes( { buttonOnly: value } ) }\n\t\t\t\t\t\thelp={ __( 'Only show the follow button without profile information', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t setAttributes( { buttonText: value } ) }\n\t\t\t\t\t/>\n\t\t\t\t\t setAttributes( { buttonSize: value } ) }\n\t\t\t\t\t\thelp={ __( 'Choose the size of the follow button', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\n\t\t\t{ isInheritMode && ! authorId ? (\n\t\t\t\t\n\t\t\t) : (\n\t\t\t\t\n\t\t\t) }\n\t\t
\n\t);\n}\n","import { Card, CardBody } from '@wordpress/components';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\nexport function InheritModeBlockFallback( { name } ) {\n\tconst { enabled } = useOptions();\n\tconst nonAuthorExtra = enabled?.site ? '' : __( 'It will be empty in other non-author contexts.', 'activitypub' );\n\tconst text = sprintf(\n\t\t/* translators: %1$s: block name, %2$s: extra information for non-author context */\n\t\t__( 'This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s', 'activitypub' ),\n\t\tname,\n\t\tnonAuthorExtra\n\t).trim();\n\n\treturn (\n\t\t\n\t\t\t{ createInterpolateElement( text, { strong: } ) }\n\t\t\n\t);\n}\n","/**\n * Returns the ActivityPub options object.\n *\n * @return {Object} The options object.\n */\nexport function useOptions() {\n\treturn window._activityPubOptions || {};\n}\n","import { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\nexport function useUserOptions( { withInherit = false } ) {\n\tconst { enabled } = useOptions();\n\tconst users = enabled?.users ? useSelect( ( select ) => select( 'core' ).getUsers( { who: 'authors' } ) ) : [];\n\treturn useMemo( () => {\n\t\tif ( ! users ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst userKeywords = [];\n\n\t\tif ( enabled?.site ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Site', 'activitypub' ),\n\t\t\t\tvalue: 'site'\n\t\t\t} );\n\t\t}\n\n\t\t// Only show inherit option when explicitly asked for and users are enabled.\n\t\tif ( withInherit && enabled?.users ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Dynamic User', 'activitypub' ),\n\t\t\t\tvalue: 'inherit'\n\t\t\t} );\n\t\t}\n\n\t\treturn users.reduce( ( acc, user ) => {\n\t\t\tacc.push({\n\t\t\t\tlabel: user.name,\n\t\t\t\tvalue: `${ user.id }` // casting to string because that's how the attribute is stored by Gutenberg\n\t\t\t} );\n\t\t\treturn acc;\n\t\t}, userKeywords );\n\t}, [ users ] );\n}","/**\n * @license React\n * react-jsx-runtime.development.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\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'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","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","// 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\t// no module.id needed\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport { people } from '@wordpress/icons';\nimport edit from './edit';\n\n// Register the block\nregisterBlockType( 'activitypub/follow-me', {\n\tedit,\n\ticon: people,\n\tsave: () => null,\n} );\n"],"names":["InspectorControls","useBlockProps","__","useSelect","store","coreStore","SelectControl","PanelBody","ToggleControl","TextControl","useUserOptions","useEffect","useState","InheritModeBlockFallback","apiFetch","useOptions","DEFAULT_PROFILE_DATA","avatar","webfinger","name","url","getNormalizedProfile","profile","data","icon","fetchProfile","userId","namespace","fetchOptions","headers","Accept","path","EditorProfile","buttonText","buttonOnly","buttonSize","webfingerWithAt","startsWith","buttonClass","createElement","className","size","src","alt","title","Edit","attributes","setAttributes","context","postType","postId","blockProps","usersOptions","withInherit","selectedUser","isInheritMode","setProfile","authorId","select","getEditedEntityRecord","_authorId","author","effectiveUserId","then","length","find","value","key","label","options","onChange","checked","help","Card","CardBody","sprintf","createInterpolateElement","enabled","nonAuthorExtra","site","text","trim","strong","window","_activityPubOptions","useMemo","users","getUsers","who","userKeywords","push","reduce","acc","user","id","registerBlockType","people","edit","save"],"sourceRoot":""} \ No newline at end of file diff --git a/build/follow-me/render.php b/build/follow-me/render.php index 47a197173..2c2783447 100644 --- a/build/follow-me/render.php +++ b/build/follow-me/render.php @@ -25,6 +25,13 @@ // Get button style from block attributes. $button_style = $attributes['style'] ?? array(); +$button_class = ''; +if ( 'small' === $button_size ) { + $button_class = 'is-small'; +} elseif ( 'compact' === $button_size ) { + $button_class = 'is-compact'; +} + // Set up the Interactivity API state. wp_interactivity_state( 'activitypub/follow-me', @@ -106,7 +113,7 @@ class="activitypub-profile__handle"
-
diff --git a/src/follow-me/render.php b/src/follow-me/render.php index 47a197173..2c2783447 100644 --- a/src/follow-me/render.php +++ b/src/follow-me/render.php @@ -25,6 +25,13 @@ // Get button style from block attributes. $button_style = $attributes['style'] ?? array(); +$button_class = ''; +if ( 'small' === $button_size ) { + $button_class = 'is-small'; +} elseif ( 'compact' === $button_size ) { + $button_class = 'is-compact'; +} + // Set up the Interactivity API state. wp_interactivity_state( 'activitypub/follow-me', @@ -106,7 +113,7 @@ class="activitypub-profile__handle"
@@ -134,7 +133,7 @@ class="activitypub-modal__overlay"
@@ -134,7 +133,7 @@ class="activitypub-modal__overlay"
- { isOpen && ( - setIsOpen( false ) } - title={ title } - aria-label={ title } - role="dialog" - > - - - - ) } - - ); -} - -/** - * Dialog follow component. - * - * @param {Object} props Component props. - * @param {Object} props.profile Profile data. - * @param {number} props.userId User ID. - * @return {JSX.Element} Dialog follow component. - */ -function DialogFollow( { profile, userId } ) { - const { namespace } = useOptions(); - const { webfinger } = profile; - const actionText = __( 'Follow', 'activitypub' ); - const resourceUrl = `/${ namespace }/actors/${ userId }/remote-follow?resource=`; - const copyDescription = __( - 'Copy and paste my profile into the search field of your favorite fediverse app or server.', - 'activitypub' - ); - const webfingerWithAt = webfinger.startsWith( '@' ) ? webfinger : `@${ webfinger }`; - - return ( - - ); -} - -/** - * Follow me component. - * - * @param {Object} props Component props. - * @param {number|string} props.selectedUser Selected user ID or 'site'. - * @param {Object} props.style Style object. - * @param {string} props.backgroundColor Background color. - * @param {string} props.id Component ID. - * @param {boolean} props.useId Whether to use the ID. - * @param {Object} props.profileData Profile data. - * @param {boolean} props.buttonOnly Whether to render only the button. - * @param {string} props.buttonText Button text. - * @param {string} props.buttonSize Button size. - * @return {JSX.Element} Follow me component. - */ -export default function FollowMe( { - selectedUser, - style, - backgroundColor, - id, - useId = false, - profileData = false, - buttonOnly = false, - buttonText = __( 'Follow', 'activitypub' ), - buttonSize = 'default', -} ) { - const [ profile, setProfile ] = useState( getNormalizedProfile() ); - const userId = selectedUser === 'site' ? 0 : selectedUser; - const popupStyles = getPopupStyles( style ); - const wrapperProps = useId ? { id } : {}; - - useEffect( () => { - if ( profileData ) { - setProfile( getNormalizedProfile( profileData ) ); - return; - } - - fetchProfile( userId ).then( ( data ) => { - setProfile( getNormalizedProfile( data ) ); - } ); - }, [ userId, profileData ] ); - - return ( -
- - -
- ); -} From 36cb8b803369afd13eba1e4355ac05ac92adca40 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Sat, 10 May 2025 20:33:31 -0500 Subject: [PATCH 08/47] update --- build/follow-me/block.json | 2 +- build/follow-me/index.js.map | 2 +- build/follow-me/render.php | 9 ++++++++- build/follow-me/style-view.css | 2 +- build/follow-me/style-view.css.map | 2 +- build/follow-me/view.js.map | 2 +- src/follow-me/block.json | 2 +- src/follow-me/render.php | 9 ++++++++- src/follow-me/style.scss | 7 +++++++ 9 files changed, 29 insertions(+), 8 deletions(-) diff --git a/build/follow-me/block.json b/build/follow-me/block.json index 9071ef15c..a61e5bdde 100644 --- a/build/follow-me/block.json +++ b/build/follow-me/block.json @@ -62,7 +62,7 @@ ], "editorScript": "file:./index.js", "viewScriptModule": "file:./view.js", - "viewScriptDependencies": [ + "viewScript": [ "wp-api-fetch" ], "style": "file:./style-view.css", diff --git a/build/follow-me/index.js.map b/build/follow-me/index.js.map index 7357de508..1fbe21770 100644 --- a/build/follow-me/index.js.map +++ b/build/follow-me/index.js.map @@ -1 +1 @@ -{"version":3,"file":"follow-me/index.js","mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACkD;AACF;AAChD,4BAA4B,sDAAI,CAAC,sDAAG;AACpC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA;AACA,GAAG;AACH,CAAC;AACD,iEAAe,MAAM,EAAC;AACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACd2E;AACtC;AACO;AACc;AACmC;AACjC;AACH;AACmB;AAChC;AACO;;AAEnD;AACA;AACA;AACA;AACA;AACA,MAAMgB,oBAAoB,GAAG;EAC5BC,MAAM,EAAE,kDAAkD;EAC1DC,SAAS,EAAE,mBAAmB;EAC9BC,IAAI,EAAEjB,mDAAE,CAAE,yBAAyB,EAAE,aAAc,CAAC;EACpDkB,GAAG,EAAE;AACN,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,oBAAoBA,CAAEC,OAAO,EAAG;EACxC,IAAK,CAAEA,OAAO,EAAG;IAChB,OAAON,oBAAoB;EAC5B;EACA,MAAMO,IAAI,GAAG;IAAE,GAAGP,oBAAoB;IAAE,GAAGM;EAAQ,CAAC;EACpDC,IAAI,CAACN,MAAM,GAAGM,IAAI,EAAEC,IAAI,EAAEJ,GAAG;EAC7B,OAAOG,IAAI;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,YAAYA,CAAEC,MAAM,EAAG;EAC/B,MAAM;IAAEC;EAAU,CAAC,GAAGZ,gEAAU,CAAC,CAAC;EAClC,MAAMa,YAAY,GAAG;IACpBC,OAAO,EAAE;MAAEC,MAAM,EAAE;IAA4B,CAAC;IAChDC,IAAI,EAAE,IAAKJ,SAAS,WAAaD,MAAM;EACxC,CAAC;EACD,OAAOZ,2DAAQ,CAAEc,YAAa,CAAC;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASI,aAAa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,CAAE,CAAC;IACJ;IAEA,OAAOoB,KAAK,CAACK,MAAM,CAAE,CAAEC,GAAG,EAAEC,IAAI,KAAM;MACrCD,GAAG,CAACF,IAAI,CAAC;QACRtB,KAAK,EAAEyB,IAAI,CAAC1E,IAAI;QAChB+C,KAAK,EAAE,GAAI2B,IAAI,CAACC,EAAE,EAAG,CAAC;MACvB,CAAE,CAAC;MACH,OAAOF,GAAG;IACX,CAAC,EAAEH,YAAa,CAAC;EAClB,CAAC,EAAE,CAAEH,KAAK,CAAG,CAAC;AACf;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,IAAI,IAAqC;AACzC;AACA;;AAEA,YAAY,mBAAO,CAAC,oBAAO;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,iGAAiG,eAAe;AAChH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA,KAAK,GAAG;;AAER,kDAAkD;AAClD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,4BAA4B;AAC5B;AACA,qCAAqC;;AAErC,gCAAgC;AAChC;AACA;;AAEA,gCAAgC;;AAEhC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;;AAGJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;;AAGF;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,sBAAsB;AACtB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,iCAAiC;AACjC;AACA,SAAS;AACT,2BAA2B;AAC3B;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;;AAE3D;AACA;;AAEA;AACA,yDAAyD;AACzD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA,gFAAgF;AAChF;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;;;AAGlB;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA,IAAI;;;AAGJ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2HAA2H;AAC3H;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA,oEAAoE;;AAEpE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC;;AAEjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,eAAe;AAC1B,WAAW,GAAG;AACd,WAAW,GAAG;AACd;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;;AAER;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;;AAEA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA,oBAAoB;AACpB,2DAA2D,UAAU;AACrE,yBAAyB,UAAU;AACnC;AACA,aAAa,UAAU;AACvB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,YAAY,SAAS;AACrB;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,6DAA6D;AAC7D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,iBAAiB;AACvC;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN,4CAA4C;;AAE5C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,8CAA8C;AAC9C;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA,0DAA0D;AAC1D;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,gDAAgD,gDAAgD,MAAM,aAAa;;AAEnH;AACA,iDAAiD,kCAAkC,OAAO;;AAE1F,yGAAyG,cAAc,UAAU,gGAAgG,kBAAkB,UAAU,UAAU;;AAEvQ;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;AACtC;;AAEA;;AAEA,gBAAgB;AAChB,WAAW;AACX,YAAY;AACZ,GAAG;AACH;;;;;;;;;;;ACpzCa;;AAEb,IAAI,KAAqC,EAAE,EAE1C,CAAC;AACF,EAAE,+IAAkE;AACpE;;;;;;;;;;;ACNA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;ACNsD;AACZ;AAChB;;AAE1B;AACAS,oEAAiB,CAAE,uBAAuB,EAAE;EAC3CE,IAAI;EACJzE,IAAI,EAAEwE,wDAAM;EACZE,IAAI,EAAEA,CAAA,KAAM;AACb,CAAE,CAAC,C","sources":["webpack://wordpress-activitypub/./node_modules/@wordpress/icons/build-module/library/people.js","webpack://wordpress-activitypub/./src/follow-me/edit.js","webpack://wordpress-activitypub/./src/shared/inherit-block-fallback.js","webpack://wordpress-activitypub/./src/shared/use-options.js","webpack://wordpress-activitypub/./src/shared/use-user-options.js","webpack://wordpress-activitypub/./node_modules/react/cjs/react-jsx-runtime.development.js","webpack://wordpress-activitypub/./node_modules/react/jsx-runtime.js","webpack://wordpress-activitypub/external window \"React\"","webpack://wordpress-activitypub/external window [\"wp\",\"apiFetch\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blockEditor\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blocks\"]","webpack://wordpress-activitypub/external window [\"wp\",\"components\"]","webpack://wordpress-activitypub/external window [\"wp\",\"coreData\"]","webpack://wordpress-activitypub/external window [\"wp\",\"data\"]","webpack://wordpress-activitypub/external window [\"wp\",\"element\"]","webpack://wordpress-activitypub/external window [\"wp\",\"i18n\"]","webpack://wordpress-activitypub/external window [\"wp\",\"primitives\"]","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/compat get default export","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/./src/follow-me/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst people = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z\",\n fillRule: \"evenodd\"\n })\n});\nexport default people;\n//# sourceMappingURL=people.js.map","import { InspectorControls, useBlockProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { SelectControl, PanelBody, ToggleControl, TextControl } from '@wordpress/components';\nimport { useUserOptions } from '../shared/use-user-options';\nimport { useEffect, useState } from '@wordpress/element';\nimport { InheritModeBlockFallback } from '../shared/inherit-block-fallback';\nimport apiFetch from '@wordpress/api-fetch';\nimport { useOptions } from '../shared/use-options';\n\n/**\n * Default profile data.\n *\n * @type {Object}\n */\nconst DEFAULT_PROFILE_DATA = {\n\tavatar: 'https://secure.gravatar.com/avatar/default?s=120',\n\twebfinger: '@well@hello.dolly',\n\tname: __( 'Hello Dolly Fan Account', 'activitypub' ),\n\turl: '#',\n};\n\n/**\n * Get normalized profile data.\n *\n * @param {Object} profile Profile data.\n * @return {Object} Normalized profile data.\n */\nfunction getNormalizedProfile( profile ) {\n\tif ( ! profile ) {\n\t\treturn DEFAULT_PROFILE_DATA;\n\t}\n\tconst data = { ...DEFAULT_PROFILE_DATA, ...profile };\n\tdata.avatar = data?.icon?.url;\n\treturn data;\n}\n\n/**\n * Fetch profile data.\n *\n * @param {number} userId User ID.\n * @return {Promise} Promise resolving with profile data.\n */\nfunction fetchProfile( userId ) {\n\tconst { namespace } = useOptions();\n\tconst fetchOptions = {\n\t\theaders: { Accept: 'application/activity+json' },\n\t\tpath: `/${ namespace }/actors/${ userId }`,\n\t};\n\treturn apiFetch( fetchOptions );\n}\n\n/**\n * Profile component for the editor.\n *\n * @param {Object} props Component props.\n * @return {JSX.Element} Profile component.\n */\nfunction EditorProfile( { profile, userId, buttonText, buttonOnly, buttonSize } ) {\n\tconst { webfinger, avatar, name } = profile;\n\tconst webfingerWithAt = webfinger.startsWith( '@' ) ? webfinger : `@${ webfinger }`;\n\tconst buttonClass = buttonSize === 'small' ? 'is-small' : buttonSize === 'compact' ? 'is-compact' : '';\n\n\tif ( buttonOnly ) {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t);\n\t}\n\n\treturn (\n\t\t
\n\t\t\t{\n\t\t\t
\n\t\t\t\t
{ name }
\n\t\t\t\t
\n\t\t\t\t\t{ webfingerWithAt }\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t
\n\t);\n}\n\n/**\n * Edit component.\n *\n * @param {Object} props Component props.\n * @param {Object} props.attributes Block attributes.\n * @param {Function} props.setAttributes Set block attributes.\n * @param {Object} props.context Block context.\n * @param {string} props.context.postType Post type.\n * @param {number} props.context.postId Post ID.\n * @return {JSX.Element} Edit component.\n */\nexport default function Edit( { attributes, setAttributes, context: { postType, postId } } ) {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'activitypub-follow-me-block-wrapper',\n\t} );\n\tconst usersOptions = useUserOptions( { withInherit: true } );\n\tconst { selectedUser, buttonOnly, buttonText, buttonSize } = attributes;\n\tconst isInheritMode = selectedUser === 'inherit';\n\tconst [ profile, setProfile ] = useState( getNormalizedProfile() );\n\tconst userId = selectedUser === 'site' ? 0 : selectedUser;\n\n\tconst authorId = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord( 'postType', postType, postId )?.author;\n\n\t\t\treturn _authorId ?? null;\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tuseEffect( () => {\n\t\t// Fetch profile data when userId changes\n\t\tif ( isInheritMode && ! authorId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst effectiveUserId = isInheritMode ? authorId : userId;\n\t\tfetchProfile( effectiveUserId ).then( ( data ) => {\n\t\t\tsetProfile( getNormalizedProfile( data ) );\n\t\t} );\n\t}, [ userId, authorId, isInheritMode ] );\n\n\tuseEffect( () => {\n\t\t// if there are no users yet, do nothing\n\t\tif ( ! usersOptions.length ) {\n\t\t\treturn;\n\t\t}\n\t\t// ensure that the selected user is in the list of options, if not, select the first available user\n\t\tif ( ! usersOptions.find( ( { value } ) => value === selectedUser ) ) {\n\t\t\tsetAttributes( { selectedUser: usersOptions[ 0 ].value } );\n\t\t}\n\t}, [ selectedUser, usersOptions ] );\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{ usersOptions.length > 1 && (\n\t\t\t\t\t\t setAttributes( { selectedUser: value } ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t setAttributes( { buttonOnly: value } ) }\n\t\t\t\t\t\thelp={ __( 'Only show the follow button without profile information', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t setAttributes( { buttonText: value } ) }\n\t\t\t\t\t/>\n\t\t\t\t\t setAttributes( { buttonSize: value } ) }\n\t\t\t\t\t\thelp={ __( 'Choose the size of the follow button', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\n\t\t\t{ isInheritMode && ! authorId ? (\n\t\t\t\t\n\t\t\t) : (\n\t\t\t\t\n\t\t\t) }\n\t\t
\n\t);\n}\n","import { Card, CardBody } from '@wordpress/components';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\nexport function InheritModeBlockFallback( { name } ) {\n\tconst { enabled } = useOptions();\n\tconst nonAuthorExtra = enabled?.site ? '' : __( 'It will be empty in other non-author contexts.', 'activitypub' );\n\tconst text = sprintf(\n\t\t/* translators: %1$s: block name, %2$s: extra information for non-author context */\n\t\t__( 'This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s', 'activitypub' ),\n\t\tname,\n\t\tnonAuthorExtra\n\t).trim();\n\n\treturn (\n\t\t\n\t\t\t{ createInterpolateElement( text, { strong: } ) }\n\t\t\n\t);\n}\n","/**\n * Returns the ActivityPub options object.\n *\n * @return {Object} The options object.\n */\nexport function useOptions() {\n\treturn window._activityPubOptions || {};\n}\n","import { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\nexport function useUserOptions( { withInherit = false } ) {\n\tconst { enabled } = useOptions();\n\tconst users = enabled?.users ? useSelect( ( select ) => select( 'core' ).getUsers( { who: 'authors' } ) ) : [];\n\treturn useMemo( () => {\n\t\tif ( ! users ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst userKeywords = [];\n\n\t\tif ( enabled?.site ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Site', 'activitypub' ),\n\t\t\t\tvalue: 'site'\n\t\t\t} );\n\t\t}\n\n\t\t// Only show inherit option when explicitly asked for and users are enabled.\n\t\tif ( withInherit && enabled?.users ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Dynamic User', 'activitypub' ),\n\t\t\t\tvalue: 'inherit'\n\t\t\t} );\n\t\t}\n\n\t\treturn users.reduce( ( acc, user ) => {\n\t\t\tacc.push({\n\t\t\t\tlabel: user.name,\n\t\t\t\tvalue: `${ user.id }` // casting to string because that's how the attribute is stored by Gutenberg\n\t\t\t} );\n\t\t\treturn acc;\n\t\t}, userKeywords );\n\t}, [ users ] );\n}","/**\n * @license React\n * react-jsx-runtime.development.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\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'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","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","// 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\t// no module.id needed\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport { people } from '@wordpress/icons';\nimport edit from './edit';\n\n// Register the block\nregisterBlockType( 'activitypub/follow-me', {\n\tedit,\n\ticon: people,\n\tsave: () => null,\n} );\n"],"names":["InspectorControls","useBlockProps","__","useSelect","store","coreStore","SelectControl","PanelBody","ToggleControl","TextControl","useUserOptions","useEffect","useState","InheritModeBlockFallback","apiFetch","useOptions","DEFAULT_PROFILE_DATA","avatar","webfinger","name","url","getNormalizedProfile","profile","data","icon","fetchProfile","userId","namespace","fetchOptions","headers","Accept","path","EditorProfile","buttonText","buttonOnly","buttonSize","webfingerWithAt","startsWith","buttonClass","createElement","className","size","src","alt","title","Edit","attributes","setAttributes","context","postType","postId","blockProps","usersOptions","withInherit","selectedUser","isInheritMode","setProfile","authorId","select","getEditedEntityRecord","_authorId","author","effectiveUserId","then","length","find","value","key","label","options","onChange","checked","help","Card","CardBody","sprintf","createInterpolateElement","enabled","nonAuthorExtra","site","text","trim","strong","window","_activityPubOptions","useMemo","users","getUsers","who","userKeywords","push","reduce","acc","user","id","registerBlockType","people","edit","save"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"follow-me/index.js","mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACkD;AACF;AAChD,4BAA4B,sDAAI,CAAC,sDAAG;AACpC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA;AACA,G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B,IAAI,CAACzE,IAAI;QAChB8C,KAAK,EAAE,GAAI2B,IAAI,CAACC,EAAE,EAAG,CAAC;MACvB,CAAE,CAAC;MACH,OAAOF,GAAG;IACX,CAAC,EAAEH,YAAa,CAAC;EAClB,CAAC,EAAE,CAAEH,KAAK,CAAG,CAAC;AACf;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,IAAI,IAAqC;AACzC;AACA;;AAEA,YAAY,mBAAO,CAAC,oBAAO;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,iGAAiG,eAAe;AAChH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA,KAAK,GAAG;;AAER,kDAAkD;AAClD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,4BAA4B;AAC5B;AACA,qCAAqC;;AAErC,gCAAgC;AAChC;AACA;;AAEA,gCAAgC;;AAEhC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;;AAGJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;;AAGF;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,sBAAsB;AACtB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,iCAAiC;AACjC;AACA,SAAS;AACT,2BAA2B;AAC3B;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;;AAE3D;AACA;;AAEA;AACA,yDAAyD;AACzD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA,gFAAgF;AAChF;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;;;AAGlB;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA,IAAI;;;AAGJ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2HAA2H;AAC3H;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA,oEAAoE;;AAEpE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC;;AAEjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,eAAe;AAC1B,WAAW,GAAG;AACd,WAAW,GAAG;AACd;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;;AAER;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;;AAEA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA,oBAAoB;AACpB,2DAA2D,UAAU;AACrE,yBAAyB,UAAU;AACnC;AACA,aAAa,UAAU;AACvB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,YAAY,SAAS;AACrB;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,6DAA6D;AAC7D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,iBAAiB;AACvC;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;A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;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;ACNsD;AACZ;AAChB;;AAE1B;AACAS,oEAAiB,CAAE,uBAAuB,EAAE;EAC3CE,IAAI;EACJxE,IAAI,EAAEuE,wDAAM;EACZE,IAAI,EAAEA,CAAA,KAAM;AACb,CAAE,CAAC,C","sources":["webpack://wordpress-activitypub/./node_modules/@wordpress/icons/build-module/library/people.js","webpack://wordpress-activitypub/./src/follow-me/edit.js","webpack://wordpress-activitypub/./src/shared/inherit-block-fallback.js","webpack://wordpress-activitypub/./src/shared/use-options.js","webpack://wordpress-activitypub/./src/shared/use-user-options.js","webpack://wordpress-activitypub/./node_modules/react/cjs/react-jsx-runtime.development.js","webpack://wordpress-activitypub/./node_modules/react/jsx-runtime.js","webpack://wordpress-activitypub/external window \"React\"","webpack://wordpress-activitypub/external window [\"wp\",\"apiFetch\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blockEditor\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blocks\"]","webpack://wordpress-activitypub/external window [\"wp\",\"components\"]","webpack://wordpress-activitypub/external window [\"wp\",\"coreData\"]","webpack://wordpress-activitypub/external window [\"wp\",\"data\"]","webpack://wordpress-activitypub/external window [\"wp\",\"element\"]","webpack://wordpress-activitypub/external window [\"wp\",\"i18n\"]","webpack://wordpress-activitypub/external window [\"wp\",\"primitives\"]","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/compat get default export","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/./src/follow-me/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst people = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z\",\n fillRule: \"evenodd\"\n })\n});\nexport default people;\n//# sourceMappingURL=people.js.map","import apiFetch from '@wordpress/api-fetch';\nimport { InspectorControls, useBlockProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { SelectControl, PanelBody, ToggleControl, TextControl } from '@wordpress/components';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useUserOptions } from '../shared/use-user-options';\nimport { InheritModeBlockFallback } from '../shared/inherit-block-fallback';\nimport { useOptions } from '../shared/use-options';\n\n/**\n * Default profile data.\n *\n * @type {Object}\n */\nconst DEFAULT_PROFILE_DATA = {\n\tavatar: 'https://secure.gravatar.com/avatar/default?s=120',\n\twebfinger: '@well@hello.dolly',\n\tname: __( 'Hello Dolly Fan Account', 'activitypub' ),\n\turl: '#',\n};\n\n/**\n * Get normalized profile data.\n *\n * @param {Object} profile Profile data.\n * @return {Object} Normalized profile data.\n */\nfunction getNormalizedProfile( profile ) {\n\tif ( ! profile ) {\n\t\treturn DEFAULT_PROFILE_DATA;\n\t}\n\n\tconst data = { ...DEFAULT_PROFILE_DATA, ...profile };\n\tdata.avatar = data?.icon?.url;\n\n\t// Ensure webfinger always has the @ prefix.\n\tif ( data.webfinger && ! data.webfinger.startsWith( '@' ) ) {\n\t\tdata.webfinger = '@' + data.webfinger;\n\t}\n\n\treturn data;\n}\n\n/**\n * Fetch profile data.\n *\n * @param {number} userId User ID.\n * @return {Promise} Promise resolving with profile data.\n */\nfunction fetchProfile( userId ) {\n\tconst { namespace } = useOptions();\n\tconst fetchOptions = {\n\t\theaders: { Accept: 'application/activity+json' },\n\t\tpath: `/${ namespace }/actors/${ userId }`,\n\t};\n\treturn apiFetch( fetchOptions );\n}\n\n/**\n * Profile component for the editor.\n *\n * @param {Object} props Component props.\n * @return {JSX.Element} Profile component.\n */\nfunction EditorProfile( { profile, userId, buttonText, buttonOnly, buttonSize } ) {\n\tconst { webfinger, avatar, name } = profile;\n\tconst buttonClass = buttonSize === 'small' ? 'is-small' : buttonSize === 'compact' ? 'is-compact' : '';\n\n\tif ( buttonOnly ) {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t);\n\t}\n\n\treturn (\n\t\t
\n\t\t\t{\n\t\t\t
\n\t\t\t\t
{ name }
\n\t\t\t\t
\n\t\t\t\t\t{ webfinger }\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t
\n\t);\n}\n\n/**\n * Edit component.\n *\n * @param {Object} props Component props.\n * @param {Object} props.attributes Block attributes.\n * @param {Function} props.setAttributes Set block attributes.\n * @param {Object} props.context Block context.\n * @param {string} props.context.postType Post type.\n * @param {number} props.context.postId Post ID.\n * @return {JSX.Element} Edit component.\n */\nexport default function Edit( { attributes, setAttributes, context: { postType, postId } } ) {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'activitypub-follow-me-block-wrapper',\n\t} );\n\tconst usersOptions = useUserOptions( { withInherit: true } );\n\tconst { selectedUser, buttonOnly, buttonText, buttonSize } = attributes;\n\tconst isInheritMode = selectedUser === 'inherit';\n\tconst [ profile, setProfile ] = useState( getNormalizedProfile( DEFAULT_PROFILE_DATA ) );\n\tconst userId = selectedUser === 'site' ? 0 : selectedUser;\n\n\tconst authorId = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord( 'postType', postType, postId )?.author;\n\n\t\t\treturn _authorId ?? null;\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tuseEffect( () => {\n\t\t// Fetch profile data when userId changes\n\t\tif ( isInheritMode && ! authorId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst effectiveUserId = isInheritMode ? authorId : userId;\n\t\tfetchProfile( effectiveUserId ).then( ( data ) => {\n\t\t\tsetProfile( getNormalizedProfile( data ) );\n\t\t} );\n\t}, [ userId, authorId, isInheritMode ] );\n\n\tuseEffect( () => {\n\t\t// if there are no users yet, do nothing\n\t\tif ( ! usersOptions.length ) {\n\t\t\treturn;\n\t\t}\n\t\t// ensure that the selected user is in the list of options, if not, select the first available user\n\t\tif ( ! usersOptions.find( ( { value } ) => value === selectedUser ) ) {\n\t\t\tsetAttributes( { selectedUser: usersOptions[ 0 ].value } );\n\t\t}\n\t}, [ selectedUser, usersOptions ] );\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{ usersOptions.length > 1 && (\n\t\t\t\t\t\t setAttributes( { selectedUser: value } ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t setAttributes( { buttonOnly: value } ) }\n\t\t\t\t\t\thelp={ __( 'Only show the follow button without profile information', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t setAttributes( { buttonText: value } ) }\n\t\t\t\t\t/>\n\t\t\t\t\t setAttributes( { buttonSize: value } ) }\n\t\t\t\t\t\thelp={ __( 'Choose the size of the follow button', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\n\t\t\t{ isInheritMode && ! authorId ? (\n\t\t\t\t\n\t\t\t) : (\n\t\t\t\t\n\t\t\t) }\n\t\t
\n\t);\n}\n","import { Card, CardBody } from '@wordpress/components';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\nexport function InheritModeBlockFallback( { name } ) {\n\tconst { enabled } = useOptions();\n\tconst nonAuthorExtra = enabled?.site ? '' : __( 'It will be empty in other non-author contexts.', 'activitypub' );\n\tconst text = sprintf(\n\t\t/* translators: %1$s: block name, %2$s: extra information for non-author context */\n\t\t__( 'This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s', 'activitypub' ),\n\t\tname,\n\t\tnonAuthorExtra\n\t).trim();\n\n\treturn (\n\t\t\n\t\t\t{ createInterpolateElement( text, { strong: } ) }\n\t\t\n\t);\n}\n","/**\n * Returns the ActivityPub options object.\n *\n * @return {Object} The options object.\n */\nexport function useOptions() {\n\treturn window._activityPubOptions || {};\n}\n","import { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\nexport function useUserOptions( { withInherit = false } ) {\n\tconst { enabled } = useOptions();\n\tconst users = enabled?.users ? useSelect( ( select ) => select( 'core' ).getUsers( { who: 'authors' } ) ) : [];\n\treturn useMemo( () => {\n\t\tif ( ! users ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst userKeywords = [];\n\n\t\tif ( enabled?.site ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Site', 'activitypub' ),\n\t\t\t\tvalue: 'site'\n\t\t\t} );\n\t\t}\n\n\t\t// Only show inherit option when explicitly asked for and users are enabled.\n\t\tif ( withInherit && enabled?.users ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Dynamic User', 'activitypub' ),\n\t\t\t\tvalue: 'inherit'\n\t\t\t} );\n\t\t}\n\n\t\treturn users.reduce( ( acc, user ) => {\n\t\t\tacc.push({\n\t\t\t\tlabel: user.name,\n\t\t\t\tvalue: `${ user.id }` // casting to string because that's how the attribute is stored by Gutenberg\n\t\t\t} );\n\t\t\treturn acc;\n\t\t}, userKeywords );\n\t}, [ users ] );\n}","/**\n * @license React\n * react-jsx-runtime.development.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\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'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","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","// 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\t// no module.id needed\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport { people } from '@wordpress/icons';\nimport edit from './edit';\n\n// Register the block\nregisterBlockType( 'activitypub/follow-me', {\n\tedit,\n\ticon: people,\n\tsave: () => null,\n} );\n"],"names":["apiFetch","InspectorControls","useBlockProps","__","useSelect","store","coreStore","SelectControl","PanelBody","ToggleControl","TextControl","useEffect","useState","useUserOptions","InheritModeBlockFallback","useOptions","DEFAULT_PROFILE_DATA","avatar","webfinger","name","url","getNormalizedProfile","profile","data","icon","startsWith","fetchProfile","userId","namespace","fetchOptions","headers","Accept","path","EditorProfile","buttonText","buttonOnly","buttonSize","buttonClass","createElement","className","size","src","alt","title","Edit","attributes","setAttributes","context","postType","postId","blockProps","usersOptions","withInherit","selectedUser","isInheritMode","setProfile","authorId","select","getEditedEntityRecord","_authorId","author","effectiveUserId","then","length","find","value","key","label","options","onChange","checked","help","Card","CardBody","sprintf","createInterpolateElement","enabled","nonAuthorExtra","site","text","trim","strong","window","_activityPubOptions","useMemo","users","getUsers","who","userKeywords","push","reduce","acc","user","id","registerBlockType","people","edit","save"],"sourceRoot":""} \ No newline at end of file diff --git a/build/follow-me/render.php b/build/follow-me/render.php index 0174d0cd8..92e290aa9 100644 --- a/build/follow-me/render.php +++ b/build/follow-me/render.php @@ -97,6 +97,7 @@ class="activitypub-profile__avatar" data-wp-bind--src="context.profile.data.avatar" data-wp-bind--alt="context.profile.data.name" + src="https://secure.gravatar.com/avatar/default?s=120" alt="" />
@@ -133,7 +134,13 @@ class="activitypub-modal__overlay"
+ >
-
' + esc_html( $actor->get_name() ) ); ?> @@ -161,7 +144,7 @@ class="activitypub-modal__close" + >
-
' + esc_html( $actor->get_name() ) ); ?> @@ -161,7 +144,7 @@ class="activitypub-modal__close" \n\t\t\t
\n\t\t);\n\t}\n\n\treturn (\n\t\t
\n\t\t\t{\n\t\t\t
\n\t\t\t\t
{ name }
\n\t\t\t\t
\n\t\t\t\t\t{ webfinger }\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t
\n\t);\n}\n\n/**\n * Edit component.\n *\n * @param {Object} props Component props.\n * @param {Object} props.attributes Block attributes.\n * @param {Function} props.setAttributes Set block attributes.\n * @param {Object} props.context Block context.\n * @param {string} props.context.postType Post type.\n * @param {number} props.context.postId Post ID.\n * @return {JSX.Element} Edit component.\n */\nexport default function Edit( { attributes, setAttributes, context: { postType, postId } } ) {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'activitypub-follow-me-block-wrapper',\n\t} );\n\tconst usersOptions = useUserOptions( { withInherit: true } );\n\tconst { selectedUser, buttonOnly, buttonText, buttonSize } = attributes;\n\tconst isInheritMode = selectedUser === 'inherit';\n\tconst [ profile, setProfile ] = useState( getNormalizedProfile( DEFAULT_PROFILE_DATA ) );\n\tconst userId = selectedUser === 'site' ? 0 : selectedUser;\n\n\tconst authorId = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord( 'postType', postType, postId )?.author;\n\n\t\t\treturn _authorId ?? null;\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tuseEffect( () => {\n\t\t// Fetch profile data when userId changes\n\t\tif ( isInheritMode && ! authorId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst effectiveUserId = isInheritMode ? authorId : userId;\n\t\tfetchProfile( effectiveUserId ).then( ( data ) => {\n\t\t\tsetProfile( getNormalizedProfile( data ) );\n\t\t} );\n\t}, [ userId, authorId, isInheritMode ] );\n\n\tuseEffect( () => {\n\t\t// if there are no users yet, do nothing\n\t\tif ( ! usersOptions.length ) {\n\t\t\treturn;\n\t\t}\n\t\t// ensure that the selected user is in the list of options, if not, select the first available user\n\t\tif ( ! usersOptions.find( ( { value } ) => value === selectedUser ) ) {\n\t\t\tsetAttributes( { selectedUser: usersOptions[ 0 ].value } );\n\t\t}\n\t}, [ selectedUser, usersOptions ] );\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{ usersOptions.length > 1 && (\n\t\t\t\t\t\t setAttributes( { selectedUser: value } ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t setAttributes( { buttonOnly: value } ) }\n\t\t\t\t\t\thelp={ __( 'Only show the follow button without profile information', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t setAttributes( { buttonText: value } ) }\n\t\t\t\t\t/>\n\t\t\t\t\t setAttributes( { buttonSize: value } ) }\n\t\t\t\t\t\thelp={ __( 'Choose the size of the follow button', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\n\t\t\t{ isInheritMode && ! authorId ? (\n\t\t\t\t\n\t\t\t) : (\n\t\t\t\t\n\t\t\t) }\n\t\t
\n\t);\n}\n","import { Card, CardBody } from '@wordpress/components';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\nexport function InheritModeBlockFallback( { name } ) {\n\tconst { enabled } = useOptions();\n\tconst nonAuthorExtra = enabled?.site ? '' : __( 'It will be empty in other non-author contexts.', 'activitypub' );\n\tconst text = sprintf(\n\t\t/* translators: %1$s: block name, %2$s: extra information for non-author context */\n\t\t__( 'This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s', 'activitypub' ),\n\t\tname,\n\t\tnonAuthorExtra\n\t).trim();\n\n\treturn (\n\t\t\n\t\t\t{ createInterpolateElement( text, { strong: } ) }\n\t\t\n\t);\n}\n","/**\n * Returns the ActivityPub options object.\n *\n * @return {Object} The options object.\n */\nexport function useOptions() {\n\treturn window._activityPubOptions || {};\n}\n","import { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\nexport function useUserOptions( { withInherit = false } ) {\n\tconst { enabled } = useOptions();\n\tconst users = enabled?.users ? useSelect( ( select ) => select( 'core' ).getUsers( { who: 'authors' } ) ) : [];\n\treturn useMemo( () => {\n\t\tif ( ! users ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst userKeywords = [];\n\n\t\tif ( enabled?.site ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Site', 'activitypub' ),\n\t\t\t\tvalue: 'site'\n\t\t\t} );\n\t\t}\n\n\t\t// Only show inherit option when explicitly asked for and users are enabled.\n\t\tif ( withInherit && enabled?.users ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Dynamic User', 'activitypub' ),\n\t\t\t\tvalue: 'inherit'\n\t\t\t} );\n\t\t}\n\n\t\treturn users.reduce( ( acc, user ) => {\n\t\t\tacc.push({\n\t\t\t\tlabel: user.name,\n\t\t\t\tvalue: `${ user.id }` // casting to string because that's how the attribute is stored by Gutenberg\n\t\t\t} );\n\t\t\treturn acc;\n\t\t}, userKeywords );\n\t}, [ users ] );\n}","/**\n * @license React\n * react-jsx-runtime.development.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\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'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","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","// 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\t// no module.id needed\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport { people } from '@wordpress/icons';\nimport edit from './edit';\n\n// Register the block\nregisterBlockType( 'activitypub/follow-me', {\n\tedit,\n\ticon: people,\n\tsave: () => null,\n} );\n"],"names":["apiFetch","InspectorControls","useBlockProps","__","useSelect","store","coreStore","SelectControl","PanelBody","ToggleControl","TextControl","useEffect","useState","useUserOptions","InheritModeBlockFallback","useOptions","DEFAULT_PROFILE_DATA","avatar","webfinger","name","url","getNormalizedProfile","profile","data","icon","startsWith","fetchProfile","userId","namespace","fetchOptions","headers","Accept","path","EditorProfile","buttonText","buttonOnly","buttonSize","buttonClass","createElement","className","size","src","alt","title","Edit","attributes","setAttributes","context","postType","postId","blockProps","usersOptions","withInherit","selectedUser","isInheritMode","setProfile","authorId","select","getEditedEntityRecord","_authorId","author","effectiveUserId","then","length","find","value","key","label","options","onChange","checked","help","Card","CardBody","sprintf","createInterpolateElement","enabled","nonAuthorExtra","site","text","trim","strong","window","_activityPubOptions","useMemo","users","getUsers","who","userKeywords","push","reduce","acc","user","id","registerBlockType","people","edit","save"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"follow-me/index.js","mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACkD;AACF;AAChD,4BAA4B,sDAAI,CAAC,sDAAG;AACpC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA;AACA,GAAG;AACH,CAAC;AACD,iEAAe,MAAM,EAAC;AACtB;;;;;;;;;;;;;;;;ACdgD;;AAEhD;AACA;AACA;AACA;AACA,MAAMC,EAAE,GAAG;EACVC,UAAU,EAAE;IACXC,UAAU,EAAE;MACXC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE;IACV,CAAC;IACDC,UAAU,EAAE;MACXF,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE,SAAS;MAClBE,IAAI,EAAE,CAAE,OAAO,EAAE,SAAS,EAAE,SAAS;IACtC;EACD,CAAC;EAEDC,UAAUA,CAAEN,UAAU,EAAG;IACxB;IACA,OAAO,CAAC,CAAEA,UAAU,CAACC,UAAU;EAChC,CAAC;EAEDM,OAAOA,CAAEP,UAAU,EAAG;IACrB,MAAM;MAAEC,UAAU;MAAEG,UAAU;MAAE,GAAGI;IAAc,CAAC,GAAGR,UAAU;;IAE/D;IACA,IAAIS,SAAS,GAAG,EAAE;IAClB,IAAKL,UAAU,KAAK,OAAO,EAAG;MAC7BK,SAAS,GAAG,UAAU;IACvB,CAAC,MAAM,IAAKL,UAAU,KAAK,SAAS,EAAG;MACtCK,SAAS,GAAG,YAAY;IACzB;;IAEA;IACA,MAAMC,WAAW,GAAGZ,8DAAW,CAAE,aAAa,EAAE;MAC/CW,SAAS;MACTE,OAAO,EAAE,QAAQ;MACjBC,IAAI,EAAEX;IAC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Y,mBAAO,CAAC,oBAAO;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,iGAAiG,eAAe;AAChH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA,KAAK,GAAG;;AAER,kDAAkD;AAClD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,4BAA4B;AAC5B;AACA,qCAAqC;;AAErC,gCAAgC;AAChC;AACA;;AAEA,gCAAgC;;AAEhC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;;AAGJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;;AAGF;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,sBAAsB;AACtB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,iCAAiC;AACjC;AACA,SAAS;AACT,2BAA2B;AAC3B;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;;AAE3D;AACA;;AAEA;AACA,yDAAyD;AACzD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA,gFAAgF;AAChF;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;;;AAGlB;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA,IAAI;;;AAGJ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2HAA2H;AAC3H;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA,oEAAoE;;AAEpE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC;;AAEjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,eAAe;AAC1B,WAAW,GAAG;AACd,WAAW,GAAG;AACd;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;;AAER;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;;AAEA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA,oBAAoB;AACpB,2DAA2D,UAAU;AACrE,yBAAyB,UAAU;AACnC;AACA,aAAa,UAAU;AACvB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,YAAY,SAAS;AACrB;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,6DAA6D;AAC7D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,iBAAiB;AACvC;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN,4CAA4C;;AAE5C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;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AAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;ACNsD;AACZ;AACH;AACb;AACA;;AAE1B;AACAS,oEAAiB,CAAE,uBAAuB,EAAE;EAC3CE,UAAU;EACVC,IAAI;EACJzE,IAAI,EAAEuE,wDAAM;EACZvB,IAAIA,+CAAAA;AACL,CAAE,CAAC,C","sources":["webpack://wordpress-activitypub/./node_modules/@wordpress/icons/build-module/library/people.js","webpack://wordpress-activitypub/./src/follow-me/deprecation.js","webpack://wordpress-activitypub/./src/follow-me/edit.js","webpack://wordpress-activitypub/./src/follow-me/save.js","webpack://wordpress-activitypub/./src/shared/inherit-block-fallback.js","webpack://wordpress-activitypub/./src/shared/use-options.js","webpack://wordpress-activitypub/./src/shared/use-user-options.js","webpack://wordpress-activitypub/./node_modules/react/cjs/react-jsx-runtime.development.js","webpack://wordpress-activitypub/./node_modules/react/jsx-runtime.js","webpack://wordpress-activitypub/external window \"React\"","webpack://wordpress-activitypub/external window [\"wp\",\"apiFetch\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blockEditor\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blocks\"]","webpack://wordpress-activitypub/external window [\"wp\",\"components\"]","webpack://wordpress-activitypub/external window [\"wp\",\"coreData\"]","webpack://wordpress-activitypub/external window [\"wp\",\"data\"]","webpack://wordpress-activitypub/external window [\"wp\",\"element\"]","webpack://wordpress-activitypub/external window [\"wp\",\"i18n\"]","webpack://wordpress-activitypub/external window [\"wp\",\"primitives\"]","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/compat get default export","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/./src/follow-me/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst people = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z\",\n fillRule: \"evenodd\"\n })\n});\nexport default people;\n//# sourceMappingURL=people.js.map","import { createBlock } from '@wordpress/blocks';\n\n/**\n * Deprecation for the Follow Me block to use a core button block instead of the custom button.\n * This handles the migration of the buttonText and buttonSize attributes to the innerBlock.\n */\nconst v1 = {\n\tattributes: {\n\t\tbuttonText: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'Follow',\n\t\t},\n\t\tbuttonSize: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'default',\n\t\t\tenum: [ 'small', 'default', 'compact' ],\n\t\t},\n\t},\n\n\tisEligible( attributes ) {\n\t\t// Run migration if buttonText attribute exists.\n\t\treturn !! attributes.buttonText;\n\t},\n\n\tmigrate( attributes ) {\n\t\tconst { buttonText, buttonSize, ...newAttributes } = attributes;\n\n\t\t// Map buttonSize to core/button className.\n\t\tlet className = '';\n\t\tif ( buttonSize === 'small' ) {\n\t\t\tclassName = 'is-small';\n\t\t} else if ( buttonSize === 'compact' ) {\n\t\t\tclassName = 'is-compact';\n\t\t}\n\n\t\t// Create a core button block with the buttonText and buttonSize.\n\t\tconst buttonBlock = createBlock( 'core/button', {\n\t\t\tclassName,\n\t\t\ttagName: 'button',\n\t\t\ttext: buttonText,\n\t\t} );\n\n\t\treturn [ newAttributes, [ buttonBlock ] ];\n\t},\n};\n\nexport default [ v1 ];\n","import apiFetch from '@wordpress/api-fetch';\nimport { InspectorControls, useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { SelectControl, PanelBody, ToggleControl } from '@wordpress/components';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useUserOptions } from '../shared/use-user-options';\nimport { InheritModeBlockFallback } from '../shared/inherit-block-fallback';\nimport { useOptions } from '../shared/use-options';\n\n/**\n * Default profile data.\n *\n * @type {Object}\n */\nconst DEFAULT_PROFILE_DATA = {\n\tavatar: 'https://secure.gravatar.com/avatar/default?s=120',\n\twebfinger: '@well@hello.dolly',\n\tname: __( 'Hello Dolly Fan Account', 'activitypub' ),\n\turl: '#',\n};\n\n/**\n * Get normalized profile data.\n *\n * @param {Object} profile Profile data.\n * @return {Object} Normalized profile data.\n */\nfunction getNormalizedProfile( profile ) {\n\tif ( ! profile ) {\n\t\treturn DEFAULT_PROFILE_DATA;\n\t}\n\n\tconst data = { ...DEFAULT_PROFILE_DATA, ...profile };\n\tdata.avatar = data?.icon?.url;\n\n\t// Ensure webfinger always has the @ prefix.\n\tif ( data.webfinger && ! data.webfinger.startsWith( '@' ) ) {\n\t\tdata.webfinger = '@' + data.webfinger;\n\t}\n\n\treturn data;\n}\n\n/**\n * Fetch profile data.\n *\n * @param {number} userId User ID.\n * @return {Promise} Promise resolving with profile data.\n */\nfunction fetchProfile( userId ) {\n\tconst { namespace } = useOptions();\n\tconst fetchOptions = {\n\t\theaders: { Accept: 'application/activity+json' },\n\t\tpath: `/${ namespace }/actors/${ userId }`,\n\t};\n\treturn apiFetch( fetchOptions );\n}\n\n/**\n * Profile component for the editor.\n *\n * @param {Object} props Component props.\n * @return {JSX.Element} Profile component.\n */\nfunction EditorProfile( { profile, buttonOnly, innerBlocksProps } ) {\n\tconst { webfinger, avatar, name } = profile;\n\n\tif ( buttonOnly ) {\n\t\treturn (\n\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\treturn (\n\t\t
\n\t\t\t{\n\t\t\t
\n\t\t\t\t
{ name }
\n\t\t\t\t
\n\t\t\t\t\t{ webfinger }\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t
\n\t);\n}\n\n/**\n * Edit component.\n *\n * @param {Object} props Component props.\n * @param {Object} props.attributes Block attributes.\n * @param {Function} props.setAttributes Set block attributes.\n * @param {Object} props.context Block context.\n * @param {string} props.context.postType Post type.\n * @param {number} props.context.postId Post ID.\n * @return {JSX.Element} Edit component.\n */\nexport default function Edit( { attributes, setAttributes, context: { postType, postId } } ) {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'activitypub-follow-me-block-wrapper',\n\t} );\n\tconst usersOptions = useUserOptions( { withInherit: true } );\n\tconst { selectedUser, buttonOnly } = attributes;\n\tconst isInheritMode = selectedUser === 'inherit';\n\tconst [ profile, setProfile ] = useState( getNormalizedProfile( DEFAULT_PROFILE_DATA ) );\n\tconst userId = selectedUser === 'site' ? 0 : selectedUser;\n\n\tconst TEMPLATE = [ [ 'core/button', { text: __( 'Follow', 'activitypub' ), tagName: 'button' } ] ];\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{},\n\t\t{\n\t\t\tallowedBlocks: [ 'core/button' ],\n\t\t\ttemplate: TEMPLATE,\n\t\t\ttemplateLock: false,\n\t\t\trenderAppender: false,\n\t\t}\n\t);\n\n\tconst authorId = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord( 'postType', postType, postId )?.author;\n\n\t\t\treturn _authorId ?? null;\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tuseEffect( () => {\n\t\t// Fetch profile data when userId changes.\n\t\tif ( isInheritMode && ! authorId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst effectiveUserId = isInheritMode ? authorId : userId;\n\t\tfetchProfile( effectiveUserId ).then( ( data ) => {\n\t\t\tsetProfile( getNormalizedProfile( data ) );\n\t\t} );\n\t}, [ userId, authorId, isInheritMode ] );\n\n\tuseEffect( () => {\n\t\t// If there are no users yet, do nothing.\n\t\tif ( ! usersOptions.length ) {\n\t\t\treturn;\n\t\t}\n\t\t// Ensure that the selected user is in the list of options, if not, select the first available user.\n\t\tif ( ! usersOptions.find( ( { value } ) => value === selectedUser ) ) {\n\t\t\tsetAttributes( { selectedUser: usersOptions[ 0 ].value } );\n\t\t}\n\t}, [ selectedUser, usersOptions ] );\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{ usersOptions.length > 1 && (\n\t\t\t\t\t\t setAttributes( { selectedUser: value } ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t setAttributes( { buttonOnly: value } ) }\n\t\t\t\t\t\thelp={ __( 'Only show the follow button without profile information', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\n\t\t\t{ isInheritMode && ! authorId ? (\n\t\t\t\t\n\t\t\t) : (\n\t\t\t\t\n\t\t\t) }\n\t\t
\n\t);\n}\n","import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\n\n/**\n * Save component for the Follow Me block.\n *\n * This component ensures that inner blocks (the button) are properly saved.\n *\n * @return {JSX.Element|null} Save component.\n */\nfunction save() {\n\tconst blockProps = useBlockProps.save();\n\tconst innerBlocksProps = useInnerBlocksProps.save( blockProps );\n\n\treturn
;\n}\n\nexport default save;\n","import { Card, CardBody } from '@wordpress/components';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\nexport function InheritModeBlockFallback( { name } ) {\n\tconst { enabled } = useOptions();\n\tconst nonAuthorExtra = enabled?.site ? '' : __( 'It will be empty in other non-author contexts.', 'activitypub' );\n\tconst text = sprintf(\n\t\t/* translators: %1$s: block name, %2$s: extra information for non-author context */\n\t\t__( 'This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s', 'activitypub' ),\n\t\tname,\n\t\tnonAuthorExtra\n\t).trim();\n\n\treturn (\n\t\t\n\t\t\t{ createInterpolateElement( text, { strong: } ) }\n\t\t\n\t);\n}\n","/**\n * Returns the ActivityPub options object.\n *\n * @return {Object} The options object.\n */\nexport function useOptions() {\n\treturn window._activityPubOptions || {};\n}\n","import { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\nexport function useUserOptions( { withInherit = false } ) {\n\tconst { enabled } = useOptions();\n\tconst users = enabled?.users ? useSelect( ( select ) => select( 'core' ).getUsers( { who: 'authors' } ) ) : [];\n\treturn useMemo( () => {\n\t\tif ( ! users ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst userKeywords = [];\n\n\t\tif ( enabled?.site ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Site', 'activitypub' ),\n\t\t\t\tvalue: 'site'\n\t\t\t} );\n\t\t}\n\n\t\t// Only show inherit option when explicitly asked for and users are enabled.\n\t\tif ( withInherit && enabled?.users ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Dynamic User', 'activitypub' ),\n\t\t\t\tvalue: 'inherit'\n\t\t\t} );\n\t\t}\n\n\t\treturn users.reduce( ( acc, user ) => {\n\t\t\tacc.push({\n\t\t\t\tlabel: user.name,\n\t\t\t\tvalue: `${ user.id }` // casting to string because that's how the attribute is stored by Gutenberg\n\t\t\t} );\n\t\t\treturn acc;\n\t\t}, userKeywords );\n\t}, [ users ] );\n}","/**\n * @license React\n * react-jsx-runtime.development.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\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'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","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","// 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\t// no module.id needed\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport { people } from '@wordpress/icons';\nimport deprecated from './deprecation';\nimport edit from './edit';\nimport save from './save';\n\n// Register the block.\nregisterBlockType( 'activitypub/follow-me', {\n\tdeprecated,\n\tedit,\n\ticon: people,\n\tsave,\n} );\n"],"names":["createBlock","v1","attributes","buttonText","type","default","buttonSize","enum","isEligible","migrate","newAttributes","className","buttonBlock","tagName","text","apiFetch","InspectorControls","useBlockProps","useInnerBlocksProps","__","useSelect","store","coreStore","SelectControl","PanelBody","ToggleControl","useEffect","useState","useUserOptions","InheritModeBlockFallback","useOptions","DEFAULT_PROFILE_DATA","avatar","webfinger","name","url","getNormalizedProfile","profile","data","icon","startsWith","fetchProfile","userId","namespace","fetchOptions","headers","Accept","path","EditorProfile","buttonOnly","innerBlocksProps","createElement","src","alt","title","Edit","setAttributes","context","postType","postId","blockProps","usersOptions","withInherit","selectedUser","isInheritMode","setProfile","TEMPLATE","allowedBlocks","template","templateLock","renderAppender","authorId","select","getEditedEntityRecord","_authorId","author","effectiveUserId","then","length","find","value","key","label","options","onChange","checked","help","save","Card","CardBody","sprintf","createInterpolateElement","enabled","nonAuthorExtra","site","trim","strong","window","_activityPubOptions","useMemo","users","getUsers","who","userKeywords","push","reduce","acc","user","id","registerBlockType","people","deprecated","edit"],"sourceRoot":""} \ No newline at end of file diff --git a/build/follow-me/render.php b/build/follow-me/render.php index bb7cf582c..ddebffa85 100644 --- a/build/follow-me/render.php +++ b/build/follow-me/render.php @@ -5,6 +5,8 @@ * @package ActivityPub */ +use Activitypub\Blocks; + /* @var array $attributes Block attributes. */ $attributes = wp_parse_args( $attributes ); @@ -12,8 +14,6 @@ $selected_user = $attributes['selectedUser'] ?? 'site'; $user_id = 'site' === $selected_user ? 0 : intval( $selected_user ); $button_only = $attributes['buttonOnly'] ?? false; -$button_text = $attributes['buttonText'] ?? __( 'Follow', 'activitypub' ); -$button_size = $attributes['buttonSize'] ?? 'default'; // Generate a unique ID for the block. $block_id = 'activitypub-follow-me-block-' . wp_unique_id(); @@ -25,13 +25,6 @@ // Get button style from block attributes. $button_style = $attributes['style'] ?? array(); -$button_class = ''; -if ( 'small' === $button_size ) { - $button_class = 'is-small'; -} elseif ( 'compact' === $button_size ) { - $button_class = 'is-compact'; -} - $actor = \Activitypub\Collection\Actors::get_by_id( $user_id ); // Set up the Interactivity API state. @@ -78,6 +71,13 @@ ) ); +/* @var string $content Inner blocks content. */ +if ( empty( $content ) ) { + $button_text = $attributes['buttonText'] ?? __( 'Follow', 'activitypub' ); + $content = '
'; +} +$content = Blocks::add_directions_to_button( $content, $attributes ); + ?>
@@ -96,13 +96,7 @@ class="activitypub-profile__avatar"
- +
.activitypub-follow-me-block-wrapper .activitypub-profile,.has-border>.activitypub-follow-me-block-wrapper .activitypub-profile{padding-left:1em;padding-right:1em}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1em;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{flex:1;margin-right:1em;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle{color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__follow{background-color:var(--wp--preset--color--black);color:var(--wp--preset--color--white);flex-shrink:0}.activitypub-follow-me-block-wrapper .activitypub-profile__follow:not(:only-child){margin-left:1em}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:#fff;border-radius:4px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.activitypub-modal__header{align-items:center;border-bottom:1px solid #e2e4e7;display:flex;flex-shrink:0;justify-content:space-between;padding:1em 1em 1em 1.5em}.activitypub-modal__title{font-size:1.3em;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__close{align-items:center;background:none;border:none;color:#555;cursor:pointer;display:flex;justify-content:center;padding:.5em}.activitypub-modal__close:hover{background:none;color:#000}.activitypub-modal__close:active{background:none;border:none;color:#000;padding:.5em}.activitypub-modal__content{overflow-y:auto}.activitypub-dialog__section{border-bottom:1px solid #f0f0f0;padding:1em 1.5em}.activitypub-dialog__section:last-child{border-bottom:none}.activitypub-dialog__section h4{font-size:1.1em;margin-bottom:.5em;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:.95em;margin-bottom:1em}.activitypub-dialog__description code{background:#f0f0f0;border-radius:3px;font-size:.9em;padding:.1em .3em}.activitypub-dialog__button-group{display:flex;margin-bottom:.5em;width:100%}.activitypub-dialog__button-group input{border:1px solid #ddd;border-radius:4px 0 0 4px;flex:1;font-size:1em;margin:0}.activitypub-dialog__button-group input[aria-invalid=true]{border-color:#cc1818}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important}.activitypub-dialog__error{color:#cc1818;font-size:.9em;margin-top:.5em}.components-button.small{font-size:.8em;padding:.25em .5em}.components-button.compact{font-size:.9em;padding:.4em .8em}body.modal-open{overflow:hidden}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}} +.activitypub-follow-me-block-wrapper{display:block;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{align-items:center;display:flex;padding:1em 0}.has-background>.activitypub-follow-me-block-wrapper .activitypub-profile,.has-border>.activitypub-follow-me-block-wrapper .activitypub-profile{padding-left:1em;padding-right:1em}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1em;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{flex:1;margin-right:1em;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle{color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button{flex-shrink:0;margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button:not(:only-child){margin-left:1em}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8em;padding:.25em .5em}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9em;padding:.4em .8em}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:#fff;border-radius:4px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.activitypub-modal__header{align-items:center;border-bottom:1px solid #e2e4e7;display:flex;flex-shrink:0;justify-content:space-between;padding:1em 1em 1em 1.5em}.activitypub-modal__title{font-size:1.3em;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__close{align-items:center;background:none;border:none;color:#555;cursor:pointer;display:flex;justify-content:center;padding:.5em}.activitypub-modal__close:hover{background:none;color:#000}.activitypub-modal__close:active{background:none;border:none;color:#000;padding:.5em}.activitypub-modal__content{overflow-y:auto}.activitypub-dialog__section{border-bottom:1px solid #f0f0f0;padding:1em 1.5em}.activitypub-dialog__section:last-child{border-bottom:none}.activitypub-dialog__section h4{font-size:1.1em;margin-bottom:.5em;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:.95em;margin-bottom:1em}.activitypub-dialog__description code{background:#f0f0f0;border-radius:3px;font-size:.9em;padding:.1em .3em}.activitypub-dialog__button-group{display:flex;margin-bottom:.5em;width:100%}.activitypub-dialog__button-group input{border:1px solid #ddd;border-radius:4px 0 0 4px;flex:1;font-size:1em;margin:0}.activitypub-dialog__button-group input[aria-invalid=true]{border-color:#cc1818}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important}.activitypub-dialog__error{color:#cc1818;font-size:.9em;margin-top:.5em}body.modal-open{overflow:hidden}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}} diff --git a/build/follow-me/style-view.css.map b/build/follow-me/style-view.css.map index e917cad43..b7c8a8d71 100644 --- a/build/follow-me/style-view.css.map +++ b/build/follow-me/style-view.css.map @@ -1 +1 @@ -{"version":3,"file":"follow-me/style-view.css","mappings":";;;AAAA;EACC;EACA;AACD;;AAEA;EACC;EACA;EACA;AACD;AACC;EAEC;EACA;AAAF;AAGC;EACC;EACA;EACA;EACA;EACA;KAAA;AADF;AAIC;EACC;EACA;EACA;AAFF;AAKC;EACC;EACA;EACA;EACA;AAHF;AAMC;EACC;EACA;EACA;EACA;AAJF;AAOC;EACC;EACA;EACA;AALF;AAOE;EACC;AALH;;AAWC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AARF;AAUE;EACC;AARH;AAYC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAVF;AAaC;EACC;EACA;EACA;EACA;EACA;EACA;AAXF;AAcC;EACC;EACA;EACA;EACA;AAZF;AAeC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAbF;AAeE;EACC;EACA;AAbH;AAgBE;EACC;EACA;EACA;EACA;AAdH;AAkBC;EACC;AAhBF;;AAqBC;EACC;EACA;AAlBF;AAoBE;EACC;AAlBH;AAqBE;EACC;EACA;EACA;AAnBH;AAuBC;EACC;EACA;EACA;AArBF;AAuBE;EACC;EACA;EACA;EACA;AArBH;AAyBC;EACC;EACA;EACA;AAvBF;AAyBE;EACC;EACA;EACA;EACA;EACA;AAvBH;AAyBG;EACC;AAvBJ;AA2BE;EACC;EACA;AAzBH;AA6BC;EACC;EACA;EACA;AA3BF;;AAgCC;EACC;EACA;AA7BF;AAgCC;EACC;EACA;AA9BF;;AAkCA;EACC;AA/BD;;AAkCA;AACA;EACC;IACC;IACA;EA/BA;EAiCD;IACC;IACA;EA/BA;AACF,C","sources":["webpack://wordpress-activitypub/./src/follow-me/style.scss"],"sourcesContent":[".activitypub-follow-me-block-wrapper {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.activitypub-follow-me-block-wrapper .activitypub-profile {\n\tdisplay: flex;\n\talign-items: center;\n\tpadding: 1em 0;\n\n\t.has-background > &,\n\t.has-border > & {\n\t\tpadding-left: 1em;\n\t\tpadding-right: 1em;\n\t}\n\n\t&__avatar {\n\t\twidth: 75px;\n\t\theight: 75px;\n\t\tborder-radius: 50%;\n\t\tmargin-right: 1em;\n\t\tobject-fit: cover;\n\t}\n\n\t&__content {\n\t\tflex: 1;\n\t\tmargin-right: 1em;\n\t\tmin-width: 0;\n\t}\n\n\t&__name {\n\t\tfont-size: 1.25em;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t&__handle {\n\t\tcolor: inherit;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t&__follow {\n\t\tflex-shrink: 0;\n\t\tbackground-color: var(--wp--preset--color--black);\n\t\tcolor: var(--wp--preset--color--white);\n\n\t\t&:not(:only-child) {\n\t\t\tmargin-left: 1em;\n\t\t}\n\t}\n}\n\n.activitypub-modal {\n\t&__overlay {\n\t\tposition: fixed;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tbackground-color: rgba(0, 0, 0, 0.5);\n\t\tz-index: 100000;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tpadding: 1rem;\n\n\t\t&[hidden] {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&__frame {\n\t\tmax-width: 660px;\n\t\twidth: 100%;\n\t\tbackground-color: #fff;\n\t\tborder-radius: 4px;\n\t\tbox-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);\n\t\toverflow: hidden;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmax-height: calc(100vh - 2rem);\n\t\tanimation: activitypub-modal-appear 0.2s ease-out;\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\tpadding: 1em 1em 1em 1.5em;\n\t\tborder-bottom: 1px solid #e2e4e7;\n\t\tflex-shrink: 0;\n\t}\n\n\t&__title {\n\t\tmargin: 0 !important;\n\t\tfont-size: 1.3em;\n\t\tfont-weight: 600;\n\t\tline-height: 1.4;\n\t}\n\n\t&__close {\n\t\tbackground: none;\n\t\tborder: none;\n\t\tpadding: 0.5em;\n\t\tcursor: pointer;\n\t\tcolor: #555;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t&:hover {\n\t\t\tbackground: none;\n\t\t\tcolor: #000;\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #000;\n\t\t\tpadding: 0.5em;\n\t\t}\n\t}\n\n\t&__content {\n\t\toverflow-y: auto;\n\t}\n}\n\n.activitypub-dialog {\n\t&__section {\n\t\tpadding: 1em 1.5em;\n\t\tborder-bottom: 1px solid #f0f0f0;\n\n\t\t&:last-child {\n\t\t\tborder-bottom: none;\n\t\t}\n\n\t\th4 {\n\t\t\tmargin-top: 0;\n\t\t\tmargin-bottom: 0.5em;\n\t\t\tfont-size: 1.1em;\n\t\t}\n\t}\n\n\t&__description {\n\t\tmargin-bottom: 1em;\n\t\tcolor: inherit;\n\t\tfont-size: 0.95em;\n\n\t\tcode {\n\t\t\tbackground: #f0f0f0;\n\t\t\tpadding: 0.1em 0.3em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t}\n\t}\n\n\t&__button-group {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\tmargin-bottom: 0.5em;\n\n\t\tinput {\n\t\t\tflex: 1;\n\t\t\tborder: 1px solid #ddd;\n\t\t\tborder-radius: 4px 0 0 4px;\n\t\t\tfont-size: 1em;\n\t\t\tmargin: 0;\n\n\t\t\t&[aria-invalid=\"true\"] {\n\t\t\t\tborder-color: #cc1818;\n\t\t\t}\n\t\t}\n\n\t\tbutton {\n\t\t\tborder-radius: 0 4px 4px 0 !important;\n\t\t\tmargin-left: -1px !important;\n\t\t}\n\t}\n\n\t&__error {\n\t\tcolor: #cc1818;\n\t\tfont-size: 0.9em;\n\t\tmargin-top: 0.5em;\n\t}\n}\n\n.components-button {\n\t&.small {\n\t\tpadding: 0.25em 0.5em;\n\t\tfont-size: 0.8em;\n\t}\n\n\t&.compact {\n\t\tpadding: 0.4em 0.8em;\n\t\tfont-size: 0.9em;\n\t}\n}\n\nbody.modal-open {\n\toverflow: hidden;\n}\n\n/* Animation for modal */\n@keyframes activitypub-modal-appear {\n\tfrom {\n\t\topacity: 0;\n\t\ttransform: translateY(20px);\n\t}\n\tto {\n\t\topacity: 1;\n\t\ttransform: translateY(0);\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"follow-me/style-view.css","mappings":";;;AAAA;EACC;EACA;AACD;;AAEA;EACC;EACA;EACA;AACD;AACC;EAEC;EACA;AAAF;AAGC;EACC;EACA;EACA;EACA;EACA;KAAA;AADF;AAIC;EACC;EACA;EACA;AAFF;AAKC;EACC;EACA;EACA;EACA;AAHF;AAMC;EACC;EACA;EACA;EACA;AAJF;AAOC;EACC;EACA;AALF;AAOE;EACC;AALH;AASC;EACC;AAPF;AAUC;EACC;EACA;AARF;AAWC;EACC;EACA;AATF;;AAcC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAXF;AAaE;EACC;AAXH;AAeC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAbF;AAgBC;EACC;EACA;EACA;EACA;EACA;EACA;AAdF;AAiBC;EACC;EACA;EACA;EACA;AAfF;AAkBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAhBF;AAkBE;EACC;EACA;AAhBH;AAmBE;EACC;EACA;EACA;EACA;AAjBH;AAqBC;EACC;AAnBF;;AAwBC;EACC;EACA;AArBF;AAuBE;EACC;AArBH;AAwBE;EACC;EACA;EACA;AAtBH;AA0BC;EACC;EACA;EACA;AAxBF;AA0BE;EACC;EACA;EACA;EACA;AAxBH;AA4BC;EACC;EACA;EACA;AA1BF;AA4BE;EACC;EACA;EACA;EACA;EACA;AA1BH;AA4BG;EACC;AA1BJ;AA8BE;EACC;EACA;AA5BH;AAgCC;EACC;EACA;EACA;AA9BF;;AAkCA;EACC;AA/BD;;AAkCA;EACC;IACC;IACA;EA/BA;EAiCD;IACC;IACA;EA/BA;AACF,C","sources":["webpack://wordpress-activitypub/./src/follow-me/style.scss"],"sourcesContent":[".activitypub-follow-me-block-wrapper {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.activitypub-follow-me-block-wrapper .activitypub-profile {\n\tdisplay: flex;\n\talign-items: center;\n\tpadding: 1em 0;\n\n\t.has-background > &,\n\t.has-border > & {\n\t\tpadding-left: 1em;\n\t\tpadding-right: 1em;\n\t}\n\n\t&__avatar {\n\t\twidth: 75px;\n\t\theight: 75px;\n\t\tborder-radius: 50%;\n\t\tmargin-right: 1em;\n\t\tobject-fit: cover;\n\t}\n\n\t&__content {\n\t\tflex: 1;\n\t\tmargin-right: 1em;\n\t\tmin-width: 0;\n\t}\n\n\t&__name {\n\t\tfont-size: 1.25em;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t&__handle {\n\t\tcolor: inherit;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t.wp-block-button {\n\t\tflex-shrink: 0;\n\t\tmargin: 0;\n\n\t\t&:not(:only-child) {\n\t\t\tmargin-left: 1em;\n\t\t}\n\t}\n\n\t.wp-block-button__link {\n\t\tmargin: 0;\n\t}\n\n\t.is-small {\n\t\tpadding: 0.25em 0.5em;\n\t\tfont-size: 0.8em;\n\t}\n\n\t.is-compact {\n\t\tpadding: 0.4em 0.8em;\n\t\tfont-size: 0.9em;\n\t}\n}\n\n.activitypub-modal {\n\t&__overlay {\n\t\tposition: fixed;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tbackground-color: rgba(0, 0, 0, 0.5);\n\t\tz-index: 100000;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tpadding: 1rem;\n\n\t\t&[hidden] {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&__frame {\n\t\tmax-width: 660px;\n\t\twidth: 100%;\n\t\tbackground-color: #fff;\n\t\tborder-radius: 4px;\n\t\tbox-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);\n\t\toverflow: hidden;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmax-height: calc(100vh - 2rem);\n\t\tanimation: activitypub-modal-appear 0.2s ease-out;\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\tpadding: 1em 1em 1em 1.5em;\n\t\tborder-bottom: 1px solid #e2e4e7;\n\t\tflex-shrink: 0;\n\t}\n\n\t&__title {\n\t\tmargin: 0 !important;\n\t\tfont-size: 1.3em;\n\t\tfont-weight: 600;\n\t\tline-height: 1.4;\n\t}\n\n\t&__close {\n\t\tbackground: none;\n\t\tborder: none;\n\t\tpadding: 0.5em;\n\t\tcursor: pointer;\n\t\tcolor: #555;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t&:hover {\n\t\t\tbackground: none;\n\t\t\tcolor: #000;\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #000;\n\t\t\tpadding: 0.5em;\n\t\t}\n\t}\n\n\t&__content {\n\t\toverflow-y: auto;\n\t}\n}\n\n.activitypub-dialog {\n\t&__section {\n\t\tpadding: 1em 1.5em;\n\t\tborder-bottom: 1px solid #f0f0f0;\n\n\t\t&:last-child {\n\t\t\tborder-bottom: none;\n\t\t}\n\n\t\th4 {\n\t\t\tmargin-top: 0;\n\t\t\tmargin-bottom: 0.5em;\n\t\t\tfont-size: 1.1em;\n\t\t}\n\t}\n\n\t&__description {\n\t\tmargin-bottom: 1em;\n\t\tcolor: inherit;\n\t\tfont-size: 0.95em;\n\n\t\tcode {\n\t\t\tbackground: #f0f0f0;\n\t\t\tpadding: 0.1em 0.3em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t}\n\t}\n\n\t&__button-group {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\tmargin-bottom: 0.5em;\n\n\t\tinput {\n\t\t\tflex: 1;\n\t\t\tborder: 1px solid #ddd;\n\t\t\tborder-radius: 4px 0 0 4px;\n\t\t\tfont-size: 1em;\n\t\t\tmargin: 0;\n\n\t\t\t&[aria-invalid=\"true\"] {\n\t\t\t\tborder-color: #cc1818;\n\t\t\t}\n\t\t}\n\n\t\tbutton {\n\t\t\tborder-radius: 0 4px 4px 0 !important;\n\t\t\tmargin-left: -1px !important;\n\t\t}\n\t}\n\n\t&__error {\n\t\tcolor: #cc1818;\n\t\tfont-size: 0.9em;\n\t\tmargin-top: 0.5em;\n\t}\n}\n\nbody.modal-open {\n\toverflow: hidden;\n}\n\n@keyframes activitypub-modal-appear {\n\tfrom {\n\t\topacity: 0;\n\t\ttransform: translateY(15px);\n\t}\n\tto {\n\t\topacity: 1;\n\t\ttransform: translateY(0);\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/build/follow-me/view.asset.php b/build/follow-me/view.asset.php index a003d6dd6..2e14f1b79 100644 --- a/build/follow-me/view.asset.php +++ b/build/follow-me/view.asset.php @@ -1 +1 @@ - array('@wordpress/interactivity'), 'version' => '74a6dbf9c0fdc029aca4', 'type' => 'module'); + array('@wordpress/interactivity'), 'version' => '849432e4183af4c1428b', 'type' => 'module'); diff --git a/build/follow-me/view.js b/build/follow-me/view.js index d02ed6e4f..4008cf913 100644 --- a/build/follow-me/view.js +++ b/build/follow-me/view.js @@ -1 +1 @@ -import*as e from"@wordpress/interactivity";var t,o,r={825:(t,o,r)=>{const n=(l={getContext:()=>e.getContext,store:()=>e.store},i={},r.d(i,l),i);var l,i;function c(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|");return`var(--wp--preset--color--${t})`}function s(e,t,o=null,r=""){return o?`${e}${r} { ${t}: ${o}; }\n`:""}function a(e,t,o,r){return s(e,"background-color",t)+s(e,"color",o)+s(e,"background-color",r,":hover")+s(e,"background-color",r,":focus")}const{state:d,actions:u,callbacks:p}=(0,n.store)("activitypub/follow-me",{actions:{openModal(){const e=(0,n.getContext)();e.isModalOpen=!0,document.body.classList.add("modal-open"),setTimeout((()=>{const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".activitypub-modal__frame");e&&(r=(o=e).querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),n=r[0],l=r[r.length-1],n.focus(),o.addEventListener("keydown",(function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?document.activeElement===n&&(l.focus(),e.preventDefault()):document.activeElement===l&&(n.focus(),e.preventDefault()))})))}var o,r,n,l}),50)},closeModal(){const e=(0,n.getContext)();e.isModalOpen=!1,document.body.classList.remove("modal-open");const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".activitypub-profile__follow");e&&e.focus()}},toggleModal(){(0,n.getContext)().isModalOpen?u.closeModal():u.openModal()},copyToClipboard(){const e=(0,n.getContext)();navigator.clipboard.writeText(e.webfinger).then((()=>{e.copyButtonText=d.i18n.copied,setTimeout((()=>{e.copyButtonText=d.i18n.copy}),1e3)}),(e=>{console.error("Could not copy text: ",e)}))},updateRemoteProfile(e){const t=(0,n.getContext)();t.remoteProfile=e.target.value,t.isError=!1,t.errorMessage=""},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),u.submitRemoteProfile())},submitRemoteProfile:function*(){const e=(0,n.getContext)(),{namespace:t}=d,o=e.remoteProfile.trim();if(!o)return e.isError=!0,void(e.errorMessage=d.i18n.emptyProfileError);if(!/^(https?:\/\/|@)/.test(o))return e.isError=!0,void(e.errorMessage=d.i18n.invalidProfileError);e.isLoading=!0,e.isError=!1;const r=`/${t}/actors/${e.userId}/remote-follow?resource=${encodeURIComponent(o)}`;try{const t=yield apiFetch({path:r});e.isLoading=!1,window.open(t.url,"_blank"),u.closeModal()}catch(t){console.error("Error submitting profile:",t),e.isLoading=!1,e.isError=!0,e.errorMessage=t.message||d.i18n.genericError}}},callbacks:{initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:t,blockId:o}=(0,n.getContext)();if(o&&e){const n=document.createElement("style"),l=`#${o}`;n.textContent=function(e,t,o){if(!t.length)return"";const r=`${e} .components-button`,n=("string"==typeof(l=o)?`var(--wp--preset--color--${l})`:l?.color?.background||null)||t?.color?.background;var l;return a(r,c(t?.elements?.link?.color?.text),n,c(t?.elements?.link?.[":hover"]?.color?.text))}(l,e,t),document.head.appendChild(n);const i=document.createElement("style");i.textContent=(r=e,a(".activitypub-dialog__button-group .components-button",c(r?.elements?.link?.color?.text)||"#111","#fff",c(r?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(i)}var r},documentKeydown:e=>{(0,n.getContext)().isModalOpen&&"Escape"===e.key&&u.closeModal()},documentClick:e=>{!(0,n.getContext)().isModalOpen||e.target.closest(".activitypub-modal__frame")||e.target.closest(".activitypub-profile__follow")||u.closeModal()}}})}},n={};function l(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return r[e](o,o.exports,l),o.exports}l.m=r,t=[],l.O=(e,o,r,n)=>{if(!o){var i=1/0;for(d=0;d=n)&&Object.keys(l.O).every((e=>l.O[e](o[s])))?o.splice(s--,1):(c=!1,n0&&t[d-1][2]>n;d--)t[d]=t[d-1];t[d]=[o,r,n]},l.d=(e,t)=>{for(var o in t)l.o(t,o)&&!l.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={41:0,301:0},l.O.j=e=>0===o[e];var i=l.O(void 0,[301],(()=>l(825)));i=l.O(i); \ No newline at end of file +import*as e from"@wordpress/interactivity";var t,o,n={825:(t,o,n)=>{const r=(c={getContext:()=>e.getContext,store:()=>e.store},l={},n.d(l,c),l);var c,l;function i(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|");return`var(--wp--preset--color--${t})`}function s(e,t,o=null,n=""){return o?`${e}${n} { ${t}: ${o}; }\n`:""}function a(e,t,o,n){return s(e,"background-color",t)+s(e,"color",o)+s(e,"background-color",n,":hover")+s(e,"background-color",n,":focus")}const{state:d,actions:u}=(0,r.store)("activitypub/follow-me",{actions:{openModal(){const e=(0,r.getContext)();e.isModalOpen=!0,document.body.classList.add("modal-open"),setTimeout((()=>{const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".activitypub-modal__frame");e&&(n=(o=e).querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),r=n[0],c=n[n.length-1],r.focus(),o.addEventListener("keydown",(function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?document.activeElement===r&&(c.focus(),e.preventDefault()):document.activeElement===c&&(r.focus(),e.preventDefault()))})))}var o,n,r,c}),50)},closeModal(){const e=(0,r.getContext)();e.isModalOpen=!1,document.body.classList.remove("modal-open");const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".wp-block-button__link");e&&e.focus()}},toggleModal(){const{isModalOpen:e}=(0,r.getContext)();e?u.closeModal():u.openModal()},copyToClipboard(){const e=(0,r.getContext)();navigator.clipboard.writeText(e.webfinger).then((()=>{e.copyButtonText=d.i18n.copied,setTimeout((()=>{e.copyButtonText=d.i18n.copy}),1e3)}),(e=>{console.error("Could not copy text: ",e)}))},updateRemoteProfile(e){const t=(0,r.getContext)();t.remoteProfile=e.target.value,t.isError=!1,t.errorMessage=""},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),u.submitRemoteProfile())},submitRemoteProfile:function*(){const e=(0,r.getContext)(),{namespace:t}=d,o=e.remoteProfile.trim();if(!o)return e.isError=!0,void(e.errorMessage=d.i18n.emptyProfileError);if(!/^(https?:\/\/|@)/.test(o))return e.isError=!0,void(e.errorMessage=d.i18n.invalidProfileError);e.isLoading=!0,e.isError=!1;const n=`/${t}/actors/${e.userId}/remote-follow?resource=${encodeURIComponent(o)}`;try{const t=yield apiFetch({path:n});e.isLoading=!1,window.open(t.url,"_blank"),u.closeModal()}catch(t){console.error("Error submitting profile:",t),e.isLoading=!1,e.isError=!0,e.errorMessage=t.message||d.i18n.genericError}}},callbacks:{initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:t,blockId:o}=(0,r.getContext)();if(o&&e){const r=document.createElement("style"),c=`#${o}`;r.textContent=function(e,t,o){if(!t.length)return"";const n=`${e} .wp-block-button__link`,r=("string"==typeof(c=o)?`var(--wp--preset--color--${c})`:c?.color?.background||null)||t?.color?.background;var c;return a(n,i(t?.elements?.link?.color?.text),r,i(t?.elements?.link?.[":hover"]?.color?.text))}(c,e,t),document.head.appendChild(r);const l=document.createElement("style");l.textContent=(n=e,a(".activitypub-dialog__button-group .components-button",i(n?.elements?.link?.color?.text)||"#111","#fff",i(n?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(l)}var n},documentKeydown(e){const{isModalOpen:t}=(0,r.getContext)();t&&"Escape"===e.key&&u.closeModal()},documentClick(e){const{blockId:t,isModalOpen:o}=(0,r.getContext)();if(!o)return;const n=document.getElementById(t);if(!n)return;const c=n.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(c&&(c===e.target||c.contains(e.target)))return;const l=n.querySelector(".activitypub-modal__frame");l&&!l.contains(e.target)&&u.closeModal()}}})}},r={};function c(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,c),o.exports}c.m=n,t=[],c.O=(e,o,n,r)=>{if(!o){var l=1/0;for(d=0;d=r)&&Object.keys(c.O).every((e=>c.O[e](o[s])))?o.splice(s--,1):(i=!1,r0&&t[d-1][2]>r;d--)t[d]=t[d-1];t[d]=[o,n,r]},c.d=(e,t)=>{for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={41:0,301:0},c.O.j=e=>0===o[e];var l=c.O(void 0,[301],(()=>c(825)));l=c.O(l); \ No newline at end of file diff --git a/build/follow-me/view.js.map b/build/follow-me/view.js.map index 914763385..b42989e37 100644 --- a/build/follow-me/view.js.map +++ b/build/follow-me/view.js.map @@ -1 +1 @@ -{"version":3,"file":"follow-me/view.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,kBAAkBA,CAAEC,KAAK,EAAG;EACpC;EACA,IAAK,OAAOA,KAAK,KAAK,QAAQ,EAAG;IAChC,OAAO,4BAA6BA,KAAK,GAAI;EAC9C;EAEA,OAAOA,KAAK,EAAEA,KAAK,EAAEC,UAAU,IAAI,IAAI;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAAEC,IAAI,EAAG;EAC7B,IAAK,OAAOA,IAAI,KAAK,QAAQ,EAAG;IAC/B,OAAO,IAAI;EACZ;EACA;EACA,IAAKA,IAAI,CAACC,KAA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,CAAC,CAAC;MAC5B,IAAKoB,OAAO,CAACC,WAAW,IAAIZ,KAAK,CAACC,GAAG,KAAK,QAAQ,EAAG;QACpDO,OAAO,CAACc,UAAU,CAAC,CAAC;MACrB;IACD,CAAC;IAED;AACF;AACA;AACA;AACA;IACEiD,aAAa,EAAIvE,KAAK,IAAM;MAC3B,MAAMW,OAAO,GAAGpB,oEAAU,CAAC,CAAC;MAC5B;MACA,IACCoB,OAAO,CAACC,WAAW,IACnB,CAAEZ,KAAK,CAACwC,MAAM,CAACgC,OAAO,CAAE,2BAA4B,CAAC,IACrD,CAAExE,KAAK,CAACwC,MAAM,CAACgC,OAAO,CAAE,8BAA+B,CAAC,EACvD;QACDhE,OAAO,CAACc,UAAU,CAAC,CAAC;MACrB;IACD;EACD;AACD,CAAE,CAAC;;;;;;;;;;;AC7OH;;;;;;;;;;;ACAA;;;;;;SCAA;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;SAEA;SACA;;;;;UCzBA;UACA;UACA;UACA;UACA,+BAA+B,wCAAwC;UACvE;UACA;UACA;UACA;UACA,iBAAiB,qBAAqB;UACtC;UACA;UACA,kBAAkB,qBAAqB;UACvC;UACA;UACA,KAAK;UACL;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;;;;UC3BA;UACA;UACA;UACA;UACA,yCAAyC,wCAAwC;UACjF;UACA;UACA;;;;;UCPA;;;;;UCAA;UACA;UACA;UACA,uDAAuD,iBAAiB;UACxE;UACA,gDAAgD,aAAa;UAC7D;;;;;UCNA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;;;;SEpBA;SACA;SACA;SACA;SACA","sources":["webpack://wordpress-activitypub/./src/follow-me/button-style.js","webpack://wordpress-activitypub/./src/follow-me/view.js","webpack://wordpress-activitypub/./src/follow-me/style.scss?5e79","webpack://wordpress-activitypub/external module \"@wordpress/interactivity\"","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/chunk loaded","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/webpack/runtime/import chunk loading","webpack://wordpress-activitypub/webpack/before-startup","webpack://wordpress-activitypub/webpack/startup","webpack://wordpress-activitypub/webpack/after-startup"],"sourcesContent":["/**\n * Gets the background color from a style object.\n *\n * @param {Object|string} color Color object or string.\n * @return {string|null} Background color.\n */\nfunction getBackgroundColor( color ) {\n\t// If color is a string, it's a var like this.\n\tif ( typeof color === 'string' ) {\n\t\treturn `var(--wp--preset--color--${ color })`;\n\t}\n\n\treturn color?.color?.background || null;\n}\n\n/**\n * Gets the link color from a style object.\n *\n * @param {string} text Text color.\n * @return {string|null} Link color.\n */\nfunction getLinkColor( text ) {\n\tif ( typeof text !== 'string' ) {\n\t\treturn null;\n\t}\n\t// If it starts with a hash, leave it be.\n\tif ( text.match( /^#/ ) ) {\n\t\t// We don't handle the alpha channel if present.\n\t\treturn text.substring( 0, 7 );\n\t}\n\t// var:preset|color|luminous-vivid-amber\n\t// var(--wp--preset--color--luminous-vivid-amber)\n\t// We will receive the top format, we need to output the bottom format.\n\tconst [ , , color ] = text.split( '|' );\n\treturn `var(--wp--preset--color--${ color })`;\n}\n\n/**\n * Generates a CSS selector.\n *\n * @param {string} selector CSS selector.\n * @param {string} prop CSS property.\n * @param {string|null} value CSS value.\n * @param {string} pseudo Pseudo-selector.\n * @return {string} CSS selector.\n */\nfunction generateSelector( selector, prop, value = null, pseudo = '' ) {\n\tif ( ! value ) {\n\t\treturn '';\n\t}\n\treturn `${ selector }${ pseudo } { ${ prop }: ${ value }; }\\n`;\n}\n\n/**\n * Gets styles for a button.\n *\n * @param {string} selector CSS selector.\n * @param {string} button Button color.\n * @param {string} text Text color.\n * @param {string} hover Hover color.\n * @return {string} CSS styles.\n */\nfunction getStyles( selector, button, text, hover ) {\n\treturn (\n\t\tgenerateSelector( selector, 'background-color', button ) +\n\t\tgenerateSelector( selector, 'color', text ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':hover' ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':focus' )\n\t);\n}\n\n/**\n * Gets block styles.\n *\n * @param {string} base Base selector.\n * @param {Object} style Style object.\n * @param {Object|string} backgroundColor Background color.\n * @return {string} CSS styles.\n */\nexport function getBlockStyles( base, style, backgroundColor ) {\n\tif ( ! style.length ) {\n\t\treturn '';\n\t}\n\n\tconst selector = `${ base } .components-button`;\n\t// We grab the background color if set as a good color for our button text.\n\tconst buttonTextColor =\n\t\tgetBackgroundColor( backgroundColor ) ||\n\t\t// Background might be in this form.\n\t\tstyle?.color?.background;\n\t// We misuse the link color for the button background.\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text );\n\t// Hover!\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text );\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n\n/**\n * Gets popup styles.\n *\n * @param {Object} style Style object.\n * @return {string} CSS styles.\n */\nexport function getPopupStyles( style ) {\n\t// We don't accept backgroundColor because the popup is always white (right?).\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text ) || '#111';\n\tconst buttonTextColor = '#fff';\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text ) || '#333';\n\tconst selector = '.activitypub-dialog__button-group .components-button';\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n","import { store, getContext } from '@wordpress/interactivity';\nimport { getBlockStyles, getPopupStyles } from './button-style';\nimport './style.scss';\n\n/**\n * Traps focus within the specified element.\n *\n * @param {Element} element The element to trap focus within.\n */\nfunction trapFocus( element ) {\n\tvar focusableElements = element.querySelectorAll(\n\t\t'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type=\"text\"]:not([disabled]), input[type=\"radio\"]:not([disabled]), input[type=\"checkbox\"]:not([disabled]), select:not([disabled])'\n\t);\n\tvar firstFocusableElement = focusableElements[ 0 ];\n\tvar lastFocusableElement = focusableElements[ focusableElements.length - 1 ];\n\tfirstFocusableElement.focus();\n\n\telement.addEventListener( 'keydown', function ( event ) {\n\t\tif ( event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */ ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.shiftKey ) {\n\t\t\t/* shift + tab */\n\t\t\tif ( document.activeElement === firstFocusableElement ) {\n\t\t\t\tlastFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t} /* tab */ else {\n\t\t\tif ( document.activeElement === lastFocusableElement ) {\n\t\t\t\tfirstFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t} );\n}\n\nconst { state, actions, callbacks } = store( 'activitypub/follow-me', {\n\tactions: {\n\t\t/**\n\t\t * Open the modal.\n\t\t */\n\t\topenModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = true;\n\t\t\tdocument.body.classList.add( 'modal-open' );\n\n\t\t\t// Set up the focus trap after modal is open.\n\t\t\tsetTimeout( () => {\n\t\t\t\t// Use the blockId to find the specific modal frame for this block.\n\t\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\t\tif ( blockWrapper ) {\n\t\t\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\t\t\tif ( modalFrame ) {\n\t\t\t\t\t\ttrapFocus( modalFrame );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 50 );\n\t\t},\n\n\t\t/**\n\t\t * Close the modal.\n\t\t */\n\t\tcloseModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = false;\n\t\t\tdocument.body.classList.remove( 'modal-open' );\n\n\t\t\t// Return focus to the button that opened the modal.\n\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\tif ( blockWrapper ) {\n\t\t\t\tconst openButton = blockWrapper.querySelector( '.activitypub-profile__follow' );\n\t\t\t\tif ( openButton ) {\n\t\t\t\t\topenButton.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\ttoggleModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen ? actions.closeModal() : actions.openModal();\n\t\t},\n\n\t\t/**\n\t\t * Copy the webfinger to clipboard.\n\t\t */\n\t\tcopyToClipboard() {\n\t\t\tconst context = getContext();\n\n\t\t\t// Use the Clipboard API to copy text.\n\t\t\tnavigator.clipboard.writeText( context.webfinger ).then(\n\t\t\t\t() => {\n\t\t\t\t\t// Update button text to show success.\n\t\t\t\t\tcontext.copyButtonText = state.i18n.copied;\n\n\t\t\t\t\t// Reset button text after 1 second.\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tcontext.copyButtonText = state.i18n.copy;\n\t\t\t\t\t}, 1000 );\n\t\t\t\t},\n\t\t\t\t( error ) => {\n\t\t\t\t\t// Log error if copying fails.\n\t\t\t\t\tconsole.error( 'Could not copy text: ', error );\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the remote profile value.\n\t\t *\n\t\t * @param {Event} event Input event.\n\t\t */\n\t\tupdateRemoteProfile( event ) {\n\t\t\tconst context = getContext();\n\t\t\tcontext.remoteProfile = event.target.value;\n\t\t\t// Reset error state when input changes.\n\t\t\tcontext.isError = false;\n\t\t\tcontext.errorMessage = '';\n\t\t},\n\n\t\t/**\n\t\t * Handle keydown event for remote profile input.\n\t\t *\n\t\t * @param {Event} event Keydown event.\n\t\t */\n\t\thandleKeyDown( event ) {\n\t\t\tif ( event.key === 'Enter' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tactions.submitRemoteProfile();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Submit the remote profile.\n\t\t */\n\t\tsubmitRemoteProfile: function* () {\n\t\t\tconst context = getContext();\n\t\t\tconst { namespace } = state;\n\t\t\tconst input = context.remoteProfile.trim();\n\n\t\t\t// Validate input.\n\t\t\tif ( ! input ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.emptyProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! /^(https?:\\/\\/|@)/.test( input ) ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.invalidProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set loading state.\n\t\t\tcontext.isLoading = true;\n\t\t\tcontext.isError = false;\n\n\t\t\t// Construct the API path.\n\t\t\tconst path = `/${ namespace }/actors/${ context.userId }/remote-follow?resource=${ encodeURIComponent(\n\t\t\t\tinput\n\t\t\t) }`;\n\n\t\t\ttry {\n\t\t\t\t// Make the API request.\n\t\t\t\tconst response = yield apiFetch( { path } );\n\n\t\t\t\t// Set opening state.\n\t\t\t\tcontext.isLoading = false;\n\n\t\t\t\t// Open the remote follow URL in a new tab.\n\t\t\t\twindow.open( response.url, '_blank' );\n\n\t\t\t\t// Close the modal after opening the URL.\n\t\t\t\tactions.closeModal();\n\t\t\t} catch ( error ) {\n\t\t\t\t// Handle error.\n\t\t\t\tconsole.error( 'Error submitting profile:', error );\n\t\t\t\tcontext.isLoading = false;\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = error.message || state.i18n.genericError;\n\t\t\t}\n\t\t},\n\t},\n\tcallbacks: {\n\t\t/**\n\t\t * Initialize button styles.\n\t\t */\n\t\tinitButtonStyles: () => {\n\t\t\tconst { buttonStyle, backgroundColor, blockId } = getContext();\n\n\t\t\t// Add dynamic button styles to the document.\n\t\t\tif ( blockId && buttonStyle ) {\n\t\t\t\tconst styleElement = document.createElement( 'style' );\n\t\t\t\tconst selector = `#${ blockId }`;\n\n\t\t\t\t// Use getBlockStyles from button-style.js to get the CSS string.\n\t\t\t\tstyleElement.textContent = getBlockStyles( selector, buttonStyle, backgroundColor );\n\n\t\t\t\tdocument.head.appendChild( styleElement );\n\n\t\t\t\t// Add popup styles.\n\t\t\t\tconst popupStyleElement = document.createElement( 'style' );\n\t\t\t\tpopupStyleElement.textContent = getPopupStyles( buttonStyle );\n\n\t\t\t\tdocument.head.appendChild( popupStyleElement );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when pressing ESC key.\n\t\t *\n\t\t * @param {Event} event Keyboard event.\n\t\t */\n\t\tdocumentKeydown: ( event ) => {\n\t\t\tconst context = getContext();\n\t\t\tif ( context.isModalOpen && event.key === 'Escape' ) {\n\t\t\t\tactions.closeModal();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when clicking outside.\n\t\t *\n\t\t * @param {Event} event Click event.\n\t\t */\n\t\tdocumentClick: ( event ) => {\n\t\t\tconst context = getContext();\n\t\t\t// Update selector to match the new modal structure.\n\t\t\tif (\n\t\t\t\tcontext.isModalOpen &&\n\t\t\t\t! event.target.closest( '.activitypub-modal__frame' ) &&\n\t\t\t\t! event.target.closest( '.activitypub-profile__follow' )\n\t\t\t) {\n\t\t\t\tactions.closeModal();\n\t\t\t}\n\t\t},\n\t},\n} );\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;","// 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\t// no module.id needed\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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"follow-me/view\": 0,\n\t\"follow-me/style-view\": 0\n};\n\n// no install chunk\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no external install chunk\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"follow-me/style-view\"], () => (__webpack_require__(\"./src/follow-me/view.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["getBackgroundColor","color","background","getLinkColor","text","match","substring","split","generateSelector","selector","prop","value","pseudo","getStyles","button","hover","getBlockStyles","base","style","backgroundColor","length","buttonTextColor","buttonColor","elements","link","buttonHoverColor","getPopupStyles","store","getContext","trapFocus","element","focusableElements","querySelectorAll","firstFocusableElement","lastFocusableElement","focus","addEventListener","event","key","keyCode","shiftKey","document","activeElement","preventDefault","state","actions","callbacks","openModal","context","isModalOpen","body","classList","add","setTimeout","blockWrapper","getElementById","blockId","modalFrame","querySelector","closeModal","remove","openButton","toggleModal","copyToClipboard","navigator","clipboard","writeText","webfinger","then","copyButtonText","i18n","copied","copy","error","console","updateRemoteProfile","remoteProfile","target","isError","errorMessage","handleKeyDown","submitRemoteProfile","namespace","input","trim","emptyProfileError","test","invalidProfileError","isLoading","path","userId","encodeURIComponent","response","apiFetch","window","open","url","message","genericError","initButtonStyles","buttonStyle","styleElement","createElement","textContent","head","appendChild","popupStyleElement","documentKeydown","documentClick","closest"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"follow-me/view.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,kBAAkBA,CAAEC,KAAK,EAAG;EACpC;EACA,IAAK,OAAOA,KAAK,KAAK,QAAQ,EAAG;IAChC,OAAO,4BAA6BA,KAAK,GAAI;EAC9C;EAEA,OAAOA,KAAK,EAAEA,KAAK,EAAEC,UAAU,IAAI,IA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;UACA;UACA;UACA;UACA,+BAA+B,wCAAwC;UACvE;UACA;UACA;UACA;UACA,iBAAiB,qBAAqB;UACtC;UACA;UACA,kBAAkB,qBAAqB;UACvC;UACA;UACA,KAAK;UACL;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;;;;UC3BA;UACA;UACA;UACA;UACA,yCAAyC,wCAAwC;UACjF;UACA;UACA;;;;;UCPA;;;;;UCAA;UACA;UACA;UACA,uDAAuD,iBAAiB;UACxE;UACA,gDAAgD,aAAa;UAC7D;;;;;UCNA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;;;;SEpBA;SACA;SACA;SACA;SACA","sources":["webpack://wordpress-activitypub/./src/follow-me/button-style.js","webpack://wordpress-activitypub/./src/follow-me/view.js","webpack://wordpress-activitypub/./src/follow-me/style.scss?5e79","webpack://wordpress-activitypub/external module \"@wordpress/interactivity\"","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/chunk loaded","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/webpack/runtime/import chunk loading","webpack://wordpress-activitypub/webpack/before-startup","webpack://wordpress-activitypub/webpack/startup","webpack://wordpress-activitypub/webpack/after-startup"],"sourcesContent":["/**\n * Gets the background color from a style object.\n *\n * @param {Object|string} color Color object or string.\n * @return {string|null} Background color.\n */\nfunction getBackgroundColor( color ) {\n\t// If color is a string, it's a var like this.\n\tif ( typeof color === 'string' ) {\n\t\treturn `var(--wp--preset--color--${ color })`;\n\t}\n\n\treturn color?.color?.background || null;\n}\n\n/**\n * Gets the link color from a style object.\n *\n * @param {string} text Text color.\n * @return {string|null} Link color.\n */\nfunction getLinkColor( text ) {\n\tif ( typeof text !== 'string' ) {\n\t\treturn null;\n\t}\n\t// If it starts with a hash, leave it be.\n\tif ( text.match( /^#/ ) ) {\n\t\t// We don't handle the alpha channel if present.\n\t\treturn text.substring( 0, 7 );\n\t}\n\t// var:preset|color|luminous-vivid-amber\n\t// var(--wp--preset--color--luminous-vivid-amber)\n\t// We will receive the top format, we need to output the bottom format.\n\tconst [ , , color ] = text.split( '|' );\n\treturn `var(--wp--preset--color--${ color })`;\n}\n\n/**\n * Generates a CSS selector.\n *\n * @param {string} selector CSS selector.\n * @param {string} prop CSS property.\n * @param {string|null} value CSS value.\n * @param {string} pseudo Pseudo-selector.\n * @return {string} CSS selector.\n */\nfunction generateSelector( selector, prop, value = null, pseudo = '' ) {\n\tif ( ! value ) {\n\t\treturn '';\n\t}\n\treturn `${ selector }${ pseudo } { ${ prop }: ${ value }; }\\n`;\n}\n\n/**\n * Gets styles for a button.\n *\n * @param {string} selector CSS selector.\n * @param {string} button Button color.\n * @param {string} text Text color.\n * @param {string} hover Hover color.\n * @return {string} CSS styles.\n */\nfunction getStyles( selector, button, text, hover ) {\n\treturn (\n\t\tgenerateSelector( selector, 'background-color', button ) +\n\t\tgenerateSelector( selector, 'color', text ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':hover' ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':focus' )\n\t);\n}\n\n/**\n * Gets block styles.\n *\n * @param {string} base Base selector.\n * @param {Object} style Style object.\n * @param {Object|string} backgroundColor Background color.\n * @return {string} CSS styles.\n */\nexport function getBlockStyles( base, style, backgroundColor ) {\n\tif ( ! style.length ) {\n\t\treturn '';\n\t}\n\n\tconst selector = `${ base } .wp-block-button__link`;\n\t// We grab the background color if set as a good color for our button text.\n\tconst buttonTextColor =\n\t\tgetBackgroundColor( backgroundColor ) ||\n\t\t// Background might be in this form.\n\t\tstyle?.color?.background;\n\t// We misuse the link color for the button background.\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text );\n\t// Hover!\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text );\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n\n/**\n * Gets popup styles.\n *\n * @param {Object} style Style object.\n * @return {string} CSS styles.\n */\nexport function getPopupStyles( style ) {\n\t// We don't accept backgroundColor because the popup is always white (right?).\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text ) || '#111';\n\tconst buttonTextColor = '#fff';\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text ) || '#333';\n\tconst selector = '.activitypub-dialog__button-group .components-button';\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n","import { store, getContext } from '@wordpress/interactivity';\nimport { getBlockStyles, getPopupStyles } from './button-style';\nimport './style.scss';\n\n/**\n * Traps focus within the specified element.\n *\n * @param {Element} element The element to trap focus within.\n */\nfunction trapFocus( element ) {\n\tvar focusableElements = element.querySelectorAll(\n\t\t'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type=\"text\"]:not([disabled]), input[type=\"radio\"]:not([disabled]), input[type=\"checkbox\"]:not([disabled]), select:not([disabled])'\n\t);\n\tvar firstFocusableElement = focusableElements[ 0 ];\n\tvar lastFocusableElement = focusableElements[ focusableElements.length - 1 ];\n\tfirstFocusableElement.focus();\n\n\telement.addEventListener( 'keydown', function ( event ) {\n\t\tif ( event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */ ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.shiftKey ) {\n\t\t\t/* shift + tab */\n\t\t\tif ( document.activeElement === firstFocusableElement ) {\n\t\t\t\tlastFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t} /* tab */ else {\n\t\t\tif ( document.activeElement === lastFocusableElement ) {\n\t\t\t\tfirstFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t} );\n}\n\nconst { state, actions } = store( 'activitypub/follow-me', {\n\tactions: {\n\t\t/**\n\t\t * Open the modal.\n\t\t */\n\t\topenModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = true;\n\t\t\tdocument.body.classList.add( 'modal-open' );\n\n\t\t\t// Set up the focus trap after modal is open.\n\t\t\tsetTimeout( () => {\n\t\t\t\t// Use the blockId to find the specific modal frame for this block.\n\t\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\t\tif ( blockWrapper ) {\n\t\t\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\t\t\tif ( modalFrame ) {\n\t\t\t\t\t\ttrapFocus( modalFrame );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 50 );\n\t\t},\n\n\t\t/**\n\t\t * Close the modal.\n\t\t */\n\t\tcloseModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = false;\n\t\t\tdocument.body.classList.remove( 'modal-open' );\n\n\t\t\t// Return focus to the button that opened the modal.\n\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\tif ( blockWrapper ) {\n\t\t\t\tconst openButton = blockWrapper.querySelector( '.wp-block-button__link' );\n\t\t\t\tif ( openButton ) {\n\t\t\t\t\topenButton.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\ttoggleModal() {\n\t\t\tconst { isModalOpen } = getContext();\n\n\t\t\tisModalOpen ? actions.closeModal() : actions.openModal();\n\t\t},\n\n\t\t/**\n\t\t * Copy the webfinger to clipboard.\n\t\t */\n\t\tcopyToClipboard() {\n\t\t\tconst context = getContext();\n\n\t\t\t// Use the Clipboard API to copy text.\n\t\t\tnavigator.clipboard.writeText( context.webfinger ).then(\n\t\t\t\t() => {\n\t\t\t\t\t// Update button text to show success.\n\t\t\t\t\tcontext.copyButtonText = state.i18n.copied;\n\n\t\t\t\t\t// Reset button text after 1 second.\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tcontext.copyButtonText = state.i18n.copy;\n\t\t\t\t\t}, 1000 );\n\t\t\t\t},\n\t\t\t\t( error ) => {\n\t\t\t\t\t// Log error if copying fails.\n\t\t\t\t\tconsole.error( 'Could not copy text: ', error );\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the remote profile value.\n\t\t *\n\t\t * @param {Event} event Input event.\n\t\t */\n\t\tupdateRemoteProfile( event ) {\n\t\t\tconst context = getContext();\n\t\t\tcontext.remoteProfile = event.target.value;\n\t\t\t// Reset error state when input changes.\n\t\t\tcontext.isError = false;\n\t\t\tcontext.errorMessage = '';\n\t\t},\n\n\t\t/**\n\t\t * Handle keydown event for remote profile input.\n\t\t *\n\t\t * @param {Event} event Keydown event.\n\t\t */\n\t\thandleKeyDown( event ) {\n\t\t\tif ( event.key === 'Enter' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tactions.submitRemoteProfile();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Submit the remote profile.\n\t\t */\n\t\tsubmitRemoteProfile: function* () {\n\t\t\tconst context = getContext();\n\t\t\tconst { namespace } = state;\n\t\t\tconst input = context.remoteProfile.trim();\n\n\t\t\t// Validate input.\n\t\t\tif ( ! input ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.emptyProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! /^(https?:\\/\\/|@)/.test( input ) ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.invalidProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set loading state.\n\t\t\tcontext.isLoading = true;\n\t\t\tcontext.isError = false;\n\n\t\t\t// Construct the API path.\n\t\t\tconst path = `/${ namespace }/actors/${ context.userId }/remote-follow?resource=${ encodeURIComponent(\n\t\t\t\tinput\n\t\t\t) }`;\n\n\t\t\ttry {\n\t\t\t\t// Make the API request.\n\t\t\t\tconst response = yield apiFetch( { path } );\n\n\t\t\t\t// Set opening state.\n\t\t\t\tcontext.isLoading = false;\n\n\t\t\t\t// Open the remote follow URL in a new tab.\n\t\t\t\twindow.open( response.url, '_blank' );\n\n\t\t\t\t// Close the modal after opening the URL.\n\t\t\t\tactions.closeModal();\n\t\t\t} catch ( error ) {\n\t\t\t\t// Handle error.\n\t\t\t\tconsole.error( 'Error submitting profile:', error );\n\t\t\t\tcontext.isLoading = false;\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = error.message || state.i18n.genericError;\n\t\t\t}\n\t\t},\n\t},\n\tcallbacks: {\n\t\t/**\n\t\t * Initialize button styles.\n\t\t */\n\t\tinitButtonStyles: () => {\n\t\t\tconst { buttonStyle, backgroundColor, blockId } = getContext();\n\n\t\t\t// Add dynamic button styles to the document.\n\t\t\tif ( blockId && buttonStyle ) {\n\t\t\t\tconst styleElement = document.createElement( 'style' );\n\t\t\t\tconst selector = `#${ blockId }`;\n\n\t\t\t\t// Use getBlockStyles from button-style.js to get the CSS string.\n\t\t\t\tstyleElement.textContent = getBlockStyles( selector, buttonStyle, backgroundColor );\n\n\t\t\t\tdocument.head.appendChild( styleElement );\n\n\t\t\t\t// Add popup styles.\n\t\t\t\tconst popupStyleElement = document.createElement( 'style' );\n\t\t\t\tpopupStyleElement.textContent = getPopupStyles( buttonStyle );\n\t\t\t\tdocument.head.appendChild( popupStyleElement );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when pressing ESC key.\n\t\t *\n\t\t * @param {Event} event Keyboard event.\n\t\t */\n\t\tdocumentKeydown( event ) {\n\t\t\tconst { isModalOpen } = getContext();\n\n\t\t\tif ( isModalOpen && event.key === 'Escape' ) {\n\t\t\t\tactions.closeModal();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when clicking outside.\n\t\t *\n\t\t * @param {Event} event Click event.\n\t\t */\n\t\tdocumentClick( event ) {\n\t\t\tconst { blockId, isModalOpen } = getContext();\n\t\t\tif ( ! isModalOpen ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Get the block wrapper element.\n\t\t\tconst blockWrapper = document.getElementById( blockId );\n\t\t\tif ( ! blockWrapper ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If the click was on the button or its children, we should not close the modal.\n\t\t\tconst toggleButton = blockWrapper.querySelector(\n\t\t\t\t'.wp-element-button[data-wp-on--click=\"actions.toggleModal\"]'\n\t\t\t);\n\t\t\tif ( toggleButton && ( toggleButton === event.target || toggleButton.contains( event.target ) ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if the click was inside the modal frame.\n\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\tif ( ! modalFrame || modalFrame.contains( event.target ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactions.closeModal();\n\t\t},\n\t},\n} );\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;","// 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\t// no module.id needed\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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"follow-me/view\": 0,\n\t\"follow-me/style-view\": 0\n};\n\n// no install chunk\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no external install chunk\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"follow-me/style-view\"], () => (__webpack_require__(\"./src/follow-me/view.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["getBackgroundColor","color","background","getLinkColor","text","match","substring","split","generateSelector","selector","prop","value","pseudo","getStyles","button","hover","getBlockStyles","base","style","backgroundColor","length","buttonTextColor","buttonColor","elements","link","buttonHoverColor","getPopupStyles","store","getContext","trapFocus","element","focusableElements","querySelectorAll","firstFocusableElement","lastFocusableElement","focus","addEventListener","event","key","keyCode","shiftKey","document","activeElement","preventDefault","state","actions","openModal","context","isModalOpen","body","classList","add","setTimeout","blockWrapper","getElementById","blockId","modalFrame","querySelector","closeModal","remove","openButton","toggleModal","copyToClipboard","navigator","clipboard","writeText","webfinger","then","copyButtonText","i18n","copied","copy","error","console","updateRemoteProfile","remoteProfile","target","isError","errorMessage","handleKeyDown","submitRemoteProfile","namespace","input","trim","emptyProfileError","test","invalidProfileError","isLoading","path","userId","encodeURIComponent","response","apiFetch","window","open","url","message","genericError","callbacks","initButtonStyles","buttonStyle","styleElement","createElement","textContent","head","appendChild","popupStyleElement","documentKeydown","documentClick","toggleButton","contains"],"sourceRoot":""} \ No newline at end of file diff --git a/includes/class-blocks.php b/includes/class-blocks.php index 6cb43ddf2..fee3fabf2 100644 --- a/includes/class-blocks.php +++ b/includes/class-blocks.php @@ -419,4 +419,37 @@ function ( $paragraph ) { return $data; } + + /** + * Add directions to the button. + * + * @param string $content The block content. + * @param array $attributes The block attributes. + * + * @return string The updated content. + */ + public static function add_directions_to_button( $content, $attributes ) { + $tags = new \WP_HTML_Tag_Processor( $content ); + + $button_class = ''; + if ( isset( $attributes['buttonSize'] ) && 'small' === $attributes['buttonSize'] ) { + $button_class = 'is-small'; + } elseif ( isset( $attributes['buttonSize'] ) && 'compact' === $attributes['buttonSize'] ) { + $button_class = 'is-compact'; + } + + while ( $tags->next_tag( array( 'class_name' => 'wp-element-button' ) ) ) { + if ( $button_class ) { + $tags->add_class( $button_class ); + } + + $tags->set_attribute( 'data-wp-on--click', 'actions.toggleModal' ); + $tags->set_attribute( 'data-wp-bind--aria-expanded', 'context.isModalOpen' ); + $tags->set_attribute( 'aria-haspopup', 'dialog' ); + $tags->set_attribute( 'aria-controls', 'modal-heading' ); + $tags->set_attribute( 'aria-label', \__( 'Follow me on the Fediverse', 'activitypub' ) ); + } + + return $tags->get_updated_html(); + } } diff --git a/src/follow-me/block.json b/src/follow-me/block.json index 0104a3299..4dbe19d5e 100644 --- a/src/follow-me/block.json +++ b/src/follow-me/block.json @@ -10,9 +10,7 @@ "icon": "groups", "example": { "attributes": { - "buttonText": "Follow", - "buttonOnly": false, - "buttonSize": "default" + "buttonOnly": false } }, "supports": { @@ -38,6 +36,9 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "innerBlocks": { + "allowedBlocks": [ "core/button" ] } }, "attributes": { @@ -48,15 +49,6 @@ "buttonOnly": { "type": "boolean", "default": false - }, - "buttonText": { - "type": "string", - "default": "Follow" - }, - "buttonSize": { - "type": "string", - "default": "default", - "enum": [ "small", "default", "compact" ] } }, "usesContext": [ "postType", "postId" ], diff --git a/src/follow-me/button-style.js b/src/follow-me/button-style.js index ae4267442..243c3679e 100644 --- a/src/follow-me/button-style.js +++ b/src/follow-me/button-style.js @@ -82,7 +82,7 @@ export function getBlockStyles( base, style, backgroundColor ) { return ''; } - const selector = `${ base } .components-button`; + const selector = `${ base } .wp-block-button__link`; // We grab the background color if set as a good color for our button text. const buttonTextColor = getBackgroundColor( backgroundColor ) || diff --git a/src/follow-me/deprecation.js b/src/follow-me/deprecation.js new file mode 100644 index 000000000..4dd0a09d9 --- /dev/null +++ b/src/follow-me/deprecation.js @@ -0,0 +1,47 @@ +import { createBlock } from '@wordpress/blocks'; + +/** + * Deprecation for the Follow Me block to use a core button block instead of the custom button. + * This handles the migration of the buttonText and buttonSize attributes to the innerBlock. + */ +const v1 = { + attributes: { + buttonText: { + type: 'string', + default: 'Follow', + }, + buttonSize: { + type: 'string', + default: 'default', + enum: [ 'small', 'default', 'compact' ], + }, + }, + + isEligible( attributes ) { + // Run migration if buttonText attribute exists. + return !! attributes.buttonText; + }, + + migrate( attributes ) { + const { buttonText, buttonSize, ...newAttributes } = attributes; + + // Map buttonSize to core/button className. + let className = ''; + if ( buttonSize === 'small' ) { + className = 'is-small'; + } else if ( buttonSize === 'compact' ) { + className = 'is-compact'; + } + + // Create a core button block with the buttonText and buttonSize. + const buttonBlock = createBlock( 'core/button', { + className, + tagName: 'button', + text: buttonText, + } ); + + return [ newAttributes, [ buttonBlock ] ]; + }, +}; + +export default [ v1 ]; diff --git a/src/follow-me/edit.js b/src/follow-me/edit.js index 0e107a485..c33e0bb5b 100644 --- a/src/follow-me/edit.js +++ b/src/follow-me/edit.js @@ -1,9 +1,9 @@ import apiFetch from '@wordpress/api-fetch'; -import { InspectorControls, useBlockProps } from '@wordpress/block-editor'; +import { InspectorControls, useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor'; import { __ } from '@wordpress/i18n'; import { useSelect } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; -import { SelectControl, PanelBody, ToggleControl, TextControl } from '@wordpress/components'; +import { SelectControl, PanelBody, ToggleControl } from '@wordpress/components'; import { useEffect, useState } from '@wordpress/element'; import { useUserOptions } from '../shared/use-user-options'; import { InheritModeBlockFallback } from '../shared/inherit-block-fallback'; @@ -64,16 +64,13 @@ function fetchProfile( userId ) { * @param {Object} props Component props. * @return {JSX.Element} Profile component. */ -function EditorProfile( { profile, userId, buttonText, buttonOnly, buttonSize } ) { +function EditorProfile( { profile, buttonOnly, innerBlocksProps } ) { const { webfinger, avatar, name } = profile; - const buttonClass = buttonSize === 'small' ? 'is-small' : buttonSize === 'compact' ? 'is-compact' : ''; if ( buttonOnly ) { return (
- +
); } @@ -87,9 +84,7 @@ function EditorProfile( { profile, userId, buttonText, buttonOnly, buttonSize } { webfinger }
- +
); } @@ -110,11 +105,23 @@ export default function Edit( { attributes, setAttributes, context: { postType, className: 'activitypub-follow-me-block-wrapper', } ); const usersOptions = useUserOptions( { withInherit: true } ); - const { selectedUser, buttonOnly, buttonText, buttonSize } = attributes; + const { selectedUser, buttonOnly } = attributes; const isInheritMode = selectedUser === 'inherit'; const [ profile, setProfile ] = useState( getNormalizedProfile( DEFAULT_PROFILE_DATA ) ); const userId = selectedUser === 'site' ? 0 : selectedUser; + const TEMPLATE = [ [ 'core/button', { text: __( 'Follow', 'activitypub' ), tagName: 'button' } ] ]; + + const innerBlocksProps = useInnerBlocksProps( + {}, + { + allowedBlocks: [ 'core/button' ], + template: TEMPLATE, + templateLock: false, + renderAppender: false, + } + ); + const authorId = useSelect( ( select ) => { const { getEditedEntityRecord } = select( coreStore ); @@ -126,7 +133,7 @@ export default function Edit( { attributes, setAttributes, context: { postType, ); useEffect( () => { - // Fetch profile data when userId changes + // Fetch profile data when userId changes. if ( isInheritMode && ! authorId ) { return; } @@ -138,11 +145,11 @@ export default function Edit( { attributes, setAttributes, context: { postType, }, [ userId, authorId, isInheritMode ] ); useEffect( () => { - // if there are no users yet, do nothing + // If there are no users yet, do nothing. if ( ! usersOptions.length ) { return; } - // ensure that the selected user is in the list of options, if not, select the first available user + // Ensure that the selected user is in the list of options, if not, select the first available user. if ( ! usersOptions.find( ( { value } ) => value === selectedUser ) ) { setAttributes( { selectedUser: usersOptions[ 0 ].value } ); } @@ -166,22 +173,6 @@ export default function Edit( { attributes, setAttributes, context: { postType, onChange={ ( value ) => setAttributes( { buttonOnly: value } ) } help={ __( 'Only show the follow button without profile information', 'activitypub' ) } /> - setAttributes( { buttonText: value } ) } - /> - setAttributes( { buttonSize: value } ) } - help={ __( 'Choose the size of the follow button', 'activitypub' ) } - /> @@ -191,9 +182,8 @@ export default function Edit( { attributes, setAttributes, context: { postType, ) }
diff --git a/src/follow-me/index.js b/src/follow-me/index.js index 30e021a57..fd6263ec0 100644 --- a/src/follow-me/index.js +++ b/src/follow-me/index.js @@ -1,10 +1,13 @@ import { registerBlockType } from '@wordpress/blocks'; import { people } from '@wordpress/icons'; +import deprecated from './deprecation'; import edit from './edit'; +import save from './save'; -// Register the block +// Register the block. registerBlockType( 'activitypub/follow-me', { + deprecated, edit, icon: people, - save: () => null, + save, } ); diff --git a/src/follow-me/render.php b/src/follow-me/render.php index bb7cf582c..ddebffa85 100644 --- a/src/follow-me/render.php +++ b/src/follow-me/render.php @@ -5,6 +5,8 @@ * @package ActivityPub */ +use Activitypub\Blocks; + /* @var array $attributes Block attributes. */ $attributes = wp_parse_args( $attributes ); @@ -12,8 +14,6 @@ $selected_user = $attributes['selectedUser'] ?? 'site'; $user_id = 'site' === $selected_user ? 0 : intval( $selected_user ); $button_only = $attributes['buttonOnly'] ?? false; -$button_text = $attributes['buttonText'] ?? __( 'Follow', 'activitypub' ); -$button_size = $attributes['buttonSize'] ?? 'default'; // Generate a unique ID for the block. $block_id = 'activitypub-follow-me-block-' . wp_unique_id(); @@ -25,13 +25,6 @@ // Get button style from block attributes. $button_style = $attributes['style'] ?? array(); -$button_class = ''; -if ( 'small' === $button_size ) { - $button_class = 'is-small'; -} elseif ( 'compact' === $button_size ) { - $button_class = 'is-compact'; -} - $actor = \Activitypub\Collection\Actors::get_by_id( $user_id ); // Set up the Interactivity API state. @@ -78,6 +71,13 @@ ) ); +/* @var string $content Inner blocks content. */ +if ( empty( $content ) ) { + $button_text = $attributes['buttonText'] ?? __( 'Follow', 'activitypub' ); + $content = '
'; +} +$content = Blocks::add_directions_to_button( $content, $attributes ); + ?>
@@ -96,13 +96,7 @@ class="activitypub-profile__avatar"
- +
; +} + +export default save; diff --git a/src/follow-me/style.scss b/src/follow-me/style.scss index 7d4aa1fe1..12edb15ff 100644 --- a/src/follow-me/style.scss +++ b/src/follow-me/style.scss @@ -42,15 +42,28 @@ text-overflow: ellipsis; } - &__follow { + .wp-block-button { flex-shrink: 0; - background-color: var(--wp--preset--color--black); - color: var(--wp--preset--color--white); + margin: 0; &:not(:only-child) { margin-left: 1em; } } + + .wp-block-button__link { + margin: 0; + } + + .is-small { + padding: 0.25em 0.5em; + font-size: 0.8em; + } + + .is-compact { + padding: 0.4em 0.8em; + font-size: 0.9em; + } } .activitypub-modal { @@ -188,18 +201,6 @@ } } -.components-button { - &.small { - padding: 0.25em 0.5em; - font-size: 0.8em; - } - - &.compact { - padding: 0.4em 0.8em; - font-size: 0.9em; - } -} - body.modal-open { overflow: hidden; } diff --git a/src/follow-me/view.js b/src/follow-me/view.js index 646a031ac..801e7c755 100644 --- a/src/follow-me/view.js +++ b/src/follow-me/view.js @@ -35,7 +35,7 @@ function trapFocus( element ) { } ); } -const { state, actions, callbacks } = store( 'activitypub/follow-me', { +const { state, actions } = store( 'activitypub/follow-me', { actions: { /** * Open the modal. @@ -69,7 +69,7 @@ const { state, actions, callbacks } = store( 'activitypub/follow-me', { // Return focus to the button that opened the modal. const blockWrapper = document.getElementById( context.blockId ); if ( blockWrapper ) { - const openButton = blockWrapper.querySelector( '.activitypub-profile__follow' ); + const openButton = blockWrapper.querySelector( '.wp-block-button__link' ); if ( openButton ) { openButton.focus(); } @@ -77,8 +77,9 @@ const { state, actions, callbacks } = store( 'activitypub/follow-me', { }, toggleModal() { - const context = getContext(); - context.isModalOpen ? actions.closeModal() : actions.openModal(); + const { isModalOpen } = getContext(); + + isModalOpen ? actions.closeModal() : actions.openModal(); }, /** @@ -201,7 +202,6 @@ const { state, actions, callbacks } = store( 'activitypub/follow-me', { // Add popup styles. const popupStyleElement = document.createElement( 'style' ); popupStyleElement.textContent = getPopupStyles( buttonStyle ); - document.head.appendChild( popupStyleElement ); } }, @@ -211,9 +211,10 @@ const { state, actions, callbacks } = store( 'activitypub/follow-me', { * * @param {Event} event Keyboard event. */ - documentKeydown: ( event ) => { - const context = getContext(); - if ( context.isModalOpen && event.key === 'Escape' ) { + documentKeydown( event ) { + const { isModalOpen } = getContext(); + + if ( isModalOpen && event.key === 'Escape' ) { actions.closeModal(); } }, @@ -223,16 +224,33 @@ const { state, actions, callbacks } = store( 'activitypub/follow-me', { * * @param {Event} event Click event. */ - documentClick: ( event ) => { - const context = getContext(); - // Update selector to match the new modal structure. - if ( - context.isModalOpen && - ! event.target.closest( '.activitypub-modal__frame' ) && - ! event.target.closest( '.activitypub-profile__follow' ) - ) { - actions.closeModal(); + documentClick( event ) { + const { blockId, isModalOpen } = getContext(); + if ( ! isModalOpen ) { + return; } + + // Get the block wrapper element. + const blockWrapper = document.getElementById( blockId ); + if ( ! blockWrapper ) { + return; + } + + // If the click was on the button or its children, we should not close the modal. + const toggleButton = blockWrapper.querySelector( + '.wp-element-button[data-wp-on--click="actions.toggleModal"]' + ); + if ( toggleButton && ( toggleButton === event.target || toggleButton.contains( event.target ) ) ) { + return; + } + + // Check if the click was inside the modal frame. + const modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' ); + if ( ! modalFrame || modalFrame.contains( event.target ) ) { + return; + } + + actions.closeModal(); }, }, } ); From 83c7b95de130cb4ef5ba1c9e15caf224aea983b0 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Thu, 15 May 2025 11:25:19 -0500 Subject: [PATCH 20/47] Update build --- build/follow-me/index.asset.php | 2 +- build/follow-me/index.js | 4 ++-- build/follow-me/view.js | 2 +- build/reply/index.asset.php | 2 +- build/reply/index.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/follow-me/index.asset.php b/build/follow-me/index.asset.php index d4c4c5427..194b8fe74 100644 --- a/build/follow-me/index.asset.php +++ b/build/follow-me/index.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '13d45c3b4b88df4c0766'); + array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'c73f2f2bb1dde0fd7e3a'); diff --git a/build/follow-me/index.js b/build/follow-me/index.js index c3bae9d67..a9872c548 100644 --- a/build/follow-me/index.js +++ b/build/follow-me/index.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e={20:(e,t,n)=>{var o=n(609),r=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,n){var o,s={},c=null,u=null;for(o in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,o)&&!i.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:c,ref:u,props:s,_owner:l.current}}},848:(e,t,n)=>{e.exports=n(20)},609:e=>{e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.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);const o=window.wp.blocks,r=window.wp.primitives;var a=n(848);const l=(0,a.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(r.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})}),i=[{attributes:{buttonText:{type:"string",default:"Follow"},buttonSize:{type:"string",default:"default",enum:["small","default","compact"]}},isEligible:e=>!!e.buttonText,migrate(e){const{buttonText:t,buttonSize:n,...r}=e;let a="";return"small"===n?a="is-small":"compact"===n&&(a="is-compact"),[r,[(0,o.createBlock)("core/button",{className:a,tagName:"button",text:t})]]}}];var s=n(609);const c=window.wp.apiFetch;var u=n.n(c);const p=window.wp.blockEditor,d=window.wp.i18n,v=window.wp.data,m=window.wp.coreData,w=window.wp.components,b=window.wp.element;function f(){return window._activityPubOptions||{}}function y({name:e}){const{enabled:t}=f(),n=t?.site?"":(0,d.__)("It will be empty in other non-author contexts.","activitypub"),o=(0,d.sprintf)(/* translators: %1$s: block name, %2$s: extra information for non-author context */ /* translators: %1$s: block name, %2$s: extra information for non-author context */ -(0,d.__)("This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s","activitypub"),e,n).trim();return(0,s.createElement)(w.Card,null,(0,s.createElement)(w.CardBody,null,(0,b.createInterpolateElement)(o,{strong:(0,s.createElement)("strong",null)})))}const h={avatar:"https://secure.gravatar.com/avatar/default?s=120",webfinger:"@well@hello.dolly",name:(0,d.__)("Hello Dolly Fan Account","activitypub"),url:"#"};function _(e){if(!e)return h;const t={...h,...e};return t.avatar=t?.icon?.url,t.webfinger&&!t.webfinger.startsWith("@")&&(t.webfinger="@"+t.webfinger),t}function g({profile:e,buttonOnly:t,innerBlocksProps:n}){const{webfinger:o,avatar:r,name:a}=e;return t?(0,s.createElement)("div",{className:"activitypub-profile"},(0,s.createElement)("div",{...n})):(0,s.createElement)("div",{className:"activitypub-profile"},(0,s.createElement)("img",{className:"activitypub-profile__avatar",src:r,alt:a}),(0,s.createElement)("div",{className:"activitypub-profile__content"},(0,s.createElement)("div",{className:"activitypub-profile__name"},a),(0,s.createElement)("div",{className:"activitypub-profile__handle",title:o},o)),(0,s.createElement)("div",{...n}))}(0,o.registerBlockType)("activitypub/follow-me",{deprecated:i,edit:function({attributes:e,setAttributes:t,context:{postType:n,postId:o}}){const r=(0,p.useBlockProps)({className:"activitypub-follow-me-block-wrapper"}),a=function({withInherit:e=!1}){const{enabled:t}=f(),n=t?.users?(0,v.useSelect)((e=>e("core").getUsers({who:"authors"}))):[];return(0,b.useMemo)((()=>{if(!n)return[];const o=[];return t?.site&&o.push({label:(0,d.__)("Site","activitypub"),value:"site"}),e&&t?.users&&o.push({label:(0,d.__)("Dynamic User","activitypub"),value:"inherit"}),n.reduce(((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e)),o)}),[n])}({withInherit:!0}),{selectedUser:l,buttonOnly:i}=e,c="inherit"===l,[E,k]=(0,b.useState)(_(h)),O="site"===l?0:l,x=[["core/button",{text:(0,d.__)("Follow","activitypub"),tagName:"button"}]],P=(0,p.useInnerBlocksProps)({},{allowedBlocks:["core/button"],template:x,templateLock:!1,renderAppender:!1}),B=(0,v.useSelect)((e=>{const{getEditedEntityRecord:t}=e(m.store),r=t("postType",n,o)?.author;return null!=r?r:null}),[n,o]);return(0,b.useEffect)((()=>{c&&!B||function(e){const{namespace:t}=f(),n={headers:{Accept:"application/activity+json"},path:`/${t}/actors/${e}`};return u()(n)}(c?B:O).then((e=>{k(_(e))}))}),[O,B,c]),(0,b.useEffect)((()=>{a.length&&(a.find((({value:e})=>e===l))||t({selectedUser:a[0].value}))}),[l,a]),(0,s.createElement)("div",{...r},(0,s.createElement)(p.InspectorControls,{key:"activitypub-follow-me"},(0,s.createElement)(w.PanelBody,{title:(0,d.__)("Follow Me Options","activitypub")},a.length>1&&(0,s.createElement)(w.SelectControl,{label:(0,d.__)("Select User","activitypub"),value:e.selectedUser,options:a,onChange:e=>t({selectedUser:e})}),(0,s.createElement)(w.ToggleControl,{label:(0,d.__)("Button Only Mode","activitypub"),checked:i,onChange:e=>t({buttonOnly:e}),help:(0,d.__)("Only show the follow button without profile information","activitypub")}))),c&&!B?(0,s.createElement)(y,{name:(0,d.__)("Follow Me","activitypub")}):(0,s.createElement)(g,{profile:E,userId:c?B:O,buttonOnly:i,innerBlocksProps:P}))},icon:l,save:function(){const e=p.useBlockProps.save(),t=p.useInnerBlocksProps.save(e);return(0,s.createElement)("div",{...t})}})})(); +(()=>{"use strict";var e={20:(e,t,n)=>{var o=n(609),r=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,n){var o,s={},c=null,u=null;for(o in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,o)&&!i.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:c,ref:u,props:s,_owner:l.current}}},609:e=>{e.exports=window.React},848:(e,t,n)=>{e.exports=n(20)}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.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);const o=window.wp.blocks,r=window.wp.primitives;var a=n(848);const l=(0,a.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(r.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})}),i=[{attributes:{buttonText:{type:"string",default:"Follow"},buttonSize:{type:"string",default:"default",enum:["small","default","compact"]}},isEligible:e=>!!e.buttonText,migrate(e){const{buttonText:t,buttonSize:n,...r}=e;let a="";return"small"===n?a="is-small":"compact"===n&&(a="is-compact"),[r,[(0,o.createBlock)("core/button",{className:a,tagName:"button",text:t})]]}}];var s=n(609);const c=window.wp.apiFetch;var u=n.n(c);const p=window.wp.blockEditor,d=window.wp.i18n,v=window.wp.data,m=window.wp.coreData,w=window.wp.components,b=window.wp.element;function f(){return window._activityPubOptions||{}}function y({name:e}){const{enabled:t}=f(),n=t?.site?"":(0,d.__)("It will be empty in other non-author contexts.","activitypub"),o=(0,d.sprintf)(/* translators: %1$s: block name, %2$s: extra information for non-author context */ /* translators: %1$s: block name, %2$s: extra information for non-author context */ +(0,d.__)("This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s","activitypub"),e,n).trim();return(0,s.createElement)(w.Card,null,(0,s.createElement)(w.CardBody,null,(0,b.createInterpolateElement)(o,{strong:(0,s.createElement)("strong",null)})))}const h={avatar:"https://secure.gravatar.com/avatar/default?s=120",webfinger:"@well@hello.dolly",name:(0,d.__)("Hello Dolly Fan Account","activitypub"),url:"#"};function _(e){if(!e)return h;const t={...h,...e};return t.avatar=t?.icon?.url,t.webfinger&&!t.webfinger.startsWith("@")&&(t.webfinger="@"+t.webfinger),t}function g({profile:e,buttonOnly:t,innerBlocksProps:n}){const{webfinger:o,avatar:r,name:a}=e;return t?(0,s.createElement)("div",{className:"activitypub-profile"},(0,s.createElement)("div",{...n})):(0,s.createElement)("div",{className:"activitypub-profile"},(0,s.createElement)("img",{className:"activitypub-profile__avatar",src:r,alt:a}),(0,s.createElement)("div",{className:"activitypub-profile__content"},(0,s.createElement)("div",{className:"activitypub-profile__name"},a),(0,s.createElement)("div",{className:"activitypub-profile__handle",title:o},o)),(0,s.createElement)("div",{...n}))}(0,o.registerBlockType)("activitypub/follow-me",{deprecated:i,edit:function({attributes:e,setAttributes:t,context:{postType:n,postId:o}}){const r=(0,p.useBlockProps)({className:"activitypub-follow-me-block-wrapper"}),a=function({withInherit:e=!1}){const{enabled:t}=f(),n=t?.users?(0,v.useSelect)((e=>e("core").getUsers({who:"authors"}))):[];return(0,b.useMemo)((()=>{if(!n)return[];const o=[];return t?.site&&o.push({label:(0,d.__)("Site","activitypub"),value:"site"}),e&&t?.users&&o.push({label:(0,d.__)("Dynamic User","activitypub"),value:"inherit"}),n.reduce(((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e)),o)}),[n])}({withInherit:!0}),{selectedUser:l,buttonOnly:i}=e,c="inherit"===l,[E,k]=(0,b.useState)(_(h)),O="site"===l?0:l,x=[["core/button",{text:(0,d.__)("Follow","activitypub"),tagName:"button"}]],P=(0,p.useInnerBlocksProps)({},{allowedBlocks:["core/button"],template:x,templateLock:!1,renderAppender:!1}),B=(0,v.useSelect)((e=>{const{getEditedEntityRecord:t}=e(m.store),r=t("postType",n,o)?.author;return null!=r?r:null}),[n,o]);return(0,b.useEffect)((()=>{c&&!B||function(e){const{namespace:t}=f(),n={headers:{Accept:"application/activity+json"},path:`/${t}/actors/${e}`};return u()(n)}(c?B:O).then((e=>{k(_(e))}))}),[O,B,c]),(0,b.useEffect)((()=>{a.length&&(a.find((({value:e})=>e===l))||t({selectedUser:a[0].value}))}),[l,a]),(0,s.createElement)("div",{...r},(0,s.createElement)(p.InspectorControls,{key:"activitypub-follow-me"},(0,s.createElement)(w.PanelBody,{title:(0,d.__)("Follow Me Options","activitypub")},a.length>1&&(0,s.createElement)(w.SelectControl,{label:(0,d.__)("Select User","activitypub"),value:e.selectedUser,options:a,onChange:e=>t({selectedUser:e})}),(0,s.createElement)(w.ToggleControl,{label:(0,d.__)("Button Only Mode","activitypub"),checked:i,onChange:e=>t({buttonOnly:e}),help:(0,d.__)("Only show the follow button without profile information","activitypub")}))),c&&!B?(0,s.createElement)(y,{name:(0,d.__)("Follow Me","activitypub")}):(0,s.createElement)(g,{profile:E,userId:c?B:O,buttonOnly:i,innerBlocksProps:P}))},icon:l,save:function(){const e=p.useBlockProps.save(),t=p.useInnerBlocksProps.save(e);return(0,s.createElement)("div",{...t})}})})(); \ No newline at end of file diff --git a/build/follow-me/view.js b/build/follow-me/view.js index 03f7bf928..4008cf913 100644 --- a/build/follow-me/view.js +++ b/build/follow-me/view.js @@ -1 +1 @@ -import*as e from"@wordpress/interactivity";var t,o,n={825:(t,o,n)=>{const r=(c={getContext:()=>e.getContext,store:()=>e.store},l={},n.d(l,c),l);var c,l;function i(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|");return`var(--wp--preset--color--${t})`}function s(e,t,o=null,n=""){return o?`${e}${n} { ${t}: ${o}; }\n`:""}function a(e,t,o,n){return s(e,"background-color",t)+s(e,"color",o)+s(e,"background-color",n,":hover")+s(e,"background-color",n,":focus")}const{state:d,actions:u}=(0,r.store)("activitypub/follow-me",{actions:{openModal(){const e=(0,r.getContext)();e.isModalOpen=!0,document.body.classList.add("modal-open"),setTimeout((()=>{const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".activitypub-modal__frame");e&&(n=(o=e).querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),r=n[0],c=n[n.length-1],r.focus(),o.addEventListener("keydown",(function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?document.activeElement===r&&(c.focus(),e.preventDefault()):document.activeElement===c&&(r.focus(),e.preventDefault()))})))}var o,n,r,c}),50)},closeModal(){const e=(0,r.getContext)();e.isModalOpen=!1,document.body.classList.remove("modal-open");const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".wp-block-button__link");e&&e.focus()}},toggleModal(){const{isModalOpen:e}=(0,r.getContext)();e?u.closeModal():u.openModal()},copyToClipboard(){const e=(0,r.getContext)();navigator.clipboard.writeText(e.webfinger).then((()=>{e.copyButtonText=d.i18n.copied,setTimeout((()=>{e.copyButtonText=d.i18n.copy}),1e3)}),(e=>{console.error("Could not copy text: ",e)}))},updateRemoteProfile(e){const t=(0,r.getContext)();t.remoteProfile=e.target.value,t.isError=!1,t.errorMessage=""},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),u.submitRemoteProfile())},submitRemoteProfile:function*(){const e=(0,r.getContext)(),{namespace:t}=d,o=e.remoteProfile.trim();if(!o)return e.isError=!0,void(e.errorMessage=d.i18n.emptyProfileError);if(!/^(https?:\/\/|@)/.test(o))return e.isError=!0,void(e.errorMessage=d.i18n.invalidProfileError);e.isLoading=!0,e.isError=!1;const n=`/${t}/actors/${e.userId}/remote-follow?resource=${encodeURIComponent(o)}`;try{const t=yield apiFetch({path:n});e.isLoading=!1,window.open(t.url,"_blank"),u.closeModal()}catch(t){console.error("Error submitting profile:",t),e.isLoading=!1,e.isError=!0,e.errorMessage=t.message||d.i18n.genericError}}},callbacks:{initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:t,blockId:o}=(0,r.getContext)();if(o&&e){const r=document.createElement("style"),c=`#${o}`;r.textContent=function(e,t,o){if(!t.length)return"";const n=`${e} .wp-block-button__link`,r=("string"==typeof(c=o)?`var(--wp--preset--color--${c})`:c?.color?.background||null)||t?.color?.background;var c;return a(n,i(t?.elements?.link?.color?.text),r,i(t?.elements?.link?.[":hover"]?.color?.text))}(c,e,t),document.head.appendChild(r);const l=document.createElement("style");l.textContent=(n=e,a(".activitypub-dialog__button-group .components-button",i(n?.elements?.link?.color?.text)||"#111","#fff",i(n?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(l)}var n},documentKeydown(e){const{isModalOpen:t}=(0,r.getContext)();t&&"Escape"===e.key&&u.closeModal()},documentClick(e){const{blockId:t,isModalOpen:o}=(0,r.getContext)();if(!o)return;const n=document.getElementById(t);if(!n)return;const c=n.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(c&&(c===e.target||c.contains(e.target)))return;const l=n.querySelector(".activitypub-modal__frame");l&&!l.contains(e.target)&&u.closeModal()}}})}},r={};function c(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,c),o.exports}c.m=n,t=[],c.O=(e,o,n,r)=>{if(!o){var l=1/0;for(d=0;d=r)&&Object.keys(c.O).every((e=>c.O[e](o[s])))?o.splice(s--,1):(i=!1,r0&&t[d-1][2]>r;d--)t[d]=t[d-1];t[d]=[o,n,r]},c.d=(e,t)=>{for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={41:0,301:0},c.O.j=e=>0===o[e];var l=c.O(void 0,[301],(()=>c(825)));l=c.O(l); +import*as e from"@wordpress/interactivity";var t,o,n={825:(t,o,n)=>{const r=(c={getContext:()=>e.getContext,store:()=>e.store},l={},n.d(l,c),l);var c,l;function i(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|");return`var(--wp--preset--color--${t})`}function s(e,t,o=null,n=""){return o?`${e}${n} { ${t}: ${o}; }\n`:""}function a(e,t,o,n){return s(e,"background-color",t)+s(e,"color",o)+s(e,"background-color",n,":hover")+s(e,"background-color",n,":focus")}const{state:d,actions:u}=(0,r.store)("activitypub/follow-me",{actions:{openModal(){const e=(0,r.getContext)();e.isModalOpen=!0,document.body.classList.add("modal-open"),setTimeout((()=>{const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".activitypub-modal__frame");e&&(n=(o=e).querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),r=n[0],c=n[n.length-1],r.focus(),o.addEventListener("keydown",(function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?document.activeElement===r&&(c.focus(),e.preventDefault()):document.activeElement===c&&(r.focus(),e.preventDefault()))})))}var o,n,r,c}),50)},closeModal(){const e=(0,r.getContext)();e.isModalOpen=!1,document.body.classList.remove("modal-open");const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".wp-block-button__link");e&&e.focus()}},toggleModal(){const{isModalOpen:e}=(0,r.getContext)();e?u.closeModal():u.openModal()},copyToClipboard(){const e=(0,r.getContext)();navigator.clipboard.writeText(e.webfinger).then((()=>{e.copyButtonText=d.i18n.copied,setTimeout((()=>{e.copyButtonText=d.i18n.copy}),1e3)}),(e=>{console.error("Could not copy text: ",e)}))},updateRemoteProfile(e){const t=(0,r.getContext)();t.remoteProfile=e.target.value,t.isError=!1,t.errorMessage=""},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),u.submitRemoteProfile())},submitRemoteProfile:function*(){const e=(0,r.getContext)(),{namespace:t}=d,o=e.remoteProfile.trim();if(!o)return e.isError=!0,void(e.errorMessage=d.i18n.emptyProfileError);if(!/^(https?:\/\/|@)/.test(o))return e.isError=!0,void(e.errorMessage=d.i18n.invalidProfileError);e.isLoading=!0,e.isError=!1;const n=`/${t}/actors/${e.userId}/remote-follow?resource=${encodeURIComponent(o)}`;try{const t=yield apiFetch({path:n});e.isLoading=!1,window.open(t.url,"_blank"),u.closeModal()}catch(t){console.error("Error submitting profile:",t),e.isLoading=!1,e.isError=!0,e.errorMessage=t.message||d.i18n.genericError}}},callbacks:{initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:t,blockId:o}=(0,r.getContext)();if(o&&e){const r=document.createElement("style"),c=`#${o}`;r.textContent=function(e,t,o){if(!t.length)return"";const n=`${e} .wp-block-button__link`,r=("string"==typeof(c=o)?`var(--wp--preset--color--${c})`:c?.color?.background||null)||t?.color?.background;var c;return a(n,i(t?.elements?.link?.color?.text),r,i(t?.elements?.link?.[":hover"]?.color?.text))}(c,e,t),document.head.appendChild(r);const l=document.createElement("style");l.textContent=(n=e,a(".activitypub-dialog__button-group .components-button",i(n?.elements?.link?.color?.text)||"#111","#fff",i(n?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(l)}var n},documentKeydown(e){const{isModalOpen:t}=(0,r.getContext)();t&&"Escape"===e.key&&u.closeModal()},documentClick(e){const{blockId:t,isModalOpen:o}=(0,r.getContext)();if(!o)return;const n=document.getElementById(t);if(!n)return;const c=n.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(c&&(c===e.target||c.contains(e.target)))return;const l=n.querySelector(".activitypub-modal__frame");l&&!l.contains(e.target)&&u.closeModal()}}})}},r={};function c(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,c),o.exports}c.m=n,t=[],c.O=(e,o,n,r)=>{if(!o){var l=1/0;for(d=0;d=r)&&Object.keys(c.O).every((e=>c.O[e](o[s])))?o.splice(s--,1):(i=!1,r0&&t[d-1][2]>r;d--)t[d]=t[d-1];t[d]=[o,n,r]},c.d=(e,t)=>{for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={41:0,301:0},c.O.j=e=>0===o[e];var l=c.O(void 0,[301],(()=>c(825)));l=c.O(l); \ No newline at end of file diff --git a/build/reply/index.asset.php b/build/reply/index.asset.php index 9f4117fee..302b07b9f 100644 --- a/build/reply/index.asset.php +++ b/build/reply/index.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '78dbc26b5e405051df4a'); + array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'e4cc0f6ffd681f4d678d'); diff --git a/build/reply/index.js b/build/reply/index.js index c8ee59e4e..c9b6b8200 100644 --- a/build/reply/index.js +++ b/build/reply/index.js @@ -1 +1 @@ -(()=>{"use strict";var e,t={20:(e,t,r)=>{var n=r(609),o=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,r){var n,c={},s=null,d=null;for(n in void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(d=t.ref),t)a.call(t,n)&&!l.hasOwnProperty(n)&&(c[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===c[n]&&(c[n]=t[n]);return{$$typeof:o,type:e,key:s,ref:d,props:c,_owner:i.current}}},238:(e,t,r)=>{const n=window.wp.blocks,o=window.wp.primitives;var a=r(848);const i=(0,a.jsx)(o.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)(o.Path,{d:"M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z"})});var l=r(609);const c=window.wp.blockEditor,s=window.wp.components,d=window.wp.i18n,u=window.wp.element,m=window.wp.compose,p=window.wp.apiFetch;var f=r.n(p);const h=window.wp.url,w=window.wp.data;function b({html:e}){const t=(0,u.useRef)(null),[r,n]=(0,u.useState)(300),o=(0,u.useRef)(300),a=(0,u.useCallback)((()=>{if(t.current)try{const e=t.current;let r=300;try{e.contentDocument&&e.contentDocument.body?r=e.contentDocument.body.scrollHeight:e.contentWindow&&e.contentWindow.document&&e.contentWindow.document.body&&(r=e.contentWindow.document.body.scrollHeight)}catch(e){console.log("Could not access iframe content document:",e)}r+=5,Math.abs(r-o.current)>5&&(o.current=r,n(r))}catch(e){console.error("Error adjusting iframe height:",e)}}),[]),i=(0,u.useCallback)((()=>{if(t.current)try{a()}catch(e){console.error("Error setting up iframe height adjustment:",e)}}),[a]);return(0,u.useEffect)((()=>{t.current&&t.current.addEventListener("load",i);const e=setInterval(a,1e3);return()=>{clearInterval(e),t.current&&t.current.removeEventListener("load",i)}}),[i,a]),(0,u.useEffect)((()=>{if(t.current){const e=setTimeout((()=>{a()}),100);return()=>clearTimeout(e)}}),[e,a]),{iframeRef:t,iframeHeight:r,adjustIframeHeight:a,handleIframeLoad:i}}const v={class:"className",frameborder:"frameBorder",allowfullscreen:"allowFullScreen",allowtransparency:"allowTransparency",marginheight:"marginHeight",marginwidth:"marginWidth"};function y({onClick:e}){return(0,l.createElement)("div",{className:"activitypub-embed-overlay",onClick:e,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",cursor:"pointer",zIndex:1}})}function g({html:e,onSelectBlock:t}){const r=(0,u.useRef)(),[n,o]=(0,u.useState)(282),[a,i]=(0,u.useState)(!1),c=(0,u.useCallback)((()=>{const t=(new window.DOMParser).parseFromString(e,"text/html").querySelector("iframe"),r={};return t?(Array.from(t.attributes).forEach((({name:e,value:t})=>{"style"!==e&&(r[v[e]||e]=t)})),r):r}),[e]),s=c();return(0,u.useEffect)((()=>{if(!r.current)return;const{ownerDocument:e}=r.current,{defaultView:t}=e;function n({data:{secret:e,message:t,value:r}={}}){"height"===t&&e===s["data-secret"]&&o(r)}return t.addEventListener("message",n),()=>{t.removeEventListener("message",n)}}),[s]),s.src?(0,l.createElement)("div",{className:"wp-block-embed__wrapper",style:{position:"relative"}},(0,l.createElement)("iframe",{ref:r,title:s.title||(0,d.__)("Embedded WordPress content","activitypub"),...s,height:n,style:{width:"100%",maxWidth:"100%"}}),!a&&(0,l.createElement)(y,{onClick:t})):(0,l.createElement)("div",{className:"wp-block-embed__wrapper",style:{position:"relative"}},(0,l.createElement)("div",{dangerouslySetInnerHTML:{__html:e}}),(0,l.createElement)(y,{onClick:t}))}function _({html:e,onClick:t,isSelected:r}){const{iframeRef:n,iframeHeight:o,adjustIframeHeight:a,handleIframeLoad:i}=b({html:e}),c=(0,u.useCallback)((()=>`\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t${e}\n\t\t\t\n\t\t\t\n\t\t`),[e]);return(0,l.createElement)("div",{className:"wp-block-embed__wrapper",style:{position:"relative"}},(0,l.createElement)("iframe",{ref:n,srcDoc:c(),sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",style:{width:"100%",height:`${o}px`,border:"none",overflow:"hidden"},onLoad:i}),r&&(0,l.createElement)("div",{onClick:t,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",cursor:"pointer",zIndex:1,display:r?"block":"none"}}))}const E={default:(0,d.__)("Enter the URL of a post from the Fediverse (Mastodon, Pixelfed, etc.) that you want to reply to.","activitypub"),checking:()=>(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.Spinner,null)," "+(0,d.__)("Checking if this URL supports ActivityPub replies...","activitypub")),valid:(0,d.__)("The author will be notified of your response.","activitypub"),error:(0,d.__)("This URL probably won't receive your reply. We'll still try.","activitypub")},k={valid:(0,d.__)("This post can be embedded with your reply.","activitypub"),invalid:(0,d.__)("This post cannot be embedded.","activitypub")};(0,n.registerBlockType)("activitypub/reply",{edit:function({attributes:e,setAttributes:t,clientId:r,isSelected:n}){const{url:o}=e,{namespace:a}=window._activityPubOptions||{},[i,p]=(0,u.useState)(E.default),[v,y]=(0,u.useState)(!1),[C,L]=(0,u.useState)(!1),[S,O]=(0,u.useState)(!1),[P,x]=(0,u.useState)(!0===e.embedPost||!o),[R,T]=(0,u.useState)(null),{iframeRef:H,iframeHeight:I,adjustIframeHeight:j,handleIframeLoad:D}=b({html:R}),{insertAfterBlock:B,removeBlock:N}=(0,w.useDispatch)("core/block-editor"),W=(0,c.useBlockProps)(),F=(0,u.useRef)(),M=((0,u.useRef)(),(0,u.useRef)(P)),U=()=>{setTimeout((()=>F.current?.focus()),50)};(0,u.useEffect)((()=>{M.current=P}),[P]);const A=(0,u.useCallback)((e=>{y(e),M.current&&e&&t({embedPost:!0})}),[t]),V=(e=!1)=>{O(e),y(!1),L(!1),T("")},$=(0,m.useDebounce)((async e=>{if(e)try{V(!0),p(E.checking());const t=await f()({path:(0,h.addQueryArgs)(`${a}/url/validate`,{url:e})});A(t.is_activitypub),L(t.is_real_oembed),T(t.html||""),p(E.valid)}catch(e){V(),p(E.error)}finally{O(!1)}else V()}),250);return(0,u.useEffect)((()=>{o&&$(o)}),[o]),(0,l.createElement)(l.Fragment,null,(0,l.createElement)(c.InspectorControls,null,(0,l.createElement)(s.PanelBody,{title:(0,d.__)("Settings","activitypub")},(0,l.createElement)(s.ToggleControl,{label:(0,d.__)("Embed Post","activitypub"),checked:e.embedPost,onChange:e=>{t({embedPost:e}),x(e)},disabled:!v,help:v?k.valid:k.invalid}))),(0,l.createElement)("div",{...W},n&&(0,l.createElement)(s.TextControl,{label:(0,d.__)("Your post is a reply to the following URL","activitypub"),value:o,onChange:e=>t({url:e}),help:i,onKeyDown:t=>{"Enter"===t.key&&B(r),!e.url&&["Backspace","Delete"].includes(t.key)&&N(r)},ref:F}),v&&e.embedPost&&R&&(0,l.createElement)("div",{className:"activitypub-embed-container"},C&&(Y=R)&&(Y.includes("wp-embedded-content")||Y.includes("wp-embed/")||Y.includes('class="wp-embed"'))?(0,l.createElement)(g,{html:R,onSelectBlock:U}):(0,l.createElement)(_,{html:R,onClick:U,isSelected:n})),o&&(!e.embedPost||!R)&&(0,l.createElement)("div",{className:"activitypub-reply-block-editor__preview",contentEditable:!1,onClick:U,style:{cursor:"pointer"}},(0,l.createElement)("a",{href:o,className:"u-in-reply-to",target:"_blank",rel:"noreferrer"},"↬"+o.replace(/^https?:\/\//,"")))));var Y},save:()=>null,icon:i})},609:e=>{e.exports=window.React},848:(e,t,r)=>{e.exports=r(20)}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.m=t,e=[],n.O=(t,r,o,a)=>{if(!r){var i=1/0;for(d=0;d=a)&&Object.keys(n.O).every((e=>n.O[e](r[c])))?r.splice(c--,1):(l=!1,a0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[r,o,a]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={780:0,356:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var o,a,[i,l,c]=r,s=0;if(i.some((t=>0!==e[t]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(c)var d=c(n)}for(t&&t(r);sn(238)));o=n.O(o)})(); \ No newline at end of file +(()=>{"use strict";var e,t={20:(e,t,r)=>{var n=r(609),o=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,r){var n,c={},s=null,u=null;for(n in void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,n)&&!l.hasOwnProperty(n)&&(c[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===c[n]&&(c[n]=t[n]);return{$$typeof:o,type:e,key:s,ref:u,props:c,_owner:i.current}}},238:(e,t,r)=>{const n=window.wp.blocks,o=window.wp.primitives;var a=r(848);const i=(0,a.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)(o.Path,{d:"M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z"})});var l=r(609);const c=window.wp.blockEditor,s=window.wp.components,u=window.wp.i18n,d=window.wp.element,m=window.wp.compose,p=window.wp.apiFetch;var f=r.n(p);const h=window.wp.url,b=window.wp.data;function w({html:e}){const t=(0,d.useRef)(null),[r,n]=(0,d.useState)(300),o=(0,d.useRef)(300),a=(0,d.useCallback)((()=>{if(t.current)try{const e=t.current;let r=300;try{e.contentDocument&&e.contentDocument.body?r=e.contentDocument.body.scrollHeight:e.contentWindow&&e.contentWindow.document&&e.contentWindow.document.body&&(r=e.contentWindow.document.body.scrollHeight)}catch(e){console.log("Could not access iframe content document:",e)}r+=5,Math.abs(r-o.current)>5&&(o.current=r,n(r))}catch(e){console.error("Error adjusting iframe height:",e)}}),[]),i=(0,d.useCallback)((()=>{if(t.current)try{a()}catch(e){console.error("Error setting up iframe height adjustment:",e)}}),[a]);return(0,d.useEffect)((()=>{t.current&&t.current.addEventListener("load",i);const e=setInterval(a,1e3);return()=>{clearInterval(e),t.current&&t.current.removeEventListener("load",i)}}),[i,a]),(0,d.useEffect)((()=>{if(t.current){const e=setTimeout((()=>{a()}),100);return()=>clearTimeout(e)}}),[e,a]),{iframeRef:t,iframeHeight:r,adjustIframeHeight:a,handleIframeLoad:i}}const v={class:"className",frameborder:"frameBorder",allowfullscreen:"allowFullScreen",allowtransparency:"allowTransparency",marginheight:"marginHeight",marginwidth:"marginWidth"};function y({onClick:e}){return(0,l.createElement)("div",{className:"activitypub-embed-overlay",onClick:e,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",cursor:"pointer",zIndex:1}})}function g({html:e,onSelectBlock:t}){const r=(0,d.useRef)(),[n,o]=(0,d.useState)(282),[a,i]=(0,d.useState)(!1),c=(0,d.useCallback)((()=>{const t=(new window.DOMParser).parseFromString(e,"text/html").querySelector("iframe"),r={};return t?(Array.from(t.attributes).forEach((({name:e,value:t})=>{"style"!==e&&(r[v[e]||e]=t)})),r):r}),[e]),s=c();return(0,d.useEffect)((()=>{if(!r.current)return;const{ownerDocument:e}=r.current,{defaultView:t}=e;function n({data:{secret:e,message:t,value:r}={}}){"height"===t&&e===s["data-secret"]&&o(r)}return t.addEventListener("message",n),()=>{t.removeEventListener("message",n)}}),[s]),s.src?(0,l.createElement)("div",{className:"wp-block-embed__wrapper",style:{position:"relative"}},(0,l.createElement)("iframe",{ref:r,title:s.title||(0,u.__)("Embedded WordPress content","activitypub"),...s,height:n,style:{width:"100%",maxWidth:"100%"}}),!a&&(0,l.createElement)(y,{onClick:t})):(0,l.createElement)("div",{className:"wp-block-embed__wrapper",style:{position:"relative"}},(0,l.createElement)("div",{dangerouslySetInnerHTML:{__html:e}}),(0,l.createElement)(y,{onClick:t}))}function _({html:e,onClick:t,isSelected:r}){const{iframeRef:n,iframeHeight:o,adjustIframeHeight:a,handleIframeLoad:i}=w({html:e}),c=(0,d.useCallback)((()=>`\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t${e}\n\t\t\t\n\t\t\t\n\t\t`),[e]);return(0,l.createElement)("div",{className:"wp-block-embed__wrapper",style:{position:"relative"}},(0,l.createElement)("iframe",{ref:n,srcDoc:c(),sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",style:{width:"100%",height:`${o}px`,border:"none",overflow:"hidden"},onLoad:i}),r&&(0,l.createElement)("div",{onClick:t,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",cursor:"pointer",zIndex:1,display:r?"block":"none"}}))}const E={default:(0,u.__)("Enter the URL of a post from the Fediverse (Mastodon, Pixelfed, etc.) that you want to reply to.","activitypub"),checking:()=>(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.Spinner,null)," "+(0,u.__)("Checking if this URL supports ActivityPub replies...","activitypub")),valid:(0,u.__)("The author will be notified of your response.","activitypub"),error:(0,u.__)("This URL probably won't receive your reply. We'll still try.","activitypub")},k={valid:(0,u.__)("This post can be embedded with your reply.","activitypub"),invalid:(0,u.__)("This post cannot be embedded.","activitypub")};(0,n.registerBlockType)("activitypub/reply",{edit:function({attributes:e,setAttributes:t,clientId:r,isSelected:n}){const{url:o}=e,{namespace:a}=window._activityPubOptions||{},[i,p]=(0,d.useState)(E.default),[v,y]=(0,d.useState)(!1),[C,L]=(0,d.useState)(!1),[S,O]=(0,d.useState)(!1),[P,x]=(0,d.useState)(!0===e.embedPost||!o),[R,T]=(0,d.useState)(null),{iframeRef:H,iframeHeight:I,adjustIframeHeight:j,handleIframeLoad:D}=w({html:R}),{insertAfterBlock:B,removeBlock:N}=(0,b.useDispatch)("core/block-editor"),W=(0,c.useBlockProps)(),F=(0,d.useRef)(),M=((0,d.useRef)(),(0,d.useRef)(P)),U=()=>{setTimeout((()=>F.current?.focus()),50)};(0,d.useEffect)((()=>{M.current=P}),[P]);const A=(0,d.useCallback)((e=>{y(e),M.current&&e&&t({embedPost:!0})}),[t]),V=(e=!1)=>{O(e),y(!1),L(!1),T("")},$=(0,m.useDebounce)((async e=>{if(e)try{V(!0),p(E.checking());const t=await f()({path:(0,h.addQueryArgs)(`${a}/url/validate`,{url:e})});A(t.is_activitypub),L(t.is_real_oembed),T(t.html||""),p(E.valid)}catch(e){V(),p(E.error)}finally{O(!1)}else V()}),250);return(0,d.useEffect)((()=>{o&&$(o)}),[o]),(0,l.createElement)(l.Fragment,null,(0,l.createElement)(c.InspectorControls,null,(0,l.createElement)(s.PanelBody,{title:(0,u.__)("Settings","activitypub")},(0,l.createElement)(s.ToggleControl,{label:(0,u.__)("Embed Post","activitypub"),checked:e.embedPost,onChange:e=>{t({embedPost:e}),x(e)},disabled:!v,help:v?k.valid:k.invalid}))),(0,l.createElement)("div",{...W},n&&(0,l.createElement)(s.TextControl,{label:(0,u.__)("Your post is a reply to the following URL","activitypub"),value:o,onChange:e=>t({url:e}),help:i,onKeyDown:t=>{"Enter"===t.key&&B(r),!e.url&&["Backspace","Delete"].includes(t.key)&&N(r)},ref:F}),v&&e.embedPost&&R&&(0,l.createElement)("div",{className:"activitypub-embed-container"},C&&(Y=R)&&(Y.includes("wp-embedded-content")||Y.includes("wp-embed/")||Y.includes('class="wp-embed"'))?(0,l.createElement)(g,{html:R,onSelectBlock:U}):(0,l.createElement)(_,{html:R,onClick:U,isSelected:n})),o&&(!e.embedPost||!R)&&(0,l.createElement)("div",{className:"activitypub-reply-block-editor__preview",contentEditable:!1,onClick:U,style:{cursor:"pointer"}},(0,l.createElement)("a",{href:o,className:"u-in-reply-to",target:"_blank",rel:"noreferrer"},"↬"+o.replace(/^https?:\/\//,"")))));var Y},save:()=>null,icon:i})},609:e=>{e.exports=window.React},848:(e,t,r)=>{e.exports=r(20)}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.m=t,e=[],n.O=(t,r,o,a)=>{if(!r){var i=1/0;for(u=0;u=a)&&Object.keys(n.O).every((e=>n.O[e](r[c])))?r.splice(c--,1):(l=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[r,o,a]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={780:0,356:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var o,a,[i,l,c]=r,s=0;if(i.some((t=>0!==e[t]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(c)var u=c(n)}for(t&&t(r);sn(238)));o=n.O(o)})(); \ No newline at end of file From b98e0a93e273062309e675ce555b3feed0d071f5 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Thu, 15 May 2025 11:32:58 -0500 Subject: [PATCH 21/47] Bail if there is no actor --- src/follow-me/render.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/follow-me/render.php b/src/follow-me/render.php index ddebffa85..fc41856ac 100644 --- a/src/follow-me/render.php +++ b/src/follow-me/render.php @@ -26,6 +26,9 @@ $button_style = $attributes['style'] ?? array(); $actor = \Activitypub\Collection\Actors::get_by_id( $user_id ); +if ( is_wp_error( $actor ) ) { + return; +} // Set up the Interactivity API state. $state = wp_interactivity_state( From 9a2dca85b20c570940596441513c7e1b784b827d Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Thu, 15 May 2025 11:34:24 -0500 Subject: [PATCH 22/47] Account for inherit user --- build/editor-plugin/plugin.asset.php | 2 +- build/follow-me/index.asset.php | 2 +- build/follow-me/render.php | 5 ++++- includes/class-blocks.php | 2 +- src/follow-me/render.php | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build/editor-plugin/plugin.asset.php b/build/editor-plugin/plugin.asset.php index 35f04faca..77d23dddf 100644 --- a/build/editor-plugin/plugin.asset.php +++ b/build/editor-plugin/plugin.asset.php @@ -1 +1 @@ - array('react', 'wp-components', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => 'c4ec9c3a1f0d32bd9118'); + array('react', 'wp-components', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => 'b45e1a403d2765677cf3'); diff --git a/build/follow-me/index.asset.php b/build/follow-me/index.asset.php index 194b8fe74..678f3d638 100644 --- a/build/follow-me/index.asset.php +++ b/build/follow-me/index.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'c73f2f2bb1dde0fd7e3a'); + array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '226f1e679d8b786a0211'); diff --git a/build/follow-me/render.php b/build/follow-me/render.php index ddebffa85..ebfa8c303 100644 --- a/build/follow-me/render.php +++ b/build/follow-me/render.php @@ -12,7 +12,7 @@ // Get the user ID from the selected user attribute. $selected_user = $attributes['selectedUser'] ?? 'site'; -$user_id = 'site' === $selected_user ? 0 : intval( $selected_user ); +$user_id = Blocks::get_user_id( $selected_user ); $button_only = $attributes['buttonOnly'] ?? false; // Generate a unique ID for the block. @@ -26,6 +26,9 @@ $button_style = $attributes['style'] ?? array(); $actor = \Activitypub\Collection\Actors::get_by_id( $user_id ); +if ( is_wp_error( $actor ) ) { + return; +} // Set up the Interactivity API state. $state = wp_interactivity_state( diff --git a/includes/class-blocks.php b/includes/class-blocks.php index 541ec6c01..0d7fc395d 100644 --- a/includes/class-blocks.php +++ b/includes/class-blocks.php @@ -213,7 +213,7 @@ public static function render_post_reactions_block( $attrs, $content ) { * @param string $user_string The user string. Can be a user ID, 'site', or 'inherit'. * @return int|null The user ID, or null if the 'inherit' string is not supported in this context. */ - private static function get_user_id( $user_string ) { + public static function get_user_id( $user_string ) { if ( is_numeric( $user_string ) ) { return absint( $user_string ); } diff --git a/src/follow-me/render.php b/src/follow-me/render.php index fc41856ac..ebfa8c303 100644 --- a/src/follow-me/render.php +++ b/src/follow-me/render.php @@ -12,7 +12,7 @@ // Get the user ID from the selected user attribute. $selected_user = $attributes['selectedUser'] ?? 'site'; -$user_id = 'site' === $selected_user ? 0 : intval( $selected_user ); +$user_id = Blocks::get_user_id( $selected_user ); $button_only = $attributes['buttonOnly'] ?? false; // Generate a unique ID for the block. From f2580e4be8d811c20ad379a3a013f67de80ee459 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Thu, 15 May 2025 11:46:21 -0500 Subject: [PATCH 23/47] Align styles better with trunk --- build/editor-plugin/plugin.asset.php | 2 +- build/follow-me/index.asset.php | 2 +- build/follow-me/style-view.css | 2 +- build/follow-me/style-view.css.map | 2 +- build/follow-me/view.js.map | 2 +- src/follow-me/style.scss | 130 ++++++++++++++------------- 6 files changed, 71 insertions(+), 69 deletions(-) diff --git a/build/editor-plugin/plugin.asset.php b/build/editor-plugin/plugin.asset.php index 77d23dddf..35f04faca 100644 --- a/build/editor-plugin/plugin.asset.php +++ b/build/editor-plugin/plugin.asset.php @@ -1 +1 @@ - array('react', 'wp-components', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => 'b45e1a403d2765677cf3'); + array('react', 'wp-components', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => 'c4ec9c3a1f0d32bd9118'); diff --git a/build/follow-me/index.asset.php b/build/follow-me/index.asset.php index 678f3d638..194b8fe74 100644 --- a/build/follow-me/index.asset.php +++ b/build/follow-me/index.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '226f1e679d8b786a0211'); + array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'c73f2f2bb1dde0fd7e3a'); diff --git a/build/follow-me/style-view.css b/build/follow-me/style-view.css index 7631dde17..ea68d90ec 100644 --- a/build/follow-me/style-view.css +++ b/build/follow-me/style-view.css @@ -1 +1 @@ -.activitypub-follow-me-block-wrapper{display:block;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{align-items:center;display:flex;padding:1em 0}.has-background>.activitypub-follow-me-block-wrapper .activitypub-profile,.has-border>.activitypub-follow-me-block-wrapper .activitypub-profile{padding-left:1em;padding-right:1em}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1em;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{flex:1;margin-right:1em;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle{color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button{flex-shrink:0;margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button:not(:only-child){margin-left:1em}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8em;padding:.25em .5em}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9em;padding:.4em .8em}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:#fff;border-radius:4px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.activitypub-modal__header{align-items:center;border-bottom:1px solid #e2e4e7;display:flex;flex-shrink:0;justify-content:space-between;padding:1em 1em 1em 1.5em}.activitypub-modal__title{font-size:1.3em;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__close{align-items:center;background:none;border:none;color:#555;cursor:pointer;display:flex;justify-content:center;padding:.5em}.activitypub-modal__close:hover{background:none;color:#000}.activitypub-modal__close:active{background:none;border:none;color:#000;padding:.5em}.activitypub-modal__content{overflow-y:auto}.activitypub-dialog__section{border-bottom:1px solid #f0f0f0;padding:1em 1.5em}.activitypub-dialog__section:last-child{border-bottom:none}.activitypub-dialog__section h4{font-size:1.1em;margin-bottom:.5em;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:.95em;margin-bottom:1em}.activitypub-dialog__description code{background:#f0f0f0;border-radius:3px;font-size:.9em;padding:.1em .3em}.activitypub-dialog__button-group{display:flex;margin-bottom:.5em;width:100%}.activitypub-dialog__button-group input{border:1px solid #ddd;border-radius:4px 0 0 4px;flex:1;font-size:1em;margin:0}.activitypub-dialog__button-group input[aria-invalid=true]{border-color:#cc1818}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important}.activitypub-dialog__error{color:#cc1818;font-size:.9em;margin-top:.5em}body.modal-open{overflow:hidden}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}} +.activitypub-follow-me-block-wrapper{display:block;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{align-items:center;display:flex;padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1rem;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{flex:1;margin-right:1rem;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle{color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button{flex-shrink:0;margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button:not(:only-child){margin-left:1rem}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8rem;padding:.25rem .5rem}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9rem;padding:.4rem .8rem}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border .activitypub-profile{padding-left:1rem;padding-right:1rem}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:#fff;border-radius:4px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.activitypub-modal__header{align-items:center;border-bottom:1px solid #e2e4e7;display:flex;flex-shrink:0;justify-content:space-between;padding:1rem 1rem 1rem 1.5rem}.activitypub-modal__title{font-size:1.3rem;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__close{align-items:center;background:none;border:none;color:#555;cursor:pointer;display:flex;justify-content:center;padding:.5rem}.activitypub-modal__close:hover{background:none;color:#000}.activitypub-modal__close:active{background:none;border:none;color:#000;padding:.5rem}.activitypub-modal__content{overflow-y:auto}.activitypub-dialog__section{border-bottom:1px solid #f0f0f0;padding:1rem 1.5rem}.activitypub-dialog__section:last-child{border-bottom:none}.activitypub-dialog__section h4{font-size:1.1rem;margin-bottom:.5rem;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:.95rem;margin-bottom:1rem}.activitypub-dialog__description code{background:#f0f0f0;border-radius:3px;font-size:.9rem;padding:.1rem .3rem}.activitypub-dialog__button-group{display:flex;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input{border:1px solid #ddd;border-radius:4px 0 0 4px;flex:1;font-size:1rem;margin:0}.activitypub-dialog__button-group input[aria-invalid=true]{border-color:#cc1818}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important}.activitypub-dialog__error{color:#cc1818;font-size:.9rem;margin-top:.5rem}body.modal-open{overflow:hidden}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}} diff --git a/build/follow-me/style-view.css.map b/build/follow-me/style-view.css.map index b7c8a8d71..b90b66458 100644 --- a/build/follow-me/style-view.css.map +++ b/build/follow-me/style-view.css.map @@ -1 +1 @@ -{"version":3,"file":"follow-me/style-view.css","mappings":";;;AAAA;EACC;EACA;AACD;;AAEA;EACC;EACA;EACA;AACD;AACC;EAEC;EACA;AAAF;AAGC;EACC;EACA;EACA;EACA;EACA;KAAA;AADF;AAIC;EACC;EACA;EACA;AAFF;AAKC;EACC;EACA;EACA;EACA;AAHF;AAMC;EACC;EACA;EACA;EACA;AAJF;AAOC;EACC;EACA;AALF;AAOE;EACC;AALH;AASC;EACC;AAPF;AAUC;EACC;EACA;AARF;AAWC;EACC;EACA;AATF;;AAcC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAXF;AAaE;EACC;AAXH;AAeC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAbF;AAgBC;EACC;EACA;EACA;EACA;EACA;EACA;AAdF;AAiBC;EACC;EACA;EACA;EACA;AAfF;AAkBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAhBF;AAkBE;EACC;EACA;AAhBH;AAmBE;EACC;EACA;EACA;EACA;AAjBH;AAqBC;EACC;AAnBF;;AAwBC;EACC;EACA;AArBF;AAuBE;EACC;AArBH;AAwBE;EACC;EACA;EACA;AAtBH;AA0BC;EACC;EACA;EACA;AAxBF;AA0BE;EACC;EACA;EACA;EACA;AAxBH;AA4BC;EACC;EACA;EACA;AA1BF;AA4BE;EACC;EACA;EACA;EACA;EACA;AA1BH;AA4BG;EACC;AA1BJ;AA8BE;EACC;EACA;AA5BH;AAgCC;EACC;EACA;EACA;AA9BF;;AAkCA;EACC;AA/BD;;AAkCA;EACC;IACC;IACA;EA/BA;EAiCD;IACC;IACA;EA/BA;AACF,C","sources":["webpack://wordpress-activitypub/./src/follow-me/style.scss"],"sourcesContent":[".activitypub-follow-me-block-wrapper {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.activitypub-follow-me-block-wrapper .activitypub-profile {\n\tdisplay: flex;\n\talign-items: center;\n\tpadding: 1em 0;\n\n\t.has-background > &,\n\t.has-border > & {\n\t\tpadding-left: 1em;\n\t\tpadding-right: 1em;\n\t}\n\n\t&__avatar {\n\t\twidth: 75px;\n\t\theight: 75px;\n\t\tborder-radius: 50%;\n\t\tmargin-right: 1em;\n\t\tobject-fit: cover;\n\t}\n\n\t&__content {\n\t\tflex: 1;\n\t\tmargin-right: 1em;\n\t\tmin-width: 0;\n\t}\n\n\t&__name {\n\t\tfont-size: 1.25em;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t&__handle {\n\t\tcolor: inherit;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t.wp-block-button {\n\t\tflex-shrink: 0;\n\t\tmargin: 0;\n\n\t\t&:not(:only-child) {\n\t\t\tmargin-left: 1em;\n\t\t}\n\t}\n\n\t.wp-block-button__link {\n\t\tmargin: 0;\n\t}\n\n\t.is-small {\n\t\tpadding: 0.25em 0.5em;\n\t\tfont-size: 0.8em;\n\t}\n\n\t.is-compact {\n\t\tpadding: 0.4em 0.8em;\n\t\tfont-size: 0.9em;\n\t}\n}\n\n.activitypub-modal {\n\t&__overlay {\n\t\tposition: fixed;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tbackground-color: rgba(0, 0, 0, 0.5);\n\t\tz-index: 100000;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tpadding: 1rem;\n\n\t\t&[hidden] {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&__frame {\n\t\tmax-width: 660px;\n\t\twidth: 100%;\n\t\tbackground-color: #fff;\n\t\tborder-radius: 4px;\n\t\tbox-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);\n\t\toverflow: hidden;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmax-height: calc(100vh - 2rem);\n\t\tanimation: activitypub-modal-appear 0.2s ease-out;\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\tpadding: 1em 1em 1em 1.5em;\n\t\tborder-bottom: 1px solid #e2e4e7;\n\t\tflex-shrink: 0;\n\t}\n\n\t&__title {\n\t\tmargin: 0 !important;\n\t\tfont-size: 1.3em;\n\t\tfont-weight: 600;\n\t\tline-height: 1.4;\n\t}\n\n\t&__close {\n\t\tbackground: none;\n\t\tborder: none;\n\t\tpadding: 0.5em;\n\t\tcursor: pointer;\n\t\tcolor: #555;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t&:hover {\n\t\t\tbackground: none;\n\t\t\tcolor: #000;\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #000;\n\t\t\tpadding: 0.5em;\n\t\t}\n\t}\n\n\t&__content {\n\t\toverflow-y: auto;\n\t}\n}\n\n.activitypub-dialog {\n\t&__section {\n\t\tpadding: 1em 1.5em;\n\t\tborder-bottom: 1px solid #f0f0f0;\n\n\t\t&:last-child {\n\t\t\tborder-bottom: none;\n\t\t}\n\n\t\th4 {\n\t\t\tmargin-top: 0;\n\t\t\tmargin-bottom: 0.5em;\n\t\t\tfont-size: 1.1em;\n\t\t}\n\t}\n\n\t&__description {\n\t\tmargin-bottom: 1em;\n\t\tcolor: inherit;\n\t\tfont-size: 0.95em;\n\n\t\tcode {\n\t\t\tbackground: #f0f0f0;\n\t\t\tpadding: 0.1em 0.3em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t}\n\t}\n\n\t&__button-group {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\tmargin-bottom: 0.5em;\n\n\t\tinput {\n\t\t\tflex: 1;\n\t\t\tborder: 1px solid #ddd;\n\t\t\tborder-radius: 4px 0 0 4px;\n\t\t\tfont-size: 1em;\n\t\t\tmargin: 0;\n\n\t\t\t&[aria-invalid=\"true\"] {\n\t\t\t\tborder-color: #cc1818;\n\t\t\t}\n\t\t}\n\n\t\tbutton {\n\t\t\tborder-radius: 0 4px 4px 0 !important;\n\t\t\tmargin-left: -1px !important;\n\t\t}\n\t}\n\n\t&__error {\n\t\tcolor: #cc1818;\n\t\tfont-size: 0.9em;\n\t\tmargin-top: 0.5em;\n\t}\n}\n\nbody.modal-open {\n\toverflow: hidden;\n}\n\n@keyframes activitypub-modal-appear {\n\tfrom {\n\t\topacity: 0;\n\t\ttransform: translateY(15px);\n\t}\n\tto {\n\t\topacity: 1;\n\t\ttransform: translateY(0);\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"follow-me/style-view.css","mappings":";;;AAAA;EACC;EACA;AACD;;AAGC;EACC;EACA;EACA;AAAF;AAEE;EACC;EACA;EACA;EACA;EACA;KAAA;AAAH;AAGE;EACC;EACA;EACA;AADH;AAIE;EACC;EACA;EACA;EACA;AAFH;AAKE;EACC;EACA;EACA;EACA;AAHH;AAME;EACC;EACA;AAJH;AAMG;EACC;AAJJ;AAQE;EACC;AANH;AASE;EACC;EACA;AAPH;AAUE;EACC;EACA;AARH;AAYC;EAEC;EACA;AAXF;;AAgBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAbF;AAeE;EACC;AAbH;AAiBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAfF;AAkBC;EACC;EACA;EACA;EACA;EACA;EACA;AAhBF;AAmBC;EACC;EACA;EACA;EACA;AAjBF;AAoBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAlBF;AAoBE;EACC;EACA;AAlBH;AAqBE;EACC;EACA;EACA;EACA;AAnBH;AAuBC;EACC;AArBF;;AA0BC;EACC;EACA;AAvBF;AAyBE;EACC;AAvBH;AA0BE;EACC;EACA;EACA;AAxBH;AA4BC;EACC;EACA;EACA;AA1BF;AA4BE;EACC;EACA;EACA;EACA;AA1BH;AA8BC;EACC;EACA;EACA;AA5BF;AA8BE;EACC;EACA;EACA;EACA;EACA;AA5BH;AA8BG;EACC;AA5BJ;AAgCE;EACC;EACA;AA9BH;AAkCC;EACC;EACA;EACA;AAhCF;;AAoCA;EACC;AAjCD;;AAoCA;AACA;EACC;IACC;IACA;EAjCA;EAmCD;IACC;IACA;EAjCA;AACF,C","sources":["webpack://wordpress-activitypub/./src/follow-me/style.scss"],"sourcesContent":[".activitypub-follow-me-block-wrapper {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.activitypub-follow-me-block-wrapper {\n\t.activitypub-profile {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tpadding: 1rem 0;\n\n\t\t&__avatar {\n\t\t\twidth: 75px;\n\t\t\theight: 75px;\n\t\t\tborder-radius: 50%;\n\t\t\tmargin-right: 1rem;\n\t\t\tobject-fit: cover;\n\t\t}\n\n\t\t&__content {\n\t\t\tflex: 1;\n\t\t\tmargin-right: 1rem;\n\t\t\tmin-width: 0;\n\t\t}\n\n\t\t&__name {\n\t\t\tfont-size: 1.25rem;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t&__handle {\n\t\t\tcolor: inherit;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t.wp-block-button {\n\t\t\tflex-shrink: 0;\n\t\t\tmargin: 0;\n\n\t\t\t&:not(:only-child) {\n\t\t\t\tmargin-left: 1rem;\n\t\t\t}\n\t\t}\n\n\t\t.wp-block-button__link {\n\t\t\tmargin: 0;\n\t\t}\n\n\t\t.is-small {\n\t\t\tpadding: 0.25rem 0.5rem;\n\t\t\tfont-size: 0.8rem;\n\t\t}\n\n\t\t.is-compact {\n\t\t\tpadding: 0.4rem 0.8rem;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t}\n\n\t&.has-background .activitypub-profile,\n\t&.has-border .activitypub-profile {\n\t\tpadding-left: 1rem;\n\t\tpadding-right: 1rem;\n\t}\n}\n\n.activitypub-modal {\n\t&__overlay {\n\t\tposition: fixed;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tbackground-color: rgba(0, 0, 0, 0.5);\n\t\tz-index: 100000;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tpadding: 1rem;\n\n\t\t&[hidden] {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&__frame {\n\t\tmax-width: 660px;\n\t\twidth: 100%;\n\t\tbackground-color: #fff;\n\t\tborder-radius: 4px;\n\t\tbox-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);\n\t\toverflow: hidden;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmax-height: calc(100vh - 2rem);\n\t\tanimation: activitypub-modal-appear 0.2s ease-out;\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\tpadding: 1rem 1rem 1rem 1.5rem;\n\t\tborder-bottom: 1px solid #e2e4e7;\n\t\tflex-shrink: 0;\n\t}\n\n\t&__title {\n\t\tmargin: 0 !important;\n\t\tfont-size: 1.3rem;\n\t\tfont-weight: 600;\n\t\tline-height: 1.4;\n\t}\n\n\t&__close {\n\t\tbackground: none;\n\t\tborder: none;\n\t\tpadding: 0.5rem;\n\t\tcursor: pointer;\n\t\tcolor: #555;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t&:hover {\n\t\t\tbackground: none;\n\t\t\tcolor: #000;\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #000;\n\t\t\tpadding: 0.5rem;\n\t\t}\n\t}\n\n\t&__content {\n\t\toverflow-y: auto;\n\t}\n}\n\n.activitypub-dialog {\n\t&__section {\n\t\tpadding: 1rem 1.5rem;\n\t\tborder-bottom: 1px solid #f0f0f0;\n\n\t\t&:last-child {\n\t\t\tborder-bottom: none;\n\t\t}\n\n\t\th4 {\n\t\t\tmargin-top: 0;\n\t\t\tmargin-bottom: 0.5rem;\n\t\t\tfont-size: 1.1rem;\n\t\t}\n\t}\n\n\t&__description {\n\t\tmargin-bottom: 1rem;\n\t\tcolor: inherit;\n\t\tfont-size: 0.95rem;\n\n\t\tcode {\n\t\t\tbackground: #f0f0f0;\n\t\t\tpadding: 0.1rem 0.3rem;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t}\n\n\t&__button-group {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\tmargin-bottom: 0.5rem;\n\n\t\tinput {\n\t\t\tflex: 1;\n\t\t\tborder: 1px solid #ddd;\n\t\t\tborder-radius: 4px 0 0 4px;\n\t\t\tfont-size: 1rem;\n\t\t\tmargin: 0;\n\n\t\t\t&[aria-invalid=\"true\"] {\n\t\t\t\tborder-color: #cc1818;\n\t\t\t}\n\t\t}\n\n\t\tbutton {\n\t\t\tborder-radius: 0 4px 4px 0 !important;\n\t\t\tmargin-left: -1px !important;\n\t\t}\n\t}\n\n\t&__error {\n\t\tcolor: #cc1818;\n\t\tfont-size: 0.9rem;\n\t\tmargin-top: 0.5rem;\n\t}\n}\n\nbody.modal-open {\n\toverflow: hidden;\n}\n\n/* Animation for modal */\n@keyframes activitypub-modal-appear {\n\tfrom {\n\t\topacity: 0;\n\t\ttransform: translateY(20px);\n\t}\n\tto {\n\t\topacity: 1;\n\t\ttransform: translateY(0);\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/build/follow-me/view.js.map b/build/follow-me/view.js.map index b42989e37..7d86b7a2a 100644 --- a/build/follow-me/view.js.map +++ b/build/follow-me/view.js.map @@ -1 +1 @@ -{"version":3,"file":"follow-me/view.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,kBAAkBA,CAAEC,KAAK,EAAG;EACpC;EACA,IAAK,OAAOA,KAAK,KAAK,QAAQ,EAAG;IAChC,OAAO,4BAA6BA,KAAK,GAAI;EAC9C;EAEA,OAAOA,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;;SAEA;SACA;SACA;;SAEA;SACA;;;;;UCzBA;UACA;UACA;UACA;UACA,+BAA+B,wCAAwC;UACvE;UACA;UACA;UACA;UACA,iBAAiB,qBAAqB;UACtC;UACA;UACA,kBAAkB,qBAAqB;UACvC;UACA;UACA,KAAK;UACL;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;;;;UC3BA;UACA;UACA;UACA;UACA,yCAAyC,wCAAwC;UACjF;UACA;UACA;;;;;UCPA;;;;;UCAA;UACA;UACA;UACA,uDAAuD,iBAAiB;UACxE;UACA,gDAAgD,aAAa;UAC7D;;;;;UCNA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;;;;SEpBA;SACA;SACA;SACA;SACA","sources":["webpack://wordpress-activitypub/./src/follow-me/button-style.js","webpack://wordpress-activitypub/./src/follow-me/view.js","webpack://wordpress-activitypub/./src/follow-me/style.scss?5e79","webpack://wordpress-activitypub/external module \"@wordpress/interactivity\"","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/chunk loaded","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/webpack/runtime/import chunk loading","webpack://wordpress-activitypub/webpack/before-startup","webpack://wordpress-activitypub/webpack/startup","webpack://wordpress-activitypub/webpack/after-startup"],"sourcesContent":["/**\n * Gets the background color from a style object.\n *\n * @param {Object|string} color Color object or string.\n * @return {string|null} Background color.\n */\nfunction getBackgroundColor( color ) {\n\t// If color is a string, it's a var like this.\n\tif ( typeof color === 'string' ) {\n\t\treturn `var(--wp--preset--color--${ color })`;\n\t}\n\n\treturn color?.color?.background || null;\n}\n\n/**\n * Gets the link color from a style object.\n *\n * @param {string} text Text color.\n * @return {string|null} Link color.\n */\nfunction getLinkColor( text ) {\n\tif ( typeof text !== 'string' ) {\n\t\treturn null;\n\t}\n\t// If it starts with a hash, leave it be.\n\tif ( text.match( /^#/ ) ) {\n\t\t// We don't handle the alpha channel if present.\n\t\treturn text.substring( 0, 7 );\n\t}\n\t// var:preset|color|luminous-vivid-amber\n\t// var(--wp--preset--color--luminous-vivid-amber)\n\t// We will receive the top format, we need to output the bottom format.\n\tconst [ , , color ] = text.split( '|' );\n\treturn `var(--wp--preset--color--${ color })`;\n}\n\n/**\n * Generates a CSS selector.\n *\n * @param {string} selector CSS selector.\n * @param {string} prop CSS property.\n * @param {string|null} value CSS value.\n * @param {string} pseudo Pseudo-selector.\n * @return {string} CSS selector.\n */\nfunction generateSelector( selector, prop, value = null, pseudo = '' ) {\n\tif ( ! value ) {\n\t\treturn '';\n\t}\n\treturn `${ selector }${ pseudo } { ${ prop }: ${ value }; }\\n`;\n}\n\n/**\n * Gets styles for a button.\n *\n * @param {string} selector CSS selector.\n * @param {string} button Button color.\n * @param {string} text Text color.\n * @param {string} hover Hover color.\n * @return {string} CSS styles.\n */\nfunction getStyles( selector, button, text, hover ) {\n\treturn (\n\t\tgenerateSelector( selector, 'background-color', button ) +\n\t\tgenerateSelector( selector, 'color', text ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':hover' ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':focus' )\n\t);\n}\n\n/**\n * Gets block styles.\n *\n * @param {string} base Base selector.\n * @param {Object} style Style object.\n * @param {Object|string} backgroundColor Background color.\n * @return {string} CSS styles.\n */\nexport function getBlockStyles( base, style, backgroundColor ) {\n\tif ( ! style.length ) {\n\t\treturn '';\n\t}\n\n\tconst selector = `${ base } .wp-block-button__link`;\n\t// We grab the background color if set as a good color for our button text.\n\tconst buttonTextColor =\n\t\tgetBackgroundColor( backgroundColor ) ||\n\t\t// Background might be in this form.\n\t\tstyle?.color?.background;\n\t// We misuse the link color for the button background.\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text );\n\t// Hover!\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text );\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n\n/**\n * Gets popup styles.\n *\n * @param {Object} style Style object.\n * @return {string} CSS styles.\n */\nexport function getPopupStyles( style ) {\n\t// We don't accept backgroundColor because the popup is always white (right?).\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text ) || '#111';\n\tconst buttonTextColor = '#fff';\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text ) || '#333';\n\tconst selector = '.activitypub-dialog__button-group .components-button';\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n","import { store, getContext } from '@wordpress/interactivity';\nimport { getBlockStyles, getPopupStyles } from './button-style';\nimport './style.scss';\n\n/**\n * Traps focus within the specified element.\n *\n * @param {Element} element The element to trap focus within.\n */\nfunction trapFocus( element ) {\n\tvar focusableElements = element.querySelectorAll(\n\t\t'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type=\"text\"]:not([disabled]), input[type=\"radio\"]:not([disabled]), input[type=\"checkbox\"]:not([disabled]), select:not([disabled])'\n\t);\n\tvar firstFocusableElement = focusableElements[ 0 ];\n\tvar lastFocusableElement = focusableElements[ focusableElements.length - 1 ];\n\tfirstFocusableElement.focus();\n\n\telement.addEventListener( 'keydown', function ( event ) {\n\t\tif ( event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */ ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.shiftKey ) {\n\t\t\t/* shift + tab */\n\t\t\tif ( document.activeElement === firstFocusableElement ) {\n\t\t\t\tlastFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t} /* tab */ else {\n\t\t\tif ( document.activeElement === lastFocusableElement ) {\n\t\t\t\tfirstFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t} );\n}\n\nconst { state, actions } = store( 'activitypub/follow-me', {\n\tactions: {\n\t\t/**\n\t\t * Open the modal.\n\t\t */\n\t\topenModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = true;\n\t\t\tdocument.body.classList.add( 'modal-open' );\n\n\t\t\t// Set up the focus trap after modal is open.\n\t\t\tsetTimeout( () => {\n\t\t\t\t// Use the blockId to find the specific modal frame for this block.\n\t\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\t\tif ( blockWrapper ) {\n\t\t\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\t\t\tif ( modalFrame ) {\n\t\t\t\t\t\ttrapFocus( modalFrame );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 50 );\n\t\t},\n\n\t\t/**\n\t\t * Close the modal.\n\t\t */\n\t\tcloseModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = false;\n\t\t\tdocument.body.classList.remove( 'modal-open' );\n\n\t\t\t// Return focus to the button that opened the modal.\n\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\tif ( blockWrapper ) {\n\t\t\t\tconst openButton = blockWrapper.querySelector( '.wp-block-button__link' );\n\t\t\t\tif ( openButton ) {\n\t\t\t\t\topenButton.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\ttoggleModal() {\n\t\t\tconst { isModalOpen } = getContext();\n\n\t\t\tisModalOpen ? actions.closeModal() : actions.openModal();\n\t\t},\n\n\t\t/**\n\t\t * Copy the webfinger to clipboard.\n\t\t */\n\t\tcopyToClipboard() {\n\t\t\tconst context = getContext();\n\n\t\t\t// Use the Clipboard API to copy text.\n\t\t\tnavigator.clipboard.writeText( context.webfinger ).then(\n\t\t\t\t() => {\n\t\t\t\t\t// Update button text to show success.\n\t\t\t\t\tcontext.copyButtonText = state.i18n.copied;\n\n\t\t\t\t\t// Reset button text after 1 second.\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tcontext.copyButtonText = state.i18n.copy;\n\t\t\t\t\t}, 1000 );\n\t\t\t\t},\n\t\t\t\t( error ) => {\n\t\t\t\t\t// Log error if copying fails.\n\t\t\t\t\tconsole.error( 'Could not copy text: ', error );\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the remote profile value.\n\t\t *\n\t\t * @param {Event} event Input event.\n\t\t */\n\t\tupdateRemoteProfile( event ) {\n\t\t\tconst context = getContext();\n\t\t\tcontext.remoteProfile = event.target.value;\n\t\t\t// Reset error state when input changes.\n\t\t\tcontext.isError = false;\n\t\t\tcontext.errorMessage = '';\n\t\t},\n\n\t\t/**\n\t\t * Handle keydown event for remote profile input.\n\t\t *\n\t\t * @param {Event} event Keydown event.\n\t\t */\n\t\thandleKeyDown( event ) {\n\t\t\tif ( event.key === 'Enter' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tactions.submitRemoteProfile();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Submit the remote profile.\n\t\t */\n\t\tsubmitRemoteProfile: function* () {\n\t\t\tconst context = getContext();\n\t\t\tconst { namespace } = state;\n\t\t\tconst input = context.remoteProfile.trim();\n\n\t\t\t// Validate input.\n\t\t\tif ( ! input ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.emptyProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! /^(https?:\\/\\/|@)/.test( input ) ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.invalidProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set loading state.\n\t\t\tcontext.isLoading = true;\n\t\t\tcontext.isError = false;\n\n\t\t\t// Construct the API path.\n\t\t\tconst path = `/${ namespace }/actors/${ context.userId }/remote-follow?resource=${ encodeURIComponent(\n\t\t\t\tinput\n\t\t\t) }`;\n\n\t\t\ttry {\n\t\t\t\t// Make the API request.\n\t\t\t\tconst response = yield apiFetch( { path } );\n\n\t\t\t\t// Set opening state.\n\t\t\t\tcontext.isLoading = false;\n\n\t\t\t\t// Open the remote follow URL in a new tab.\n\t\t\t\twindow.open( response.url, '_blank' );\n\n\t\t\t\t// Close the modal after opening the URL.\n\t\t\t\tactions.closeModal();\n\t\t\t} catch ( error ) {\n\t\t\t\t// Handle error.\n\t\t\t\tconsole.error( 'Error submitting profile:', error );\n\t\t\t\tcontext.isLoading = false;\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = error.message || state.i18n.genericError;\n\t\t\t}\n\t\t},\n\t},\n\tcallbacks: {\n\t\t/**\n\t\t * Initialize button styles.\n\t\t */\n\t\tinitButtonStyles: () => {\n\t\t\tconst { buttonStyle, backgroundColor, blockId } = getContext();\n\n\t\t\t// Add dynamic button styles to the document.\n\t\t\tif ( blockId && buttonStyle ) {\n\t\t\t\tconst styleElement = document.createElement( 'style' );\n\t\t\t\tconst selector = `#${ blockId }`;\n\n\t\t\t\t// Use getBlockStyles from button-style.js to get the CSS string.\n\t\t\t\tstyleElement.textContent = getBlockStyles( selector, buttonStyle, backgroundColor );\n\n\t\t\t\tdocument.head.appendChild( styleElement );\n\n\t\t\t\t// Add popup styles.\n\t\t\t\tconst popupStyleElement = document.createElement( 'style' );\n\t\t\t\tpopupStyleElement.textContent = getPopupStyles( buttonStyle );\n\t\t\t\tdocument.head.appendChild( popupStyleElement );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when pressing ESC key.\n\t\t *\n\t\t * @param {Event} event Keyboard event.\n\t\t */\n\t\tdocumentKeydown( event ) {\n\t\t\tconst { isModalOpen } = getContext();\n\n\t\t\tif ( isModalOpen && event.key === 'Escape' ) {\n\t\t\t\tactions.closeModal();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when clicking outside.\n\t\t *\n\t\t * @param {Event} event Click event.\n\t\t */\n\t\tdocumentClick( event ) {\n\t\t\tconst { blockId, isModalOpen } = getContext();\n\t\t\tif ( ! isModalOpen ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Get the block wrapper element.\n\t\t\tconst blockWrapper = document.getElementById( blockId );\n\t\t\tif ( ! blockWrapper ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If the click was on the button or its children, we should not close the modal.\n\t\t\tconst toggleButton = blockWrapper.querySelector(\n\t\t\t\t'.wp-element-button[data-wp-on--click=\"actions.toggleModal\"]'\n\t\t\t);\n\t\t\tif ( toggleButton && ( toggleButton === event.target || toggleButton.contains( event.target ) ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if the click was inside the modal frame.\n\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\tif ( ! modalFrame || modalFrame.contains( event.target ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactions.closeModal();\n\t\t},\n\t},\n} );\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;","// 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\t// no module.id needed\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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"follow-me/view\": 0,\n\t\"follow-me/style-view\": 0\n};\n\n// no install chunk\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no external install chunk\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"follow-me/style-view\"], () => (__webpack_require__(\"./src/follow-me/view.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["getBackgroundColor","color","background","getLinkColor","text","match","substring","split","generateSelector","selector","prop","value","pseudo","getStyles","button","hover","getBlockStyles","base","style","backgroundColor","length","buttonTextColor","buttonColor","elements","link","buttonHoverColor","getPopupStyles","store","getContext","trapFocus","element","focusableElements","querySelectorAll","firstFocusableElement","lastFocusableElement","focus","addEventListener","event","key","keyCode","shiftKey","document","activeElement","preventDefault","state","actions","openModal","context","isModalOpen","body","classList","add","setTimeout","blockWrapper","getElementById","blockId","modalFrame","querySelector","closeModal","remove","openButton","toggleModal","copyToClipboard","navigator","clipboard","writeText","webfinger","then","copyButtonText","i18n","copied","copy","error","console","updateRemoteProfile","remoteProfile","target","isError","errorMessage","handleKeyDown","submitRemoteProfile","namespace","input","trim","emptyProfileError","test","invalidProfileError","isLoading","path","userId","encodeURIComponent","response","apiFetch","window","open","url","message","genericError","callbacks","initButtonStyles","buttonStyle","styleElement","createElement","textContent","head","appendChild","popupStyleElement","documentKeydown","documentClick","toggleButton","contains"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"follow-me/view.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,kBAAkBA,CAAEC,KAAK,EAAG;EACpC;EACA,IAAK,OAAOA,KAAK,KAAK,QAAQ,EAAG;IAChC,OAAO,4BAA6BA,KAAK,GAAI;EAC9C;EAEA,OAAOA,KAAK,EAAEA,KAAK,EAAEC,UAAU,IAAI,IAAI;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAAEC,IAAI,EAAG;EAC7B,IAAK,OAAOA,IAAI,KAAK,QAAQ,EAAG;IAC/B,OAAO,IAAI;EACZ;EACA;EACA,IAAKA,IAAI,CAACC,KAAK,CAAE,IAAK,CAAC,EAAG;IACzB;IACA,OAAOD,IAAI,CAACE,SAAS,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;UACA;UACA;;;;;UCPA;;;;;UCAA;UACA;UACA;UACA,uDAAuD,iBAAiB;UACxE;UACA,gDAAgD,aAAa;UAC7D;;;;;UCNA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;;;;SEpBA;SACA;SACA;SACA;SACA","sources":["webpack://wordpress-activitypub/./src/follow-me/button-style.js","webpack://wordpress-activitypub/./src/follow-me/style.scss?8459","webpack://wordpress-activitypub/./src/follow-me/view.js","webpack://wordpress-activitypub/external module \"@wordpress/interactivity\"","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/chunk loaded","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/webpack/runtime/import chunk loading","webpack://wordpress-activitypub/webpack/before-startup","webpack://wordpress-activitypub/webpack/startup","webpack://wordpress-activitypub/webpack/after-startup"],"sourcesContent":["/**\n * Gets the background color from a style object.\n *\n * @param {Object|string} color Color object or string.\n * @return {string|null} Background color.\n */\nfunction getBackgroundColor( color ) {\n\t// If color is a string, it's a var like this.\n\tif ( typeof color === 'string' ) {\n\t\treturn `var(--wp--preset--color--${ color })`;\n\t}\n\n\treturn color?.color?.background || null;\n}\n\n/**\n * Gets the link color from a style object.\n *\n * @param {string} text Text color.\n * @return {string|null} Link color.\n */\nfunction getLinkColor( text ) {\n\tif ( typeof text !== 'string' ) {\n\t\treturn null;\n\t}\n\t// If it starts with a hash, leave it be.\n\tif ( text.match( /^#/ ) ) {\n\t\t// We don't handle the alpha channel if present.\n\t\treturn text.substring( 0, 7 );\n\t}\n\t// var:preset|color|luminous-vivid-amber\n\t// var(--wp--preset--color--luminous-vivid-amber)\n\t// We will receive the top format, we need to output the bottom format.\n\tconst [ , , color ] = text.split( '|' );\n\treturn `var(--wp--preset--color--${ color })`;\n}\n\n/**\n * Generates a CSS selector.\n *\n * @param {string} selector CSS selector.\n * @param {string} prop CSS property.\n * @param {string|null} value CSS value.\n * @param {string} pseudo Pseudo-selector.\n * @return {string} CSS selector.\n */\nfunction generateSelector( selector, prop, value = null, pseudo = '' ) {\n\tif ( ! value ) {\n\t\treturn '';\n\t}\n\treturn `${ selector }${ pseudo } { ${ prop }: ${ value }; }\\n`;\n}\n\n/**\n * Gets styles for a button.\n *\n * @param {string} selector CSS selector.\n * @param {string} button Button color.\n * @param {string} text Text color.\n * @param {string} hover Hover color.\n * @return {string} CSS styles.\n */\nfunction getStyles( selector, button, text, hover ) {\n\treturn (\n\t\tgenerateSelector( selector, 'background-color', button ) +\n\t\tgenerateSelector( selector, 'color', text ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':hover' ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':focus' )\n\t);\n}\n\n/**\n * Gets block styles.\n *\n * @param {string} base Base selector.\n * @param {Object} style Style object.\n * @param {Object|string} backgroundColor Background color.\n * @return {string} CSS styles.\n */\nexport function getBlockStyles( base, style, backgroundColor ) {\n\tif ( ! style.length ) {\n\t\treturn '';\n\t}\n\n\tconst selector = `${ base } .wp-block-button__link`;\n\t// We grab the background color if set as a good color for our button text.\n\tconst buttonTextColor =\n\t\tgetBackgroundColor( backgroundColor ) ||\n\t\t// Background might be in this form.\n\t\tstyle?.color?.background;\n\t// We misuse the link color for the button background.\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text );\n\t// Hover!\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text );\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n\n/**\n * Gets popup styles.\n *\n * @param {Object} style Style object.\n * @return {string} CSS styles.\n */\nexport function getPopupStyles( style ) {\n\t// We don't accept backgroundColor because the popup is always white (right?).\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text ) || '#111';\n\tconst buttonTextColor = '#fff';\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text ) || '#333';\n\tconst selector = '.activitypub-dialog__button-group .components-button';\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n","// extracted by mini-css-extract-plugin\nexport {};","import { store, getContext } from '@wordpress/interactivity';\nimport { getBlockStyles, getPopupStyles } from './button-style';\nimport './style.scss';\n\n/**\n * Traps focus within the specified element.\n *\n * @param {Element} element The element to trap focus within.\n */\nfunction trapFocus( element ) {\n\tvar focusableElements = element.querySelectorAll(\n\t\t'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type=\"text\"]:not([disabled]), input[type=\"radio\"]:not([disabled]), input[type=\"checkbox\"]:not([disabled]), select:not([disabled])'\n\t);\n\tvar firstFocusableElement = focusableElements[ 0 ];\n\tvar lastFocusableElement = focusableElements[ focusableElements.length - 1 ];\n\tfirstFocusableElement.focus();\n\n\telement.addEventListener( 'keydown', function ( event ) {\n\t\tif ( event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */ ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.shiftKey ) {\n\t\t\t/* shift + tab */\n\t\t\tif ( document.activeElement === firstFocusableElement ) {\n\t\t\t\tlastFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t} /* tab */ else {\n\t\t\tif ( document.activeElement === lastFocusableElement ) {\n\t\t\t\tfirstFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t} );\n}\n\nconst { state, actions } = store( 'activitypub/follow-me', {\n\tactions: {\n\t\t/**\n\t\t * Open the modal.\n\t\t */\n\t\topenModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = true;\n\t\t\tdocument.body.classList.add( 'modal-open' );\n\n\t\t\t// Set up the focus trap after modal is open.\n\t\t\tsetTimeout( () => {\n\t\t\t\t// Use the blockId to find the specific modal frame for this block.\n\t\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\t\tif ( blockWrapper ) {\n\t\t\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\t\t\tif ( modalFrame ) {\n\t\t\t\t\t\ttrapFocus( modalFrame );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 50 );\n\t\t},\n\n\t\t/**\n\t\t * Close the modal.\n\t\t */\n\t\tcloseModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = false;\n\t\t\tdocument.body.classList.remove( 'modal-open' );\n\n\t\t\t// Return focus to the button that opened the modal.\n\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\tif ( blockWrapper ) {\n\t\t\t\tconst openButton = blockWrapper.querySelector( '.wp-block-button__link' );\n\t\t\t\tif ( openButton ) {\n\t\t\t\t\topenButton.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\ttoggleModal() {\n\t\t\tconst { isModalOpen } = getContext();\n\n\t\t\tisModalOpen ? actions.closeModal() : actions.openModal();\n\t\t},\n\n\t\t/**\n\t\t * Copy the webfinger to clipboard.\n\t\t */\n\t\tcopyToClipboard() {\n\t\t\tconst context = getContext();\n\n\t\t\t// Use the Clipboard API to copy text.\n\t\t\tnavigator.clipboard.writeText( context.webfinger ).then(\n\t\t\t\t() => {\n\t\t\t\t\t// Update button text to show success.\n\t\t\t\t\tcontext.copyButtonText = state.i18n.copied;\n\n\t\t\t\t\t// Reset button text after 1 second.\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tcontext.copyButtonText = state.i18n.copy;\n\t\t\t\t\t}, 1000 );\n\t\t\t\t},\n\t\t\t\t( error ) => {\n\t\t\t\t\t// Log error if copying fails.\n\t\t\t\t\tconsole.error( 'Could not copy text: ', error );\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the remote profile value.\n\t\t *\n\t\t * @param {Event} event Input event.\n\t\t */\n\t\tupdateRemoteProfile( event ) {\n\t\t\tconst context = getContext();\n\t\t\tcontext.remoteProfile = event.target.value;\n\t\t\t// Reset error state when input changes.\n\t\t\tcontext.isError = false;\n\t\t\tcontext.errorMessage = '';\n\t\t},\n\n\t\t/**\n\t\t * Handle keydown event for remote profile input.\n\t\t *\n\t\t * @param {Event} event Keydown event.\n\t\t */\n\t\thandleKeyDown( event ) {\n\t\t\tif ( event.key === 'Enter' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tactions.submitRemoteProfile();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Submit the remote profile.\n\t\t */\n\t\tsubmitRemoteProfile: function* () {\n\t\t\tconst context = getContext();\n\t\t\tconst { namespace } = state;\n\t\t\tconst input = context.remoteProfile.trim();\n\n\t\t\t// Validate input.\n\t\t\tif ( ! input ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.emptyProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! /^(https?:\\/\\/|@)/.test( input ) ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.invalidProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set loading state.\n\t\t\tcontext.isLoading = true;\n\t\t\tcontext.isError = false;\n\n\t\t\t// Construct the API path.\n\t\t\tconst path = `/${ namespace }/actors/${ context.userId }/remote-follow?resource=${ encodeURIComponent(\n\t\t\t\tinput\n\t\t\t) }`;\n\n\t\t\ttry {\n\t\t\t\t// Make the API request.\n\t\t\t\tconst response = yield apiFetch( { path } );\n\n\t\t\t\t// Set opening state.\n\t\t\t\tcontext.isLoading = false;\n\n\t\t\t\t// Open the remote follow URL in a new tab.\n\t\t\t\twindow.open( response.url, '_blank' );\n\n\t\t\t\t// Close the modal after opening the URL.\n\t\t\t\tactions.closeModal();\n\t\t\t} catch ( error ) {\n\t\t\t\t// Handle error.\n\t\t\t\tconsole.error( 'Error submitting profile:', error );\n\t\t\t\tcontext.isLoading = false;\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = error.message || state.i18n.genericError;\n\t\t\t}\n\t\t},\n\t},\n\tcallbacks: {\n\t\t/**\n\t\t * Initialize button styles.\n\t\t */\n\t\tinitButtonStyles: () => {\n\t\t\tconst { buttonStyle, backgroundColor, blockId } = getContext();\n\n\t\t\t// Add dynamic button styles to the document.\n\t\t\tif ( blockId && buttonStyle ) {\n\t\t\t\tconst styleElement = document.createElement( 'style' );\n\t\t\t\tconst selector = `#${ blockId }`;\n\n\t\t\t\t// Use getBlockStyles from button-style.js to get the CSS string.\n\t\t\t\tstyleElement.textContent = getBlockStyles( selector, buttonStyle, backgroundColor );\n\n\t\t\t\tdocument.head.appendChild( styleElement );\n\n\t\t\t\t// Add popup styles.\n\t\t\t\tconst popupStyleElement = document.createElement( 'style' );\n\t\t\t\tpopupStyleElement.textContent = getPopupStyles( buttonStyle );\n\t\t\t\tdocument.head.appendChild( popupStyleElement );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when pressing ESC key.\n\t\t *\n\t\t * @param {Event} event Keyboard event.\n\t\t */\n\t\tdocumentKeydown( event ) {\n\t\t\tconst { isModalOpen } = getContext();\n\n\t\t\tif ( isModalOpen && event.key === 'Escape' ) {\n\t\t\t\tactions.closeModal();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when clicking outside.\n\t\t *\n\t\t * @param {Event} event Click event.\n\t\t */\n\t\tdocumentClick( event ) {\n\t\t\tconst { blockId, isModalOpen } = getContext();\n\t\t\tif ( ! isModalOpen ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Get the block wrapper element.\n\t\t\tconst blockWrapper = document.getElementById( blockId );\n\t\t\tif ( ! blockWrapper ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If the click was on the button or its children, we should not close the modal.\n\t\t\tconst toggleButton = blockWrapper.querySelector(\n\t\t\t\t'.wp-element-button[data-wp-on--click=\"actions.toggleModal\"]'\n\t\t\t);\n\t\t\tif ( toggleButton && ( toggleButton === event.target || toggleButton.contains( event.target ) ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if the click was inside the modal frame.\n\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\tif ( ! modalFrame || modalFrame.contains( event.target ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactions.closeModal();\n\t\t},\n\t},\n} );\n","module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;","// 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\t// no module.id needed\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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"follow-me/view\": 0,\n\t\"follow-me/style-view\": 0\n};\n\n// no install chunk\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no external install chunk\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"follow-me/style-view\"], () => (__webpack_require__(\"./src/follow-me/view.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["getBackgroundColor","color","background","getLinkColor","text","match","substring","split","generateSelector","selector","prop","value","pseudo","getStyles","button","hover","getBlockStyles","base","style","backgroundColor","length","buttonTextColor","buttonColor","elements","link","buttonHoverColor","getPopupStyles","store","getContext","trapFocus","element","focusableElements","querySelectorAll","firstFocusableElement","lastFocusableElement","focus","addEventListener","event","key","keyCode","shiftKey","document","activeElement","preventDefault","state","actions","openModal","context","isModalOpen","body","classList","add","setTimeout","blockWrapper","getElementById","blockId","modalFrame","querySelector","closeModal","remove","openButton","toggleModal","copyToClipboard","navigator","clipboard","writeText","webfinger","then","copyButtonText","i18n","copied","copy","error","console","updateRemoteProfile","remoteProfile","target","isError","errorMessage","handleKeyDown","submitRemoteProfile","namespace","input","trim","emptyProfileError","test","invalidProfileError","isLoading","path","userId","encodeURIComponent","response","apiFetch","window","open","url","message","genericError","callbacks","initButtonStyles","buttonStyle","styleElement","createElement","textContent","head","appendChild","popupStyleElement","documentKeydown","documentClick","toggleButton","contains"],"sourceRoot":""} \ No newline at end of file diff --git a/src/follow-me/style.scss b/src/follow-me/style.scss index 12edb15ff..1c61a7ad0 100644 --- a/src/follow-me/style.scss +++ b/src/follow-me/style.scss @@ -3,66 +3,68 @@ position: relative; } -.activitypub-follow-me-block-wrapper .activitypub-profile { - display: flex; - align-items: center; - padding: 1em 0; - - .has-background > &, - .has-border > & { - padding-left: 1em; - padding-right: 1em; - } +.activitypub-follow-me-block-wrapper { + .activitypub-profile { + display: flex; + align-items: center; + padding: 1rem 0; + + &__avatar { + width: 75px; + height: 75px; + border-radius: 50%; + margin-right: 1rem; + object-fit: cover; + } - &__avatar { - width: 75px; - height: 75px; - border-radius: 50%; - margin-right: 1em; - object-fit: cover; - } + &__content { + flex: 1; + margin-right: 1rem; + min-width: 0; + } - &__content { - flex: 1; - margin-right: 1em; - min-width: 0; - } + &__name { + font-size: 1.25rem; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } - &__name { - font-size: 1.25em; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } + &__handle { + color: inherit; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } - &__handle { - color: inherit; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } + .wp-block-button { + flex-shrink: 0; + margin: 0; - .wp-block-button { - flex-shrink: 0; - margin: 0; + &:not(:only-child) { + margin-left: 1rem; + } + } - &:not(:only-child) { - margin-left: 1em; + .wp-block-button__link { + margin: 0; } - } - .wp-block-button__link { - margin: 0; - } + .is-small { + padding: 0.25rem 0.5rem; + font-size: 0.8rem; + } - .is-small { - padding: 0.25em 0.5em; - font-size: 0.8em; + .is-compact { + padding: 0.4rem 0.8rem; + font-size: 0.9rem; + } } - .is-compact { - padding: 0.4em 0.8em; - font-size: 0.9em; + &.has-background .activitypub-profile, + &.has-border .activitypub-profile { + padding-left: 1rem; + padding-right: 1rem; } } @@ -102,14 +104,14 @@ display: flex; justify-content: space-between; align-items: center; - padding: 1em 1em 1em 1.5em; + padding: 1rem 1rem 1rem 1.5rem; border-bottom: 1px solid #e2e4e7; flex-shrink: 0; } &__title { margin: 0 !important; - font-size: 1.3em; + font-size: 1.3rem; font-weight: 600; line-height: 1.4; } @@ -117,7 +119,7 @@ &__close { background: none; border: none; - padding: 0.5em; + padding: 0.5rem; cursor: pointer; color: #555; display: flex; @@ -133,7 +135,7 @@ background: none; border: none; color: #000; - padding: 0.5em; + padding: 0.5rem; } } @@ -144,7 +146,7 @@ .activitypub-dialog { &__section { - padding: 1em 1.5em; + padding: 1rem 1.5rem; border-bottom: 1px solid #f0f0f0; &:last-child { @@ -153,34 +155,34 @@ h4 { margin-top: 0; - margin-bottom: 0.5em; - font-size: 1.1em; + margin-bottom: 0.5rem; + font-size: 1.1rem; } } &__description { - margin-bottom: 1em; + margin-bottom: 1rem; color: inherit; - font-size: 0.95em; + font-size: 0.95rem; code { background: #f0f0f0; - padding: 0.1em 0.3em; + padding: 0.1rem 0.3rem; border-radius: 3px; - font-size: 0.9em; + font-size: 0.9rem; } } &__button-group { display: flex; width: 100%; - margin-bottom: 0.5em; + margin-bottom: 0.5rem; input { flex: 1; border: 1px solid #ddd; border-radius: 4px 0 0 4px; - font-size: 1em; + font-size: 1rem; margin: 0; &[aria-invalid="true"] { @@ -196,8 +198,8 @@ &__error { color: #cc1818; - font-size: 0.9em; - margin-top: 0.5em; + font-size: 0.9rem; + margin-top: 0.5rem; } } From 4ebcd1aadec18581b52ae6e8915bee20e89097bf Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Thu, 15 May 2025 12:08:55 -0500 Subject: [PATCH 24/47] Small style update --- build/editor-plugin/plugin.js.map | 1 + build/follow-me/index.js.map | 2 +- build/follow-me/style-view.css | 2 +- build/follow-me/style-view.css.map | 2 +- src/follow-me/style.scss | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 build/editor-plugin/plugin.js.map diff --git a/build/editor-plugin/plugin.js.map b/build/editor-plugin/plugin.js.map new file mode 100644 index 000000000..896f7900d --- /dev/null +++ b/build/editor-plugin/plugin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"editor-plugin/plugin.js","mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAC8D;;AAE9D,eAAe,kCAAkC,4CAA4C;;AAE7F;AACA;AACA;AACA,WAAW,2CAA2C;AACtD;AACA;AACA,WAAW,2CAA2C;AACtD;AACA,YAAY,cAAc;AAC1B;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,SAAS,gEAAY;AACrB;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,iEAAe,8DAAU,MAAM,EAAC;AAChC;;;;;;;;;;;;;;;;;AC9BA;AACA;AACA;AACkD;AACF;AAChD,8BAA8B,sDAAI,CAAC,sDAAG;AACtC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA,GAAG;AACH,CAAC;AACD,iEAAe,QAAQ,EAAC;AACxB;;;;;;;;;;;;;;;;;ACbA;AACA;AACA;AACkD;AACF;AAChD,2BAA2B,sDAAI,CAAC,sDAAG;AACnC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA,GAAG;AACH,CAAC;AACD,iEAAe,KAAK,EAAC;AACrB;;;;;;;;;;;;;;;;;ACbA;AACA;AACA;AACkD;AACF;AAChD,4BAA4B,sDAAI,CAAC,sDAAG;AACpC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA;AACA,GAAG;AACH,CAAC;AACD,iEAAe,MAAM,EAAC;AACtB;;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,IAAI,IAAqC;AACzC;AACA;;AAEA,YAAY,mBAAO,CAAC,oBAAO;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,iGAAiG,eAAe;AAChH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA,KAAK,GAAG;;AAER,kDAAkD;AAClD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,4BAA4B;AAC5B;AACA,qCAAqC;;AAErC,gCAAgC;AAChC;AACA;;AAEA,gCAAgC;;AAEhC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;;AAGJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;;AAGF;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,sBAAsB;AACtB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,iCAAiC;AACjC;AACA,SAAS;AACT,2BAA2B;AAC3B;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;;AAE3D;AACA;;AAEA;AACA,yDAAyD;AACzD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA,gFAAgF;AAChF;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;;;AAGlB;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA,IAAI;;;AAGJ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2HAA2H;AAC3H;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA,oEAAoE;;AAEpE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC;;AAEjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,eAAe;AAC1B,WAAW,GAAG;AACd,WAAW,GAAG;AACd;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;;AAER;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;;AAEA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA,oBAAoB;AACpB,2DAA2D,UAAU;AACrE,yBAAyB,UAAU;AACnC;AACA,aAAa,UAAU;AACvB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,YAAY,SAAS;AACrB;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,6DAA6D;AAC7D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,iBAAiB;AACvC;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN,4CAA4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;IAAEG,WAAW,EAAE;EAAO,CAAE,CAAC;EAEjFb,MAAM,CAACc,IAAI,CAAEF,oBAAoB,EAAE,QAAS,CAAC;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMG,aAAa,GAAGA,CAAA,KAAM;EAC3B;EACA,MAAMC,WAAW,GAAGzD,0DAAS,CAAIC,MAAM,IAAMA,MAAM,CAAE,aAAc,CAAC,CAACyD,cAAc,CAAC,CAAC,CAACC,MAAO,CAAC;EAE9F,OACCnD,oDAAA,CAAAoD,2CAAA,QACGxE,oEAAqB,GACtBoB,oDAAA,CAACpB,oEAAqB;IACrByE,OAAO,EAAGA,CAAA,KAAMX,oBAAoB,CAAC,CAAG;IACxCtB,IAAI,EAAG7B,yDAAU;IACjB+D,QAAQ,EAAGL,WAAW,KAAK;EAAc,GAEvCrD,mDAAE,CAAE,qBAAqB,EAAE,aAAc,CACrB,CAAC,GACrB,IACH,CAAC;AAEL,CAAC;AAEDf,kEAAc,CAAE,2BAA2B,EAAE;EAAE0E,MAAM,EAAEjD;AAAa,CAAE,CAAC;AACvEzB,kEAAc,CAAE,4BAA4B,EAAE;EAAE0E,MAAM,EAAEP;AAAc,CAAE,CAAC,C","sources":["webpack://wordpress-activitypub/./node_modules/@wordpress/icons/build-module/icon/index.js","webpack://wordpress-activitypub/./node_modules/@wordpress/icons/build-module/library/external.js","webpack://wordpress-activitypub/./node_modules/@wordpress/icons/build-module/library/globe.js","webpack://wordpress-activitypub/./node_modules/@wordpress/icons/build-module/library/people.js","webpack://wordpress-activitypub/./node_modules/react/cjs/react-jsx-runtime.development.js","webpack://wordpress-activitypub/./node_modules/react/jsx-runtime.js","webpack://wordpress-activitypub/external window [\"wp\",\"components\"]","webpack://wordpress-activitypub/external window [\"wp\",\"coreData\"]","webpack://wordpress-activitypub/external window [\"wp\",\"data\"]","webpack://wordpress-activitypub/external window [\"wp\",\"editor\"]","webpack://wordpress-activitypub/external window [\"wp\",\"element\"]","webpack://wordpress-activitypub/external window [\"wp\",\"i18n\"]","webpack://wordpress-activitypub/external window [\"wp\",\"plugins\"]","webpack://wordpress-activitypub/external window [\"wp\",\"primitives\"]","webpack://wordpress-activitypub/external window [\"wp\",\"url\"]","webpack://wordpress-activitypub/external window \"React\"","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/compat get default export","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/./src/editor-plugin/plugin.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { cloneElement, forwardRef } from '@wordpress/element';\n\n/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */\n\n/**\n * Return an SVG icon.\n *\n * @param {IconProps} props icon is the SVG component to render\n * size is a number specifying the icon size in pixels\n * Other props will be passed to wrapped SVG component\n * @param {import('react').ForwardedRef} ref The forwarded ref to the SVG element.\n *\n * @return {JSX.Element} Icon component\n */\nfunction Icon({\n icon,\n size = 24,\n ...props\n}, ref) {\n return cloneElement(icon, {\n width: size,\n height: size,\n ...props,\n ref\n });\n}\nexport default forwardRef(Icon);\n//# sourceMappingURL=index.js.map","/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst external = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z\"\n })\n});\nexport default external;\n//# sourceMappingURL=external.js.map","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst globe = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M12 3.3c-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.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z\"\n })\n});\nexport default globe;\n//# sourceMappingURL=globe.js.map","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst people = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z\",\n fillRule: \"evenodd\"\n })\n});\nexport default people;\n//# sourceMappingURL=people.js.map","/**\n * @license React\n * react-jsx-runtime.development.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\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'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","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"editor\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"plugins\"];","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"wp\"][\"url\"];","module.exports = window[\"React\"];","// 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\t// no module.id needed\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { PluginDocumentSettingPanel, PluginPreviewMenuItem } from '@wordpress/editor';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { TextControl, RadioControl, RangeControl, __experimentalText as Text, Tooltip } from '@wordpress/components';\nimport { Icon, globe, people, external } from '@wordpress/icons';\nimport { useSelect, select } from '@wordpress/data';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __ } from '@wordpress/i18n';\nimport { SVG, Path } from '@wordpress/primitives';\n\n// Defining our own because it's too new in @wordpress/icons\n// https://github.com/WordPress/gutenberg/blob/trunk/packages/icons/src/library/not-allowed.js\nconst notAllowed = (\n\t\n\t\t\n\t\n);\n\n/**\n * Editor plugin for ActivityPub settings in the block editor.\n *\n * @returns {JSX.Element|null} The settings panel for ActivityPub or null for sync blocks.\n */\nconst EditorPlugin = () => {\n\tconst postType = useSelect( ( select ) => select( 'core/editor' ).getCurrentPostType(), [] );\n\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\n\n\tconst labelStyling = {\n\t\tverticalAlign: 'middle',\n\t\tgap: '4px',\n\t\tjustifyContent: 'start',\n\t\tdisplay: 'inline-flex',\n\t\talignItems: 'center',\n\t};\n\n\t/**\n\t * Enhances a label with an icon and tooltip.\n\t *\n\t * @param {JSX.Element} icon The icon to display.\n\t * @param {string} text The label text.\n\t * @param {string} tooltip The tooltip text.\n\t *\n\t * @returns {JSX.Element} The enhanced label component.\n\t */\n\tconst enhancedLabel = ( icon, text, tooltip ) => (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t{ text }\n\t\t\t\n\t\t\n\t);\n\n\t// Don't show when editing sync blocks.\n\tif ( 'wp_block' === postType ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t\n\t\t\t {\n\t\t\t\t\tsetMeta( { ...meta, activitypub_content_warning: value } );\n\t\t\t\t} }\n\t\t\t\tplaceholder={ __( 'Optional content warning', 'activitypub' ) }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Content warnings do not change the content on your site, only in the fediverse.',\n\t\t\t\t\t'activitypub'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t {\n\t\t\t\t\tsetMeta( { ...meta, activitypub_max_image_attachments: value } );\n\t\t\t\t} }\n\t\t\t\tmin={ 0 }\n\t\t\t\tmax={ 10 }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Maximum number of image attachments to include when sharing to the fediverse.',\n\t\t\t\t\t'activitypub'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t {\n\t\t\t\t\tsetMeta( { ...meta, activitypub_content_visibility: value } );\n\t\t\t\t} }\n\t\t\t\tclassName=\"activitypub-visibility\"\n\t\t\t/>\n\t\t\n\t);\n};\n\n/**\n * Opens the Fediverse preview for the current post in a new tab.\n */\nfunction onActivityPubPreview() {\n\tconst previewLink = select( 'core/editor' ).getEditedPostPreviewLink();\n\tconst fediversePreviewLink = addQueryArgs( previewLink, { activitypub: 'true' } );\n\n\twindow.open( fediversePreviewLink, '_blank' );\n}\n\n/**\n * Renders the preview menu item for Fediverse preview.\n *\n * @returns {JSX.Element} The preview menu item component.\n */\nconst EditorPreview = () => {\n\t// check if post was saved\n\tconst post_status = useSelect( ( select ) => select( 'core/editor' ).getCurrentPost().status );\n\n\treturn (\n\t\t<>\n\t\t\t{ PluginPreviewMenuItem ? (\n\t\t\t\t onActivityPubPreview() }\n\t\t\t\t\ticon={ external }\n\t\t\t\t\tdisabled={ post_status === 'auto-draft' }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Fediverse preview ⁂', 'activitypub' ) }\n\t\t\t\t\n\t\t\t) : null }\n\t\t\n\t);\n};\n\nregisterPlugin( 'activitypub-editor-plugin', { render: EditorPlugin } );\nregisterPlugin( 'activitypub-editor-preview', { render: EditorPreview } );\n"],"names":["PluginDocumentSettingPanel","PluginPreviewMenuItem","registerPlugin","TextControl","RadioControl","RangeControl","__experimentalText","Text","Tooltip","Icon","globe","people","external","useSelect","select","useEntityProp","addQueryArgs","__","SVG","Path","notAllowed","createElement","xmlns","viewBox","fillRule","clipRule","d","EditorPlugin","_ref","_meta$activitypub_max","postType","getCurrentPostType","meta","setMeta","labelStyling","verticalAlign","gap","justifyContent","display","alignItems","enhancedLabel","icon","text","tooltip","style","name","title","label","value","activitypub_content_warning","onChange","placeholder","help","activitypub_max_image_attachments","window","_activityPubOptions","maxImageAttachments","min","max","selected","activitypub_content_visibility","options","className","onActivityPubPreview","previewLink","getEditedPostPreviewLink","fediversePreviewLink","activitypub","open","EditorPreview","post_status","getCurrentPost","status","Fragment","onClick","disabled","render"],"sourceRoot":""} \ No newline at end of file diff --git a/build/follow-me/index.js.map b/build/follow-me/index.js.map index fda79d3a5..c544d4d50 100644 --- a/build/follow-me/index.js.map +++ b/build/follow-me/index.js.map @@ -1 +1 @@ -{"version":3,"file":"follow-me/index.js","mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACkD;AACF;AAChD,4BAA4B,sDAAI,CAAC,sDAAG;AACpC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA;AACA,GAAG;AACH,CAAC;AACD,iEAAe,MAAM,EAAC;AACtB;;;;;;;;;;;;;;;;ACdgD;;AAEhD;AACA;AACA;AACA;AACA,MAAMC,EAAE,GAAG;EACVC,UAAU,EAAE;IACXC,UAAU,EAAE;MACXC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE;IACV,CAAC;IACDC,UAAU,EAAE;MAC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ACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;;AAGF;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,sBAAsB;AACtB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,iCAAiC;AACjC;AACA,SAAS;AACT,2BAA2B;AAC3B;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;;AAE3D;AACA;;AAEA;AACA,yDAAyD;AACzD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA,gFAAgF;AAChF;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;;;AAGlB;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA,IAAI;;;AAGJ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2HAA2H;AAC3H;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA,oEAAoE;;AAEpE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC;;AAEjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,eAAe;AAC1B,WAAW,GAAG;AACd,WAAW,GAAG;AACd;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;;AAER;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;;AAEA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA,oBAAoB;AACpB,2DAA2D,UAAU;AACrE,yBAAyB,UAAU;AACnC;AACA,aAAa,UAAU;AACvB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,YAAY,SAAS;AACrB;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,6DAA6D;AAC7D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,iBAAiB;AACvC;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN,4CAA4C;;AAE5C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,8CAA8C;AAC9C;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA,0DAA0D;AAC1D;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,gDAAgD,gDAAgD,MAAM,aAAa;;AAEnH;AACA,iDAAiD,kCAAkC,OAAO;;AAE1F,yGAAyG,cAAc,UAAU,gGAAgG,kBAAkB,UAAU,UAAU;;AAEvQ;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;AACtC;;AAEA;;AAEA,gBAAgB;AAChB,WAAW;AACX,YAAY;AACZ,GAAG;AACH;;;;;;;;;;;ACpzCa;;AAEb,IAAI,KAAqC,EAAE,EAE1C,CAAC;AACF,EAAE,+IAAkE;AACpE;;;;;;;;;;;ACNA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;ACNsD;AACZ;AACH;AACb;AACA;;AAE1B;AACAS,oEAAiB,CAAE,uBAAuB,EAAE;EAC3CE,UAAU;EACVC,IAAI;EACJzE,IAAI,EAAEuE,wDAAM;EACZvB,IAAIA,+CAAAA;AACL,CAAE,CAAC,C","sources":["webpack://wordpress-activitypub/./node_modules/@wordpress/icons/build-module/library/people.js","webpack://wordpress-activitypub/./src/follow-me/deprecation.js","webpack://wordpress-activitypub/./src/follow-me/edit.js","webpack://wordpress-activitypub/./src/follow-me/save.js","webpack://wordpress-activitypub/./src/shared/inherit-block-fallback.js","webpack://wordpress-activitypub/./src/shared/use-options.js","webpack://wordpress-activitypub/./src/shared/use-user-options.js","webpack://wordpress-activitypub/./node_modules/react/cjs/react-jsx-runtime.development.js","webpack://wordpress-activitypub/./node_modules/react/jsx-runtime.js","webpack://wordpress-activitypub/external window \"React\"","webpack://wordpress-activitypub/external window [\"wp\",\"apiFetch\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blockEditor\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blocks\"]","webpack://wordpress-activitypub/external window [\"wp\",\"components\"]","webpack://wordpress-activitypub/external window [\"wp\",\"coreData\"]","webpack://wordpress-activitypub/external window [\"wp\",\"data\"]","webpack://wordpress-activitypub/external window [\"wp\",\"element\"]","webpack://wordpress-activitypub/external window [\"wp\",\"i18n\"]","webpack://wordpress-activitypub/external window [\"wp\",\"primitives\"]","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/compat get default export","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/./src/follow-me/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst people = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z\",\n fillRule: \"evenodd\"\n })\n});\nexport default people;\n//# sourceMappingURL=people.js.map","import { createBlock } from '@wordpress/blocks';\n\n/**\n * Deprecation for the Follow Me block to use a core button block instead of the custom button.\n * This handles the migration of the buttonText and buttonSize attributes to the innerBlock.\n */\nconst v1 = {\n\tattributes: {\n\t\tbuttonText: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'Follow',\n\t\t},\n\t\tbuttonSize: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'default',\n\t\t\tenum: [ 'small', 'default', 'compact' ],\n\t\t},\n\t},\n\n\tisEligible( attributes ) {\n\t\t// Run migration if buttonText attribute exists.\n\t\treturn !! attributes.buttonText;\n\t},\n\n\tmigrate( attributes ) {\n\t\tconst { buttonText, buttonSize, ...newAttributes } = attributes;\n\n\t\t// Map buttonSize to core/button className.\n\t\tlet className = '';\n\t\tif ( buttonSize === 'small' ) {\n\t\t\tclassName = 'is-small';\n\t\t} else if ( buttonSize === 'compact' ) {\n\t\t\tclassName = 'is-compact';\n\t\t}\n\n\t\t// Create a core button block with the buttonText and buttonSize.\n\t\tconst buttonBlock = createBlock( 'core/button', {\n\t\t\tclassName,\n\t\t\ttagName: 'button',\n\t\t\ttext: buttonText,\n\t\t} );\n\n\t\treturn [ newAttributes, [ buttonBlock ] ];\n\t},\n};\n\nexport default [ v1 ];\n","import apiFetch from '@wordpress/api-fetch';\nimport { InspectorControls, useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { SelectControl, PanelBody, ToggleControl } from '@wordpress/components';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useUserOptions } from '../shared/use-user-options';\nimport { InheritModeBlockFallback } from '../shared/inherit-block-fallback';\nimport { useOptions } from '../shared/use-options';\n\n/**\n * Default profile data.\n *\n * @type {Object}\n */\nconst DEFAULT_PROFILE_DATA = {\n\tavatar: 'https://secure.gravatar.com/avatar/default?s=120',\n\twebfinger: '@well@hello.dolly',\n\tname: __( 'Hello Dolly Fan Account', 'activitypub' ),\n\turl: '#',\n};\n\n/**\n * Get normalized profile data.\n *\n * @param {Object} profile Profile data.\n * @return {Object} Normalized profile data.\n */\nfunction getNormalizedProfile( profile ) {\n\tif ( ! profile ) {\n\t\treturn DEFAULT_PROFILE_DATA;\n\t}\n\n\tconst data = { ...DEFAULT_PROFILE_DATA, ...profile };\n\tdata.avatar = data?.icon?.url;\n\n\t// Ensure webfinger always has the @ prefix.\n\tif ( data.webfinger && ! data.webfinger.startsWith( '@' ) ) {\n\t\tdata.webfinger = '@' + data.webfinger;\n\t}\n\n\treturn data;\n}\n\n/**\n * Fetch profile data.\n *\n * @param {number} userId User ID.\n * @return {Promise} Promise resolving with profile data.\n */\nfunction fetchProfile( userId ) {\n\tconst { namespace } = useOptions();\n\tconst fetchOptions = {\n\t\theaders: { Accept: 'application/activity+json' },\n\t\tpath: `/${ namespace }/actors/${ userId }`,\n\t};\n\treturn apiFetch( fetchOptions );\n}\n\n/**\n * Profile component for the editor.\n *\n * @param {Object} props Component props.\n * @return {JSX.Element} Profile component.\n */\nfunction EditorProfile( { profile, buttonOnly, innerBlocksProps } ) {\n\tconst { webfinger, avatar, name } = profile;\n\n\tif ( buttonOnly ) {\n\t\treturn (\n\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\treturn (\n\t\t
\n\t\t\t{\n\t\t\t
\n\t\t\t\t
{ name }
\n\t\t\t\t
\n\t\t\t\t\t{ webfinger }\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t
\n\t);\n}\n\n/**\n * Edit component.\n *\n * @param {Object} props Component props.\n * @param {Object} props.attributes Block attributes.\n * @param {Function} props.setAttributes Set block attributes.\n * @param {Object} props.context Block context.\n * @param {string} props.context.postType Post type.\n * @param {number} props.context.postId Post ID.\n * @return {JSX.Element} Edit component.\n */\nexport default function Edit( { attributes, setAttributes, context: { postType, postId } } ) {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'activitypub-follow-me-block-wrapper',\n\t} );\n\tconst usersOptions = useUserOptions( { withInherit: true } );\n\tconst { selectedUser, buttonOnly } = attributes;\n\tconst isInheritMode = selectedUser === 'inherit';\n\tconst [ profile, setProfile ] = useState( getNormalizedProfile( DEFAULT_PROFILE_DATA ) );\n\tconst userId = selectedUser === 'site' ? 0 : selectedUser;\n\n\tconst TEMPLATE = [ [ 'core/button', { text: __( 'Follow', 'activitypub' ), tagName: 'button' } ] ];\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{},\n\t\t{\n\t\t\tallowedBlocks: [ 'core/button' ],\n\t\t\ttemplate: TEMPLATE,\n\t\t\ttemplateLock: false,\n\t\t\trenderAppender: false,\n\t\t}\n\t);\n\n\tconst authorId = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord( 'postType', postType, postId )?.author;\n\n\t\t\treturn _authorId ?? null;\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tuseEffect( () => {\n\t\t// Fetch profile data when userId changes.\n\t\tif ( isInheritMode && ! authorId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst effectiveUserId = isInheritMode ? authorId : userId;\n\t\tfetchProfile( effectiveUserId ).then( ( data ) => {\n\t\t\tsetProfile( getNormalizedProfile( data ) );\n\t\t} );\n\t}, [ userId, authorId, isInheritMode ] );\n\n\tuseEffect( () => {\n\t\t// If there are no users yet, do nothing.\n\t\tif ( ! usersOptions.length ) {\n\t\t\treturn;\n\t\t}\n\t\t// Ensure that the selected user is in the list of options, if not, select the first available user.\n\t\tif ( ! usersOptions.find( ( { value } ) => value === selectedUser ) ) {\n\t\t\tsetAttributes( { selectedUser: usersOptions[ 0 ].value } );\n\t\t}\n\t}, [ selectedUser, usersOptions ] );\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{ usersOptions.length > 1 && (\n\t\t\t\t\t\t setAttributes( { selectedUser: value } ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t setAttributes( { buttonOnly: value } ) }\n\t\t\t\t\t\thelp={ __( 'Only show the follow button without profile information', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\n\t\t\t{ isInheritMode && ! authorId ? (\n\t\t\t\t\n\t\t\t) : (\n\t\t\t\t\n\t\t\t) }\n\t\t
\n\t);\n}\n","import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\n\n/**\n * Save component for the Follow Me block.\n *\n * This component ensures that inner blocks (the button) are properly saved.\n *\n * @return {JSX.Element|null} Save component.\n */\nfunction save() {\n\tconst blockProps = useBlockProps.save();\n\tconst innerBlocksProps = useInnerBlocksProps.save( blockProps );\n\n\treturn
;\n}\n\nexport default save;\n","import { Card, CardBody } from '@wordpress/components';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\nexport function InheritModeBlockFallback( { name } ) {\n\tconst { enabled } = useOptions();\n\tconst nonAuthorExtra = enabled?.site ? '' : __( 'It will be empty in other non-author contexts.', 'activitypub' );\n\tconst text = sprintf(\n\t\t/* translators: %1$s: block name, %2$s: extra information for non-author context */\n\t\t__( 'This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s', 'activitypub' ),\n\t\tname,\n\t\tnonAuthorExtra\n\t).trim();\n\n\treturn (\n\t\t\n\t\t\t{ createInterpolateElement( text, { strong: } ) }\n\t\t\n\t);\n}\n","/**\n * Returns the ActivityPub options object.\n *\n * @return {Object} The options object.\n */\nexport function useOptions() {\n\treturn window._activityPubOptions || {};\n}\n","import { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\nexport function useUserOptions( { withInherit = false } ) {\n\tconst { enabled } = useOptions();\n\tconst users = enabled?.users ? useSelect( ( select ) => select( 'core' ).getUsers( { who: 'authors' } ) ) : [];\n\treturn useMemo( () => {\n\t\tif ( ! users ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst userKeywords = [];\n\n\t\tif ( enabled?.site ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Site', 'activitypub' ),\n\t\t\t\tvalue: 'site'\n\t\t\t} );\n\t\t}\n\n\t\t// Only show inherit option when explicitly asked for and users are enabled.\n\t\tif ( withInherit && enabled?.users ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Dynamic User', 'activitypub' ),\n\t\t\t\tvalue: 'inherit'\n\t\t\t} );\n\t\t}\n\n\t\treturn users.reduce( ( acc, user ) => {\n\t\t\tacc.push({\n\t\t\t\tlabel: user.name,\n\t\t\t\tvalue: `${ user.id }` // casting to string because that's how the attribute is stored by Gutenberg\n\t\t\t} );\n\t\t\treturn acc;\n\t\t}, userKeywords );\n\t}, [ users ] );\n}","/**\n * @license React\n * react-jsx-runtime.development.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\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'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","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","// 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\t// no module.id needed\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport { people } from '@wordpress/icons';\nimport deprecated from './deprecation';\nimport edit from './edit';\nimport save from './save';\n\n// Register the block.\nregisterBlockType( 'activitypub/follow-me', {\n\tdeprecated,\n\tedit,\n\ticon: people,\n\tsave,\n} );\n"],"names":["createBlock","v1","attributes","buttonText","type","default","buttonSize","enum","isEligible","migrate","newAttributes","className","buttonBlock","tagName","text","apiFetch","InspectorControls","useBlockProps","useInnerBlocksProps","__","useSelect","store","coreStore","SelectControl","PanelBody","ToggleControl","useEffect","useState","useUserOptions","InheritModeBlockFallback","useOptions","DEFAULT_PROFILE_DATA","avatar","webfinger","name","url","getNormalizedProfile","profile","data","icon","startsWith","fetchProfile","userId","namespace","fetchOptions","headers","Accept","path","EditorProfile","buttonOnly","innerBlocksProps","createElement","src","alt","title","Edit","setAttributes","context","postType","postId","blockProps","usersOptions","withInherit","selectedUser","isInheritMode","setProfile","TEMPLATE","allowedBlocks","template","templateLock","renderAppender","authorId","select","getEditedEntityRecord","_authorId","author","effectiveUserId","then","length","find","value","key","label","options","onChange","checked","help","save","Card","CardBody","sprintf","createInterpolateElement","enabled","nonAuthorExtra","site","trim","strong","window","_activityPubOptions","useMemo","users","getUsers","who","userKeywords","push","reduce","acc","user","id","registerBlockType","people","deprecated","edit"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"follow-me/index.js","mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACkD;AACF;AAChD,4BAA4B,sDAAI,CAAC,sDAAG;AACpC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA;AACA,GAAG;AACH,CAAC;AACD,iEAAe,MAAM,EAAC;AACtB;;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,IAAI,IAAqC;AACzC;AACA;;AAEA,YAAY,mBAAO,CAAC,oBAAO;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,iGAAiG,eAAe;AAChH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA,KAAK,GAAG;;AAER,kDAAkD;AAClD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,4BAA4B;AAC5B;AACA,qCAAqC;;AAErC,gCAAgC;AAChC;AACA;;AAEA,gCAAgC;;AAEhC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;;AAGJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;;AAGF;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,sBAAsB;AACtB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,iCAAiC;AACjC;AACA,SAAS;AACT,2BAA2B;AAC3B;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;;AAE3D;AACA;;AAEA;AACA,yDAAyD;AACzD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA,gFAAgF;AAChF;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;;;AAGlB;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA,IAAI;;;AAGJ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2HAA2H;AAC3H;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA,oEAAoE;;AAEpE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC;;AAEjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,eAAe;AAC1B,WAAW,GAAG;AACd,WAAW,GAAG;AACd;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;;AAER;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;;AAEA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA,oBAAoB;AACpB,2DAA2D,UAAU;AACrE,yBAAyB,UAAU;AACnC;AACA,aAAa,UAAU;AACvB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,YAAY,SAAS;AACrB;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,6DAA6D;AAC7D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,iBAAiB;AACvC;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN,4CAA4C;;AAE5C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,8CAA8C;AAC9C;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA,0DAA0D;AAC1D;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,gDAAgD,gDAAgD,MAAM,aAAa;;AAEnH;AACA,iDAAiD,kCAAkC,OAAO;;AAE1F,yGAAyG,cAAc,UAAU,gGAAgG,kBAAkB,UAAU,UAAU;;AAEvQ;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;AACtC;;AAEA;;AAEA,gBAAgB;AAChB,WAAW;AACX,YAAY;AACZ,GAAG;AACH;;;;;;;;;;;ACpzCa;;AAEb,IAAI,KAAqC,EAAE,EAE1C,CAAC;AACF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;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;ACNsD;AACZ;AACH;AACb;AACA;;AAE1B;AACAS,oEAAiB,CAAE,uBAAuB,EAAE;EAC3CE,UAAU;EACVC,IAAI;EACJzE,IAAI,EAAEuE,wDAAM;EACZvB,IAAIA,+CAAAA;AACL,CAAE,CAAC,C","sources":["webpack://wordpress-activitypub/./node_modules/@wordpress/icons/build-module/library/people.js","webpack://wordpress-activitypub/./node_modules/react/cjs/react-jsx-runtime.development.js","webpack://wordpress-activitypub/./node_modules/react/jsx-runtime.js","webpack://wordpress-activitypub/./src/follow-me/deprecation.js","webpack://wordpress-activitypub/./src/follow-me/edit.js","webpack://wordpress-activitypub/./src/follow-me/save.js","webpack://wordpress-activitypub/./src/shared/inherit-block-fallback.js","webpack://wordpress-activitypub/./src/shared/use-options.js","webpack://wordpress-activitypub/./src/shared/use-user-options.js","webpack://wordpress-activitypub/external window [\"wp\",\"apiFetch\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blockEditor\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blocks\"]","webpack://wordpress-activitypub/external window [\"wp\",\"components\"]","webpack://wordpress-activitypub/external window [\"wp\",\"coreData\"]","webpack://wordpress-activitypub/external window [\"wp\",\"data\"]","webpack://wordpress-activitypub/external window [\"wp\",\"element\"]","webpack://wordpress-activitypub/external window [\"wp\",\"i18n\"]","webpack://wordpress-activitypub/external window [\"wp\",\"primitives\"]","webpack://wordpress-activitypub/external window \"React\"","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/compat get default export","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/./src/follow-me/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst people = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z\",\n fillRule: \"evenodd\"\n })\n});\nexport default people;\n//# sourceMappingURL=people.js.map","/**\n * @license React\n * react-jsx-runtime.development.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\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'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 { createBlock } from '@wordpress/blocks';\n\n/**\n * Deprecation for the Follow Me block to use a core button block instead of the custom button.\n * This handles the migration of the buttonText and buttonSize attributes to the innerBlock.\n */\nconst v1 = {\n\tattributes: {\n\t\tbuttonText: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'Follow',\n\t\t},\n\t\tbuttonSize: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'default',\n\t\t\tenum: [ 'small', 'default', 'compact' ],\n\t\t},\n\t},\n\n\tisEligible( attributes ) {\n\t\t// Run migration if buttonText attribute exists.\n\t\treturn !! attributes.buttonText;\n\t},\n\n\tmigrate( attributes ) {\n\t\tconst { buttonText, buttonSize, ...newAttributes } = attributes;\n\n\t\t// Map buttonSize to core/button className.\n\t\tlet className = '';\n\t\tif ( buttonSize === 'small' ) {\n\t\t\tclassName = 'is-small';\n\t\t} else if ( buttonSize === 'compact' ) {\n\t\t\tclassName = 'is-compact';\n\t\t}\n\n\t\t// Create a core button block with the buttonText and buttonSize.\n\t\tconst buttonBlock = createBlock( 'core/button', {\n\t\t\tclassName,\n\t\t\ttagName: 'button',\n\t\t\ttext: buttonText,\n\t\t} );\n\n\t\treturn [ newAttributes, [ buttonBlock ] ];\n\t},\n};\n\nexport default [ v1 ];\n","import apiFetch from '@wordpress/api-fetch';\nimport { InspectorControls, useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { SelectControl, PanelBody, ToggleControl } from '@wordpress/components';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useUserOptions } from '../shared/use-user-options';\nimport { InheritModeBlockFallback } from '../shared/inherit-block-fallback';\nimport { useOptions } from '../shared/use-options';\n\n/**\n * Default profile data.\n *\n * @type {Object}\n */\nconst DEFAULT_PROFILE_DATA = {\n\tavatar: 'https://secure.gravatar.com/avatar/default?s=120',\n\twebfinger: '@well@hello.dolly',\n\tname: __( 'Hello Dolly Fan Account', 'activitypub' ),\n\turl: '#',\n};\n\n/**\n * Get normalized profile data.\n *\n * @param {Object} profile Profile data.\n * @return {Object} Normalized profile data.\n */\nfunction getNormalizedProfile( profile ) {\n\tif ( ! profile ) {\n\t\treturn DEFAULT_PROFILE_DATA;\n\t}\n\n\tconst data = { ...DEFAULT_PROFILE_DATA, ...profile };\n\tdata.avatar = data?.icon?.url;\n\n\t// Ensure webfinger always has the @ prefix.\n\tif ( data.webfinger && ! data.webfinger.startsWith( '@' ) ) {\n\t\tdata.webfinger = '@' + data.webfinger;\n\t}\n\n\treturn data;\n}\n\n/**\n * Fetch profile data.\n *\n * @param {number} userId User ID.\n * @return {Promise} Promise resolving with profile data.\n */\nfunction fetchProfile( userId ) {\n\tconst { namespace } = useOptions();\n\tconst fetchOptions = {\n\t\theaders: { Accept: 'application/activity+json' },\n\t\tpath: `/${ namespace }/actors/${ userId }`,\n\t};\n\treturn apiFetch( fetchOptions );\n}\n\n/**\n * Profile component for the editor.\n *\n * @param {Object} props Component props.\n * @return {JSX.Element} Profile component.\n */\nfunction EditorProfile( { profile, buttonOnly, innerBlocksProps } ) {\n\tconst { webfinger, avatar, name } = profile;\n\n\tif ( buttonOnly ) {\n\t\treturn (\n\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\treturn (\n\t\t
\n\t\t\t{\n\t\t\t
\n\t\t\t\t
{ name }
\n\t\t\t\t
\n\t\t\t\t\t{ webfinger }\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t
\n\t);\n}\n\n/**\n * Edit component.\n *\n * @param {Object} props Component props.\n * @param {Object} props.attributes Block attributes.\n * @param {Function} props.setAttributes Set block attributes.\n * @param {Object} props.context Block context.\n * @param {string} props.context.postType Post type.\n * @param {number} props.context.postId Post ID.\n * @return {JSX.Element} Edit component.\n */\nexport default function Edit( { attributes, setAttributes, context: { postType, postId } } ) {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'activitypub-follow-me-block-wrapper',\n\t} );\n\tconst usersOptions = useUserOptions( { withInherit: true } );\n\tconst { selectedUser, buttonOnly } = attributes;\n\tconst isInheritMode = selectedUser === 'inherit';\n\tconst [ profile, setProfile ] = useState( getNormalizedProfile( DEFAULT_PROFILE_DATA ) );\n\tconst userId = selectedUser === 'site' ? 0 : selectedUser;\n\n\tconst TEMPLATE = [ [ 'core/button', { text: __( 'Follow', 'activitypub' ), tagName: 'button' } ] ];\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{},\n\t\t{\n\t\t\tallowedBlocks: [ 'core/button' ],\n\t\t\ttemplate: TEMPLATE,\n\t\t\ttemplateLock: false,\n\t\t\trenderAppender: false,\n\t\t}\n\t);\n\n\tconst authorId = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord( 'postType', postType, postId )?.author;\n\n\t\t\treturn _authorId ?? null;\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tuseEffect( () => {\n\t\t// Fetch profile data when userId changes.\n\t\tif ( isInheritMode && ! authorId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst effectiveUserId = isInheritMode ? authorId : userId;\n\t\tfetchProfile( effectiveUserId ).then( ( data ) => {\n\t\t\tsetProfile( getNormalizedProfile( data ) );\n\t\t} );\n\t}, [ userId, authorId, isInheritMode ] );\n\n\tuseEffect( () => {\n\t\t// If there are no users yet, do nothing.\n\t\tif ( ! usersOptions.length ) {\n\t\t\treturn;\n\t\t}\n\t\t// Ensure that the selected user is in the list of options, if not, select the first available user.\n\t\tif ( ! usersOptions.find( ( { value } ) => value === selectedUser ) ) {\n\t\t\tsetAttributes( { selectedUser: usersOptions[ 0 ].value } );\n\t\t}\n\t}, [ selectedUser, usersOptions ] );\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{ usersOptions.length > 1 && (\n\t\t\t\t\t\t setAttributes( { selectedUser: value } ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t setAttributes( { buttonOnly: value } ) }\n\t\t\t\t\t\thelp={ __( 'Only show the follow button without profile information', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\n\t\t\t{ isInheritMode && ! authorId ? (\n\t\t\t\t\n\t\t\t) : (\n\t\t\t\t\n\t\t\t) }\n\t\t
\n\t);\n}\n","import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\n\n/**\n * Save component for the Follow Me block.\n *\n * This component ensures that inner blocks (the button) are properly saved.\n *\n * @return {JSX.Element|null} Save component.\n */\nfunction save() {\n\tconst blockProps = useBlockProps.save();\n\tconst innerBlocksProps = useInnerBlocksProps.save( blockProps );\n\n\treturn
;\n}\n\nexport default save;\n","import { Card, CardBody } from '@wordpress/components';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\n/**\n * Block fallback component for inheriting user context in ActivityPub blocks.\n *\n * @param {Object} props\n * @param {string} props.name - Name of the block.\n * @returns {JSX.Element} Rendered fallback block.\n */\nexport function InheritModeBlockFallback( { name } ) {\n\tconst { enabled } = useOptions();\n\tconst nonAuthorExtra = enabled?.site ? '' : __( 'It will be empty in other non-author contexts.', 'activitypub' );\n\tconst text = sprintf(\n\t\t/* translators: %1$s: block name, %2$s: extra information for non-author context */\n\t\t__(\n\t\t\t'This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s',\n\t\t\t'activitypub'\n\t\t),\n\t\tname,\n\t\tnonAuthorExtra\n\t).trim();\n\n\treturn (\n\t\t\n\t\t\t{ createInterpolateElement( text, { strong: } ) }\n\t\t\n\t);\n}\n","/**\n * React hook to return the ActivityPub options object from the global window.\n *\n * @returns {Object} The options object.\n */\nexport function useOptions() {\n\treturn window._activityPubOptions || {};\n}\n","import { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\n/**\n * React hook providing user options for ActivityPub blocks.\n *\n * @param {Object} params\n * @param {boolean} params.withInherit - Whether to include the inherit option.\n * @returns {Array} List of user option objects.\n */\nexport function useUserOptions( { withInherit = false } ) {\n\tconst { enabled } = useOptions();\n\tconst users = enabled?.users ? useSelect( ( select ) => select( 'core' ).getUsers( { who: 'authors' } ) ) : [];\n\n\t/**\n\t * Memoized computation of user options for block settings.\n\t */\n\treturn useMemo( () => {\n\t\tif ( ! users ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst userKeywords = [];\n\n\t\tif ( enabled?.site ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Site', 'activitypub' ),\n\t\t\t\tvalue: 'site',\n\t\t\t} );\n\t\t}\n\n\t\t// Only show the inherit option when explicitly asked for and users are enabled.\n\t\tif ( withInherit && enabled?.users ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Dynamic User', 'activitypub' ),\n\t\t\t\tvalue: 'inherit',\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Reduce users into keyword/value pairs for options.\n\t\t */\n\t\treturn users.reduce( ( acc, user ) => {\n\t\t\tacc.push( {\n\t\t\t\tlabel: user.name,\n\t\t\t\tvalue: `${ user.id }`, // Casting to string because that's how Gutenberg stores the attribute.\n\t\t\t} );\n\t\t\treturn acc;\n\t\t}, userKeywords );\n\t}, [ users ] );\n}\n","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"React\"];","// 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\t// no module.id needed\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport { people } from '@wordpress/icons';\nimport deprecated from './deprecation';\nimport edit from './edit';\nimport save from './save';\n\n// Register the block.\nregisterBlockType( 'activitypub/follow-me', {\n\tdeprecated,\n\tedit,\n\ticon: people,\n\tsave,\n} );\n"],"names":["createBlock","v1","attributes","buttonText","type","default","buttonSize","enum","isEligible","migrate","newAttributes","className","buttonBlock","tagName","text","apiFetch","InspectorControls","useBlockProps","useInnerBlocksProps","__","useSelect","store","coreStore","SelectControl","PanelBody","ToggleControl","useEffect","useState","useUserOptions","InheritModeBlockFallback","useOptions","DEFAULT_PROFILE_DATA","avatar","webfinger","name","url","getNormalizedProfile","profile","data","icon","startsWith","fetchProfile","userId","namespace","fetchOptions","headers","Accept","path","EditorProfile","buttonOnly","innerBlocksProps","createElement","src","alt","title","Edit","setAttributes","context","postType","postId","blockProps","usersOptions","withInherit","selectedUser","isInheritMode","setProfile","TEMPLATE","allowedBlocks","template","templateLock","renderAppender","authorId","select","getEditedEntityRecord","_authorId","author","effectiveUserId","then","length","find","value","key","label","options","onChange","checked","help","save","Card","CardBody","sprintf","createInterpolateElement","enabled","nonAuthorExtra","site","trim","strong","window","_activityPubOptions","useMemo","users","getUsers","who","userKeywords","push","reduce","acc","user","id","registerBlockType","people","deprecated","edit"],"sourceRoot":""} \ No newline at end of file diff --git a/build/follow-me/style-view.css b/build/follow-me/style-view.css index ea68d90ec..e4f9cc190 100644 --- a/build/follow-me/style-view.css +++ b/build/follow-me/style-view.css @@ -1 +1 @@ -.activitypub-follow-me-block-wrapper{display:block;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{align-items:center;display:flex;padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1rem;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{flex:1;margin-right:1rem;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle{color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button{flex-shrink:0;margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button:not(:only-child){margin-left:1rem}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8rem;padding:.25rem .5rem}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9rem;padding:.4rem .8rem}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border .activitypub-profile{padding-left:1rem;padding-right:1rem}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:#fff;border-radius:4px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.activitypub-modal__header{align-items:center;border-bottom:1px solid #e2e4e7;display:flex;flex-shrink:0;justify-content:space-between;padding:1rem 1rem 1rem 1.5rem}.activitypub-modal__title{font-size:1.3rem;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__close{align-items:center;background:none;border:none;color:#555;cursor:pointer;display:flex;justify-content:center;padding:.5rem}.activitypub-modal__close:hover{background:none;color:#000}.activitypub-modal__close:active{background:none;border:none;color:#000;padding:.5rem}.activitypub-modal__content{overflow-y:auto}.activitypub-dialog__section{border-bottom:1px solid #f0f0f0;padding:1rem 1.5rem}.activitypub-dialog__section:last-child{border-bottom:none}.activitypub-dialog__section h4{font-size:1.1rem;margin-bottom:.5rem;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:.95rem;margin-bottom:1rem}.activitypub-dialog__description code{background:#f0f0f0;border-radius:3px;font-size:.9rem;padding:.1rem .3rem}.activitypub-dialog__button-group{display:flex;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input{border:1px solid #ddd;border-radius:4px 0 0 4px;flex:1;font-size:1rem;margin:0}.activitypub-dialog__button-group input[aria-invalid=true]{border-color:#cc1818}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important}.activitypub-dialog__error{color:#cc1818;font-size:.9rem;margin-top:.5rem}body.modal-open{overflow:hidden}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}} +.activitypub-follow-me-block-wrapper{display:block;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{align-items:center;display:flex;padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1rem;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{flex:1;margin-right:1rem;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle{color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button{flex-shrink:0;margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button:not(:only-child){margin-left:1rem}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8rem;padding:.25rem .5rem}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9rem;padding:.4rem .8rem}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border .activitypub-profile{padding-left:1rem;padding-right:1rem}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:#fff;border-radius:4px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.activitypub-modal__header{align-items:center;border-bottom:1px solid #e2e4e7;display:flex;flex-shrink:0;justify-content:space-between;padding:1rem 1rem 1rem 1.5rem}.activitypub-modal__title{font-size:1.3rem;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__close{align-items:center;background:none;border:none;color:#555;cursor:pointer;display:flex;justify-content:center;padding:.5rem}.activitypub-modal__close:hover{background:none;color:#000}.activitypub-modal__close:active{background:none;border:none;color:#000;padding:.5rem}.activitypub-modal__content{overflow-y:auto}.activitypub-dialog__section{border-bottom:1px solid #f0f0f0;padding:1rem 1.5rem}.activitypub-dialog__section:last-child{border-bottom:none}.activitypub-dialog__section h4{font-size:1.1rem;margin-bottom:.5rem;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:.95rem;margin-bottom:1rem}.activitypub-dialog__description code{background:#f0f0f0;border-radius:3px;font-size:.9rem;padding:.1rem .3rem}.activitypub-dialog__button-group{display:flex;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input{border:1px solid #ddd;border-radius:4px 0 0 4px;flex:1;font-size:1rem;margin:0}.activitypub-dialog__button-group input[aria-invalid=true]{border-color:#cc1818}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important}.activitypub-dialog__error{color:#cc1818;font-size:.9rem;margin-top:.5rem}body.modal-open{overflow:hidden}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}} diff --git a/build/follow-me/style-view.css.map b/build/follow-me/style-view.css.map index b90b66458..a4d401d3f 100644 --- a/build/follow-me/style-view.css.map +++ b/build/follow-me/style-view.css.map @@ -1 +1 @@ -{"version":3,"file":"follow-me/style-view.css","mappings":";;;AAAA;EACC;EACA;AACD;;AAGC;EACC;EACA;EACA;AAAF;AAEE;EACC;EACA;EACA;EACA;EACA;KAAA;AAAH;AAGE;EACC;EACA;EACA;AADH;AAIE;EACC;EACA;EACA;EACA;AAFH;AAKE;EACC;EACA;EACA;EACA;AAHH;AAME;EACC;EACA;AAJH;AAMG;EACC;AAJJ;AAQE;EACC;AANH;AASE;EACC;EACA;AAPH;AAUE;EACC;EACA;AARH;AAYC;EAEC;EACA;AAXF;;AAgBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAbF;AAeE;EACC;AAbH;AAiBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAfF;AAkBC;EACC;EACA;EACA;EACA;EACA;EACA;AAhBF;AAmBC;EACC;EACA;EACA;EACA;AAjBF;AAoBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAlBF;AAoBE;EACC;EACA;AAlBH;AAqBE;EACC;EACA;EACA;EACA;AAnBH;AAuBC;EACC;AArBF;;AA0BC;EACC;EACA;AAvBF;AAyBE;EACC;AAvBH;AA0BE;EACC;EACA;EACA;AAxBH;AA4BC;EACC;EACA;EACA;AA1BF;AA4BE;EACC;EACA;EACA;EACA;AA1BH;AA8BC;EACC;EACA;EACA;AA5BF;AA8BE;EACC;EACA;EACA;EACA;EACA;AA5BH;AA8BG;EACC;AA5BJ;AAgCE;EACC;EACA;AA9BH;AAkCC;EACC;EACA;EACA;AAhCF;;AAoCA;EACC;AAjCD;;AAoCA;AACA;EACC;IACC;IACA;EAjCA;EAmCD;IACC;IACA;EAjCA;AACF,C","sources":["webpack://wordpress-activitypub/./src/follow-me/style.scss"],"sourcesContent":[".activitypub-follow-me-block-wrapper {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.activitypub-follow-me-block-wrapper {\n\t.activitypub-profile {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tpadding: 1rem 0;\n\n\t\t&__avatar {\n\t\t\twidth: 75px;\n\t\t\theight: 75px;\n\t\t\tborder-radius: 50%;\n\t\t\tmargin-right: 1rem;\n\t\t\tobject-fit: cover;\n\t\t}\n\n\t\t&__content {\n\t\t\tflex: 1;\n\t\t\tmargin-right: 1rem;\n\t\t\tmin-width: 0;\n\t\t}\n\n\t\t&__name {\n\t\t\tfont-size: 1.25rem;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t&__handle {\n\t\t\tcolor: inherit;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t.wp-block-button {\n\t\t\tflex-shrink: 0;\n\t\t\tmargin: 0;\n\n\t\t\t&:not(:only-child) {\n\t\t\t\tmargin-left: 1rem;\n\t\t\t}\n\t\t}\n\n\t\t.wp-block-button__link {\n\t\t\tmargin: 0;\n\t\t}\n\n\t\t.is-small {\n\t\t\tpadding: 0.25rem 0.5rem;\n\t\t\tfont-size: 0.8rem;\n\t\t}\n\n\t\t.is-compact {\n\t\t\tpadding: 0.4rem 0.8rem;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t}\n\n\t&.has-background .activitypub-profile,\n\t&.has-border .activitypub-profile {\n\t\tpadding-left: 1rem;\n\t\tpadding-right: 1rem;\n\t}\n}\n\n.activitypub-modal {\n\t&__overlay {\n\t\tposition: fixed;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tbackground-color: rgba(0, 0, 0, 0.5);\n\t\tz-index: 100000;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tpadding: 1rem;\n\n\t\t&[hidden] {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&__frame {\n\t\tmax-width: 660px;\n\t\twidth: 100%;\n\t\tbackground-color: #fff;\n\t\tborder-radius: 4px;\n\t\tbox-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);\n\t\toverflow: hidden;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmax-height: calc(100vh - 2rem);\n\t\tanimation: activitypub-modal-appear 0.2s ease-out;\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\tpadding: 1rem 1rem 1rem 1.5rem;\n\t\tborder-bottom: 1px solid #e2e4e7;\n\t\tflex-shrink: 0;\n\t}\n\n\t&__title {\n\t\tmargin: 0 !important;\n\t\tfont-size: 1.3rem;\n\t\tfont-weight: 600;\n\t\tline-height: 1.4;\n\t}\n\n\t&__close {\n\t\tbackground: none;\n\t\tborder: none;\n\t\tpadding: 0.5rem;\n\t\tcursor: pointer;\n\t\tcolor: #555;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t&:hover {\n\t\t\tbackground: none;\n\t\t\tcolor: #000;\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #000;\n\t\t\tpadding: 0.5rem;\n\t\t}\n\t}\n\n\t&__content {\n\t\toverflow-y: auto;\n\t}\n}\n\n.activitypub-dialog {\n\t&__section {\n\t\tpadding: 1rem 1.5rem;\n\t\tborder-bottom: 1px solid #f0f0f0;\n\n\t\t&:last-child {\n\t\t\tborder-bottom: none;\n\t\t}\n\n\t\th4 {\n\t\t\tmargin-top: 0;\n\t\t\tmargin-bottom: 0.5rem;\n\t\t\tfont-size: 1.1rem;\n\t\t}\n\t}\n\n\t&__description {\n\t\tmargin-bottom: 1rem;\n\t\tcolor: inherit;\n\t\tfont-size: 0.95rem;\n\n\t\tcode {\n\t\t\tbackground: #f0f0f0;\n\t\t\tpadding: 0.1rem 0.3rem;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t}\n\n\t&__button-group {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\tmargin-bottom: 0.5rem;\n\n\t\tinput {\n\t\t\tflex: 1;\n\t\t\tborder: 1px solid #ddd;\n\t\t\tborder-radius: 4px 0 0 4px;\n\t\t\tfont-size: 1rem;\n\t\t\tmargin: 0;\n\n\t\t\t&[aria-invalid=\"true\"] {\n\t\t\t\tborder-color: #cc1818;\n\t\t\t}\n\t\t}\n\n\t\tbutton {\n\t\t\tborder-radius: 0 4px 4px 0 !important;\n\t\t\tmargin-left: -1px !important;\n\t\t}\n\t}\n\n\t&__error {\n\t\tcolor: #cc1818;\n\t\tfont-size: 0.9rem;\n\t\tmargin-top: 0.5rem;\n\t}\n}\n\nbody.modal-open {\n\toverflow: hidden;\n}\n\n/* Animation for modal */\n@keyframes activitypub-modal-appear {\n\tfrom {\n\t\topacity: 0;\n\t\ttransform: translateY(20px);\n\t}\n\tto {\n\t\topacity: 1;\n\t\ttransform: translateY(0);\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"follow-me/style-view.css","mappings":";;;AAAA;EACC;EACA;AACD;;AAGC;EACC;EACA;EACA;AAAF;AAEE;EACC;EACA;EACA;EACA;EACA;KAAA;AAAH;AAGE;EACC;EACA;EACA;AADH;AAIE;EACC;EACA;EACA;EACA;AAFH;AAKE;EACC;EACA;EACA;EACA;AAHH;AAME;EACC;EACA;AAJH;AAMG;EACC;AAJJ;AAQE;EACC;AANH;AASE;EACC;EACA;AAPH;AAUE;EACC;EACA;AARH;AAYC;EAEC;EACA;AAXF;;AAgBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAbF;AAeE;EACC;AAbH;AAiBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAfF;AAkBC;EACC;EACA;EACA;EACA;EACA;EACA;AAhBF;AAmBC;EACC;EACA;EACA;EACA;AAjBF;AAoBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAlBF;AAoBE;EACC;EACA;AAlBH;AAqBE;EACC;EACA;EACA;EACA;AAnBH;AAuBC;EACC;AArBF;;AA0BC;EACC;EACA;AAvBF;AAyBE;EACC;AAvBH;AA0BE;EACC;EACA;EACA;AAxBH;AA4BC;EACC;EACA;EACA;AA1BF;AA4BE;EACC;EACA;EACA;EACA;AA1BH;AA8BC;EACC;EACA;EACA;AA5BF;AA8BE;EACC;EACA;EACA;EACA;EACA;AA5BH;AA8BG;EACC;AA5BJ;AAgCE;EACC;EACA;AA9BH;AAkCC;EACC;EACA;EACA;AAhCF;;AAoCA;EACC;AAjCD;;AAoCA;AACA;EACC;IACC;IACA;EAjCA;EAmCD;IACC;IACA;EAjCA;AACF,C","sources":["webpack://wordpress-activitypub/./src/follow-me/style.scss"],"sourcesContent":[".activitypub-follow-me-block-wrapper {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.activitypub-follow-me-block-wrapper {\n\t.activitypub-profile {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tpadding: 1rem 0;\n\n\t\t&__avatar {\n\t\t\twidth: 75px;\n\t\t\theight: 75px;\n\t\t\tborder-radius: 50%;\n\t\t\tmargin-right: 1rem;\n\t\t\tobject-fit: cover;\n\t\t}\n\n\t\t&__content {\n\t\t\tflex: 1;\n\t\t\tmargin-right: 1rem;\n\t\t\tmin-width: 0;\n\t\t}\n\n\t\t&__name {\n\t\t\tfont-size: 1.25em;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t&__handle {\n\t\t\tcolor: inherit;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t.wp-block-button {\n\t\t\tflex-shrink: 0;\n\t\t\tmargin: 0;\n\n\t\t\t&:not(:only-child) {\n\t\t\t\tmargin-left: 1rem;\n\t\t\t}\n\t\t}\n\n\t\t.wp-block-button__link {\n\t\t\tmargin: 0;\n\t\t}\n\n\t\t.is-small {\n\t\t\tpadding: 0.25rem 0.5rem;\n\t\t\tfont-size: 0.8rem;\n\t\t}\n\n\t\t.is-compact {\n\t\t\tpadding: 0.4rem 0.8rem;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t}\n\n\t&.has-background .activitypub-profile,\n\t&.has-border .activitypub-profile {\n\t\tpadding-left: 1rem;\n\t\tpadding-right: 1rem;\n\t}\n}\n\n.activitypub-modal {\n\t&__overlay {\n\t\tposition: fixed;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tbackground-color: rgba(0, 0, 0, 0.5);\n\t\tz-index: 100000;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tpadding: 1rem;\n\n\t\t&[hidden] {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&__frame {\n\t\tmax-width: 660px;\n\t\twidth: 100%;\n\t\tbackground-color: #fff;\n\t\tborder-radius: 4px;\n\t\tbox-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);\n\t\toverflow: hidden;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmax-height: calc(100vh - 2rem);\n\t\tanimation: activitypub-modal-appear 0.2s ease-out;\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\tpadding: 1rem 1rem 1rem 1.5rem;\n\t\tborder-bottom: 1px solid #e2e4e7;\n\t\tflex-shrink: 0;\n\t}\n\n\t&__title {\n\t\tmargin: 0 !important;\n\t\tfont-size: 1.3rem;\n\t\tfont-weight: 600;\n\t\tline-height: 1.4;\n\t}\n\n\t&__close {\n\t\tbackground: none;\n\t\tborder: none;\n\t\tpadding: 0.5rem;\n\t\tcursor: pointer;\n\t\tcolor: #555;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t&:hover {\n\t\t\tbackground: none;\n\t\t\tcolor: #000;\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #000;\n\t\t\tpadding: 0.5rem;\n\t\t}\n\t}\n\n\t&__content {\n\t\toverflow-y: auto;\n\t}\n}\n\n.activitypub-dialog {\n\t&__section {\n\t\tpadding: 1rem 1.5rem;\n\t\tborder-bottom: 1px solid #f0f0f0;\n\n\t\t&:last-child {\n\t\t\tborder-bottom: none;\n\t\t}\n\n\t\th4 {\n\t\t\tmargin-top: 0;\n\t\t\tmargin-bottom: 0.5rem;\n\t\t\tfont-size: 1.1rem;\n\t\t}\n\t}\n\n\t&__description {\n\t\tmargin-bottom: 1rem;\n\t\tcolor: inherit;\n\t\tfont-size: 0.95rem;\n\n\t\tcode {\n\t\t\tbackground: #f0f0f0;\n\t\t\tpadding: 0.1rem 0.3rem;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t}\n\n\t&__button-group {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\tmargin-bottom: 0.5rem;\n\n\t\tinput {\n\t\t\tflex: 1;\n\t\t\tborder: 1px solid #ddd;\n\t\t\tborder-radius: 4px 0 0 4px;\n\t\t\tfont-size: 1rem;\n\t\t\tmargin: 0;\n\n\t\t\t&[aria-invalid=\"true\"] {\n\t\t\t\tborder-color: #cc1818;\n\t\t\t}\n\t\t}\n\n\t\tbutton {\n\t\t\tborder-radius: 0 4px 4px 0 !important;\n\t\t\tmargin-left: -1px !important;\n\t\t}\n\t}\n\n\t&__error {\n\t\tcolor: #cc1818;\n\t\tfont-size: 0.9rem;\n\t\tmargin-top: 0.5rem;\n\t}\n}\n\nbody.modal-open {\n\toverflow: hidden;\n}\n\n/* Animation for modal */\n@keyframes activitypub-modal-appear {\n\tfrom {\n\t\topacity: 0;\n\t\ttransform: translateY(20px);\n\t}\n\tto {\n\t\topacity: 1;\n\t\ttransform: translateY(0);\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/src/follow-me/style.scss b/src/follow-me/style.scss index 1c61a7ad0..24d4b84ff 100644 --- a/src/follow-me/style.scss +++ b/src/follow-me/style.scss @@ -24,7 +24,7 @@ } &__name { - font-size: 1.25rem; + font-size: 1.25em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; From 994af6e619db2d36efcf8d3aab5860a0e862058e Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Thu, 15 May 2025 13:19:54 -0500 Subject: [PATCH 25/47] More style updates --- build/follow-me/style-view.css | 2 +- build/follow-me/style-view.css.map | 2 +- build/follow-me/view.asset.php | 2 +- build/follow-me/view.js | 2 +- build/follow-me/view.js.map | 2 +- src/follow-me/button-style.js | 9 +++------ src/follow-me/style.scss | 5 ++++- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build/follow-me/style-view.css b/build/follow-me/style-view.css index e4f9cc190..7abf9b745 100644 --- a/build/follow-me/style-view.css +++ b/build/follow-me/style-view.css @@ -1 +1 @@ -.activitypub-follow-me-block-wrapper{display:block;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{align-items:center;display:flex;padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1rem;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{flex:1;margin-right:1rem;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle{color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button{flex-shrink:0;margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button:not(:only-child){margin-left:1rem}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8rem;padding:.25rem .5rem}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9rem;padding:.4rem .8rem}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border .activitypub-profile{padding-left:1rem;padding-right:1rem}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:#fff;border-radius:4px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.activitypub-modal__header{align-items:center;border-bottom:1px solid #e2e4e7;display:flex;flex-shrink:0;justify-content:space-between;padding:1rem 1rem 1rem 1.5rem}.activitypub-modal__title{font-size:1.3rem;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__close{align-items:center;background:none;border:none;color:#555;cursor:pointer;display:flex;justify-content:center;padding:.5rem}.activitypub-modal__close:hover{background:none;color:#000}.activitypub-modal__close:active{background:none;border:none;color:#000;padding:.5rem}.activitypub-modal__content{overflow-y:auto}.activitypub-dialog__section{border-bottom:1px solid #f0f0f0;padding:1rem 1.5rem}.activitypub-dialog__section:last-child{border-bottom:none}.activitypub-dialog__section h4{font-size:1.1rem;margin-bottom:.5rem;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:.95rem;margin-bottom:1rem}.activitypub-dialog__description code{background:#f0f0f0;border-radius:3px;font-size:.9rem;padding:.1rem .3rem}.activitypub-dialog__button-group{display:flex;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input{border:1px solid #ddd;border-radius:4px 0 0 4px;flex:1;font-size:1rem;margin:0}.activitypub-dialog__button-group input[aria-invalid=true]{border-color:#cc1818}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important}.activitypub-dialog__error{color:#cc1818;font-size:.9rem;margin-top:.5rem}body.modal-open{overflow:hidden}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}} +.activitypub-follow-me-block-wrapper{display:block;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{align-items:center;display:flex;padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1rem;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{flex:1;margin-right:1rem;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle{color:inherit;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button{align-items:center;display:flex;margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button:not(:only-child){flex:.5;margin-left:1rem}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8rem;padding:.25rem .5rem}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9rem;padding:.4rem .8rem}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border .activitypub-profile{padding-left:1rem;padding-right:1rem}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:#fff;border-radius:4px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.activitypub-modal__header{align-items:center;border-bottom:1px solid #e2e4e7;display:flex;flex-shrink:0;justify-content:space-between;padding:1rem 1rem 1rem 1.5rem}.activitypub-modal__title{font-size:1.3rem;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__close{align-items:center;background:none;border:none;color:#555;cursor:pointer;display:flex;justify-content:center;padding:.5rem}.activitypub-modal__close:hover{background:none;color:#000}.activitypub-modal__close:active{background:none;border:none;color:#000;padding:.5rem}.activitypub-modal__content{overflow-y:auto}.activitypub-dialog__section{border-bottom:1px solid #f0f0f0;padding:1rem 1.5rem}.activitypub-dialog__section:last-child{border-bottom:none}.activitypub-dialog__section h4{font-size:1.1rem;margin-bottom:.5rem;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:.95rem;margin-bottom:1rem}.activitypub-dialog__description code{background:#f0f0f0;border-radius:3px;font-size:.9rem;padding:.1rem .3rem}.activitypub-dialog__button-group{display:flex;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input{border:1px solid #ddd;border-radius:4px 0 0 4px;flex:1;font-size:1rem;margin:0}.activitypub-dialog__button-group input[aria-invalid=true]{border-color:#cc1818}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important}.activitypub-dialog__error{color:#cc1818;font-size:.9rem;margin-top:.5rem}body.modal-open{overflow:hidden}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}} diff --git a/build/follow-me/style-view.css.map b/build/follow-me/style-view.css.map index a4d401d3f..730664b5c 100644 --- a/build/follow-me/style-view.css.map +++ b/build/follow-me/style-view.css.map @@ -1 +1 @@ -{"version":3,"file":"follow-me/style-view.css","mappings":";;;AAAA;EACC;EACA;AACD;;AAGC;EACC;EACA;EACA;AAAF;AAEE;EACC;EACA;EACA;EACA;EACA;KAAA;AAAH;AAGE;EACC;EACA;EACA;AADH;AAIE;EACC;EACA;EACA;EACA;AAFH;AAKE;EACC;EACA;EACA;EACA;AAHH;AAME;EACC;EACA;AAJH;AAMG;EACC;AAJJ;AAQE;EACC;AANH;AASE;EACC;EACA;AAPH;AAUE;EACC;EACA;AARH;AAYC;EAEC;EACA;AAXF;;AAgBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAbF;AAeE;EACC;AAbH;AAiBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAfF;AAkBC;EACC;EACA;EACA;EACA;EACA;EACA;AAhBF;AAmBC;EACC;EACA;EACA;EACA;AAjBF;AAoBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAlBF;AAoBE;EACC;EACA;AAlBH;AAqBE;EACC;EACA;EACA;EACA;AAnBH;AAuBC;EACC;AArBF;;AA0BC;EACC;EACA;AAvBF;AAyBE;EACC;AAvBH;AA0BE;EACC;EACA;EACA;AAxBH;AA4BC;EACC;EACA;EACA;AA1BF;AA4BE;EACC;EACA;EACA;EACA;AA1BH;AA8BC;EACC;EACA;EACA;AA5BF;AA8BE;EACC;EACA;EACA;EACA;EACA;AA5BH;AA8BG;EACC;AA5BJ;AAgCE;EACC;EACA;AA9BH;AAkCC;EACC;EACA;EACA;AAhCF;;AAoCA;EACC;AAjCD;;AAoCA;AACA;EACC;IACC;IACA;EAjCA;EAmCD;IACC;IACA;EAjCA;AACF,C","sources":["webpack://wordpress-activitypub/./src/follow-me/style.scss"],"sourcesContent":[".activitypub-follow-me-block-wrapper {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.activitypub-follow-me-block-wrapper {\n\t.activitypub-profile {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tpadding: 1rem 0;\n\n\t\t&__avatar {\n\t\t\twidth: 75px;\n\t\t\theight: 75px;\n\t\t\tborder-radius: 50%;\n\t\t\tmargin-right: 1rem;\n\t\t\tobject-fit: cover;\n\t\t}\n\n\t\t&__content {\n\t\t\tflex: 1;\n\t\t\tmargin-right: 1rem;\n\t\t\tmin-width: 0;\n\t\t}\n\n\t\t&__name {\n\t\t\tfont-size: 1.25em;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t&__handle {\n\t\t\tcolor: inherit;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t.wp-block-button {\n\t\t\tflex-shrink: 0;\n\t\t\tmargin: 0;\n\n\t\t\t&:not(:only-child) {\n\t\t\t\tmargin-left: 1rem;\n\t\t\t}\n\t\t}\n\n\t\t.wp-block-button__link {\n\t\t\tmargin: 0;\n\t\t}\n\n\t\t.is-small {\n\t\t\tpadding: 0.25rem 0.5rem;\n\t\t\tfont-size: 0.8rem;\n\t\t}\n\n\t\t.is-compact {\n\t\t\tpadding: 0.4rem 0.8rem;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t}\n\n\t&.has-background .activitypub-profile,\n\t&.has-border .activitypub-profile {\n\t\tpadding-left: 1rem;\n\t\tpadding-right: 1rem;\n\t}\n}\n\n.activitypub-modal {\n\t&__overlay {\n\t\tposition: fixed;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tbackground-color: rgba(0, 0, 0, 0.5);\n\t\tz-index: 100000;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tpadding: 1rem;\n\n\t\t&[hidden] {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&__frame {\n\t\tmax-width: 660px;\n\t\twidth: 100%;\n\t\tbackground-color: #fff;\n\t\tborder-radius: 4px;\n\t\tbox-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);\n\t\toverflow: hidden;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmax-height: calc(100vh - 2rem);\n\t\tanimation: activitypub-modal-appear 0.2s ease-out;\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\tpadding: 1rem 1rem 1rem 1.5rem;\n\t\tborder-bottom: 1px solid #e2e4e7;\n\t\tflex-shrink: 0;\n\t}\n\n\t&__title {\n\t\tmargin: 0 !important;\n\t\tfont-size: 1.3rem;\n\t\tfont-weight: 600;\n\t\tline-height: 1.4;\n\t}\n\n\t&__close {\n\t\tbackground: none;\n\t\tborder: none;\n\t\tpadding: 0.5rem;\n\t\tcursor: pointer;\n\t\tcolor: #555;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t&:hover {\n\t\t\tbackground: none;\n\t\t\tcolor: #000;\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #000;\n\t\t\tpadding: 0.5rem;\n\t\t}\n\t}\n\n\t&__content {\n\t\toverflow-y: auto;\n\t}\n}\n\n.activitypub-dialog {\n\t&__section {\n\t\tpadding: 1rem 1.5rem;\n\t\tborder-bottom: 1px solid #f0f0f0;\n\n\t\t&:last-child {\n\t\t\tborder-bottom: none;\n\t\t}\n\n\t\th4 {\n\t\t\tmargin-top: 0;\n\t\t\tmargin-bottom: 0.5rem;\n\t\t\tfont-size: 1.1rem;\n\t\t}\n\t}\n\n\t&__description {\n\t\tmargin-bottom: 1rem;\n\t\tcolor: inherit;\n\t\tfont-size: 0.95rem;\n\n\t\tcode {\n\t\t\tbackground: #f0f0f0;\n\t\t\tpadding: 0.1rem 0.3rem;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t}\n\n\t&__button-group {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\tmargin-bottom: 0.5rem;\n\n\t\tinput {\n\t\t\tflex: 1;\n\t\t\tborder: 1px solid #ddd;\n\t\t\tborder-radius: 4px 0 0 4px;\n\t\t\tfont-size: 1rem;\n\t\t\tmargin: 0;\n\n\t\t\t&[aria-invalid=\"true\"] {\n\t\t\t\tborder-color: #cc1818;\n\t\t\t}\n\t\t}\n\n\t\tbutton {\n\t\t\tborder-radius: 0 4px 4px 0 !important;\n\t\t\tmargin-left: -1px !important;\n\t\t}\n\t}\n\n\t&__error {\n\t\tcolor: #cc1818;\n\t\tfont-size: 0.9rem;\n\t\tmargin-top: 0.5rem;\n\t}\n}\n\nbody.modal-open {\n\toverflow: hidden;\n}\n\n/* Animation for modal */\n@keyframes activitypub-modal-appear {\n\tfrom {\n\t\topacity: 0;\n\t\ttransform: translateY(20px);\n\t}\n\tto {\n\t\topacity: 1;\n\t\ttransform: translateY(0);\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"follow-me/style-view.css","mappings":";;;AAAA;EACC;EACA;AACD;;AAGC;EACC;EACA;EACA;AAAF;AAEE;EACC;EACA;EACA;EACA;EACA;KAAA;AAAH;AAGE;EACC;EACA;EACA;AADH;AAIE;EACC;EACA;EACA;EACA;AAFH;AAKE;EACC;EACA;EACA;EACA;EACA;AAHH;AAME;EACC;EACA;EACA;AAJH;AAMG;EACC;EACA;AAJJ;AAQE;EACC;AANH;AASE;EACC;EACA;AAPH;AAUE;EACC;EACA;AARH;AAYC;EAEC;EACA;AAXF;;AAgBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAbF;AAeE;EACC;AAbH;AAiBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAfF;AAkBC;EACC;EACA;EACA;EACA;EACA;EACA;AAhBF;AAmBC;EACC;EACA;EACA;EACA;AAjBF;AAoBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAlBF;AAoBE;EACC;EACA;AAlBH;AAqBE;EACC;EACA;EACA;EACA;AAnBH;AAuBC;EACC;AArBF;;AA0BC;EACC;EACA;AAvBF;AAyBE;EACC;AAvBH;AA0BE;EACC;EACA;EACA;AAxBH;AA4BC;EACC;EACA;EACA;AA1BF;AA4BE;EACC;EACA;EACA;EACA;AA1BH;AA8BC;EACC;EACA;EACA;AA5BF;AA8BE;EACC;EACA;EACA;EACA;EACA;AA5BH;AA8BG;EACC;AA5BJ;AAgCE;EACC;EACA;AA9BH;AAkCC;EACC;EACA;EACA;AAhCF;;AAoCA;EACC;AAjCD;;AAoCA;AACA;EACC;IACC;IACA;EAjCA;EAmCD;IACC;IACA;EAjCA;AACF,C","sources":["webpack://wordpress-activitypub/./src/follow-me/style.scss"],"sourcesContent":[".activitypub-follow-me-block-wrapper {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.activitypub-follow-me-block-wrapper {\n\t.activitypub-profile {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tpadding: 1rem 0;\n\n\t\t&__avatar {\n\t\t\twidth: 75px;\n\t\t\theight: 75px;\n\t\t\tborder-radius: 50%;\n\t\t\tmargin-right: 1rem;\n\t\t\tobject-fit: cover;\n\t\t}\n\n\t\t&__content {\n\t\t\tflex: 1;\n\t\t\tmargin-right: 1rem;\n\t\t\tmin-width: 0;\n\t\t}\n\n\t\t&__name {\n\t\t\tfont-size: 1.25em;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t&__handle {\n\t\t\tcolor: inherit;\n\t\t\tline-height: 1.2;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t.wp-block-button {\n\t\t\tmargin: 0;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\n\t\t\t&:not(:only-child) {\n\t\t\t\tflex: 0.5;\n\t\t\t\tmargin-left: 1rem;\n\t\t\t}\n\t\t}\n\n\t\t.wp-block-button__link {\n\t\t\tmargin: 0;\n\t\t}\n\n\t\t.is-small {\n\t\t\tpadding: 0.25rem 0.5rem;\n\t\t\tfont-size: 0.8rem;\n\t\t}\n\n\t\t.is-compact {\n\t\t\tpadding: 0.4rem 0.8rem;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t}\n\n\t&.has-background .activitypub-profile,\n\t&.has-border .activitypub-profile {\n\t\tpadding-left: 1rem;\n\t\tpadding-right: 1rem;\n\t}\n}\n\n.activitypub-modal {\n\t&__overlay {\n\t\tposition: fixed;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tbackground-color: rgba(0, 0, 0, 0.5);\n\t\tz-index: 100000;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tpadding: 1rem;\n\n\t\t&[hidden] {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&__frame {\n\t\tmax-width: 660px;\n\t\twidth: 100%;\n\t\tbackground-color: #fff;\n\t\tborder-radius: 4px;\n\t\tbox-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);\n\t\toverflow: hidden;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmax-height: calc(100vh - 2rem);\n\t\tanimation: activitypub-modal-appear 0.2s ease-out;\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\tpadding: 1rem 1rem 1rem 1.5rem;\n\t\tborder-bottom: 1px solid #e2e4e7;\n\t\tflex-shrink: 0;\n\t}\n\n\t&__title {\n\t\tmargin: 0 !important;\n\t\tfont-size: 1.3rem;\n\t\tfont-weight: 600;\n\t\tline-height: 1.4;\n\t}\n\n\t&__close {\n\t\tbackground: none;\n\t\tborder: none;\n\t\tpadding: 0.5rem;\n\t\tcursor: pointer;\n\t\tcolor: #555;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t&:hover {\n\t\t\tbackground: none;\n\t\t\tcolor: #000;\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #000;\n\t\t\tpadding: 0.5rem;\n\t\t}\n\t}\n\n\t&__content {\n\t\toverflow-y: auto;\n\t}\n}\n\n.activitypub-dialog {\n\t&__section {\n\t\tpadding: 1rem 1.5rem;\n\t\tborder-bottom: 1px solid #f0f0f0;\n\n\t\t&:last-child {\n\t\t\tborder-bottom: none;\n\t\t}\n\n\t\th4 {\n\t\t\tmargin-top: 0;\n\t\t\tmargin-bottom: 0.5rem;\n\t\t\tfont-size: 1.1rem;\n\t\t}\n\t}\n\n\t&__description {\n\t\tmargin-bottom: 1rem;\n\t\tcolor: inherit;\n\t\tfont-size: 0.95rem;\n\n\t\tcode {\n\t\t\tbackground: #f0f0f0;\n\t\t\tpadding: 0.1rem 0.3rem;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t}\n\n\t&__button-group {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\tmargin-bottom: 0.5rem;\n\n\t\tinput {\n\t\t\tflex: 1;\n\t\t\tborder: 1px solid #ddd;\n\t\t\tborder-radius: 4px 0 0 4px;\n\t\t\tfont-size: 1rem;\n\t\t\tmargin: 0;\n\n\t\t\t&[aria-invalid=\"true\"] {\n\t\t\t\tborder-color: #cc1818;\n\t\t\t}\n\t\t}\n\n\t\tbutton {\n\t\t\tborder-radius: 0 4px 4px 0 !important;\n\t\t\tmargin-left: -1px !important;\n\t\t}\n\t}\n\n\t&__error {\n\t\tcolor: #cc1818;\n\t\tfont-size: 0.9rem;\n\t\tmargin-top: 0.5rem;\n\t}\n}\n\nbody.modal-open {\n\toverflow: hidden;\n}\n\n/* Animation for modal */\n@keyframes activitypub-modal-appear {\n\tfrom {\n\t\topacity: 0;\n\t\ttransform: translateY(20px);\n\t}\n\tto {\n\t\topacity: 1;\n\t\ttransform: translateY(0);\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/build/follow-me/view.asset.php b/build/follow-me/view.asset.php index 2e14f1b79..6060268c2 100644 --- a/build/follow-me/view.asset.php +++ b/build/follow-me/view.asset.php @@ -1 +1 @@ - array('@wordpress/interactivity'), 'version' => '849432e4183af4c1428b', 'type' => 'module'); + array('@wordpress/interactivity'), 'version' => '78ec8be488ab128fbcc1', 'type' => 'module'); diff --git a/build/follow-me/view.js b/build/follow-me/view.js index 4008cf913..0e979b6dc 100644 --- a/build/follow-me/view.js +++ b/build/follow-me/view.js @@ -1 +1 @@ -import*as e from"@wordpress/interactivity";var t,o,n={825:(t,o,n)=>{const r=(c={getContext:()=>e.getContext,store:()=>e.store},l={},n.d(l,c),l);var c,l;function i(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|");return`var(--wp--preset--color--${t})`}function s(e,t,o=null,n=""){return o?`${e}${n} { ${t}: ${o}; }\n`:""}function a(e,t,o,n){return s(e,"background-color",t)+s(e,"color",o)+s(e,"background-color",n,":hover")+s(e,"background-color",n,":focus")}const{state:d,actions:u}=(0,r.store)("activitypub/follow-me",{actions:{openModal(){const e=(0,r.getContext)();e.isModalOpen=!0,document.body.classList.add("modal-open"),setTimeout((()=>{const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".activitypub-modal__frame");e&&(n=(o=e).querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),r=n[0],c=n[n.length-1],r.focus(),o.addEventListener("keydown",(function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?document.activeElement===r&&(c.focus(),e.preventDefault()):document.activeElement===c&&(r.focus(),e.preventDefault()))})))}var o,n,r,c}),50)},closeModal(){const e=(0,r.getContext)();e.isModalOpen=!1,document.body.classList.remove("modal-open");const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".wp-block-button__link");e&&e.focus()}},toggleModal(){const{isModalOpen:e}=(0,r.getContext)();e?u.closeModal():u.openModal()},copyToClipboard(){const e=(0,r.getContext)();navigator.clipboard.writeText(e.webfinger).then((()=>{e.copyButtonText=d.i18n.copied,setTimeout((()=>{e.copyButtonText=d.i18n.copy}),1e3)}),(e=>{console.error("Could not copy text: ",e)}))},updateRemoteProfile(e){const t=(0,r.getContext)();t.remoteProfile=e.target.value,t.isError=!1,t.errorMessage=""},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),u.submitRemoteProfile())},submitRemoteProfile:function*(){const e=(0,r.getContext)(),{namespace:t}=d,o=e.remoteProfile.trim();if(!o)return e.isError=!0,void(e.errorMessage=d.i18n.emptyProfileError);if(!/^(https?:\/\/|@)/.test(o))return e.isError=!0,void(e.errorMessage=d.i18n.invalidProfileError);e.isLoading=!0,e.isError=!1;const n=`/${t}/actors/${e.userId}/remote-follow?resource=${encodeURIComponent(o)}`;try{const t=yield apiFetch({path:n});e.isLoading=!1,window.open(t.url,"_blank"),u.closeModal()}catch(t){console.error("Error submitting profile:",t),e.isLoading=!1,e.isError=!0,e.errorMessage=t.message||d.i18n.genericError}}},callbacks:{initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:t,blockId:o}=(0,r.getContext)();if(o&&e){const r=document.createElement("style"),c=`#${o}`;r.textContent=function(e,t,o){if(!t.length)return"";const n=`${e} .wp-block-button__link`,r=("string"==typeof(c=o)?`var(--wp--preset--color--${c})`:c?.color?.background||null)||t?.color?.background;var c;return a(n,i(t?.elements?.link?.color?.text),r,i(t?.elements?.link?.[":hover"]?.color?.text))}(c,e,t),document.head.appendChild(r);const l=document.createElement("style");l.textContent=(n=e,a(".activitypub-dialog__button-group .components-button",i(n?.elements?.link?.color?.text)||"#111","#fff",i(n?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(l)}var n},documentKeydown(e){const{isModalOpen:t}=(0,r.getContext)();t&&"Escape"===e.key&&u.closeModal()},documentClick(e){const{blockId:t,isModalOpen:o}=(0,r.getContext)();if(!o)return;const n=document.getElementById(t);if(!n)return;const c=n.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(c&&(c===e.target||c.contains(e.target)))return;const l=n.querySelector(".activitypub-modal__frame");l&&!l.contains(e.target)&&u.closeModal()}}})}},r={};function c(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,c),o.exports}c.m=n,t=[],c.O=(e,o,n,r)=>{if(!o){var l=1/0;for(d=0;d=r)&&Object.keys(c.O).every((e=>c.O[e](o[s])))?o.splice(s--,1):(i=!1,r0&&t[d-1][2]>r;d--)t[d]=t[d-1];t[d]=[o,n,r]},c.d=(e,t)=>{for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={41:0,301:0},c.O.j=e=>0===o[e];var l=c.O(void 0,[301],(()=>c(825)));l=c.O(l); \ No newline at end of file +import*as e from"@wordpress/interactivity";var t,o,n={825:(t,o,n)=>{const r=(c={getContext:()=>e.getContext,store:()=>e.store},l={},n.d(l,c),l);var c,l;function i(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|");return`var(--wp--preset--color--${t})`}function s(e,t,o=null,n=""){return o?`${e}${n} { ${t}: ${o}; }\n`:""}function a(e,t,o,n){return s(e,"background-color",t)+s(e,"color",o)+s(e,"background-color",n,":hover")+s(e,"background-color",n,":focus")}const{state:d,actions:u}=(0,r.store)("activitypub/follow-me",{actions:{openModal(){const e=(0,r.getContext)();e.isModalOpen=!0,document.body.classList.add("modal-open"),setTimeout((()=>{const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".activitypub-modal__frame");e&&(n=(o=e).querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),r=n[0],c=n[n.length-1],r.focus(),o.addEventListener("keydown",(function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?document.activeElement===r&&(c.focus(),e.preventDefault()):document.activeElement===c&&(r.focus(),e.preventDefault()))})))}var o,n,r,c}),50)},closeModal(){const e=(0,r.getContext)();e.isModalOpen=!1,document.body.classList.remove("modal-open");const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".wp-block-button__link");e&&e.focus()}},toggleModal(){const{isModalOpen:e}=(0,r.getContext)();e?u.closeModal():u.openModal()},copyToClipboard(){const e=(0,r.getContext)();navigator.clipboard.writeText(e.webfinger).then((()=>{e.copyButtonText=d.i18n.copied,setTimeout((()=>{e.copyButtonText=d.i18n.copy}),1e3)}),(e=>{console.error("Could not copy text: ",e)}))},updateRemoteProfile(e){const t=(0,r.getContext)();t.remoteProfile=e.target.value,t.isError=!1,t.errorMessage=""},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),u.submitRemoteProfile())},submitRemoteProfile:function*(){const e=(0,r.getContext)(),{namespace:t}=d,o=e.remoteProfile.trim();if(!o)return e.isError=!0,void(e.errorMessage=d.i18n.emptyProfileError);if(!/^(https?:\/\/|@)/.test(o))return e.isError=!0,void(e.errorMessage=d.i18n.invalidProfileError);e.isLoading=!0,e.isError=!1;const n=`/${t}/actors/${e.userId}/remote-follow?resource=${encodeURIComponent(o)}`;try{const t=yield apiFetch({path:n});e.isLoading=!1,window.open(t.url,"_blank"),u.closeModal()}catch(t){console.error("Error submitting profile:",t),e.isLoading=!1,e.isError=!0,e.errorMessage=t.message||d.i18n.genericError}}},callbacks:{initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:t,blockId:o}=(0,r.getContext)();if(o&&e){const r=document.createElement("style"),c=`#${o}`;r.textContent=function(e,t,o){const n=`${e} .wp-block-button__link`,r=("string"==typeof(c=o)?`var(--wp--preset--color--${c})`:c?.color?.background||null)||t?.color?.background;var c;return a(n,i(t?.elements?.link?.color?.text),r,i(t?.elements?.link?.[":hover"]?.color?.text))}(c,e,t),document.head.appendChild(r);const l=document.createElement("style");l.textContent=(n=e,a(".activitypub-dialog__button-group .wp-block-button",i(n?.elements?.link?.color?.text)||"#111","#fff",i(n?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(l)}var n},documentKeydown(e){const{isModalOpen:t}=(0,r.getContext)();t&&"Escape"===e.key&&u.closeModal()},documentClick(e){const{blockId:t,isModalOpen:o}=(0,r.getContext)();if(!o)return;const n=document.getElementById(t);if(!n)return;const c=n.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(c&&(c===e.target||c.contains(e.target)))return;const l=n.querySelector(".activitypub-modal__frame");l&&!l.contains(e.target)&&u.closeModal()}}})}},r={};function c(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,c),o.exports}c.m=n,t=[],c.O=(e,o,n,r)=>{if(!o){var l=1/0;for(d=0;d=r)&&Object.keys(c.O).every((e=>c.O[e](o[s])))?o.splice(s--,1):(i=!1,r0&&t[d-1][2]>r;d--)t[d]=t[d-1];t[d]=[o,n,r]},c.d=(e,t)=>{for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={41:0,301:0},c.O.j=e=>0===o[e];var l=c.O(void 0,[301],(()=>c(825)));l=c.O(l); \ No newline at end of file diff --git a/build/follow-me/view.js.map b/build/follow-me/view.js.map index 7d86b7a2a..321887652 100644 --- a/build/follow-me/view.js.map +++ b/build/follow-me/view.js.map @@ -1 +1 @@ -{"version":3,"file":"follow-me/view.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,kBAAkBA,CAAEC,KAAK,EAAG;EACpC;EACA,IAAK,OAAOA,KAAK,KAAK,QAAQ,EAAG;IAChC,OAAO,4BAA6BA,KAAK,GAAI;EAC9C;EAEA,OAAOA,KAAK,EAAEA,KAAK,EAAEC,UAAU,IAAI,IAAI;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAAEC,IAAI,EAAG;EA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ACtC;UACA;UACA,kBAAkB,qBAAqB;UACvC;UACA;UACA,KAAK;UACL;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;;;;UC3BA;UACA;UACA;UACA;UACA,yCAAyC,wCAAwC;UACjF;UACA;UACA;;;;;UCPA;;;;;UCAA;UACA;UACA;UACA,uDAAuD,iBAAiB;UACxE;UACA,gDAAgD,aAAa;UAC7D;;;;;UCNA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;;;;SEpBA;SACA;SACA;SACA;SACA","sources":["webpack://wordpress-activitypub/./src/follow-me/button-style.js","webpack://wordpress-activitypub/./src/follow-me/style.scss?8459","webpack://wordpress-activitypub/./src/follow-me/view.js","webpack://wordpress-activitypub/external module \"@wordpress/interactivity\"","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/chunk loaded","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/webpack/runtime/import chunk loading","webpack://wordpress-activitypub/webpack/before-startup","webpack://wordpress-activitypub/webpack/startup","webpack://wordpress-activitypub/webpack/after-startup"],"sourcesContent":["/**\n * Gets the background color from a style object.\n *\n * @param {Object|string} color Color object or string.\n * @return {string|null} Background color.\n */\nfunction getBackgroundColor( color ) {\n\t// If color is a string, it's a var like this.\n\tif ( typeof color === 'string' ) {\n\t\treturn `var(--wp--preset--color--${ color })`;\n\t}\n\n\treturn color?.color?.background || null;\n}\n\n/**\n * Gets the link color from a style object.\n *\n * @param {string} text Text color.\n * @return {string|null} Link color.\n */\nfunction getLinkColor( text ) {\n\tif ( typeof text !== 'string' ) {\n\t\treturn null;\n\t}\n\t// If it starts with a hash, leave it be.\n\tif ( text.match( /^#/ ) ) {\n\t\t// We don't handle the alpha channel if present.\n\t\treturn text.substring( 0, 7 );\n\t}\n\t// var:preset|color|luminous-vivid-amber\n\t// var(--wp--preset--color--luminous-vivid-amber)\n\t// We will receive the top format, we need to output the bottom format.\n\tconst [ , , color ] = text.split( '|' );\n\treturn `var(--wp--preset--color--${ color })`;\n}\n\n/**\n * Generates a CSS selector.\n *\n * @param {string} selector CSS selector.\n * @param {string} prop CSS property.\n * @param {string|null} value CSS value.\n * @param {string} pseudo Pseudo-selector.\n * @return {string} CSS selector.\n */\nfunction generateSelector( selector, prop, value = null, pseudo = '' ) {\n\tif ( ! value ) {\n\t\treturn '';\n\t}\n\treturn `${ selector }${ pseudo } { ${ prop }: ${ value }; }\\n`;\n}\n\n/**\n * Gets styles for a button.\n *\n * @param {string} selector CSS selector.\n * @param {string} button Button color.\n * @param {string} text Text color.\n * @param {string} hover Hover color.\n * @return {string} CSS styles.\n */\nfunction getStyles( selector, button, text, hover ) {\n\treturn (\n\t\tgenerateSelector( selector, 'background-color', button ) +\n\t\tgenerateSelector( selector, 'color', text ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':hover' ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':focus' )\n\t);\n}\n\n/**\n * Gets block styles.\n *\n * @param {string} base Base selector.\n * @param {Object} style Style object.\n * @param {Object|string} backgroundColor Background color.\n * @return {string} CSS styles.\n */\nexport function getBlockStyles( base, style, backgroundColor ) {\n\tif ( ! style.length ) {\n\t\treturn '';\n\t}\n\n\tconst selector = `${ base } .wp-block-button__link`;\n\t// We grab the background color if set as a good color for our button text.\n\tconst buttonTextColor =\n\t\tgetBackgroundColor( backgroundColor ) ||\n\t\t// Background might be in this form.\n\t\tstyle?.color?.background;\n\t// We misuse the link color for the button background.\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text );\n\t// Hover!\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text );\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n\n/**\n * Gets popup styles.\n *\n * @param {Object} style Style object.\n * @return {string} CSS styles.\n */\nexport function getPopupStyles( style ) {\n\t// We don't accept backgroundColor because the popup is always white (right?).\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text ) || '#111';\n\tconst buttonTextColor = '#fff';\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text ) || '#333';\n\tconst selector = '.activitypub-dialog__button-group .components-button';\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n","// extracted by mini-css-extract-plugin\nexport {};","import { store, getContext } from '@wordpress/interactivity';\nimport { getBlockStyles, getPopupStyles } from './button-style';\nimport './style.scss';\n\n/**\n * Traps focus within the specified element.\n *\n * @param {Element} element The element to trap focus within.\n */\nfunction trapFocus( element ) {\n\tvar focusableElements = element.querySelectorAll(\n\t\t'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type=\"text\"]:not([disabled]), input[type=\"radio\"]:not([disabled]), input[type=\"checkbox\"]:not([disabled]), select:not([disabled])'\n\t);\n\tvar firstFocusableElement = focusableElements[ 0 ];\n\tvar lastFocusableElement = focusableElements[ focusableElements.length - 1 ];\n\tfirstFocusableElement.focus();\n\n\telement.addEventListener( 'keydown', function ( event ) {\n\t\tif ( event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */ ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.shiftKey ) {\n\t\t\t/* shift + tab */\n\t\t\tif ( document.activeElement === firstFocusableElement ) {\n\t\t\t\tlastFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t} /* tab */ else {\n\t\t\tif ( document.activeElement === lastFocusableElement ) {\n\t\t\t\tfirstFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t} );\n}\n\nconst { state, actions } = store( 'activitypub/follow-me', {\n\tactions: {\n\t\t/**\n\t\t * Open the modal.\n\t\t */\n\t\topenModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = true;\n\t\t\tdocument.body.classList.add( 'modal-open' );\n\n\t\t\t// Set up the focus trap after modal is open.\n\t\t\tsetTimeout( () => {\n\t\t\t\t// Use the blockId to find the specific modal frame for this block.\n\t\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\t\tif ( blockWrapper ) {\n\t\t\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\t\t\tif ( modalFrame ) {\n\t\t\t\t\t\ttrapFocus( modalFrame );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 50 );\n\t\t},\n\n\t\t/**\n\t\t * Close the modal.\n\t\t */\n\t\tcloseModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = false;\n\t\t\tdocument.body.classList.remove( 'modal-open' );\n\n\t\t\t// Return focus to the button that opened the modal.\n\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\tif ( blockWrapper ) {\n\t\t\t\tconst openButton = blockWrapper.querySelector( '.wp-block-button__link' );\n\t\t\t\tif ( openButton ) {\n\t\t\t\t\topenButton.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\ttoggleModal() {\n\t\t\tconst { isModalOpen } = getContext();\n\n\t\t\tisModalOpen ? actions.closeModal() : actions.openModal();\n\t\t},\n\n\t\t/**\n\t\t * Copy the webfinger to clipboard.\n\t\t */\n\t\tcopyToClipboard() {\n\t\t\tconst context = getContext();\n\n\t\t\t// Use the Clipboard API to copy text.\n\t\t\tnavigator.clipboard.writeText( context.webfinger ).then(\n\t\t\t\t() => {\n\t\t\t\t\t// Update button text to show success.\n\t\t\t\t\tcontext.copyButtonText = state.i18n.copied;\n\n\t\t\t\t\t// Reset button text after 1 second.\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tcontext.copyButtonText = state.i18n.copy;\n\t\t\t\t\t}, 1000 );\n\t\t\t\t},\n\t\t\t\t( error ) => {\n\t\t\t\t\t// Log error if copying fails.\n\t\t\t\t\tconsole.error( 'Could not copy text: ', error );\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the remote profile value.\n\t\t *\n\t\t * @param {Event} event Input event.\n\t\t */\n\t\tupdateRemoteProfile( event ) {\n\t\t\tconst context = getContext();\n\t\t\tcontext.remoteProfile = event.target.value;\n\t\t\t// Reset error state when input changes.\n\t\t\tcontext.isError = false;\n\t\t\tcontext.errorMessage = '';\n\t\t},\n\n\t\t/**\n\t\t * Handle keydown event for remote profile input.\n\t\t *\n\t\t * @param {Event} event Keydown event.\n\t\t */\n\t\thandleKeyDown( event ) {\n\t\t\tif ( event.key === 'Enter' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tactions.submitRemoteProfile();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Submit the remote profile.\n\t\t */\n\t\tsubmitRemoteProfile: function* () {\n\t\t\tconst context = getContext();\n\t\t\tconst { namespace } = state;\n\t\t\tconst input = context.remoteProfile.trim();\n\n\t\t\t// Validate input.\n\t\t\tif ( ! input ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.emptyProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! /^(https?:\\/\\/|@)/.test( input ) ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.invalidProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set loading state.\n\t\t\tcontext.isLoading = true;\n\t\t\tcontext.isError = false;\n\n\t\t\t// Construct the API path.\n\t\t\tconst path = `/${ namespace }/actors/${ context.userId }/remote-follow?resource=${ encodeURIComponent(\n\t\t\t\tinput\n\t\t\t) }`;\n\n\t\t\ttry {\n\t\t\t\t// Make the API request.\n\t\t\t\tconst response = yield apiFetch( { path } );\n\n\t\t\t\t// Set opening state.\n\t\t\t\tcontext.isLoading = false;\n\n\t\t\t\t// Open the remote follow URL in a new tab.\n\t\t\t\twindow.open( response.url, '_blank' );\n\n\t\t\t\t// Close the modal after opening the URL.\n\t\t\t\tactions.closeModal();\n\t\t\t} catch ( error ) {\n\t\t\t\t// Handle error.\n\t\t\t\tconsole.error( 'Error submitting profile:', error );\n\t\t\t\tcontext.isLoading = false;\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = error.message || state.i18n.genericError;\n\t\t\t}\n\t\t},\n\t},\n\tcallbacks: {\n\t\t/**\n\t\t * Initialize button styles.\n\t\t */\n\t\tinitButtonStyles: () => {\n\t\t\tconst { buttonStyle, backgroundColor, blockId } = getContext();\n\n\t\t\t// Add dynamic button styles to the document.\n\t\t\tif ( blockId && buttonStyle ) {\n\t\t\t\tconst styleElement = document.createElement( 'style' );\n\t\t\t\tconst selector = `#${ blockId }`;\n\n\t\t\t\t// Use getBlockStyles from button-style.js to get the CSS string.\n\t\t\t\tstyleElement.textContent = getBlockStyles( selector, buttonStyle, backgroundColor );\n\n\t\t\t\tdocument.head.appendChild( styleElement );\n\n\t\t\t\t// Add popup styles.\n\t\t\t\tconst popupStyleElement = document.createElement( 'style' );\n\t\t\t\tpopupStyleElement.textContent = getPopupStyles( buttonStyle );\n\t\t\t\tdocument.head.appendChild( popupStyleElement );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when pressing ESC key.\n\t\t *\n\t\t * @param {Event} event Keyboard event.\n\t\t */\n\t\tdocumentKeydown( event ) {\n\t\t\tconst { isModalOpen } = getContext();\n\n\t\t\tif ( isModalOpen && event.key === 'Escape' ) {\n\t\t\t\tactions.closeModal();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when clicking outside.\n\t\t *\n\t\t * @param {Event} event Click event.\n\t\t */\n\t\tdocumentClick( event ) {\n\t\t\tconst { blockId, isModalOpen } = getContext();\n\t\t\tif ( ! isModalOpen ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Get the block wrapper element.\n\t\t\tconst blockWrapper = document.getElementById( blockId );\n\t\t\tif ( ! blockWrapper ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If the click was on the button or its children, we should not close the modal.\n\t\t\tconst toggleButton = blockWrapper.querySelector(\n\t\t\t\t'.wp-element-button[data-wp-on--click=\"actions.toggleModal\"]'\n\t\t\t);\n\t\t\tif ( toggleButton && ( toggleButton === event.target || toggleButton.contains( event.target ) ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if the click was inside the modal frame.\n\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\tif ( ! modalFrame || modalFrame.contains( event.target ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactions.closeModal();\n\t\t},\n\t},\n} );\n","module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;","// 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\t// no module.id needed\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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"follow-me/view\": 0,\n\t\"follow-me/style-view\": 0\n};\n\n// no install chunk\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no external install chunk\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"follow-me/style-view\"], () => (__webpack_require__(\"./src/follow-me/view.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["getBackgroundColor","color","background","getLinkColor","text","match","substring","split","generateSelector","selector","prop","value","pseudo","getStyles","button","hover","getBlockStyles","base","style","backgroundColor","length","buttonTextColor","buttonColor","elements","link","buttonHoverColor","getPopupStyles","store","getContext","trapFocus","element","focusableElements","querySelectorAll","firstFocusableElement","lastFocusableElement","focus","addEventListener","event","key","keyCode","shiftKey","document","activeElement","preventDefault","state","actions","openModal","context","isModalOpen","body","classList","add","setTimeout","blockWrapper","getElementById","blockId","modalFrame","querySelector","closeModal","remove","openButton","toggleModal","copyToClipboard","navigator","clipboard","writeText","webfinger","then","copyButtonText","i18n","copied","copy","error","console","updateRemoteProfile","remoteProfile","target","isError","errorMessage","handleKeyDown","submitRemoteProfile","namespace","input","trim","emptyProfileError","test","invalidProfileError","isLoading","path","userId","encodeURIComponent","response","apiFetch","window","open","url","message","genericError","callbacks","initButtonStyles","buttonStyle","styleElement","createElement","textContent","head","appendChild","popupStyleElement","documentKeydown","documentClick","toggleButton","contains"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"follow-me/view.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,kBAAkBA,CAAEC,KAAK,EAAG;EACpC;EACA,IAAK,OAAOA,KAAK,KAAK,QAAQ,EAAG;IAChC,OAAO,4BAA6BA,KAAK,GAAI;EAC9C;EAEA,OAAOA,KAAK,EAAEA,KAAK,EAAEC,UAAU,IAAI,IAAI;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAAEC,IAAI,EAAG;EAC7B,IAAK,OAAOA,IAAI,KAAK,QAAQ,EAAG;IAC/B,OAAO,IAAI;EACZ;EACA;EACA,IAAKA,IAAI,CAACC,KAAK,CAAE,IAAK,CAAC,EAAG;IACzB;IACA,OAAOD,IAAI,CAACE,SAAS,CAAE,CAAC,EAAE,CAAE,CAAC;EAC9B;EACA;EACA;EACA;EACA,MAAM,IAAML,KAAK,CAAE,GAAGG,IAAI,CAACG,KAAK,CAAE,GAAI,CAAC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;;;SEpBA;SACA;SACA;SACA;SACA","sources":["webpack://wordpress-activitypub/./src/follow-me/button-style.js","webpack://wordpress-activitypub/./src/follow-me/style.scss","webpack://wordpress-activitypub/./src/follow-me/view.js","webpack://wordpress-activitypub/external module \"@wordpress/interactivity\"","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/chunk loaded","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/webpack/runtime/import chunk loading","webpack://wordpress-activitypub/webpack/before-startup","webpack://wordpress-activitypub/webpack/startup","webpack://wordpress-activitypub/webpack/after-startup"],"sourcesContent":["/**\n * Gets the background color from a style object.\n *\n * @param {Object|string} color Color object or string.\n * @return {string|null} Background color.\n */\nfunction getBackgroundColor( color ) {\n\t// If color is a string, it's a var like this.\n\tif ( typeof color === 'string' ) {\n\t\treturn `var(--wp--preset--color--${ color })`;\n\t}\n\n\treturn color?.color?.background || null;\n}\n\n/**\n * Gets the link color from a style object.\n *\n * @param {string} text Text color.\n * @return {string|null} Link color.\n */\nfunction getLinkColor( text ) {\n\tif ( typeof text !== 'string' ) {\n\t\treturn null;\n\t}\n\t// If it starts with a hash, leave it be.\n\tif ( text.match( /^#/ ) ) {\n\t\t// We don't handle the alpha channel if present.\n\t\treturn text.substring( 0, 7 );\n\t}\n\t// var:preset|color|luminous-vivid-amber\n\t// var(--wp--preset--color--luminous-vivid-amber)\n\t// We will receive the top format, we need to output the bottom format.\n\tconst [ , , color ] = text.split( '|' );\n\treturn `var(--wp--preset--color--${ color })`;\n}\n\n/**\n * Generates a CSS selector.\n *\n * @param {string} selector CSS selector.\n * @param {string} prop CSS property.\n * @param {string|null} value CSS value.\n * @param {string} pseudo Pseudo-selector.\n * @return {string} CSS selector.\n */\nfunction generateSelector( selector, prop, value = null, pseudo = '' ) {\n\tif ( ! value ) {\n\t\treturn '';\n\t}\n\treturn `${ selector }${ pseudo } { ${ prop }: ${ value }; }\\n`;\n}\n\n/**\n * Gets styles for a button.\n *\n * @param {string} selector CSS selector.\n * @param {string} button Button color.\n * @param {string} text Text color.\n * @param {string} hover Hover color.\n * @return {string} CSS styles.\n */\nfunction getStyles( selector, button, text, hover ) {\n\treturn (\n\t\tgenerateSelector( selector, 'background-color', button ) +\n\t\tgenerateSelector( selector, 'color', text ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':hover' ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':focus' )\n\t);\n}\n\n/**\n * Gets block styles.\n *\n * @param {string} base Base selector.\n * @param {Object} style Style object.\n * @param {Object|string} backgroundColor Background color.\n * @return {string} CSS styles.\n */\nexport function getBlockStyles( base, style, backgroundColor ) {\n\tconst selector = `${ base } .wp-block-button__link`;\n\n\t// We grab the background color if set as a good color for our button text.\n\tconst buttonTextColor =\n\t\tgetBackgroundColor( backgroundColor ) ||\n\t\t// Background might be in this form.\n\t\tstyle?.color?.background;\n\n\t// We misuse the link color for the button background.\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text );\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text );\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n\n/**\n * Gets popup styles.\n *\n * @param {Object} style Style object.\n * @return {string} CSS styles.\n */\nexport function getPopupStyles( style ) {\n\t// We don't accept backgroundColor because the popup is always white (right?).\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text ) || '#111';\n\tconst buttonTextColor = '#fff';\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text ) || '#333';\n\tconst selector = '.activitypub-dialog__button-group .wp-block-button';\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n","// extracted by mini-css-extract-plugin\nexport {};","import { store, getContext } from '@wordpress/interactivity';\nimport { getBlockStyles, getPopupStyles } from './button-style';\nimport './style.scss';\n\n/**\n * Traps focus within the specified element.\n *\n * @param {Element} element The element to trap focus within.\n */\nfunction trapFocus( element ) {\n\tvar focusableElements = element.querySelectorAll(\n\t\t'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type=\"text\"]:not([disabled]), input[type=\"radio\"]:not([disabled]), input[type=\"checkbox\"]:not([disabled]), select:not([disabled])'\n\t);\n\tvar firstFocusableElement = focusableElements[ 0 ];\n\tvar lastFocusableElement = focusableElements[ focusableElements.length - 1 ];\n\tfirstFocusableElement.focus();\n\n\telement.addEventListener( 'keydown', function ( event ) {\n\t\tif ( event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */ ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.shiftKey ) {\n\t\t\t/* shift + tab */\n\t\t\tif ( document.activeElement === firstFocusableElement ) {\n\t\t\t\tlastFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t} /* tab */ else {\n\t\t\tif ( document.activeElement === lastFocusableElement ) {\n\t\t\t\tfirstFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t} );\n}\n\nconst { state, actions } = store( 'activitypub/follow-me', {\n\tactions: {\n\t\t/**\n\t\t * Open the modal.\n\t\t */\n\t\topenModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = true;\n\t\t\tdocument.body.classList.add( 'modal-open' );\n\n\t\t\t// Set up the focus trap after modal is open.\n\t\t\tsetTimeout( () => {\n\t\t\t\t// Use the blockId to find the specific modal frame for this block.\n\t\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\t\tif ( blockWrapper ) {\n\t\t\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\t\t\tif ( modalFrame ) {\n\t\t\t\t\t\ttrapFocus( modalFrame );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 50 );\n\t\t},\n\n\t\t/**\n\t\t * Close the modal.\n\t\t */\n\t\tcloseModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = false;\n\t\t\tdocument.body.classList.remove( 'modal-open' );\n\n\t\t\t// Return focus to the button that opened the modal.\n\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\tif ( blockWrapper ) {\n\t\t\t\tconst openButton = blockWrapper.querySelector( '.wp-block-button__link' );\n\t\t\t\tif ( openButton ) {\n\t\t\t\t\topenButton.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\ttoggleModal() {\n\t\t\tconst { isModalOpen } = getContext();\n\n\t\t\tisModalOpen ? actions.closeModal() : actions.openModal();\n\t\t},\n\n\t\t/**\n\t\t * Copy the webfinger to clipboard.\n\t\t */\n\t\tcopyToClipboard() {\n\t\t\tconst context = getContext();\n\n\t\t\t// Use the Clipboard API to copy text.\n\t\t\tnavigator.clipboard.writeText( context.webfinger ).then(\n\t\t\t\t() => {\n\t\t\t\t\t// Update button text to show success.\n\t\t\t\t\tcontext.copyButtonText = state.i18n.copied;\n\n\t\t\t\t\t// Reset button text after 1 second.\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tcontext.copyButtonText = state.i18n.copy;\n\t\t\t\t\t}, 1000 );\n\t\t\t\t},\n\t\t\t\t( error ) => {\n\t\t\t\t\t// Log error if copying fails.\n\t\t\t\t\tconsole.error( 'Could not copy text: ', error );\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the remote profile value.\n\t\t *\n\t\t * @param {Event} event Input event.\n\t\t */\n\t\tupdateRemoteProfile( event ) {\n\t\t\tconst context = getContext();\n\t\t\tcontext.remoteProfile = event.target.value;\n\t\t\t// Reset error state when input changes.\n\t\t\tcontext.isError = false;\n\t\t\tcontext.errorMessage = '';\n\t\t},\n\n\t\t/**\n\t\t * Handle keydown event for remote profile input.\n\t\t *\n\t\t * @param {Event} event Keydown event.\n\t\t */\n\t\thandleKeyDown( event ) {\n\t\t\tif ( event.key === 'Enter' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tactions.submitRemoteProfile();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Submit the remote profile.\n\t\t */\n\t\tsubmitRemoteProfile: function* () {\n\t\t\tconst context = getContext();\n\t\t\tconst { namespace } = state;\n\t\t\tconst input = context.remoteProfile.trim();\n\n\t\t\t// Validate input.\n\t\t\tif ( ! input ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.emptyProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! /^(https?:\\/\\/|@)/.test( input ) ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.invalidProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set loading state.\n\t\t\tcontext.isLoading = true;\n\t\t\tcontext.isError = false;\n\n\t\t\t// Construct the API path.\n\t\t\tconst path = `/${ namespace }/actors/${ context.userId }/remote-follow?resource=${ encodeURIComponent(\n\t\t\t\tinput\n\t\t\t) }`;\n\n\t\t\ttry {\n\t\t\t\t// Make the API request.\n\t\t\t\tconst response = yield apiFetch( { path } );\n\n\t\t\t\t// Set opening state.\n\t\t\t\tcontext.isLoading = false;\n\n\t\t\t\t// Open the remote follow URL in a new tab.\n\t\t\t\twindow.open( response.url, '_blank' );\n\n\t\t\t\t// Close the modal after opening the URL.\n\t\t\t\tactions.closeModal();\n\t\t\t} catch ( error ) {\n\t\t\t\t// Handle error.\n\t\t\t\tconsole.error( 'Error submitting profile:', error );\n\t\t\t\tcontext.isLoading = false;\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = error.message || state.i18n.genericError;\n\t\t\t}\n\t\t},\n\t},\n\tcallbacks: {\n\t\t/**\n\t\t * Initialize button styles.\n\t\t */\n\t\tinitButtonStyles: () => {\n\t\t\tconst { buttonStyle, backgroundColor, blockId } = getContext();\n\n\t\t\t// Add dynamic button styles to the document.\n\t\t\tif ( blockId && buttonStyle ) {\n\t\t\t\tconst styleElement = document.createElement( 'style' );\n\t\t\t\tconst selector = `#${ blockId }`;\n\n\t\t\t\t// Use getBlockStyles from button-style.js to get the CSS string.\n\t\t\t\tstyleElement.textContent = getBlockStyles( selector, buttonStyle, backgroundColor );\n\n\t\t\t\tdocument.head.appendChild( styleElement );\n\n\t\t\t\t// Add popup styles.\n\t\t\t\tconst popupStyleElement = document.createElement( 'style' );\n\t\t\t\tpopupStyleElement.textContent = getPopupStyles( buttonStyle );\n\t\t\t\tdocument.head.appendChild( popupStyleElement );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when pressing ESC key.\n\t\t *\n\t\t * @param {Event} event Keyboard event.\n\t\t */\n\t\tdocumentKeydown( event ) {\n\t\t\tconst { isModalOpen } = getContext();\n\n\t\t\tif ( isModalOpen && event.key === 'Escape' ) {\n\t\t\t\tactions.closeModal();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when clicking outside.\n\t\t *\n\t\t * @param {Event} event Click event.\n\t\t */\n\t\tdocumentClick( event ) {\n\t\t\tconst { blockId, isModalOpen } = getContext();\n\t\t\tif ( ! isModalOpen ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Get the block wrapper element.\n\t\t\tconst blockWrapper = document.getElementById( blockId );\n\t\t\tif ( ! blockWrapper ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If the click was on the button or its children, we should not close the modal.\n\t\t\tconst toggleButton = blockWrapper.querySelector(\n\t\t\t\t'.wp-element-button[data-wp-on--click=\"actions.toggleModal\"]'\n\t\t\t);\n\t\t\tif ( toggleButton && ( toggleButton === event.target || toggleButton.contains( event.target ) ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if the click was inside the modal frame.\n\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\tif ( ! modalFrame || modalFrame.contains( event.target ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactions.closeModal();\n\t\t},\n\t},\n} );\n","module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;","// 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\t// no module.id needed\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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"follow-me/view\": 0,\n\t\"follow-me/style-view\": 0\n};\n\n// no install chunk\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no external install chunk\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"follow-me/style-view\"], () => (__webpack_require__(\"./src/follow-me/view.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["getBackgroundColor","color","background","getLinkColor","text","match","substring","split","generateSelector","selector","prop","value","pseudo","getStyles","button","hover","getBlockStyles","base","style","backgroundColor","buttonTextColor","buttonColor","elements","link","buttonHoverColor","getPopupStyles","store","getContext","trapFocus","element","focusableElements","querySelectorAll","firstFocusableElement","lastFocusableElement","length","focus","addEventListener","event","key","keyCode","shiftKey","document","activeElement","preventDefault","state","actions","openModal","context","isModalOpen","body","classList","add","setTimeout","blockWrapper","getElementById","blockId","modalFrame","querySelector","closeModal","remove","openButton","toggleModal","copyToClipboard","navigator","clipboard","writeText","webfinger","then","copyButtonText","i18n","copied","copy","error","console","updateRemoteProfile","remoteProfile","target","isError","errorMessage","handleKeyDown","submitRemoteProfile","namespace","input","trim","emptyProfileError","test","invalidProfileError","isLoading","path","userId","encodeURIComponent","response","apiFetch","window","open","url","message","genericError","callbacks","initButtonStyles","buttonStyle","styleElement","createElement","textContent","head","appendChild","popupStyleElement","documentKeydown","documentClick","toggleButton","contains"],"sourceRoot":""} \ No newline at end of file diff --git a/src/follow-me/button-style.js b/src/follow-me/button-style.js index 243c3679e..f4b74edc7 100644 --- a/src/follow-me/button-style.js +++ b/src/follow-me/button-style.js @@ -78,19 +78,16 @@ function getStyles( selector, button, text, hover ) { * @return {string} CSS styles. */ export function getBlockStyles( base, style, backgroundColor ) { - if ( ! style.length ) { - return ''; - } - const selector = `${ base } .wp-block-button__link`; + // We grab the background color if set as a good color for our button text. const buttonTextColor = getBackgroundColor( backgroundColor ) || // Background might be in this form. style?.color?.background; + // We misuse the link color for the button background. const buttonColor = getLinkColor( style?.elements?.link?.color?.text ); - // Hover! const buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text ); return getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor ); @@ -107,7 +104,7 @@ export function getPopupStyles( style ) { const buttonColor = getLinkColor( style?.elements?.link?.color?.text ) || '#111'; const buttonTextColor = '#fff'; const buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text ) || '#333'; - const selector = '.activitypub-dialog__button-group .components-button'; + const selector = '.activitypub-dialog__button-group .wp-block-button'; return getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor ); } diff --git a/src/follow-me/style.scss b/src/follow-me/style.scss index 24d4b84ff..b4c222769 100644 --- a/src/follow-me/style.scss +++ b/src/follow-me/style.scss @@ -32,16 +32,19 @@ &__handle { color: inherit; + line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .wp-block-button { - flex-shrink: 0; margin: 0; + display: flex; + align-items: center; &:not(:only-child) { + flex: 0.5; margin-left: 1rem; } } From 29238397f2ab8a0de3354cf23459da6d6a91c23e Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Thu, 15 May 2025 13:24:18 -0500 Subject: [PATCH 26/47] Keep modal color separate --- build/follow-me/style-view.css | 2 +- src/follow-me/style.scss | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/follow-me/style-view.css b/build/follow-me/style-view.css index 7abf9b745..3a8fec68d 100644 --- a/build/follow-me/style-view.css +++ b/build/follow-me/style-view.css @@ -1 +1 @@ -.activitypub-follow-me-block-wrapper{display:block;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{align-items:center;display:flex;padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1rem;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{flex:1;margin-right:1rem;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle{color:inherit;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button{align-items:center;display:flex;margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button:not(:only-child){flex:.5;margin-left:1rem}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8rem;padding:.25rem .5rem}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9rem;padding:.4rem .8rem}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border .activitypub-profile{padding-left:1rem;padding-right:1rem}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:#fff;border-radius:4px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.activitypub-modal__header{align-items:center;border-bottom:1px solid #e2e4e7;display:flex;flex-shrink:0;justify-content:space-between;padding:1rem 1rem 1rem 1.5rem}.activitypub-modal__title{font-size:1.3rem;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__close{align-items:center;background:none;border:none;color:#555;cursor:pointer;display:flex;justify-content:center;padding:.5rem}.activitypub-modal__close:hover{background:none;color:#000}.activitypub-modal__close:active{background:none;border:none;color:#000;padding:.5rem}.activitypub-modal__content{overflow-y:auto}.activitypub-dialog__section{border-bottom:1px solid #f0f0f0;padding:1rem 1.5rem}.activitypub-dialog__section:last-child{border-bottom:none}.activitypub-dialog__section h4{font-size:1.1rem;margin-bottom:.5rem;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:.95rem;margin-bottom:1rem}.activitypub-dialog__description code{background:#f0f0f0;border-radius:3px;font-size:.9rem;padding:.1rem .3rem}.activitypub-dialog__button-group{display:flex;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input{border:1px solid #ddd;border-radius:4px 0 0 4px;flex:1;font-size:1rem;margin:0}.activitypub-dialog__button-group input[aria-invalid=true]{border-color:#cc1818}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important}.activitypub-dialog__error{color:#cc1818;font-size:.9rem;margin-top:.5rem}body.modal-open{overflow:hidden}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}} +.activitypub-follow-me-block-wrapper{display:block;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{align-items:center;display:flex;padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1rem;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{flex:1;margin-right:1rem;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle{color:inherit;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button{align-items:center;display:flex;margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button:not(:only-child){flex:.5;margin-left:1rem}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8rem;padding:.25rem .5rem}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9rem;padding:.4rem .8rem}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border .activitypub-profile{padding-left:1rem;padding-right:1rem}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;color:initial;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:#fff;border-radius:4px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.activitypub-modal__header{align-items:center;border-bottom:1px solid #e2e4e7;display:flex;flex-shrink:0;justify-content:space-between;padding:1rem 1rem 1rem 1.5rem}.activitypub-modal__title{font-size:1.3rem;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__close{align-items:center;background:none;border:none;color:#555;cursor:pointer;display:flex;justify-content:center;padding:.5rem}.activitypub-modal__close:hover{background:none;color:#000}.activitypub-modal__close:active{background:none;border:none;color:#000;padding:.5rem}.activitypub-modal__content{overflow-y:auto}.activitypub-dialog__section{border-bottom:1px solid #f0f0f0;padding:1rem 1.5rem}.activitypub-dialog__section:last-child{border-bottom:none}.activitypub-dialog__section h4{font-size:1.1rem;margin-bottom:.5rem;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:.95rem;margin-bottom:1rem}.activitypub-dialog__description code{background:#f0f0f0;border-radius:3px;font-size:.9rem;padding:.1rem .3rem}.activitypub-dialog__button-group{display:flex;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input{border:1px solid #ddd;border-radius:4px 0 0 4px;flex:1;font-size:1rem;margin:0}.activitypub-dialog__button-group input[aria-invalid=true]{border-color:#cc1818}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important}.activitypub-dialog__error{color:#cc1818;font-size:.9rem;margin-top:.5rem}body.modal-open{overflow:hidden}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}} diff --git a/src/follow-me/style.scss b/src/follow-me/style.scss index b4c222769..d290e07f8 100644 --- a/src/follow-me/style.scss +++ b/src/follow-me/style.scss @@ -79,6 +79,7 @@ right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.5); + color: initial; z-index: 100000; display: flex; align-items: center; From b276af0c01bb72e5ce7d3b22926446c62676d6d4 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Thu, 15 May 2025 14:10:16 -0500 Subject: [PATCH 27/47] Make dependency on apiFetch explicit --- build/follow-me/block.json | 1 + build/follow-me/style-view.css.map | 2 +- build/follow-me/view.asset.php | 2 +- build/follow-me/view.js | 2 +- build/follow-me/view.js.map | 2 +- src/follow-me/block.json | 1 + src/follow-me/view.js | 3 +++ 7 files changed, 9 insertions(+), 4 deletions(-) diff --git a/build/follow-me/block.json b/build/follow-me/block.json index 98484cbcc..14f41256a 100644 --- a/build/follow-me/block.json +++ b/build/follow-me/block.json @@ -59,6 +59,7 @@ ], "editorScript": "file:./index.js", "viewScriptModule": "file:./view.js", + "viewScript": "wp-api-fetch", "style": "file:./style-view.css", "render": "file:./render.php" } \ No newline at end of file diff --git a/build/follow-me/style-view.css.map b/build/follow-me/style-view.css.map index 730664b5c..fdfda2a8b 100644 --- a/build/follow-me/style-view.css.map +++ b/build/follow-me/style-view.css.map @@ -1 +1 @@ -{"version":3,"file":"follow-me/style-view.css","mappings":";;;AAAA;EACC;EACA;AACD;;AAGC;EACC;EACA;EACA;AAAF;AAEE;EACC;EACA;EACA;EACA;EACA;KAAA;AAAH;AAGE;EACC;EACA;EACA;AADH;AAIE;EACC;EACA;EACA;EACA;AAFH;AAKE;EACC;EACA;EACA;EACA;EACA;AAHH;AAME;EACC;EACA;EACA;AAJH;AAMG;EACC;EACA;AAJJ;AAQE;EACC;AANH;AASE;EACC;EACA;AAPH;AAUE;EACC;EACA;AARH;AAYC;EAEC;EACA;AAXF;;AAgBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAbF;AAeE;EACC;AAbH;AAiBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAfF;AAkBC;EACC;EACA;EACA;EACA;EACA;EACA;AAhBF;AAmBC;EACC;EACA;EACA;EACA;AAjBF;AAoBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAlBF;AAoBE;EACC;EACA;AAlBH;AAqBE;EACC;EACA;EACA;EACA;AAnBH;AAuBC;EACC;AArBF;;AA0BC;EACC;EACA;AAvBF;AAyBE;EACC;AAvBH;AA0BE;EACC;EACA;EACA;AAxBH;AA4BC;EACC;EACA;EACA;AA1BF;AA4BE;EACC;EACA;EACA;EACA;AA1BH;AA8BC;EACC;EACA;EACA;AA5BF;AA8BE;EACC;EACA;EACA;EACA;EACA;AA5BH;AA8BG;EACC;AA5BJ;AAgCE;EACC;EACA;AA9BH;AAkCC;EACC;EACA;EACA;AAhCF;;AAoCA;EACC;AAjCD;;AAoCA;AACA;EACC;IACC;IACA;EAjCA;EAmCD;IACC;IACA;EAjCA;AACF,C","sources":["webpack://wordpress-activitypub/./src/follow-me/style.scss"],"sourcesContent":[".activitypub-follow-me-block-wrapper {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.activitypub-follow-me-block-wrapper {\n\t.activitypub-profile {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tpadding: 1rem 0;\n\n\t\t&__avatar {\n\t\t\twidth: 75px;\n\t\t\theight: 75px;\n\t\t\tborder-radius: 50%;\n\t\t\tmargin-right: 1rem;\n\t\t\tobject-fit: cover;\n\t\t}\n\n\t\t&__content {\n\t\t\tflex: 1;\n\t\t\tmargin-right: 1rem;\n\t\t\tmin-width: 0;\n\t\t}\n\n\t\t&__name {\n\t\t\tfont-size: 1.25em;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t&__handle {\n\t\t\tcolor: inherit;\n\t\t\tline-height: 1.2;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t.wp-block-button {\n\t\t\tmargin: 0;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\n\t\t\t&:not(:only-child) {\n\t\t\t\tflex: 0.5;\n\t\t\t\tmargin-left: 1rem;\n\t\t\t}\n\t\t}\n\n\t\t.wp-block-button__link {\n\t\t\tmargin: 0;\n\t\t}\n\n\t\t.is-small {\n\t\t\tpadding: 0.25rem 0.5rem;\n\t\t\tfont-size: 0.8rem;\n\t\t}\n\n\t\t.is-compact {\n\t\t\tpadding: 0.4rem 0.8rem;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t}\n\n\t&.has-background .activitypub-profile,\n\t&.has-border .activitypub-profile {\n\t\tpadding-left: 1rem;\n\t\tpadding-right: 1rem;\n\t}\n}\n\n.activitypub-modal {\n\t&__overlay {\n\t\tposition: fixed;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tbackground-color: rgba(0, 0, 0, 0.5);\n\t\tz-index: 100000;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tpadding: 1rem;\n\n\t\t&[hidden] {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&__frame {\n\t\tmax-width: 660px;\n\t\twidth: 100%;\n\t\tbackground-color: #fff;\n\t\tborder-radius: 4px;\n\t\tbox-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);\n\t\toverflow: hidden;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmax-height: calc(100vh - 2rem);\n\t\tanimation: activitypub-modal-appear 0.2s ease-out;\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\tpadding: 1rem 1rem 1rem 1.5rem;\n\t\tborder-bottom: 1px solid #e2e4e7;\n\t\tflex-shrink: 0;\n\t}\n\n\t&__title {\n\t\tmargin: 0 !important;\n\t\tfont-size: 1.3rem;\n\t\tfont-weight: 600;\n\t\tline-height: 1.4;\n\t}\n\n\t&__close {\n\t\tbackground: none;\n\t\tborder: none;\n\t\tpadding: 0.5rem;\n\t\tcursor: pointer;\n\t\tcolor: #555;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t&:hover {\n\t\t\tbackground: none;\n\t\t\tcolor: #000;\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #000;\n\t\t\tpadding: 0.5rem;\n\t\t}\n\t}\n\n\t&__content {\n\t\toverflow-y: auto;\n\t}\n}\n\n.activitypub-dialog {\n\t&__section {\n\t\tpadding: 1rem 1.5rem;\n\t\tborder-bottom: 1px solid #f0f0f0;\n\n\t\t&:last-child {\n\t\t\tborder-bottom: none;\n\t\t}\n\n\t\th4 {\n\t\t\tmargin-top: 0;\n\t\t\tmargin-bottom: 0.5rem;\n\t\t\tfont-size: 1.1rem;\n\t\t}\n\t}\n\n\t&__description {\n\t\tmargin-bottom: 1rem;\n\t\tcolor: inherit;\n\t\tfont-size: 0.95rem;\n\n\t\tcode {\n\t\t\tbackground: #f0f0f0;\n\t\t\tpadding: 0.1rem 0.3rem;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t}\n\n\t&__button-group {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\tmargin-bottom: 0.5rem;\n\n\t\tinput {\n\t\t\tflex: 1;\n\t\t\tborder: 1px solid #ddd;\n\t\t\tborder-radius: 4px 0 0 4px;\n\t\t\tfont-size: 1rem;\n\t\t\tmargin: 0;\n\n\t\t\t&[aria-invalid=\"true\"] {\n\t\t\t\tborder-color: #cc1818;\n\t\t\t}\n\t\t}\n\n\t\tbutton {\n\t\t\tborder-radius: 0 4px 4px 0 !important;\n\t\t\tmargin-left: -1px !important;\n\t\t}\n\t}\n\n\t&__error {\n\t\tcolor: #cc1818;\n\t\tfont-size: 0.9rem;\n\t\tmargin-top: 0.5rem;\n\t}\n}\n\nbody.modal-open {\n\toverflow: hidden;\n}\n\n/* Animation for modal */\n@keyframes activitypub-modal-appear {\n\tfrom {\n\t\topacity: 0;\n\t\ttransform: translateY(20px);\n\t}\n\tto {\n\t\topacity: 1;\n\t\ttransform: translateY(0);\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"follow-me/style-view.css","mappings":";;;AAAA;EACC;EACA;AACD;;AAGC;EACC;EACA;EACA;AAAF;AAEE;EACC;EACA;EACA;EACA;EACA;KAAA;AAAH;AAGE;EACC;EACA;EACA;AADH;AAIE;EACC;EACA;EACA;EACA;AAFH;AAKE;EACC;EACA;EACA;EACA;EACA;AAHH;AAME;EACC;EACA;EACA;AAJH;AAMG;EACC;EACA;AAJJ;AAQE;EACC;AANH;AASE;EACC;EACA;AAPH;AAUE;EACC;EACA;AARH;AAYC;EAEC;EACA;AAXF;;AAgBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAbF;AAeE;EACC;AAbH;AAiBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAfF;AAkBC;EACC;EACA;EACA;EACA;EACA;EACA;AAhBF;AAmBC;EACC;EACA;EACA;EACA;AAjBF;AAoBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAlBF;AAoBE;EACC;EACA;AAlBH;AAqBE;EACC;EACA;EACA;EACA;AAnBH;AAuBC;EACC;AArBF;;AA0BC;EACC;EACA;AAvBF;AAyBE;EACC;AAvBH;AA0BE;EACC;EACA;EACA;AAxBH;AA4BC;EACC;EACA;EACA;AA1BF;AA4BE;EACC;EACA;EACA;EACA;AA1BH;AA8BC;EACC;EACA;EACA;AA5BF;AA8BE;EACC;EACA;EACA;EACA;EACA;AA5BH;AA8BG;EACC;AA5BJ;AAgCE;EACC;EACA;AA9BH;AAkCC;EACC;EACA;EACA;AAhCF;;AAoCA;EACC;AAjCD;;AAoCA;AACA;EACC;IACC;IACA;EAjCA;EAmCD;IACC;IACA;EAjCA;AACF,C","sources":["webpack://wordpress-activitypub/./src/follow-me/style.scss"],"sourcesContent":[".activitypub-follow-me-block-wrapper {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.activitypub-follow-me-block-wrapper {\n\t.activitypub-profile {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tpadding: 1rem 0;\n\n\t\t&__avatar {\n\t\t\twidth: 75px;\n\t\t\theight: 75px;\n\t\t\tborder-radius: 50%;\n\t\t\tmargin-right: 1rem;\n\t\t\tobject-fit: cover;\n\t\t}\n\n\t\t&__content {\n\t\t\tflex: 1;\n\t\t\tmargin-right: 1rem;\n\t\t\tmin-width: 0;\n\t\t}\n\n\t\t&__name {\n\t\t\tfont-size: 1.25em;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t&__handle {\n\t\t\tcolor: inherit;\n\t\t\tline-height: 1.2;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t.wp-block-button {\n\t\t\tmargin: 0;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\n\t\t\t&:not(:only-child) {\n\t\t\t\tflex: 0.5;\n\t\t\t\tmargin-left: 1rem;\n\t\t\t}\n\t\t}\n\n\t\t.wp-block-button__link {\n\t\t\tmargin: 0;\n\t\t}\n\n\t\t.is-small {\n\t\t\tpadding: 0.25rem 0.5rem;\n\t\t\tfont-size: 0.8rem;\n\t\t}\n\n\t\t.is-compact {\n\t\t\tpadding: 0.4rem 0.8rem;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t}\n\n\t&.has-background .activitypub-profile,\n\t&.has-border .activitypub-profile {\n\t\tpadding-left: 1rem;\n\t\tpadding-right: 1rem;\n\t}\n}\n\n.activitypub-modal {\n\t&__overlay {\n\t\tposition: fixed;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tbackground-color: rgba(0, 0, 0, 0.5);\n\t\tcolor: initial;\n\t\tz-index: 100000;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tpadding: 1rem;\n\n\t\t&[hidden] {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&__frame {\n\t\tmax-width: 660px;\n\t\twidth: 100%;\n\t\tbackground-color: #fff;\n\t\tborder-radius: 4px;\n\t\tbox-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);\n\t\toverflow: hidden;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmax-height: calc(100vh - 2rem);\n\t\tanimation: activitypub-modal-appear 0.2s ease-out;\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\tpadding: 1rem 1rem 1rem 1.5rem;\n\t\tborder-bottom: 1px solid #e2e4e7;\n\t\tflex-shrink: 0;\n\t}\n\n\t&__title {\n\t\tmargin: 0 !important;\n\t\tfont-size: 1.3rem;\n\t\tfont-weight: 600;\n\t\tline-height: 1.4;\n\t}\n\n\t&__close {\n\t\tbackground: none;\n\t\tborder: none;\n\t\tpadding: 0.5rem;\n\t\tcursor: pointer;\n\t\tcolor: #555;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t&:hover {\n\t\t\tbackground: none;\n\t\t\tcolor: #000;\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #000;\n\t\t\tpadding: 0.5rem;\n\t\t}\n\t}\n\n\t&__content {\n\t\toverflow-y: auto;\n\t}\n}\n\n.activitypub-dialog {\n\t&__section {\n\t\tpadding: 1rem 1.5rem;\n\t\tborder-bottom: 1px solid #f0f0f0;\n\n\t\t&:last-child {\n\t\t\tborder-bottom: none;\n\t\t}\n\n\t\th4 {\n\t\t\tmargin-top: 0;\n\t\t\tmargin-bottom: 0.5rem;\n\t\t\tfont-size: 1.1rem;\n\t\t}\n\t}\n\n\t&__description {\n\t\tmargin-bottom: 1rem;\n\t\tcolor: inherit;\n\t\tfont-size: 0.95rem;\n\n\t\tcode {\n\t\t\tbackground: #f0f0f0;\n\t\t\tpadding: 0.1rem 0.3rem;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t}\n\n\t&__button-group {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\tmargin-bottom: 0.5rem;\n\n\t\tinput {\n\t\t\tflex: 1;\n\t\t\tborder: 1px solid #ddd;\n\t\t\tborder-radius: 4px 0 0 4px;\n\t\t\tfont-size: 1rem;\n\t\t\tmargin: 0;\n\n\t\t\t&[aria-invalid=\"true\"] {\n\t\t\t\tborder-color: #cc1818;\n\t\t\t}\n\t\t}\n\n\t\tbutton {\n\t\t\tborder-radius: 0 4px 4px 0 !important;\n\t\t\tmargin-left: -1px !important;\n\t\t}\n\t}\n\n\t&__error {\n\t\tcolor: #cc1818;\n\t\tfont-size: 0.9rem;\n\t\tmargin-top: 0.5rem;\n\t}\n}\n\nbody.modal-open {\n\toverflow: hidden;\n}\n\n/* Animation for modal */\n@keyframes activitypub-modal-appear {\n\tfrom {\n\t\topacity: 0;\n\t\ttransform: translateY(20px);\n\t}\n\tto {\n\t\topacity: 1;\n\t\ttransform: translateY(0);\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/build/follow-me/view.asset.php b/build/follow-me/view.asset.php index 6060268c2..bf76897ab 100644 --- a/build/follow-me/view.asset.php +++ b/build/follow-me/view.asset.php @@ -1 +1 @@ - array('@wordpress/interactivity'), 'version' => '78ec8be488ab128fbcc1', 'type' => 'module'); + array('@wordpress/interactivity'), 'version' => '420d8351e16ed37b196f', 'type' => 'module'); diff --git a/build/follow-me/view.js b/build/follow-me/view.js index 0e979b6dc..70e74c332 100644 --- a/build/follow-me/view.js +++ b/build/follow-me/view.js @@ -1 +1 @@ -import*as e from"@wordpress/interactivity";var t,o,n={825:(t,o,n)=>{const r=(c={getContext:()=>e.getContext,store:()=>e.store},l={},n.d(l,c),l);var c,l;function i(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|");return`var(--wp--preset--color--${t})`}function s(e,t,o=null,n=""){return o?`${e}${n} { ${t}: ${o}; }\n`:""}function a(e,t,o,n){return s(e,"background-color",t)+s(e,"color",o)+s(e,"background-color",n,":hover")+s(e,"background-color",n,":focus")}const{state:d,actions:u}=(0,r.store)("activitypub/follow-me",{actions:{openModal(){const e=(0,r.getContext)();e.isModalOpen=!0,document.body.classList.add("modal-open"),setTimeout((()=>{const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".activitypub-modal__frame");e&&(n=(o=e).querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),r=n[0],c=n[n.length-1],r.focus(),o.addEventListener("keydown",(function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?document.activeElement===r&&(c.focus(),e.preventDefault()):document.activeElement===c&&(r.focus(),e.preventDefault()))})))}var o,n,r,c}),50)},closeModal(){const e=(0,r.getContext)();e.isModalOpen=!1,document.body.classList.remove("modal-open");const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".wp-block-button__link");e&&e.focus()}},toggleModal(){const{isModalOpen:e}=(0,r.getContext)();e?u.closeModal():u.openModal()},copyToClipboard(){const e=(0,r.getContext)();navigator.clipboard.writeText(e.webfinger).then((()=>{e.copyButtonText=d.i18n.copied,setTimeout((()=>{e.copyButtonText=d.i18n.copy}),1e3)}),(e=>{console.error("Could not copy text: ",e)}))},updateRemoteProfile(e){const t=(0,r.getContext)();t.remoteProfile=e.target.value,t.isError=!1,t.errorMessage=""},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),u.submitRemoteProfile())},submitRemoteProfile:function*(){const e=(0,r.getContext)(),{namespace:t}=d,o=e.remoteProfile.trim();if(!o)return e.isError=!0,void(e.errorMessage=d.i18n.emptyProfileError);if(!/^(https?:\/\/|@)/.test(o))return e.isError=!0,void(e.errorMessage=d.i18n.invalidProfileError);e.isLoading=!0,e.isError=!1;const n=`/${t}/actors/${e.userId}/remote-follow?resource=${encodeURIComponent(o)}`;try{const t=yield apiFetch({path:n});e.isLoading=!1,window.open(t.url,"_blank"),u.closeModal()}catch(t){console.error("Error submitting profile:",t),e.isLoading=!1,e.isError=!0,e.errorMessage=t.message||d.i18n.genericError}}},callbacks:{initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:t,blockId:o}=(0,r.getContext)();if(o&&e){const r=document.createElement("style"),c=`#${o}`;r.textContent=function(e,t,o){const n=`${e} .wp-block-button__link`,r=("string"==typeof(c=o)?`var(--wp--preset--color--${c})`:c?.color?.background||null)||t?.color?.background;var c;return a(n,i(t?.elements?.link?.color?.text),r,i(t?.elements?.link?.[":hover"]?.color?.text))}(c,e,t),document.head.appendChild(r);const l=document.createElement("style");l.textContent=(n=e,a(".activitypub-dialog__button-group .wp-block-button",i(n?.elements?.link?.color?.text)||"#111","#fff",i(n?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(l)}var n},documentKeydown(e){const{isModalOpen:t}=(0,r.getContext)();t&&"Escape"===e.key&&u.closeModal()},documentClick(e){const{blockId:t,isModalOpen:o}=(0,r.getContext)();if(!o)return;const n=document.getElementById(t);if(!n)return;const c=n.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(c&&(c===e.target||c.contains(e.target)))return;const l=n.querySelector(".activitypub-modal__frame");l&&!l.contains(e.target)&&u.closeModal()}}})}},r={};function c(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,c),o.exports}c.m=n,t=[],c.O=(e,o,n,r)=>{if(!o){var l=1/0;for(d=0;d=r)&&Object.keys(c.O).every((e=>c.O[e](o[s])))?o.splice(s--,1):(i=!1,r0&&t[d-1][2]>r;d--)t[d]=t[d-1];t[d]=[o,n,r]},c.d=(e,t)=>{for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={41:0,301:0},c.O.j=e=>0===o[e];var l=c.O(void 0,[301],(()=>c(825)));l=c.O(l); \ No newline at end of file +import*as e from"@wordpress/interactivity";var t,o,n={825:(t,o,n)=>{const r=(c={getContext:()=>e.getContext,store:()=>e.store},l={},n.d(l,c),l);var c,l;function i(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|");return`var(--wp--preset--color--${t})`}function s(e,t,o=null,n=""){return o?`${e}${n} { ${t}: ${o}; }\n`:""}function a(e,t,o,n){return s(e,"background-color",t)+s(e,"color",o)+s(e,"background-color",n,":hover")+s(e,"background-color",n,":focus")}const{apiFetch:d}=window.wp,{state:u,actions:p}=(0,r.store)("activitypub/follow-me",{actions:{openModal(){const e=(0,r.getContext)();e.isModalOpen=!0,document.body.classList.add("modal-open"),setTimeout((()=>{const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".activitypub-modal__frame");e&&(n=(o=e).querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),r=n[0],c=n[n.length-1],r.focus(),o.addEventListener("keydown",(function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?document.activeElement===r&&(c.focus(),e.preventDefault()):document.activeElement===c&&(r.focus(),e.preventDefault()))})))}var o,n,r,c}),50)},closeModal(){const e=(0,r.getContext)();e.isModalOpen=!1,document.body.classList.remove("modal-open");const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".wp-block-button__link");e&&e.focus()}},toggleModal(){const{isModalOpen:e}=(0,r.getContext)();e?p.closeModal():p.openModal()},copyToClipboard(){const e=(0,r.getContext)();navigator.clipboard.writeText(e.webfinger).then((()=>{e.copyButtonText=u.i18n.copied,setTimeout((()=>{e.copyButtonText=u.i18n.copy}),1e3)}),(e=>{console.error("Could not copy text: ",e)}))},updateRemoteProfile(e){const t=(0,r.getContext)();t.remoteProfile=e.target.value,t.isError=!1,t.errorMessage=""},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),p.submitRemoteProfile())},submitRemoteProfile:function*(){const e=(0,r.getContext)(),{namespace:t}=u,o=e.remoteProfile.trim();if(!o)return e.isError=!0,void(e.errorMessage=u.i18n.emptyProfileError);if(!/^(https?:\/\/|@)/.test(o))return e.isError=!0,void(e.errorMessage=u.i18n.invalidProfileError);e.isLoading=!0,e.isError=!1;const n=`/${t}/actors/${e.userId}/remote-follow?resource=${encodeURIComponent(o)}`;try{const t=yield d({path:n});e.isLoading=!1,window.open(t.url,"_blank"),p.closeModal()}catch(t){console.error("Error submitting profile:",t),e.isLoading=!1,e.isError=!0,e.errorMessage=t.message||u.i18n.genericError}}},callbacks:{initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:t,blockId:o}=(0,r.getContext)();if(o&&e){const r=document.createElement("style"),c=`#${o}`;r.textContent=function(e,t,o){const n=`${e} .wp-block-button__link`,r=("string"==typeof(c=o)?`var(--wp--preset--color--${c})`:c?.color?.background||null)||t?.color?.background;var c;return a(n,i(t?.elements?.link?.color?.text),r,i(t?.elements?.link?.[":hover"]?.color?.text))}(c,e,t),document.head.appendChild(r);const l=document.createElement("style");l.textContent=(n=e,a(".activitypub-dialog__button-group .wp-block-button",i(n?.elements?.link?.color?.text)||"#111","#fff",i(n?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(l)}var n},documentKeydown(e){const{isModalOpen:t}=(0,r.getContext)();t&&"Escape"===e.key&&p.closeModal()},documentClick(e){const{blockId:t,isModalOpen:o}=(0,r.getContext)();if(!o)return;const n=document.getElementById(t);if(!n)return;const c=n.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(c&&(c===e.target||c.contains(e.target)))return;const l=n.querySelector(".activitypub-modal__frame");l&&!l.contains(e.target)&&p.closeModal()}}})}},r={};function c(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,c),o.exports}c.m=n,t=[],c.O=(e,o,n,r)=>{if(!o){var l=1/0;for(d=0;d=r)&&Object.keys(c.O).every((e=>c.O[e](o[s])))?o.splice(s--,1):(i=!1,r0&&t[d-1][2]>r;d--)t[d]=t[d-1];t[d]=[o,n,r]},c.d=(e,t)=>{for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={41:0,301:0},c.O.j=e=>0===o[e];var l=c.O(void 0,[301],(()=>c(825)));l=c.O(l); \ No newline at end of file diff --git a/build/follow-me/view.js.map b/build/follow-me/view.js.map index 321887652..e9a88ed38 100644 --- a/build/follow-me/view.js.map +++ b/build/follow-me/view.js.map @@ -1 +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ACa,UAAU,CAAC,CAAC;IACrB;EACD;AACD,CAAE,CAAC;;;;;;;;;;AC/PH;;;;;;SCAA;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;SAEA;SACA;;;;;UCzBA;UACA;UACA;UACA;UACA,+BAA+B,wCAAwC;UACvE;UACA;UACA;UACA;UACA,iBAAiB,qBAAqB;UACtC;UACA;UACA,kBAAkB,qBAAqB;UACvC;UACA;UACA,KAAK;UACL;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;;;;UC3BA;UACA;UACA;UACA;UACA,yCAAyC,wCAAwC;UACjF;UACA;UACA;;;;;UCPA;;;;;UCAA;UACA;UACA;UACA,uDAAuD,iBAAiB;UACxE;UACA,gDAAgD,aAAa;UAC7D;;;;;UCNA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;;;;SEpBA;SACA;SACA;SACA;SACA","sources":["webpack://wordpress-activitypub/./src/follow-me/button-style.js","webpack://wordpress-activitypub/./src/follow-me/style.scss","webpack://wordpress-activitypub/./src/follow-me/view.js","webpack://wordpress-activitypub/external module \"@wordpress/interactivity\"","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/chunk loaded","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/webpack/runtime/import chunk loading","webpack://wordpress-activitypub/webpack/before-startup","webpack://wordpress-activitypub/webpack/startup","webpack://wordpress-activitypub/webpack/after-startup"],"sourcesContent":["/**\n * Gets the background color from a style object.\n *\n * @param {Object|string} color Color object or string.\n * @return {string|null} Background color.\n */\nfunction getBackgroundColor( color ) {\n\t// If color is a string, it's a var like this.\n\tif ( typeof color === 'string' ) {\n\t\treturn `var(--wp--preset--color--${ color })`;\n\t}\n\n\treturn color?.color?.background || null;\n}\n\n/**\n * Gets the link color from a style object.\n *\n * @param {string} text Text color.\n * @return {string|null} Link color.\n */\nfunction getLinkColor( text ) {\n\tif ( typeof text !== 'string' ) {\n\t\treturn null;\n\t}\n\t// If it starts with a hash, leave it be.\n\tif ( text.match( /^#/ ) ) {\n\t\t// We don't handle the alpha channel if present.\n\t\treturn text.substring( 0, 7 );\n\t}\n\t// var:preset|color|luminous-vivid-amber\n\t// var(--wp--preset--color--luminous-vivid-amber)\n\t// We will receive the top format, we need to output the bottom format.\n\tconst [ , , color ] = text.split( '|' );\n\treturn `var(--wp--preset--color--${ color })`;\n}\n\n/**\n * Generates a CSS selector.\n *\n * @param {string} selector CSS selector.\n * @param {string} prop CSS property.\n * @param {string|null} value CSS value.\n * @param {string} pseudo Pseudo-selector.\n * @return {string} CSS selector.\n */\nfunction generateSelector( selector, prop, value = null, pseudo = '' ) {\n\tif ( ! value ) {\n\t\treturn '';\n\t}\n\treturn `${ selector }${ pseudo } { ${ prop }: ${ value }; }\\n`;\n}\n\n/**\n * Gets styles for a button.\n *\n * @param {string} selector CSS selector.\n * @param {string} button Button color.\n * @param {string} text Text color.\n * @param {string} hover Hover color.\n * @return {string} CSS styles.\n */\nfunction getStyles( selector, button, text, hover ) {\n\treturn (\n\t\tgenerateSelector( selector, 'background-color', button ) +\n\t\tgenerateSelector( selector, 'color', text ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':hover' ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':focus' )\n\t);\n}\n\n/**\n * Gets block styles.\n *\n * @param {string} base Base selector.\n * @param {Object} style Style object.\n * @param {Object|string} backgroundColor Background color.\n * @return {string} CSS styles.\n */\nexport function getBlockStyles( base, style, backgroundColor ) {\n\tconst selector = `${ base } .wp-block-button__link`;\n\n\t// We grab the background color if set as a good color for our button text.\n\tconst buttonTextColor =\n\t\tgetBackgroundColor( backgroundColor ) ||\n\t\t// Background might be in this form.\n\t\tstyle?.color?.background;\n\n\t// We misuse the link color for the button background.\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text );\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text );\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n\n/**\n * Gets popup styles.\n *\n * @param {Object} style Style object.\n * @return {string} CSS styles.\n */\nexport function getPopupStyles( style ) {\n\t// We don't accept backgroundColor because the popup is always white (right?).\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text ) || '#111';\n\tconst buttonTextColor = '#fff';\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text ) || '#333';\n\tconst selector = '.activitypub-dialog__button-group .wp-block-button';\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n","// extracted by mini-css-extract-plugin\nexport {};","import { store, getContext } from '@wordpress/interactivity';\nimport { getBlockStyles, getPopupStyles } from './button-style';\nimport './style.scss';\n\n/**\n * Traps focus within the specified element.\n *\n * @param {Element} element The element to trap focus within.\n */\nfunction trapFocus( element ) {\n\tvar focusableElements = element.querySelectorAll(\n\t\t'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type=\"text\"]:not([disabled]), input[type=\"radio\"]:not([disabled]), input[type=\"checkbox\"]:not([disabled]), select:not([disabled])'\n\t);\n\tvar firstFocusableElement = focusableElements[ 0 ];\n\tvar lastFocusableElement = focusableElements[ focusableElements.length - 1 ];\n\tfirstFocusableElement.focus();\n\n\telement.addEventListener( 'keydown', function ( event ) {\n\t\tif ( event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */ ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.shiftKey ) {\n\t\t\t/* shift + tab */\n\t\t\tif ( document.activeElement === firstFocusableElement ) {\n\t\t\t\tlastFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t} /* tab */ else {\n\t\t\tif ( document.activeElement === lastFocusableElement ) {\n\t\t\t\tfirstFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t} );\n}\n\nconst { state, actions } = store( 'activitypub/follow-me', {\n\tactions: {\n\t\t/**\n\t\t * Open the modal.\n\t\t */\n\t\topenModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = true;\n\t\t\tdocument.body.classList.add( 'modal-open' );\n\n\t\t\t// Set up the focus trap after modal is open.\n\t\t\tsetTimeout( () => {\n\t\t\t\t// Use the blockId to find the specific modal frame for this block.\n\t\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\t\tif ( blockWrapper ) {\n\t\t\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\t\t\tif ( modalFrame ) {\n\t\t\t\t\t\ttrapFocus( modalFrame );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 50 );\n\t\t},\n\n\t\t/**\n\t\t * Close the modal.\n\t\t */\n\t\tcloseModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = false;\n\t\t\tdocument.body.classList.remove( 'modal-open' );\n\n\t\t\t// Return focus to the button that opened the modal.\n\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\tif ( blockWrapper ) {\n\t\t\t\tconst openButton = blockWrapper.querySelector( '.wp-block-button__link' );\n\t\t\t\tif ( openButton ) {\n\t\t\t\t\topenButton.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\ttoggleModal() {\n\t\t\tconst { isModalOpen } = getContext();\n\n\t\t\tisModalOpen ? actions.closeModal() : actions.openModal();\n\t\t},\n\n\t\t/**\n\t\t * Copy the webfinger to clipboard.\n\t\t */\n\t\tcopyToClipboard() {\n\t\t\tconst context = getContext();\n\n\t\t\t// Use the Clipboard API to copy text.\n\t\t\tnavigator.clipboard.writeText( context.webfinger ).then(\n\t\t\t\t() => {\n\t\t\t\t\t// Update button text to show success.\n\t\t\t\t\tcontext.copyButtonText = state.i18n.copied;\n\n\t\t\t\t\t// Reset button text after 1 second.\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tcontext.copyButtonText = state.i18n.copy;\n\t\t\t\t\t}, 1000 );\n\t\t\t\t},\n\t\t\t\t( error ) => {\n\t\t\t\t\t// Log error if copying fails.\n\t\t\t\t\tconsole.error( 'Could not copy text: ', error );\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the remote profile value.\n\t\t *\n\t\t * @param {Event} event Input event.\n\t\t */\n\t\tupdateRemoteProfile( event ) {\n\t\t\tconst context = getContext();\n\t\t\tcontext.remoteProfile = event.target.value;\n\t\t\t// Reset error state when input changes.\n\t\t\tcontext.isError = false;\n\t\t\tcontext.errorMessage = '';\n\t\t},\n\n\t\t/**\n\t\t * Handle keydown event for remote profile input.\n\t\t *\n\t\t * @param {Event} event Keydown event.\n\t\t */\n\t\thandleKeyDown( event ) {\n\t\t\tif ( event.key === 'Enter' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tactions.submitRemoteProfile();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Submit the remote profile.\n\t\t */\n\t\tsubmitRemoteProfile: function* () {\n\t\t\tconst context = getContext();\n\t\t\tconst { namespace } = state;\n\t\t\tconst input = context.remoteProfile.trim();\n\n\t\t\t// Validate input.\n\t\t\tif ( ! input ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.emptyProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! /^(https?:\\/\\/|@)/.test( input ) ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.invalidProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set loading state.\n\t\t\tcontext.isLoading = true;\n\t\t\tcontext.isError = false;\n\n\t\t\t// Construct the API path.\n\t\t\tconst path = `/${ namespace }/actors/${ context.userId }/remote-follow?resource=${ encodeURIComponent(\n\t\t\t\tinput\n\t\t\t) }`;\n\n\t\t\ttry {\n\t\t\t\t// Make the API request.\n\t\t\t\tconst response = yield apiFetch( { path } );\n\n\t\t\t\t// Set opening state.\n\t\t\t\tcontext.isLoading = false;\n\n\t\t\t\t// Open the remote follow URL in a new tab.\n\t\t\t\twindow.open( response.url, '_blank' );\n\n\t\t\t\t// Close the modal after opening the URL.\n\t\t\t\tactions.closeModal();\n\t\t\t} catch ( error ) {\n\t\t\t\t// Handle error.\n\t\t\t\tconsole.error( 'Error submitting profile:', error );\n\t\t\t\tcontext.isLoading = false;\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = error.message || state.i18n.genericError;\n\t\t\t}\n\t\t},\n\t},\n\tcallbacks: {\n\t\t/**\n\t\t * Initialize button styles.\n\t\t */\n\t\tinitButtonStyles: () => {\n\t\t\tconst { buttonStyle, backgroundColor, blockId } = getContext();\n\n\t\t\t// Add dynamic button styles to the document.\n\t\t\tif ( blockId && buttonStyle ) {\n\t\t\t\tconst styleElement = document.createElement( 'style' );\n\t\t\t\tconst selector = `#${ blockId }`;\n\n\t\t\t\t// Use getBlockStyles from button-style.js to get the CSS string.\n\t\t\t\tstyleElement.textContent = getBlockStyles( selector, buttonStyle, backgroundColor );\n\n\t\t\t\tdocument.head.appendChild( styleElement );\n\n\t\t\t\t// Add popup styles.\n\t\t\t\tconst popupStyleElement = document.createElement( 'style' );\n\t\t\t\tpopupStyleElement.textContent = getPopupStyles( buttonStyle );\n\t\t\t\tdocument.head.appendChild( popupStyleElement );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when pressing ESC key.\n\t\t *\n\t\t * @param {Event} event Keyboard event.\n\t\t */\n\t\tdocumentKeydown( event ) {\n\t\t\tconst { isModalOpen } = getContext();\n\n\t\t\tif ( isModalOpen && event.key === 'Escape' ) {\n\t\t\t\tactions.closeModal();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when clicking outside.\n\t\t *\n\t\t * @param {Event} event Click event.\n\t\t */\n\t\tdocumentClick( event ) {\n\t\t\tconst { blockId, isModalOpen } = getContext();\n\t\t\tif ( ! isModalOpen ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Get the block wrapper element.\n\t\t\tconst blockWrapper = document.getElementById( blockId );\n\t\t\tif ( ! blockWrapper ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If the click was on the button or its children, we should not close the modal.\n\t\t\tconst toggleButton = blockWrapper.querySelector(\n\t\t\t\t'.wp-element-button[data-wp-on--click=\"actions.toggleModal\"]'\n\t\t\t);\n\t\t\tif ( toggleButton && ( toggleButton === event.target || toggleButton.contains( event.target ) ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if the click was inside the modal frame.\n\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\tif ( ! modalFrame || modalFrame.contains( event.target ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactions.closeModal();\n\t\t},\n\t},\n} );\n","module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;","// 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\t// no module.id needed\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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"follow-me/view\": 0,\n\t\"follow-me/style-view\": 0\n};\n\n// no install chunk\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no external install chunk\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"follow-me/style-view\"], () => (__webpack_require__(\"./src/follow-me/view.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["getBackgroundColor","color","background","getLinkColor","text","match","substring","split","generateSelector","selector","prop","value","pseudo","getStyles","button","hover","getBlockStyles","base","style","backgroundColor","buttonTextColor","buttonColor","elements","link","buttonHoverColor","getPopupStyles","store","getContext","trapFocus","element","focusableElements","querySelectorAll","firstFocusableElement","lastFocusableElement","length","focus","addEventListener","event","key","keyCode","shiftKey","document","activeElement","preventDefault","state","actions","openModal","context","isModalOpen","body","classList","add","setTimeout","blockWrapper","getElementById","blockId","modalFrame","querySelector","closeModal","remove","openButton","toggleModal","copyToClipboard","navigator","clipboard","writeText","webfinger","then","copyButtonText","i18n","copied","copy","error","console","updateRemoteProfile","remoteProfile","target","isError","errorMessage","handleKeyDown","submitRemoteProfile","namespace","input","trim","emptyProfileError","test","invalidProfileError","isLoading","path","userId","encodeURIComponent","response","apiFetch","window","open","url","message","genericError","callbacks","initButtonStyles","buttonStyle","styleElement","createElement","textContent","head","appendChild","popupStyleElement","documentKeydown","documentClick","toggleButton","contains"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"follow-me/view.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,kBAAkBA,CAAEC,KAAK,EAAG;EACpC;EACA,IAAK,OAAOA,KAAK,KAAK,QAAQ,EAAG;IAChC,OAAO,4BAA6BA,KAAK,GAAI;EAC9C;EAEA,OAAOA,KAAK,EAAEA,KAAK,EAAEC,UAAU,IAAI,IAAI;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAAEC,IAAI,EAAG;EAC7B,IAAK,OAAOA,IAAI,KAAK,QAAQ,EAAG;IAC/B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UACL;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;;;;UC3BA;UACA;UACA;UACA;UACA,yCAAyC,wCAAwC;UACjF;UACA;UACA;;;;;UCPA;;;;;UCAA;UACA;UACA;UACA,uDAAuD,iBAAiB;UACxE;UACA,gDAAgD,aAAa;UAC7D;;;;;UCNA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;;;;SEpBA;SACA;SACA;SACA;SACA","sources":["webpack://wordpress-activitypub/./src/follow-me/button-style.js","webpack://wordpress-activitypub/./src/follow-me/style.scss?8459","webpack://wordpress-activitypub/./src/follow-me/view.js","webpack://wordpress-activitypub/external module \"@wordpress/interactivity\"","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/chunk loaded","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/webpack/runtime/import chunk loading","webpack://wordpress-activitypub/webpack/before-startup","webpack://wordpress-activitypub/webpack/startup","webpack://wordpress-activitypub/webpack/after-startup"],"sourcesContent":["/**\n * Gets the background color from a style object.\n *\n * @param {Object|string} color Color object or string.\n * @return {string|null} Background color.\n */\nfunction getBackgroundColor( color ) {\n\t// If color is a string, it's a var like this.\n\tif ( typeof color === 'string' ) {\n\t\treturn `var(--wp--preset--color--${ color })`;\n\t}\n\n\treturn color?.color?.background || null;\n}\n\n/**\n * Gets the link color from a style object.\n *\n * @param {string} text Text color.\n * @return {string|null} Link color.\n */\nfunction getLinkColor( text ) {\n\tif ( typeof text !== 'string' ) {\n\t\treturn null;\n\t}\n\t// If it starts with a hash, leave it be.\n\tif ( text.match( /^#/ ) ) {\n\t\t// We don't handle the alpha channel if present.\n\t\treturn text.substring( 0, 7 );\n\t}\n\t// var:preset|color|luminous-vivid-amber\n\t// var(--wp--preset--color--luminous-vivid-amber)\n\t// We will receive the top format, we need to output the bottom format.\n\tconst [ , , color ] = text.split( '|' );\n\treturn `var(--wp--preset--color--${ color })`;\n}\n\n/**\n * Generates a CSS selector.\n *\n * @param {string} selector CSS selector.\n * @param {string} prop CSS property.\n * @param {string|null} value CSS value.\n * @param {string} pseudo Pseudo-selector.\n * @return {string} CSS selector.\n */\nfunction generateSelector( selector, prop, value = null, pseudo = '' ) {\n\tif ( ! value ) {\n\t\treturn '';\n\t}\n\treturn `${ selector }${ pseudo } { ${ prop }: ${ value }; }\\n`;\n}\n\n/**\n * Gets styles for a button.\n *\n * @param {string} selector CSS selector.\n * @param {string} button Button color.\n * @param {string} text Text color.\n * @param {string} hover Hover color.\n * @return {string} CSS styles.\n */\nfunction getStyles( selector, button, text, hover ) {\n\treturn (\n\t\tgenerateSelector( selector, 'background-color', button ) +\n\t\tgenerateSelector( selector, 'color', text ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':hover' ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':focus' )\n\t);\n}\n\n/**\n * Gets block styles.\n *\n * @param {string} base Base selector.\n * @param {Object} style Style object.\n * @param {Object|string} backgroundColor Background color.\n * @return {string} CSS styles.\n */\nexport function getBlockStyles( base, style, backgroundColor ) {\n\tconst selector = `${ base } .wp-block-button__link`;\n\n\t// We grab the background color if set as a good color for our button text.\n\tconst buttonTextColor =\n\t\tgetBackgroundColor( backgroundColor ) ||\n\t\t// Background might be in this form.\n\t\tstyle?.color?.background;\n\n\t// We misuse the link color for the button background.\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text );\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text );\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n\n/**\n * Gets popup styles.\n *\n * @param {Object} style Style object.\n * @return {string} CSS styles.\n */\nexport function getPopupStyles( style ) {\n\t// We don't accept backgroundColor because the popup is always white (right?).\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text ) || '#111';\n\tconst buttonTextColor = '#fff';\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text ) || '#333';\n\tconst selector = '.activitypub-dialog__button-group .wp-block-button';\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n","// extracted by mini-css-extract-plugin\nexport {};","import { store, getContext } from '@wordpress/interactivity';\nimport { getBlockStyles, getPopupStyles } from './button-style';\nimport './style.scss';\n\n/** @var {object} wp WordPress global. */\nconst { apiFetch } = window.wp;\n\n/**\n * Traps focus within the specified element.\n *\n * @param {Element} element The element to trap focus within.\n */\nfunction trapFocus( element ) {\n\tvar focusableElements = element.querySelectorAll(\n\t\t'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type=\"text\"]:not([disabled]), input[type=\"radio\"]:not([disabled]), input[type=\"checkbox\"]:not([disabled]), select:not([disabled])'\n\t);\n\tvar firstFocusableElement = focusableElements[ 0 ];\n\tvar lastFocusableElement = focusableElements[ focusableElements.length - 1 ];\n\tfirstFocusableElement.focus();\n\n\telement.addEventListener( 'keydown', function ( event ) {\n\t\tif ( event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */ ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.shiftKey ) {\n\t\t\t/* shift + tab */\n\t\t\tif ( document.activeElement === firstFocusableElement ) {\n\t\t\t\tlastFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t} /* tab */ else {\n\t\t\tif ( document.activeElement === lastFocusableElement ) {\n\t\t\t\tfirstFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t} );\n}\n\nconst { state, actions } = store( 'activitypub/follow-me', {\n\tactions: {\n\t\t/**\n\t\t * Open the modal.\n\t\t */\n\t\topenModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = true;\n\t\t\tdocument.body.classList.add( 'modal-open' );\n\n\t\t\t// Set up the focus trap after modal is open.\n\t\t\tsetTimeout( () => {\n\t\t\t\t// Use the blockId to find the specific modal frame for this block.\n\t\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\t\tif ( blockWrapper ) {\n\t\t\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\t\t\tif ( modalFrame ) {\n\t\t\t\t\t\ttrapFocus( modalFrame );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 50 );\n\t\t},\n\n\t\t/**\n\t\t * Close the modal.\n\t\t */\n\t\tcloseModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = false;\n\t\t\tdocument.body.classList.remove( 'modal-open' );\n\n\t\t\t// Return focus to the button that opened the modal.\n\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\tif ( blockWrapper ) {\n\t\t\t\tconst openButton = blockWrapper.querySelector( '.wp-block-button__link' );\n\t\t\t\tif ( openButton ) {\n\t\t\t\t\topenButton.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\ttoggleModal() {\n\t\t\tconst { isModalOpen } = getContext();\n\n\t\t\tisModalOpen ? actions.closeModal() : actions.openModal();\n\t\t},\n\n\t\t/**\n\t\t * Copy the webfinger to clipboard.\n\t\t */\n\t\tcopyToClipboard() {\n\t\t\tconst context = getContext();\n\n\t\t\t// Use the Clipboard API to copy text.\n\t\t\tnavigator.clipboard.writeText( context.webfinger ).then(\n\t\t\t\t() => {\n\t\t\t\t\t// Update button text to show success.\n\t\t\t\t\tcontext.copyButtonText = state.i18n.copied;\n\n\t\t\t\t\t// Reset button text after 1 second.\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tcontext.copyButtonText = state.i18n.copy;\n\t\t\t\t\t}, 1000 );\n\t\t\t\t},\n\t\t\t\t( error ) => {\n\t\t\t\t\t// Log error if copying fails.\n\t\t\t\t\tconsole.error( 'Could not copy text: ', error );\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the remote profile value.\n\t\t *\n\t\t * @param {Event} event Input event.\n\t\t */\n\t\tupdateRemoteProfile( event ) {\n\t\t\tconst context = getContext();\n\t\t\tcontext.remoteProfile = event.target.value;\n\t\t\t// Reset error state when input changes.\n\t\t\tcontext.isError = false;\n\t\t\tcontext.errorMessage = '';\n\t\t},\n\n\t\t/**\n\t\t * Handle keydown event for remote profile input.\n\t\t *\n\t\t * @param {Event} event Keydown event.\n\t\t */\n\t\thandleKeyDown( event ) {\n\t\t\tif ( event.key === 'Enter' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tactions.submitRemoteProfile();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Submit the remote profile.\n\t\t */\n\t\tsubmitRemoteProfile: function* () {\n\t\t\tconst context = getContext();\n\t\t\tconst { namespace } = state;\n\t\t\tconst input = context.remoteProfile.trim();\n\n\t\t\t// Validate input.\n\t\t\tif ( ! input ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.emptyProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! /^(https?:\\/\\/|@)/.test( input ) ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.invalidProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set loading state.\n\t\t\tcontext.isLoading = true;\n\t\t\tcontext.isError = false;\n\n\t\t\t// Construct the API path.\n\t\t\tconst path = `/${ namespace }/actors/${ context.userId }/remote-follow?resource=${ encodeURIComponent(\n\t\t\t\tinput\n\t\t\t) }`;\n\n\t\t\ttry {\n\t\t\t\t// Make the API request.\n\t\t\t\tconst response = yield apiFetch( { path } );\n\n\t\t\t\t// Set opening state.\n\t\t\t\tcontext.isLoading = false;\n\n\t\t\t\t// Open the remote follow URL in a new tab.\n\t\t\t\twindow.open( response.url, '_blank' );\n\n\t\t\t\t// Close the modal after opening the URL.\n\t\t\t\tactions.closeModal();\n\t\t\t} catch ( error ) {\n\t\t\t\t// Handle error.\n\t\t\t\tconsole.error( 'Error submitting profile:', error );\n\t\t\t\tcontext.isLoading = false;\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = error.message || state.i18n.genericError;\n\t\t\t}\n\t\t},\n\t},\n\tcallbacks: {\n\t\t/**\n\t\t * Initialize button styles.\n\t\t */\n\t\tinitButtonStyles: () => {\n\t\t\tconst { buttonStyle, backgroundColor, blockId } = getContext();\n\n\t\t\t// Add dynamic button styles to the document.\n\t\t\tif ( blockId && buttonStyle ) {\n\t\t\t\tconst styleElement = document.createElement( 'style' );\n\t\t\t\tconst selector = `#${ blockId }`;\n\n\t\t\t\t// Use getBlockStyles from button-style.js to get the CSS string.\n\t\t\t\tstyleElement.textContent = getBlockStyles( selector, buttonStyle, backgroundColor );\n\n\t\t\t\tdocument.head.appendChild( styleElement );\n\n\t\t\t\t// Add popup styles.\n\t\t\t\tconst popupStyleElement = document.createElement( 'style' );\n\t\t\t\tpopupStyleElement.textContent = getPopupStyles( buttonStyle );\n\t\t\t\tdocument.head.appendChild( popupStyleElement );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when pressing ESC key.\n\t\t *\n\t\t * @param {Event} event Keyboard event.\n\t\t */\n\t\tdocumentKeydown( event ) {\n\t\t\tconst { isModalOpen } = getContext();\n\n\t\t\tif ( isModalOpen && event.key === 'Escape' ) {\n\t\t\t\tactions.closeModal();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when clicking outside.\n\t\t *\n\t\t * @param {Event} event Click event.\n\t\t */\n\t\tdocumentClick( event ) {\n\t\t\tconst { blockId, isModalOpen } = getContext();\n\t\t\tif ( ! isModalOpen ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Get the block wrapper element.\n\t\t\tconst blockWrapper = document.getElementById( blockId );\n\t\t\tif ( ! blockWrapper ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If the click was on the button or its children, we should not close the modal.\n\t\t\tconst toggleButton = blockWrapper.querySelector(\n\t\t\t\t'.wp-element-button[data-wp-on--click=\"actions.toggleModal\"]'\n\t\t\t);\n\t\t\tif ( toggleButton && ( toggleButton === event.target || toggleButton.contains( event.target ) ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if the click was inside the modal frame.\n\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\tif ( ! modalFrame || modalFrame.contains( event.target ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactions.closeModal();\n\t\t},\n\t},\n} );\n","module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;","// 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\t// no module.id needed\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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"follow-me/view\": 0,\n\t\"follow-me/style-view\": 0\n};\n\n// no install chunk\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no external install chunk\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"follow-me/style-view\"], () => (__webpack_require__(\"./src/follow-me/view.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["getBackgroundColor","color","background","getLinkColor","text","match","substring","split","generateSelector","selector","prop","value","pseudo","getStyles","button","hover","getBlockStyles","base","style","backgroundColor","buttonTextColor","buttonColor","elements","link","buttonHoverColor","getPopupStyles","store","getContext","apiFetch","window","wp","trapFocus","element","focusableElements","querySelectorAll","firstFocusableElement","lastFocusableElement","length","focus","addEventListener","event","key","keyCode","shiftKey","document","activeElement","preventDefault","state","actions","openModal","context","isModalOpen","body","classList","add","setTimeout","blockWrapper","getElementById","blockId","modalFrame","querySelector","closeModal","remove","openButton","toggleModal","copyToClipboard","navigator","clipboard","writeText","webfinger","then","copyButtonText","i18n","copied","copy","error","console","updateRemoteProfile","remoteProfile","target","isError","errorMessage","handleKeyDown","submitRemoteProfile","namespace","input","trim","emptyProfileError","test","invalidProfileError","isLoading","path","userId","encodeURIComponent","response","open","url","message","genericError","callbacks","initButtonStyles","buttonStyle","styleElement","createElement","textContent","head","appendChild","popupStyleElement","documentKeydown","documentClick","toggleButton","contains"],"sourceRoot":""} \ No newline at end of file diff --git a/src/follow-me/block.json b/src/follow-me/block.json index 4dbe19d5e..0522070cc 100644 --- a/src/follow-me/block.json +++ b/src/follow-me/block.json @@ -54,6 +54,7 @@ "usesContext": [ "postType", "postId" ], "editorScript": "file:./index.js", "viewScriptModule": "file:./view.js", + "viewScript": "wp-api-fetch", "style": "file:./style-view.css", "render": "file:./render.php" } diff --git a/src/follow-me/view.js b/src/follow-me/view.js index 801e7c755..d147e6b23 100644 --- a/src/follow-me/view.js +++ b/src/follow-me/view.js @@ -2,6 +2,9 @@ import { store, getContext } from '@wordpress/interactivity'; import { getBlockStyles, getPopupStyles } from './button-style'; import './style.scss'; +/** @var {object} wp WordPress global. */ +const { apiFetch } = window.wp; + /** * Traps focus within the specified element. * From f293b20d6c283f51fe94abf0a58b69d66299ce1c Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Thu, 15 May 2025 14:37:09 -0500 Subject: [PATCH 28/47] More standardized buttons and fonts --- build/follow-me/render.php | 4 ++-- build/follow-me/style-view.css | 2 +- build/follow-me/style-view.css.map | 2 +- src/follow-me/render.php | 4 ++-- src/follow-me/style.scss | 12 ++++++------ 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build/follow-me/render.php b/build/follow-me/render.php index ebfa8c303..2ee66ec53 100644 --- a/build/follow-me/render.php +++ b/build/follow-me/render.php @@ -145,7 +145,7 @@ class="activitypub-modal__close" disabled />
'; } -$content = Blocks::add_directions_to_button( $content, $attributes ); +$content = Blocks::add_directions( + $content, + array( 'class_name' => 'wp-element-button' ), + array( + 'data-wp-on--click' => 'actions.toggleModal', + 'data-wp-bind--aria-expanded' => 'context.isModalOpen', + 'aria-label' => __( 'Follow me on the Fediverse', 'activitypub' ), + 'aria-haspopup' => 'dialog', + 'aria-controls' => 'modal-heading', + ) +); ?>
next_tag( $selector ) ) { + foreach ( $attributes as $key => $value ) { + if ( 'class' === $key ) { + $tags->add_class( $value ); + continue; + } - while ( $tags->next_tag( array( 'class_name' => 'wp-element-button' ) ) ) { - if ( $button_class ) { - $tags->add_class( $button_class ); + $tags->set_attribute( $key, $value ); } - - $tags->set_attribute( 'data-wp-on--click', 'actions.toggleModal' ); - $tags->set_attribute( 'data-wp-bind--aria-expanded', 'context.isModalOpen' ); - $tags->set_attribute( 'aria-haspopup', 'dialog' ); - $tags->set_attribute( 'aria-controls', 'modal-heading' ); - $tags->set_attribute( 'aria-label', \__( 'Follow me on the Fediverse', 'activitypub' ) ); } return $tags->get_updated_html(); diff --git a/src/follow-me/render.php b/src/follow-me/render.php index 2ee66ec53..f55c01ede 100644 --- a/src/follow-me/render.php +++ b/src/follow-me/render.php @@ -6,6 +6,7 @@ */ use Activitypub\Blocks; +use Activitypub\Collection\Actors; /* @var array $attributes Block attributes. */ $attributes = wp_parse_args( $attributes ); @@ -25,7 +26,7 @@ // Get button style from block attributes. $button_style = $attributes['style'] ?? array(); -$actor = \Activitypub\Collection\Actors::get_by_id( $user_id ); +$actor = Actors::get_by_id( $user_id ); if ( is_wp_error( $actor ) ) { return; } @@ -79,7 +80,17 @@ $button_text = $attributes['buttonText'] ?? __( 'Follow', 'activitypub' ); $content = '
'; } -$content = Blocks::add_directions_to_button( $content, $attributes ); +$content = Blocks::add_directions( + $content, + array( 'class_name' => 'wp-element-button' ), + array( + 'data-wp-on--click' => 'actions.toggleModal', + 'data-wp-bind--aria-expanded' => 'context.isModalOpen', + 'aria-label' => __( 'Follow me on the Fediverse', 'activitypub' ), + 'aria-haspopup' => 'dialog', + 'aria-controls' => 'modal-heading', + ) +); ?>
Date: Mon, 19 May 2025 13:42:30 -0500 Subject: [PATCH 31/47] Add dark mode styles. --- build/follow-me/style-view.css | 2 +- src/follow-me/style.scss | 75 ++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) diff --git a/build/follow-me/style-view.css b/build/follow-me/style-view.css index 26738f840..2958eb0f8 100644 --- a/build/follow-me/style-view.css +++ b/build/follow-me/style-view.css @@ -1 +1 @@ -.activitypub-follow-me-block-wrapper{display:block;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{align-items:center;display:flex;padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1rem;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{flex:1;margin-right:1rem;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle,.activitypub-follow-me-block-wrapper .activitypub-profile__name{color:inherit;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button{align-items:center;display:flex;margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button:not(:only-child){flex:.5;margin-left:1rem}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8rem;padding:.25rem .5rem}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9rem;padding:.4rem .8rem}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border .activitypub-profile{padding-left:1rem;padding-right:1rem}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;color:initial;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:#fff;border-radius:4px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.activitypub-modal__header{align-items:center;border-bottom:1px solid #e2e4e7;display:flex;flex-shrink:0;justify-content:space-between;padding:2rem 2rem 1.5rem}.activitypub-modal__title{font-size:130%;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__close{align-items:center;background:none;border:none;color:#555;cursor:pointer;display:flex;justify-content:center;padding:.5rem}.activitypub-modal__close:hover{background:none;color:#000}.activitypub-modal__close:active{background:none;border:none;color:#000;padding:.5rem}.activitypub-modal__content{overflow-y:auto}.activitypub-dialog__section{border-bottom:1px solid #f0f0f0;padding:1.5rem 2rem}.activitypub-dialog__section:last-child{border-bottom:none;padding-bottom:2rem}.activitypub-dialog__section h4{font-size:110%;margin-bottom:.5rem;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:95%;margin-bottom:1rem}.activitypub-dialog__description code{background:#f0f0f0;border-radius:3px;font-size:90%;padding:.1rem .3rem}.activitypub-dialog__button-group{display:flex;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input{border:1px solid #ddd;border-radius:4px 0 0 4px;flex:1;font-size:100%;margin:0}.activitypub-dialog__button-group input[aria-invalid=true]{border-color:#cc1818}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important}.activitypub-dialog__error{color:#cc1818;font-size:90%;margin-top:.5rem}body.modal-open{overflow:hidden}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}} +.activitypub-follow-me-block-wrapper{display:block;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{align-items:center;display:flex;padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1rem;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{flex:1;margin-right:1rem;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle,.activitypub-follow-me-block-wrapper .activitypub-profile__name{color:inherit;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button{align-items:center;display:flex;margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button:not(:only-child){flex:.5;margin-left:1rem}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8rem;padding:.25rem .5rem}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9rem;padding:.4rem .8rem}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border .activitypub-profile{padding-left:1rem;padding-right:1rem}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;color:initial;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:#fff;border-radius:4px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.activitypub-modal__header{align-items:center;border-bottom:1px solid #e2e4e7;display:flex;flex-shrink:0;justify-content:space-between;padding:2rem 2rem 1.5rem}.activitypub-modal__title{font-size:130%;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__close{align-items:center;background:none;border:none;color:#555;cursor:pointer;display:flex;justify-content:center;padding:.5rem}.activitypub-modal__close:hover{background:none;color:#000}.activitypub-modal__close:active{background:none;border:none;color:#000;padding:.5rem}.activitypub-modal__content{overflow-y:auto}.activitypub-dialog__section{border-bottom:1px solid #f0f0f0;padding:1.5rem 2rem}.activitypub-dialog__section:last-child{border-bottom:none;padding-bottom:2rem}.activitypub-dialog__section h4{font-size:110%;margin-bottom:.5rem;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:95%;margin-bottom:1rem}.activitypub-dialog__description code{background:#f0f0f0;border-radius:3px;font-size:90%;padding:.1rem .3rem}.activitypub-dialog__button-group{display:flex;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input{border:1px solid #ddd;border-radius:4px 0 0 4px;flex:1;font-size:100%;margin:0}.activitypub-dialog__button-group input[aria-invalid=true]{border-color:#cc1818}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important}.activitypub-dialog__error{color:#cc1818;font-size:90%;margin-top:.5rem}body.modal-open{overflow:hidden}@media(prefers-color-scheme:dark){.activitypub-modal__overlay{color:var(--wp--preset--color--foreground,#d4d4d4)}.activitypub-modal__frame{background-color:var(--wp--preset--color--background,#1e1e1e);box-shadow:0 5px 15px rgba(0,0,0,.5)}.activitypub-modal__header{border-bottom:1px solid var(--wp--preset--color--contrast,#2c2c2c)}.activitypub-modal__close{color:var(--wp--preset--color--tertiary,#aaa);fill:var(--wp--preset--color--tertiary,#aaa)}.activitypub-modal__close:active,.activitypub-modal__close:hover{background:var(--wp--preset--color--foreground,#d4d4d4);color:var(--wp--preset--color--background,#2c2c2c);fill:var(--wp--preset--color--background,#2c2c2c)}.activitypub-dialog__section{border-bottom:1px solid var(--wp--preset--color--contrast,#2c2c2c)}.activitypub-dialog__description{color:var(--wp--preset--color--tertiary,silver)}.activitypub-dialog__description code{background:var(--wp--preset--color--contrast,#2c2c2c);color:var(--wp--preset--color--foreground,#d4d4d4)}.activitypub-dialog__button-group input{background-color:var(--wp--preset--color--background,#2c2c2c);border:1px solid var(--wp--preset--color--contrast,#444);color:var(--wp--preset--color--foreground,#d4d4d4)}.activitypub-dialog__button-group input[aria-invalid=true]{border-color:var(--wp--preset--color--alert,#e65054)}.activitypub-dialog__button-group button:active,.activitypub-dialog__button-group button:hover{background:var(--wp--preset--color--foreground,#d4d4d4);color:var(--wp--preset--color--background,#2c2c2c);fill:var(--wp--preset--color--background,#2c2c2c)}.activitypub-dialog__error{color:var(--wp--preset--color--alert,#e65054)}.activitypub-profile__handle,.activitypub-profile__name{color:var(--wp--preset--color--foreground,#d4d4d4)}}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}} diff --git a/src/follow-me/style.scss b/src/follow-me/style.scss index bce3b5be2..2fec2d39f 100644 --- a/src/follow-me/style.scss +++ b/src/follow-me/style.scss @@ -213,6 +213,81 @@ body.modal-open { overflow: hidden; } +/* Dark mode styles. */ +@media (prefers-color-scheme: dark) { + .activitypub-modal { + &__overlay { + color: var(--wp--preset--color--foreground, #d4d4d4); + } + + &__frame { + background-color: var(--wp--preset--color--background, #1e1e1e); + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + } + + &__header { + border-bottom: 1px solid var(--wp--preset--color--contrast, #2c2c2c); + } + + &__close { + color: var(--wp--preset--color--tertiary, #aaa); + fill: var(--wp--preset--color--tertiary, #aaa); + + &:hover, + &:active { + background: var(--wp--preset--color--foreground, #d4d4d4); + color: var(--wp--preset--color--background, #2c2c2c); + fill: var(--wp--preset--color--background, #2c2c2c); + } + } + } + + .activitypub-dialog { + &__section { + border-bottom: 1px solid var(--wp--preset--color--contrast, #2c2c2c); + } + + &__description { + color: var(--wp--preset--color--tertiary, #c0c0c0); + + code { + background: var(--wp--preset--color--contrast, #2c2c2c); + color: var(--wp--preset--color--foreground, #d4d4d4); + } + } + + &__button-group { + input { + border: 1px solid var(--wp--preset--color--contrast, #444); + background-color: var(--wp--preset--color--background, #2c2c2c); + color: var(--wp--preset--color--foreground, #d4d4d4); + + &[aria-invalid="true"] { + border-color: var(--wp--preset--color--alert, #e65054); + } + } + + button:hover, + button:active { + background: var(--wp--preset--color--foreground, #d4d4d4); + color: var(--wp--preset--color--background, #2c2c2c); + fill: var(--wp--preset--color--background, #2c2c2c); + } + } + + &__error { + color: var(--wp--preset--color--alert, #e65054); + } + } + + .activitypub-profile { + &__name, + &__handle { + color: var(--wp--preset--color--foreground, #d4d4d4); + } + } +} + /* Animation for modal */ @keyframes activitypub-modal-appear { from { From c6b54f247e171b4b2087b6bf04f9fdb7bb3fc980 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Mon, 19 May 2025 13:50:03 -0500 Subject: [PATCH 32/47] Rebuild build files --- build/follow-me/index.js.map | 1 - build/follow-me/style-view.css.map | 1 - build/follow-me/view.js.map | 1 - 3 files changed, 3 deletions(-) delete mode 100644 build/follow-me/index.js.map delete mode 100644 build/follow-me/style-view.css.map delete mode 100644 build/follow-me/view.js.map diff --git a/build/follow-me/index.js.map b/build/follow-me/index.js.map deleted file mode 100644 index c544d4d50..000000000 --- a/build/follow-me/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"follow-me/index.js","mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACkD;AACF;AAChD,4BAA4B,sDAAI,CAAC,sDAAG;AACpC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA;AACA,GAAG;AACH,CAAC;AACD,iEAAe,MAAM,EAAC;AACtB;;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,IAAI,IAAqC;AACzC;AACA;;AAEA,YAAY,mBAAO,CAAC,oBAAO;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,iGAAiG,eAAe;AAChH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA,KAAK,GAAG;;AAER,kDAAkD;AAClD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,4BAA4B;AAC5B;AACA,qCAAqC;;AAErC,gCAAgC;AAChC;AACA;;AAEA,gCAAgC;;AAEhC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;;AAGJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;;AAGF;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,sBAAsB;AACtB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,iCAAiC;AACjC;AACA,SAAS;AACT,2BAA2B;AAC3B;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;;AAE3D;AACA;;AAEA;AACA,yDAAyD;AACzD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA,gFAAgF;AAChF;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;;;AAGlB;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA,IAAI;;;AAGJ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2HAA2H;AAC3H;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA,oEAAoE;;AAEpE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC;;AAEjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,eAAe;AAC1B,WAAW,GAAG;AACd,WAAW,GAAG;AACd;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;;AAER;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;;AAEA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA,oBAAoB;AACpB,2DAA2D,UAAU;AACrE,yBAAyB,UAAU;AACnC;AACA,aAAa,UAAU;AACvB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,YAAY,SAAS;AACrB;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,6DAA6D;AAC7D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,iBAAiB;AACvC;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN,4CAA4C;;AAE5C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,8CAA8C;AAC9C;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AA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,KAAK,EAAE;MACR,CAAE,CAAC;IACJ;;IAEA;AACF;AACA;IACE,OAAOoB,KAAK,CAACK,MAAM,CAAE,CAAEC,GAAG,EAAEC,IAAI,KAAM;MACrCD,GAAG,CAACF,IAAI,CAAE;QACTtB,KAAK,EAAEyB,IAAI,CAACzE,IAAI;QAChB8C,KAAK,EAAE,GAAI2B,IAAI,CAACC,EAAE,EAAG,CAAE;MACxB,CAAE,CAAC;MACH,OAAOF,GAAG;IACX,CAAC,EAAEH,YAAa,CAAC;EAClB,CAAC,EAAE,CAAEH,KAAK,CAAG,CAAC;AACf;;;;;;;;;;ACnDA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;ACNsD;AACZ;AACH;AACb;AACA;;AAE1B;AACAS,oEAAiB,CAAE,uBAAuB,EAAE;EAC3CE,UAAU;EACVC,IAAI;EACJzE,IAAI,EAAEuE,wDAAM;EACZvB,IAAIA,+CAAAA;AACL,CAAE,CAAC,C","sources":["webpack://wordpress-activitypub/./node_modules/@wordpress/icons/build-module/library/people.js","webpack://wordpress-activitypub/./node_modules/react/cjs/react-jsx-runtime.development.js","webpack://wordpress-activitypub/./node_modules/react/jsx-runtime.js","webpack://wordpress-activitypub/./src/follow-me/deprecation.js","webpack://wordpress-activitypub/./src/follow-me/edit.js","webpack://wordpress-activitypub/./src/follow-me/save.js","webpack://wordpress-activitypub/./src/shared/inherit-block-fallback.js","webpack://wordpress-activitypub/./src/shared/use-options.js","webpack://wordpress-activitypub/./src/shared/use-user-options.js","webpack://wordpress-activitypub/external window [\"wp\",\"apiFetch\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blockEditor\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blocks\"]","webpack://wordpress-activitypub/external window [\"wp\",\"components\"]","webpack://wordpress-activitypub/external window [\"wp\",\"coreData\"]","webpack://wordpress-activitypub/external window [\"wp\",\"data\"]","webpack://wordpress-activitypub/external window [\"wp\",\"element\"]","webpack://wordpress-activitypub/external window [\"wp\",\"i18n\"]","webpack://wordpress-activitypub/external window [\"wp\",\"primitives\"]","webpack://wordpress-activitypub/external window \"React\"","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/compat get default export","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/./src/follow-me/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst people = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z\",\n fillRule: \"evenodd\"\n })\n});\nexport default people;\n//# sourceMappingURL=people.js.map","/**\n * @license React\n * react-jsx-runtime.development.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\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'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 { createBlock } from '@wordpress/blocks';\n\n/**\n * Deprecation for the Follow Me block to use a core button block instead of the custom button.\n * This handles the migration of the buttonText and buttonSize attributes to the innerBlock.\n */\nconst v1 = {\n\tattributes: {\n\t\tbuttonText: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'Follow',\n\t\t},\n\t\tbuttonSize: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'default',\n\t\t\tenum: [ 'small', 'default', 'compact' ],\n\t\t},\n\t},\n\n\tisEligible( attributes ) {\n\t\t// Run migration if buttonText attribute exists.\n\t\treturn !! attributes.buttonText;\n\t},\n\n\tmigrate( attributes ) {\n\t\tconst { buttonText, buttonSize, ...newAttributes } = attributes;\n\n\t\t// Map buttonSize to core/button className.\n\t\tlet className = '';\n\t\tif ( buttonSize === 'small' ) {\n\t\t\tclassName = 'is-small';\n\t\t} else if ( buttonSize === 'compact' ) {\n\t\t\tclassName = 'is-compact';\n\t\t}\n\n\t\t// Create a core button block with the buttonText and buttonSize.\n\t\tconst buttonBlock = createBlock( 'core/button', {\n\t\t\tclassName,\n\t\t\ttagName: 'button',\n\t\t\ttext: buttonText,\n\t\t} );\n\n\t\treturn [ newAttributes, [ buttonBlock ] ];\n\t},\n};\n\nexport default [ v1 ];\n","import apiFetch from '@wordpress/api-fetch';\nimport { InspectorControls, useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { SelectControl, PanelBody, ToggleControl } from '@wordpress/components';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useUserOptions } from '../shared/use-user-options';\nimport { InheritModeBlockFallback } from '../shared/inherit-block-fallback';\nimport { useOptions } from '../shared/use-options';\n\n/**\n * Default profile data.\n *\n * @type {Object}\n */\nconst DEFAULT_PROFILE_DATA = {\n\tavatar: 'https://secure.gravatar.com/avatar/default?s=120',\n\twebfinger: '@well@hello.dolly',\n\tname: __( 'Hello Dolly Fan Account', 'activitypub' ),\n\turl: '#',\n};\n\n/**\n * Get normalized profile data.\n *\n * @param {Object} profile Profile data.\n * @return {Object} Normalized profile data.\n */\nfunction getNormalizedProfile( profile ) {\n\tif ( ! profile ) {\n\t\treturn DEFAULT_PROFILE_DATA;\n\t}\n\n\tconst data = { ...DEFAULT_PROFILE_DATA, ...profile };\n\tdata.avatar = data?.icon?.url;\n\n\t// Ensure webfinger always has the @ prefix.\n\tif ( data.webfinger && ! data.webfinger.startsWith( '@' ) ) {\n\t\tdata.webfinger = '@' + data.webfinger;\n\t}\n\n\treturn data;\n}\n\n/**\n * Fetch profile data.\n *\n * @param {number} userId User ID.\n * @return {Promise} Promise resolving with profile data.\n */\nfunction fetchProfile( userId ) {\n\tconst { namespace } = useOptions();\n\tconst fetchOptions = {\n\t\theaders: { Accept: 'application/activity+json' },\n\t\tpath: `/${ namespace }/actors/${ userId }`,\n\t};\n\treturn apiFetch( fetchOptions );\n}\n\n/**\n * Profile component for the editor.\n *\n * @param {Object} props Component props.\n * @return {JSX.Element} Profile component.\n */\nfunction EditorProfile( { profile, buttonOnly, innerBlocksProps } ) {\n\tconst { webfinger, avatar, name } = profile;\n\n\tif ( buttonOnly ) {\n\t\treturn (\n\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\treturn (\n\t\t
\n\t\t\t{\n\t\t\t
\n\t\t\t\t
{ name }
\n\t\t\t\t
\n\t\t\t\t\t{ webfinger }\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t
\n\t);\n}\n\n/**\n * Edit component.\n *\n * @param {Object} props Component props.\n * @param {Object} props.attributes Block attributes.\n * @param {Function} props.setAttributes Set block attributes.\n * @param {Object} props.context Block context.\n * @param {string} props.context.postType Post type.\n * @param {number} props.context.postId Post ID.\n * @return {JSX.Element} Edit component.\n */\nexport default function Edit( { attributes, setAttributes, context: { postType, postId } } ) {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'activitypub-follow-me-block-wrapper',\n\t} );\n\tconst usersOptions = useUserOptions( { withInherit: true } );\n\tconst { selectedUser, buttonOnly } = attributes;\n\tconst isInheritMode = selectedUser === 'inherit';\n\tconst [ profile, setProfile ] = useState( getNormalizedProfile( DEFAULT_PROFILE_DATA ) );\n\tconst userId = selectedUser === 'site' ? 0 : selectedUser;\n\n\tconst TEMPLATE = [ [ 'core/button', { text: __( 'Follow', 'activitypub' ), tagName: 'button' } ] ];\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{},\n\t\t{\n\t\t\tallowedBlocks: [ 'core/button' ],\n\t\t\ttemplate: TEMPLATE,\n\t\t\ttemplateLock: false,\n\t\t\trenderAppender: false,\n\t\t}\n\t);\n\n\tconst authorId = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord( 'postType', postType, postId )?.author;\n\n\t\t\treturn _authorId ?? null;\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tuseEffect( () => {\n\t\t// Fetch profile data when userId changes.\n\t\tif ( isInheritMode && ! authorId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst effectiveUserId = isInheritMode ? authorId : userId;\n\t\tfetchProfile( effectiveUserId ).then( ( data ) => {\n\t\t\tsetProfile( getNormalizedProfile( data ) );\n\t\t} );\n\t}, [ userId, authorId, isInheritMode ] );\n\n\tuseEffect( () => {\n\t\t// If there are no users yet, do nothing.\n\t\tif ( ! usersOptions.length ) {\n\t\t\treturn;\n\t\t}\n\t\t// Ensure that the selected user is in the list of options, if not, select the first available user.\n\t\tif ( ! usersOptions.find( ( { value } ) => value === selectedUser ) ) {\n\t\t\tsetAttributes( { selectedUser: usersOptions[ 0 ].value } );\n\t\t}\n\t}, [ selectedUser, usersOptions ] );\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{ usersOptions.length > 1 && (\n\t\t\t\t\t\t setAttributes( { selectedUser: value } ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t setAttributes( { buttonOnly: value } ) }\n\t\t\t\t\t\thelp={ __( 'Only show the follow button without profile information', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\n\t\t\t{ isInheritMode && ! authorId ? (\n\t\t\t\t\n\t\t\t) : (\n\t\t\t\t\n\t\t\t) }\n\t\t
\n\t);\n}\n","import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\n\n/**\n * Save component for the Follow Me block.\n *\n * This component ensures that inner blocks (the button) are properly saved.\n *\n * @return {JSX.Element|null} Save component.\n */\nfunction save() {\n\tconst blockProps = useBlockProps.save();\n\tconst innerBlocksProps = useInnerBlocksProps.save( blockProps );\n\n\treturn
;\n}\n\nexport default save;\n","import { Card, CardBody } from '@wordpress/components';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\n/**\n * Block fallback component for inheriting user context in ActivityPub blocks.\n *\n * @param {Object} props\n * @param {string} props.name - Name of the block.\n * @returns {JSX.Element} Rendered fallback block.\n */\nexport function InheritModeBlockFallback( { name } ) {\n\tconst { enabled } = useOptions();\n\tconst nonAuthorExtra = enabled?.site ? '' : __( 'It will be empty in other non-author contexts.', 'activitypub' );\n\tconst text = sprintf(\n\t\t/* translators: %1$s: block name, %2$s: extra information for non-author context */\n\t\t__(\n\t\t\t'This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s',\n\t\t\t'activitypub'\n\t\t),\n\t\tname,\n\t\tnonAuthorExtra\n\t).trim();\n\n\treturn (\n\t\t\n\t\t\t{ createInterpolateElement( text, { strong: } ) }\n\t\t\n\t);\n}\n","/**\n * React hook to return the ActivityPub options object from the global window.\n *\n * @returns {Object} The options object.\n */\nexport function useOptions() {\n\treturn window._activityPubOptions || {};\n}\n","import { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\n/**\n * React hook providing user options for ActivityPub blocks.\n *\n * @param {Object} params\n * @param {boolean} params.withInherit - Whether to include the inherit option.\n * @returns {Array} List of user option objects.\n */\nexport function useUserOptions( { withInherit = false } ) {\n\tconst { enabled } = useOptions();\n\tconst users = enabled?.users ? useSelect( ( select ) => select( 'core' ).getUsers( { who: 'authors' } ) ) : [];\n\n\t/**\n\t * Memoized computation of user options for block settings.\n\t */\n\treturn useMemo( () => {\n\t\tif ( ! users ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst userKeywords = [];\n\n\t\tif ( enabled?.site ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Site', 'activitypub' ),\n\t\t\t\tvalue: 'site',\n\t\t\t} );\n\t\t}\n\n\t\t// Only show the inherit option when explicitly asked for and users are enabled.\n\t\tif ( withInherit && enabled?.users ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Dynamic User', 'activitypub' ),\n\t\t\t\tvalue: 'inherit',\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Reduce users into keyword/value pairs for options.\n\t\t */\n\t\treturn users.reduce( ( acc, user ) => {\n\t\t\tacc.push( {\n\t\t\t\tlabel: user.name,\n\t\t\t\tvalue: `${ user.id }`, // Casting to string because that's how Gutenberg stores the attribute.\n\t\t\t} );\n\t\t\treturn acc;\n\t\t}, userKeywords );\n\t}, [ users ] );\n}\n","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"React\"];","// 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\t// no module.id needed\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport { people } from '@wordpress/icons';\nimport deprecated from './deprecation';\nimport edit from './edit';\nimport save from './save';\n\n// Register the block.\nregisterBlockType( 'activitypub/follow-me', {\n\tdeprecated,\n\tedit,\n\ticon: people,\n\tsave,\n} );\n"],"names":["createBlock","v1","attributes","buttonText","type","default","buttonSize","enum","isEligible","migrate","newAttributes","className","buttonBlock","tagName","text","apiFetch","InspectorControls","useBlockProps","useInnerBlocksProps","__","useSelect","store","coreStore","SelectControl","PanelBody","ToggleControl","useEffect","useState","useUserOptions","InheritModeBlockFallback","useOptions","DEFAULT_PROFILE_DATA","avatar","webfinger","name","url","getNormalizedProfile","profile","data","icon","startsWith","fetchProfile","userId","namespace","fetchOptions","headers","Accept","path","EditorProfile","buttonOnly","innerBlocksProps","createElement","src","alt","title","Edit","setAttributes","context","postType","postId","blockProps","usersOptions","withInherit","selectedUser","isInheritMode","setProfile","TEMPLATE","allowedBlocks","template","templateLock","renderAppender","authorId","select","getEditedEntityRecord","_authorId","author","effectiveUserId","then","length","find","value","key","label","options","onChange","checked","help","save","Card","CardBody","sprintf","createInterpolateElement","enabled","nonAuthorExtra","site","trim","strong","window","_activityPubOptions","useMemo","users","getUsers","who","userKeywords","push","reduce","acc","user","id","registerBlockType","people","deprecated","edit"],"sourceRoot":""} \ No newline at end of file diff --git a/build/follow-me/style-view.css.map b/build/follow-me/style-view.css.map deleted file mode 100644 index 9d3e9d75c..000000000 --- a/build/follow-me/style-view.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"follow-me/style-view.css","mappings":";;;AAAA;EACC;EACA;AACD;;AAGC;EACC;EACA;EACA;AAAF;AAEE;EACC;EACA;EACA;EACA;EACA;KAAA;AAAH;AAGE;EACC;EACA;EACA;AADH;AAIE;EACC;EACA;EACA;EACA;AAFH;AAKE;EAEC;EACA;EACA;EACA;EACA;AAJH;AAOE;EACC;EACA;EACA;AALH;AAOG;EACC;EACA;AALJ;AASE;EACC;AAPH;AAUE;EACC;EACA;AARH;AAWE;EACC;EACA;AATH;AAaC;EAEC;EACA;AAZF;;AAiBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAdF;AAgBE;EACC;AAdH;AAkBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAhBF;AAmBC;EACC;EACA;EACA;EACA;EACA;EACA;AAjBF;AAoBC;EACC;EACA;EACA;EACA;AAlBF;AAqBC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAnBF;AAqBE;EACC;EACA;AAnBH;AAsBE;EACC;EACA;EACA;EACA;AApBH;AAwBC;EACC;AAtBF;;AA2BC;EACC;EACA;AAxBF;AA0BE;EACC;EACA;AAxBH;AA2BE;EACC;EACA;EACA;AAzBH;AA6BC;EACC;EACA;EACA;AA3BF;AA6BE;EACC;EACA;EACA;EACA;AA3BH;AA+BC;EACC;EACA;EACA;AA7BF;AA+BE;EACC;EACA;EACA;EACA;EACA;AA7BH;AA+BG;EACC;AA7BJ;AAiCE;EACC;EACA;AA/BH;AAmCC;EACC;EACA;EACA;AAjCF;;AAqCA;EACC;AAlCD;;AAqCA;AACA;EACC;IACC;IACA;EAlCA;EAoCD;IACC;IACA;EAlCA;AACF,C","sources":["webpack://wordpress-activitypub/./src/follow-me/style.scss"],"sourcesContent":[".activitypub-follow-me-block-wrapper {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.activitypub-follow-me-block-wrapper {\n\t.activitypub-profile {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tpadding: 1rem 0;\n\n\t\t&__avatar {\n\t\t\twidth: 75px;\n\t\t\theight: 75px;\n\t\t\tborder-radius: 50%;\n\t\t\tmargin-right: 1rem;\n\t\t\tobject-fit: cover;\n\t\t}\n\n\t\t&__content {\n\t\t\tflex: 1;\n\t\t\tmargin-right: 1rem;\n\t\t\tmin-width: 0;\n\t\t}\n\n\t\t&__name {\n\t\t\tfont-size: 1.25em;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t&__name,\n\t\t&__handle {\n\t\t\tcolor: inherit;\n\t\t\tline-height: 1.2;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t.wp-block-button {\n\t\t\tmargin: 0;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\n\t\t\t&:not(:only-child) {\n\t\t\t\tflex: 0.5;\n\t\t\t\tmargin-left: 1rem;\n\t\t\t}\n\t\t}\n\n\t\t.wp-block-button__link {\n\t\t\tmargin: 0;\n\t\t}\n\n\t\t.is-small {\n\t\t\tpadding: 0.25rem 0.5rem;\n\t\t\tfont-size: 0.8rem;\n\t\t}\n\n\t\t.is-compact {\n\t\t\tpadding: 0.4rem 0.8rem;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t}\n\n\t&.has-background .activitypub-profile,\n\t&.has-border .activitypub-profile {\n\t\tpadding-left: 1rem;\n\t\tpadding-right: 1rem;\n\t}\n}\n\n.activitypub-modal {\n\t&__overlay {\n\t\tposition: fixed;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tbackground-color: rgba(0, 0, 0, 0.5);\n\t\tcolor: initial;\n\t\tz-index: 100000;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tpadding: 1rem;\n\n\t\t&[hidden] {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&__frame {\n\t\tmax-width: 660px;\n\t\twidth: 100%;\n\t\tbackground-color: #fff;\n\t\tborder-radius: 4px;\n\t\tbox-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);\n\t\toverflow: hidden;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmax-height: calc(100vh - 2rem);\n\t\tanimation: activitypub-modal-appear 0.2s ease-out;\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\tpadding: 32px 32px 24px 32px;\n\t\tborder-bottom: 1px solid #e2e4e7;\n\t\tflex-shrink: 0;\n\t}\n\n\t&__title {\n\t\tmargin: 0 !important;\n\t\tfont-size: 130%;\n\t\tfont-weight: 600;\n\t\tline-height: 1.4;\n\t}\n\n\t&__close {\n\t\tbackground: none;\n\t\tborder: none;\n\t\tpadding: 0.5rem;\n\t\tcursor: pointer;\n\t\tcolor: #555;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t&:hover {\n\t\t\tbackground: none;\n\t\t\tcolor: #000;\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #000;\n\t\t\tpadding: 0.5rem;\n\t\t}\n\t}\n\n\t&__content {\n\t\toverflow-y: auto;\n\t}\n}\n\n.activitypub-dialog {\n\t&__section {\n\t\tpadding: 1rem 32px;\n\t\tborder-bottom: 1px solid #f0f0f0;\n\n\t\t&:last-child {\n\t\t\tborder-bottom: none;\n\t\t\tpadding-bottom: 32px;\n\t\t}\n\n\t\th4 {\n\t\t\tmargin-top: 0;\n\t\t\tmargin-bottom: 0.5rem;\n\t\t\tfont-size: 110%;\n\t\t}\n\t}\n\n\t&__description {\n\t\tmargin-bottom: 1rem;\n\t\tcolor: inherit;\n\t\tfont-size: 95%;\n\n\t\tcode {\n\t\t\tbackground: #f0f0f0;\n\t\t\tpadding: 0.1rem 0.3rem;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 90%;\n\t\t}\n\t}\n\n\t&__button-group {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\tmargin-bottom: 0.5rem;\n\n\t\tinput {\n\t\t\tflex: 1;\n\t\t\tborder: 1px solid #ddd;\n\t\t\tborder-radius: 4px 0 0 4px;\n\t\t\tfont-size: 100%;\n\t\t\tmargin: 0;\n\n\t\t\t&[aria-invalid=\"true\"] {\n\t\t\t\tborder-color: #cc1818;\n\t\t\t}\n\t\t}\n\n\t\tbutton {\n\t\t\tborder-radius: 0 4px 4px 0 !important;\n\t\t\tmargin-left: -1px !important;\n\t\t}\n\t}\n\n\t&__error {\n\t\tcolor: #cc1818;\n\t\tfont-size: 90%;\n\t\tmargin-top: 0.5rem;\n\t}\n}\n\nbody.modal-open {\n\toverflow: hidden;\n}\n\n/* Animation for modal */\n@keyframes activitypub-modal-appear {\n\tfrom {\n\t\topacity: 0;\n\t\ttransform: translateY(20px);\n\t}\n\tto {\n\t\topacity: 1;\n\t\ttransform: translateY(0);\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/build/follow-me/view.js.map b/build/follow-me/view.js.map deleted file mode 100644 index c08689531..000000000 --- a/build/follow-me/view.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"follow-me/view.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,oBAAoBA,CAAEC,YAAY,EAAG;EAC7C;EACA,IAAK,OAAOC,MAAM,KAAK,WAAW,IAAI,CAAEA,MAAM,CAACC,gBAAgB,EAAG;IACjE,OAAO,KAAK;EACb;;EAEA;EACA,MAAMC,MAAM,GAAGF,MAAM,CAACC,gBAAgB,CAAEE,QAAQ,CAACC,eAAgB,CAAC;;EAElE;EACA,MAAMC,KAAK,GAAGH,MAAM,CAACI,gBAAgB,CAAEP,YAAa,CAAC,CAACQ,IAAI,CAAC,CAAC;;EAE5D;EACA,OAAOF,KAAK,KAAK,EAAE;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,kBAAkBA,CAAEC,KAAK,EAAG;EACpC;EACA,IAAK,OAAOA,KAAK,KAAK,QAAQ,EAAG;IAChC,MAAMC,OAAO,GAAG,wBAAyBD,KAAK,EAAG;IACjD,IAAK,CAAEX,oBAAoB,CAAEY,OAAQ,CAAC,EAAG;MACxC,OAAO,IAAI;IACZ;IACA,OAAO,OAAQA,OAAO,GAAI;EAC3B;EAEA,OAAOD,KAAK,EAAEA,KAAK,EAAEE,UAAU,IAAI,IAAI;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAAEC,IAAI,EAAG;EAC7B,IAAK,OAAOA,IAAI,KAAK,QAAQ,EAAG;IAC/B,OAAO,IAAI;EACZ;EACA;EACA,IAAKA,IAAI,CAACC,KAAK,CAAE,IAAK,CAAC,EAAG;IACzB;IACA,OAA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UACtC;UACA;UACA,kBAAkB,qBAAqB;UACvC;UACA;UACA,KAAK;UACL;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;;;;UC3BA;UACA;UACA;UACA;UACA,yCAAyC,wCAAwC;UACjF;UACA;UACA;;;;;UCPA;;;;;UCAA;UACA;UACA;UACA,uDAAuD,iBAAiB;UACxE;UACA,gDAAgD,aAAa;UAC7D;;;;;UCNA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;UAEA;;;;;SEpBA;SACA;SACA;SACA;SACA","sources":["webpack://wordpress-activitypub/./src/follow-me/button-style.js","webpack://wordpress-activitypub/./src/follow-me/style.scss?8459","webpack://wordpress-activitypub/./src/follow-me/view.js","webpack://wordpress-activitypub/external module \"@wordpress/interactivity\"","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/chunk loaded","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/webpack/runtime/import chunk loading","webpack://wordpress-activitypub/webpack/before-startup","webpack://wordpress-activitypub/webpack/startup","webpack://wordpress-activitypub/webpack/after-startup"],"sourcesContent":["/**\n * Checks if a CSS variable is defined.\n *\n * @param {string} variableName The CSS variable name to check.\n * @return {boolean} Whether the variable is defined.\n */\nfunction isCssVariableDefined( variableName ) {\n\t// Return false if we're in a server-side context.\n\tif ( typeof window === 'undefined' || ! window.getComputedStyle ) {\n\t\treturn false;\n\t}\n\n\t// Get the computed style of the root element.\n\tconst styles = window.getComputedStyle( document.documentElement );\n\t\n\t// Get the value of the CSS variable.\n\tconst value = styles.getPropertyValue( variableName ).trim();\n\t\n\t// If the value is empty, the variable is not defined or is set to an empty value.\n\treturn value !== '';\n}\n\n/**\n * Gets the background color from a style object.\n *\n * @param {Object|string} color Color object or string.\n * @return {string|null} Background color.\n */\nfunction getBackgroundColor( color ) {\n\t// If color is a string, it's a var like this.\n\tif ( typeof color === 'string' ) {\n\t\tconst varName = `--wp--preset--color--${ color }`;\n\t\tif ( ! isCssVariableDefined( varName ) ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn `var(${ varName })`;\n\t}\n\n\treturn color?.color?.background || null;\n}\n\n/**\n * Gets the link color from a style object.\n *\n * @param {string} text Text color.\n * @return {string|null} Link color.\n */\nfunction getLinkColor( text ) {\n\tif ( typeof text !== 'string' ) {\n\t\treturn null;\n\t}\n\t// If it starts with a hash, leave it be.\n\tif ( text.match( /^#/ ) ) {\n\t\t// We don't handle the alpha channel if present.\n\t\treturn text.substring( 0, 7 );\n\t}\n\t// var:preset|color|luminous-vivid-amber\n\t// var(--wp--preset--color--luminous-vivid-amber)\n\t// We will receive the top format, we need to output the bottom format.\n\tconst [ , , color ] = text.split( '|' );\n\tconst varName = `--wp--preset--color--${ color }`;\n\t\n\t// Check if the CSS variable is defined before using it.\n\tif ( ! isCssVariableDefined( varName ) ) {\n\t\treturn null;\n\t}\n\t\n\treturn `var(${ varName })`;\n}\n\n/**\n * Generates a CSS selector.\n *\n * @param {string} selector CSS selector.\n * @param {string} prop CSS property.\n * @param {string|null} value CSS value.\n * @param {string} pseudo Pseudo-selector.\n * @return {string} CSS selector.\n */\nfunction generateSelector( selector, prop, value = null, pseudo = '' ) {\n\tif ( ! value ) {\n\t\treturn '';\n\t}\n\treturn `${ selector }${ pseudo } { ${ prop }: ${ value }; }\\n`;\n}\n\n/**\n * Gets styles for a button.\n *\n * @param {string} selector CSS selector.\n * @param {string} button Button color.\n * @param {string} text Text color.\n * @param {string} hover Hover color.\n * @return {string} CSS styles.\n */\nfunction getStyles( selector, button, text, hover ) {\n\treturn (\n\t\tgenerateSelector( selector, 'background-color', button ) +\n\t\tgenerateSelector( selector, 'color', text ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':hover' ) +\n\t\tgenerateSelector( selector, 'background-color', hover, ':focus' )\n\t);\n}\n\n/**\n * Gets block styles.\n *\n * @param {string} base Base selector.\n * @param {Object} style Style object.\n * @param {Object|string} backgroundColor Background color.\n * @return {string} CSS styles.\n */\nexport function getBlockStyles( base, style, backgroundColor ) {\n\tconst selector = `${ base } .wp-block-button__link`;\n\n\t// We grab the background color if set as a good color for our button text.\n\tconst buttonTextColor =\n\t\tgetBackgroundColor( backgroundColor ) ||\n\t\t// Background might be in this form.\n\t\tstyle?.color?.background;\n\n\t// We misuse the link color for the button background.\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text );\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text );\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n\n/**\n * Gets popup styles.\n *\n * @param {Object} style Style object.\n * @return {string} CSS styles.\n */\nexport function getPopupStyles( style ) {\n\t// We don't accept backgroundColor because the popup is always white (right?).\n\tconst buttonColor = getLinkColor( style?.elements?.link?.color?.text ) || '#111';\n\tconst buttonTextColor = '#fff';\n\tconst buttonHoverColor = getLinkColor( style?.elements?.link?.[ ':hover' ]?.color?.text ) || '#333';\n\tconst selector = '.activitypub-dialog__button-group .wp-block-button';\n\n\treturn getStyles( selector, buttonColor, buttonTextColor, buttonHoverColor );\n}\n","// extracted by mini-css-extract-plugin\nexport {};","import { store, getContext } from '@wordpress/interactivity';\nimport { getBlockStyles, getPopupStyles } from './button-style';\nimport './style.scss';\n\n/** @var {object} wp WordPress global. */\nconst { apiFetch } = window.wp;\n\n/**\n * Traps focus within the specified element.\n *\n * @param {Element} element The element to trap focus within.\n */\nfunction trapFocus( element ) {\n\tvar focusableElements = element.querySelectorAll(\n\t\t'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type=\"text\"]:not([disabled]), input[type=\"radio\"]:not([disabled]), input[type=\"checkbox\"]:not([disabled]), select:not([disabled])'\n\t);\n\tvar firstFocusableElement = focusableElements[ 0 ];\n\tvar lastFocusableElement = focusableElements[ focusableElements.length - 1 ];\n\tfirstFocusableElement.focus();\n\n\telement.addEventListener( 'keydown', function ( event ) {\n\t\tif ( event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */ ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.shiftKey ) {\n\t\t\t/* shift + tab */\n\t\t\tif ( document.activeElement === firstFocusableElement ) {\n\t\t\t\tlastFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t} /* tab */ else {\n\t\t\tif ( document.activeElement === lastFocusableElement ) {\n\t\t\t\tfirstFocusableElement.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t} );\n}\n\nconst { state, actions } = store( 'activitypub/follow-me', {\n\tactions: {\n\t\t/**\n\t\t * Open the modal.\n\t\t */\n\t\topenModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = true;\n\t\t\tdocument.body.classList.add( 'modal-open' );\n\n\t\t\t// Set up the focus trap after modal is open.\n\t\t\tsetTimeout( () => {\n\t\t\t\t// Use the blockId to find the specific modal frame for this block.\n\t\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\t\tif ( blockWrapper ) {\n\t\t\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\t\t\tif ( modalFrame ) {\n\t\t\t\t\t\ttrapFocus( modalFrame );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 50 );\n\t\t},\n\n\t\t/**\n\t\t * Close the modal.\n\t\t */\n\t\tcloseModal() {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isModalOpen = false;\n\t\t\tdocument.body.classList.remove( 'modal-open' );\n\n\t\t\t// Return focus to the button that opened the modal.\n\t\t\tconst blockWrapper = document.getElementById( context.blockId );\n\t\t\tif ( blockWrapper ) {\n\t\t\t\tconst openButton = blockWrapper.querySelector( '.wp-block-button__link' );\n\t\t\t\tif ( openButton ) {\n\t\t\t\t\topenButton.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\ttoggleModal() {\n\t\t\tconst { isModalOpen } = getContext();\n\n\t\t\tisModalOpen ? actions.closeModal() : actions.openModal();\n\t\t},\n\n\t\t/**\n\t\t * Copy the webfinger to clipboard.\n\t\t */\n\t\tcopyToClipboard() {\n\t\t\tconst context = getContext();\n\n\t\t\t// Use the Clipboard API to copy text.\n\t\t\tnavigator.clipboard.writeText( context.webfinger ).then(\n\t\t\t\t() => {\n\t\t\t\t\t// Update button text to show success.\n\t\t\t\t\tcontext.copyButtonText = state.i18n.copied;\n\n\t\t\t\t\t// Reset button text after 1 second.\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tcontext.copyButtonText = state.i18n.copy;\n\t\t\t\t\t}, 1000 );\n\t\t\t\t},\n\t\t\t\t( error ) => {\n\t\t\t\t\t// Log error if copying fails.\n\t\t\t\t\tconsole.error( 'Could not copy text: ', error );\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the remote profile value.\n\t\t *\n\t\t * @param {Event} event Input event.\n\t\t */\n\t\tupdateRemoteProfile( event ) {\n\t\t\tconst context = getContext();\n\t\t\tcontext.remoteProfile = event.target.value;\n\t\t\t// Reset error state when input changes.\n\t\t\tcontext.isError = false;\n\t\t\tcontext.errorMessage = '';\n\t\t},\n\n\t\t/**\n\t\t * Handle keydown event for remote profile input.\n\t\t *\n\t\t * @param {Event} event Keydown event.\n\t\t */\n\t\thandleKeyDown( event ) {\n\t\t\tif ( event.key === 'Enter' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tactions.submitRemoteProfile();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Submit the remote profile.\n\t\t */\n\t\tsubmitRemoteProfile: function* () {\n\t\t\tconst context = getContext();\n\t\t\tconst { namespace } = state;\n\t\t\tconst input = context.remoteProfile.trim();\n\n\t\t\t// Validate input.\n\t\t\tif ( ! input ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.emptyProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! /^(https?:\\/\\/|@)/.test( input ) ) {\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = state.i18n.invalidProfileError;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set loading state.\n\t\t\tcontext.isLoading = true;\n\t\t\tcontext.isError = false;\n\n\t\t\t// Construct the API path.\n\t\t\tconst path = `/${ namespace }/actors/${ context.userId }/remote-follow?resource=${ encodeURIComponent(\n\t\t\t\tinput\n\t\t\t) }`;\n\n\t\t\ttry {\n\t\t\t\t// Make the API request.\n\t\t\t\tconst response = yield apiFetch( { path } );\n\n\t\t\t\t// Set opening state.\n\t\t\t\tcontext.isLoading = false;\n\n\t\t\t\t// Open the remote follow URL in a new tab.\n\t\t\t\twindow.open( response.url, '_blank' );\n\n\t\t\t\t// Close the modal after opening the URL.\n\t\t\t\tactions.closeModal();\n\t\t\t} catch ( error ) {\n\t\t\t\t// Handle error.\n\t\t\t\tconsole.error( 'Error submitting profile:', error );\n\t\t\t\tcontext.isLoading = false;\n\t\t\t\tcontext.isError = true;\n\t\t\t\tcontext.errorMessage = error.message || state.i18n.genericError;\n\t\t\t}\n\t\t},\n\t},\n\tcallbacks: {\n\t\t/**\n\t\t * Initialize button styles.\n\t\t */\n\t\tinitButtonStyles: () => {\n\t\t\tconst { buttonStyle, backgroundColor, blockId } = getContext();\n\n\t\t\t// Add dynamic button styles to the document.\n\t\t\tif ( blockId && buttonStyle ) {\n\t\t\t\tconst styleElement = document.createElement( 'style' );\n\t\t\t\tconst selector = `#${ blockId }`;\n\n\t\t\t\t// Use getBlockStyles from button-style.js to get the CSS string.\n\t\t\t\tstyleElement.textContent = getBlockStyles( selector, buttonStyle, backgroundColor );\n\n\t\t\t\tdocument.head.appendChild( styleElement );\n\n\t\t\t\t// Add popup styles.\n\t\t\t\tconst popupStyleElement = document.createElement( 'style' );\n\t\t\t\tpopupStyleElement.textContent = getPopupStyles( buttonStyle );\n\t\t\t\tdocument.head.appendChild( popupStyleElement );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when pressing ESC key.\n\t\t *\n\t\t * @param {Event} event Keyboard event.\n\t\t */\n\t\tdocumentKeydown( event ) {\n\t\t\tconst { isModalOpen } = getContext();\n\n\t\t\tif ( isModalOpen && event.key === 'Escape' ) {\n\t\t\t\tactions.closeModal();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close modal when clicking outside.\n\t\t *\n\t\t * @param {Event} event Click event.\n\t\t */\n\t\tdocumentClick( event ) {\n\t\t\tconst { blockId, isModalOpen } = getContext();\n\t\t\tif ( ! isModalOpen ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Get the block wrapper element.\n\t\t\tconst blockWrapper = document.getElementById( blockId );\n\t\t\tif ( ! blockWrapper ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If the click was on the button or its children, we should not close the modal.\n\t\t\tconst toggleButton = blockWrapper.querySelector(\n\t\t\t\t'.wp-element-button[data-wp-on--click=\"actions.toggleModal\"]'\n\t\t\t);\n\t\t\tif ( toggleButton && ( toggleButton === event.target || toggleButton.contains( event.target ) ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if the click was inside the modal frame.\n\t\t\tconst modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' );\n\t\t\tif ( ! modalFrame || modalFrame.contains( event.target ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactions.closeModal();\n\t\t},\n\t},\n} );\n","module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;","// 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\t// no module.id needed\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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"follow-me/view\": 0,\n\t\"follow-me/style-view\": 0\n};\n\n// no install chunk\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no external install chunk\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"follow-me/style-view\"], () => (__webpack_require__(\"./src/follow-me/view.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["isCssVariableDefined","variableName","window","getComputedStyle","styles","document","documentElement","value","getPropertyValue","trim","getBackgroundColor","color","varName","background","getLinkColor","text","match","substring","split","generateSelector","selector","prop","pseudo","getStyles","button","hover","getBlockStyles","base","style","backgroundColor","buttonTextColor","buttonColor","elements","link","buttonHoverColor","getPopupStyles","store","getContext","apiFetch","wp","trapFocus","element","focusableElements","querySelectorAll","firstFocusableElement","lastFocusableElement","length","focus","addEventListener","event","key","keyCode","shiftKey","activeElement","preventDefault","state","actions","openModal","context","isModalOpen","body","classList","add","setTimeout","blockWrapper","getElementById","blockId","modalFrame","querySelector","closeModal","remove","openButton","toggleModal","copyToClipboard","navigator","clipboard","writeText","webfinger","then","copyButtonText","i18n","copied","copy","error","console","updateRemoteProfile","remoteProfile","target","isError","errorMessage","handleKeyDown","submitRemoteProfile","namespace","input","emptyProfileError","test","invalidProfileError","isLoading","path","userId","encodeURIComponent","response","open","url","message","genericError","callbacks","initButtonStyles","buttonStyle","styleElement","createElement","textContent","head","appendChild","popupStyleElement","documentKeydown","documentClick","toggleButton","contains"],"sourceRoot":""} \ No newline at end of file From 6d85d6493a97eae8581661c97f47b1384d414d0e Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Mon, 19 May 2025 13:54:22 -0500 Subject: [PATCH 33/47] Tabs > Spaces --- package.json | 100 +++++++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/package.json b/package.json index aadefbedd..c753376c6 100644 --- a/package.json +++ b/package.json @@ -1,52 +1,52 @@ { - "name": "wordpress-activitypub", - "description": "The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.", - "repository": { - "type": "git", - "url": "git+https://github.com/automattic/wordpress-activitypub.git" - }, - "author": { - "name": "Matthias Pfefferle", - "web": "https://notiz.blog" - }, - "scripts": { - "dev": "wp-scripts start --experimental-modules", - "build": "wp-scripts format && wp-scripts build --experimental-modules", - "format": "wp-scripts format", - "lint:css": "wp-scripts lint-style", - "lint:js": "wp-scripts lint-js", - "env": "wp-env", - "env-start": "wp-env start && wp-env run cli wp rewrite structure '/%year%/%monthnum%/%postname%/'", - "env-stop": "wp-env stop", - "env-test": "wp-env run tests-cli --env-cwd=\"wp-content/plugins/activitypub\" vendor/bin/phpunit", - "release": "node bin/release.js" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/automattic/wordpress-activitypub/issues" - }, - "homepage": "https://github.com/automattic/wordpress-activitypub#readme", - "devDependencies": { - "@wordpress/api-fetch": "^7.23.0", - "@wordpress/block-editor": "^14.17.0", - "@wordpress/blocks": "^14.0.0", - "@wordpress/components": "^29.1.1", - "@wordpress/compose": "^7.22.0", - "@wordpress/core-data": "^7.22.0", - "@wordpress/data": "^10.0.0", - "@wordpress/dom-ready": "^4.0.0", - "@wordpress/editor": "^14.22.0", - "@wordpress/element": "^6.0.0", - "@wordpress/env": "^10.10.0", - "@wordpress/i18n": "^5.22.0", - "@wordpress/icons": "^10.10.0", - "@wordpress/interactivity": "^6.23.0", - "@wordpress/plugins": "^7.22.0", - "@wordpress/prettier-config": "^4.23.0", - "@wordpress/primitives": "^4.22.0", - "@wordpress/scripts": "^27.0.0", - "@wordpress/url": "^4.22.0", - "classnames": "^2.3.2", - "prettier": "npm:wp-prettier@^3.0.3" - } + "name": "wordpress-activitypub", + "description": "The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.", + "repository": { + "type": "git", + "url": "git+https://github.com/automattic/wordpress-activitypub.git" + }, + "author": { + "name": "Matthias Pfefferle", + "web": "https://notiz.blog" + }, + "scripts": { + "dev": "wp-scripts start --experimental-modules", + "build": "wp-scripts format && wp-scripts build --experimental-modules", + "format": "wp-scripts format", + "lint:css": "wp-scripts lint-style", + "lint:js": "wp-scripts lint-js", + "env": "wp-env", + "env-start": "wp-env start && wp-env run cli wp rewrite structure '/%year%/%monthnum%/%postname%/'", + "env-stop": "wp-env stop", + "env-test": "wp-env run tests-cli --env-cwd=\"wp-content/plugins/activitypub\" vendor/bin/phpunit", + "release": "node bin/release.js" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/automattic/wordpress-activitypub/issues" + }, + "homepage": "https://github.com/automattic/wordpress-activitypub#readme", + "devDependencies": { + "@wordpress/api-fetch": "^7.23.0", + "@wordpress/block-editor": "^14.17.0", + "@wordpress/blocks": "^14.0.0", + "@wordpress/components": "^29.1.1", + "@wordpress/compose": "^7.22.0", + "@wordpress/core-data": "^7.22.0", + "@wordpress/data": "^10.0.0", + "@wordpress/dom-ready": "^4.0.0", + "@wordpress/editor": "^14.22.0", + "@wordpress/element": "^6.0.0", + "@wordpress/env": "^10.10.0", + "@wordpress/i18n": "^5.22.0", + "@wordpress/icons": "^10.10.0", + "@wordpress/interactivity": "^6.23.0", + "@wordpress/plugins": "^7.22.0", + "@wordpress/prettier-config": "^4.23.0", + "@wordpress/primitives": "^4.22.0", + "@wordpress/scripts": "^27.0.0", + "@wordpress/url": "^4.22.0", + "classnames": "^2.3.2", + "prettier": "npm:wp-prettier@^3.0.3" + } } From 9a9490cdc670a42afa4b501462001ac1c9f45674 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Mon, 19 May 2025 13:59:14 -0500 Subject: [PATCH 34/47] Tabs > Spaces --- src/follow-me/block.json | 116 +++++++++++++++++++-------------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/src/follow-me/block.json b/src/follow-me/block.json index 0522070cc..e19607945 100644 --- a/src/follow-me/block.json +++ b/src/follow-me/block.json @@ -1,60 +1,60 @@ { - "$schema": "https://schemas.wp.org/trunk/block.json", - "name": "activitypub/follow-me", - "apiVersion": 3, - "version": "2.0.0", - "title": "Follow me on the Fediverse", - "category": "widgets", - "description": "Display your Fediverse profile so that visitors can follow you.", - "textdomain": "activitypub", - "icon": "groups", - "example": { - "attributes": { - "buttonOnly": false - } - }, - "supports": { - "html": false, - "interactivity": true, - "color": { - "gradients": true, - "link": true, - "__experimentalDefaultControls": { - "background": true, - "text": true, - "link": true - } - }, - "__experimentalBorder": { - "radius": true, - "width": true, - "color": true, - "style": true - }, - "typography": { - "fontSize": true, - "__experimentalDefaultControls": { - "fontSize": true - } - }, - "innerBlocks": { - "allowedBlocks": [ "core/button" ] - } - }, - "attributes": { - "selectedUser": { - "type": "string", - "default": "site" - }, - "buttonOnly": { - "type": "boolean", - "default": false - } - }, - "usesContext": [ "postType", "postId" ], - "editorScript": "file:./index.js", - "viewScriptModule": "file:./view.js", - "viewScript": "wp-api-fetch", - "style": "file:./style-view.css", - "render": "file:./render.php" + "$schema": "https://schemas.wp.org/trunk/block.json", + "name": "activitypub/follow-me", + "apiVersion": 3, + "version": "2.0.0", + "title": "Follow me on the Fediverse", + "category": "widgets", + "description": "Display your Fediverse profile so that visitors can follow you.", + "textdomain": "activitypub", + "icon": "groups", + "example": { + "attributes": { + "buttonOnly": false + } + }, + "supports": { + "html": false, + "interactivity": true, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true, + "link": true + } + }, + "__experimentalBorder": { + "radius": true, + "width": true, + "color": true, + "style": true + }, + "typography": { + "fontSize": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "innerBlocks": { + "allowedBlocks": [ "core/button" ] + } + }, + "attributes": { + "selectedUser": { + "type": "string", + "default": "site" + }, + "buttonOnly": { + "type": "boolean", + "default": false + } + }, + "usesContext": [ "postType", "postId" ], + "editorScript": "file:./index.js", + "viewScriptModule": "file:./view.js", + "viewScript": "wp-api-fetch", + "style": "file:./style-view.css", + "render": "file:./render.php" } From dfee0d2b2c9ba06e2eb7f6672156889d48274f81 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Mon, 19 May 2025 15:22:59 -0500 Subject: [PATCH 35/47] Improve migration --- build/follow-me/index.asset.php | 2 +- build/follow-me/index.js | 4 +-- src/follow-me/deprecation.js | 64 ++++++++++++++++++++++++--------- 3 files changed, 51 insertions(+), 19 deletions(-) diff --git a/build/follow-me/index.asset.php b/build/follow-me/index.asset.php index 194b8fe74..a40896d0e 100644 --- a/build/follow-me/index.asset.php +++ b/build/follow-me/index.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'c73f2f2bb1dde0fd7e3a'); + array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '49624f0cc66c91bddf95'); diff --git a/build/follow-me/index.js b/build/follow-me/index.js index a9872c548..7b72534da 100644 --- a/build/follow-me/index.js +++ b/build/follow-me/index.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e={20:(e,t,n)=>{var o=n(609),r=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,n){var o,s={},c=null,u=null;for(o in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,o)&&!i.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:c,ref:u,props:s,_owner:l.current}}},609:e=>{e.exports=window.React},848:(e,t,n)=>{e.exports=n(20)}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.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);const o=window.wp.blocks,r=window.wp.primitives;var a=n(848);const l=(0,a.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(r.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})}),i=[{attributes:{buttonText:{type:"string",default:"Follow"},buttonSize:{type:"string",default:"default",enum:["small","default","compact"]}},isEligible:e=>!!e.buttonText,migrate(e){const{buttonText:t,buttonSize:n,...r}=e;let a="";return"small"===n?a="is-small":"compact"===n&&(a="is-compact"),[r,[(0,o.createBlock)("core/button",{className:a,tagName:"button",text:t})]]}}];var s=n(609);const c=window.wp.apiFetch;var u=n.n(c);const p=window.wp.blockEditor,d=window.wp.i18n,v=window.wp.data,m=window.wp.coreData,w=window.wp.components,b=window.wp.element;function f(){return window._activityPubOptions||{}}function y({name:e}){const{enabled:t}=f(),n=t?.site?"":(0,d.__)("It will be empty in other non-author contexts.","activitypub"),o=(0,d.sprintf)(/* translators: %1$s: block name, %2$s: extra information for non-author context */ /* translators: %1$s: block name, %2$s: extra information for non-author context */ -(0,d.__)("This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s","activitypub"),e,n).trim();return(0,s.createElement)(w.Card,null,(0,s.createElement)(w.CardBody,null,(0,b.createInterpolateElement)(o,{strong:(0,s.createElement)("strong",null)})))}const h={avatar:"https://secure.gravatar.com/avatar/default?s=120",webfinger:"@well@hello.dolly",name:(0,d.__)("Hello Dolly Fan Account","activitypub"),url:"#"};function _(e){if(!e)return h;const t={...h,...e};return t.avatar=t?.icon?.url,t.webfinger&&!t.webfinger.startsWith("@")&&(t.webfinger="@"+t.webfinger),t}function g({profile:e,buttonOnly:t,innerBlocksProps:n}){const{webfinger:o,avatar:r,name:a}=e;return t?(0,s.createElement)("div",{className:"activitypub-profile"},(0,s.createElement)("div",{...n})):(0,s.createElement)("div",{className:"activitypub-profile"},(0,s.createElement)("img",{className:"activitypub-profile__avatar",src:r,alt:a}),(0,s.createElement)("div",{className:"activitypub-profile__content"},(0,s.createElement)("div",{className:"activitypub-profile__name"},a),(0,s.createElement)("div",{className:"activitypub-profile__handle",title:o},o)),(0,s.createElement)("div",{...n}))}(0,o.registerBlockType)("activitypub/follow-me",{deprecated:i,edit:function({attributes:e,setAttributes:t,context:{postType:n,postId:o}}){const r=(0,p.useBlockProps)({className:"activitypub-follow-me-block-wrapper"}),a=function({withInherit:e=!1}){const{enabled:t}=f(),n=t?.users?(0,v.useSelect)((e=>e("core").getUsers({who:"authors"}))):[];return(0,b.useMemo)((()=>{if(!n)return[];const o=[];return t?.site&&o.push({label:(0,d.__)("Site","activitypub"),value:"site"}),e&&t?.users&&o.push({label:(0,d.__)("Dynamic User","activitypub"),value:"inherit"}),n.reduce(((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e)),o)}),[n])}({withInherit:!0}),{selectedUser:l,buttonOnly:i}=e,c="inherit"===l,[E,k]=(0,b.useState)(_(h)),O="site"===l?0:l,x=[["core/button",{text:(0,d.__)("Follow","activitypub"),tagName:"button"}]],P=(0,p.useInnerBlocksProps)({},{allowedBlocks:["core/button"],template:x,templateLock:!1,renderAppender:!1}),B=(0,v.useSelect)((e=>{const{getEditedEntityRecord:t}=e(m.store),r=t("postType",n,o)?.author;return null!=r?r:null}),[n,o]);return(0,b.useEffect)((()=>{c&&!B||function(e){const{namespace:t}=f(),n={headers:{Accept:"application/activity+json"},path:`/${t}/actors/${e}`};return u()(n)}(c?B:O).then((e=>{k(_(e))}))}),[O,B,c]),(0,b.useEffect)((()=>{a.length&&(a.find((({value:e})=>e===l))||t({selectedUser:a[0].value}))}),[l,a]),(0,s.createElement)("div",{...r},(0,s.createElement)(p.InspectorControls,{key:"activitypub-follow-me"},(0,s.createElement)(w.PanelBody,{title:(0,d.__)("Follow Me Options","activitypub")},a.length>1&&(0,s.createElement)(w.SelectControl,{label:(0,d.__)("Select User","activitypub"),value:e.selectedUser,options:a,onChange:e=>t({selectedUser:e})}),(0,s.createElement)(w.ToggleControl,{label:(0,d.__)("Button Only Mode","activitypub"),checked:i,onChange:e=>t({buttonOnly:e}),help:(0,d.__)("Only show the follow button without profile information","activitypub")}))),c&&!B?(0,s.createElement)(y,{name:(0,d.__)("Follow Me","activitypub")}):(0,s.createElement)(g,{profile:E,userId:c?B:O,buttonOnly:i,innerBlocksProps:P}))},icon:l,save:function(){const e=p.useBlockProps.save(),t=p.useInnerBlocksProps.save(e);return(0,s.createElement)("div",{...t})}})})(); \ No newline at end of file +(()=>{"use strict";var e={20:(e,t,n)=>{var r=n(609),o=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,n){var r,s={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!i.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:s,_owner:l.current}}},609:e=>{e.exports=window.React},848:(e,t,n)=>{e.exports=n(20)}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.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 r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const r=window.wp.blocks,o=window.wp.primitives;var a=n(848);const l=(0,a.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(o.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})}),i=[{attributes:{buttonOnly:{type:"boolean",default:!1},buttonText:{type:"string",default:"Follow"},selectedUser:{type:"string",default:"site"}},supports:{html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},__experimentalBorder:{radius:!0,width:!0,color:!0,style:!0},typography:{fontSize:!0,__experimentalDefaultControls:{fontSize:!0}}},isEligible:e=>!!e.buttonText||!!e.buttonOnly,migrate(e){const{buttonText:t,...n}=e;return[n,[(0,r.createBlock)("core/button",{tagName:"button",text:t})]]}}];var s=n(609);const c=window.wp.apiFetch;var u=n.n(c);const p=window.wp.blockEditor,d=window.wp.i18n,v=window.wp.data,w=window.wp.coreData,b=window.wp.components,f=window.wp.element;function m(){return window._activityPubOptions||{}}function y({name:e}){const{enabled:t}=m(),n=t?.site?"":(0,d.__)("It will be empty in other non-author contexts.","activitypub"),r=(0,d.sprintf)(/* translators: %1$s: block name, %2$s: extra information for non-author context */ /* translators: %1$s: block name, %2$s: extra information for non-author context */ +(0,d.__)("This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s","activitypub"),e,n).trim();return(0,s.createElement)(b.Card,null,(0,s.createElement)(b.CardBody,null,(0,f.createInterpolateElement)(r,{strong:(0,s.createElement)("strong",null)})))}const _={avatar:"https://secure.gravatar.com/avatar/default?s=120",webfinger:"@well@hello.dolly",name:(0,d.__)("Hello Dolly Fan Account","activitypub"),url:"#"};function h(e){if(!e)return _;const t={..._,...e};return t.avatar=t?.icon?.url,t.webfinger&&!t.webfinger.startsWith("@")&&(t.webfinger="@"+t.webfinger),t}function g({profile:e,buttonOnly:t,innerBlocksProps:n}){const{webfinger:r,avatar:o,name:a}=e;return t?(0,s.createElement)("div",{className:"activitypub-profile"},(0,s.createElement)("div",{...n})):(0,s.createElement)("div",{className:"activitypub-profile"},(0,s.createElement)("img",{className:"activitypub-profile__avatar",src:o,alt:a}),(0,s.createElement)("div",{className:"activitypub-profile__content"},(0,s.createElement)("div",{className:"activitypub-profile__name"},a),(0,s.createElement)("div",{className:"activitypub-profile__handle",title:r},r)),(0,s.createElement)("div",{...n}))}(0,r.registerBlockType)("activitypub/follow-me",{deprecated:i,edit:function({attributes:e,setAttributes:t,context:{postType:n,postId:r}}){const o=(0,p.useBlockProps)({className:"activitypub-follow-me-block-wrapper"}),a=function({withInherit:e=!1}){const{enabled:t}=m(),n=t?.users?(0,v.useSelect)((e=>e("core").getUsers({who:"authors"}))):[];return(0,f.useMemo)((()=>{if(!n)return[];const r=[];return t?.site&&r.push({label:(0,d.__)("Site","activitypub"),value:"site"}),e&&t?.users&&r.push({label:(0,d.__)("Dynamic User","activitypub"),value:"inherit"}),n.reduce(((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e)),r)}),[n])}({withInherit:!0}),{selectedUser:l,buttonOnly:i}=e,c="inherit"===l,[E,k]=(0,f.useState)(h(_)),x="site"===l?0:l,O=[["core/button",{text:(0,d.__)("Follow","activitypub"),tagName:"button"}]],B=(0,p.useInnerBlocksProps)({},{allowedBlocks:["core/button"],template:O,templateLock:!1,renderAppender:!1}),P=(0,v.useSelect)((e=>{const{getEditedEntityRecord:t}=e(w.store),o=t("postType",n,r)?.author;return null!=o?o:null}),[n,r]);return(0,f.useEffect)((()=>{c&&!P||function(e){const{namespace:t}=m(),n={headers:{Accept:"application/activity+json"},path:`/${t}/actors/${e}`};return u()(n)}(c?P:x).then((e=>{k(h(e))}))}),[x,P,c]),(0,f.useEffect)((()=>{a.length&&(a.find((({value:e})=>e===l))||t({selectedUser:a[0].value}))}),[l,a]),(0,s.createElement)("div",{...o},(0,s.createElement)(p.InspectorControls,{key:"activitypub-follow-me"},(0,s.createElement)(b.PanelBody,{title:(0,d.__)("Follow Me Options","activitypub")},a.length>1&&(0,s.createElement)(b.SelectControl,{label:(0,d.__)("Select User","activitypub"),value:e.selectedUser,options:a,onChange:e=>t({selectedUser:e})}),(0,s.createElement)(b.ToggleControl,{label:(0,d.__)("Button Only Mode","activitypub"),checked:i,onChange:e=>t({buttonOnly:e}),help:(0,d.__)("Only show the follow button without profile information","activitypub")}))),c&&!P?(0,s.createElement)(y,{name:(0,d.__)("Follow Me","activitypub")}):(0,s.createElement)(g,{profile:E,userId:c?P:x,buttonOnly:i,innerBlocksProps:B}))},icon:l,save:function(){const e=p.useBlockProps.save(),t=p.useInnerBlocksProps.save(e);return(0,s.createElement)("div",{...t})}})})(); \ No newline at end of file diff --git a/src/follow-me/deprecation.js b/src/follow-me/deprecation.js index 4dd0a09d9..30b44acd6 100644 --- a/src/follow-me/deprecation.js +++ b/src/follow-me/deprecation.js @@ -6,36 +6,68 @@ import { createBlock } from '@wordpress/blocks'; */ const v1 = { attributes: { + buttonOnly: { + type: 'boolean', + default: false, + }, buttonText: { type: 'string', default: 'Follow', }, - buttonSize: { + selectedUser: { type: 'string', - default: 'default', - enum: [ 'small', 'default', 'compact' ], + default: 'site', }, }, + supports: { + html: false, + color: { + gradients: true, + link: true, + __experimentalDefaultControls: { + background: true, + text: true, + link: true, + }, + }, + __experimentalBorder: { + radius: true, + width: true, + color: true, + style: true, + }, + typography: { + fontSize: true, + __experimentalDefaultControls: { + fontSize: true, + }, + }, + }, + + /** + * Checks if the block is eligible for migration. + * + * @param {Object} attributes The block attributes. + * + * @return {boolean} Whether the block is eligible for migration. + */ isEligible( attributes ) { - // Run migration if buttonText attribute exists. - return !! attributes.buttonText; + // Run migration if buttonText or buttonOnly is set. + return !! attributes.buttonText || !! attributes.buttonOnly; }, + /** + * Migrates the Follow Me block to use a core button block instead of the custom button. + * + * @param {Object} attributes The block attributes. + * + * @return {[Object, Array]} An array with the new block attributes and inner blocks. + */ migrate( attributes ) { - const { buttonText, buttonSize, ...newAttributes } = attributes; - - // Map buttonSize to core/button className. - let className = ''; - if ( buttonSize === 'small' ) { - className = 'is-small'; - } else if ( buttonSize === 'compact' ) { - className = 'is-compact'; - } + const { buttonText, ...newAttributes } = attributes; - // Create a core button block with the buttonText and buttonSize. const buttonBlock = createBlock( 'core/button', { - className, tagName: 'button', text: buttonText, } ); From e64e45821f12f9e2c1170be76169eab096c9d855 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Mon, 19 May 2025 16:03:58 -0500 Subject: [PATCH 36/47] Cache computed styles --- build/follow-me/view.asset.php | 2 +- build/follow-me/view.js | 2 +- src/follow-me/button-style.js | 29 +++++++++++++++++++++++++---- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/build/follow-me/view.asset.php b/build/follow-me/view.asset.php index 208133e5a..e9a70969d 100644 --- a/build/follow-me/view.asset.php +++ b/build/follow-me/view.asset.php @@ -1 +1 @@ - array('@wordpress/interactivity'), 'version' => '90a92c519a7542a121fc', 'type' => 'module'); + array('@wordpress/interactivity'), 'version' => 'be310446665a8fc28ea1', 'type' => 'module'); diff --git a/build/follow-me/view.js b/build/follow-me/view.js index 21dc4770d..f4b73edf0 100644 --- a/build/follow-me/view.js +++ b/build/follow-me/view.js @@ -1 +1 @@ -import*as e from"@wordpress/interactivity";var t,o,n={825:(t,o,n)=>{const r=(c={getContext:()=>e.getContext,store:()=>e.store},l={},n.d(l,c),l);var c,l;function i(e){return!("undefined"==typeof window||!window.getComputedStyle)&&""!==window.getComputedStyle(document.documentElement).getPropertyValue(e).trim()}function s(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|"),o=`--wp--preset--color--${t}`;return i(o)?`var(${o})`:null}function a(e,t,o=null,n=""){return o?`${e}${n} { ${t}: ${o}; }\n`:""}function d(e,t,o,n){return a(e,"background-color",t)+a(e,"color",o)+a(e,"background-color",n,":hover")+a(e,"background-color",n,":focus")}const{apiFetch:u}=window.wp,{state:p,actions:f}=(0,r.store)("activitypub/follow-me",{actions:{openModal(){const e=(0,r.getContext)();e.isModalOpen=!0,document.body.classList.add("modal-open"),setTimeout((()=>{const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".activitypub-modal__frame");e&&function(e){const t=e.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),o=t[0],n=t[t.length-1];o&&o.classList.contains("activitypub-modal__close")&&t.length>1?t[1].focus():o.focus(),e.addEventListener("keydown",(function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?document.activeElement===o&&(n.focus(),e.preventDefault()):document.activeElement===n&&(o.focus(),e.preventDefault()))}))}(e)}}),50)},closeModal(){const e=(0,r.getContext)();e.isModalOpen=!1,document.body.classList.remove("modal-open");const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".wp-block-button__link");e&&e.focus()}},toggleModal(){const{isModalOpen:e}=(0,r.getContext)();e?f.closeModal():f.openModal()},copyToClipboard(){const e=(0,r.getContext)();navigator.clipboard.writeText(e.webfinger).then((()=>{e.copyButtonText=p.i18n.copied,setTimeout((()=>{e.copyButtonText=p.i18n.copy}),1e3)}),(e=>{console.error("Could not copy text: ",e)}))},updateRemoteProfile(e){const t=(0,r.getContext)();t.remoteProfile=e.target.value,t.isError=!1,t.errorMessage=""},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),f.submitRemoteProfile())},submitRemoteProfile:function*(){const e=(0,r.getContext)(),{namespace:t}=p,o=e.remoteProfile.trim();if(!o)return e.isError=!0,void(e.errorMessage=p.i18n.emptyProfileError);if(!/^(https?:\/\/|@)/.test(o))return e.isError=!0,void(e.errorMessage=p.i18n.invalidProfileError);e.isLoading=!0,e.isError=!1;const n=`/${t}/actors/${e.userId}/remote-follow?resource=${encodeURIComponent(o)}`;try{const t=yield u({path:n});e.isLoading=!1,window.open(t.url,"_blank"),f.closeModal()}catch(t){console.error("Error submitting profile:",t),e.isLoading=!1,e.isError=!0,e.errorMessage=t.message||p.i18n.genericError}}},callbacks:{initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:t,blockId:o}=(0,r.getContext)();if(o&&e){const r=document.createElement("style"),c=`#${o}`;r.textContent=function(e,t,o){const n=`${e} .wp-block-button__link`,r=function(e){if("string"==typeof e){const t=`--wp--preset--color--${e}`;return i(t)?`var(${t})`:null}return e?.color?.background||null}(o)||t?.color?.background;return d(n,s(t?.elements?.link?.color?.text),r,s(t?.elements?.link?.[":hover"]?.color?.text))}(c,e,t),document.head.appendChild(r);const l=document.createElement("style");l.textContent=(n=e,d(".activitypub-dialog__button-group .wp-block-button",s(n?.elements?.link?.color?.text)||"#111","#fff",s(n?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(l)}var n},documentKeydown(e){const{isModalOpen:t}=(0,r.getContext)();t&&"Escape"===e.key&&f.closeModal()},documentClick(e){const{blockId:t,isModalOpen:o}=(0,r.getContext)();if(!o)return;const n=document.getElementById(t);if(!n)return;const c=n.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(c&&(c===e.target||c.contains(e.target)))return;const l=n.querySelector(".activitypub-modal__frame");l&&!l.contains(e.target)&&f.closeModal()}}})}},r={};function c(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,c),o.exports}c.m=n,t=[],c.O=(e,o,n,r)=>{if(!o){var l=1/0;for(d=0;d=r)&&Object.keys(c.O).every((e=>c.O[e](o[s])))?o.splice(s--,1):(i=!1,r0&&t[d-1][2]>r;d--)t[d]=t[d-1];t[d]=[o,n,r]},c.d=(e,t)=>{for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={41:0,301:0},c.O.j=e=>0===o[e];var l=c.O(void 0,[301],(()=>c(825)));l=c.O(l); \ No newline at end of file +import*as e from"@wordpress/interactivity";var t,o,n={825:(t,o,n)=>{const r=(c={getContext:()=>e.getContext,store:()=>e.store},i={},n.d(i,c),i),l={computedStyles:null,variables:{}};var c,i;function s(e){if("undefined"==typeof window||!window.getComputedStyle)return!1;if(l.variables.hasOwnProperty(e))return l.variables[e];l.computedStyles||(l.computedStyles=window.getComputedStyle(document.documentElement));const t=l.computedStyles.getPropertyValue(e).trim();return l.variables[e]=""!==t,l.variables[e]}function a(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|"),o=`--wp--preset--color--${t}`;return s(o)?`var(${o})`:null}function d(e,t,o=null,n=""){return o?`${e}${n} { ${t}: ${o}; }\n`:""}function u(e,t,o,n){return d(e,"background-color",t)+d(e,"color",o)+d(e,"background-color",n,":hover")+d(e,"background-color",n,":focus")}const{apiFetch:p}=window.wp,{state:m,actions:f}=(0,r.store)("activitypub/follow-me",{actions:{openModal(){const e=(0,r.getContext)();e.isModalOpen=!0,document.body.classList.add("modal-open"),setTimeout((()=>{const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".activitypub-modal__frame");e&&function(e){const t=e.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),o=t[0],n=t[t.length-1];o&&o.classList.contains("activitypub-modal__close")&&t.length>1?t[1].focus():o.focus(),e.addEventListener("keydown",(function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?document.activeElement===o&&(n.focus(),e.preventDefault()):document.activeElement===n&&(o.focus(),e.preventDefault()))}))}(e)}}),50)},closeModal(){const e=(0,r.getContext)();e.isModalOpen=!1,document.body.classList.remove("modal-open");const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".wp-block-button__link");e&&e.focus()}},toggleModal(){const{isModalOpen:e}=(0,r.getContext)();e?f.closeModal():f.openModal()},copyToClipboard(){const e=(0,r.getContext)();navigator.clipboard.writeText(e.webfinger).then((()=>{e.copyButtonText=m.i18n.copied,setTimeout((()=>{e.copyButtonText=m.i18n.copy}),1e3)}),(e=>{console.error("Could not copy text: ",e)}))},updateRemoteProfile(e){const t=(0,r.getContext)();t.remoteProfile=e.target.value,t.isError=!1,t.errorMessage=""},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),f.submitRemoteProfile())},submitRemoteProfile:function*(){const e=(0,r.getContext)(),{namespace:t}=m,o=e.remoteProfile.trim();if(!o)return e.isError=!0,void(e.errorMessage=m.i18n.emptyProfileError);if(!/^(https?:\/\/|@)/.test(o))return e.isError=!0,void(e.errorMessage=m.i18n.invalidProfileError);e.isLoading=!0,e.isError=!1;const n=`/${t}/actors/${e.userId}/remote-follow?resource=${encodeURIComponent(o)}`;try{const t=yield p({path:n});e.isLoading=!1,window.open(t.url,"_blank"),f.closeModal()}catch(t){console.error("Error submitting profile:",t),e.isLoading=!1,e.isError=!0,e.errorMessage=t.message||m.i18n.genericError}}},callbacks:{initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:t,blockId:o}=(0,r.getContext)();if(o&&e){const r=document.createElement("style"),l=`#${o}`;r.textContent=function(e,t,o){const n=`${e} .wp-block-button__link`,r=function(e){if("string"==typeof e){const t=`--wp--preset--color--${e}`;return s(t)?`var(${t})`:null}return e?.color?.background||null}(o)||t?.color?.background;return u(n,a(t?.elements?.link?.color?.text),r,a(t?.elements?.link?.[":hover"]?.color?.text))}(l,e,t),document.head.appendChild(r);const c=document.createElement("style");c.textContent=(n=e,u(".activitypub-dialog__button-group .wp-block-button",a(n?.elements?.link?.color?.text)||"#111","#fff",a(n?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(c)}var n},documentKeydown(e){const{isModalOpen:t}=(0,r.getContext)();t&&"Escape"===e.key&&f.closeModal()},documentClick(e){const{blockId:t,isModalOpen:o}=(0,r.getContext)();if(!o)return;const n=document.getElementById(t);if(!n)return;const l=n.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(l&&(l===e.target||l.contains(e.target)))return;const c=n.querySelector(".activitypub-modal__frame");c&&!c.contains(e.target)&&f.closeModal()}}})}},r={};function l(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,l),o.exports}l.m=n,t=[],l.O=(e,o,n,r)=>{if(!o){var c=1/0;for(d=0;d=r)&&Object.keys(l.O).every((e=>l.O[e](o[s])))?o.splice(s--,1):(i=!1,r0&&t[d-1][2]>r;d--)t[d]=t[d-1];t[d]=[o,n,r]},l.d=(e,t)=>{for(var o in t)l.o(t,o)&&!l.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={41:0,301:0},l.O.j=e=>0===o[e];var c=l.O(void 0,[301],(()=>l(825)));c=l.O(c); \ No newline at end of file diff --git a/src/follow-me/button-style.js b/src/follow-me/button-style.js index 52cff3fd7..b022cd08e 100644 --- a/src/follow-me/button-style.js +++ b/src/follow-me/button-style.js @@ -1,6 +1,17 @@ +/** + * Cache for computed styles and CSS variable checks. + */ +const cssCache = { + computedStyles: null, + variables: {}, +}; + /** * Checks if a CSS variable is defined. * + * Uses a caching mechanism to avoid frequent getComputedStyle calls, + * which can cause layout thrashing when called repeatedly. + * * @param {string} variableName The CSS variable name to check. * @return {boolean} Whether the variable is defined. */ @@ -10,14 +21,24 @@ function isCssVariableDefined( variableName ) { return false; } - // Get the computed style of the root element. - const styles = window.getComputedStyle( document.documentElement ); + // Check if we've already cached this variable. + if ( cssCache.variables.hasOwnProperty( variableName ) ) { + return cssCache.variables[ variableName ]; + } + + // Get the computed style of the root element (cached). + if ( ! cssCache.computedStyles ) { + cssCache.computedStyles = window.getComputedStyle( document.documentElement ); + } // Get the value of the CSS variable. - const value = styles.getPropertyValue( variableName ).trim(); + const value = cssCache.computedStyles.getPropertyValue( variableName ).trim(); + + // Cache the result. + cssCache.variables[ variableName ] = value !== ''; // If the value is empty, the variable is not defined or is set to an empty value. - return value !== ''; + return cssCache.variables[ variableName ]; } /** From f605d813e430a15fb4d7d9804af59c090aa59025 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Tue, 20 May 2025 09:50:50 -0500 Subject: [PATCH 37/47] Genuinely my best good faith effort to make colors work across themes. --- build/follow-me/index.js.map | 1 + build/follow-me/render.php | 2 + build/follow-me/style-view.css | 2 +- build/follow-me/style-view.css.map | 1 + build/follow-me/view.js.map | 1 + src/follow-me/render.php | 2 + src/follow-me/style.scss | 106 ++++------------------------- 7 files changed, 21 insertions(+), 94 deletions(-) create mode 100644 build/follow-me/index.js.map create mode 100644 build/follow-me/style-view.css.map create mode 100644 build/follow-me/view.js.map diff --git a/build/follow-me/index.js.map b/build/follow-me/index.js.map new file mode 100644 index 000000000..cd12c83d9 --- /dev/null +++ b/build/follow-me/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"follow-me/index.js","mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACkD;AACF;AAChD,4BAA4B,sDAAI,CAAC,sDAAG;AACpC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA;AACA,GAAG;AACH,CAAC;AACD,iEAAe,MAAM,EAAC;AACtB;;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,IAAI,IAAqC;AACzC;AACA;;AAEA,YAAY,mBAAO,CAAC,oBAAO;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,iGAAiG,eAAe;AAChH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA,KAAK,GAAG;;AAER,kDAAkD;AAClD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,4BAA4B;AAC5B;AACA,qCAAqC;;AAErC,gCAAgC;AAChC;AACA;;AAEA,gCAAgC;;AAEhC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;;AAGJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;;AAGF;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,sBAAsB;AACtB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,uBAAuB;AACvB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,wBAAwB;AACxB;AACA,SAAS;AACT,iCAAiC;AACjC;AACA,SAAS;AACT,2BAA2B;AAC3B;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;;AAE3D;AACA;;AAEA;AACA,yDAAyD;AACzD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA,gFAAgF;AAChF;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;;;AAGlB;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA,IAAI;;;AAGJ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2HAA2H;AAC3H;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA,oEAAoE;;AAEpE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC;;AAEjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,GAAG;AACd,WAAW,eAAe;AAC1B,WAAW,GAAG;AACd,WAAW,GAAG;AACd;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;;AAER;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;;AAEA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA,oBAAoB;AACpB,2DAA2D,UAAU;AACrE,yBAAyB,UAAU;AACnC;AACA,aAAa,UAAU;AACvB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,YAAY,SAAS;AACrB;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,6DAA6D;AAC7D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,GAAG;AACd;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,iBAAiB;AACvC;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN,4CAA4C;;AAE5C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;;;AAGA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,8CAA8C;AAC9C;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA,0DAA0D;AAC1D;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,gDAAgD,gDAAgD,MAAM,aAAa;;AAEnH;AACA,iDAAiD,kCAAkC,OAAO;;AAE1F,yGAAyG,cAAc,UAAU,gGAAgG,kBAAkB,UAAU,UAAU;;AAEvQ;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ACF,IAAI,CAAE;QACTtB,KAAK,EAAEyB,IAAI,CAACxE,IAAI;QAChB6C,KAAK,EAAE,GAAI2B,IAAI,CAACC,EAAE,EAAG,CAAE;MACxB,CAAE,CAAC;MACH,OAAOF,GAAG;IACX,CAAC,EAAEH,YAAa,CAAC;EAClB,CAAC,EAAE,CAAEH,KAAK,CAAG,CAAC;AACf;;;;;;;;;;ACnDA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;ACNsD;AACZ;AACH;AACb;AACA;;AAE1B;AACAS,oEAAiB,CAAE,uBAAuB,EAAE;EAC3CE,UAAU;EACVC,IAAI;EACJxE,IAAI,EAAEsE,wDAAM;EACZvB,IAAIA,+CAAAA;AACL,CAAE,CAAC,C","sources":["webpack://wordpress-activitypub/./node_modules/@wordpress/icons/build-module/library/people.js","webpack://wordpress-activitypub/./node_modules/react/cjs/react-jsx-runtime.development.js","webpack://wordpress-activitypub/./node_modules/react/jsx-runtime.js","webpack://wordpress-activitypub/./src/follow-me/deprecation.js","webpack://wordpress-activitypub/./src/follow-me/edit.js","webpack://wordpress-activitypub/./src/follow-me/save.js","webpack://wordpress-activitypub/./src/shared/inherit-block-fallback.js","webpack://wordpress-activitypub/./src/shared/use-options.js","webpack://wordpress-activitypub/./src/shared/use-user-options.js","webpack://wordpress-activitypub/external window [\"wp\",\"apiFetch\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blockEditor\"]","webpack://wordpress-activitypub/external window [\"wp\",\"blocks\"]","webpack://wordpress-activitypub/external window [\"wp\",\"components\"]","webpack://wordpress-activitypub/external window [\"wp\",\"coreData\"]","webpack://wordpress-activitypub/external window [\"wp\",\"data\"]","webpack://wordpress-activitypub/external window [\"wp\",\"element\"]","webpack://wordpress-activitypub/external window [\"wp\",\"i18n\"]","webpack://wordpress-activitypub/external window [\"wp\",\"primitives\"]","webpack://wordpress-activitypub/external window \"React\"","webpack://wordpress-activitypub/webpack/bootstrap","webpack://wordpress-activitypub/webpack/runtime/compat get default export","webpack://wordpress-activitypub/webpack/runtime/define property getters","webpack://wordpress-activitypub/webpack/runtime/hasOwnProperty shorthand","webpack://wordpress-activitypub/webpack/runtime/make namespace object","webpack://wordpress-activitypub/./src/follow-me/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst people = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z\",\n fillRule: \"evenodd\"\n })\n});\nexport default people;\n//# sourceMappingURL=people.js.map","/**\n * @license React\n * react-jsx-runtime.development.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\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'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 { createBlock } from '@wordpress/blocks';\n\n/**\n * Deprecation for the Follow Me block to use a core button block instead of the custom button.\n * This handles the migration of the buttonText and buttonSize attributes to the innerBlock.\n */\nconst v1 = {\n\tattributes: {\n\t\tbuttonOnly: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t\tbuttonText: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'Follow',\n\t\t},\n\t\tselectedUser: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'site',\n\t\t},\n\t},\n\n\tsupports: {\n\t\thtml: false,\n\t\tcolor: {\n\t\t\tgradients: true,\n\t\t\tlink: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tbackground: true,\n\t\t\t\ttext: true,\n\t\t\t\tlink: true,\n\t\t\t},\n\t\t},\n\t\t__experimentalBorder: {\n\t\t\tradius: true,\n\t\t\twidth: true,\n\t\t\tcolor: true,\n\t\t\tstyle: true,\n\t\t},\n\t\ttypography: {\n\t\t\tfontSize: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tfontSize: true,\n\t\t\t},\n\t\t},\n\t},\n\n\t/**\n\t * Checks if the block is eligible for migration.\n\t *\n\t * @param {Object} attributes The block attributes.\n\t *\n\t * @return {boolean} Whether the block is eligible for migration.\n\t */\n\tisEligible( attributes ) {\n\t\t// Run migration if buttonText or buttonOnly is set.\n\t\treturn !! attributes.buttonText || !! attributes.buttonOnly;\n\t},\n\n\t/**\n\t * Migrates the Follow Me block to use a core button block instead of the custom button.\n\t *\n\t * @param {Object} attributes The block attributes.\n\t *\n\t * @return {[Object, Array]} An array with the new block attributes and inner blocks.\n\t */\n\tmigrate( attributes ) {\n\t\tconst { buttonText, ...newAttributes } = attributes;\n\n\t\tconst buttonBlock = createBlock( 'core/button', {\n\t\t\ttagName: 'button',\n\t\t\ttext: buttonText,\n\t\t} );\n\n\t\treturn [ newAttributes, [ buttonBlock ] ];\n\t},\n};\n\nexport default [ v1 ];\n","import apiFetch from '@wordpress/api-fetch';\nimport { InspectorControls, useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { SelectControl, PanelBody, ToggleControl } from '@wordpress/components';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useUserOptions } from '../shared/use-user-options';\nimport { InheritModeBlockFallback } from '../shared/inherit-block-fallback';\nimport { useOptions } from '../shared/use-options';\n\n/**\n * Default profile data.\n *\n * @type {Object}\n */\nconst DEFAULT_PROFILE_DATA = {\n\tavatar: 'https://secure.gravatar.com/avatar/default?s=120',\n\twebfinger: '@well@hello.dolly',\n\tname: __( 'Hello Dolly Fan Account', 'activitypub' ),\n\turl: '#',\n};\n\n/**\n * Get normalized profile data.\n *\n * @param {Object} profile Profile data.\n * @return {Object} Normalized profile data.\n */\nfunction getNormalizedProfile( profile ) {\n\tif ( ! profile ) {\n\t\treturn DEFAULT_PROFILE_DATA;\n\t}\n\n\tconst data = { ...DEFAULT_PROFILE_DATA, ...profile };\n\tdata.avatar = data?.icon?.url;\n\n\t// Ensure webfinger always has the @ prefix.\n\tif ( data.webfinger && ! data.webfinger.startsWith( '@' ) ) {\n\t\tdata.webfinger = '@' + data.webfinger;\n\t}\n\n\treturn data;\n}\n\n/**\n * Fetch profile data.\n *\n * @param {number} userId User ID.\n * @return {Promise} Promise resolving with profile data.\n */\nfunction fetchProfile( userId ) {\n\tconst { namespace } = useOptions();\n\tconst fetchOptions = {\n\t\theaders: { Accept: 'application/activity+json' },\n\t\tpath: `/${ namespace }/actors/${ userId }`,\n\t};\n\treturn apiFetch( fetchOptions );\n}\n\n/**\n * Profile component for the editor.\n *\n * @param {Object} props Component props.\n * @return {JSX.Element} Profile component.\n */\nfunction EditorProfile( { profile, buttonOnly, innerBlocksProps } ) {\n\tconst { webfinger, avatar, name } = profile;\n\n\tif ( buttonOnly ) {\n\t\treturn (\n\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\treturn (\n\t\t
\n\t\t\t{\n\t\t\t
\n\t\t\t\t
{ name }
\n\t\t\t\t
\n\t\t\t\t\t{ webfinger }\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t
\n\t);\n}\n\n/**\n * Edit component.\n *\n * @param {Object} props Component props.\n * @param {Object} props.attributes Block attributes.\n * @param {Function} props.setAttributes Set block attributes.\n * @param {Object} props.context Block context.\n * @param {string} props.context.postType Post type.\n * @param {number} props.context.postId Post ID.\n * @return {JSX.Element} Edit component.\n */\nexport default function Edit( { attributes, setAttributes, context: { postType, postId } } ) {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'activitypub-follow-me-block-wrapper',\n\t} );\n\tconst usersOptions = useUserOptions( { withInherit: true } );\n\tconst { selectedUser, buttonOnly } = attributes;\n\tconst isInheritMode = selectedUser === 'inherit';\n\tconst [ profile, setProfile ] = useState( getNormalizedProfile( DEFAULT_PROFILE_DATA ) );\n\tconst userId = selectedUser === 'site' ? 0 : selectedUser;\n\n\tconst TEMPLATE = [ [ 'core/button', { text: __( 'Follow', 'activitypub' ), tagName: 'button' } ] ];\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{},\n\t\t{\n\t\t\tallowedBlocks: [ 'core/button' ],\n\t\t\ttemplate: TEMPLATE,\n\t\t\ttemplateLock: false,\n\t\t\trenderAppender: false,\n\t\t}\n\t);\n\n\tconst authorId = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord( 'postType', postType, postId )?.author;\n\n\t\t\treturn _authorId ?? null;\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tuseEffect( () => {\n\t\t// Fetch profile data when userId changes.\n\t\tif ( isInheritMode && ! authorId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst effectiveUserId = isInheritMode ? authorId : userId;\n\t\tfetchProfile( effectiveUserId ).then( ( data ) => {\n\t\t\tsetProfile( getNormalizedProfile( data ) );\n\t\t} );\n\t}, [ userId, authorId, isInheritMode ] );\n\n\tuseEffect( () => {\n\t\t// If there are no users yet, do nothing.\n\t\tif ( ! usersOptions.length ) {\n\t\t\treturn;\n\t\t}\n\t\t// Ensure that the selected user is in the list of options, if not, select the first available user.\n\t\tif ( ! usersOptions.find( ( { value } ) => value === selectedUser ) ) {\n\t\t\tsetAttributes( { selectedUser: usersOptions[ 0 ].value } );\n\t\t}\n\t}, [ selectedUser, usersOptions ] );\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{ usersOptions.length > 1 && (\n\t\t\t\t\t\t setAttributes( { selectedUser: value } ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t setAttributes( { buttonOnly: value } ) }\n\t\t\t\t\t\thelp={ __( 'Only show the follow button without profile information', 'activitypub' ) }\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\n\t\t\t{ isInheritMode && ! authorId ? (\n\t\t\t\t\n\t\t\t) : (\n\t\t\t\t\n\t\t\t) }\n\t\t
\n\t);\n}\n","import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\n\n/**\n * Save component for the Follow Me block.\n *\n * This component ensures that inner blocks (the button) are properly saved.\n *\n * @return {JSX.Element|null} Save component.\n */\nfunction save() {\n\tconst blockProps = useBlockProps.save();\n\tconst innerBlocksProps = useInnerBlocksProps.save( blockProps );\n\n\treturn
;\n}\n\nexport default save;\n","import { Card, CardBody } from '@wordpress/components';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\n/**\n * Block fallback component for inheriting user context in ActivityPub blocks.\n *\n * @param {Object} props\n * @param {string} props.name - Name of the block.\n * @returns {JSX.Element} Rendered fallback block.\n */\nexport function InheritModeBlockFallback( { name } ) {\n\tconst { enabled } = useOptions();\n\tconst nonAuthorExtra = enabled?.site ? '' : __( 'It will be empty in other non-author contexts.', 'activitypub' );\n\tconst text = sprintf(\n\t\t/* translators: %1$s: block name, %2$s: extra information for non-author context */\n\t\t__(\n\t\t\t'This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s',\n\t\t\t'activitypub'\n\t\t),\n\t\tname,\n\t\tnonAuthorExtra\n\t).trim();\n\n\treturn (\n\t\t\n\t\t\t{ createInterpolateElement( text, { strong: } ) }\n\t\t\n\t);\n}\n","/**\n * React hook to return the ActivityPub options object from the global window.\n *\n * @returns {Object} The options object.\n */\nexport function useOptions() {\n\treturn window._activityPubOptions || {};\n}\n","import { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { useOptions } from './use-options';\n\n/**\n * React hook providing user options for ActivityPub blocks.\n *\n * @param {Object} params\n * @param {boolean} params.withInherit - Whether to include the inherit option.\n * @returns {Array} List of user option objects.\n */\nexport function useUserOptions( { withInherit = false } ) {\n\tconst { enabled } = useOptions();\n\tconst users = enabled?.users ? useSelect( ( select ) => select( 'core' ).getUsers( { who: 'authors' } ) ) : [];\n\n\t/**\n\t * Memoized computation of user options for block settings.\n\t */\n\treturn useMemo( () => {\n\t\tif ( ! users ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst userKeywords = [];\n\n\t\tif ( enabled?.site ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Site', 'activitypub' ),\n\t\t\t\tvalue: 'site',\n\t\t\t} );\n\t\t}\n\n\t\t// Only show the inherit option when explicitly asked for and users are enabled.\n\t\tif ( withInherit && enabled?.users ) {\n\t\t\tuserKeywords.push( {\n\t\t\t\tlabel: __( 'Dynamic User', 'activitypub' ),\n\t\t\t\tvalue: 'inherit',\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Reduce users into keyword/value pairs for options.\n\t\t */\n\t\treturn users.reduce( ( acc, user ) => {\n\t\t\tacc.push( {\n\t\t\t\tlabel: user.name,\n\t\t\t\tvalue: `${ user.id }`, // Casting to string because that's how Gutenberg stores the attribute.\n\t\t\t} );\n\t\t\treturn acc;\n\t\t}, userKeywords );\n\t}, [ users ] );\n}\n","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"React\"];","// 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\t// no module.id needed\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport { people } from '@wordpress/icons';\nimport deprecated from './deprecation';\nimport edit from './edit';\nimport save from './save';\n\n// Register the block.\nregisterBlockType( 'activitypub/follow-me', {\n\tdeprecated,\n\tedit,\n\ticon: people,\n\tsave,\n} );\n"],"names":["createBlock","v1","attributes","buttonOnly","type","default","buttonText","selectedUser","supports","html","color","gradients","link","__experimentalDefaultControls","background","text","__experimentalBorder","radius","width","style","typography","fontSize","isEligible","migrate","newAttributes","buttonBlock","tagName","apiFetch","InspectorControls","useBlockProps","useInnerBlocksProps","__","useSelect","store","coreStore","SelectControl","PanelBody","ToggleControl","useEffect","useState","useUserOptions","InheritModeBlockFallback","useOptions","DEFAULT_PROFILE_DATA","avatar","webfinger","name","url","getNormalizedProfile","profile","data","icon","startsWith","fetchProfile","userId","namespace","fetchOptions","headers","Accept","path","EditorProfile","innerBlocksProps","createElement","className","src","alt","title","Edit","setAttributes","context","postType","postId","blockProps","usersOptions","withInherit","isInheritMode","setProfile","TEMPLATE","allowedBlocks","template","templateLock","renderAppender","authorId","select","getEditedEntityRecord","_authorId","author","effectiveUserId","then","length","find","value","key","label","options","onChange","checked","help","save","Card","CardBody","sprintf","createInterpolateElement","enabled","nonAuthorExtra","site","trim","strong","window","_activityPubOptions","useMemo","users","getUsers","who","userKeywords","push","reduce","acc","user","id","registerBlockType","people","deprecated","edit"],"sourceRoot":""} \ No newline at end of file diff --git a/build/follow-me/render.php b/build/follow-me/render.php index f55c01ede..bc8bd2a15 100644 --- a/build/follow-me/render.php +++ b/build/follow-me/render.php @@ -157,6 +157,7 @@ class="activitypub-modal__close" /> diff --git a/build/follow-me/style-view.css b/build/follow-me/style-view.css index e7ab61b01..6cd2c6426 100644 --- a/build/follow-me/style-view.css +++ b/build/follow-me/style-view.css @@ -1 +1 @@ -.activitypub-follow-me-block-wrapper{display:block;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{align-items:center;display:flex;padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1rem;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{flex:1;margin-right:1rem;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle,.activitypub-follow-me-block-wrapper .activitypub-profile__name{color:inherit;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button{align-items:center;display:flex;margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button:not(:only-child){flex:.5;margin-left:1rem}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8rem;padding:.25rem .5rem}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9rem;padding:.4rem .8rem}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border .activitypub-profile{padding-left:1rem;padding-right:1rem}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;color:initial;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:var(--wp--preset--color--white);border-radius:4px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.activitypub-modal__header{align-items:center;border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);display:flex;flex-shrink:0;justify-content:space-between;padding:2rem 2rem 1.5rem}.activitypub-modal__title{font-size:130%;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__close{background:none;border:none;color:var(--wp--preset--color--gray,#555);cursor:pointer;padding:.5rem;fill:var(--wp--preset--color--gray,#555);align-items:center;display:flex;justify-content:center}.activitypub-modal__close:active,.activitypub-modal__close:hover{background:none;color:var(--wp--preset--color--black);fill:var(--wp--preset--color--black)}.activitypub-modal__close:active{border:none;padding:.5rem}.activitypub-modal__content{overflow-y:auto}.activitypub-dialog__section{border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);padding:1.5rem 2rem}.activitypub-dialog__section:last-child{border-bottom:none;padding-bottom:2rem}.activitypub-dialog__section h4{font-size:110%;margin-bottom:.5rem;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:95%;margin-bottom:1rem}.activitypub-dialog__button-group{display:flex;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input[type]{border:1px solid var(--wp--preset--color--gray,#e2e4e7);border-radius:4px 0 0 4px;flex:1;line-height:1;margin:0}.activitypub-dialog__button-group input[type]::-moz-placeholder{opacity:.5}.activitypub-dialog__button-group input[type]::placeholder{opacity:.5}.activitypub-dialog__button-group input[type][aria-invalid=true]{border-color:var(--wp--preset--color--vivid-red)}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important;min-width:22.5%;width:auto}.activitypub-dialog__error{color:var(--wp--preset--color--vivid-red);font-size:90%;margin-top:.5rem}body.modal-open{overflow:hidden}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}} +.activitypub-follow-me-block-wrapper{display:block;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{align-items:center;display:flex;padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1rem;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{flex:1;margin-right:1rem;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle,.activitypub-follow-me-block-wrapper .activitypub-profile__name{color:inherit;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button{align-items:center;display:flex;margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button:not(:only-child){margin-left:1rem}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8rem;padding:.25rem .5rem}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9rem;padding:.4rem .8rem}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border .activitypub-profile{padding-left:1rem;padding-right:1rem}body.modal-open{overflow:hidden}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;color:initial;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:var(--wp--preset--color--white);border-radius:4px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.activitypub-modal__header{align-items:center;border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);display:flex;flex-shrink:0;justify-content:space-between;padding:2rem 2rem 1.5rem}.activitypub-modal__title{font-size:130%;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__close{align-items:center;background:none;border:none;color:var(--wp--preset--color--gray,#555);cursor:pointer;display:flex;justify-content:center;padding:.5rem}.activitypub-modal__close:active,.activitypub-modal__close:hover{background:none;color:var(--wp--preset--color--black);fill:var(--wp--preset--color--black)}.activitypub-modal__close:active{border:none;padding:.5rem}.activitypub-modal__content{overflow-y:auto}.activitypub-dialog__section{border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);padding:1.5rem 2rem}.activitypub-dialog__section:last-child{border-bottom:none;padding-bottom:2rem}.activitypub-dialog__section h4{font-size:110%;margin-bottom:.5rem;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:95%;margin-bottom:1rem}.activitypub-dialog__button-group{display:flex;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input[type]{border:1px solid var(--wp--preset--color--gray,#e2e4e7);border-radius:4px 0 0 4px;flex:1;line-height:1;margin:0}.activitypub-dialog__button-group input[type]::-moz-placeholder{opacity:.5}.activitypub-dialog__button-group input[type]::placeholder{opacity:.5}.activitypub-dialog__button-group input[type][aria-invalid=true]{border-color:var(--wp--preset--color--vivid-red)}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important;min-width:22.5%;width:auto}.activitypub-dialog__error{color:var(--wp--preset--color--vivid-red);font-size:90%;margin-top:.5rem}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}} diff --git a/src/follow-me/render.php b/src/follow-me/render.php index 967fa7ebd..49a81cd6a 100644 --- a/src/follow-me/render.php +++ b/src/follow-me/render.php @@ -137,7 +137,7 @@ class="activitypub-modal__close" data-wp-on--click="actions.closeModal" aria-label="" > -
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'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","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"editor\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"plugins\"];","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"wp\"][\"url\"];","module.exports = window[\"React\"];","// 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\t// no module.id needed\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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { PluginDocumentSettingPanel, PluginPreviewMenuItem } from '@wordpress/editor';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { TextControl, RadioControl, RangeControl, __experimentalText as Text, Tooltip } from '@wordpress/components';\nimport { Icon, globe, people, external } from '@wordpress/icons';\nimport { useSelect, select } from '@wordpress/data';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __ } from '@wordpress/i18n';\nimport { SVG, Path } from '@wordpress/primitives';\n\n// Defining our own because it's too new in @wordpress/icons\n// https://github.com/WordPress/gutenberg/blob/trunk/packages/icons/src/library/not-allowed.js\nconst notAllowed = (\n\t\n\t\t\n\t\n);\n\n/**\n * Editor plugin for ActivityPub settings in the block editor.\n *\n * @returns {JSX.Element|null} The settings panel for ActivityPub or null for sync blocks.\n */\nconst EditorPlugin = () => {\n\tconst postType = useSelect( ( select ) => select( 'core/editor' ).getCurrentPostType(), [] );\n\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\n\n\tconst labelStyling = {\n\t\tverticalAlign: 'middle',\n\t\tgap: '4px',\n\t\tjustifyContent: 'start',\n\t\tdisplay: 'inline-flex',\n\t\talignItems: 'center',\n\t};\n\n\t/**\n\t * Enhances a label with an icon and tooltip.\n\t *\n\t * @param {JSX.Element} icon The icon to display.\n\t * @param {string} text The label text.\n\t * @param {string} tooltip The tooltip text.\n\t *\n\t * @returns {JSX.Element} The enhanced label component.\n\t */\n\tconst enhancedLabel = ( icon, text, tooltip ) => (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t{ text }\n\t\t\t\n\t\t\n\t);\n\n\t// Don't show when editing sync blocks.\n\tif ( 'wp_block' === postType ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t\n\t\t\t {\n\t\t\t\t\tsetMeta( { ...meta, activitypub_content_warning: value } );\n\t\t\t\t} }\n\t\t\t\tplaceholder={ __( 'Optional content warning', 'activitypub' ) }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Content warnings do not change the content on your site, only in the fediverse.',\n\t\t\t\t\t'activitypub'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t {\n\t\t\t\t\tsetMeta( { ...meta, activitypub_max_image_attachments: value } );\n\t\t\t\t} }\n\t\t\t\tmin={ 0 }\n\t\t\t\tmax={ 10 }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Maximum number of image attachments to include when sharing to the fediverse.',\n\t\t\t\t\t'activitypub'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t {\n\t\t\t\t\tsetMeta( { ...meta, activitypub_content_visibility: value } );\n\t\t\t\t} }\n\t\t\t\tclassName=\"activitypub-visibility\"\n\t\t\t/>\n\t\t\n\t);\n};\n\n/**\n * Opens the Fediverse preview for the current post in a new tab.\n */\nfunction onActivityPubPreview() {\n\tconst previewLink = select( 'core/editor' ).getEditedPostPreviewLink();\n\tconst fediversePreviewLink = addQueryArgs( previewLink, { activitypub: 'true' } );\n\n\twindow.open( fediversePreviewLink, '_blank' );\n}\n\n/**\n * Renders the preview menu item for Fediverse preview.\n *\n * @returns {JSX.Element} The preview menu item component.\n */\nconst EditorPreview = () => {\n\t// check if post was saved\n\tconst post_status = useSelect( ( select ) => select( 'core/editor' ).getCurrentPost().status );\n\n\treturn (\n\t\t<>\n\t\t\t{ PluginPreviewMenuItem ? (\n\t\t\t\t onActivityPubPreview() }\n\t\t\t\t\ticon={ external }\n\t\t\t\t\tdisabled={ post_status === 'auto-draft' }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Fediverse preview ⁂', 'activitypub' ) }\n\t\t\t\t\n\t\t\t) : null }\n\t\t\n\t);\n};\n\nregisterPlugin( 'activitypub-editor-plugin', { render: EditorPlugin } );\nregisterPlugin( 'activitypub-editor-preview', { render: EditorPreview } );\n"],"names":["PluginDocumentSettingPanel","PluginPreviewMenuItem","registerPlugin","TextControl","RadioControl","RangeControl","__experimentalText","Text","Tooltip","Icon","globe","people","external","useSelect","select","useEntityProp","addQueryArgs","__","SVG","Path","notAllowed","createElement","xmlns","viewBox","fillRule","clipRule","d","EditorPlugin","_ref","_meta$activitypub_max","postType","getCurrentPostType","meta","setMeta","labelStyling","verticalAlign","gap","justifyContent","display","alignItems","enhancedLabel","icon","text","tooltip","style","name","title","label","value","activitypub_content_warning","onChange","placeholder","help","activitypub_max_image_attachments","window","_activityPubOptions","maxImageAttachments","min","max","selected","activitypub_content_visibility","options","className","onActivityPubPreview","previewLink","getEditedPostPreviewLink","fediversePreviewLink","activitypub","open","EditorPreview","post_status","getCurrentPost","status","Fragment","onClick","disabled","render"],"sourceRoot":""} \ No newline at end of file From 11c4231a02b410d7930342ea789f1e36b842321c Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Tue, 20 May 2025 15:56:17 -0500 Subject: [PATCH 47/47] Move trapFocus in utils --- build/follow-me/view.asset.php | 2 +- build/follow-me/view.js | 2 +- src/follow-me/view.js | 92 +++++++++++++++++----------------- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/build/follow-me/view.asset.php b/build/follow-me/view.asset.php index 3a5278dc1..e05081792 100644 --- a/build/follow-me/view.asset.php +++ b/build/follow-me/view.asset.php @@ -1 +1 @@ - array('@wordpress/interactivity'), 'version' => '06e71f34acfebb2812ce', 'type' => 'module'); + array('@wordpress/interactivity'), 'version' => '66f75ff35a5e5e082c49', 'type' => 'module'); diff --git a/build/follow-me/view.js b/build/follow-me/view.js index d8588bfb1..4862dc41e 100644 --- a/build/follow-me/view.js +++ b/build/follow-me/view.js @@ -1 +1 @@ -import*as e from"@wordpress/interactivity";var t,o,n={825:(t,o,n)=>{const r=(i={getContext:()=>e.getContext,store:()=>e.store},c={},n.d(c,i),c),l={computedStyles:null,variables:{}};var i,c;function s(e){if("undefined"==typeof window||!window.getComputedStyle)return!1;if(l.variables.hasOwnProperty(e))return l.variables[e];l.computedStyles||(l.computedStyles=window.getComputedStyle(document.documentElement));const t=l.computedStyles.getPropertyValue(e).trim();return l.variables[e]=""!==t,l.variables[e]}function a(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|"),o=`--wp--preset--color--${t}`;return s(o)?`var(${o})`:null}function d(e,t,o=null,n=""){return o?`${e}${n} { ${t}: ${o}; }\n`:""}function u(e,t,o,n){return d(e,"background-color",t)+d(e,"color",o)+d(e,"background-color",n,":hover")+d(e,"background-color",n,":focus")}const{apiFetch:p}=window.wp,{state:m,actions:f,utils:y}=(0,r.store)("activitypub/follow-me",{actions:{openModal(){const e=(0,r.getContext)();e.isModalOpen=!0,document.body.classList.add("modal-open"),setTimeout((()=>{const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".activitypub-modal__frame");e&&function(e){const t=e.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]):not([readonly]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),o=t[0],n=t[t.length-1];o&&o.classList.contains("activitypub-modal__close")&&t.length>1?t[1].focus():o.focus(),e.addEventListener("keydown",(function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?document.activeElement===o&&(n.focus(),e.preventDefault()):document.activeElement===n&&(o.focus(),e.preventDefault()))}))}(e)}}),50)},closeModal(){const e=(0,r.getContext)();e.isModalOpen=!1,e.isError=!1,document.body.classList.remove("modal-open");const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".wp-block-button__link");e&&e.focus()}},toggleModal(){const{isModalOpen:e}=(0,r.getContext)();e?f.closeModal():f.openModal()},copyToClipboard(){const e=(0,r.getContext)();navigator.clipboard.writeText(e.webfinger).then((()=>{e.copyButtonText=m.i18n.copied,setTimeout((()=>{e.copyButtonText=m.i18n.copy}),1e3)}),(e=>{console.error("Could not copy text: ",e)}))},updateRemoteProfile(e){const t=(0,r.getContext)();t.remoteProfile=e.target.value,t.isError=!1,t.errorMessage=""},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),f.submitRemoteProfile())},submitRemoteProfile:function*(){const e=(0,r.getContext)(),{namespace:t}=m,o=e.remoteProfile.trim();if(!o)return e.isError=!0,void(e.errorMessage=m.i18n.emptyProfileError);if(!y.isHandle(o))return e.isError=!0,void(e.errorMessage=m.i18n.invalidProfileError);e.isLoading=!0,e.isError=!1;const n=`/${t}/actors/${e.userId}/remote-follow?resource=${encodeURIComponent(o)}`;try{const t=yield p({path:n});e.isLoading=!1,window.open(t.url,"_blank"),f.closeModal()}catch(t){console.error("Error submitting profile:",t),e.isLoading=!1,e.isError=!0,e.errorMessage=t.message||m.i18n.genericError}}},callbacks:{initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:t,blockId:o}=(0,r.getContext)();if(o&&e){const r=document.createElement("style"),l=`#${o}`;r.textContent=function(e,t,o){const n=`${e} .wp-block-button__link`,r=function(e){if("string"==typeof e){const t=`--wp--preset--color--${e}`;return s(t)?`var(${t})`:null}return e?.color?.background||null}(o)||t?.color?.background;return u(n,a(t?.elements?.link?.color?.text),r,a(t?.elements?.link?.[":hover"]?.color?.text))}(l,e,t),document.head.appendChild(r);const i=document.createElement("style");i.textContent=(n=e,u(".activitypub-dialog__button-group .wp-block-button",a(n?.elements?.link?.color?.text)||"#111","#fff",a(n?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(i)}var n},documentKeydown(e){const{isModalOpen:t}=(0,r.getContext)();t&&"Escape"===e.key&&f.closeModal()},documentClick(e){const{blockId:t,isModalOpen:o}=(0,r.getContext)();if(!o)return;const n=document.getElementById(t);if(!n)return;const l=n.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(l&&(l===e.target||l.contains(e.target)))return;const i=n.querySelector(".activitypub-modal__frame");i&&!i.contains(e.target)&&f.closeModal()}},utils:{isHandle(e){const t=e.replace(/^@/,"").split("@");return 2===t.length&&y.isUrl(`https://${t[1]}`)},isUrl(e){try{return new URL(e),!0}catch(e){return!1}}}})}},r={};function l(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,l),o.exports}l.m=n,t=[],l.O=(e,o,n,r)=>{if(!o){var i=1/0;for(d=0;d=r)&&Object.keys(l.O).every((e=>l.O[e](o[s])))?o.splice(s--,1):(c=!1,r0&&t[d-1][2]>r;d--)t[d]=t[d-1];t[d]=[o,n,r]},l.d=(e,t)=>{for(var o in t)l.o(t,o)&&!l.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={41:0,301:0},l.O.j=e=>0===o[e];var i=l.O(void 0,[301],(()=>l(825)));i=l.O(i); \ No newline at end of file +import*as e from"@wordpress/interactivity";var t,o,n={825:(t,o,n)=>{const r=(i={getContext:()=>e.getContext,store:()=>e.store},c={},n.d(c,i),c),l={computedStyles:null,variables:{}};var i,c;function s(e){if("undefined"==typeof window||!window.getComputedStyle)return!1;if(l.variables.hasOwnProperty(e))return l.variables[e];l.computedStyles||(l.computedStyles=window.getComputedStyle(document.documentElement));const t=l.computedStyles.getPropertyValue(e).trim();return l.variables[e]=""!==t,l.variables[e]}function a(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|"),o=`--wp--preset--color--${t}`;return s(o)?`var(${o})`:null}function d(e,t,o=null,n=""){return o?`${e}${n} { ${t}: ${o}; }\n`:""}function u(e,t,o,n){return d(e,"background-color",t)+d(e,"color",o)+d(e,"background-color",n,":hover")+d(e,"background-color",n,":focus")}const{apiFetch:p}=window.wp,{state:m,actions:f,utils:y}=(0,r.store)("activitypub/follow-me",{actions:{openModal(){const e=(0,r.getContext)();e.isModalOpen=!0,document.body.classList.add("modal-open"),setTimeout((()=>{const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".activitypub-modal__frame");e&&y.trapFocus(e)}}),50)},closeModal(){const e=(0,r.getContext)();e.isModalOpen=!1,e.isError=!1,document.body.classList.remove("modal-open");const t=document.getElementById(e.blockId);if(t){const e=t.querySelector(".wp-block-button__link");e&&e.focus()}},toggleModal(){const{isModalOpen:e}=(0,r.getContext)();e?f.closeModal():f.openModal()},copyToClipboard(){const e=(0,r.getContext)();navigator.clipboard.writeText(e.webfinger).then((()=>{e.copyButtonText=m.i18n.copied,setTimeout((()=>{e.copyButtonText=m.i18n.copy}),1e3)}),(e=>{console.error("Could not copy text: ",e)}))},updateRemoteProfile(e){const t=(0,r.getContext)();t.remoteProfile=e.target.value,t.isError=!1,t.errorMessage=""},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),f.submitRemoteProfile())},submitRemoteProfile:function*(){const e=(0,r.getContext)(),{namespace:t}=m,o=e.remoteProfile.trim();if(!o)return e.isError=!0,void(e.errorMessage=m.i18n.emptyProfileError);if(!y.isHandle(o))return e.isError=!0,void(e.errorMessage=m.i18n.invalidProfileError);e.isLoading=!0,e.isError=!1;const n=`/${t}/actors/${e.userId}/remote-follow?resource=${encodeURIComponent(o)}`;try{const t=yield p({path:n});e.isLoading=!1,window.open(t.url,"_blank"),f.closeModal()}catch(t){console.error("Error submitting profile:",t),e.isLoading=!1,e.isError=!0,e.errorMessage=t.message||m.i18n.genericError}}},callbacks:{initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:t,blockId:o}=(0,r.getContext)();if(o&&e){const r=document.createElement("style"),l=`#${o}`;r.textContent=function(e,t,o){const n=`${e} .wp-block-button__link`,r=function(e){if("string"==typeof e){const t=`--wp--preset--color--${e}`;return s(t)?`var(${t})`:null}return e?.color?.background||null}(o)||t?.color?.background;return u(n,a(t?.elements?.link?.color?.text),r,a(t?.elements?.link?.[":hover"]?.color?.text))}(l,e,t),document.head.appendChild(r);const i=document.createElement("style");i.textContent=(n=e,u(".activitypub-dialog__button-group .wp-block-button",a(n?.elements?.link?.color?.text)||"#111","#fff",a(n?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(i)}var n},documentKeydown(e){const{isModalOpen:t}=(0,r.getContext)();t&&"Escape"===e.key&&f.closeModal()},documentClick(e){const{blockId:t,isModalOpen:o}=(0,r.getContext)();if(!o)return;const n=document.getElementById(t);if(!n)return;const l=n.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(l&&(l===e.target||l.contains(e.target)))return;const i=n.querySelector(".activitypub-modal__frame");i&&!i.contains(e.target)&&f.closeModal()}},utils:{isHandle(e){const t=e.replace(/^@/,"").split("@");return 2===t.length&&y.isUrl(`https://${t[1]}`)},isUrl(e){try{return new URL(e),!0}catch(e){return!1}}},trapFocus(e){const t=e.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]):not([readonly]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),o=t[0],n=t[t.length-1];o&&o.classList.contains("activitypub-modal__close")&&t.length>1?t[1].focus():o.focus(),e.addEventListener("keydown",(function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?document.activeElement===o&&(n.focus(),e.preventDefault()):document.activeElement===n&&(o.focus(),e.preventDefault()))}))}})}},r={};function l(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,l),o.exports}l.m=n,t=[],l.O=(e,o,n,r)=>{if(!o){var i=1/0;for(d=0;d=r)&&Object.keys(l.O).every((e=>l.O[e](o[s])))?o.splice(s--,1):(c=!1,r0&&t[d-1][2]>r;d--)t[d]=t[d-1];t[d]=[o,n,r]},l.d=(e,t)=>{for(var o in t)l.o(t,o)&&!l.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={41:0,301:0},l.O.j=e=>0===o[e];var i=l.O(void 0,[301],(()=>l(825)));i=l.O(i); \ No newline at end of file diff --git a/src/follow-me/view.js b/src/follow-me/view.js index 2f73f9a70..b1d9b0e4c 100644 --- a/src/follow-me/view.js +++ b/src/follow-me/view.js @@ -5,51 +5,6 @@ import './style.scss'; /** @var {object} wp WordPress global. */ const { apiFetch } = window.wp; -/** - * Traps focus within the specified element. - * - * @param {Element} element The element to trap focus within. - */ -function trapFocus( element ) { - const focusableElements = element.querySelectorAll( - 'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]):not([readonly]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])' - ); - const firstFocusableElement = focusableElements[ 0 ]; - const lastFocusableElement = focusableElements[ focusableElements.length - 1 ]; - - // If the first focusable element is the close button, set initial focus to the next element instead. - if ( - firstFocusableElement && - firstFocusableElement.classList.contains( 'activitypub-modal__close' ) && - focusableElements.length > 1 - ) { - // Set initial focus to the second element, but keep firstFocusableElement as is for tab trapping. - focusableElements[ 1 ].focus(); - } else { - // Otherwise focus the first element as usual. - firstFocusableElement.focus(); - } - - element.addEventListener( 'keydown', function ( event ) { - if ( event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */ ) { - return; - } - - if ( event.shiftKey ) { - /* shift + tab */ - if ( document.activeElement === firstFocusableElement ) { - lastFocusableElement.focus(); - event.preventDefault(); - } - } /* tab */ else { - if ( document.activeElement === lastFocusableElement ) { - firstFocusableElement.focus(); - event.preventDefault(); - } - } - } ); -} - const { state, actions, utils } = store( 'activitypub/follow-me', { actions: { /** @@ -67,7 +22,7 @@ const { state, actions, utils } = store( 'activitypub/follow-me', { if ( blockWrapper ) { const modalFrame = blockWrapper.querySelector( '.activitypub-modal__frame' ); if ( modalFrame ) { - trapFocus( modalFrame ); + utils.trapFocus( modalFrame ); } } }, 50 ); @@ -298,4 +253,49 @@ const { state, actions, utils } = store( 'activitypub/follow-me', { } }, }, + + /** + * Traps focus within the specified element. + * + * @param {Element} element The element to trap focus within. + */ + trapFocus( element ) { + const focusableElements = element.querySelectorAll( + 'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]):not([readonly]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])' + ); + const firstFocusableElement = focusableElements[ 0 ]; + const lastFocusableElement = focusableElements[ focusableElements.length - 1 ]; + + // If the first focusable element is the close button, set initial focus to the next element instead. + if ( + firstFocusableElement && + firstFocusableElement.classList.contains( 'activitypub-modal__close' ) && + focusableElements.length > 1 + ) { + // Set initial focus to the second element, but keep firstFocusableElement as is for tab trapping. + focusableElements[ 1 ].focus(); + } else { + // Otherwise focus the first element as usual. + firstFocusableElement.focus(); + } + + element.addEventListener( 'keydown', function ( event ) { + if ( event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */ ) { + return; + } + + if ( event.shiftKey ) { + /* shift + tab */ + if ( document.activeElement === firstFocusableElement ) { + lastFocusableElement.focus(); + event.preventDefault(); + } + } /* tab */ else { + if ( document.activeElement === lastFocusableElement ) { + firstFocusableElement.focus(); + event.preventDefault(); + } + } + } ); + }, } );