updated plugin ActivityPub version 8.3.0

This commit is contained in:
2026-06-03 21:28:46 +00:00
committed by Gitium
parent a4b78ec277
commit 6fe182458a
340 changed files with 43232 additions and 7568 deletions

View File

@ -0,0 +1,66 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "activitypub/following",
"apiVersion": 3,
"version": "8.3.0",
"title": "Fediverse Following",
"category": "widgets",
"description": "Display the accounts you follow in the Fediverse on your website.",
"textdomain": "activitypub",
"icon": "groups",
"keywords": [
"fediverse",
"activitypub",
"following",
"mastodon"
],
"supports": {
"html": false,
"interactivity": true
},
"attributes": {
"selectedUser": {
"type": "string",
"default": "blog"
},
"per_page": {
"type": "number",
"default": 10
},
"order": {
"type": "string",
"default": "desc",
"enum": [
"asc",
"desc"
]
}
},
"usesContext": [
"postType",
"postId"
],
"styles": [
{
"name": "default",
"label": "Default",
"isDefault": true
},
{
"name": "card",
"label": "Card"
},
{
"name": "compact",
"label": "Compact"
}
],
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"viewScriptModule": "file:./view.js",
"viewScript": "wp-api-fetch",
"style": [
"file:./style-index.css"
],
"render": "file:./render.php"
}

View File

@ -0,0 +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');

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,20 @@
<?php
/**
* Server-side rendering of the following block.
*
* @package Activitypub
*/
use Activitypub\Blocks;
/* @var array $attributes Block attributes. */
$attributes = $attributes ?? array();
/* @var WP_Block $block Current block. */
$block = $block ?? null;
/* @var string $content Block content. */
$content = $content ?? '';
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output is escaped in render method.
echo Blocks::render_actor_list_block( 'following', $attributes, $block, $content );

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array('@wordpress/interactivity'), 'version' => '94e5efb023ccc7caf799', 'type' => 'module');

View File

@ -0,0 +1 @@
import*as e from"@wordpress/interactivity";const t=e,a=t.withSyncEvent??(e=>e);!function(){const{actions:e}=(0,t.store)("activitypub/following",{state:{get paginationText(){const{page:e,pages:a}=(0,t.getContext)();return`${e} / ${a}`},get disablePreviousLink(){const{page:e}=(0,t.getContext)();return e<=1},get disableNextLink(){const{page:e,pages:a}=(0,t.getContext)();return e>=a}},actions:{async fetchItems(){const e=(0,t.getContext)(),{userId:a,page:n,perPage:r,order:o,endpoint:s}=e,{apiFetch:g,url:i}=window.wp;e.isLoading=!0;try{const{namespace:c}=(0,t.getConfig)(),p=i.addQueryArgs(`/${c}/actors/${a}/${s}`,{context:"full",per_page:r,order:o,page:n}),{orderedItems:l,totalItems:d}=await g({path:p});e.items=l.map(e=>({handle:"@"+e.webfinger,icon:e.icon,name:e.name||e.preferredUsername,url:e.url||e.id})),e.total=d,e.pages=Math.ceil(d/r)}catch(e){console.error(`Error fetching ${s}:`,e)}finally{e.isLoading=!1}},previousPage:a(a=>{a.preventDefault();const n=(0,t.getContext)();n.page>1&&(n.page--,e.fetchItems())}),nextPage:a(a=>{a.preventDefault();const n=(0,t.getContext)();n.page<n.pages&&(n.page++,e.fetchItems())})},callbacks:{setDefaultAvatar(e){e.target.src=(0,t.getConfig)().defaultAvatarUrl}}})}();