Skip to content
Open
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
ffcade5
Add initial carousel content selection interface
philcable Apr 7, 2025
f27bce7
Add initial block controls
philcable Apr 7, 2025
f67d2f2
Add initial styles for gallery carousels
philcable Mar 25, 2025
55c347d
Add initial handling for uncropped galleries
philcable Apr 1, 2025
bc33cd8
Add initial front-end functionality
philcable Apr 10, 2025
7b257f7
Fix default item gap
philcable Apr 14, 2025
717a141
Merge pull request #51 from a8cteam51/feature/17-gallery
philcable Apr 14, 2025
57b00db
Fix plugin description
philcable Apr 14, 2025
1a6744d
Add initial arrow button position handling
philcable Apr 16, 2025
1dbe0f2
Merge pull request #53 from a8cteam51/feature/17-block-settings
philcable Apr 16, 2025
61b1a47
Add support for arbitrary cards
philcable Apr 16, 2025
492fb2f
Update itemCount logic to accommodate arbitrary cards
philcable Apr 17, 2025
9aaee68
Fix carousel block selectability
philcable Apr 17, 2025
68cdd04
Improve gap style handling
philcable Apr 17, 2025
ac06939
Merge pull request #54 from a8cteam51/feature/17-cards
philcable Apr 17, 2025
f00bb60
Add PHP rendering
philcable Apr 16, 2025
949ad2a
Clean up view script
philcable Apr 17, 2025
7dfd226
Merge pull request #56 from a8cteam51/feature/17-render
philcable Apr 17, 2025
70bd6f1
Ensure all files are included on `wp-scripts plugin-zip`
jeremyfelt Apr 21, 2025
bc96b25
Don't check wp.org for updates to this plugin slug
jeremyfelt Apr 21, 2025
8fdf81a
Merge pull request #57 from jeremyfelt/fix/add-auto-update-class
philcable Apr 21, 2025
079480b
Add initial drag/swipe handling
philcable Apr 21, 2025
177bc5d
Merge pull request #58 from a8cteam51/feature/17-swipe
philcable Apr 21, 2025
66d9ccb
Add support for a title for screen reader users
philcable Apr 22, 2025
69840c8
Merge pull request #59 from a8cteam51/fix/17-title
philcable Apr 22, 2025
7ff08b8
Remove escaping from carousel content
philcable Apr 23, 2025
e9505ec
Merge pull request #61 from a8cteam51/fix/17-content-escaping
philcable Apr 23, 2025
70e04a6
Add an animation speed control
philcable Apr 23, 2025
7f154d8
Merge pull request #62 from a8cteam51/feature/17-speed-option
philcable Apr 23, 2025
c2ab57b
Improve drag navigation handling
philcable Apr 24, 2025
8f7581c
Merge pull request #63 from a8cteam51/fix/swipe-tolerance
philcable Apr 24, 2025
ac9fcf5
Add a control for selecting slideshow end behavior
philcable Apr 24, 2025
fa97549
Add initial infinite scroll handling
philcable Apr 24, 2025
a6b2d40
Disable pagination buttons when infinite scroll is selected
philcable Apr 24, 2025
79d5115
Ensure transitionend listener is cleaned up after animating slides
philcable Apr 24, 2025
1caeddc
Merge pull request #64 from a8cteam51/feature/infinite-loop
philcable Apr 24, 2025
224bf4f
Ensure that grid area style is applied to the correct selectors
philcable Apr 25, 2025
30ae4a2
Disable "Go back to first slide" option until support for it is added
philcable Apr 25, 2025
051da4b
Fix track selector for post carousels
philcable Apr 25, 2025
ac6ccfd
Improve column gap handling
philcable Apr 25, 2025
dc960e6
Merge pull request #65 from a8cteam51/fix/17-posts-track
philcable Apr 25, 2025
563ef4f
Fix undefined variable issue
philcable Apr 28, 2025
3a9478f
Merge pull request #66 from a8cteam51/fix/17-get-item-gap
philcable Apr 28, 2025
a3e1dd3
Ensure that children of non-visible slides can't be focused
philcable Apr 28, 2025
81baddb
Ensure that focus is reset if lost during the slide animation
philcable Apr 28, 2025
954009b
Merge pull request #67 from a8cteam51/fix/17-slide-focus
philcable Apr 28, 2025
22bf6b2
Refactor carousel nav buttons as a block
philcable May 1, 2025
da72fa5
Refactor carousel pagination buttons as a block
philcable May 6, 2025
1be8109
Adjust styles to improve editor experience
philcable May 6, 2025
1f3073c
Add layout support to the carousel block
philcable May 6, 2025
6ee3b95
Fix track container name
philcable May 7, 2025
d9495b4
Improve navigation and pagination block controls
philcable May 13, 2025
87760d7
Ensure navigation works when prev/next buttons aren't in place
philcable May 13, 2025
a0f404f
Adjust alignment support
philcable May 20, 2025
0ba1a8a
Remove convulted gallery handling and introduce a track height control
philcable May 20, 2025
acdedc0
Update arbitrary card handling
philcable May 20, 2025
4333016
Update navigation and button block color controls
philcable May 22, 2025
916f637
Accommodate nesting
philcable May 22, 2025
6bfab33
Improve pagination button handling
philcable May 22, 2025
b3fb954
Display track height control only for gallery carousels
philcable May 22, 2025
b993e48
Adjust selector for query and product collection display in editor
philcable May 22, 2025
1a7c73f
Allow custom icons for the navigation buttons
philcable May 27, 2025
9c61069
Merge pull request #68 from a8cteam51/feature/17-buttons
philcable Jun 5, 2025
d8c0555
Fix check for product collection block
philcable Jun 5, 2025
c52e2ff
Fix selector for Product Collection block
philcable Jun 5, 2025
6d09ac2
Merge pull request #72 from a8cteam51/feature/17-woocommerce-quick-fixes
philcable Jun 5, 2025
879a6cf
Add back to beginning/end option
philcable Jul 21, 2025
5528675
Divest from experimental components for track height control
philcable Jul 22, 2025
15bcabc
Update NPM packages
philcable Jul 22, 2025
ad582f7
Update readme.txt
philcable Jul 22, 2025
2d456c8
Add styles for left and right overflow options
philcable Jul 22, 2025
d1b6a65
Validate JSON and check required fields in self_update() function
philcable Jul 22, 2025
429deb1
Update block description and readme file
philcable Jul 22, 2025
8402abb
Incorporate coderabbit suggestions
philcable Jul 22, 2025
34d3c02
Update disabled pagination button styles
philcable Jul 23, 2025
6cf10ca
Add handling for pagination button states
philcable Jul 23, 2025
696f002
Update Author and Update URI
philcable Jul 29, 2025
cdc22ba
Refactor to better handle infinite mode
philcable Aug 4, 2025
832f2a1
Refactor view script
philcable Aug 11, 2025
3d6becb
Fix clip path on overflow right rule
philcable Aug 13, 2025
1b4f2ef
Adjust flex rules for individual slides
philcable Sep 2, 2025
b726b7b
Merge pull request #84 from a8cteam51/feature/17-carousel-refac
philcable Sep 2, 2025
2d978df
Implement a common selector for the carousel track
philcable Sep 15, 2025
3482b61
Merge pull request #102 from a8cteam51/fix/17-carousel-track-selector
philcable Sep 15, 2025
406e54f
Fix Sticky handling in item count logic
philcable Sep 23, 2025
3ac215f
Ensure accuracy of the `--item-count` CSS variable on the front-end
philcable Sep 23, 2025
1af3a24
Add a meta name to all track blocks
philcable Sep 23, 2025
bf33f6f
Merge pull request #104 from a8cteam51/fix/17-item-count
philcable Sep 29, 2025
28c32c3
Fix bugs and remove dead code
philcable Feb 20, 2026
0691b3f
Improve front-end i18n and accessibility
philcable Feb 20, 2026
a43b4e8
Update Carousel Nav block icon
philcable Feb 20, 2026
88a0038
Update NPM packages, add an eslint config
philcable Feb 23, 2026
940a754
Support third-party blocks as carousel tracks
philcable Feb 23, 2026
ec561dc
Fix WooCommerce Product Collection variation handling
philcable Feb 23, 2026
95c5252
Improve item count in editor for third-party carousel tracks
philcable Feb 23, 2026
8f1858e
Merge pull request #124 from a8cteam51/feature/17-carousel-extensibility
philcable Feb 23, 2026
e664c44
Fix carousel block slug and namespace
philcable Feb 25, 2026
5db78aa
Fix Query block variation
philcable Feb 26, 2026
f2521ed
Update files included in plugin zip
philcable Mar 3, 2026
09a74c9
Update changelog
philcable Mar 3, 2026
2bf54d8
Update project version
philcable Mar 3, 2026
d42d005
Merge pull request #146 from a8cteam51/fix/17-carousel-slug-and-ns
philcable Mar 3, 2026
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
18 changes: 18 additions & 0 deletions carousel/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[*.{yml,yaml}]
indent_style = space
indent_size = 2
30 changes: 30 additions & 0 deletions carousel/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Coverage directory used by tools like istanbul
coverage

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Output of `npm pack`
*.tgz

