Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reply Block: Embed referenced post when possible #1100

Open
wants to merge 75 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
77ac01f
Reply Block: Embed referenced post when possible
obenland Dec 18, 2024
38e866b
some small refactorings
pfefferle Dec 19, 2024
3db22d2
Add support for Activitypub JSON
obenland Dec 19, 2024
797e93e
Try oembed first.
obenland Dec 19, 2024
fd5b328
Merge branch 'trunk' into add/oembed-reply-block
pfefferle Dec 19, 2024
ab2e708
Use get_remote_object() to, well, get the remote objects
obenland Dec 19, 2024
387e008
Set out embed template into its own template
obenland Dec 19, 2024
83c75be
Merge branch 'trunk' into add/oembed-reply-block
pfefferle Dec 23, 2024
7ba6345
Update readme.txt
pfefferle Dec 23, 2024
2d17d44
Merge branch 'trunk' into add/oembed-reply-block
pfefferle Jan 10, 2025
59d154b
Added some microformats
pfefferle Jan 10, 2025
877ac1f
Merge branch 'trunk' into add/oembed-reply-block
pfefferle Feb 5, 2025
3b51ab6
fix changelog
pfefferle Feb 5, 2025
fefc320
Merge branch 'trunk' into add/oembed-reply-block
pfefferle Feb 14, 2025
c2e8483
Add an embed setting
obenland Feb 14, 2025
2db96d3
Move to Inspector
obenland Feb 14, 2025
aaac07b
Add migrate
obenland Feb 14, 2025
861dac8
Default to false
obenland Feb 14, 2025
d737d42
build
obenland Feb 14, 2025
ed3fa18
Default to true, legacy false
mattwiebe Feb 14, 2025
402c344
built files
mattwiebe Feb 14, 2025
bb20ea9
Merge branch 'trunk' into add/oembed-reply-block
mattwiebe Feb 14, 2025
24a070d
nothing to see here
mattwiebe Feb 14, 2025
1ab52cb
Fix tests
obenland Feb 14, 2025
eeada46
Merge branch 'trunk' into add/oembed-reply-block
pfefferle Feb 17, 2025
cae5180
Merge branch 'trunk' into add/oembed-reply-block
pfefferle Feb 17, 2025
56af483
default to true
mattwiebe Feb 18, 2025
4b8d181
Merge branch 'trunk' into add/oembed-reply-block
mattwiebe Feb 18, 2025
f14fee9
Show embed previews in the Editor
mattwiebe Feb 19, 2025
6151b3c
Merge remote-tracking branch 'origin/add/oembed-reply-block' into add…
mattwiebe Feb 19, 2025
8808f92
use REST namespace
mattwiebe Feb 19, 2025
0382d7e
Merge branch 'trunk' into add/oembed-reply-block
mattwiebe Feb 19, 2025
e4dc696
Use core embeds as much as possible
mattwiebe Feb 20, 2025
9b09ffa
Merge branch 'trunk' into add/oembed-reply-block
mattwiebe Feb 20, 2025
8fb1789
Account for proxy response being an object
obenland Feb 20, 2025
ea04b02
UX fit and finish
mattwiebe Feb 20, 2025
2b6fea5
Merge branch 'trunk' into add/oembed-reply-block
mattwiebe Feb 20, 2025
17db76f
Might this be the key to defaults?
obenland Feb 20, 2025
9d0686a
return early and empty with no url
mattwiebe Feb 20, 2025
8e122eb
Merge remote-tracking branch 'origin/add/oembed-reply-block' into add…
mattwiebe Feb 20, 2025
deb21a2
fix tests
mattwiebe Feb 20, 2025
1e4a6c2
Merge branch 'trunk' into add/oembed-reply-block
mattwiebe Feb 21, 2025
7809d3a
UX fit and finish ✨
mattwiebe Feb 21, 2025
069b37c
The long way around to only ActivityPub embeds supported.
mattwiebe Feb 22, 2025
79d3027
lint and stray var_dump
mattwiebe Feb 22, 2025
4e8848c
more stray debugs
mattwiebe Feb 22, 2025
aeff510
fix embed test
mattwiebe Feb 22, 2025
586681a
lint brush
mattwiebe Feb 22, 2025
6279a01
Optimistic embedding when appropriate
mattwiebe Feb 22, 2025
a1e40e3
Merge branch 'trunk' into add/oembed-reply-block
mattwiebe Feb 24, 2025
71364da
Use webfinger style identifiers rather than URLs in embed
mattwiebe Feb 24, 2025
c7bfaf9
better labels, loading states
mattwiebe Feb 25, 2025
c3e772f
Merge remote-tracking branch 'origin/add/oembed-reply-block' into add…
mattwiebe Feb 25, 2025
22be389
Don't render reply block in federated replies
mattwiebe Feb 25, 2025
daa7f6a
Merge remote-tracking branch 'origin/trunk' into add/oembed-reply-block
mattwiebe Feb 25, 2025
08bbd8e
Generate @-reply markup for reply block when federating
mattwiebe Feb 25, 2025
9c15956
Merge branch 'trunk' into add/oembed-reply-block
obenland Feb 27, 2025
90484cf
Improve Rest Controller implementation
mattwiebe Feb 27, 2025
2b163be
Use real oEmbed as much as possible, and consistently
mattwiebe Feb 27, 2025
1a964e4
Merge remote-tracking branch 'origin/add/oembed-reply-block' into add…
mattwiebe Feb 27, 2025
35e7a3f
Merge branch 'trunk' into add/oembed-reply-block
mattwiebe Mar 3, 2025
8885f18
update bookmarklet flow to prefer embeds
mattwiebe Mar 3, 2025
98f3d67
Rest: Replace URL checks with built-in sanitization
obenland Mar 4, 2025
4fb1ec5
Minor cleanup
obenland Mar 4, 2025
ee25c8d
Add schema
obenland Mar 4, 2025
63af552
Alphabetize
obenland Mar 4, 2025
4e77606
Handle oEmbed ourselves, the block was causing trouble
mattwiebe Mar 4, 2025
90c1785
Ensure ActivityPub markup is always available
mattwiebe Mar 4, 2025
d9ba977
Merge remote-tracking branch 'origin/add/oembed-reply-block' into add…
mattwiebe Mar 4, 2025
265c180
Merge branch 'trunk' into add/oembed-reply-block
mattwiebe Mar 4, 2025
dbe7243
lint
mattwiebe Mar 4, 2025
df7f653
Merge remote-tracking branch 'origin/add/oembed-reply-block' into add…
mattwiebe Mar 4, 2025
963e09f
remove `embed_get`
mattwiebe Mar 4, 2025
7b8fc8f
Embed class tests
mattwiebe Mar 4, 2025
3f9b7b8
Merge branch 'trunk' into add/oembed-reply-block
mattwiebe Mar 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Allow omitting replies in ActivityPub representations instead of setting them as empty.
* Allow Base Transformer to handle WP_Term objects for transformation.
* Improved Query extensibility for third party plugins.
* The Reply block now shows an embedded version of the referenced post, if available.

