diff --git a/.distignore b/.distignore new file mode 100644 index 0000000..ab910a6 --- /dev/null +++ b/.distignore @@ -0,0 +1,94 @@ +# Exclude from WordPress.org distribution + +# Git/Version Control +.git/ +.github/ +.gitignore + +# Development Configuration +.browserslistrc +.editorconfig +.eslintignore +.eslintrc +.eslintrc.json +.husky/ +.jscsrc +.jshintignore +.lintstagedrc.js +.npmrc +.nvmrc +.packagejsonignore +.stylelintignore +.stylelintrc.json +babel.config.js +commitlint.config.js +jest.config.js +Makefile +phpcs.xml +phpcs.xml.dist +phpstan.neon +phpstan.neon.dist +phpunit.xml +phpunit.xml.dist +postcss.config.js +tailwind.config.js +tsconfig.json +tsconfig.tsbuildinfo +webpack.config.js + +# Source files (build output is included) +src/ +assets/src/ + +# Tests +tests/ +__tests__/ +bin/ + +# Documentation +docs/ +DEVELOPMENT.md +CONTRIBUTING.md +README.md + +# WordPress.org assets (separate from plugin) +wp-assets/ + +# Dependencies +node_modules/ +vendor/bin +vendor/antecedent +vendor/brain +vendor/hamcrest +vendor/mockery +vendor/myclabs +vendor/nikic +vendor/phar-io +vendor/phpcompatibility +vendor/phpcsstandards +vendor/phpstan +vendor/phpunit +vendor/sebastian +vendor/sirbrillig +vendor/slevomat +vendor/squizlabs +vendor/staabm +vendor/szepeviktor +vendor/theseer +vendor/wpackagist-plugin +vendor/yoast + +# Package files +package.json +package-lock.json +composer.json +composer.lock +blueprint.json + +# Other +*.log +*.map +*.zip +.distignore +.DS_Store +Thumbs.db diff --git a/carousel-kit.php b/carousel-kit.php index 49c5021..7b26232 100644 --- a/carousel-kit.php +++ b/carousel-kit.php @@ -8,7 +8,7 @@ * Author: rtCamp * Author URI: https://rtcamp.com * Contributors: iamdanih17, immasud - * License: GPL2 + * License: GPL-2.0-or-later * License URI: https://www.gnu.org/licenses/gpl-2.0.html * Version: 1.0.3 * Text Domain: carousel-kit @@ -16,6 +16,8 @@ * @package carousel-kit */ +defined( 'ABSPATH' ) || exit; + define( 'CAROUSEL_KIT_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); define( 'CAROUSEL_KIT_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) ); define( 'CAROUSEL_KIT_BUILD_PATH', CAROUSEL_KIT_PATH . '/build' ); diff --git a/composer.json b/composer.json index 5f9aaf6..f9b09df 100644 --- a/composer.json +++ b/composer.json @@ -32,8 +32,7 @@ } ], "require": { - "php": "^8.2", - "scrivo/highlight.php": "^9.18" + "php": "^8.2" }, "require-dev": { "automattic/vipwpcs": "^3.0", diff --git a/composer.lock b/composer.lock index 719a5fd..ca59430 100644 --- a/composer.lock +++ b/composer.lock @@ -4,87 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c807d59c2478e04aa04acd36971c41e8", - "packages": [ - { - "name": "scrivo/highlight.php", - "version": "v9.18.1.10", - "source": { - "type": "git", - "url": "https://github.com/scrivo/highlight.php.git", - "reference": "850f4b44697a2552e892ffe71490ba2733c2fc6e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/scrivo/highlight.php/zipball/850f4b44697a2552e892ffe71490ba2733c2fc6e", - "reference": "850f4b44697a2552e892ffe71490ba2733c2fc6e", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": ">=5.4" - }, - "require-dev": { - "phpunit/phpunit": "^4.8|^5.7", - "sabberworm/php-css-parser": "^8.3", - "symfony/finder": "^2.8|^3.4|^5.4", - "symfony/var-dumper": "^2.8|^3.4|^5.4" - }, - "suggest": { - "ext-mbstring": "Allows highlighting code with unicode characters and supports language with unicode keywords" - }, - "type": "library", - "autoload": { - "files": [ - "HighlightUtilities/functions.php" - ], - "psr-0": { - "Highlight\\": "", - "HighlightUtilities\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Geert Bergman", - "homepage": "http://www.scrivo.org/", - "role": "Project Author" - }, - { - "name": "Vladimir Jimenez", - "homepage": "https://allejo.io", - "role": "Maintainer" - }, - { - "name": "Martin Folkers", - "homepage": "https://twobrain.io", - "role": "Contributor" - } - ], - "description": "Server side syntax highlighter that supports 185 languages. It's a PHP port of highlight.js", - "keywords": [ - "code", - "highlight", - "highlight.js", - "highlight.php", - "syntax" - ], - "support": { - "issues": "https://github.com/scrivo/highlight.php/issues", - "source": "https://github.com/scrivo/highlight.php" - }, - "funding": [ - { - "url": "https://github.com/allejo", - "type": "github" - } - ], - "time": "2022-12-17T21:53:22+00:00" - } - ], + "content-hash": "ce07304be6cef4c520c42700f79bcaee", + "packages": [], "packages-dev": [ { "name": "antecedent/patchwork", diff --git a/index.php b/index.php new file mode 100644 index 0000000..ba0f793 --- /dev/null +++ b/index.php @@ -0,0 +1,7 @@ +\n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"POT-Creation-Date: 2026-02-24T08:22:25+00:00\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"X-Generator: WP-CLI 2.12.0\n" +"X-Domain: carousel-kit\n" + +#. Plugin Name of the plugin +#: carousel-kit.php +#: inc/Plugin.php:71 +#: inc/Plugin.php:121 +msgid "Carousel Kit" +msgstr "" + +#. Plugin URI of the plugin +#: carousel-kit.php +msgid "https://github.com/rtCamp/carousel-kit" +msgstr "" + +#. Description of the plugin +#: carousel-kit.php +msgid "Carousel block using Embla and WordPress Interactivity API." +msgstr "" + +#. Author of the plugin +#: carousel-kit.php +msgid "rtCamp" +msgstr "" + +#. Author URI of the plugin +#: carousel-kit.php +msgid "https://rtcamp.com" +msgstr "" + +#: inc/Plugin.php:122 +msgid "Pre-configured carousel patterns for various use cases." +msgstr "" + +#: src/blocks/carousel/block.json +msgctxt "block title" +msgid "Carousel" +msgstr "" + +#: src/blocks/carousel/block.json +msgctxt "block description" +msgid "Carousel container using Embla and Interactivity API." +msgstr "" + +#: src/blocks/carousel/controls/block.json +msgctxt "block title" +msgid "Carousel Controls" +msgstr "" + +#: src/blocks/carousel/controls/block.json +msgctxt "block description" +msgid "Navigation buttons for the carousel." +msgstr "" + +#: src/blocks/carousel/dots/block.json +msgctxt "block title" +msgid "Carousel Dots" +msgstr "" + +#: src/blocks/carousel/dots/block.json +msgctxt "block description" +msgid "Navigation dots for the carousel." +msgstr "" + +#: src/blocks/carousel/slide/block.json +msgctxt "block title" +msgid "Carousel Slide" +msgstr "" + +#: src/blocks/carousel/slide/block.json +msgctxt "block description" +msgid "A single slide within the carousel." +msgstr "" + +#: src/blocks/carousel/viewport/block.json +msgctxt "block title" +msgid "Carousel Viewport" +msgstr "" + +#: src/blocks/carousel/viewport/block.json +msgctxt "block description" +msgid "Viewport container for carousel slides." +msgstr "" diff --git a/package.json b/package.json index 9268bef..459f061 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,13 @@ "node": "^22.0.0", "npm": "^10.0.0" }, + "repository": { + "type": "git", + "url": "https://github.com/rtCamp/carousel-kit" + }, + "bugs": { + "url": "https://github.com/rtCamp/carousel-kit/issues" + }, "scripts": { "build": "wp-scripts build --experimental-modules --webpack-src-dir=./src --output-path=./build", "start": "wp-scripts start --experimental-modules --webpack-src-dir=./src --output-path=./build", @@ -20,6 +27,7 @@ "lint:php:fix": "composer run-script format", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", "version": "npm run changelog && git add CHANGELOG.md", + "i18n:pot": "wp i18n make-pot . languages/carousel-kit.pot --domain=carousel-kit --exclude=node_modules,vendor,tests --headers='{\"Report-Msgid-Bugs-To\":\"https://github.com/rtCamp/carousel-kit/issues\"}'", "test:actions": "act", "test:js": "wp-scripts test-unit-js", "test:js:watch": "wp-scripts test-unit-js --watch", diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..e6e0239 --- /dev/null +++ b/readme.txt @@ -0,0 +1,106 @@ +=== Carousel Kit === +Contributors: rtcamp, danish17, immasud +Tags: carousel, slider, block, interactivity-api, embla +Requires at least: 6.5 +Tested up to: 6.9 +Requires PHP: 7.4 +Stable tag: 1.0.2 +License: GPL-2.0-or-later +License URI: https://www.gnu.org/licenses/gpl-2.0.html + +A modular, high-performance carousel block for WordPress, powered by the Interactivity API and Embla Carousel. + +== Description == + +**Carousel Kit** is a flexible, accessible carousel block for the WordPress block editor. Build dynamic carousels for posts, testimonials, images, and more—without writing code. + += Features = + +* **Compound Block Architecture** – Mix and match any blocks inside the carousel +* **High Performance** – Powered by Embla Carousel v8 +* **Interactivity API** – Reactive state management with zero hydration overhead +* **Query Loop Support** – Each post in a Query Loop becomes a slide automatically +* **Accessibility** – W3C-compliant roles, labels, and keyboard navigation +* **RTL Support** – Built-in support for Right-to-Left languages + += Block Components = + +1. **Carousel** – The main wrapper and controller +2. **Carousel Viewport** – The visible scrolling area +3. **Carousel Slide** – Container for individual slides +4. **Carousel Controls** – Previous/Next navigation buttons +5. **Carousel Dots** – Pagination indicators + += Use Cases = + +* Image galleries and sliders +* Testimonial carousels +* Post/product showcases +* Logo showcases +* Hero banners with multiple slides + +== Installation == + +1. Upload the `carousel-kit` folder to `/wp-content/plugins/` +2. Activate the plugin through the **Plugins** menu in WordPress +3. In the block editor, search for "Carousel" and insert the block + +== Frequently Asked Questions == + += Does it work with Full Site Editing? = + +Yes! Carousel Kit is fully compatible with FSE. Use it in templates, template parts, and anywhere blocks are supported. + += Can I nest other blocks inside slides? = + +Absolutely. Each slide accepts any WordPress block—images, paragraphs, groups, columns, and third-party blocks. + += Does it support the Query Loop block? = + +Yes. Add a Query Loop inside the Carousel Viewport, and each post becomes a slide automatically. + += Is it accessible? = + +Yes. The carousel follows W3C accessibility guidelines with proper ARIA roles, labels, and full keyboard navigation. + += Can I have multiple carousels on the same page? = + +Yes. Each carousel instance maintains its own independent state. + +== Screenshots == + +1. Carousel block in the editor with multiple slides +2. Carousel controls and dots configuration +3. Query Loop integration for dynamic content +4. Frontend carousel with autoplay + +== Changelog == + += 1.0.2 = +* Fix: Demo pattern now shows 4 slides per view +* Fix: Replace PNG images with optimized WEBP format +* New: Setup wizard styles +* New: Slide appender and setup wizard + += 1.0.1 = +* Fix: Resolve spacing issues in loop mode where gaps were missing between last and first slide +* Fix: Allow infinite loop in editor viewport to match frontend behavior + += 1.0.0 = +* Initial release +* Compound block architecture with Carousel, Viewport, Slide, Controls, and Dots +* Embla Carousel v8 integration +* WordPress Interactivity API support +* Query Loop integration +* RTL and accessibility support + +== Upgrade Notice == + += 1.0.2 = +Improved demo patterns and setup wizard. Image optimization with WEBP format. + += 1.0.1 = +Fixes spacing issues in loop mode and editor preview behavior. + += 1.0.0 = +Initial release of Carousel Kit. diff --git a/wp-assets/screenshot-1.png b/wp-assets/screenshot-1.png new file mode 100644 index 0000000..b536292 Binary files /dev/null and b/wp-assets/screenshot-1.png differ