# Output of `wp-scripts plugin-zip`
*.zip

# dotenv environment variables file
.env
Empty file added carousel/CHANGELOG.md
Empty file.
90 changes: 90 additions & 0 deletions carousel/carousel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?php
/**
* Plugin Name: Carousel
* Description: Display a horizontal series of content.
* Version: 0.1.1
* Requires at least: 6.7
* Requires PHP: 8.0
* Author: The WordPress Contributors
* Author URI: https://wpspecialprojects.wordpress.com/
* Update URI: https://opsoasis.wpspecialprojects.com/carousel/
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: carousel
*
* @package wpcomsp
*/

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}

// If no other WPCOMSP Block Plugin added the self update class, add it.
if ( ! class_exists( 'WPCOMSP_Blocks_Self_Update' ) ) {
require __DIR__ . '/classes/class-wpcomsp-blocks-self-update.php';

$wpcomsp_blocks_self_update = WPCOMSP_Blocks_Self_Update::get_instance();
$wpcomsp_blocks_self_update->hooks();
}

/**
* Setup auto-updates for this plugin from our monorepo.
* Done in an anonymous function for simplicity in making this a drop-in snippet.
*
* @param array $blocks Array of plugin files.
*
* @return array
*/
add_filter(
'wpcomsp_installed_blocks',
function ( $blocks ) {
$plugin_data = get_plugin_data( __FILE__ );

// Add the plugin slug here to enable autoupdates.
$blocks[] = 'carousel';

return $blocks;
}
);