### Fixed

Expand Down
1 change: 1 addition & 0 deletions activitypub.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function rest_init() {
Rest\Inbox::init();
Rest\Server::init();
Rest\Post::init();
( new Rest\URL_Validator_Controller() )->register_routes();
( new Rest\Actors_Controller() )->register_routes();
( new Rest\Application_Controller() )->register_routes();
( new Rest\Collections_Controller() )->register_routes();
Expand Down
106 changes: 106 additions & 0 deletions assets/css/activitypub-embed.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/**
* ActivityPub embed styles.
*/

.activitypub-embed {
background: #fff;
border: 1px solid #e6e6e6;
border-radius: 12px;
margin: 1em 0;
padding: 0;
max-width: 100%;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.activitypub-embed-header {
padding: 15px;
display: flex;
align-items: center;
gap: 10px;
}

.activitypub-embed-header img {
width: 48px;
height: 48px;
border-radius: 50%;
}

.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 {
font-size: 23px;
font-weight: 600;
margin: 0 0 10px;
padding: 0;
color: #000;
}

.activitypub-embed-content .ap-subtitle {
font-size: 15px;
color: #000;
margin: 0 0 15px;
}

.activitypub-embed-content .ap-preview {
border: 1px solid #e6e6e6;
border-radius: 8px;
overflow: hidden;
}

.activitypub-embed-content .ap-preview img {
width: 100%;
height: auto;
display: block;
}

.activitypub-embed-content .ap-preview-text {
padding: 15px;
}

.activitypub-embed-meta {
padding: 15px;
border-top: 1px solid #e6e6e6;
color: #687684;
font-size: 13px;
display: flex;
gap: 15px;
}

.activitypub-embed-meta .ap-stat {
display: flex;
align-items: center;
gap: 5px;
}

.activitypub-embed-meta a.ap-stat {
text-decoration: none;
}

.activitypub-embed-meta strong {
font-weight: 600;
color: #000;
}

.activitypub-embed-meta .ap-stat-label {
color: #687684;
}
2 changes: 1 addition & 1 deletion build/follow-me/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '37fe71b93359e27fe42a');
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '312dfda65910e13c045d');
4 changes: 2 additions & 2 deletions build/follow-me/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/follow-me/view.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '91c0e513a192990d783c');
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '23b8c0ea643db71e16b0');
2 changes: 1 addition & 1 deletion build/follow-me/view.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/followers/view.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '34299fc181d49292ada0');
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => 'c195c94d414df10e8b6a');
6 changes: 3 additions & 3 deletions build/followers/view.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/reactions/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '2ff24f7290aed1fc43f8');
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'af8b65b2e9159308a4b0');
Loading
Loading