HEX
Server: Apache/2.4.59 (Debian)
System: Linux befbaa421a4c 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64
User: www-data (33)
PHP: 8.2.19
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/waves/blocks/waves.php
<?php

add_action( 'init', function() {
	register_block_type( 'a8c/waves', [
		'editor_script' => 'a8c-waves',
		'style' => 'a8c-waves',
		'editor_style' => 'a8c-waves-editor',
		'render_callback' => function( $attribs, $content ) {
			wp_enqueue_script( 'a8c-waves-js' );
			return $content;
		},
	] );
	wp_register_script(
		'a8c-twgl-js',
		plugins_url( 'twgl/twgl.js', __FILE__ ),
		[], // no dependencies
		filemtime( plugin_dir_path( __FILE__ ) . 'twgl/twgl.js' ),
		true // in footer
	);
	wp_register_script(
		'a8c-waves-js',
		plugins_url( 'waves.js', __FILE__ ),
		[ 'a8c-twgl-js', 'wp-dom-ready' ],
		filemtime( plugin_dir_path( __FILE__ ) . 'waves.js' ),
		true // in footer
	);
} );

add_action( 'enqueue_block_editor_assets', function() {
	wp_enqueue_script( 'a8c-waves-js' );
} );