Skip to content

Commit c4562c4

Browse files
authored
Federated Reply: Use Core Embed block (#2129)
1 parent 3cc821b commit c4562c4

File tree

14 files changed

+155
-608
lines changed

14 files changed

+155
-608
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: changed
3+
4+
Refactored Reply block to use WordPress core embed functionality for better compatibility and performance.

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ vendor
77

88
# Temporary ignores while breaking out each component.
99
assets
10-
src/reply
1110
src/reply-intent

activitypub.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ function rest_init() {
5555
( new Rest\Outbox_Controller() )->register_routes();
5656
( new Rest\Post_Controller() )->register_routes();
5757
( new Rest\Replies_Controller() )->register_routes();
58-
( new Rest\URL_Validator_Controller() )->register_routes();
5958
( new Rest\Webfinger_Controller() )->register_routes();
6059

6160
// Load NodeInfo endpoints only if blog is public.

build/reply/block.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
"html": false,
1212
"inserter": true,
1313
"reusable": false,
14-
"lock": false
14+
"lock": false,
15+
"innerBlocks": {
16+
"allowedBlocks": [
17+
"core/embed"
18+
]
19+
}
1520
},
1621
"textdomain": "activitypub",
1722
"editorScript": "file:./index.js",

build/reply/index.asset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'e4cc0f6ffd681f4d678d');
1+
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'b24c13a1511313a54eb6');

build/reply/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/reply/style-index-rtl.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/reply/style-index.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/class-blocks.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ public static function render_reply_block( $attrs ) {
255255
$embed = wp_oembed_get( $attrs['url'] );
256256
if ( $embed ) {
257257
$html .= $embed;
258+
\wp_enqueue_script( 'wp-embed' );
258259
}
259260
}
260261

@@ -301,7 +302,7 @@ class="activitypub-modal__overlay<?php echo \esc_attr( $args['is_compact'] ? ' c
301302
<div class="activitypub-modal__frame">
302303
<?php if ( ! $args['is_compact'] || ! empty( $args['title'] ) ) : ?>
303304
<div class="activitypub-modal__header">
304-
<h2
305+
<h2
305306
class="activitypub-modal__title"
306307
<?php if ( ! empty( $args['id'] ) ) : ?>
307308
id="<?php echo \esc_attr( $args['id'] . '-title' ); ?>"

0 commit comments

Comments
 (0)