updated plugin ActivityPub version 9.1.0

This commit is contained in:
2026-07-28 15:03:10 +00:00
committed by Gitium
parent bf428f0e45
commit ff806e1811
217 changed files with 6098 additions and 3025 deletions

View File

@ -7,5 +7,9 @@
"description": "Manage ActivityPub settings, followers, and federation from the WordPress admin.",
"icon": "smartphone",
"textdomain": "activitypub",
"editorScript": "file:./index.js"
"viewScriptModule": [
"file:./loader.js",
"file:./routes/feed/content.js",
"file:./routes/feed/route.js"
]
}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
"use strict";(globalThis.webpackChunkwordpress_activitypub=globalThis.webpackChunkwordpress_activitypub||[]).push([[843],{4831(s,t,p){p.r(t),p.d(t,{route:()=>r});const r={inspector:({search:s})=>!!s.postId}}}]);

View File

@ -1 +0,0 @@
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-preferences', 'wp-primitives', 'wp-url'), 'version' => '3b7e2c6f3b9b959e939d');

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array('@wordpress/boot'), 'version' => '628716c963d567f5237c', 'type' => 'module');

View File

@ -0,0 +1 @@
import{initSinglePage as t}from"@wordpress/boot";const e=()=>{const{mountId:e,routes:n}=(()=>{const t=document.getElementById("wp-script-module-data-@activitypub/app");if(!t?.textContent)return{};try{return JSON.parse(t.textContent)}catch{return{}}})();e&&Array.isArray(n)&&t({mountId:e,routes:n})};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e,{once:!0}):e();

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array('@wordpress/route'), 'version' => '3f559ba6405dafacccda', 'type' => 'module');

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => '2342cc8363fb9d82cc64', 'type' => 'module');

View File

