updated plugin ActivityPub version 8.3.0
This commit is contained in:
66
wp-content/plugins/activitypub/build/following/block.json
Normal file
66
wp-content/plugins/activitypub/build/following/block.json
Normal 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"
|
||||
}
|
||||
@ -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');
|
||||
3
wp-content/plugins/activitypub/build/following/index.js
Normal file
3
wp-content/plugins/activitypub/build/following/index.js
Normal file
File diff suppressed because one or more lines are too long
20
wp-content/plugins/activitypub/build/following/render.php
Normal file
20
wp-content/plugins/activitypub/build/following/render.php
Normal 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
@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('@wordpress/interactivity'), 'version' => '94e5efb023ccc7caf799', 'type' => 'module');
|
||||
1
wp-content/plugins/activitypub/build/following/view.js
Normal file
1
wp-content/plugins/activitypub/build/following/view.js
Normal 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}}})}();
|
||||
Reference in New Issue
Block a user