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.9 11.9.1 11.9.2 11.9.3 12.0 12.0.1 12.0.2 12.1 12.1.1 12.1.2 12.2 12.2.1 12.2.2 12.3 12.3.1 12.4 12.4.1 12.5 12.5.1 12.6 12.6.1 12.6.2 12.6.3 12.7 12.7.1 12.7.2 12.8 12.8.1 12.8.2 12.9 12.9.1 12.9.2 12.9.3 12.9.4 13.0 13.0.1 13.1 13.1.1 13.1.2 13.1.3 13.1.4 13.2 13.2.1 13.2.2 13.2.3 13.3 13.3.1 13.3.2 13.4 13.4.1 13.4.2 13.4.3 13.4.4 13.5 13.5.1 13.6 13.6.1 13.7 13.7.1 13.8 13.8.1 13.8.2 13.9 13.9.1 14.0 14.1 14.2 14.2.1 14.3 14.4 14.4.1 14.5 14.6 14.7 14.8 14.9 14.9.1 15.0 15.0.1 15.0.2 15.1 15.1.1 15.2 15.3 15.3.1 15.4 15.5 15.6 15.7 15.7-a.1 15.7-a.3 15.7-a.5 15.7-a.7 15.7-beta
jetpack / class.jetpack-gutenberg.php
jetpack Last commit date
3rd-party 7 years ago _inc 6 years ago bin 7 years ago css 7 years ago images 6 years ago json-endpoints 7 years ago languages 7 years ago modules 5 years ago sal 7 years ago scss 7 years ago sync 7 years ago views 7 years ago .svnignore 12 years ago CODE-OF-CONDUCT.md 9 years ago changelog.txt 7 years ago class.frame-nonce-preview.php 9 years ago class.jetpack-admin.php 7 years ago class.jetpack-affiliate.php 7 years ago class.jetpack-autoupdate.php 8 years ago class.jetpack-bbpress-json-api-compat.php 9 years ago class.jetpack-cli.php 7 years ago class.jetpack-client-server.php 8 years ago class.jetpack-client.php 7 years ago class.jetpack-connection-banner.php 7 years ago class.jetpack-constants.php 8 years ago class.jetpack-data.php 7 years ago class.jetpack-debugger.php 7 years ago class.jetpack-error.php 10 years ago class.jetpack-gutenberg.php 7 years ago class.jetpack-heartbeat.php 7 years ago class.jetpack-idc.php 8 years ago class.jetpack-ixr-client.php 10 years ago class.jetpack-jitm.php 7 years ago class.jetpack-modules-list-table.php 8 years ago class.jetpack-network-sites-list-table.php 9 years ago class.jetpack-network.php 7 years ago class.jetpack-options.php 7 years ago class.jetpack-post-images.php 7 years ago class.jetpack-signature.php 7 years ago class.jetpack-tracks.php 8 years ago class.jetpack-twitter-cards.php 7 years ago class.jetpack-user-agent.php 8 years ago class.jetpack-xmlrpc-server.php 7 years ago class.jetpack.php 7 years ago class.json-api-endpoints.php 7 years ago class.json-api.php 7 years ago class.photon.php 7 years ago composer.json 7 years ago functions.compat.php 7 years ago functions.gallery.php 8 years ago functions.global.php 7 years ago functions.opengraph.php 7 years ago functions.photon.php 8 years ago jetpack.php 5 years ago json-api-config.php 10 years ago json-endpoints.php 7 years ago locales.php 7 years ago readme.txt 5 years ago require-lib.php 7 years ago uninstall.php 8 years ago wpml-config.xml 10 years ago
class.jetpack-gutenberg.php
512 lines
1 <?php
2 /**
3 * Handles server-side registration and use of all blocks and plugins available in Jetpack for the block editor, aka Gutenberg.
4 * Works in tandem with client-side block registration via `index.json`
5 *
6 * @package Jetpack
7 */
8
9 /**
10 * Helper function to register a Jetpack Gutenberg block
11 *
12 * @param string $slug Slug of the block.
13 * @param array $args Arguments that are passed into register_block_type.
14 *
15 * @see register_block_type
16 *
17 * @since 6.7.0
18 *
19 * @return void
20 */
21 function jetpack_register_block( $slug, $args = array() ) {
22 Jetpack_Gutenberg::register_block( $slug, $args );
23 }
24
25 /**
26 * Helper function to register a Jetpack Gutenberg plugin
27 *
28 * @param string $slug Slug of the plugin.
29 *
30 * @since 6.9.0
31 *
32 * @return void
33 */
34 function jetpack_register_plugin( $slug ) {
35 Jetpack_Gutenberg::register_plugin( $slug );
36 }
37
38 /**
39 * Set the reason why an extension (block or plugin) is unavailable
40 *
41 * @param string $slug Slug of the block.
42 * @param string $reason A string representation of why the extension is unavailable.
43 *
44 * @since 7.0.0
45 *
46 * @return void
47 */
48 function jetpack_set_extension_unavailability_reason( $slug, $reason ) {
49 Jetpack_Gutenberg::set_extension_unavailability_reason( $slug, $reason );
50 }
51
52 /**
53 * General Gutenberg editor specific functionality
54 */
55 class Jetpack_Gutenberg {
56
57 /**
58 * Only these extensions can be registered. Used to control availability of beta blocks.
59 *
60 * @var array Extensions whitelist
61 */
62 private static $extensions = array();
63
64 /**
65 * Keeps track of the reasons why a given extension is unavailable.
66 *
67 * @var array Extensions availability information
68 */
69 private static $availability = array();
70
71 /**
72 * Since there is no `register_plugin()` counterpart to `register_block_type()` in Gutenberg,
73 * we have to keep track of plugin registration ourselves
74 *
75 * @var array Plugin registry
76 */
77 private static $registered_plugins = array();
78
79 /**
80 * Prepend the 'jetpack/' prefix to a block name
81 *
82 * @param string $block_name The block name.
83 *
84 * @return string The prefixed block name.
85 */
86 private static function prepend_block_prefix( $block_name ) {
87 return 'jetpack/' . $block_name;
88 }
89
90 /**
91 * Whether two arrays share at least one item
92 *
93 * @param array $a An array.
94 * @param array $b Another array.
95 *
96 * @return boolean True if $a and $b share at least one item
97 */
98 protected static function share_items( $a, $b ) {
99 return count( array_intersect( $a, $b ) ) > 0;
100 }
101
102 /**
103 * Register a block
104 *
105 * If the block isn't whitelisted, set its unavailability reason instead.
106 *
107 * @param string $slug Slug of the block.
108 * @param array $args Arguments that are passed into register_block_type().
109 */
110 public static function register_block( $slug, $args ) {
111 $prefixed_extensions = array_map( array( __CLASS__, 'prepend_block_prefix' ), self::$extensions );
112
113 // Register the block if it's whitelisted, or if it's a child block, and one of its parents is whitelisted.
114 if ( in_array( $slug, self::$extensions, true ) || ( isset( $args['parent'] ) && self::share_items( $args['parent'], $prefixed_extensions ) ) ) {
115 register_block_type( 'jetpack/' . $slug, $args );
116 } elseif ( ! isset( $args['parent'] ) ) {
117 // Don't set availability information for child blocks -- we infer it from their parents.
118 self::set_extension_unavailability_reason( $slug, 'not_whitelisted' );
119 }
120 }
121
122 /**
123 * Register a plugin
124 *
125 * If the plugin isn't whitelisted, set its unavailability reason instead.
126 *
127 * @param string $slug Slug of the plugin.
128 */
129 public static function register_plugin( $slug ) {
130 if ( in_array( $slug, self::$extensions, true ) ) {
131 self::$registered_plugins[] = 'jetpack-' . $slug;
132 } else {
133 self::set_extension_unavailability_reason( $slug, 'not_whitelisted' );
134 }
135 }
136
137 /**
138 * Register a block
139 *
140 * @deprecated 7.0.0 Use register_block() instead
141 *
142 * @param string $slug Slug of the block.
143 * @param array $args Arguments that are passed into the register_block_type.
144 * @param array $availability array containing if a block is available and the reason when it is not.
145 */
146 public static function register( $slug, $args, $availability ) {
147 if ( isset( $availability['available'] ) && ! $availability['available'] ) {
148 self::set_extension_unavailability_reason( $slug, $availability['unavailable_reason'] );
149 } else {
150 self::register_block( $slug, $args );
151 }
152 }
153
154 /**
155 * Set the reason why an extension (block or plugin) is unavailable
156 *
157 * @param string $slug Slug of the extension.
158 * @param string $reason A string representation of why the extension is unavailable.
159 */
160 public static function set_extension_unavailability_reason( $slug, $reason ) {
161 self::$availability[ $slug ] = $reason;
162 }
163
164 /**
165 * Set up a whitelist of allowed block editor extensions
166 *
167 * @return void
168 */
169 public static function init() {
170 if ( ! self::is_gutenberg_available() ) {
171 return;
172 }
173
174 if ( ! self::should_load() ) {
175 return;
176 }
177
178 /**
179 * Alternative to `JETPACK_BETA_BLOCKS`, set to `true` to load Beta Blocks.
180 *
181 * @since 6.9.0
182 *
183 * @param boolean
184 */
185 if ( apply_filters( 'jetpack_load_beta_blocks', false ) ) {
186 Jetpack_Constants::set_constant( 'JETPACK_BETA_BLOCKS', true );
187 }
188
189 /**
190 * Filter the whitelist of block editor extensions that are available through Jetpack.
191 *
192 * @since 7.0.0
193 *
194 * @param array
195 */
196 self::$extensions = apply_filters( 'jetpack_set_available_extensions', self::get_jetpack_gutenberg_extensions_whitelist() );
197
198 /**
199 * Filter the whitelist of block editor plugins that are available through Jetpack.
200 *
201 * @deprecated 7.0.0 Use jetpack_set_available_extensions instead
202 *
203 * @since 6.8.0
204 *
205 * @param array
206 */
207 self::$extensions = apply_filters( 'jetpack_set_available_blocks', self::$extensions );
208
209 /**
210 * Filter the whitelist of block editor plugins that are available through Jetpack.
211 *
212 * @deprecated 7.0.0 Use jetpack_set_available_extensions instead
213 *
214 * @since 6.9.0
215 *
216 * @param array
217 */
218 self::$extensions = apply_filters( 'jetpack_set_available_plugins', self::$extensions );
219 }
220
221 /**
222 * Resets the class to its original state
223 *
224 * Used in unit tests
225 *
226 * @return void
227 */
228 public static function reset() {
229 self::$extensions = array();
230 self::$availability = array();
231 self::$registered_plugins = array();
232 }
233
234 /**
235 * Return the Gutenberg extensions (blocks and plugins) directory
236 *
237 * @return string The Gutenberg extensions directory
238 */
239 public static function get_blocks_directory() {
240 /**
241 * Filter to select Gutenberg blocks directory
242 *
243 * @since 6.9.0
244 *
245 * @param string default: '_inc/blocks/'
246 */
247 return apply_filters( 'jetpack_blocks_directory', '_inc/blocks/' );
248 }
249
250 /**
251 * Checks for a given .json file in the blocks folder.
252 *
253 * @param string $preset The name of the .json file to look for.
254 *
255 * @return bool True if the file is found.
256 */
257 public static function preset_exists( $preset ) {
258 return file_exists( JETPACK__PLUGIN_DIR . self::get_blocks_directory() . $preset . '.json' );
259 }
260
261 /**
262 * Decodes JSON loaded from a preset file in the blocks folder
263 *
264 * @param string $preset The name of the .json file to load.
265 *
266 * @return mixed Returns an object if the file is present, or false if a valid .json file is not present.
267 */
268 public static function get_preset( $preset ) {
269 return json_decode( file_get_contents( JETPACK__PLUGIN_DIR . self::get_blocks_directory() . $preset . '.json' ) );
270 }
271
272 /**
273 * Returns a whitelist of Jetpack Gutenberg extensions (blocks and plugins), based on index.json
274 *
275 * @return array A list of blocks: eg [ 'publicize', 'markdown' ]
276 */
277 public static function get_jetpack_gutenberg_extensions_whitelist() {
278 $preset_extensions_manifest = self::preset_exists( 'index' ) ? self::get_preset( 'index' ) : (object) array();
279
280 $preset_extensions = isset( $preset_extensions_manifest->production ) ? (array) $preset_extensions_manifest->production : array();
281
282 if ( Jetpack_Constants::is_true( 'JETPACK_BETA_BLOCKS' ) ) {
283 $beta_extensions = isset( $preset_extensions_manifest->beta ) ? (array) $preset_extensions_manifest->beta : array();
284 return array_unique( array_merge( $preset_extensions, $beta_extensions ) );
285 }
286
287 return $preset_extensions;
288 }
289
290 /**
291 * Get availability of each block / plugin.
292 *
293 * @return array A list of block and plugins and their availablity status
294 */
295 public static function get_availability() {
296
297 /**
298 * Fires before Gutenberg extensions availability is computed.
299 *
300 * In the function call you supply, use `jetpack_register_block()` and `jetpack_register_plugin()`, respectively.
301 * Alternatively, use `jetpack_set_extension_unavailability_reason()` if the block or plugin should not be registered but
302 * marked as unavailable.
303 *
304 * @since 7.0.0
305 */
306 do_action( 'jetpack_register_gutenberg_extensions' );
307
308 $available_extensions = array();
309
310 foreach ( self::$extensions as $extension ) {
311 $is_available = WP_Block_Type_Registry::get_instance()->is_registered( 'jetpack/' . $extension ) ||
312 in_array( 'jetpack-' . $extension, self::$registered_plugins, true );
313
314 $available_extensions[ $extension ] = array(
315 'available' => $is_available,
316 );
317
318 if ( ! $is_available ) {
319 $reason = isset( self::$availability[ $extension ] ) ? self::$availability[ $extension ] : 'missing_module';
320 $available_extensions[ $extension ]['unavailable_reason'] = $reason;
321 }
322 }
323
324 $unwhitelisted = array_fill_keys(
325 array_diff( array_keys( self::$availability ), self::$extensions ),
326 array(
327 'available' => false,
328 'unavailable_reason' => 'not_whitelisted',
329 )
330 );
331
332 return array_merge( $available_extensions, $unwhitelisted );
333 }
334
335 /**
336 * Check if Gutenberg editor is available
337 *
338 * @since 6.7.0
339 *
340 * @return bool
341 */
342 public static function is_gutenberg_available() {
343 return function_exists( 'register_block_type' );
344 }
345
346 /**
347 * Check whether conditions indicate Gutenberg Extensions (blocks and plugins) should be loaded
348 *
349 * Loading blocks and plugins is enabled by default and may be disabled via filter:
350 * add_filter( 'jetpack_gutenberg', '__return_false' );
351 *
352 * @since 6.9.0
353 *
354 * @return bool
355 */
356 public static function should_load() {
357 if ( ! Jetpack::is_active() && ! Jetpack::is_development_mode() ) {
358 return false;
359 }
360
361 /**
362 * Filter to disable Gutenberg blocks
363 *
364 * @since 6.5.0
365 *
366 * @param bool true Whether to load Gutenberg blocks
367 */
368 return (bool) apply_filters( 'jetpack_gutenberg', true );
369 }
370
371 /**
372 * Only enqueue block assets when needed.
373 *
374 * @param string $type slug of the block.
375 * @param array $script_dependencies An array of view-side Javascript dependencies to be enqueued.
376 *
377 * @return void
378 */
379 public static function load_assets_as_required( $type, $script_dependencies = array() ) {
380 if ( is_admin() ) {
381 // A block's view assets will not be required in wp-admin.
382 return;
383 }
384
385 $type = sanitize_title_with_dashes( $type );
386 // Enqueue styles.
387 $style_relative_path = self::get_blocks_directory() . $type . '/view' . ( is_rtl() ? '.rtl' : '' ) . '.css';
388 if ( self::block_has_asset( $style_relative_path ) ) {
389 $style_version = self::get_asset_version( $style_relative_path );
390 $view_style = plugins_url( $style_relative_path, JETPACK__PLUGIN_FILE );
391 wp_enqueue_style( 'jetpack-block-' . $type, $view_style, array(), $style_version );
392 }
393
394 // Enqueue script.
395 $script_relative_path = self::get_blocks_directory() . $type . '/view.js';
396 if ( self::block_has_asset( $script_relative_path ) ) {
397 $script_version = self::get_asset_version( $script_relative_path );
398 $view_script = plugins_url( $script_relative_path, JETPACK__PLUGIN_FILE );
399 wp_enqueue_script( 'jetpack-block-' . $type, $view_script, $script_dependencies, $script_version, false );
400 }
401
402 wp_localize_script(
403 'jetpack-block-' . $type,
404 'Jetpack_Block_Assets_Base_Url',
405 plugins_url( self::get_blocks_directory(), JETPACK__PLUGIN_FILE )
406 );
407 }
408
409 /**
410 * Check if an asset exists for a block.
411 *
412 * @param string $file Path of the file we are looking for.
413 *
414 * @return bool $block_has_asset Does the file exist.
415 */
416 public static function block_has_asset( $file ) {
417 return file_exists( JETPACK__PLUGIN_DIR . $file );
418 }
419
420 /**
421 * Get the version number to use when loading the file. Allows us to bypass cache when developing.
422 *
423 * @param string $file Path of the file we are looking for.
424 *
425 * @return string $script_version Version number.
426 */
427 public static function get_asset_version( $file ) {
428 return Jetpack::is_development_version() && self::block_has_asset( $file )
429 ? filemtime( JETPACK__PLUGIN_DIR . $file )
430 : JETPACK__VERSION;
431 }
432
433 /**
434 * Load Gutenberg editor assets
435 *
436 * @since 6.7.0
437 *
438 * @return void
439 */
440 public static function enqueue_block_editor_assets() {
441 if ( ! self::should_load() ) {
442 return;
443 }
444
445 $rtl = is_rtl() ? '.rtl' : '';
446 $beta = Jetpack_Constants::is_true( 'JETPACK_BETA_BLOCKS' ) ? '-beta' : '';
447 $blocks_dir = self::get_blocks_directory();
448
449 $editor_script = plugins_url( "{$blocks_dir}editor{$beta}.js", JETPACK__PLUGIN_FILE );
450 $editor_style = plugins_url( "{$blocks_dir}editor{$beta}{$rtl}.css", JETPACK__PLUGIN_FILE );
451
452 $version = Jetpack::is_development_version() && file_exists( JETPACK__PLUGIN_DIR . $blocks_dir . 'editor.js' )
453 ? filemtime( JETPACK__PLUGIN_DIR . $blocks_dir . 'editor.js' )
454 : JETPACK__VERSION;
455
456 if ( method_exists( 'Jetpack', 'build_raw_urls' ) ) {
457 $site_fragment = Jetpack::build_raw_urls( home_url() );
458 } elseif ( class_exists( 'WPCOM_Masterbar' ) && method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) {
459 $site_fragment = WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() );
460 } else {
461 $site_fragment = '';
462 }
463
464 wp_enqueue_script(
465 'jetpack-blocks-editor',
466 $editor_script,
467 array(
468 'lodash',
469 'wp-api-fetch',
470 'wp-blob',
471 'wp-blocks',
472 'wp-components',
473 'wp-compose',
474 'wp-data',
475 'wp-date',
476 'wp-edit-post',
477 'wp-editor',
478 'wp-element',
479 'wp-hooks',
480 'wp-i18n',
481 'wp-keycodes',
482 'wp-plugins',
483 'wp-rich-text',
484 'wp-token-list',
485 'wp-url',
486 ),
487 $version,
488 false
489 );
490
491 wp_localize_script(
492 'jetpack-blocks-editor',
493 'Jetpack_Block_Assets_Base_Url',
494 plugins_url( $blocks_dir . '/', JETPACK__PLUGIN_FILE )
495 );
496
497 wp_localize_script(
498 'jetpack-blocks-editor',
499 'Jetpack_Editor_Initial_State',
500 array(
501 'available_blocks' => self::get_availability(),
502 'jetpack' => array( 'is_active' => Jetpack::is_active() ),
503 'siteFragment' => $site_fragment,
504 )
505 );
506
507 Jetpack::setup_wp_i18n_locale_data();
508
509 wp_enqueue_style( 'jetpack-blocks-editor', $editor_style, array(), $version );
510 }
511 }
512