@ -0,0 +1 @@
const t=window.wp.i18n,i={title:()=>(0,t.__)("Social Web","activitypub"),inspector:({search:t})=>!!t.postId};export{i as route};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,10 +0,0 @@
.themed-surface{background:#fff;border-radius:0;display:flex;flex:1;flex-direction:column;min-height:0;overflow:hidden}@media(min-width:782px){.themed-surface{border-radius:var(--wpds-border-radius-large,8px)}}
.panel{display:flex;flex:1;flex-direction:column;margin:0;min-height:0}@media(min-width:782px){.panel{margin:var(--wpds-spacing-40,16px) 0 var(--wpds-spacing-40,16px) var(--wpds-spacing-40,16px)}}
.site-icon{align-items:center;display:flex;justify-content:center}.site-icon__image{aspect-ratio:1/1;background:#333;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.site-icon__icon{fill:currentcolor}
.site-hub{align-items:center;display:flex;gap:var(--wpds-spacing-20,8px);height:var(--wpds-spacing-160,64px);justify-content:space-between;margin-left:var(--wpds-spacing-30,12px)}.site-hub__actions{flex-shrink:0}.site-hub__icon-container{flex-shrink:0;height:var(--wpds-spacing-160,64px);width:var(--wpds-spacing-160,64px)}.site-hub__icon-container.has-transparent-background .site-hub__icon-container{background:transparent}.site-hub__icon-button.components-button{align-items:center;background:#1e1e1e;border-radius:0;color:#fff;display:flex;height:var(--wpds-spacing-160,64px);justify-content:center;overflow:hidden;padding:0;position:relative;view-transition-name:toggle;width:var(--wpds-spacing-160,64px)}.site-hub__icon-button.components-button:active,.site-hub__icon-button.components-button:hover{color:#fff}.site-hub__icon-button.components-button:focus,.site-hub__icon-button.components-button:focus-visible{box-shadow:0 0 0 3px #1e1e1e,0 0 0 6px var(--wp-admin-theme-color);outline:4px solid transparent;outline-offset:4px}.site-hub__icon-button.components-button:before{border-radius:var(--wpds-border-radius-large,8px);bottom:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));box-shadow:none;content:"";display:block;right:calc(var(--wpds-spacing-40, 16px) + var(--wpds-border-width-focus, 1px));position:absolute;left:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));top:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px))}@media not (prefers-reduced-motion){.site-hub__icon-button.components-button:before{transition:box-shadow .1s ease}}.site-hub__icon-button.components-button .site-icon{height:var(--wpds-spacing-160,64px);width:var(--wpds-spacing-160,64px)}.site-hub__icon-button.components-button .site-icon__icon{height:100%;width:100%}.site-hub__title .components-button{color:#e0e0e0;display:block;flex-grow:1;font-size:var(--wpds-font-size-medium,15px);font-weight:var(--wpds-font-weight-medium,500);margin-right:-4px;overflow:hidden;padding-left:var(--wpds-spacing-40,16px);position:relative;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.site-hub__title .components-button:active,.site-hub__title .components-button:focus,.site-hub__title .components-button:hover{color:#e0e0e0}.site-hub__title .components-button:focus{box-shadow:none;outline:none}.site-hub__title .components-button:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) #1e1e1e,0 0 0 calc(var(--wp-admin-border-width-focus)*2) var(--wp-admin-theme-color);outline:2px solid transparent;outline-offset:2px}.site-hub__title .components-button:after{content:"↗";font-weight:400;opacity:0;position:absolute;left:0}@media not (prefers-reduced-motion){.site-hub__title .components-button:after{transition:opacity .1s linear}}.site-hub__title .components-button:active:after,.site-hub__title .components-button:focus:after,.site-hub__title .components-button:hover:after{opacity:1}.site-hub__command-button{color:#e0e0e0}.site-hub__command-button:active svg,.site-hub__command-button:hover svg{fill:#f0f0f0}.site-hub-mobile{align-items:center;background:#1e1e1e;border-bottom:1px solid hsla(0,0%,100%,.1);display:flex;flex-shrink:0;height:56px;justify-content:space-between;padding:0 var(--wpds-spacing-30,12px)}.site-hub-mobile__title{color:#fff;font-size:var(--wpds-font-size-medium,16px);font-weight:var(--wpds-font-weight-medium,500)}.site-hub-mobile__button.components-button{color:#e0e0e0}.site-hub-mobile__button.components-button:focus:not(:disabled),.site-hub-mobile__button.components-button:hover:not(:disabled){color:#fff}.site-hub-mobile__button.components-button:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:2px solid transparent}
.activitypub-avatar{background-color:#f0f0f0;border-radius:50%;flex-shrink:0;height:var(--wpds-spacing-120,48px);-o-object-fit:cover;object-fit:cover;width:var(--wpds-spacing-120,48px)}
.actor-switcher{align-items:center;color:#e0e0e0;display:flex;min-width:0;padding-right:2px;text-decoration:none;transition:color .2s ease}.actor-switcher:hover:not(:disabled){color:#fff}.actor-switcher__avatar{border-radius:50%;flex-shrink:0;height:32px;width:32px}.actor-switcher__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.popular-tags{background:transparent!important;border-bottom:none!important;border-right:none!important;border-left:none!important;border-top:1px solid hsla(0,0%,100%,.1);box-shadow:none!important;padding:0 var(--wpds-spacing-30,12px) var(--wpds-spacing-30,12px)}.popular-tags__title{color:#949494;font-size:11px;font-weight:500;letter-spacing:.5px;margin:var(--wpds-spacing-30,12px) 0 var(--wpds-spacing-20,8px) 0;padding:0 var(--wpds-spacing-20,8px);text-transform:uppercase}.popular-tags__loading{color:#ccc;font-size:13px;padding:var(--wpds-spacing-20,8px)}.popular-tags .components-menu-group{background:transparent!important;border:none!important;box-shadow:none!important;margin:0;padding:0}.popular-tags .menu-item{align-items:center;color:#e0e0e0;display:flex;gap:var(--wpds-spacing-20,8px)}.popular-tags .menu-item:hover{background-color:hsla(0,0%,100%,.1);color:#fff}.popular-tags .menu-item.is-pressed{background-color:hsla(0,0%,100%,.15);color:#fff}.popular-tags .menu-item svg{flex-shrink:0}
.sidebar{background-color:#1e1e1e;color:#ccc;display:flex;flex:1;flex-direction:column}.sidebar .nav{flex:1;overflow-y:auto;padding:0 var(--wpds-spacing-30,12px)}.sidebar .sidebar-navigation__icon-title{background:#1e1e1e;margin-bottom:var(--wpds-spacing-20,8px);padding-bottom:var(--wpds-spacing-20,8px);padding-top:var(--wpds-spacing-120,48px);position:sticky;top:0}.sidebar .sidebar-navigation__button{color:#e0e0e0;flex-shrink:0}.sidebar .sidebar-navigation__button:focus:not(:disabled){box-shadow:none;outline:none}.sidebar .sidebar-navigation__button:focus-visible:not(:disabled){box-shadow:0 0 0 var(--wpds-border-width-focus,1.5px) var(--wp-admin-theme-color);outline:3px solid transparent}.sidebar .sidebar-navigation__button:focus,.sidebar .sidebar-navigation__button:focus-visible,.sidebar .sidebar-navigation__button:hover:not(:disabled,[aria-disabled=true]),.sidebar .sidebar-navigation__button:not(:disabled,[aria-disabled=true]):active,.sidebar .sidebar-navigation__button[aria-expanded=true]{color:#f0f0f0}.sidebar .sidebar-navigation__title{color:#e0e0e0;flex-grow:1;line-height:var(--wpds-spacing-80,32px);overflow-wrap:break-word}.sidebar .sidebar-description{margin:0 0 var(--wpds-spacing-80,32px) 0;padding:0 var(--wpds-spacing-40,16px)}.sidebar .menu-item{color:#e0e0e0;transition:none!important}.sidebar .menu-item:focus{box-shadow:none!important;outline:none!important}.sidebar .menu-item:focus-visible{box-shadow:0 0 0 var(--wpds-border-width-focus,1.5px) var(--wp-admin-theme-color)!important;outline:3px solid transparent!important}.sidebar .menu-item:hover{color:#fff!important}.sidebar .menu-item:active,.sidebar .menu-item:hover{background-color:hsla(0,0%,100%,.1)!important}.sidebar .menu-item.is-selected,.sidebar .menu-item[aria-pressed=true]{background-color:hsla(0,0%,100%,.15)!important;color:#fff!important}.sidebar .menu-item.is-selected:active,.sidebar .menu-item.is-selected:hover,.sidebar .menu-item[aria-pressed=true]:active,.sidebar .menu-item[aria-pressed=true]:hover{background-color:hsla(0,0%,100%,.15)!important}.sidebar .menu-item svg{margin-left:var(--wpds-spacing-10,8px)}.sidebar .object-types-menu{margin-top:var(--wpds-spacing-10,4px)}.sidebar .object-types{padding:var(--wpds-spacing-20,8px) var(--wpds-spacing-30,12px)}.sidebar .object-types__loading{color:#ccc;font-size:13px}.sidebar .footer{border-top:1px solid hsla(0,0%,100%,.1);padding:var(--wpds-spacing-40,16px)}.sidebar .footer>.components-h-stack{padding:2px 0}.sidebar .footer .footer-settings-button{color:#e0e0e0;flex-shrink:0}.sidebar .footer .footer-settings-button:hover:not(:disabled){color:#fff}
#activitypub-app-root>div{height:100%}.app-layout{background-color:#1e1e1e;display:flex;flex-direction:column;height:100%;isolation:isolate;overflow:hidden;width:100%}.sidebar-backdrop{background-color:rgba(0,0,0,.5);cursor:pointer;inset:0;position:fixed;z-index:100002}.app-content{background-color:#1e1e1e;display:flex;flex-grow:1;height:100%;overflow:hidden;width:100%}.app-content.is-mobile,.sidebar-region{flex-direction:column}.sidebar-region{display:flex;flex-shrink:0;height:100%;width:300px}.sidebar-region.is-mobile{background-color:#1e1e1e;bottom:0;box-shadow:-2px 0 8px rgba(0,0,0,.3);right:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.inspector-region,.stage-region{bottom:0;display:flex;flex-direction:column;height:calc(100vh - 56px);right:0;overflow:hidden;position:fixed;left:0;top:56px;width:100vw}@media(min-width:782px){.inspector-region,.stage-region{bottom:auto;height:auto;right:auto;position:static;left:auto;top:auto;width:auto}}.stage-region{z-index:2}@media(min-width:782px){.stage-region{flex:1 1 auto;min-width:0;z-index:auto}}.inspector-region{z-index:3}@media(min-width:782px){.inspector-region{flex:0 0 var(--sw-inspector-width,380px);z-index:auto}}.components-snackbar-list{bottom:20px;right:20px;position:fixed;z-index:100000}@media(max-width:782px){.components-snackbar-list{bottom:10px;right:10px;left:10px}}
:root{--sw-sidebar-width:300px;--sw-inspector-width:50%}.activitypub-app-layout{bottom:0;right:0;position:fixed;left:0;top:0}#wpfooter{display:none}

View File

@ -1,10 +0,0 @@
.themed-surface{background:#fff;border-radius:0;display:flex;flex:1;flex-direction:column;min-height:0;overflow:hidden}@media(min-width:782px){.themed-surface{border-radius:var(--wpds-border-radius-large,8px)}}
.panel{display:flex;flex:1;flex-direction:column;margin:0;min-height:0}@media(min-width:782px){.panel{margin:var(--wpds-spacing-40,16px) var(--wpds-spacing-40,16px) var(--wpds-spacing-40,16px) 0}}
.site-icon{align-items:center;display:flex;justify-content:center}.site-icon__image{aspect-ratio:1/1;background:#333;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.site-icon__icon{fill:currentcolor}
.site-hub{align-items:center;display:flex;gap:var(--wpds-spacing-20,8px);height:var(--wpds-spacing-160,64px);justify-content:space-between;margin-right:var(--wpds-spacing-30,12px)}.site-hub__actions{flex-shrink:0}.site-hub__icon-container{flex-shrink:0;height:var(--wpds-spacing-160,64px);width:var(--wpds-spacing-160,64px)}.site-hub__icon-container.has-transparent-background .site-hub__icon-container{background:transparent}.site-hub__icon-button.components-button{align-items:center;background:#1e1e1e;border-radius:0;color:#fff;display:flex;height:var(--wpds-spacing-160,64px);justify-content:center;overflow:hidden;padding:0;position:relative;view-transition-name:toggle;width:var(--wpds-spacing-160,64px)}.site-hub__icon-button.components-button:active,.site-hub__icon-button.components-button:hover{color:#fff}.site-hub__icon-button.components-button:focus,.site-hub__icon-button.components-button:focus-visible{box-shadow:0 0 0 3px #1e1e1e,0 0 0 6px var(--wp-admin-theme-color);outline:4px solid transparent;outline-offset:4px}.site-hub__icon-button.components-button:before{border-radius:var(--wpds-border-radius-large,8px);bottom:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));box-shadow:none;content:"";display:block;left:calc(var(--wpds-spacing-40, 16px) + var(--wpds-border-width-focus, 1px));position:absolute;right:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));top:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px))}@media not (prefers-reduced-motion){.site-hub__icon-button.components-button:before{transition:box-shadow .1s ease}}.site-hub__icon-button.components-button .site-icon{height:var(--wpds-spacing-160,64px);width:var(--wpds-spacing-160,64px)}.site-hub__icon-button.components-button .site-icon__icon{height:100%;width:100%}.site-hub__title .components-button{color:#e0e0e0;display:block;flex-grow:1;font-size:var(--wpds-font-size-medium,15px);font-weight:var(--wpds-font-weight-medium,500);margin-left:-4px;overflow:hidden;padding-right:var(--wpds-spacing-40,16px);position:relative;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.site-hub__title .components-button:active,.site-hub__title .components-button:focus,.site-hub__title .components-button:hover{color:#e0e0e0}.site-hub__title .components-button:focus{box-shadow:none;outline:none}.site-hub__title .components-button:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) #1e1e1e,0 0 0 calc(var(--wp-admin-border-width-focus)*2) var(--wp-admin-theme-color);outline:2px solid transparent;outline-offset:2px}.site-hub__title .components-button:after{content:"↗";font-weight:400;opacity:0;position:absolute;right:0}@media not (prefers-reduced-motion){.site-hub__title .components-button:after{transition:opacity .1s linear}}.site-hub__title .components-button:active:after,.site-hub__title .components-button:focus:after,.site-hub__title .components-button:hover:after{opacity:1}.site-hub__command-button{color:#e0e0e0}.site-hub__command-button:active svg,.site-hub__command-button:hover svg{fill:#f0f0f0}.site-hub-mobile{align-items:center;background:#1e1e1e;border-bottom:1px solid hsla(0,0%,100%,.1);display:flex;flex-shrink:0;height:56px;justify-content:space-between;padding:0 var(--wpds-spacing-30,12px)}.site-hub-mobile__title{color:#fff;font-size:var(--wpds-font-size-medium,16px);font-weight:var(--wpds-font-weight-medium,500)}.site-hub-mobile__button.components-button{color:#e0e0e0}.site-hub-mobile__button.components-button:focus:not(:disabled),.site-hub-mobile__button.components-button:hover:not(:disabled){color:#fff}.site-hub-mobile__button.components-button:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:2px solid transparent}
.activitypub-avatar{background-color:#f0f0f0;border-radius:50%;flex-shrink:0;height:var(--wpds-spacing-120,48px);-o-object-fit:cover;object-fit:cover;width:var(--wpds-spacing-120,48px)}
.actor-switcher{align-items:center;color:#e0e0e0;display:flex;min-width:0;padding-left:2px;text-decoration:none;transition:color .2s ease}.actor-switcher:hover:not(:disabled){color:#fff}.actor-switcher__avatar{border-radius:50%;flex-shrink:0;height:32px;width:32px}.actor-switcher__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.popular-tags{background:transparent!important;border-bottom:none!important;border-left:none!important;border-right:none!important;border-top:1px solid hsla(0,0%,100%,.1);box-shadow:none!important;padding:0 var(--wpds-spacing-30,12px) var(--wpds-spacing-30,12px)}.popular-tags__title{color:#949494;font-size:11px;font-weight:500;letter-spacing:.5px;margin:var(--wpds-spacing-30,12px) 0 var(--wpds-spacing-20,8px) 0;padding:0 var(--wpds-spacing-20,8px);text-transform:uppercase}.popular-tags__loading{color:#ccc;font-size:13px;padding:var(--wpds-spacing-20,8px)}.popular-tags .components-menu-group{background:transparent!important;border:none!important;box-shadow:none!important;margin:0;padding:0}.popular-tags .menu-item{align-items:center;color:#e0e0e0;display:flex;gap:var(--wpds-spacing-20,8px)}.popular-tags .menu-item:hover{background-color:hsla(0,0%,100%,.1);color:#fff}.popular-tags .menu-item.is-pressed{background-color:hsla(0,0%,100%,.15);color:#fff}.popular-tags .menu-item svg{flex-shrink:0}
.sidebar{background-color:#1e1e1e;color:#ccc;display:flex;flex:1;flex-direction:column}.sidebar .nav{flex:1;overflow-y:auto;padding:0 var(--wpds-spacing-30,12px)}.sidebar .sidebar-navigation__icon-title{background:#1e1e1e;margin-bottom:var(--wpds-spacing-20,8px);padding-bottom:var(--wpds-spacing-20,8px);padding-top:var(--wpds-spacing-120,48px);position:sticky;top:0}.sidebar .sidebar-navigation__button{color:#e0e0e0;flex-shrink:0}.sidebar .sidebar-navigation__button:focus:not(:disabled){box-shadow:none;outline:none}.sidebar .sidebar-navigation__button:focus-visible:not(:disabled){box-shadow:0 0 0 var(--wpds-border-width-focus,1.5px) var(--wp-admin-theme-color);outline:3px solid transparent}.sidebar .sidebar-navigation__button:focus,.sidebar .sidebar-navigation__button:focus-visible,.sidebar .sidebar-navigation__button:hover:not(:disabled,[aria-disabled=true]),.sidebar .sidebar-navigation__button:not(:disabled,[aria-disabled=true]):active,.sidebar .sidebar-navigation__button[aria-expanded=true]{color:#f0f0f0}.sidebar .sidebar-navigation__title{color:#e0e0e0;flex-grow:1;line-height:var(--wpds-spacing-80,32px);overflow-wrap:break-word}.sidebar .sidebar-description{margin:0 0 var(--wpds-spacing-80,32px) 0;padding:0 var(--wpds-spacing-40,16px)}.sidebar .menu-item{color:#e0e0e0;transition:none!important}.sidebar .menu-item:focus{box-shadow:none!important;outline:none!important}.sidebar .menu-item:focus-visible{box-shadow:0 0 0 var(--wpds-border-width-focus,1.5px) var(--wp-admin-theme-color)!important;outline:3px solid transparent!important}.sidebar .menu-item:hover{color:#fff!important}.sidebar .menu-item:active,.sidebar .menu-item:hover{background-color:hsla(0,0%,100%,.1)!important}.sidebar .menu-item.is-selected,.sidebar .menu-item[aria-pressed=true]{background-color:hsla(0,0%,100%,.15)!important;color:#fff!important}.sidebar .menu-item.is-selected:active,.sidebar .menu-item.is-selected:hover,.sidebar .menu-item[aria-pressed=true]:active,.sidebar .menu-item[aria-pressed=true]:hover{background-color:hsla(0,0%,100%,.15)!important}.sidebar .menu-item svg{margin-right:var(--wpds-spacing-10,8px)}.sidebar .object-types-menu{margin-top:var(--wpds-spacing-10,4px)}.sidebar .object-types{padding:var(--wpds-spacing-20,8px) var(--wpds-spacing-30,12px)}.sidebar .object-types__loading{color:#ccc;font-size:13px}.sidebar .footer{border-top:1px solid hsla(0,0%,100%,.1);padding:var(--wpds-spacing-40,16px)}.sidebar .footer>.components-h-stack{padding:2px 0}.sidebar .footer .footer-settings-button{color:#e0e0e0;flex-shrink:0}.sidebar .footer .footer-settings-button:hover:not(:disabled){color:#fff}
#activitypub-app-root>div{height:100%}.app-layout{background-color:#1e1e1e;display:flex;flex-direction:column;height:100%;isolation:isolate;overflow:hidden;width:100%}.sidebar-backdrop{background-color:rgba(0,0,0,.5);cursor:pointer;inset:0;position:fixed;z-index:100002}.app-content{background-color:#1e1e1e;display:flex;flex-grow:1;height:100%;overflow:hidden;width:100%}.app-content.is-mobile,.sidebar-region{flex-direction:column}.sidebar-region{display:flex;flex-shrink:0;height:100%;width:300px}.sidebar-region.is-mobile{background-color:#1e1e1e;bottom:0;box-shadow:2px 0 8px rgba(0,0,0,.3);left:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.inspector-region,.stage-region{bottom:0;display:flex;flex-direction:column;height:calc(100vh - 56px);left:0;overflow:hidden;position:fixed;right:0;top:56px;width:100vw}@media(min-width:782px){.inspector-region,.stage-region{bottom:auto;height:auto;left:auto;position:static;right:auto;top:auto;width:auto}}.stage-region{z-index:2}@media(min-width:782px){.stage-region{flex:1 1 auto;min-width:0;z-index:auto}}.inspector-region{z-index:3}@media(min-width:782px){.inspector-region{flex:0 0 var(--sw-inspector-width,380px);z-index:auto}}.components-snackbar-list{bottom:20px;left:20px;position:fixed;z-index:100000}@media(max-width:782px){.components-snackbar-list{bottom:10px;left:10px;right:10px}}
:root{--sw-sidebar-width:300px;--sw-inspector-width:50%}.activitypub-app-layout{bottom:0;left:0;position:fixed;right:0;top:0}#wpfooter{display:none}

View File

@ -1 +0,0 @@
<?php return array('dependencies' => array(), 'version' => '574f62b8c694f733dfd4');

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
<?php return array('dependencies' => array(), 'version' => '753d276871f3f5b80028');

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '018706e2c6de03ab04d1');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'ce9100d5903e06fbd90c');

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => 'a87121d13575d9f2d232');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '274eb3cd8d33a8c91dd5');

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "activitypub/extra-fields",
"apiVersion": 3,
"version": "8.3.0",
"version": "9.1.0",
"title": "Fediverse Extra Fields",
"category": "widgets",
"description": "Display extra fields from Fediverse user profiles.",

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-i18n'), 'version' => 'c22c615ef19e14341c00');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-i18n'), 'version' => '0f6193ad9d1a0f8e03bb');

View File

@ -1,2 +1,2 @@
(()=>{"use strict";var e,t={6755(e,t,i){const r=window.wp.blocks,s=window.wp.i18n,n=window.wp.blockEditor,l=window.wp.components,a=window.wp.dom,o=window.wp.data,c=window.wp.element,d=window.wp.apiFetch;var u=i.n(d);function p(){return window._activityPubOptions||{}}const h=window.ReactJSXRuntime,b=JSON.parse('{"UU":"activitypub/extra-fields"}');(0,r.registerBlockType)(b.UU,{edit:function({attributes:e,setAttributes:t,context:i}){const{selectedUser:r,maxFields:d}=e,{postId:b,postType:v}=i??{},[y,f]=(0,c.useState)([]),[x,g]=(0,c.useState)(!1),[w,m]=(0,c.useState)(null),_=(0,o.useSelect)(e=>{if(b&&v){const t=e("core");if(t){const e=t.getEditedEntityRecord?.("postType",v,b)??null;if(e?.author)return e.author;const i=t.getEntityRecord?.("postType",v,b)??null;if(i?.author)return i.author}}const t=e("core/editor");return t&&t.getCurrentPostAttribute?t.getCurrentPostAttribute("author"):null},[b,v]),j="blog"===r?0:"inherit"===r?_||null:r,{namespace:k="activitypub/1.0",profileUrls:U={}}=p(),F="blog"===r?U.blog:U.user,C=(0,n.useBlockProps)({className:"activitypub-extra-fields-block-wrapper"}),O=function({withInherit:e=!1}){const{enabled:t,namespace:i}=p(),[r,n]=(0,c.useState)(!1),{fetchedUsers:l,isLoadingUsers:a}=(0,o.useSelect)(e=>{const{getUsers:i,getIsResolving:r}=e("core");return{fetchedUsers:t?.users?i({capabilities:"activitypub"}):null,isLoadingUsers:!!t?.users&&r("getUsers",[{capabilities:"activitypub"}])}},[t?.users]),d=(0,o.useSelect)(e=>l||a?null:e("core").getCurrentUser(),[l,a]);(0,c.useEffect)(()=>{!l&&!a&&d&&i&&u()({path:`/${i}/actors/${d.id}`,method:"HEAD",headers:{Accept:"application/activity+json"},parse:!1}).then(()=>n(!0)).catch(()=>n(!1))},[l,a,d,i]);const h=(0,c.useMemo)(()=>l||(d&&r?[{id:d.id,name:d.name}]:[]),[l,d,r]);return(0,c.useMemo)(()=>{if(!h.length)return[];const i=[];return t?.blog&&l&&i.push({label:(0,s.__)("Blog","activitypub"),value:"blog"}),e&&t?.users&&l&&i.push({label:(0,s.__)("Dynamic User","activitypub"),value:"inherit"}),h.reduce((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e),i)},[h,t?.blog,t?.users,l,e])}({withInherit:!0});(0,c.useEffect)(()=>{null!==j?(g(!0),m(null),u()({path:`/${k}/actors/${j}`,headers:{Accept:"application/activity+json"}}).then(e=>{const t=(e.attachment||[]).filter(e=>"PropertyValue"===e.type);f(t),g(!1)}).catch(e=>{m(e.message),g(!1)})):f([])},[j,k]);const E=d>0?y.slice(0,d):y,S=(()=>{const t=e.className?.includes("is-style-cards");if(!t)return{};const i=e.style||{},r=e.backgroundColor,s=i.color?.background;return r?{backgroundColor:`var(--wp--preset--color--${r})`}:s?{backgroundColor:s}:{}})(),P=(0,h.jsx)(n.InspectorControls,{children:(0,h.jsxs)(l.PanelBody,{title:(0,s.__)("Settings","activitypub"),initialOpen:!0,children:[(0,h.jsx)(l.SelectControl,{label:(0,s.__)("User","activitypub"),value:r,options:O,onChange:e=>t({selectedUser:e})}),(0,h.jsx)(l.RangeControl,{label:(0,s.__)("Maximum Fields","activitypub"),value:d,onChange:e=>t({maxFields:e}),min:0,max:20,help:(0,s.__)("Limit the number of fields displayed. 0 = show all.","activitypub")})]})});return"inherit"!==r||_?x?(0,h.jsx)("div",{...C,children:(0,h.jsx)(l.Placeholder,{label:(0,s.__)("Fediverse Extra Fields","activitypub"),children:(0,h.jsx)(l.Spinner,{})})}):w?(0,h.jsx)("div",{...C,children:(0,h.jsx)(l.Placeholder,{label:(0,s.__)("Fediverse Extra Fields","activitypub"),children:(0,h.jsx)("p",{children:(0,s.sprintf)(/* translators: %s: Error message */ /* translators: %s: Error message */
(0,s.__)("Error loading extra fields: %s","activitypub"),w)})})}):0===E.length?(0,h.jsxs)(h.Fragment,{children:[P,(0,h.jsx)("div",{...C,children:(0,h.jsx)(l.Placeholder,{label:(0,s.__)("Fediverse Extra Fields","activitypub"),children:(0,h.jsxs)("p",{children:[(0,s.__)("No extra fields found.","activitypub")," ",F&&(0,h.jsx)(l.Button,{variant:"link",onClick:()=>{window.location.href=F},children:(0,s.__)("Add fields in your profile settings","activitypub")})]})})})]}):(0,h.jsxs)(h.Fragment,{children:[P,(0,h.jsx)("div",{...C,children:(0,h.jsx)("dl",{className:"activitypub-extra-fields",children:E.map(e=>(0,h.jsxs)("div",{className:"activitypub-extra-field",style:S,children:[(0,h.jsx)("dt",{children:e.name}),(0,h.jsx)("dd",{dangerouslySetInnerHTML:{__html:(0,a.safeHTML)(e.value)}})]},`${e.name}-${e.value}`))})})]}):(0,h.jsxs)(h.Fragment,{children:[P,(0,h.jsx)("div",{...C,children:(0,h.jsx)(l.Placeholder,{label:(0,s.__)("Fediverse Extra Fields","activitypub"),children:(0,h.jsx)("p",{children:(0,s.__)("This block will display extra fields based on the post author when published.","activitypub")})})})]})},save:()=>null})}},i={};function r(e){var s=i[e];if(void 0!==s)return s.exports;var n=i[e]={exports:{}};return t[e](n,n.exports,r),n.exports}r.m=t,e=[],r.O=(t,i,s,n)=>{if(!i){var l=1/0;for(d=0;d<e.length;d++){for(var[i,s,n]=e[d],a=!0,o=0;o<i.length;o++)(!1&n||l>=n)&&Object.keys(r.O).every(e=>r.O[e](i[o]))?i.splice(o--,1):(a=!1,n<l&&(l=n));if(a){e.splice(d--,1);var c=s();void 0!==c&&(t=c)}}return t}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[i,s,n]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={914:0,678:0};r.O.j=t=>0===e[t];var t=(t,i)=>{var s,n,[l,a,o]=i,c=0;if(l.some(t=>0!==e[t])){for(s in a)r.o(a,s)&&(r.m[s]=a[s]);if(o)var d=o(r)}for(t&&t(i);c<l.length;c++)n=l[c],r.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return r.O(d)},i=globalThis.webpackChunkwordpress_activitypub=globalThis.webpackChunkwordpress_activitypub||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var s=r.O(void 0,[678],()=>r(6755));s=r.O(s)})();
(()=>{"use strict";var e={755(e,t,i){const r=window.wp.blocks,s=window.wp.i18n,n=window.wp.blockEditor,l=window.wp.components,a=window.wp.dom,o=window.wp.data,c=window.wp.element,d=window.wp.apiFetch;var u=i.n(d);function p(){return window._activityPubOptions||{}}const h=window.ReactJSXRuntime,b=JSON.parse('{"UU":"activitypub/extra-fields"}');(0,r.registerBlockType)(b.UU,{edit:function({attributes:e,setAttributes:t,context:i}){const{selectedUser:r,maxFields:d}=e,{postId:b,postType:v}=i??{},[f,y]=(0,c.useState)([]),[x,g]=(0,c.useState)(!1),[m,w]=(0,c.useState)(null),_=(0,o.useSelect)(e=>{if(b&&v){const t=e("core");if(t){const e=t.getEditedEntityRecord?.("postType",v,b)??null;if(e?.author)return e.author;const i=t.getEntityRecord?.("postType",v,b)??null;if(i?.author)return i.author}}const t=e("core/editor");return t&&t.getCurrentPostAttribute?t.getCurrentPostAttribute("author"):null},[b,v]),j="blog"===r?0:"inherit"===r?_||null:r,{namespace:O="activitypub/1.0",profileUrls:U={}}=p(),k="blog"===r?U.blog:U.user,F=(0,n.useBlockProps)({className:"activitypub-extra-fields-block-wrapper"}),C=function({withInherit:e=!1}){const{enabled:t,namespace:i}=p(),[r,n]=(0,c.useState)(!1),{fetchedUsers:l,isLoadingUsers:a}=(0,o.useSelect)(e=>{const{getUsers:i,getIsResolving:r}=e("core");return{fetchedUsers:t?.users?i({capabilities:"activitypub"}):null,isLoadingUsers:!!t?.users&&r("getUsers",[{capabilities:"activitypub"}])}},[t?.users]),d=(0,o.useSelect)(e=>l||a?null:e("core").getCurrentUser(),[l,a]);(0,c.useEffect)(()=>{!l&&!a&&d&&i&&u()({path:`/${i}/actors/${d.id}`,method:"HEAD",headers:{Accept:"application/activity+json"},parse:!1}).then(()=>n(!0)).catch(()=>n(!1))},[l,a,d,i]);const h=(0,c.useMemo)(()=>l||(d&&r?[{id:d.id,name:d.name}]:[]),[l,d,r]);return(0,c.useMemo)(()=>{if(!h.length)return[];const i=[];return t?.blog&&l&&i.push({label:(0,s.__)("Blog","activitypub"),value:"blog"}),e&&t?.users&&l&&i.push({label:(0,s.__)("Dynamic User","activitypub"),value:"inherit"}),h.reduce((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e),i)},[h,t?.blog,t?.users,l,e])}({withInherit:!0});(0,c.useEffect)(()=>{null!==j?(g(!0),w(null),u()({path:`/${O}/actors/${j}`,headers:{Accept:"application/activity+json"}}).then(e=>{const t=(e.attachment||[]).filter(e=>"PropertyValue"===e.type);y(t),g(!1)}).catch(e=>{w(e.message),g(!1)})):y([])},[j,O]);const E=d>0?f.slice(0,d):f,P=(()=>{const t=e.className?.includes("is-style-cards");if(!t)return{};const i=e.style||{},r=e.backgroundColor,s=i.color?.background;return r?{backgroundColor:`var(--wp--preset--color--${r})`}:s?{backgroundColor:s}:{}})(),S=(0,h.jsx)(n.InspectorControls,{children:(0,h.jsxs)(l.PanelBody,{title:(0,s.__)("Settings","activitypub"),initialOpen:!0,children:[(0,h.jsx)(l.SelectControl,{label:(0,s.__)("User","activitypub"),value:r,options:C,onChange:e=>t({selectedUser:e})}),(0,h.jsx)(l.RangeControl,{label:(0,s.__)("Maximum Fields","activitypub"),value:d,onChange:e=>t({maxFields:e}),min:0,max:20,help:(0,s.__)("Limit the number of fields displayed. 0 = show all.","activitypub")})]})});return"inherit"!==r||_?x?(0,h.jsx)("div",{...F,children:(0,h.jsx)(l.Placeholder,{label:(0,s.__)("Fediverse Extra Fields","activitypub"),children:(0,h.jsx)(l.Spinner,{})})}):m?(0,h.jsx)("div",{...F,children:(0,h.jsx)(l.Placeholder,{label:(0,s.__)("Fediverse Extra Fields","activitypub"),children:(0,h.jsx)("p",{children:(0,s.sprintf)(/* translators: %s: Error message */ /* translators: %s: Error message */
(0,s.__)("Error loading extra fields: %s","activitypub"),m)})})}):0===E.length?(0,h.jsxs)(h.Fragment,{children:[S,(0,h.jsx)("div",{...F,children:(0,h.jsx)(l.Placeholder,{label:(0,s.__)("Fediverse Extra Fields","activitypub"),children:(0,h.jsxs)("p",{children:[(0,s.__)("No extra fields found.","activitypub")," ",k&&(0,h.jsx)(l.Button,{variant:"link",onClick:()=>{window.location.href=k},children:(0,s.__)("Add fields in your profile settings","activitypub")})]})})})]}):(0,h.jsxs)(h.Fragment,{children:[S,(0,h.jsx)("div",{...F,children:(0,h.jsx)("dl",{className:"activitypub-extra-fields",children:E.map(e=>(0,h.jsxs)("div",{className:"activitypub-extra-field",style:P,children:[(0,h.jsx)("dt",{children:e.name}),(0,h.jsx)("dd",{dangerouslySetInnerHTML:{__html:(0,a.safeHTML)(e.value)}})]},`${e.name}-${e.value}`))})})]}):(0,h.jsxs)(h.Fragment,{children:[S,(0,h.jsx)("div",{...F,children:(0,h.jsx)(l.Placeholder,{label:(0,s.__)("Fediverse Extra Fields","activitypub"),children:(0,h.jsx)("p",{children:(0,s.__)("This block will display extra fields based on the post author when published.","activitypub")})})})]})},save:()=>null})}};const t={};function i(r){const s=t[r];if(void 0!==s)return s.exports;const n=t[r]={exports:{}};return e[r](n,n.exports,i),n.exports}i.m=e,(()=>{const e=[];i.O=(t,r,s,n)=>{if(r){n=n||0;for(var l=e.length;l>0&&e[l-1][2]>n;l--)e[l]=e[l-1];return void(e[l]=[r,s,n])}let a=1/0;for(l=0;l<e.length;l++){let[r,s,n]=e[l],c=!0;for(var o=0;o<r.length;o++)(!1&n||a>=n)&&Object.keys(i.O).every(e=>i.O[e](r[o]))?r.splice(o--,1):(c=!1,n<a&&(a=n));if(c){e.splice(l--,1);const i=s();void 0!==i&&(t=i)}}return t}})(),i.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var s=t[r++],n=t[r++];i.o(e,s)?0===n&&r++:0===n?Object.defineProperty(e,s,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,s,{enumerable:!0,get:n})}else for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.hasOwn(e,t),(()=>{const e={914:0,678:0};i.O.j=t=>0===e[t];const t=(t,r)=>{let[s,n,l]=r;var a,o,c=0;if(s.some(t=>0!==e[t])){for(a in n)i.o(n,a)&&(i.m[a]=n[a]);if(l)var d=l(i)}for(t&&t(r);c<s.length;c++)o=s[c],i.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return i.O(d)},r=globalThis.webpackChunkwordpress_activitypub||=[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();let r=i.O(void 0,[678],()=>i(755));r=i.O(r)})();

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "activitypub/follow-me",
"apiVersion": 3,
"version": "8.3.0",
"version": "9.1.0",
"title": "Follow me on the Fediverse",
"category": "widgets",
"description": "Display your Fediverse profile so that visitors can follow you.",

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'a7a6cb736043a8fe087f');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'd9b2734e3ace0db0581c');

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "activitypub/followers",
"apiVersion": 3,
"version": "8.3.0",
"version": "9.1.0",
"title": "Fediverse Followers",
"category": "widgets",
"description": "Display your followers from the Fediverse on your website.",

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'da88cfc334f994481a92');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '176eb7cf33243aa43546');

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "activitypub/following",
"apiVersion": 3,
"version": "8.3.0",
"version": "9.1.0",
"title": "Fediverse Following",
"category": "widgets",
"description": "Display the accounts you follow in the Fediverse on your website.",

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '579447d958b5f1081d10');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '1930abe82fb42731ebb4');

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "activitypub/posts-and-replies",
"apiVersion": 3,
"version": "unreleased",
"version": "9.1.0",
"title": "Posts and Replies",
"category": "widgets",
"description": "Display a tab bar to filter between posts only and posts with replies on author archives.",

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'c8dfeeece9537c9d6183');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '1547e16f5dd8e2ae2d88');

View File

@ -1 +1 @@
(()=>{"use strict";var e,t={5879(){const e=window.wp.blocks,t=window.wp.blockEditor,i=window.wp.components,s=window.wp.i18n,r=window.ReactJSXRuntime,o=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/posts-and-replies","apiVersion":3,"version":"unreleased","title":"Posts and Replies","category":"widgets","description":"Display a tab bar to filter between posts only and posts with replies on author archives.","textdomain":"activitypub","icon":"admin-post","keywords":["fediverse","activitypub","posts","replies","tabs"],"supports":{"html":false},"editorScript":"file:./index.js","style":["file:./style-index.css"],"render":"file:./render.php"}');(0,e.registerBlockType)(o,{edit:function(){const e=(0,t.useBlockProps)();return(0,r.jsx)("div",{...e,children:(0,r.jsx)(i.Placeholder,{icon:"admin-post",label:(0,s.__)("Posts and Replies","activitypub"),instructions:(0,s.__)('Displays a tab bar to filter between "Posts" (excluding replies) and "Posts & Replies" on author archives. Place above a Query Loop block with "Inherit query from template" enabled.',"activitypub")})})},save:()=>null})}},i={};function s(e){var r=i[e];if(void 0!==r)return r.exports;var o=i[e]={exports:{}};return t[e](o,o.exports,s),o.exports}s.m=t,e=[],s.O=(t,i,r,o)=>{if(!i){var n=1/0;for(c=0;c<e.length;c++){for(var[i,r,o]=e[c],a=!0,p=0;p<i.length;p++)(!1&o||n>=o)&&Object.keys(s.O).every(e=>s.O[e](i[p]))?i.splice(p--,1):(a=!1,o<n&&(n=o));if(a){e.splice(c--,1);var l=r();void 0!==l&&(t=l)}}return t}o=o||0;for(var c=e.length;c>0&&e[c-1][2]>o;c--)e[c]=e[c-1];e[c]=[i,r,o]},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={642:0,6:0};s.O.j=t=>0===e[t];var t=(t,i)=>{var r,o,[n,a,p]=i,l=0;if(n.some(t=>0!==e[t])){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);if(p)var c=p(s)}for(t&&t(i);l<n.length;l++)o=n[l],s.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return s.O(c)},i=globalThis.webpackChunkwordpress_activitypub=globalThis.webpackChunkwordpress_activitypub||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var r=s.O(void 0,[6],()=>s(5879));r=s.O(r)})();
(()=>{"use strict";var e={879(){const e=window.wp.blocks,t=window.wp.blockEditor,s=window.wp.components,i=window.wp.i18n,o=window.ReactJSXRuntime,n=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/posts-and-replies","apiVersion":3,"version":"9.0.1","title":"Posts and Replies","category":"widgets","description":"Display a tab bar to filter between posts only and posts with replies on author archives.","textdomain":"activitypub","icon":"admin-post","keywords":["fediverse","activitypub","posts","replies","tabs"],"supports":{"html":false},"editorScript":"file:./index.js","style":["file:./style-index.css"],"render":"file:./render.php"}');(0,e.registerBlockType)(n,{edit:function(){const e=(0,t.useBlockProps)();return(0,o.jsx)("div",{...e,children:(0,o.jsx)(s.Placeholder,{icon:"admin-post",label:(0,i.__)("Posts and Replies","activitypub"),instructions:(0,i.__)('Displays a tab bar to filter between "Posts" (excluding replies) and "Posts & Replies" on author archives. Place above a Query Loop block with "Inherit query from template" enabled.',"activitypub")})})},save:()=>null})}};const t={};function s(i){const o=t[i];if(void 0!==o)return o.exports;const n=t[i]={exports:{}};return e[i](n,n.exports,s),n.exports}s.m=e,(()=>{const e=[];s.O=(t,i,o,n)=>{if(i){n=n||0;for(var r=e.length;r>0&&e[r-1][2]>n;r--)e[r]=e[r-1];return void(e[r]=[i,o,n])}let l=1/0;for(r=0;r<e.length;r++){let[i,o,n]=e[r],p=!0;for(var a=0;a<i.length;a++)(!1&n||l>=n)&&Object.keys(s.O).every(e=>s.O[e](i[a]))?i.splice(a--,1):(p=!1,n<l&&(l=n));if(p){e.splice(r--,1);const s=o();void 0!==s&&(t=s)}}return t}})(),s.o=(e,t)=>Object.hasOwn(e,t),(()=>{const e={642:0,6:0};s.O.j=t=>0===e[t];const t=(t,i)=>{let[o,n,r]=i;var l,a,p=0;if(o.some(t=>0!==e[t])){for(l in n)s.o(n,l)&&(s.m[l]=n[l]);if(r)var c=r(s)}for(t&&t(i);p<o.length;p++)a=o[p],s.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return s.O(c)},i=globalThis.webpackChunkwordpress_activitypub||=[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();let i=s.O(void 0,[6],()=>s(879));i=s.O(i)})();

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "activitypub/reactions",
"apiVersion": 3,
"version": "8.3.0",
"version": "9.1.0",
"title": "Fediverse Reactions",
"category": "widgets",
"icon": "heart",

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '1e13568c338d5be171c1');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '6306c831521d83d3a536');

View File

@ -1,4 +1,4 @@
(()=>{"use strict";var e,t={2091(e,t,s){const i=window.wp.blocks,r=window.wp.blockEditor,a=window.ReactJSXRuntime,n=[{attributes:{},supports:{html:!1,align:!0,layout:{default:{type:"constrained",orientation:"vertical",justifyContent:"center"}}},save:()=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.InnerBlocks.Content,{}),(0,a.jsx)("div",{className:"activitypub-reactions-block"})]})},{attributes:{title:{type:"string",default:"Fediverse reactions"}},supports:{html:!1,align:!0,layout:{default:{type:"constrained",orientation:"vertical",justifyContent:"center"}}},save:()=>null,isEligible:({title:e})=>!!e,migrate:({title:e,...t})=>[t,[(0,i.createBlock)("core/heading",{content:e,level:6})]]}];function o(e){var t,s,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(s=o(e[t]))&&(i&&(i+=" "),i+=s)}else for(s in e)e[s]&&(i&&(i+=" "),i+=s);return i}const l=function(){for(var e,t,s=0,i="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=o(e))&&(i&&(i+=" "),i+=t);return i},c=window.wp.components,p=window.wp.i18n,u=window.wp.data,d=window.wp.element,f=window.wp.apiFetch;var v=s.n(f);function y(){return window._activityPubOptions||{}}const m={like:(0,p.__)("Like","activitypub"),likes:(0,p.__)("Like","activitypub"),repost:(0,p.__)("Repost","activitypub"),reposts:(0,p.__)("Repost","activitypub"),quote:(0,p.__)("Quote","activitypub"),quotes:(0,p.__)("Quote","activitypub")},h=({reactions:e,displayStyle:t})=>{const{defaultAvatarUrl:s}=y();return"compact"===t?null:(0,a.jsx)("ul",{className:"reaction-avatars",children:e.map((e,t)=>{const i=["reaction-avatar"].filter(Boolean).join(" "),r=e.avatar||s;return(0,a.jsx)("li",{children:(0,a.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:(0,a.jsx)("img",{src:r,alt:e.name,className:i,width:"32",height:"32",onError:e=>{e.target.src=s}})})},t)})})},b=({reactions:e,displayStyle:t})=>{const{defaultAvatarUrl:s}=y();return(0,a.jsx)("ul",{className:"reactions-list",children:e.map((e,i)=>{const r=e.avatar||s;return(0,a.jsx)("li",{className:"reaction-item",children:(0,a.jsxs)("a",{href:e.url,className:"reaction-item",target:"_blank",rel:"noopener noreferrer",children:["facepile"===t&&(0,a.jsx)("img",{src:r,alt:e.name,width:"32",height:"32",onError:e=>{e.target.src=s}}),(0,a.jsx)("span",{className:"reaction-name",children:e.name})]})},i)})})},w=({items:e,label:t,displayStyle:s,showActions:i,actionLabel:r})=>{const[n,o]=(0,d.useState)(!1),[l,p]=(0,d.useState)(null),u=(0,d.useRef)(null),f=e.slice(0,20);return(0,a.jsxs)("div",{className:"reaction-group",ref:u,children:[i&&r&&(0,a.jsx)("button",{className:"reaction-action-button wp-element-button",type:"button",disabled:!0,children:r}),(0,a.jsx)(h,{reactions:f,displayStyle:s}),(0,a.jsx)(c.Button,{ref:p,className:"reaction-label is-link",onClick:()=>o(!n),"aria-expanded":n,children:t}),n&&l&&(0,a.jsx)(c.Popover,{anchor:l,onClose:()=>o(!1),className:"activitypub-popover",children:(0,a.jsx)(b,{reactions:e,displayStyle:s})})]})};function g({postId:e=null,reactions:t=null,fallbackReactions:s=null,displayStyle:i="facepile",showActions:r=!1}){const{namespace:n}=y(),[o,l]=(0,d.useState)(t),[c,p]=(0,d.useState)(!t),u=(0,d.useCallback)(()=>{s&&l(s),p(!1)},[s]);return(0,d.useEffect)(()=>{if(t)return l(t),void p(!1);e&&"number"==typeof e?(p(!0),v()({path:`/${n}/posts/${e}/reactions`}).then(e=>{const t=Object.values(e).some(e=>e.items?.length>0);l(!t&&s?s:e),p(!1)}).catch(u)):u()},[e,t,s,n,u]),c?null:o&&Object.values(o).some(e=>e.items?.length>0)?(0,a.jsx)("div",{className:"activitypub-reactions",children:Object.entries(o).map(([e,t])=>t.items?.length?(0,a.jsx)(w,{items:t.items,label:t.label,displayStyle:i,showActions:r,actionLabel:m[e]},e):null)}):null}const x=(e,t,s,i)=>Array.from({length:e},(e,r)=>({name:`${t} ${r+1}`,url:"#",avatar:`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='32' r='32' fill='%23${i[r%i.length]}'/%3E%3Ctext x='32' y='38' font-family='sans-serif' font-size='24' fill='white' text-anchor='middle'%3E${String.fromCharCode(s+r)}%3C/text%3E%3C/svg%3E`})),j=["FF6B6B","4ECDC4","45B7D1","96CEB4","D4A5A5","9B59B6","3498DB","E67E22"],k={likes:{label:(0,p.sprintf)(/* translators: %d: Number of likes */ /* translators: %d: Number of likes */
(0,p._x)("%d likes","number of likes","activitypub"),9),items:x(9,"User",65,j)},reposts:{label:(0,p.sprintf)(/* translators: %d: Number of reposts */ /* translators: %d: Number of reposts */
(0,p._x)("%d reposts","number of reposts","activitypub"),6),items:x(6,"Reposter",82,j)},quotes:{label:(0,p.sprintf)(/* translators: %d: Number of quotes */ /* translators: %d: Number of quotes */
(0,p._x)("%d quotes","number of quotes","activitypub"),7),items:x(7,"Quoter",81,j)}},_=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/reactions","apiVersion":3,"version":"8.2.1","title":"Fediverse Reactions","category":"widgets","icon":"heart","keywords":["fediverse","activitypub","likes","reposts"],"description":"Display Fediverse likes and reposts for your posts.","example":{"attributes":{"className":"is-style-facepile"}},"styles":[{"name":"facepile","label":"Facepile","isDefault":true},{"name":"compact","label":"Compact"}],"attributes":{"displayStyle":{"type":"string","default":"facepile"},"showActions":{"type":"boolean","default":false}},"supports":{"align":["wide","full"],"color":{"gradients":true},"__experimentalBorder":{"radius":true,"width":true,"color":true,"style":true},"html":false,"interactivity":true,"shadow":true,"typography":{"fontSize":true,"__experimentalDefaultControls":{"fontSize":true}}},"blockHooks":{"core/post-content":"after"},"textdomain":"activitypub","editorScript":"file:./index.js","style":"file:./style-index.css","viewStyle":"file:./view.css","viewScriptModule":"file:./view.js","viewScript":"wp-api-fetch","render":"file:./render.php"}');(0,i.registerBlockType)(_,{deprecated:n,edit:function({attributes:e,setAttributes:t}){const{className:s="",displayStyle:i="facepile",showActions:n=!1}=e,o=(0,r.useBlockProps)(),{getCurrentPostId:f}=(0,u.select)("core/editor"),{showAvatars:v=!0}=y(),m=(0,d.useRef)(!1);(0,d.useEffect)(()=>{if(m.current)return;m.current=!0;const e=s?.includes("is-style-");if(!e){const e=v?"facepile":"compact";t({className:l(s,`is-style-${e}`),displayStyle:e})}},[s,v,t]);const h=s?.includes("is-style-compact")?"compact":"facepile";(0,d.useEffect)(()=>{h!==i&&t({displayStyle:h})},[h,i,t]);const b=[["core/heading",{level:6,placeholder:(0,p.__)("Fediverse Reactions","activitypub"),content:(0,p.__)("Fediverse Reactions","activitypub")}]];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.InspectorControls,{children:(0,a.jsx)(c.PanelBody,{title:(0,p.__)("Action Buttons","activitypub"),children:(0,a.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,p.__)("Show action buttons","activitypub"),help:(0,p.__)("Display Like and Boost buttons so visitors can interact from their Fediverse server.","activitypub"),checked:n,onChange:e=>t({showActions:e})})})}),(0,a.jsxs)("div",{...o,children:[(0,a.jsx)(r.InnerBlocks,{template:b,allowedBlocks:["core/heading"],templateLock:"all",renderAppender:!1}),(0,a.jsx)(g,{postId:f(),fallbackReactions:k,displayStyle:i,showActions:n})]})]})},save:function(){return(0,a.jsx)("div",{...r.useBlockProps.save(),children:(0,a.jsx)(r.InnerBlocks.Content,{})})}})}},s={};function i(e){var r=s[e];if(void 0!==r)return r.exports;var a=s[e]={exports:{}};return t[e](a,a.exports,i),a.exports}i.m=t,e=[],i.O=(t,s,r,a)=>{if(!s){var n=1/0;for(p=0;p<e.length;p++){for(var[s,r,a]=e[p],o=!0,l=0;l<s.length;l++)(!1&a||n>=a)&&Object.keys(i.O).every(e=>i.O[e](s[l]))?s.splice(l--,1):(o=!1,a<n&&(n=a));if(o){e.splice(p--,1);var c=r();void 0!==c&&(t=c)}}return t}a=a||0;for(var p=e.length;p>0&&e[p-1][2]>a;p--)e[p]=e[p-1];e[p]=[s,r,a]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={608:0,104:0};i.O.j=t=>0===e[t];var t=(t,s)=>{var r,a,[n,o,l]=s,c=0;if(n.some(t=>0!==e[t])){for(r in o)i.o(o,r)&&(i.m[r]=o[r]);if(l)var p=l(i)}for(t&&t(s);c<n.length;c++)a=n[c],i.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return i.O(p)},s=globalThis.webpackChunkwordpress_activitypub=globalThis.webpackChunkwordpress_activitypub||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})();var r=i.O(void 0,[104],()=>i(2091));r=i.O(r)})();
(()=>{"use strict";var e={91(e,t,s){const i=window.wp.blocks,r=window.wp.blockEditor,n=window.ReactJSXRuntime,a=[{attributes:{},supports:{html:!1,align:!0,layout:{default:{type:"constrained",orientation:"vertical",justifyContent:"center"}}},save:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.InnerBlocks.Content,{}),(0,n.jsx)("div",{className:"activitypub-reactions-block"})]})},{attributes:{title:{type:"string",default:"Fediverse reactions"}},supports:{html:!1,align:!0,layout:{default:{type:"constrained",orientation:"vertical",justifyContent:"center"}}},save:()=>null,isEligible:({title:e})=>!!e,migrate:({title:e,...t})=>[t,[(0,i.createBlock)("core/heading",{content:e,level:6})]]}];function o(e){var t,s,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(s=o(e[t]))&&(i&&(i+=" "),i+=s)}else for(s in e)e[s]&&(i&&(i+=" "),i+=s);return i}const l=function(){for(var e,t,s=0,i="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=o(e))&&(i&&(i+=" "),i+=t);return i},c=window.wp.components,u=window.wp.i18n,p=window.wp.data,d=window.wp.element,f=window.wp.apiFetch;var y=s.n(f);function v(){return window._activityPubOptions||{}}const m={like:(0,u.__)("Like","activitypub"),likes:(0,u.__)("Like","activitypub"),repost:(0,u.__)("Repost","activitypub"),reposts:(0,u.__)("Repost","activitypub"),quote:(0,u.__)("Quote","activitypub"),quotes:(0,u.__)("Quote","activitypub")},h=({reactions:e,displayStyle:t})=>{const{defaultAvatarUrl:s}=v();return"compact"===t?null:(0,n.jsx)("ul",{className:"reaction-avatars",children:e.map((e,t)=>{const i=["reaction-avatar"].filter(Boolean).join(" "),r=e.avatar||s;return(0,n.jsx)("li",{children:(0,n.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:(0,n.jsx)("img",{src:r,alt:e.name,className:i,width:"32",height:"32",onError:e=>{e.target.src=s}})})},t)})})},b=({reactions:e,displayStyle:t})=>{const{defaultAvatarUrl:s}=v();return(0,n.jsx)("ul",{className:"reactions-list",children:e.map((e,i)=>{const r=e.avatar||s;return(0,n.jsx)("li",{className:"reaction-item",children:(0,n.jsxs)("a",{href:e.url,className:"reaction-item",target:"_blank",rel:"noopener noreferrer",children:["facepile"===t&&(0,n.jsx)("img",{src:r,alt:e.name,width:"32",height:"32",onError:e=>{e.target.src=s}}),(0,n.jsx)("span",{className:"reaction-name",children:e.name})]})},i)})})},w=({items:e,label:t,displayStyle:s,showActions:i,actionLabel:r})=>{const[a,o]=(0,d.useState)(!1),[l,u]=(0,d.useState)(null),p=(0,d.useRef)(null),f=e.slice(0,20);return(0,n.jsxs)("div",{className:"reaction-group",ref:p,children:[i&&r&&(0,n.jsx)("button",{className:"reaction-action-button wp-element-button",type:"button",disabled:!0,children:r}),(0,n.jsx)(h,{reactions:f,displayStyle:s}),(0,n.jsx)(c.Button,{ref:u,className:"reaction-label is-link",onClick:()=>o(!a),"aria-expanded":a,children:t}),a&&l&&(0,n.jsx)(c.Popover,{anchor:l,onClose:()=>o(!1),className:"activitypub-popover",children:(0,n.jsx)(b,{reactions:e,displayStyle:s})})]})};function g({postId:e=null,reactions:t=null,fallbackReactions:s=null,displayStyle:i="facepile",showActions:r=!1}){const{namespace:a}=v(),[o,l]=(0,d.useState)(t),[c,u]=(0,d.useState)(!t),p=(0,d.useCallback)(()=>{s&&l(s),u(!1)},[s]);return(0,d.useEffect)(()=>{if(t)return l(t),void u(!1);e&&"number"==typeof e?(u(!0),y()({path:`/${a}/posts/${e}/reactions`}).then(e=>{const t=Object.values(e).some(e=>e.items?.length>0);l(!t&&s?s:e),u(!1)}).catch(p)):p()},[e,t,s,a,p]),c?null:o&&Object.values(o).some(e=>e.items?.length>0)?(0,n.jsx)("div",{className:"activitypub-reactions",children:Object.entries(o).map(([e,t])=>t.items?.length?(0,n.jsx)(w,{items:t.items,label:t.label,displayStyle:i,showActions:r,actionLabel:m[e]},e):null)}):null}const x=(e,t,s,i)=>Array.from({length:e},(e,r)=>({name:`${t} ${r+1}`,url:"#",avatar:`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='32' r='32' fill='%23${i[r%i.length]}'/%3E%3Ctext x='32' y='38' font-family='sans-serif' font-size='24' fill='white' text-anchor='middle'%3E${String.fromCharCode(s+r)}%3C/text%3E%3C/svg%3E`})),j=["FF6B6B","4ECDC4","45B7D1","96CEB4","D4A5A5","9B59B6","3498DB","E67E22"],k={likes:{label:(0,u.sprintf)(/* translators: %d: Number of likes */ /* translators: %d: Number of likes */
(0,u._x)("%d likes","number of likes","activitypub"),9),items:x(9,"User",65,j)},reposts:{label:(0,u.sprintf)(/* translators: %d: Number of reposts */ /* translators: %d: Number of reposts */
(0,u._x)("%d reposts","number of reposts","activitypub"),6),items:x(6,"Reposter",82,j)},quotes:{label:(0,u.sprintf)(/* translators: %d: Number of quotes */ /* translators: %d: Number of quotes */
(0,u._x)("%d quotes","number of quotes","activitypub"),7),items:x(7,"Quoter",81,j)}},_=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/reactions","apiVersion":3,"version":"9.0.1","title":"Fediverse Reactions","category":"widgets","icon":"heart","keywords":["fediverse","activitypub","likes","reposts"],"description":"Display Fediverse likes and reposts for your posts.","example":{"attributes":{"className":"is-style-facepile"}},"styles":[{"name":"facepile","label":"Facepile","isDefault":true},{"name":"compact","label":"Compact"}],"attributes":{"displayStyle":{"type":"string","default":"facepile"},"showActions":{"type":"boolean","default":false}},"supports":{"align":["wide","full"],"color":{"gradients":true},"__experimentalBorder":{"radius":true,"width":true,"color":true,"style":true},"html":false,"interactivity":true,"shadow":true,"typography":{"fontSize":true,"__experimentalDefaultControls":{"fontSize":true}}},"blockHooks":{"core/post-content":"after"},"textdomain":"activitypub","editorScript":"file:./index.js","style":"file:./style-index.css","viewStyle":"file:./view.css","viewScriptModule":"file:./view.js","viewScript":"wp-api-fetch","render":"file:./render.php"}');(0,i.registerBlockType)(_,{deprecated:a,edit:function({attributes:e,setAttributes:t}){const{className:s="",displayStyle:i="facepile",showActions:a=!1}=e,o=(0,r.useBlockProps)(),{getCurrentPostId:f}=(0,p.select)("core/editor"),{showAvatars:y=!0}=v(),m=(0,d.useRef)(!1);(0,d.useEffect)(()=>{if(m.current)return;m.current=!0;const e=s?.includes("is-style-");if(!e){const e=y?"facepile":"compact";t({className:l(s,`is-style-${e}`),displayStyle:e})}},[s,y,t]);const h=s?.includes("is-style-compact")?"compact":"facepile";(0,d.useEffect)(()=>{h!==i&&t({displayStyle:h})},[h,i,t]);const b=[["core/heading",{level:6,placeholder:(0,u.__)("Fediverse Reactions","activitypub"),content:(0,u.__)("Fediverse Reactions","activitypub")}]];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.InspectorControls,{children:(0,n.jsx)(c.PanelBody,{title:(0,u.__)("Action Buttons","activitypub"),children:(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,u.__)("Show action buttons","activitypub"),help:(0,u.__)("Display Like and Boost buttons so visitors can interact from their Fediverse server.","activitypub"),checked:a,onChange:e=>t({showActions:e})})})}),(0,n.jsxs)("div",{...o,children:[(0,n.jsx)(r.InnerBlocks,{template:b,allowedBlocks:["core/heading"],templateLock:"all",renderAppender:!1}),(0,n.jsx)(g,{postId:f(),fallbackReactions:k,displayStyle:i,showActions:a})]})]})},save:function(){return(0,n.jsx)("div",{...r.useBlockProps.save(),children:(0,n.jsx)(r.InnerBlocks.Content,{})})}})}};const t={};function s(i){const r=t[i];if(void 0!==r)return r.exports;const n=t[i]={exports:{}};return e[i](n,n.exports,s),n.exports}s.m=e,(()=>{const e=[];s.O=(t,i,r,n)=>{if(i){n=n||0;for(var a=e.length;a>0&&e[a-1][2]>n;a--)e[a]=e[a-1];return void(e[a]=[i,r,n])}let o=1/0;for(a=0;a<e.length;a++){let[i,r,n]=e[a],c=!0;for(var l=0;l<i.length;l++)(!1&n||o>=n)&&Object.keys(s.O).every(e=>s.O[e](i[l]))?i.splice(l--,1):(c=!1,n<o&&(o=n));if(c){e.splice(a--,1);const s=r();void 0!==s&&(t=s)}}return t}})(),s.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var r=t[i++],n=t[i++];s.o(e,r)?0===n&&i++:0===n?Object.defineProperty(e,r,{enumerable:!0,value:t[i++]}):Object.defineProperty(e,r,{enumerable:!0,get:n})}else for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.hasOwn(e,t),(()=>{const e={608:0,104:0};s.O.j=t=>0===e[t];const t=(t,i)=>{let[r,n,a]=i;var o,l,c=0;if(r.some(t=>0!==e[t])){for(o in n)s.o(n,o)&&(s.m[o]=n[o]);if(a)var u=a(s)}for(t&&t(i);c<r.length;c++)l=r[c],s.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return s.O(u)},i=globalThis.webpackChunkwordpress_activitypub||=[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();let i=s.O(void 0,[104],()=>s(91));i=s.O(i)})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "activitypub/remote-reply",
"apiVersion": 3,
"version": "8.3.0",
"version": "9.1.0",
"title": "Reply on the Fediverse",
"category": "widgets",
"description": "Allow visitors to reply to your posts from their Fediverse account.",

View File

@ -1 +1 @@
body.modal-open{overflow:hidden}.activitypub-modal__overlay{--activitypub-modal-background-color:var(--wp--preset--color--base,var(--wp--preset--color--background,#fff));--activitypub-modal-border-color:var(--wp--preset--color--contrast-3,var(--wp--preset--color--light-gray,#e2e4e7));--activitypub-modal-radius:var(--wp--custom--border--radius--medium,8px);--activitypub-modal-shadow:var(--wp--preset--shadow--natural,0 5px 15px rgba(0,0,0,.3));--activitypub-modal-compact-shadow:var(--wp--preset--shadow--natural,0 2px 8px rgba(0,0,0,.1));--activitypub-modal-text-color:var(--wp--preset--color--contrast,var(--wp--preset--color--foreground,inherit));align-items:center;background-color:rgba(0,0,0,.5);bottom:0;color:var(--activitypub-modal-text-color);display:flex;justify-content:center;left:0;margin:0!important;max-width:none!important;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay.compact{align-items:flex-start;background-color:transparent;bottom:auto;justify-content:flex-start;left:auto;padding:0;position:absolute;right:auto;top:auto;z-index:100}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:var(--activitypub-modal-background-color);border:1px solid var(--activitypub-modal-border-color);border-radius:var(--activitypub-modal-radius);box-shadow:var(--activitypub-modal-shadow);box-sizing:border-box;color:var(--wp--preset--color--contrast,#1e1e1e);display:flex;flex-direction:column;font-size:inherit;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.compact .activitypub-modal__frame{box-shadow:var(--activitypub-modal-compact-shadow);max-height:300px;max-width:-moz-min-content;max-width:min-content;min-width:250px;width:auto}.activitypub-modal__header{align-items:center;border-bottom:1px solid var(--activitypub-modal-border-color);display:flex;flex-shrink:0;justify-content:space-between;padding:2rem 2rem 1.5rem}.compact .activitypub-modal__header{display:none}.activitypub-modal__header .activitypub-modal__close{align-items:center;background:transparent;border:none;border-radius:var(--activitypub-modal-radius);color:inherit;cursor:pointer;display:flex;justify-content:center;padding:.5rem;width:auto}.activitypub-modal__header .activitypub-modal__close:active{border:none;padding:.5rem}.activitypub-modal__title{font-size:130%;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__content{overflow-y:auto}.activitypub-dialog__section{border-bottom:1px solid var(--activitypub-modal-border-color,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;margin-bottom:1rem}.activitypub-dialog__button-group{align-items:center;display:flex;gap:.5rem;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input[type]{background-color:var(--activitypub-modal-background-color,#fff)!important;border:1px solid var(--activitypub-modal-border-color,#949494)!important;border-radius:0;box-sizing:border-box;color:inherit!important;flex:1;font-family:inherit;font-size:1em;line-height:1;margin:0;min-width:0;padding:calc(.667em + 2px)!important}.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,#b32d2e)!important}.activitypub-dialog__button-group button{background-color:var(--wp--preset--color--contrast,#1e1e1e);border:none;box-sizing:border-box;color:var(--wp--preset--color--base,#fff);cursor:pointer;font-family:inherit;font-size:1em;line-height:1;min-width:22.5%;padding:calc(.667em + 2px) 1.5em;width:auto}.activitypub-dialog__error{color:var(--wp--preset--color--vivid-red,#b32d2e);font-size:90%;margin-top:.5rem}.activitypub-dialog__remember{font-size:90%;margin-top:1rem}.activitypub-dialog__remember label{align-items:center;display:flex;gap:.5rem}.activitypub-dialog__remember input[type=checkbox]{margin:0;position:relative;top:0}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.activitypub-remote-reply{margin-top:24px}.activitypub-remote-reply .activitypub-remote-profile{align-items:center;display:flex;gap:1rem}.activitypub-remote-reply .activitypub-remote-profile__close{align-items:center;border-radius:50%;display:inline-flex;height:24px;justify-content:center;line-height:1;padding:0;width:24px}.activitypub-remote-reply .activitypub-remote-profile__link,.activitypub-remote-reply__link{cursor:pointer;display:inline-block;margin:0!important}.activitypub-remote-profile[hidden],.activitypub-remote-reply__link[hidden]{display:none!important}
body.modal-open{overflow:hidden}.activitypub-modal__overlay{--activitypub-modal-background-color:var(--wp--preset--color--base,var(--wp--preset--color--background,#fff));--activitypub-modal-border-color:var(--wp--preset--color--contrast-3,var(--wp--preset--color--light-gray,#e2e4e7));--activitypub-modal-radius:var(--wp--custom--border--radius--medium,8px);--activitypub-modal-shadow:var(--wp--preset--shadow--natural,0 5px 15px rgba(0,0,0,.3));--activitypub-modal-compact-shadow:var(--wp--preset--shadow--natural,0 2px 8px rgba(0,0,0,.1));--activitypub-modal-text-color:var(--wp--preset--color--contrast,var(--wp--preset--color--foreground,inherit));align-items:center;background-color:rgba(0,0,0,.5);bottom:0;color:var(--activitypub-modal-text-color);display:flex;justify-content:center;left:0;margin:0!important;max-width:none!important;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay.compact{align-items:flex-start;background-color:transparent;bottom:auto;justify-content:flex-start;left:auto;padding:0;position:absolute;right:auto;top:auto;z-index:100}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:var(--activitypub-modal-background-color);border:1px solid var(--activitypub-modal-border-color);border-radius:var(--activitypub-modal-radius);box-shadow:var(--activitypub-modal-shadow);box-sizing:border-box;color:var(--wp--preset--color--contrast,#1e1e1e);display:flex;flex-direction:column;font-size:inherit;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.compact .activitypub-modal__frame{box-shadow:var(--activitypub-modal-compact-shadow);max-height:300px;max-width:min-content;min-width:250px;width:auto}.activitypub-modal__header{align-items:center;border-bottom:1px solid var(--activitypub-modal-border-color);display:flex;flex-shrink:0;justify-content:space-between;padding:2rem 2rem 1.5rem}.compact .activitypub-modal__header{display:none}.activitypub-modal__header .activitypub-modal__close{align-items:center;background:transparent;border:none;border-radius:var(--activitypub-modal-radius);color:inherit;cursor:pointer;display:flex;justify-content:center;padding:.5rem;width:auto}.activitypub-modal__header .activitypub-modal__close:active{border:none;padding:.5rem}.activitypub-modal__title{font-size:130%;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__content{overflow-y:auto}.activitypub-dialog__section{border-bottom:1px solid var(--activitypub-modal-border-color,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;margin-bottom:1rem}.activitypub-dialog__button-group{align-items:center;display:flex;gap:.5rem;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input[type]{background-color:var(--activitypub-modal-background-color,#fff)!important;border:1px solid var(--activitypub-modal-border-color,#949494)!important;border-radius:0;box-sizing:border-box;color:inherit!important;flex:1;font-family:inherit;font-size:1em;line-height:1;margin:0;min-width:0;padding:calc(.667em + 2px)!important}.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,#b32d2e)!important}.activitypub-dialog__button-group button{background-color:var(--wp--preset--color--contrast,#1e1e1e);border:none;box-sizing:border-box;color:var(--wp--preset--color--base,#fff);cursor:pointer;font-family:inherit;font-size:1em;line-height:1;min-width:22.5%;padding:calc(.667em + 2px) 1.5em;width:auto}.activitypub-dialog__error{color:var(--wp--preset--color--vivid-red,#b32d2e);font-size:90%;margin-top:.5rem}.activitypub-dialog__remember{font-size:90%;margin-top:1rem}.activitypub-dialog__remember label{align-items:center;display:flex;gap:.5rem}.activitypub-dialog__remember input[type=checkbox]{margin:0;position:relative;top:0}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.activitypub-remote-reply{margin-top:24px}.activitypub-remote-reply .activitypub-remote-profile{align-items:center;display:flex;gap:1rem}.activitypub-remote-reply .activitypub-remote-profile__close{align-items:center;border-radius:50%;display:inline-flex;height:24px;justify-content:center;line-height:1;padding:0;width:24px}.activitypub-remote-reply .activitypub-remote-profile__link,.activitypub-remote-reply__link{cursor:pointer;display:inline-block;margin:0!important}.activitypub-remote-profile[hidden],.activitypub-remote-reply__link[hidden]{display:none!important}

View File

@ -1 +1 @@
<?php return array('dependencies' => array('@wordpress/interactivity'), 'version' => '283e9946a5209ff839e1', 'type' => 'module');
<?php return array('dependencies' => array('@wordpress/interactivity'), 'version' => '773aabd18fa5b71fb3f3', 'type' => 'module');

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "activitypub/reply",
"version": "8.3.0",
"version": "9.1.0",
"title": "Federated Reply",
"category": "widgets",
"icon": "admin-comments",

View File

@ -1 +1 @@
.activitypub-embed-container{min-height:100px;pointer-events:none;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.activitypub-embed-loading{align-items:center;display:flex;justify-content:center}.activitypub-embed-container .wp-block-embed{pointer-events:none!important}.activitypub-embed-preview,.activitypub-embed-preview iframe{pointer-events:none}.activitypub-reply-display{margin:1em 0}.activitypub-reply-display p{margin:0}.activitypub-reply-display a{color:#2271b1;text-decoration:none}.activitypub-reply-display a:hover{color:#135e96;text-decoration:underline}.activitypub-embed{background:#fff;border:1px solid #e6e6e6;border-radius:12px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;max-width:100%;padding:0}.activitypub-reply-block .activitypub-embed{margin:1em 0}.activitypub-embed-header{align-items:center;display:flex;gap:10px;padding:15px}.activitypub-embed-header img{border-radius:50%;height:48px;width:48px}.activitypub-embed-header-text{flex-grow:1}.activitypub-embed-header-text h2{color:#000;font-size:15px;font-weight:600;margin:0;padding:0}.activitypub-embed-header-text .ap-account{color:#687684;font-size:14px;text-decoration:none}.activitypub-embed-content{padding:0 15px 15px}.activitypub-embed-content .ap-title{color:#000;font-size:23px;font-weight:600;margin:0 0 10px;padding:0}.activitypub-embed-content .ap-subtitle{color:#000;font-size:15px;margin:0 0 15px}.activitypub-embed-content .ap-preview{border:1px solid #e6e6e6;border-radius:8px;box-sizing:border-box;display:grid;gap:2px;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;margin:1em 0 0;min-height:64px;overflow:hidden;position:relative;width:100%}.activitypub-embed-content .ap-preview img{border:0;box-sizing:border-box;display:block;height:100%;-o-object-fit:cover;object-fit:cover;overflow:hidden;position:relative;width:100%}.activitypub-embed-content .ap-preview audio,.activitypub-embed-content .ap-preview video{display:block;grid-column:1/span 2;max-width:100%}.activitypub-embed-content .ap-preview audio{width:100%}.activitypub-embed-content .ap-preview.layout-1{grid-template-columns:1fr;grid-template-rows:1fr}.activitypub-embed-content .ap-preview.layout-2{aspect-ratio:auto;grid-template-rows:1fr;height:auto}.activitypub-embed-content .ap-preview.layout-3>img:first-child{grid-row:span 2}.activitypub-embed-content .ap-preview-text{padding:15px}.activitypub-embed-meta{border-top:1px solid #e6e6e6;color:#687684;display:flex;font-size:13px;gap:15px;padding:15px}.activitypub-embed-meta .ap-stat{align-items:center;display:flex;gap:5px}@media only screen and (max-width:399px){.activitypub-embed-meta span.ap-stat{display:none!important}}.activitypub-embed-meta a.ap-stat{color:inherit;text-decoration:none}.activitypub-embed-meta strong{color:#000;font-weight:600}.activitypub-embed-meta .ap-stat-label{color:#687684}.wp-block-activitypub-reply .components-spinner{height:12px;margin-bottom:0;margin-top:0;width:12px}
.activitypub-embed-container{min-height:100px;pointer-events:none;position:relative;-webkit-user-select:none;user-select:none}.activitypub-embed-loading{align-items:center;display:flex;justify-content:center}.activitypub-embed-container .wp-block-embed{pointer-events:none!important}.activitypub-embed-preview,.activitypub-embed-preview iframe{pointer-events:none}.activitypub-reply-display{margin:1em 0}.activitypub-reply-display p{margin:0}.activitypub-reply-display a{color:#2271b1;text-decoration:none}.activitypub-reply-display a:hover{color:#135e96;text-decoration:underline}.activitypub-embed{background:#fff;border:1px solid #e6e6e6;border-radius:12px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;max-width:100%;padding:0}.activitypub-reply-block .activitypub-embed{margin:1em 0}.activitypub-embed-header{align-items:center;display:flex;gap:10px;padding:15px}.activitypub-embed-header img{border-radius:50%;height:48px;width:48px}.activitypub-embed-header-text{flex-grow:1}.activitypub-embed-header-text h2{color:#000;font-size:15px;font-weight:600;margin:0;padding:0}.activitypub-embed-header-text .ap-account{color:#687684;font-size:14px;text-decoration:none}.activitypub-embed-content{padding:0 15px 15px}.activitypub-embed-content .ap-title{color:#000;font-size:23px;font-weight:600;margin:0 0 10px;padding:0}.activitypub-embed-content .ap-subtitle{color:#000;font-size:15px;margin:0 0 15px}.activitypub-embed-content .ap-preview{border:1px solid #e6e6e6;border-radius:8px;box-sizing:border-box;display:grid;gap:2px;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;margin:1em 0 0;min-height:64px;overflow:hidden;position:relative;width:100%}.activitypub-embed-content .ap-preview img{border:0;box-sizing:border-box;display:block;height:100%;object-fit:cover;overflow:hidden;position:relative;width:100%}.activitypub-embed-content .ap-preview audio,.activitypub-embed-content .ap-preview video{display:block;grid-column:1/span 2;max-width:100%}.activitypub-embed-content .ap-preview audio{width:100%}.activitypub-embed-content .ap-preview.layout-1{grid-template-columns:1fr;grid-template-rows:1fr}.activitypub-embed-content .ap-preview.layout-2{aspect-ratio:auto;grid-template-rows:1fr;height:auto}.activitypub-embed-content .ap-preview.layout-3>img:first-child{grid-row:span 2}.activitypub-embed-content .ap-preview-text{padding:15px}.activitypub-embed-meta{border-top:1px solid #e6e6e6;color:#687684;display:flex;font-size:13px;gap:15px;padding:15px}.activitypub-embed-meta .ap-stat{align-items:center;display:flex;gap:5px}@media only screen and (max-width:399px){.activitypub-embed-meta span.ap-stat{display:none!important}}.activitypub-embed-meta a.ap-stat{color:inherit;text-decoration:none}.activitypub-embed-meta strong{color:#000;font-weight:600}.activitypub-embed-meta .ap-stat-label{color:#687684}.wp-block-activitypub-reply .components-spinner{height:12px;margin-bottom:0;margin-top:0;width:12px}

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '9528bc906518de9ee951');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'fbe17065130aaabefa31');

View File

@ -1 +1 @@
.activitypub-embed-container{min-height:100px;pointer-events:none;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.activitypub-embed-loading{align-items:center;display:flex;justify-content:center}.activitypub-embed-container .wp-block-embed{pointer-events:none!important}.activitypub-embed-preview,.activitypub-embed-preview iframe{pointer-events:none}.activitypub-reply-display{margin:1em 0}.activitypub-reply-display p{margin:0}.activitypub-reply-display a{color:#2271b1;text-decoration:none}.activitypub-reply-display a:hover{color:#135e96;text-decoration:underline}.activitypub-embed{background:#fff;border:1px solid #e6e6e6;border-radius:12px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;max-width:100%;padding:0}.activitypub-reply-block .activitypub-embed{margin:1em 0}.activitypub-embed-header{align-items:center;display:flex;gap:10px;padding:15px}.activitypub-embed-header img{border-radius:50%;height:48px;width:48px}.activitypub-embed-header-text{flex-grow:1}.activitypub-embed-header-text h2{color:#000;font-size:15px;font-weight:600;margin:0;padding:0}.activitypub-embed-header-text .ap-account{color:#687684;font-size:14px;text-decoration:none}.activitypub-embed-content{padding:0 15px 15px}.activitypub-embed-content .ap-title{color:#000;font-size:23px;font-weight:600;margin:0 0 10px;padding:0}.activitypub-embed-content .ap-subtitle{color:#000;font-size:15px;margin:0 0 15px}.activitypub-embed-content .ap-preview{border:1px solid #e6e6e6;border-radius:8px;box-sizing:border-box;display:grid;gap:2px;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;margin:1em 0 0;min-height:64px;overflow:hidden;position:relative;width:100%}.activitypub-embed-content .ap-preview img{border:0;box-sizing:border-box;display:block;height:100%;-o-object-fit:cover;object-fit:cover;overflow:hidden;position:relative;width:100%}.activitypub-embed-content .ap-preview audio,.activitypub-embed-content .ap-preview video{display:block;grid-column:1/span 2;max-width:100%}.activitypub-embed-content .ap-preview audio{width:100%}.activitypub-embed-content .ap-preview.layout-1{grid-template-columns:1fr;grid-template-rows:1fr}.activitypub-embed-content .ap-preview.layout-2{aspect-ratio:auto;grid-template-rows:1fr;height:auto}.activitypub-embed-content .ap-preview.layout-3>img:first-child{grid-row:span 2}.activitypub-embed-content .ap-preview-text{padding:15px}.activitypub-embed-meta{border-top:1px solid #e6e6e6;color:#687684;display:flex;font-size:13px;gap:15px;padding:15px}.activitypub-embed-meta .ap-stat{align-items:center;display:flex;gap:5px}@media only screen and (max-width:399px){.activitypub-embed-meta span.ap-stat{display:none!important}}.activitypub-embed-meta a.ap-stat{color:inherit;text-decoration:none}.activitypub-embed-meta strong{color:#000;font-weight:600}.activitypub-embed-meta .ap-stat-label{color:#687684}.wp-block-activitypub-reply .components-spinner{height:12px;margin-bottom:0;margin-top:0;width:12px}
.activitypub-embed-container{min-height:100px;pointer-events:none;position:relative;-webkit-user-select:none;user-select:none}.activitypub-embed-loading{align-items:center;display:flex;justify-content:center}.activitypub-embed-container .wp-block-embed{pointer-events:none!important}.activitypub-embed-preview,.activitypub-embed-preview iframe{pointer-events:none}.activitypub-reply-display{margin:1em 0}.activitypub-reply-display p{margin:0}.activitypub-reply-display a{color:#2271b1;text-decoration:none}.activitypub-reply-display a:hover{color:#135e96;text-decoration:underline}.activitypub-embed{background:#fff;border:1px solid #e6e6e6;border-radius:12px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;max-width:100%;padding:0}.activitypub-reply-block .activitypub-embed{margin:1em 0}.activitypub-embed-header{align-items:center;display:flex;gap:10px;padding:15px}.activitypub-embed-header img{border-radius:50%;height:48px;width:48px}.activitypub-embed-header-text{flex-grow:1}.activitypub-embed-header-text h2{color:#000;font-size:15px;font-weight:600;margin:0;padding:0}.activitypub-embed-header-text .ap-account{color:#687684;font-size:14px;text-decoration:none}.activitypub-embed-content{padding:0 15px 15px}.activitypub-embed-content .ap-title{color:#000;font-size:23px;font-weight:600;margin:0 0 10px;padding:0}.activitypub-embed-content .ap-subtitle{color:#000;font-size:15px;margin:0 0 15px}.activitypub-embed-content .ap-preview{border:1px solid #e6e6e6;border-radius:8px;box-sizing:border-box;display:grid;gap:2px;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;margin:1em 0 0;min-height:64px;overflow:hidden;position:relative;width:100%}.activitypub-embed-content .ap-preview img{border:0;box-sizing:border-box;display:block;height:100%;object-fit:cover;overflow:hidden;position:relative;width:100%}.activitypub-embed-content .ap-preview audio,.activitypub-embed-content .ap-preview video{display:block;grid-column:1/span 2;max-width:100%}.activitypub-embed-content .ap-preview audio{width:100%}.activitypub-embed-content .ap-preview.layout-1{grid-template-columns:1fr;grid-template-rows:1fr}.activitypub-embed-content .ap-preview.layout-2{aspect-ratio:auto;grid-template-rows:1fr;height:auto}.activitypub-embed-content .ap-preview.layout-3>img:first-child{grid-row:span 2}.activitypub-embed-content .ap-preview-text{padding:15px}.activitypub-embed-meta{border-top:1px solid #e6e6e6;color:#687684;display:flex;font-size:13px;gap:15px;padding:15px}.activitypub-embed-meta .ap-stat{align-items:center;display:flex;gap:5px}@media only screen and (max-width:399px){.activitypub-embed-meta span.ap-stat{display:none!important}}.activitypub-embed-meta a.ap-stat{color:inherit;text-decoration:none}.activitypub-embed-meta strong{color:#000;font-weight:600}.activitypub-embed-meta .ap-stat-label{color:#687684}.wp-block-activitypub-reply .components-spinner{height:12px;margin-bottom:0;margin-top:0;width:12px}

View File

@ -1 +1 @@
(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,o=window.wp.primitives,r=window.ReactJSXRuntime;var i=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.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"})});const c=window.wp.blockEditor,l=window.wp.components,n=window.wp.i18n,s=window.wp.element,a=window.wp.compose,d=window.wp.data,u=window.wp.apiFetch;var p=e.n(u);const b=window.wp.url,w={default:(0,n.__)("Enter the URL of a post from the Fediverse (Mastodon, Pixelfed, etc.) that you want to reply to.","activitypub"),checking:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.Spinner,{})," "+(0,n.__)("Checking URL…","activitypub")]}),valid:(0,n.__)("The author will be notified of your response.","activitypub"),error:(0,n.__)("This site doesnt have ActivityPub enabled and wont receive your reply.","activitypub")};(0,t.registerBlockType)("activitypub/reply",{edit:function({attributes:e,setAttributes:o,clientId:i,isSelected:u}){const{url:y="",embedPost:v=!1}=e,[m,h]=(0,s.useState)(w.default),[f,k]=(0,s.useState)(!1),[_,C]=(0,s.useState)(!1),x=(0,s.useRef)(),{insertAfterBlock:L,removeBlock:g,replaceInnerBlocks:P}=(0,d.useDispatch)("core/block-editor"),j=v&&!_&&f,B=(0,c.useInnerBlocksProps)({className:"activitypub-embed-container"},{allowedBlocks:["core/embed"],template:y&&j?[["core/embed",{url:y}]]:[],templateLock:"all"});(0,s.useEffect)(()=>{P(i,y&&j?[(0,t.createBlock)("core/embed",{url:y})]:[])},[y,j,i,P]),(0,s.useEffect)(()=>{h(y?_?w.checking():f?w.valid:w.error:w.default)},[y,_,f]);const S=()=>{setTimeout(()=>x.current?.focus(),50)},V=(0,s.useCallback)(async e=>{if(e)try{C(!0),new URL(e);try{const t=await p()({path:(0,b.addQueryArgs)("/oembed/1.0/proxy",{url:e,activitypub:!0})});t&&t.provider_name?(o({embedPost:!0,isValidActivityPub:!0}),k(!0)):(o({isValidActivityPub:!1}),k(!1))}catch(e){console.log("Could not fetch embed:",e),o({isValidActivityPub:!1}),k(!1)}}catch(e){o({isValidActivityPub:!1}),k(!1)}finally{C(!1)}else k(!1)},[o,k,C]),A=(0,a.useDebounce)(V,250);return(0,s.useEffect)(()=>{y&&A(y)},[y,A]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.InspectorControls,{children:(0,r.jsx)(l.PanelBody,{title:(0,n.__)("Settings","activitypub"),children:(0,r.jsx)(l.ToggleControl,{label:(0,n.__)("Embed Post","activitypub"),checked:!!v,onChange:e=>o({embedPost:e}),disabled:!f,help:(0,n.__)("Show embedded content from the URL.","activitypub")})})}),(0,r.jsxs)("div",{onClick:S,...(0,c.useBlockProps)(),children:[u&&(0,r.jsx)(l.TextControl,{label:(0,n.__)("Your post is a reply to the following URL","activitypub"),value:y,onChange:e=>o({url:e}),help:m,onKeyDown:e=>{"Enter"===e.key&&L(i),!y&&["Backspace","Delete"].includes(e.key)&&g(i)},ref:x,__next40pxDefaultSize:!0}),j&&(0,r.jsx)("div",{...B}),y&&!j&&!u&&(0,r.jsx)("div",{className:"activitypub-reply-block-editor__preview",contentEditable:!1,onClick:S,style:{cursor:"pointer"},children:(0,r.jsx)("a",{href:y,className:"u-in-reply-to",target:"_blank",rel:"noreferrer",children:"↬"+y.replace(/^https?:\/\//,"")})})]})]})},save:()=>null,icon:i,transforms:{from:[{type:"block",blocks:["core/embed"],transform:e=>(0,t.createBlock)("activitypub/reply",{url:e.url||"",embedPost:!0})}],to:[{type:"block",blocks:["core/embed"],transform:e=>(0,t.createBlock)("core/embed",{url:e.url||""})}]}})})();
(()=>{"use strict";const e={n:t=>{const o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{if(Array.isArray(o))for(var r=0;r<o.length;){var i=o[r++],l=o[r++];e.o(t,i)?0===l&&r++:0===l?Object.defineProperty(t,i,{enumerable:!0,value:o[r++]}):Object.defineProperty(t,i,{enumerable:!0,get:l})}else for(var i in o)e.o(o,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:o[i]})},o:(e,t)=>Object.hasOwn(e,t)},t=window.wp.blocks,o=window.wp.primitives,r=window.ReactJSXRuntime;var i=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.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"})});const l=window.wp.blockEditor,c=window.wp.components,n=window.wp.i18n,s=window.wp.element,a=window.wp.compose,d=window.wp.data,u=window.wp.apiFetch;var p=e.n(u);const b=window.wp.url,w={default:(0,n.__)("Enter the URL of a post from the Fediverse (Mastodon, Pixelfed, etc.) that you want to reply to.","activitypub"),checking:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.Spinner,{})," "+(0,n.__)("Checking URL…","activitypub")]}),valid:(0,n.__)("The author will be notified of your response.","activitypub"),error:(0,n.__)("This site doesnt have ActivityPub enabled and wont receive your reply.","activitypub")};(0,t.registerBlockType)("activitypub/reply",{edit:function({attributes:e,setAttributes:o,clientId:i,isSelected:u}){const{url:y="",embedPost:m=!1}=e,[v,f]=(0,s.useState)(w.default),[h,k]=(0,s.useState)(!1),[_,C]=(0,s.useState)(!1),g=(0,s.useRef)(),{insertAfterBlock:x,removeBlock:L,replaceInnerBlocks:P}=(0,d.useDispatch)("core/block-editor"),j=m&&!_&&h,B=(0,l.useInnerBlocksProps)({className:"activitypub-embed-container"},{allowedBlocks:["core/embed"],template:y&&j?[["core/embed",{url:y}]]:[],templateLock:"all"});(0,s.useEffect)(()=>{P(i,y&&j?[(0,t.createBlock)("core/embed",{url:y})]:[])},[y,j,i,P]),(0,s.useEffect)(()=>{f(y?_?w.checking():h?w.valid:w.error:w.default)},[y,_,h]);const A=()=>{setTimeout(()=>g.current?.focus(),50)},S=(0,s.useCallback)(async e=>{if(e)try{C(!0),new URL(e);try{const t=await p()({path:(0,b.addQueryArgs)("/oembed/1.0/proxy",{url:e,activitypub:!0})});t&&t.provider_name?(o({embedPost:!0,isValidActivityPub:!0}),k(!0)):(o({isValidActivityPub:!1}),k(!1))}catch(e){console.log("Could not fetch embed:",e),o({isValidActivityPub:!1}),k(!1)}}catch(e){o({isValidActivityPub:!1}),k(!1)}finally{C(!1)}else k(!1)},[o,k,C]),V=(0,a.useDebounce)(S,250);return(0,s.useEffect)(()=>{y&&V(y)},[y,V]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.InspectorControls,{children:(0,r.jsx)(c.PanelBody,{title:(0,n.__)("Settings","activitypub"),children:(0,r.jsx)(c.ToggleControl,{label:(0,n.__)("Embed Post","activitypub"),checked:!!m,onChange:e=>o({embedPost:e}),disabled:!h,help:(0,n.__)("Show embedded content from the URL.","activitypub")})})}),(0,r.jsxs)("div",{onClick:A,...(0,l.useBlockProps)(),children:[u&&(0,r.jsx)(c.TextControl,{label:(0,n.__)("Your post is a reply to the following URL","activitypub"),value:y,onChange:e=>o({url:e}),help:v,onKeyDown:e=>{"Enter"===e.key&&x(i),!y&&["Backspace","Delete"].includes(e.key)&&L(i)},ref:g,__next40pxDefaultSize:!0}),j&&(0,r.jsx)("div",{...B}),y&&!j&&!u&&(0,r.jsx)("div",{className:"activitypub-reply-block-editor__preview",contentEditable:!1,onClick:A,style:{cursor:"pointer"},children:(0,r.jsx)("a",{href:y,className:"u-in-reply-to",target:"_blank",rel:"noreferrer",children:"↬"+y.replace(/^https?:\/\//,"")})})]})]})},save:()=>null,icon:i,transforms:{from:[{type:"block",blocks:["core/embed"],transform:e=>(0,t.createBlock)("activitypub/reply",{url:e.url||"",embedPost:!0})}],to:[{type:"block",blocks:["core/embed"],transform:e=>(0,t.createBlock)("core/embed",{url:e.url||""})}]}})})();

View File

@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "activitypub/stats",
"apiVersion": 3,
"version": "unreleased",
"version": "9.1.0",
"title": "ActivityPub Stats",
"category": "widgets",
"description": "Display your annual Fediverse stats as a shareable card.",

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => '7042ce0f90bb9fbbfc2a');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => 'c3b06abb1351ff45fc38');

View File

@ -1 +1 @@
(()=>{"use strict";var e,t={1868(e,t,i){const s=window.wp.blocks,r=window.wp.serverSideRender;var n=i.n(r);const a=window.wp.components,o=window.wp.blockEditor,l=window.wp.i18n,c=window.wp.element,u=window.wp.apiFetch;var p=i.n(u);const d=window.wp.data;const v=window.ReactJSXRuntime,b=(new Date).getFullYear();function h(){const e=[];for(let t=b;t>=b-5;t--)e.push({label:String(t),value:String(t)});return e}const g=JSON.parse('{"UU":"activitypub/stats"}');(0,s.registerBlockType)(g.UU,{edit:function({attributes:e,setAttributes:t}){const{selectedUser:i,year:s}=e,r=(0,o.useBlockProps)(),u=function({withInherit:e=!1}){const{enabled:t,namespace:i}=window._activityPubOptions||{},[s,r]=(0,c.useState)(!1),{fetchedUsers:n,isLoadingUsers:a}=(0,d.useSelect)(e=>{const{getUsers:i,getIsResolving:s}=e("core");return{fetchedUsers:t?.users?i({capabilities:"activitypub"}):null,isLoadingUsers:!!t?.users&&s("getUsers",[{capabilities:"activitypub"}])}},[t?.users]),o=(0,d.useSelect)(e=>n||a?null:e("core").getCurrentUser(),[n,a]);(0,c.useEffect)(()=>{!n&&!a&&o&&i&&p()({path:`/${i}/actors/${o.id}`,method:"HEAD",headers:{Accept:"application/activity+json"},parse:!1}).then(()=>r(!0)).catch(()=>r(!1))},[n,a,o,i]);const u=(0,c.useMemo)(()=>n||(o&&s?[{id:o.id,name:o.name}]:[]),[n,o,s]);return(0,c.useMemo)(()=>{if(!u.length)return[];const i=[];return t?.blog&&n&&i.push({label:(0,l.__)("Blog","activitypub"),value:"blog"}),e&&t?.users&&n&&i.push({label:(0,l.__)("Dynamic User","activitypub"),value:"inherit"}),u.reduce((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e),i)},[u,t?.blog,t?.users,n,e])}({}),[g,w]=(0,c.useState)(!1);(0,c.useEffect)(()=>{!i&&u.length&&t({selectedUser:u[0].value})},[u]);const y=s||b-1,[f,_]=(0,c.useState)(""),m=(0,c.useCallback)(()=>{if(!i)return;const e=function(e,t){const i=window._activityPubOptions?.statsImageUrlEndpoint||"";if(!i)return"";const s=e&&"blog"!==e?e:0;return i.replace("{user_id}",s).replace("{year}",t)}(i,y);e&&p()({url:e}).then(e=>_(e.url||"")).catch(()=>_(""))},[i,y]);return(0,c.useEffect)(()=>{m()},[m]),(0,v.jsxs)("div",{...r,children:[(0,v.jsxs)(o.InspectorControls,{children:[(0,v.jsxs)(a.PanelBody,{title:(0,l.__)("Settings","activitypub"),children:[u.length>1&&(0,v.jsx)(a.SelectControl,{label:(0,l.__)("Select User","activitypub"),value:i,options:u,onChange:e=>t({selectedUser:e})}),(0,v.jsx)(a.SelectControl,{label:(0,l.__)("Year","activitypub"),value:String(y),options:h(),onChange:e=>t({year:parseInt(e,10)})})]}),f&&(0,v.jsxs)(a.PanelBody,{title:(0,l.__)("Share Image","activitypub"),initialOpen:!1,children:[(0,v.jsx)("p",{className:"description",children:(0,l.__)("Use this URL to share your stats as an image on social media.","activitypub")}),(0,v.jsx)(a.TextControl,{label:(0,l.__)("Share image URL","activitypub"),hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,value:f,readOnly:!0,onClick:e=>e.target.select()}),(0,v.jsxs)("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[(0,v.jsx)(a.Button,{variant:"secondary",onClick:()=>{navigator.clipboard.writeText(f).then(()=>{w(!0),setTimeout(()=>w(!1),2e3)})},children:g?(0,l.__)("Copied!","activitypub"):(0,l.__)("Copy URL","activitypub")}),(0,v.jsx)(a.ExternalLink,{href:f,children:(0,l.__)("Preview","activitypub")})]})]})]}),(0,v.jsx)(a.Disabled,{children:(0,v.jsx)(n(),{block:"activitypub/stats",attributes:{...e,year:y}})})]})}})}},i={};function s(e){var r=i[e];if(void 0!==r)return r.exports;var n=i[e]={exports:{}};return t[e](n,n.exports,s),n.exports}s.m=t,e=[],s.O=(t,i,r,n)=>{if(!i){var a=1/0;for(u=0;u<e.length;u++){for(var[i,r,n]=e[u],o=!0,l=0;l<i.length;l++)(!1&n||a>=n)&&Object.keys(s.O).every(e=>s.O[e](i[l]))?i.splice(l--,1):(o=!1,n<a&&(a=n));if(o){e.splice(u--,1);var c=r();void 0!==c&&(t=c)}}return t}n=n||0;for(var u=e.length;u>0&&e[u-1][2]>n;u--)e[u]=e[u-1];e[u]=[i,r,n]},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={85:0,721:0};s.O.j=t=>0===e[t];var t=(t,i)=>{var r,n,[a,o,l]=i,c=0;if(a.some(t=>0!==e[t])){for(r in o)s.o(o,r)&&(s.m[r]=o[r]);if(l)var u=l(s)}for(t&&t(i);c<a.length;c++)n=a[c],s.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return s.O(u)},i=globalThis.webpackChunkwordpress_activitypub=globalThis.webpackChunkwordpress_activitypub||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var r=s.O(void 0,[721],()=>s(1868));r=s.O(r)})();
(()=>{"use strict";var e={868(e,t,n){const r=window.wp.blocks,i=window.wp.serverSideRender;var s=n.n(i);const a=window.wp.components,o=window.wp.blockEditor,l=window.wp.i18n,c=window.wp.element,u=window.wp.apiFetch;var p=n.n(u);const d=window.wp.data;const b=window.ReactJSXRuntime,v=(new Date).getFullYear();function h(){const e=[];for(let t=v;t>=v-5;t--)e.push({label:String(t),value:String(t)});return e}const g=JSON.parse('{"UU":"activitypub/stats"}');(0,r.registerBlockType)(g.UU,{edit:function({attributes:e,setAttributes:t}){const{selectedUser:n,year:r}=e,i=(0,o.useBlockProps)(),u=function({withInherit:e=!1}){const{enabled:t,namespace:n}=window._activityPubOptions||{},[r,i]=(0,c.useState)(!1),{fetchedUsers:s,isLoadingUsers:a}=(0,d.useSelect)(e=>{const{getUsers:n,getIsResolving:r}=e("core");return{fetchedUsers:t?.users?n({capabilities:"activitypub"}):null,isLoadingUsers:!!t?.users&&r("getUsers",[{capabilities:"activitypub"}])}},[t?.users]),o=(0,d.useSelect)(e=>s||a?null:e("core").getCurrentUser(),[s,a]);(0,c.useEffect)(()=>{!s&&!a&&o&&n&&p()({path:`/${n}/actors/${o.id}`,method:"HEAD",headers:{Accept:"application/activity+json"},parse:!1}).then(()=>i(!0)).catch(()=>i(!1))},[s,a,o,n]);const u=(0,c.useMemo)(()=>s||(o&&r?[{id:o.id,name:o.name}]:[]),[s,o,r]);return(0,c.useMemo)(()=>{if(!u.length)return[];const n=[];return t?.blog&&s&&n.push({label:(0,l.__)("Blog","activitypub"),value:"blog"}),e&&t?.users&&s&&n.push({label:(0,l.__)("Dynamic User","activitypub"),value:"inherit"}),u.reduce((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e),n)},[u,t?.blog,t?.users,s,e])}({}),[g,y]=(0,c.useState)(!1);(0,c.useEffect)(()=>{!n&&u.length&&t({selectedUser:u[0].value})},[u]);const f=r||v-1,[w,_]=(0,c.useState)(""),m=(0,c.useCallback)(()=>{if(!n)return;const e=function(e,t){const n=window._activityPubOptions?.statsImageUrlEndpoint||"";if(!n)return"";const r=e&&"blog"!==e?e:0;return n.replace("{user_id}",r).replace("{year}",t)}(n,f);e&&p()({url:e}).then(e=>_(e.url||"")).catch(()=>_(""))},[n,f]);return(0,c.useEffect)(()=>{m()},[m]),(0,b.jsxs)("div",{...i,children:[(0,b.jsxs)(o.InspectorControls,{children:[(0,b.jsxs)(a.PanelBody,{title:(0,l.__)("Settings","activitypub"),children:[u.length>1&&(0,b.jsx)(a.SelectControl,{label:(0,l.__)("Select User","activitypub"),value:n,options:u,onChange:e=>t({selectedUser:e})}),(0,b.jsx)(a.SelectControl,{label:(0,l.__)("Year","activitypub"),value:String(f),options:h(),onChange:e=>t({year:parseInt(e,10)})})]}),w&&(0,b.jsxs)(a.PanelBody,{title:(0,l.__)("Share Image","activitypub"),initialOpen:!1,children:[(0,b.jsx)("p",{className:"description",children:(0,l.__)("Use this URL to share your stats as an image on social media.","activitypub")}),(0,b.jsx)(a.TextControl,{label:(0,l.__)("Share image URL","activitypub"),hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,value:w,readOnly:!0,onClick:e=>e.target.select()}),(0,b.jsxs)("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[(0,b.jsx)(a.Button,{variant:"secondary",onClick:()=>{navigator.clipboard.writeText(w).then(()=>{y(!0),setTimeout(()=>y(!1),2e3)})},children:g?(0,l.__)("Copied!","activitypub"):(0,l.__)("Copy URL","activitypub")}),(0,b.jsx)(a.ExternalLink,{href:w,rel:"external noreferrer noopener",children:(0,l.__)("Preview","activitypub")})]})]})]}),(0,b.jsx)(a.Disabled,{children:(0,b.jsx)(s(),{block:"activitypub/stats",attributes:{...e,year:f}})})]})}})}};const t={};function n(r){const i=t[r];if(void 0!==i)return i.exports;const s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.m=e,(()=>{const e=[];n.O=(t,r,i,s)=>{if(r){s=s||0;for(var a=e.length;a>0&&e[a-1][2]>s;a--)e[a]=e[a-1];return void(e[a]=[r,i,s])}let o=1/0;for(a=0;a<e.length;a++){let[r,i,s]=e[a],c=!0;for(var l=0;l<r.length;l++)(!1&s||o>=s)&&Object.keys(n.O).every(e=>n.O[e](r[l]))?r.splice(l--,1):(c=!1,s<o&&(o=s));if(c){e.splice(a--,1);const n=i();void 0!==n&&(t=n)}}return t}})(),n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var i=t[r++],s=t[r++];n.o(e,i)?0===s&&r++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.hasOwn(e,t),(()=>{const e={85:0,721:0};n.O.j=t=>0===e[t];const t=(t,r)=>{let[i,s,a]=r;var o,l,c=0;if(i.some(t=>0!==e[t])){for(o in s)n.o(s,o)&&(n.m[o]=s[o]);if(a)var u=a(n)}for(t&&t(r);c<i.length;c++)l=i[c],n.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return n.O(u)},r=globalThis.webpackChunkwordpress_activitypub||=[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();let r=n.O(void 0,[721],()=>n(868));r=n.O(r)})();

View File

@ -65,13 +65,9 @@ $change_sign = $followers_net_change >= 0 ? '+' : '';
// Get actor webfinger for the card header.
$actor = Actors::get_by_id( $user_id );
if ( \is_wp_error( $actor ) ) {
// Fall back to direct model instantiation for blog/application actors.
if ( Actors::BLOG_USER_ID === $user_id ) {
$actor = new \Activitypub\Model\Blog();
} elseif ( Actors::APPLICATION_USER_ID === $user_id ) {
$actor = new \Activitypub\Model\Application();
}
if ( \is_wp_error( $actor ) && Actors::BLOG_USER_ID === $user_id ) {
// Fall back to direct model instantiation for the blog actor.
$actor = new \Activitypub\Model\Blog();
}
$actor_webfinger = ! \is_wp_error( $actor ) ? $actor->get_webfinger() : '';