/**
* Registers the block using a `blocks-manifest.php` file, which improves the performance of block type registration.
* Behind the scenes, it also registers all assets so they can be enqueued
* through the block editor in the corresponding context.
*
* @see https://make.wordpress.org/core/2025/03/13/more-efficient-block-type-registration-in-6-8/
* @see https://make.wordpress.org/core/2024/10/17/new-block-type-registration-apis-to-improve-performance-in-wordpress-6-7/
*/
function a8csp_carousel_block_init() {
/**
* Registers the block(s) metadata from the `blocks-manifest.php` and registers the block type(s)
* based on the registered block metadata.
* Added in WordPress 6.8 to simplify the block metadata registration process added in WordPress 6.7.
*
* @see https://make.wordpress.org/core/2025/03/13/more-efficient-block-type-registration-in-6-8/
*/
if ( function_exists( 'wp_register_block_types_from_metadata_collection' ) ) {
wp_register_block_types_from_metadata_collection( __DIR__ . '/build', __DIR__ . '/build/blocks-manifest.php' );
return;
}

/**
* Registers the block(s) metadata from the `blocks-manifest.php` file.
* Added to WordPress 6.7 to improve the performance of block type registration.
*
* @see https://make.wordpress.org/core/2024/10/17/new-block-type-registration-apis-to-improve-performance-in-wordpress-6-7/
*/
if ( function_exists( 'wp_register_block_metadata_collection' ) ) {
wp_register_block_metadata_collection( __DIR__ . '/build', __DIR__ . '/build/blocks-manifest.php' );
}
/**
* Registers the block type(s) in the `blocks-manifest.php` file.
*
* @see https://developer.wordpress.org/reference/functions/register_block_type/
*/
$manifest_data = require __DIR__ . '/build/blocks-manifest.php';
foreach ( array_keys( $manifest_data ) as $block_type ) {
register_block_type( __DIR__ . "/build/{$block_type}" );
}
}
add_action( 'init', 'a8csp_carousel_block_init' );
85 changes: 85 additions & 0 deletions carousel/classes/class-wpcomsp-blocks-self-update.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php
/**
* Plugin Autoupdate Filter Self Update class.
* sets up autoupdates for this GitHub-hosted plugin.
*
* @package wpcomsp
*/

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}

class WPCOMSP_Blocks_Self_Update {

public static $instance;

/**
* Get instance of this class.
*
* @return WPCOMSP_Blocks_Self_Update
*/
public static function get_instance() {
if ( ! self::$instance ) {
self::$instance = new self();
}

return self::$instance;
}

/**
* Initialize WordPress hooks
*/
public function hooks() {
add_filter( 'update_plugins_opsoasis.wpspecialprojects.com', array( $this, 'self_update' ), 10, 3 );
}

/**
* Check for updates to this plugin
*
* @param array $update Array of update data.
* @param array $plugin_data Array of plugin data.
* @param string $plugin_file Path to plugin file.
*
* @return array|bool Array of update data or false if no update available.
*/
public function self_update( $update, array $plugin_data, string $plugin_file ) {
// Already completed update check elsewhere.
if ( ! empty( $update ) ) {
return $update;
}

$plugin_filename_parts = explode( '/', $plugin_file );

// Ask opsoasis.mystagingwebsite.com if there's an update.
$response = wp_remote_get(
'https://opsoasis.wpspecialprojects.com/wp-json/opsoasis-blocks-version-manager/v1/update-check',
array(
'body' => array(
'plugin' => $plugin_filename_parts[0],
'version' => $plugin_data['Version'],
),
)
);

// Bail if this plugin wasn't found on opsoasis.mystagingwebsite.com.
if ( 404 === wp_remote_retrieve_response_code( $response ) || 202 === wp_remote_retrieve_response_code( $response ) ) {
return $update;
}

$updated_version = wp_remote_retrieve_body( $response );
$updated_array = json_decode( $updated_version, true );

// Validate JSON and required fields.
if ( ! is_array( $updated_array ) || ! isset( $updated_array['slug'], $updated_array['version'], $updated_array['package_url'] ) ) {
return $update;
}

return array(
'slug' => $updated_array['slug'],
'version' => $updated_array['version'],
'url' => $updated_array['package_url'],
'package' => $updated_array['package_url'],
);
}
}
Loading