Changeset 3395126
- Timestamp:
- 11/13/2025 03:13:26 PM (4 months ago)
- Location:
- native-blocks-carousel/trunk
- Files:
-
- 12 added
- 3 deleted
- 16 edited
-
.gitignore (deleted)
-
.wordpress-org (added)
-
.wordpress-org/banner-1544x500.gif (added)
-
.wordpress-org/banner-772x250.gif (added)
-
.wordpress-org/banner.svg (added)
-
.wordpress-org/icon-256x256.gif (added)
-
.wordpress-org/icon.svg (added)
-
.wordpress-org/screenshot-1.png (added)
-
.wordpress-org/screenshot-2.png (added)
-
.wordpress-org/screenshot-3.png (added)
-
.wordpress-org/screenshot-4.png (added)
-
any-block-carousel-slider.php (added)
-
assets/css/carousel-editor.css (modified) (11 diffs)
-
assets/css/carousel.css (modified) (102 diffs)
-
assets/js/carousel-editor.js (modified) (47 diffs)
-
assets/js/carousel-frontend-init.js (modified) (10 diffs)
-
assets/js/carousel-shared.js (modified) (2 diffs)
-
includes/Activator.php (modified) (3 diffs)
-
includes/Assets.php (modified) (7 diffs)
-
includes/Autoloader.php (modified) (1 diff)
-
includes/Contracts/ServiceInterface.php (modified) (1 diff)
-
includes/Contracts/TranslatableInterface.php (modified) (1 diff)
-
includes/Contracts/TranslationServiceInterface.php (modified) (1 diff)
-
includes/Plugin.php (modified) (2 diffs)
-
includes/Renderer.php (modified) (6 diffs)
-
includes/ThemeStyles.php (modified) (2 diffs)
-
includes/Translations.php (modified) (2 diffs)
-
languages/any-block-carousel-slider-fr_FR.mo (added)
-
languages/native-blocks-carousel-fr_FR.mo (deleted)
-
native-blocks-carousel.php (deleted)
-
readme.txt (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
native-blocks-carousel/trunk/assets/css/carousel-editor.css
r3394953 r3395126 1 1 /* 2 * Gutenberg editor styles for Native Blocks Carousel3 * @package NativeBlocksCarousel2 * Gutenberg editor styles for Any Block Carousel Slider 3 * @package AnyBlockCarouselSlider 4 4 */ 5 5 6 .cfg- nbc-carousel-toggle-control {6 .cfg-abcs-toggle-control { 7 7 margin-bottom: 1rem; 8 8 } 9 9 10 .cfg- nbc-carousel-toggle-control .components-base-control__label {10 .cfg-abcs-toggle-control .components-base-control__label { 11 11 font-weight: 600; 12 12 color: #1e1e1e; 13 13 } 14 14 15 .cfg- nbc-carousel-toggle-control .components-base-control__help {15 .cfg-abcs-toggle-control .components-base-control__help { 16 16 font-size: 12px; 17 17 color: #757575; … … 19 19 } 20 20 21 .cfg- nbc-carousel-toggle-control .components-toggle-control__label[for*="carousel"] {21 .cfg-abcs-toggle-control .components-toggle-control__label[for*="carousel"] { 22 22 color: #007cba; 23 23 font-weight: 600; 24 24 } 25 25 26 .cfg- nbc-carousel-panel .components-panel__body-title {26 .cfg-abcs-panel .components-panel__body-title { 27 27 font-weight: 600; 28 28 } 29 29 30 . nbc-arrow-style-panel .components-base-control__field,31 . nbc-arrow-style-panel .components-toggle-group-control {30 .abcs-arrow-style-panel .components-base-control__field, 31 .abcs-arrow-style-panel .components-toggle-group-control { 32 32 display: grid; 33 33 justify-content: center; 34 34 } 35 35 36 . nbc-arrow-style-panel .components-toggle-group-control {36 .abcs-arrow-style-panel .components-toggle-group-control { 37 37 width: 100%; 38 38 } 39 39 40 . nbc-arrow-style-panel .nbc-arrow-style-group {40 .abcs-arrow-style-panel .abcs-arrow-style-group { 41 41 gap: 8px; 42 42 } 43 43 44 . nbc-arrow-style-group.components-toggle-group-control {44 .abcs-arrow-style-group.components-toggle-group-control { 45 45 display: flex; 46 46 flex-wrap: wrap; 47 47 } 48 48 49 . nbc-arrow-style-group .components-toggle-group-control__option {50 -- nbc-arrow-option-size: 44px;51 width: var(-- nbc-arrow-option-size);52 height: var(-- nbc-arrow-option-size);53 min-width: var(-- nbc-arrow-option-size);54 min-height: var(-- nbc-arrow-option-size);55 flex: 0 0 var(-- nbc-arrow-option-size);49 .abcs-arrow-style-group .components-toggle-group-control__option { 50 --abcs-arrow-option-size: 44px; 51 width: var(--abcs-arrow-option-size); 52 height: var(--abcs-arrow-option-size); 53 min-width: var(--abcs-arrow-option-size); 54 min-height: var(--abcs-arrow-option-size); 55 flex: 0 0 var(--abcs-arrow-option-size); 56 56 padding: 0; 57 57 border-radius: 10px; … … 67 67 } 68 68 69 . nbc-arrow-style-group .components-toggle-group-control__option>span {69 .abcs-arrow-style-group .components-toggle-group-control__option>span { 70 70 display: flex; 71 71 align-items: center; … … 76 76 } 77 77 78 . nbc-arrow-style-group .components-toggle-group-control__option:hover {78 .abcs-arrow-style-group .components-toggle-group-control__option:hover { 79 79 box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); 80 80 transform: translateY(-1px); 81 81 } 82 82 83 . nbc-arrow-style-group .components-toggle-group-control__option.is-selected {83 .abcs-arrow-style-group .components-toggle-group-control__option.is-selected { 84 84 background: var(--wp-admin-theme-color, #3858e9); 85 85 border-color: var(--wp-admin-theme-color, #3858e9); … … 89 89 } 90 90 91 . nbc-arrow-style-group .components-toggle-group-control__option.is-selected .nbc-arrow-style-icon__button {91 .abcs-arrow-style-group .components-toggle-group-control__option.is-selected .abcs-arrow-style-icon__button { 92 92 background: rgba(255, 255, 255, 0.2); 93 93 border-color: rgba(255, 255, 255, 0.7); … … 96 96 } 97 97 98 . nbc-arrow-style-icon {98 .abcs-arrow-style-icon { 99 99 display: flex; 100 100 align-items: center; … … 104 104 } 105 105 106 . nbc-arrow-style-icon svg {106 .abcs-arrow-style-icon svg { 107 107 width: 20px; 108 108 height: 20px; … … 111 111 112 112 113 .cfg- nbc-carousel-panel-first {113 .cfg-abcs-panel-first { 114 114 order: -1000 !important; 115 115 } 116 116 117 .block-editor-block-inspector .cfg- nbc-carousel-panel-first {117 .block-editor-block-inspector .cfg-abcs-panel-first { 118 118 order: -1000 !important; 119 119 margin-bottom: 16px; 120 120 } 121 121 122 .block-editor-block-list__layout . nbc-carousel>*:not(:first-child),123 .editor-styles-wrapper . nbc-carousel>*:not(:first-child) {122 .block-editor-block-list__layout .abcs>*:not(:first-child), 123 .editor-styles-wrapper .abcs>*:not(:first-child) { 124 124 pointer-events: none; 125 125 } 126 126 127 127 @media (prefers-color-scheme: dark) { 128 .cfg- nbc-carousel-toggle-control .components-base-control__label {128 .cfg-abcs-toggle-control .components-base-control__label { 129 129 color: #fff; 130 130 } 131 131 132 .cfg- nbc-carousel-toggle-control .components-base-control__help {132 .cfg-abcs-toggle-control .components-base-control__help { 133 133 color: #ccc; 134 134 } 135 135 } 136 136 137 :has(> . nbc-carousel.nbc-carousel-hide-arrows)::after {137 :has(> .abcs.abcs-hide-arrows)::after { 138 138 display: none !important; 139 139 content: none !important; 140 140 } 141 141 142 :has(> . nbc-carousel.nbc-carousel-hide-markers)::after {142 :has(> .abcs.abcs-hide-markers)::after { 143 143 display: none !important; 144 144 content: none !important; … … 146 146 147 147 @supports selector(::scroll-button(*)) { 148 . nbc-carousel.nbc-carousel-hide-arrows::scroll-button(*) {148 .abcs.abcs-hide-arrows::scroll-button(*) { 149 149 display: none !important; 150 150 opacity: 0 !important; … … 155 155 156 156 @supports selector(::scroll-marker-group) { 157 . nbc-carousel.nbc-carousel-hide-markers::scroll-marker-group {157 .abcs.abcs-hide-markers::scroll-marker-group { 158 158 display: none !important; 159 159 opacity: 0 !important; … … 164 164 165 165 @supports selector(::scroll-marker) { 166 . nbc-carousel.nbc-carousel-hide-markers>*::scroll-marker {166 .abcs.abcs-hide-markers>*::scroll-marker { 167 167 opacity: 0 !important; 168 168 cursor: default !important; -
native-blocks-carousel/trunk/assets/css/carousel.css
r3394953 r3395126 1 1 /** 2 * Native Blocks Carousel- Styles CSS2 * Any Block Carousel Slider - Styles CSS 3 3 * 4 * Transform any WordPress block into a carousel with the . nbc-carouselclass4 * Transform any WordPress block into a carousel with the .abcs class 5 5 * Compatible with post loops and all WordPress blocks 6 6 * Compatible with Block Editor and frontend 7 7 * 8 * @package NativeBlocksCarousel8 * @package AnyBlockCarouselSlider 9 9 * @version 1.0.2 10 10 * @author weblazer35 … … 47 47 /* Required so ::scroll-button and ::scroll-marker are positioned correctly */ 48 48 /* ::scroll-button tends to position relative to a distant ancestor, not the carousel itself */ 49 :has(. nbc-carousel) {49 :has(.abcs) { 50 50 position: relative !important; 51 51 } … … 53 53 /* Also force the direct parent to be positioned relative */ 54 54 /* Important to correctly anchor buttons to the container */ 55 . nbc-carousel{55 .abcs { 56 56 position: relative !important; 57 57 } … … 60 60 /* Double safety for cases where :has() is not supported everywhere */ 61 61 /* IMPORTANT: the parent must be the positioning context for the buttons */ 62 *:has(> . nbc-carousel) {62 *:has(> .abcs) { 63 63 position: relative !important; 64 64 /* Ensure the parent can contain positioned buttons */ … … 69 69 } 70 70 71 . nbc-carousel,72 .block-editor-block-list__layout . nbc-carousel,73 .editor-styles-wrapper . nbc-carousel{71 .abcs, 72 .block-editor-block-list__layout .abcs, 73 .editor-styles-wrapper .abcs { 74 74 /* Layout */ 75 75 position: relative !important; … … 117 117 ========================================================================== */ 118 118 119 . nbc-carousel>*,120 .block-editor-block-list__layout . nbc-carousel>*,121 .editor-styles-wrapper . nbc-carousel>* {119 .abcs>*, 120 .block-editor-block-list__layout .abcs>*, 121 .editor-styles-wrapper .abcs>* { 122 122 /* Layout */ 123 123 position: relative; … … 135 135 } 136 136 137 . nbc-carousel.wp-block-group[style*="border-radius"] {137 .abcs .wp-block-group[style*="border-radius"] { 138 138 overflow: hidden; 139 139 } 140 140 141 . nbc-carousel.wp-block-group.has-global-padding {141 .abcs .wp-block-group.has-global-padding { 142 142 padding-left: initial; 143 143 padding-right: initial; … … 145 145 146 146 /* Backgrounds */ 147 . nbc-carousel.has-background,148 .block-editor-block-list__layout . nbc-carousel.has-background,149 .editor-styles-wrapper . nbc-carousel.has-background {147 .abcs .has-background, 148 .block-editor-block-list__layout .abcs .has-background, 149 .editor-styles-wrapper .abcs .has-background { 150 150 height: 100%; 151 151 } … … 156 156 157 157 /* Disable flex-wrap and the gallery column system */ 158 .wp-block-gallery. nbc-carousel,159 .block-editor-block-list__layout .wp-block-gallery. nbc-carousel,160 .editor-styles-wrapper .wp-block-gallery. nbc-carousel{158 .wp-block-gallery.abcs, 159 .block-editor-block-list__layout .wp-block-gallery.abcs, 160 .editor-styles-wrapper .wp-block-gallery.abcs { 161 161 flex-wrap: nowrap !important; 162 162 columns: auto !important; … … 164 164 165 165 /* Chaque figure dans la galerie carousel */ 166 .wp-block-gallery. nbc-carousel>.wp-block-image,167 .block-editor-block-list__layout .wp-block-gallery. nbc-carousel>.wp-block-image,168 .editor-styles-wrapper .wp-block-gallery. nbc-carousel>.wp-block-image {166 .wp-block-gallery.abcs>.wp-block-image, 167 .block-editor-block-list__layout .wp-block-gallery.abcs>.wp-block-image, 168 .editor-styles-wrapper .wp-block-gallery.abcs>.wp-block-image { 169 169 flex: 0 0 auto; 170 170 /* Default width: 6 images visible on wide desktop (> 1280px) */ … … 176 176 177 177 /* Images dans la galerie carousel */ 178 .wp-block-gallery. nbc-carousel>.wp-block-image img,179 .block-editor-block-list__layout .wp-block-gallery. nbc-carousel>.wp-block-image img,180 .editor-styles-wrapper .wp-block-gallery. nbc-carousel>.wp-block-image img {178 .wp-block-gallery.abcs>.wp-block-image img, 179 .block-editor-block-list__layout .wp-block-gallery.abcs>.wp-block-image img, 180 .editor-styles-wrapper .wp-block-gallery.abcs>.wp-block-image img { 181 181 width: 100%; 182 182 height: 100%; … … 189 189 190 190 /* Convertir le CSS Grid en Flexbox pour le carousel */ 191 .is-layout-grid. nbc-carousel,192 .block-editor-block-list__layout .is-layout-grid. nbc-carousel,193 .editor-styles-wrapper .is-layout-grid. nbc-carousel{191 .is-layout-grid.abcs, 192 .block-editor-block-list__layout .is-layout-grid.abcs, 193 .editor-styles-wrapper .is-layout-grid.abcs { 194 194 display: flex !important; 195 195 grid-template-columns: none !important; … … 200 200 /* Grids in carousel mode display items with a fixed width */ 201 201 /* Use --carousel-grid-item-width to customise */ 202 .is-layout-grid. nbc-carousel>*,203 .block-editor-block-list__layout .is-layout-grid. nbc-carousel>*,204 .editor-styles-wrapper .is-layout-grid. nbc-carousel>* {202 .is-layout-grid.abcs>*, 203 .block-editor-block-list__layout .is-layout-grid.abcs>*, 204 .editor-styles-wrapper .is-layout-grid.abcs>* { 205 205 flex: 0 0 auto; 206 206 /* Default width sized for 3 visible columns */ … … 211 211 212 212 /* Grid Item Position - Respecter grid-column span */ 213 .is-layout-grid. nbc-carousel>*[style*="grid-column-end:span 2"],214 .is-layout-grid. nbc-carousel>*[style*="grid-column:span 2"] {213 .is-layout-grid.abcs>*[style*="grid-column-end:span 2"], 214 .is-layout-grid.abcs>*[style*="grid-column:span 2"] { 215 215 width: calc(var(--carousel-grid-item-width, 33.333%) * 2 + var(--wp--style--block-gap, 1rem)) !important; 216 216 } 217 217 218 .is-layout-grid. nbc-carousel>*[style*="grid-column-end:span 3"],219 .is-layout-grid. nbc-carousel>*[style*="grid-column:span 3"] {218 .is-layout-grid.abcs>*[style*="grid-column-end:span 3"], 219 .is-layout-grid.abcs>*[style*="grid-column:span 3"] { 220 220 width: calc(var(--carousel-grid-item-width, 33.333%) * 3 + var(--wp--style--block-gap, 1rem) * 2) !important; 221 221 } 222 222 223 .is-layout-grid. nbc-carousel>*[style*="grid-column-end:span 4"],224 .is-layout-grid. nbc-carousel>*[style*="grid-column:span 4"] {223 .is-layout-grid.abcs>*[style*="grid-column-end:span 4"], 224 .is-layout-grid.abcs>*[style*="grid-column:span 4"] { 225 225 width: calc(var(--carousel-grid-item-width, 33.333%) * 4 + var(--wp--style--block-gap, 1rem) * 3) !important; 226 226 } … … 229 229 /* Add these classes to the Grid block to control item width */ 230 230 231 /* nbc-carousel-cols-1: 1 visible item (full width) */232 .is-layout-grid. nbc-carousel.nbc-carousel-cols-1>* {231 /* abcs-cols-1: 1 visible item (full width) */ 232 .is-layout-grid.abcs.abcs-cols-1>* { 233 233 --carousel-grid-item-width: 100%; 234 234 width: 100%; … … 236 236 } 237 237 238 /* nbc-carousel-cols-2: 2 visible items */239 .is-layout-grid. nbc-carousel.nbc-carousel-cols-2>* {238 /* abcs-cols-2: 2 visible items */ 239 .is-layout-grid.abcs.abcs-cols-2>* { 240 240 --carousel-grid-item-width: calc(50% - var(--wp--style--block-gap, 1rem) / 2); 241 241 width: calc(50% - var(--wp--style--block-gap, 1rem) / 2); … … 243 243 } 244 244 245 /* nbc-carousel-cols-3: 3 visible items (default) */246 .is-layout-grid. nbc-carousel.nbc-carousel-cols-3>* {245 /* abcs-cols-3: 3 visible items (default) */ 246 .is-layout-grid.abcs.abcs-cols-3>* { 247 247 --carousel-grid-item-width: calc(33.333% - var(--wp--style--block-gap, 1rem) * 2 / 3); 248 248 width: calc(33.333% - var(--wp--style--block-gap, 1rem) * 2 / 3); … … 250 250 } 251 251 252 /* nbc-carousel-cols-4: 4 visible items */253 .is-layout-grid. nbc-carousel.nbc-carousel-cols-4>* {252 /* abcs-cols-4: 4 visible items */ 253 .is-layout-grid.abcs.abcs-cols-4>* { 254 254 --carousel-grid-item-width: calc(25% - var(--wp--style--block-gap, 1rem) * 3 / 4); 255 255 width: calc(25% - var(--wp--style--block-gap, 1rem) * 3 / 4); … … 257 257 } 258 258 259 /* nbc-carousel-cols-5: 5 visible items */260 .is-layout-grid. nbc-carousel.nbc-carousel-cols-5>* {259 /* abcs-cols-5: 5 visible items */ 260 .is-layout-grid.abcs.abcs-cols-5>* { 261 261 --carousel-grid-item-width: calc(20% - var(--wp--style--block-gap, 1rem) * 4 / 5); 262 262 width: calc(20% - var(--wp--style--block-gap, 1rem) * 4 / 5); … … 264 264 } 265 265 266 /* nbc-carousel-cols-6: 6 visible items */267 .is-layout-grid. nbc-carousel.nbc-carousel-cols-6>* {266 /* abcs-cols-6: 6 visible items */ 267 .is-layout-grid.abcs.abcs-cols-6>* { 268 268 --carousel-grid-item-width: calc(16.666% - var(--wp--style--block-gap, 1rem) * 5 / 6); 269 269 width: calc(16.666% - var(--wp--style--block-gap, 1rem) * 5 / 6); … … 271 271 } 272 272 273 /* nbc-carousel-cols-7: 7 visible items */274 .is-layout-grid. nbc-carousel.nbc-carousel-cols-7>* {273 /* abcs-cols-7: 7 visible items */ 274 .is-layout-grid.abcs.abcs-cols-7>* { 275 275 --carousel-grid-item-width: calc(14.285% - var(--wp--style--block-gap, 1rem) * 6 / 7); 276 276 width: calc(14.285% - var(--wp--style--block-gap, 1rem) * 6 / 7); … … 278 278 } 279 279 280 /* nbc-carousel-cols-8: 8 visible items */281 .is-layout-grid. nbc-carousel.nbc-carousel-cols-8>* {280 /* abcs-cols-8: 8 visible items */ 281 .is-layout-grid.abcs.abcs-cols-8>* { 282 282 --carousel-grid-item-width: calc(12.5% - var(--wp--style--block-gap, 1rem) * 7 / 8); 283 283 width: calc(12.5% - var(--wp--style--block-gap, 1rem) * 7 / 8); … … 285 285 } 286 286 287 /* nbc-carousel-cols-9: 9 visible items */288 .is-layout-grid. nbc-carousel.nbc-carousel-cols-9>* {287 /* abcs-cols-9: 9 visible items */ 288 .is-layout-grid.abcs.abcs-cols-9>* { 289 289 --carousel-grid-item-width: calc(11.111% - var(--wp--style--block-gap, 1rem) * 8 / 9); 290 290 width: calc(11.111% - var(--wp--style--block-gap, 1rem) * 8 / 9); … … 292 292 } 293 293 294 /* nbc-carousel-cols-10: 10 visible items */295 .is-layout-grid. nbc-carousel.nbc-carousel-cols-10>* {294 /* abcs-cols-10: 10 visible items */ 295 .is-layout-grid.abcs.abcs-cols-10>* { 296 296 --carousel-grid-item-width: calc(10% - var(--wp--style--block-gap, 1rem) * 9 / 10); 297 297 width: calc(10% - var(--wp--style--block-gap, 1rem) * 9 / 10); … … 299 299 } 300 300 301 /* nbc-carousel-cols-11: 11 visible items */302 .is-layout-grid. nbc-carousel.nbc-carousel-cols-11>* {301 /* abcs-cols-11: 11 visible items */ 302 .is-layout-grid.abcs.abcs-cols-11>* { 303 303 --carousel-grid-item-width: calc(9.090% - var(--wp--style--block-gap, 1rem) * 10 / 11); 304 304 width: calc(9.090% - var(--wp--style--block-gap, 1rem) * 10 / 11); … … 306 306 } 307 307 308 /* nbc-carousel-cols-12: 12 visible items */309 .is-layout-grid. nbc-carousel.nbc-carousel-cols-12>* {308 /* abcs-cols-12: 12 visible items */ 309 .is-layout-grid.abcs.abcs-cols-12>* { 310 310 --carousel-grid-item-width: calc(8.333% - var(--wp--style--block-gap, 1rem) * 11 / 12); 311 311 width: calc(8.333% - var(--wp--style--block-gap, 1rem) * 11 / 12); … … 313 313 } 314 314 315 /* nbc-carousel-cols-13: 13 visible items */316 .is-layout-grid. nbc-carousel.nbc-carousel-cols-13>* {315 /* abcs-cols-13: 13 visible items */ 316 .is-layout-grid.abcs.abcs-cols-13>* { 317 317 --carousel-grid-item-width: calc(7.692% - var(--wp--style--block-gap, 1rem) * 12 / 13); 318 318 width: calc(7.692% - var(--wp--style--block-gap, 1rem) * 12 / 13); … … 320 320 } 321 321 322 /* nbc-carousel-cols-14: 14 visible items */323 .is-layout-grid. nbc-carousel.nbc-carousel-cols-14>* {322 /* abcs-cols-14: 14 visible items */ 323 .is-layout-grid.abcs.abcs-cols-14>* { 324 324 --carousel-grid-item-width: calc(7.142% - var(--wp--style--block-gap, 1rem) * 13 / 14); 325 325 width: calc(7.142% - var(--wp--style--block-gap, 1rem) * 13 / 14); … … 327 327 } 328 328 329 /* nbc-carousel-cols-15: 15 visible items */330 .is-layout-grid. nbc-carousel.nbc-carousel-cols-15>* {329 /* abcs-cols-15: 15 visible items */ 330 .is-layout-grid.abcs.abcs-cols-15>* { 331 331 --carousel-grid-item-width: calc(6.666% - var(--wp--style--block-gap, 1rem) * 14 / 15); 332 332 width: calc(6.666% - var(--wp--style--block-gap, 1rem) * 14 / 15); … … 334 334 } 335 335 336 /* nbc-carousel-cols-16: 16 visible items */337 .is-layout-grid. nbc-carousel.nbc-carousel-cols-16>* {336 /* abcs-cols-16: 16 visible items */ 337 .is-layout-grid.abcs.abcs-cols-16>* { 338 338 --carousel-grid-item-width: calc(6.25% - var(--wp--style--block-gap, 1rem) * 15 / 16); 339 339 width: calc(6.25% - var(--wp--style--block-gap, 1rem) * 15 / 16); … … 341 341 } 342 342 343 /* nbc-carousel-min-width: use the minimum width defined in the grid */343 /* abcs-min-width: use the minimum width defined in the grid */ 344 344 /* WordPress generates: grid-template-columns: repeat(auto-fill, minmax(XXXpx, 1fr)) */ 345 345 /* On doit extraire cette valeur et l'utiliser comme largeur fixe en mode Flexbox */ 346 .is-layout-grid. nbc-carousel.nbc-carousel-min-width>*,347 .block-editor-block-list__layout .is-layout-grid. nbc-carousel.nbc-carousel-min-width>*,348 .editor-styles-wrapper .is-layout-grid. nbc-carousel.nbc-carousel-min-width>* {346 .is-layout-grid.abcs.abcs-min-width>*, 347 .block-editor-block-list__layout .is-layout-grid.abcs.abcs-min-width>*, 348 .editor-styles-wrapper .is-layout-grid.abcs.abcs-min-width>* { 349 349 /* Largeur fixe avec adaptation sur mobile */ 350 350 flex: 0 0 auto !important; … … 356 356 357 357 /* Specific rules for Post Template (children are <li class="wp-block-post">) */ 358 .wp-block-post-template. nbc-carousel.nbc-carousel-min-width .wp-block-post,359 .block-editor-block-list__layout .wp-block-post-template. nbc-carousel.nbc-carousel-min-width .wp-block-post,360 .editor-styles-wrapper .wp-block-post-template. nbc-carousel.nbc-carousel-min-width .wp-block-post {358 .wp-block-post-template.abcs.abcs-min-width .wp-block-post, 359 .block-editor-block-list__layout .wp-block-post-template.abcs.abcs-min-width .wp-block-post, 360 .editor-styles-wrapper .wp-block-post-template.abcs.abcs-min-width .wp-block-post { 361 361 flex: 0 0 auto !important; 362 362 width: min(var(--carousel-min-width, 200px), 100%) !important; … … 366 366 367 367 /* Specific rules for Group blocks (children can be <div> or other elements) */ 368 .wp-block-group. nbc-carousel.nbc-carousel-min-width>*,369 .block-editor-block-list__layout .wp-block-group. nbc-carousel.nbc-carousel-min-width>*,370 .editor-styles-wrapper .wp-block-group. nbc-carousel.nbc-carousel-min-width>* {368 .wp-block-group.abcs.abcs-min-width>*, 369 .block-editor-block-list__layout .wp-block-group.abcs.abcs-min-width>*, 370 .editor-styles-wrapper .wp-block-group.abcs.abcs-min-width>* { 371 371 flex: 0 0 auto !important; 372 372 width: min(var(--carousel-min-width, 200px), 100%) !important; … … 379 379 ========================================================================== */ 380 380 381 /* En mode Auto ( nbc-carousel-min-width), le snap se fait sur le centre */382 . nbc-carousel.nbc-carousel-min-width>*,383 .block-editor-block-list__layout . nbc-carousel.nbc-carousel-min-width>*,384 .editor-styles-wrapper . nbc-carousel.nbc-carousel-min-width>* {381 /* En mode Auto (abcs-min-width), le snap se fait sur le centre */ 382 .abcs.abcs-min-width>*, 383 .block-editor-block-list__layout .abcs.abcs-min-width>*, 384 .editor-styles-wrapper .abcs.abcs-min-width>* { 385 385 scroll-snap-align: center !important; 386 386 } … … 391 391 392 392 /* Post Template en mode list view (sans is-layout-grid) : snap sur le centre */ 393 .wp-block-post-template. nbc-carousel:not(.is-layout-grid) .wp-block-post,394 .block-editor-block-list__layout .wp-block-post-template. nbc-carousel:not(.is-layout-grid) .wp-block-post,395 .editor-styles-wrapper .wp-block-post-template. nbc-carousel:not(.is-layout-grid) .wp-block-post {393 .wp-block-post-template.abcs:not(.is-layout-grid) .wp-block-post, 394 .block-editor-block-list__layout .wp-block-post-template.abcs:not(.is-layout-grid) .wp-block-post, 395 .editor-styles-wrapper .wp-block-post-template.abcs:not(.is-layout-grid) .wp-block-post { 396 396 scroll-snap-align: center !important; 397 397 } 398 398 399 399 /* Specific rules for Post Template in Auto mode */ 400 .wp-block-post-template. nbc-carousel.nbc-carousel-min-width .wp-block-post,401 .block-editor-block-list__layout .wp-block-post-template. nbc-carousel.nbc-carousel-min-width .wp-block-post,402 .editor-styles-wrapper .wp-block-post-template. nbc-carousel.nbc-carousel-min-width .wp-block-post {400 .wp-block-post-template.abcs.abcs-min-width .wp-block-post, 401 .block-editor-block-list__layout .wp-block-post-template.abcs.abcs-min-width .wp-block-post, 402 .editor-styles-wrapper .wp-block-post-template.abcs.abcs-min-width .wp-block-post { 403 403 scroll-snap-align: center !important; 404 404 } 405 405 406 406 /* Specific rules for Group in Auto mode */ 407 .wp-block-group. nbc-carousel.nbc-carousel-min-width>*,408 .block-editor-block-list__layout .wp-block-group. nbc-carousel.nbc-carousel-min-width>*,409 .editor-styles-wrapper .wp-block-group. nbc-carousel.nbc-carousel-min-width>* {407 .wp-block-group.abcs.abcs-min-width>*, 408 .block-editor-block-list__layout .wp-block-group.abcs.abcs-min-width>*, 409 .editor-styles-wrapper .wp-block-group.abcs.abcs-min-width>* { 410 410 scroll-snap-align: center !important; 411 411 } 412 412 413 413 /* Specific rules for Gallery in Auto mode */ 414 .wp-block-gallery. nbc-carousel.nbc-carousel-min-width>.wp-block-image,415 .block-editor-block-list__layout .wp-block-gallery. nbc-carousel.nbc-carousel-min-width>.wp-block-image,416 .editor-styles-wrapper .wp-block-gallery. nbc-carousel.nbc-carousel-min-width>.wp-block-image {414 .wp-block-gallery.abcs.abcs-min-width>.wp-block-image, 415 .block-editor-block-list__layout .wp-block-gallery.abcs.abcs-min-width>.wp-block-image, 416 .editor-styles-wrapper .wp-block-gallery.abcs.abcs-min-width>.wp-block-image { 417 417 scroll-snap-align: center !important; 418 418 } … … 424 424 /* Fallback : indicateur de pagination pour navigateurs non compatibles */ 425 425 /* Objectif : signaler visuellement le carrousel sans boutons cliquables */ 426 :has(> . nbc-carousel)::after {426 :has(> .abcs)::after { 427 427 content: ''; 428 428 position: absolute; … … 446 446 } 447 447 448 :has(> . nbc-carousel)::hover::after {448 :has(> .abcs)::hover::after { 449 449 opacity: 0.75; 450 450 } 451 451 452 :has(> . nbc-carousel.nbc-carousel-hide-arrows)::after,453 :has(> . nbc-carousel.nbc-carousel-hide-markers)::after {452 :has(> .abcs.abcs-hide-arrows)::after, 453 :has(> .abcs.abcs-hide-markers)::after { 454 454 display: none !important; 455 455 content: none !important; … … 462 462 463 463 /* Masquer les fallbacks visuels */ 464 :has(> . nbc-carousel)::after {464 :has(> .abcs)::after { 465 465 display: none; 466 466 } 467 467 468 . nbc-carousel::scroll-button(*) {468 .abcs::scroll-button(*) { 469 469 position: absolute; 470 470 z-index: var(--carousel-z-index); … … 500 500 } 501 501 502 . nbc-carousel::scroll-button(*):hover {502 .abcs::scroll-button(*):hover { 503 503 box-shadow: var(--carousel-shadow), 0 6px 20px rgba(0, 0, 0, 0.2); 504 504 background-color: var(--carousel-button-bg); … … 506 506 } 507 507 508 . nbc-carousel::scroll-button(*):disabled {508 .abcs::scroll-button(*):disabled { 509 509 opacity: 0; 510 510 visibility: hidden; … … 516 516 /* Simple approach: rely on padding variables already defined by JavaScript */ 517 517 /* Le calcul se fait dans le CSS avec calc() */ 518 . nbc-carousel::scroll-button(left) {518 .abcs::scroll-button(left) { 519 519 left: calc(var(--carousel-padding-left, 0px) + var(--carousel-button-offset, 0px)); 520 520 content: ''; … … 527 527 } 528 528 529 . nbc-carousel::scroll-button(right) {529 .abcs::scroll-button(right) { 530 530 right: calc(var(--carousel-padding-right, 0px) + var(--carousel-button-offset, 0px)); 531 531 left: auto; … … 539 539 } 540 540 541 . nbc-carousel.nbc-carousel-hide-arrows::scroll-button(*) {541 .abcs.abcs-hide-arrows::scroll-button(*) { 542 542 display: none !important; 543 543 opacity: 0 !important; … … 546 546 } 547 547 548 . nbc-carousel.nbc-carousel-hide-markers::scroll-marker-group {548 .abcs.abcs-hide-markers::scroll-marker-group { 549 549 display: none !important; 550 550 opacity: 0 !important; … … 561 561 562 562 /* Masquer les fallbacks visuels */ 563 :has(> . nbc-carousel)::after {563 :has(> .abcs)::after { 564 564 display: none; 565 565 } 566 566 567 . nbc-carousel::scroll-marker-group {567 .abcs::scroll-marker-group { 568 568 position: absolute; 569 569 z-index: var(--carousel-z-index); … … 582 582 583 583 @supports selector(::scroll-marker) { 584 . nbc-carousel>*::scroll-marker {584 .abcs>*::scroll-marker { 585 585 position: relative; 586 586 content: ''; … … 595 595 } 596 596 597 . nbc-carousel.nbc-carousel-hide-markers>*::scroll-marker {597 .abcs.abcs-hide-markers>*::scroll-marker { 598 598 opacity: 0 !important; 599 599 cursor: default !important; … … 601 601 } 602 602 603 . nbc-carousel>*::scroll-marker:hover {603 .abcs>*::scroll-marker:hover { 604 604 opacity: 0.75; 605 605 } 606 606 607 . nbc-carousel>*::scroll-marker:target-current {607 .abcs>*::scroll-marker:target-current { 608 608 opacity: 1; 609 609 cursor: default; … … 628 628 /* Mobile (default) - 1 column */ 629 629 /* Exclude min-width mode which has its own rules */ 630 .wp-block-post-template.is-layout-grid. nbc-carousel:not(.nbc-carousel-min-width) .wp-block-post {630 .wp-block-post-template.is-layout-grid.abcs:not(.abcs-min-width) .wp-block-post { 631 631 width: 100% !important; 632 632 min-width: 100% !important; … … 637 637 638 638 /* 2 columns */ 639 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-2 .wp-block-post {639 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-2 .wp-block-post { 640 640 width: calc(50% - var(--wp--style--block-gap, 1.25em) / 2) !important; 641 641 min-width: calc(50% - var(--wp--style--block-gap, 1.25em) / 2) !important; … … 643 643 644 644 /* 3 columns */ 645 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-3 .wp-block-post {645 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-3 .wp-block-post { 646 646 width: calc(33.33333% - var(--wp--style--block-gap, 1.25em) * 2 / 3) !important; 647 647 min-width: calc(33.33333% - var(--wp--style--block-gap, 1.25em) * 2 / 3) !important; … … 649 649 650 650 /* 4 columns */ 651 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-4 .wp-block-post {651 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-4 .wp-block-post { 652 652 width: calc(25% - var(--wp--style--block-gap, 1.25em) * 3 / 4) !important; 653 653 min-width: calc(25% - var(--wp--style--block-gap, 1.25em) * 3 / 4) !important; … … 655 655 656 656 /* 5 columns */ 657 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-5 .wp-block-post {657 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-5 .wp-block-post { 658 658 width: calc(20% - var(--wp--style--block-gap, 1.25em) * 4 / 5) !important; 659 659 min-width: calc(20% - var(--wp--style--block-gap, 1.25em) * 4 / 5) !important; … … 661 661 662 662 /* 6 columns */ 663 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-6 .wp-block-post {663 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-6 .wp-block-post { 664 664 width: calc(16.66667% - var(--wp--style--block-gap, 1.25em) * 5 / 6) !important; 665 665 min-width: calc(16.66667% - var(--wp--style--block-gap, 1.25em) * 5 / 6) !important; … … 667 667 668 668 /* 7 columns */ 669 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-7 .wp-block-post {669 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-7 .wp-block-post { 670 670 width: calc(14.285% - var(--wp--style--block-gap, 1.25em) * 6 / 7) !important; 671 671 min-width: calc(14.285% - var(--wp--style--block-gap, 1.25em) * 6 / 7) !important; … … 673 673 674 674 /* 8 columns */ 675 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-8 .wp-block-post {675 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-8 .wp-block-post { 676 676 width: calc(12.5% - var(--wp--style--block-gap, 1.25em) * 7 / 8) !important; 677 677 min-width: calc(12.5% - var(--wp--style--block-gap, 1.25em) * 7 / 8) !important; … … 679 679 680 680 /* 9 columns */ 681 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-9 .wp-block-post {681 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-9 .wp-block-post { 682 682 width: calc(11.111% - var(--wp--style--block-gap, 1.25em) * 8 / 9) !important; 683 683 min-width: calc(11.111% - var(--wp--style--block-gap, 1.25em) * 8 / 9) !important; … … 685 685 686 686 /* 10 columns */ 687 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-10 .wp-block-post {687 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-10 .wp-block-post { 688 688 width: calc(10% - var(--wp--style--block-gap, 1.25em) * 9 / 10) !important; 689 689 min-width: calc(10% - var(--wp--style--block-gap, 1.25em) * 9 / 10) !important; … … 691 691 692 692 /* 11 columns */ 693 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-11 .wp-block-post {693 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-11 .wp-block-post { 694 694 width: calc(9.090% - var(--wp--style--block-gap, 1.25em) * 10 / 11) !important; 695 695 min-width: calc(9.090% - var(--wp--style--block-gap, 1.25em) * 10 / 11) !important; … … 697 697 698 698 /* 12 columns */ 699 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-12 .wp-block-post {699 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-12 .wp-block-post { 700 700 width: calc(8.333% - var(--wp--style--block-gap, 1.25em) * 11 / 12) !important; 701 701 min-width: calc(8.333% - var(--wp--style--block-gap, 1.25em) * 11 / 12) !important; … … 703 703 704 704 /* 13 columns */ 705 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-13 .wp-block-post {705 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-13 .wp-block-post { 706 706 width: calc(7.692% - var(--wp--style--block-gap, 1.25em) * 12 / 13) !important; 707 707 min-width: calc(7.692% - var(--wp--style--block-gap, 1.25em) * 12 / 13) !important; … … 709 709 710 710 /* 14 columns */ 711 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-14 .wp-block-post {711 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-14 .wp-block-post { 712 712 width: calc(7.142% - var(--wp--style--block-gap, 1.25em) * 13 / 14) !important; 713 713 min-width: calc(7.142% - var(--wp--style--block-gap, 1.25em) * 13 / 14) !important; … … 715 715 716 716 /* 15 columns */ 717 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-15 .wp-block-post {717 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-15 .wp-block-post { 718 718 width: calc(6.666% - var(--wp--style--block-gap, 1.25em) * 14 / 15) !important; 719 719 min-width: calc(6.666% - var(--wp--style--block-gap, 1.25em) * 14 / 15) !important; … … 721 721 722 722 /* 16 columns */ 723 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-16 .wp-block-post {723 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-16 .wp-block-post { 724 724 width: calc(6.25% - var(--wp--style--block-gap, 1.25em) * 15 / 16) !important; 725 725 min-width: calc(6.25% - var(--wp--style--block-gap, 1.25em) * 15 / 16) !important; … … 732 732 733 733 /* 3 columns and up: force 2 columns on tablets */ 734 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-3 .wp-block-post,735 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-4 .wp-block-post,736 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-5 .wp-block-post,737 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-6 .wp-block-post,738 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-7 .wp-block-post,739 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-8 .wp-block-post,740 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-9 .wp-block-post,741 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-10 .wp-block-post,742 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-11 .wp-block-post,743 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-12 .wp-block-post,744 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-13 .wp-block-post,745 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-14 .wp-block-post,746 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-15 .wp-block-post,747 .wp-block-post-template.is-layout-grid. nbc-carousel.nbc-carousel-cols-16 .wp-block-post {734 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-3 .wp-block-post, 735 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-4 .wp-block-post, 736 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-5 .wp-block-post, 737 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-6 .wp-block-post, 738 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-7 .wp-block-post, 739 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-8 .wp-block-post, 740 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-9 .wp-block-post, 741 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-10 .wp-block-post, 742 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-11 .wp-block-post, 743 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-12 .wp-block-post, 744 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-13 .wp-block-post, 745 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-14 .wp-block-post, 746 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-15 .wp-block-post, 747 .wp-block-post-template.is-layout-grid.abcs.abcs-cols-16 .wp-block-post { 748 748 width: calc(50% - var(--wp--style--block-gap, 1.25em) / 2) !important; 749 749 min-width: calc(50% - var(--wp--style--block-gap, 1.25em) / 2) !important; … … 756 756 757 757 /* Mobile (default) - 2 columns for galleries */ 758 .wp-block-gallery. nbc-carousel.wp-block-image {758 .wp-block-gallery.abcs .wp-block-image { 759 759 width: calc(50% - var(--wp--style--block-gap, 1rem) / 2) !important; 760 760 min-width: calc(50% - var(--wp--style--block-gap, 1rem) / 2) !important; … … 765 765 766 766 /* 1 column */ 767 .wp-block-gallery. nbc-carousel.nbc-carousel-cols-1 .wp-block-image {767 .wp-block-gallery.abcs.abcs-cols-1 .wp-block-image { 768 768 width: 100% !important; 769 769 min-width: 100% !important; … … 771 771 772 772 /* 2 columns */ 773 .wp-block-gallery. nbc-carousel.nbc-carousel-cols-2 .wp-block-image {773 .wp-block-gallery.abcs.abcs-cols-2 .wp-block-image { 774 774 width: calc(50% - var(--wp--style--block-gap, 1rem) / 2) !important; 775 775 min-width: calc(50% - var(--wp--style--block-gap, 1rem) / 2) !important; … … 777 777 778 778 /* 3 columns */ 779 .wp-block-gallery. nbc-carousel.nbc-carousel-cols-3 .wp-block-image {779 .wp-block-gallery.abcs.abcs-cols-3 .wp-block-image { 780 780 width: calc(33.33333% - var(--wp--style--block-gap, 1rem) * 2 / 3) !important; 781 781 min-width: calc(33.33333% - var(--wp--style--block-gap, 1rem) * 2 / 3) !important; … … 783 783 784 784 /* 4 columns */ 785 .wp-block-gallery. nbc-carousel.nbc-carousel-cols-4 .wp-block-image {785 .wp-block-gallery.abcs.abcs-cols-4 .wp-block-image { 786 786 width: calc(25% - var(--wp--style--block-gap, 1rem) * 3 / 4) !important; 787 787 min-width: calc(25% - var(--wp--style--block-gap, 1rem) * 3 / 4) !important; … … 789 789 790 790 /* 5 columns */ 791 .wp-block-gallery. nbc-carousel.nbc-carousel-cols-5 .wp-block-image {791 .wp-block-gallery.abcs.abcs-cols-5 .wp-block-image { 792 792 width: calc(20% - var(--wp--style--block-gap, 1rem) * 4 / 5) !important; 793 793 min-width: calc(20% - var(--wp--style--block-gap, 1rem) * 4 / 5) !important; … … 795 795 796 796 /* 6 columns */ 797 .wp-block-gallery. nbc-carousel.nbc-carousel-cols-6 .wp-block-image {797 .wp-block-gallery.abcs.abcs-cols-6 .wp-block-image { 798 798 width: calc(16.66667% - var(--wp--style--block-gap, 1rem) * 5 / 6) !important; 799 799 min-width: calc(16.66667% - var(--wp--style--block-gap, 1rem) * 5 / 6) !important; … … 801 801 802 802 /* 7 columns */ 803 .wp-block-gallery. nbc-carousel.nbc-carousel-cols-7 .wp-block-image {803 .wp-block-gallery.abcs.abcs-cols-7 .wp-block-image { 804 804 width: calc(14.285% - var(--wp--style--block-gap, 1rem) * 6 / 7) !important; 805 805 min-width: calc(14.285% - var(--wp--style--block-gap, 1rem) * 6 / 7) !important; … … 807 807 808 808 /* 8 columns */ 809 .wp-block-gallery. nbc-carousel.nbc-carousel-cols-8 .wp-block-image {809 .wp-block-gallery.abcs.abcs-cols-8 .wp-block-image { 810 810 width: calc(12.5% - var(--wp--style--block-gap, 1rem) * 7 / 8) !important; 811 811 min-width: calc(12.5% - var(--wp--style--block-gap, 1rem) * 7 / 8) !important; … … 819 819 /* Mobile (default) - 1 column */ 820 820 /* Exclude min-width mode which has its own rules */ 821 .wp-block-group.is-layout-grid. nbc-carousel:not(.nbc-carousel-min-width)>* {821 .wp-block-group.is-layout-grid.abcs:not(.abcs-min-width)>* { 822 822 width: 100% !important; 823 823 min-width: 100% !important; … … 828 828 829 829 /* 2 columns */ 830 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-2>* {830 .wp-block-group.is-layout-grid.abcs.abcs-cols-2>* { 831 831 width: calc(50% - var(--wp--style--block-gap, 1rem) / 2) !important; 832 832 min-width: calc(50% - var(--wp--style--block-gap, 1rem) / 2) !important; … … 834 834 835 835 /* 3 columns */ 836 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-3>* {836 .wp-block-group.is-layout-grid.abcs.abcs-cols-3>* { 837 837 width: calc(33.33333% - var(--wp--style--block-gap, 1rem) * 2 / 3) !important; 838 838 min-width: calc(33.33333% - var(--wp--style--block-gap, 1rem) * 2 / 3) !important; … … 840 840 841 841 /* 4 columns */ 842 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-4>* {842 .wp-block-group.is-layout-grid.abcs.abcs-cols-4>* { 843 843 width: calc(25% - var(--wp--style--block-gap, 1rem) * 3 / 4) !important; 844 844 min-width: calc(25% - var(--wp--style--block-gap, 1rem) * 3 / 4) !important; … … 846 846 847 847 /* 5 columns */ 848 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-5>* {848 .wp-block-group.is-layout-grid.abcs.abcs-cols-5>* { 849 849 width: calc(20% - var(--wp--style--block-gap, 1rem) * 4 / 5) !important; 850 850 min-width: calc(20% - var(--wp--style--block-gap, 1rem) * 4 / 5) !important; … … 852 852 853 853 /* 6 columns */ 854 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-6>* {854 .wp-block-group.is-layout-grid.abcs.abcs-cols-6>* { 855 855 width: calc(16.66667% - var(--wp--style--block-gap, 1rem) * 5 / 6) !important; 856 856 min-width: calc(16.66667% - var(--wp--style--block-gap, 1rem) * 5 / 6) !important; … … 858 858 859 859 /* 7 columns */ 860 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-7>* {860 .wp-block-group.is-layout-grid.abcs.abcs-cols-7>* { 861 861 width: calc(14.285% - var(--wp--style--block-gap, 1rem) * 6 / 7) !important; 862 862 min-width: calc(14.285% - var(--wp--style--block-gap, 1rem) * 6 / 7) !important; … … 864 864 865 865 /* 8 columns */ 866 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-8>* {866 .wp-block-group.is-layout-grid.abcs.abcs-cols-8>* { 867 867 width: calc(12.5% - var(--wp--style--block-gap, 1rem) * 7 / 8) !important; 868 868 min-width: calc(12.5% - var(--wp--style--block-gap, 1rem) * 7 / 8) !important; … … 870 870 871 871 /* 9 columns */ 872 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-9>* {872 .wp-block-group.is-layout-grid.abcs.abcs-cols-9>* { 873 873 width: calc(11.111% - var(--wp--style--block-gap, 1rem) * 8 / 9) !important; 874 874 min-width: calc(11.111% - var(--wp--style--block-gap, 1rem) * 8 / 9) !important; … … 876 876 877 877 /* 10 columns */ 878 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-10>* {878 .wp-block-group.is-layout-grid.abcs.abcs-cols-10>* { 879 879 width: calc(10% - var(--wp--style--block-gap, 1rem) * 9 / 10) !important; 880 880 min-width: calc(10% - var(--wp--style--block-gap, 1rem) * 9 / 10) !important; … … 882 882 883 883 /* 11 columns */ 884 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-11>* {884 .wp-block-group.is-layout-grid.abcs.abcs-cols-11>* { 885 885 width: calc(9.090% - var(--wp--style--block-gap, 1rem) * 10 / 11) !important; 886 886 min-width: calc(9.090% - var(--wp--style--block-gap, 1rem) * 10 / 11) !important; … … 888 888 889 889 /* 12 columns */ 890 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-12>* {890 .wp-block-group.is-layout-grid.abcs.abcs-cols-12>* { 891 891 width: calc(8.333% - var(--wp--style--block-gap, 1rem) * 11 / 12) !important; 892 892 min-width: calc(8.333% - var(--wp--style--block-gap, 1rem) * 11 / 12) !important; … … 894 894 895 895 /* 13 columns */ 896 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-13>* {896 .wp-block-group.is-layout-grid.abcs.abcs-cols-13>* { 897 897 width: calc(7.692% - var(--wp--style--block-gap, 1rem) * 12 / 13) !important; 898 898 min-width: calc(7.692% - var(--wp--style--block-gap, 1rem) * 12 / 13) !important; … … 900 900 901 901 /* 14 columns */ 902 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-14>* {902 .wp-block-group.is-layout-grid.abcs.abcs-cols-14>* { 903 903 width: calc(7.142% - var(--wp--style--block-gap, 1rem) * 13 / 14) !important; 904 904 min-width: calc(7.142% - var(--wp--style--block-gap, 1rem) * 13 / 14) !important; … … 906 906 907 907 /* 15 columns */ 908 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-15>* {908 .wp-block-group.is-layout-grid.abcs.abcs-cols-15>* { 909 909 width: calc(6.666% - var(--wp--style--block-gap, 1rem) * 14 / 15) !important; 910 910 min-width: calc(6.666% - var(--wp--style--block-gap, 1rem) * 14 / 15) !important; … … 912 912 913 913 /* 16 columns */ 914 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-16>* {914 .wp-block-group.is-layout-grid.abcs.abcs-cols-16>* { 915 915 width: calc(6.25% - var(--wp--style--block-gap, 1rem) * 15 / 16) !important; 916 916 min-width: calc(6.25% - var(--wp--style--block-gap, 1rem) * 15 / 16) !important; … … 923 923 924 924 /* 3 columns and up: force 2 columns on tablets */ 925 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-3>*,926 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-4>*,927 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-5>*,928 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-6>*,929 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-7>*,930 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-8>*,931 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-9>*,932 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-10>*,933 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-11>*,934 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-12>*,935 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-13>*,936 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-14>*,937 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-15>*,938 .wp-block-group.is-layout-grid. nbc-carousel.nbc-carousel-cols-16>* {925 .wp-block-group.is-layout-grid.abcs.abcs-cols-3>*, 926 .wp-block-group.is-layout-grid.abcs.abcs-cols-4>*, 927 .wp-block-group.is-layout-grid.abcs.abcs-cols-5>*, 928 .wp-block-group.is-layout-grid.abcs.abcs-cols-6>*, 929 .wp-block-group.is-layout-grid.abcs.abcs-cols-7>*, 930 .wp-block-group.is-layout-grid.abcs.abcs-cols-8>*, 931 .wp-block-group.is-layout-grid.abcs.abcs-cols-9>*, 932 .wp-block-group.is-layout-grid.abcs.abcs-cols-10>*, 933 .wp-block-group.is-layout-grid.abcs.abcs-cols-11>*, 934 .wp-block-group.is-layout-grid.abcs.abcs-cols-12>*, 935 .wp-block-group.is-layout-grid.abcs.abcs-cols-13>*, 936 .wp-block-group.is-layout-grid.abcs.abcs-cols-14>*, 937 .wp-block-group.is-layout-grid.abcs.abcs-cols-15>*, 938 .wp-block-group.is-layout-grid.abcs.abcs-cols-16>* { 939 939 width: calc(50% - var(--wp--style--block-gap, 1rem) / 2) !important; 940 940 min-width: calc(50% - var(--wp--style--block-gap, 1rem) / 2) !important; … … 964 964 965 965 /* Reduce the gap on mobile */ 966 . nbc-carousel{966 .abcs { 967 967 gap: var(--wp--style--block-gap, 0.5rem); 968 968 padding: 0.75rem 0px; … … 980 980 981 981 /* Reduce the gap even further */ 982 . nbc-carousel{982 .abcs { 983 983 gap: var(--wp--style--block-gap, 0.25rem); 984 984 padding: 1rem 0px; … … 998 998 999 999 /* Toggle Control */ 1000 .cfg- nbc-carousel-toggle-control {1000 .cfg-abcs-toggle-control { 1001 1001 margin-bottom: 1rem; 1002 1002 } 1003 1003 1004 .cfg- nbc-carousel-toggle-control .components-base-control__label {1004 .cfg-abcs-toggle-control .components-base-control__label { 1005 1005 font-weight: 600; 1006 1006 color: #1e1e1e; 1007 1007 } 1008 1008 1009 .cfg- nbc-carousel-toggle-control .components-base-control__help {1009 .cfg-abcs-toggle-control .components-base-control__help { 1010 1010 font-size: 12px; 1011 1011 color: #757575; … … 1013 1013 } 1014 1014 1015 .cfg- nbc-carousel-toggle-control .components-toggle-control__label[for*="carousel"] {1015 .cfg-abcs-toggle-control .components-toggle-control__label[for*="carousel"] { 1016 1016 color: #007cba; 1017 1017 font-weight: 600; … … 1019 1019 1020 1020 /* Panel Carousel */ 1021 .cfg- nbc-carousel-panel .components-panel__body-title {1021 .cfg-abcs-panel .components-panel__body-title { 1022 1022 font-weight: 600; 1023 1023 } 1024 1024 1025 .cfg- nbc-carousel-panel-first {1025 .cfg-abcs-panel-first { 1026 1026 order: -1000 !important; 1027 1027 } 1028 1028 1029 .block-editor-block-inspector .cfg- nbc-carousel-panel-first {1029 .block-editor-block-inspector .cfg-abcs-panel-first { 1030 1030 order: -1000 !important; 1031 1031 margin-bottom: 16px; … … 1033 1033 1034 1034 /* Fix editor click behaviour */ 1035 .block-editor-block-list__layout . nbc-carousel>*:not(:first-child),1036 .editor-styles-wrapper . nbc-carousel>*:not(:first-child) {1035 .block-editor-block-list__layout .abcs>*:not(:first-child), 1036 .editor-styles-wrapper .abcs>*:not(:first-child) { 1037 1037 pointer-events: none; 1038 1038 } … … 1043 1043 1044 1044 /* Optimisation du rendu */ 1045 . nbc-carousel,1046 .block-editor-block-list__layout . nbc-carousel,1047 .editor-styles-wrapper . nbc-carousel{1045 .abcs, 1046 .block-editor-block-list__layout .abcs, 1047 .editor-styles-wrapper .abcs { 1048 1048 will-change: scroll-position; 1049 1049 contain: layout style; … … 1051 1051 1052 1052 /* Optimise rendered elements */ 1053 . nbc-carousel>*,1054 .block-editor-block-list__layout . nbc-carousel>*,1055 .editor-styles-wrapper . nbc-carousel>* {1053 .abcs>*, 1054 .block-editor-block-list__layout .abcs>*, 1055 .editor-styles-wrapper .abcs>* { 1056 1056 will-change: transform; 1057 1057 } … … 1064 1064 @media (prefers-reduced-motion: reduce) { 1065 1065 1066 . nbc-carousel,1067 .block-editor-block-list__layout . nbc-carousel,1068 .editor-styles-wrapper . nbc-carousel{1066 .abcs, 1067 .block-editor-block-list__layout .abcs, 1068 .editor-styles-wrapper .abcs { 1069 1069 scroll-behavior: auto; 1070 1070 } 1071 1071 1072 . nbc-carousel::scroll-button(*),1073 *:has(>. nbc-carousel)::after {1072 .abcs::scroll-button(*), 1073 *:has(>.abcs)::after { 1074 1074 transition: none; 1075 1075 } 1076 1076 1077 . nbc-carousel>*::scroll-marker {1077 .abcs>*::scroll-marker { 1078 1078 transition: none; 1079 1079 } … … 1083 1083 @media (prefers-contrast: high) { 1084 1084 1085 . nbc-carousel::scroll-button(*),1086 *:has(>. nbc-carousel)::after {1085 .abcs::scroll-button(*), 1086 *:has(>.abcs)::after { 1087 1087 border-width: 3px; 1088 1088 } 1089 1089 1090 . nbc-carousel>*::scroll-marker {1090 .abcs>*::scroll-marker { 1091 1091 border: 2px solid currentColor; 1092 1092 } … … 1095 1095 @media (max-width: 600px) { 1096 1096 1097 . nbc-carousel.nbc-carousel-min-width>*,1098 .block-editor-block-list__layout . nbc-carousel.nbc-carousel-min-width>*,1099 .editor-styles-wrapper . nbc-carousel.nbc-carousel-min-width>*,1100 .wp-block-post-template. nbc-carousel.nbc-carousel-min-width .wp-block-post,1101 .block-editor-block-list__layout .wp-block-post-template. nbc-carousel.nbc-carousel-min-width .wp-block-post,1102 .editor-styles-wrapper .wp-block-post-template. nbc-carousel.nbc-carousel-min-width .wp-block-post,1103 .wp-block-group. nbc-carousel.nbc-carousel-min-width>*,1104 .block-editor-block-list__layout .wp-block-group. nbc-carousel.nbc-carousel-min-width>*,1105 .editor-styles-wrapper .wp-block-group. nbc-carousel.nbc-carousel-min-width>*,1106 .wp-block-gallery. nbc-carousel.nbc-carousel-min-width>.wp-block-image,1107 .block-editor-block-list__layout .wp-block-gallery. nbc-carousel.nbc-carousel-min-width>.wp-block-image,1108 .editor-styles-wrapper .wp-block-gallery. nbc-carousel.nbc-carousel-min-width>.wp-block-image {1097 .abcs.abcs-min-width>*, 1098 .block-editor-block-list__layout .abcs.abcs-min-width>*, 1099 .editor-styles-wrapper .abcs.abcs-min-width>*, 1100 .wp-block-post-template.abcs.abcs-min-width .wp-block-post, 1101 .block-editor-block-list__layout .wp-block-post-template.abcs.abcs-min-width .wp-block-post, 1102 .editor-styles-wrapper .wp-block-post-template.abcs.abcs-min-width .wp-block-post, 1103 .wp-block-group.abcs.abcs-min-width>*, 1104 .block-editor-block-list__layout .wp-block-group.abcs.abcs-min-width>*, 1105 .editor-styles-wrapper .wp-block-group.abcs.abcs-min-width>*, 1106 .wp-block-gallery.abcs.abcs-min-width>.wp-block-image, 1107 .block-editor-block-list__layout .wp-block-gallery.abcs.abcs-min-width>.wp-block-image, 1108 .editor-styles-wrapper .wp-block-gallery.abcs.abcs-min-width>.wp-block-image { 1109 1109 width: 100% !important; 1110 1110 min-width: 100% !important; -
native-blocks-carousel/trunk/assets/js/carousel-editor.js
r3394953 r3395126 1 1 /** 2 2 * Adds a "Carousel" toggle to Group, Post Template and Gallery blocks 3 * to easily enable/disable the . nbc-carouselclass.3 * to easily enable/disable the .abcs class. 4 4 */ 5 5 (function (wp) { … … 16 16 const SUPPORTED_BLOCKS = ['core/group', 'core/post-template', 'core/gallery']; 17 17 18 const SHARED = window. NativeBlocksCarouselShared || {};18 const SHARED = window.AnyBlockCarouselSliderShared || {}; 19 19 const FALLBACK_DEFAULT_ARROW_STYLE = 'chevron'; 20 20 const DEFAULT_ARROW_STYLE = SHARED.DEFAULT_ARROW_STYLE || FALLBACK_DEFAULT_ARROW_STYLE; … … 123 123 124 124 const isValidArrowStyle = (styleKey) => !!getIconDefinition(styleKey); 125 126 const findBlockWrapperElements = (rootDoc, targetClientId) => { 127 if (!targetClientId) { 128 return []; 129 } 130 131 const results = new Set(); 132 133 const collectFromDocument = (searchDoc) => { 134 if (!searchDoc || typeof searchDoc.querySelectorAll !== 'function') { 135 return; 136 } 137 const matches = searchDoc.querySelectorAll(`[data-block="${targetClientId}"]`); 138 matches.forEach((node) => { 139 if (node) { 140 results.add(node); 141 } 142 }); 143 }; 144 145 collectFromDocument(rootDoc); 146 147 if (rootDoc === document) { 148 const iframeSelectors = [ 149 '.editor-canvas iframe', 150 'iframe[name="editor-canvas"]', 151 '.edit-site-visual-editor__editor-canvas', 152 ]; 153 154 iframeSelectors.forEach((selector) => { 155 try { 156 const iframe = document.querySelector(selector); 157 if (!iframe) { 158 return; 159 } 160 161 const iframeDoc = iframe.contentDocument || (iframe.contentWindow && iframe.contentWindow.document) || null; 162 collectFromDocument(iframeDoc); 163 } catch (error) { 164 // Ignore cross-origin or unavailable iframe documents 165 } 166 }); 167 } 168 169 return Array.from(results); 170 }; 125 171 126 172 /** … … 188 234 { 189 235 value: 'chevron', 190 label: __('Chevron', ' native-blocks-carousel'),236 label: __('Chevron', 'any-block-carousel-slider'), 191 237 }, 192 238 { 193 239 value: 'arrow', 194 label: __('Arrow', ' native-blocks-carousel'),240 label: __('Arrow', 'any-block-carousel-slider'), 195 241 }, 196 242 { 197 243 value: 'angles', 198 label: __('Angles', ' native-blocks-carousel'),244 label: __('Angles', 'any-block-carousel-slider'), 199 245 }, 200 246 ]; … … 207 253 return createElement( 208 254 'span', 209 { className: ' nbc-arrow-style-icon' },255 { className: 'abcs-arrow-style-icon' }, 210 256 createElement(RawHTML, { children: rightArrow }) 211 257 ); … … 241 287 const filteredClasses = classArray.filter( 242 288 (cls) => 243 !cls.startsWith(' nbc-carousel-cols-') &&244 cls !== ' nbc-carousel-min-width' &&289 !cls.startsWith('abcs-cols-') && 290 cls !== 'abcs-min-width' && 245 291 // Remove legacy classes kept for migration purposes 246 292 !cls.startsWith('carousel-cols-') && 247 293 cls !== 'carousel-min-width' && 248 !cls.startsWith(' nbc-carousel-icon-') &&249 cls !== ' nbc-carousel-hide-arrows' &&250 cls !== ' nbc-carousel-hide-markers'294 !cls.startsWith('abcs-icon-') && 295 cls !== 'abcs-hide-arrows' && 296 cls !== 'abcs-hide-markers' 251 297 ); 252 298 253 299 if (enabled) { 254 // Add the ' nbc-carousel' class if it is not already present255 if (!filteredClasses.includes(' nbc-carousel')) {256 filteredClasses.push(' nbc-carousel');257 } 258 259 // For galleries, detect and add the nbc-carousel-cols-X class300 // Add the 'abcs' class if it is not already present 301 if (!filteredClasses.includes('abcs')) { 302 filteredClasses.push('abcs'); 303 } 304 305 // For galleries, detect and add the abcs-cols-X class 260 306 if (name === 'core/gallery') { 261 307 const columnCount = attributes.columns; … … 263 309 // If a column count is defined (up to 8 columns) 264 310 if (columnCount && columnCount >= 1 && columnCount <= 8) { 265 filteredClasses.push(` nbc-carousel-cols-${columnCount}`);311 filteredClasses.push(`abcs-cols-${columnCount}`); 266 312 } 267 313 // Otherwise default to 3 columns 268 314 else { 269 filteredClasses.push(' nbc-carousel-cols-3');315 filteredClasses.push('abcs-cols-3'); 270 316 } 271 317 } 272 318 273 // For grids (Group and Post Template), detect and add the nbc-carousel-cols-X class319 // For grids (Group and Post Template), detect and add the abcs-cols-X class 274 320 if ( 275 321 (name === 'core/group' || name === 'core/post-template') && … … 286 332 // If a column count is defined (up to 16 columns) and we are not in Auto mode 287 333 if (columnCount && columnCount >= 1 && columnCount <= 16 && !isAutoMode) { 288 filteredClasses.push(` nbc-carousel-cols-${columnCount}`);334 filteredClasses.push(`abcs-cols-${columnCount}`); 289 335 } 290 336 // If a minimum width is defined or we are in Auto mode 291 337 else if (minimumColumnWidth || isAutoMode) { 292 filteredClasses.push(' nbc-carousel-min-width');338 filteredClasses.push('abcs-min-width'); 293 339 } 294 340 // Otherwise default to 3 columns 295 341 else { 296 filteredClasses.push(' nbc-carousel-cols-3');342 filteredClasses.push('abcs-cols-3'); 297 343 } 298 344 } 299 345 } else { 300 // Remove the ' nbc-carousel' class301 const index = filteredClasses.indexOf(' nbc-carousel');346 // Remove the 'abcs' class 347 const index = filteredClasses.indexOf('abcs'); 302 348 if (index > -1) { 303 349 filteredClasses.splice(index, 1); … … 311 357 312 358 /** 313 * Keep the nbc-carousel-cols-X class in sync when column counts change.359 * Keep the abcs-cols-X class in sync when column counts change. 314 360 */ 315 361 useEffect(() => { … … 321 367 const classArray = currentClasses.split(' ').filter(Boolean); 322 368 323 // Find the current nbc-carousel-cols-* class369 // Find the current abcs-cols-* class 324 370 const currentColsClass = classArray.find((cls) => 325 cls.startsWith(' nbc-carousel-cols-')371 cls.startsWith('abcs-cols-') 326 372 ); 327 const hasMinWidthClass = classArray.includes(' nbc-carousel-min-width');373 const hasMinWidthClass = classArray.includes('abcs-min-width'); 328 374 329 375 let expectedColsClass = null; … … 336 382 // If a column count is defined (up to 8 columns) 337 383 if (columnCount && columnCount >= 1 && columnCount <= 8) { 338 expectedColsClass = ` nbc-carousel-cols-${columnCount}`;384 expectedColsClass = `abcs-cols-${columnCount}`; 339 385 } 340 386 // Otherwise default to 3 columns 341 387 else { 342 expectedColsClass = ' nbc-carousel-cols-3';388 expectedColsClass = 'abcs-cols-3'; 343 389 } 344 390 } … … 357 403 if (columnCount && columnCount >= 1 && columnCount <= 16) { 358 404 // Manual grid mode: ignore minimumColumnWidth and gridItemPosition 359 expectedColsClass = ` nbc-carousel-cols-${columnCount}`;405 expectedColsClass = `abcs-cols-${columnCount}`; 360 406 shouldHaveMinWidthClass = false; 361 407 } … … 372 418 // Otherwise default to 3 columns 373 419 else { 374 expectedColsClass = ' nbc-carousel-cols-3';420 expectedColsClass = 'abcs-cols-3'; 375 421 shouldHaveMinWidthClass = false; 376 422 } … … 382 428 const filteredClasses = classArray.filter( 383 429 (cls) => 384 !cls.startsWith(' nbc-carousel-cols-') &&385 cls !== ' nbc-carousel-min-width' &&430 !cls.startsWith('abcs-cols-') && 431 cls !== 'abcs-min-width' && 386 432 // Remove legacy classes kept for migration purposes 387 433 !cls.startsWith('carousel-cols-') && … … 394 440 } 395 441 if (shouldHaveMinWidthClass) { 396 filteredClasses.push(' nbc-carousel-min-width');442 filteredClasses.push('abcs-min-width'); 397 443 } 398 444 … … 413 459 const baseClasses = classArray.filter( 414 460 (cls) => 415 !cls.startsWith(' nbc-carousel-icon-') &&416 cls !== ' nbc-carousel-hide-arrows' &&417 cls !== ' nbc-carousel-hide-markers'461 !cls.startsWith('abcs-icon-') && 462 cls !== 'abcs-hide-arrows' && 463 cls !== 'abcs-hide-markers' 418 464 ); 419 465 const normalizedStyle = normalizedArrowStyle; 420 const desiredClass = ` nbc-carousel-icon-${normalizedStyle}`;466 const desiredClass = `abcs-icon-${normalizedStyle}`; 421 467 422 468 let nextClasses = [...baseClasses]; … … 427 473 nextClasses.push(desiredClass); 428 474 } 429 } else if (!nextClasses.includes(' nbc-carousel-hide-arrows')) {430 nextClasses.push(' nbc-carousel-hide-arrows');431 } 432 433 if (!carouselShowMarkers && !nextClasses.includes(' nbc-carousel-hide-markers')) {434 nextClasses.push(' nbc-carousel-hide-markers');475 } else if (!nextClasses.includes('abcs-hide-arrows')) { 476 nextClasses.push('abcs-hide-arrows'); 477 } 478 479 if (!carouselShowMarkers && !nextClasses.includes('abcs-hide-markers')) { 480 nextClasses.push('abcs-hide-markers'); 435 481 } 436 482 } … … 453 499 if (doc && typeof requestAnimationFrame === 'function') { 454 500 const runUpdate = () => { 455 const blockWrapper = doc.querySelector(`[data-block="${clientId}"]`); 456 let targetCarousel = null; 457 458 if (blockWrapper) { 459 if (blockWrapper.classList && blockWrapper.classList.contains('nbc-carousel')) { 460 targetCarousel = blockWrapper; 461 } else { 462 targetCarousel = blockWrapper.querySelector('.nbc-carousel'); 463 } 464 } 465 466 if (!targetCarousel) { 501 const blockWrappers = findBlockWrapperElements(doc, clientId); 502 if (!blockWrappers.length) { 467 503 return; 468 504 } 469 505 470 const config = { 471 styleKey: normalizedStyle, 472 elements: [targetCarousel], 473 }; 474 475 applyArrowIconsToCarousels(null, doc, config); 476 477 setTimeout(() => { 478 applyArrowIconsToCarousels(null, doc, config); 479 }, 50); 506 const carouselsByDocument = new Map(); 507 508 blockWrappers.forEach((wrapper) => { 509 if (!wrapper) { 510 return; 511 } 512 513 const potentialTargets = []; 514 515 if (wrapper.classList && wrapper.classList.contains('abcs')) { 516 potentialTargets.push(wrapper); 517 } 518 519 const descendants = wrapper.querySelectorAll('.abcs'); 520 descendants.forEach((node) => { 521 potentialTargets.push(node); 522 }); 523 524 potentialTargets.forEach((carouselNode) => { 525 if (!carouselNode) { 526 return; 527 } 528 529 const ownerDocument = carouselNode.ownerDocument || doc; 530 if (!carouselsByDocument.has(ownerDocument)) { 531 carouselsByDocument.set(ownerDocument, new Set()); 532 } 533 534 carouselsByDocument.get(ownerDocument).add(carouselNode); 535 }); 536 }); 537 538 if (!carouselsByDocument.size) { 539 return; 540 } 541 542 carouselsByDocument.forEach((carouselSet, ownerDocument) => { 543 const elements = Array.from(carouselSet); 544 if (!elements.length) { 545 return; 546 } 547 548 const config = { 549 styleKey: normalizedStyle, 550 elements, 551 }; 552 553 applyArrowIconsToCarousels(null, ownerDocument, config); 554 555 setTimeout(() => { 556 applyArrowIconsToCarousels(null, ownerDocument, config); 557 }, 50); 558 }); 480 559 }; 481 560 … … 492 571 } 493 572 494 const styleId = ' nbc-arrow-style-control-styles';573 const styleId = 'abcs-arrow-style-control-styles'; 495 574 if (document.getElementById(styleId)) { 496 575 return; … … 501 580 style.type = 'text/css'; 502 581 style.textContent = ` 503 . nbc-arrow-style-panel .components-base-control__field,504 . nbc-arrow-style-panel .components-toggle-group-control {582 .abcs-arrow-style-panel .components-base-control__field, 583 .abcs-arrow-style-panel .components-toggle-group-control { 505 584 display: grid; 506 585 justify-content: center; 507 586 } 508 . nbc-arrow-style-panel .components-toggle-group-control {587 .abcs-arrow-style-panel .components-toggle-group-control { 509 588 width: 100%; 510 589 } 511 . nbc-arrow-style-panel .nbc-arrow-style-group {590 .abcs-arrow-style-panel .abcs-arrow-style-group { 512 591 gap: 8px; 513 592 } 514 . nbc-arrow-style-group.components-toggle-group-control {593 .abcs-arrow-style-group.components-toggle-group-control { 515 594 display: flex; 516 595 flex-wrap: wrap; 517 596 } 518 . nbc-arrow-style-group .components-toggle-group-control__option {519 -- nbc-arrow-option-size: 44px;520 width: var(-- nbc-arrow-option-size);521 height: var(-- nbc-arrow-option-size);522 min-width: var(-- nbc-arrow-option-size);523 min-height: var(-- nbc-arrow-option-size);524 flex: 0 0 var(-- nbc-arrow-option-size);597 .abcs-arrow-style-group .components-toggle-group-control__option { 598 --abcs-arrow-option-size: 44px; 599 width: var(--abcs-arrow-option-size); 600 height: var(--abcs-arrow-option-size); 601 min-width: var(--abcs-arrow-option-size); 602 min-height: var(--abcs-arrow-option-size); 603 flex: 0 0 var(--abcs-arrow-option-size); 525 604 padding: 0; 526 605 border-radius: 10px; … … 535 614 box-sizing: border-box; 536 615 } 537 . nbc-arrow-style-group .components-toggle-group-control__option > span {616 .abcs-arrow-style-group .components-toggle-group-control__option > span { 538 617 display: flex; 539 618 align-items: center; … … 543 622 line-height: 0; 544 623 } 545 . nbc-arrow-style-group .components-toggle-group-control__option:hover {624 .abcs-arrow-style-group .components-toggle-group-control__option:hover { 546 625 box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); 547 626 transform: translateY(-1px); 548 627 } 549 . nbc-arrow-style-group .components-toggle-group-control__option.is-selected {628 .abcs-arrow-style-group .components-toggle-group-control__option.is-selected { 550 629 background: var(--wp-admin-theme-color, #3858e9); 551 630 border-color: var(--wp-admin-theme-color, #3858e9); … … 554 633 transform: none; 555 634 } 556 . nbc-arrow-style-icon {635 .abcs-arrow-style-icon { 557 636 display: flex; 558 637 align-items: center; … … 561 640 height: 100%; 562 641 } 563 . nbc-arrow-style-icon svg {642 .abcs-arrow-style-icon svg { 564 643 width: 20px; 565 644 height: 20px; … … 583 662 PanelBody, 584 663 { 585 title: __('Carousel', ' native-blocks-carousel'),664 title: __('Carousel', 'any-block-carousel-slider'), 586 665 initialOpen: true, 587 666 }, 588 667 createElement(ToggleControl, { 589 label: __('Enable carousel', ' native-blocks-carousel'),668 label: __('Enable carousel', 'any-block-carousel-slider'), 590 669 checked: carouselEnabled, 591 670 __nextHasNoMarginBottom: true, … … 595 674 ? __( 596 675 'Carousel is enabled. The number of visible columns is detected automatically from the gallery settings.', 597 ' native-blocks-carousel'676 'any-block-carousel-slider' 598 677 ) 599 678 : (name === 'core/group' || name === 'core/post-template') && attributes.layout?.type === 'grid' … … 601 680 ? __( 602 681 'Carousel is enabled in Auto mode. Slide width is set by the "Minimum column width" (' + attributes.layout.minimumColumnWidth + ').', 603 ' native-blocks-carousel'682 'any-block-carousel-slider' 604 683 ) 605 684 : attributes.layout?.columnCount 606 685 ? __( 607 686 'Carousel is enabled in Manual mode. The number of visible columns (' + attributes.layout.columnCount + ') is taken from the grid settings.', 608 ' native-blocks-carousel'687 'any-block-carousel-slider' 609 688 ) 610 689 : __( 611 690 'Carousel is enabled. Configure the column count or minimum width in the grid settings.', 612 ' native-blocks-carousel'691 'any-block-carousel-slider' 613 692 ) 614 693 : __( 615 694 'Carousel is enabled. Items scroll horizontally.', 616 ' native-blocks-carousel'695 'any-block-carousel-slider' 617 696 ) 618 697 : __( 619 698 'Enable to convert this block into a carousel with navigation. You can then choose Manual mode (column count) or Auto mode (minimum column width).', 620 ' native-blocks-carousel'699 'any-block-carousel-slider' 621 700 ), 622 701 }), 623 702 carouselEnabled 624 703 ? createElement(ToggleControl, { 625 label: __('Display navigation arrows', ' native-blocks-carousel'),704 label: __('Display navigation arrows', 'any-block-carousel-slider'), 626 705 checked: carouselShowArrows, 627 706 __nextHasNoMarginBottom: true, … … 632 711 ? __( 633 712 'Navigation arrows are visible on the carousel.', 634 ' native-blocks-carousel'713 'any-block-carousel-slider' 635 714 ) 636 715 : __( 637 716 'Arrows are hidden. Users can navigate via swipe or scroll.', 638 ' native-blocks-carousel'717 'any-block-carousel-slider' 639 718 ), 640 719 }) … … 642 721 carouselEnabled 643 722 ? createElement(ToggleControl, { 644 label: __('Display pagination markers', ' native-blocks-carousel'),723 label: __('Display pagination markers', 'any-block-carousel-slider'), 645 724 checked: carouselShowMarkers, 646 725 __nextHasNoMarginBottom: true, … … 651 730 ? __( 652 731 'Pagination markers are displayed below the carousel.', 653 ' native-blocks-carousel'732 'any-block-carousel-slider' 654 733 ) 655 734 : __( 656 735 'Pagination markers are hidden for a cleaner layout.', 657 ' native-blocks-carousel'736 'any-block-carousel-slider' 658 737 ), 659 738 }) … … 663 742 PanelBody, 664 743 { 665 title: __('Arrow style', ' native-blocks-carousel'),744 title: __('Arrow style', 'any-block-carousel-slider'), 666 745 initialOpen: true, 667 className: ' nbc-arrow-style-panel',746 className: 'abcs-arrow-style-panel', 668 747 }, 669 748 createElement( 670 749 ToggleGroupControl, 671 750 { 672 className: ' nbc-arrow-style-group',751 className: 'abcs-arrow-style-group', 673 752 value: normalizedArrowStyle, 674 753 isBlock: false, … … 686 765 label: option.label, 687 766 icon: buildIconElement(option.value), 688 className: ' nbc-arrow-style-option',767 className: 'abcs-arrow-style-option', 689 768 'aria-label': option.label, 690 769 showTooltip: true, … … 718 797 if (typeof window !== 'undefined' && window.getComputedStyle) { 719 798 const node = props?.clientId ? document.querySelector(`[data-block="${props.clientId}"]`) : null; 720 const carouselNode = node && node.classList.contains(' nbc-carousel') ? node : node?.querySelector?.('.nbc-carousel');799 const carouselNode = node && node.classList.contains('abcs') ? node : node?.querySelector?.('.abcs'); 721 800 if (carouselNode) { 722 801 const computedGap = window.getComputedStyle(carouselNode).gap || window.getComputedStyle(carouselNode).columnGap; … … 837 916 ...customStyles, 838 917 }, 839 'data- nbc-carousel-arrow-style': attributes.carouselArrowStyle || DEFAULT_ARROW_STYLE,918 'data-abcs-arrow-style': attributes.carouselArrowStyle || DEFAULT_ARROW_STYLE, 840 919 }, 841 920 }; … … 848 927 addFilter( 849 928 'blocks.registerBlockType', 850 ' native-blocks-carousel/add-carousel-attribute',929 'any-block-carousel-slider/add-carousel-attribute', 851 930 addCarouselAttribute 852 931 ); … … 854 933 addFilter( 855 934 'editor.BlockEdit', 856 ' native-blocks-carousel/with-carousel-control',935 'any-block-carousel-slider/with-carousel-control', 857 936 withCarouselControl 858 937 ); … … 860 939 addFilter( 861 940 'editor.BlockListBlock', 862 ' native-blocks-carousel/with-carousel-styles',941 'any-block-carousel-slider/with-carousel-styles', 863 942 withCarouselStyles 864 943 ); … … 870 949 */ 871 950 function copyPaddingVariablesToParent() { 872 const carousels = document.querySelectorAll('. nbc-carousel');951 const carousels = document.querySelectorAll('.abcs'); 873 952 carousels.forEach(function (carousel) { 874 953 const computedStyle = window.getComputedStyle(carousel); … … 1098 1177 } 1099 1178 1100 if (element.dataset && element.dataset. nbcCarouselArrowStyle) {1101 const normalizedDatasetStyle = normalizeStyleKey(element.dataset. nbcCarouselArrowStyle);1179 if (element.dataset && element.dataset.abcsCarouselArrowStyle) { 1180 const normalizedDatasetStyle = normalizeStyleKey(element.dataset.abcsCarouselArrowStyle); 1102 1181 if (isValidArrowStyle(normalizedDatasetStyle)) { 1103 1182 return normalizedDatasetStyle; … … 1105 1184 } 1106 1185 1107 const parentWithData = element.closest('[data- nbc-carousel-arrow-style]');1108 if (parentWithData && parentWithData.dataset && parentWithData.dataset. nbcCarouselArrowStyle) {1109 const normalizedParentStyle = normalizeStyleKey(parentWithData.dataset. nbcCarouselArrowStyle);1186 const parentWithData = element.closest('[data-abcs-arrow-style]'); 1187 if (parentWithData && parentWithData.dataset && parentWithData.dataset.abcsCarouselArrowStyle) { 1188 const normalizedParentStyle = normalizeStyleKey(parentWithData.dataset.abcsCarouselArrowStyle); 1110 1189 if (isValidArrowStyle(normalizedParentStyle)) { 1111 1190 return normalizedParentStyle; … … 1113 1192 } 1114 1193 1115 const iconClass = Array.from(element.classList).find((cls) => cls.startsWith(' nbc-carousel-icon-'));1194 const iconClass = Array.from(element.classList).find((cls) => cls.startsWith('abcs-icon-')); 1116 1195 1117 1196 if (iconClass) { 1118 const styleKey = normalizeStyleKey(iconClass.replace(' nbc-carousel-icon-', ''));1197 const styleKey = normalizeStyleKey(iconClass.replace('abcs-icon-', '')); 1119 1198 if (isValidArrowStyle(styleKey)) { 1120 1199 return styleKey; … … 1181 1260 docsToSearch.forEach((searchDoc) => { 1182 1261 try { 1183 const found = Array.from(searchDoc.querySelectorAll('. nbc-carousel'));1262 const found = Array.from(searchDoc.querySelectorAll('.abcs')); 1184 1263 if (found.length) { 1185 1264 found.forEach((node) => { … … 1211 1290 const parent = carousel.parentElement; 1212 1291 1213 if (carousel.classList && carousel.classList.contains(' nbc-carousel-hide-arrows')) {1292 if (carousel.classList && carousel.classList.contains('abcs-hide-arrows')) { 1214 1293 carousel.style.setProperty('--carousel-button-arrow-left', 'none'); 1215 1294 carousel.style.setProperty('--carousel-button-arrow-right', 'none'); … … 1235 1314 1236 1315 if (carousel.dataset) { 1237 carousel.dataset.nbcCarouselArrowStyle = styleKey; 1316 carousel.dataset.abcsCarouselArrowStyle = styleKey; 1317 carousel.dataset.abcsArrowStyle = styleKey; 1238 1318 } 1239 1319 … … 1243 1323 if (parent) { 1244 1324 if (parent.dataset) { 1245 parent.dataset.nbcCarouselArrowStyle = styleKey; 1325 parent.dataset.abcsCarouselArrowStyle = styleKey; 1326 parent.dataset.abcsArrowStyle = styleKey; 1246 1327 } 1247 1328 parent.style.setProperty('--carousel-button-arrow-left', `url("${leftArrowSvg}")`); … … 1382 1463 shouldUpdate = true; 1383 1464 } 1384 if (node.nodeType === 1 && node.classList && node.classList.contains(' nbc-carousel')) {1465 if (node.nodeType === 1 && node.classList && node.classList.contains('abcs')) { 1385 1466 shouldUpdate = true; 1386 1467 } … … 1537 1618 1538 1619 if (typeof window !== 'undefined') { 1539 window. nbcCarousel = window.nbcCarousel || {};1540 window. nbcCarousel.applyArrowIconsToCarousels = (color, context, overrideConfig) => {1620 window.abcsCarousel = window.abcsCarousel || {}; 1621 window.abcsCarousel.applyArrowIconsToCarousels = (color, context, overrideConfig) => { 1541 1622 const normalizedConfig = overrideConfig ? { 1542 1623 ...overrideConfig, -
native-blocks-carousel/trunk/assets/js/carousel-frontend-init.js
r3394953 r3395126 1 1 /** 2 * Frontend script for Native Blocks Carousel2 * Frontend script for Any Block Carousel Slider 3 3 * Injects missing CSS variables for the minimumColumnWidth mode. 4 4 * 5 * @package NativeBlocksCarousel5 * @package AnyBlockCarouselSlider 6 6 * @version 1.0.2 7 7 * @author weblazer35 … … 11 11 'use strict'; 12 12 13 const SHARED = window. NativeBlocksCarouselShared || {};13 const SHARED = window.AnyBlockCarouselSliderShared || {}; 14 14 const FALLBACK_DEFAULT_ARROW_STYLE = 'chevron'; 15 15 const DEFAULT_ARROW_STYLE = SHARED.DEFAULT_ARROW_STYLE || FALLBACK_DEFAULT_ARROW_STYLE; … … 180 180 */ 181 181 function injectMinWidthVariables() { 182 // Find all carousels with the nbc-carousel-min-width class183 const carousels = document.querySelectorAll('. nbc-carousel.nbc-carousel-min-width');182 // Find all carousels with the abcs-min-width class 183 const carousels = document.querySelectorAll('.abcs.abcs-min-width'); 184 184 185 185 carousels.forEach(function (carousel) { … … 217 217 */ 218 218 function injectPaddingVariables() { 219 const carousels = document.querySelectorAll('. nbc-carousel');219 const carousels = document.querySelectorAll('.abcs'); 220 220 221 221 carousels.forEach(function (carousel) { … … 324 324 325 325 const iconClass = Array.prototype.find.call(element.classList, function (cls) { 326 return cls.indexOf(' nbc-carousel-icon-') === 0;326 return cls.indexOf('abcs-icon-') === 0; 327 327 }); 328 328 329 329 if (iconClass) { 330 const styleKey = iconClass.replace(' nbc-carousel-icon-', '');330 const styleKey = iconClass.replace('abcs-icon-', ''); 331 331 return normalizeStyleKey(styleKey); 332 332 } … … 390 390 docsToSearch.forEach((searchDoc) => { 391 391 try { 392 const found = Array.from(searchDoc.querySelectorAll('. nbc-carousel'));392 const found = Array.from(searchDoc.querySelectorAll('.abcs')); 393 393 found.forEach((node) => { 394 394 if (node) { … … 417 417 const parent = carousel.parentElement; 418 418 419 if (carousel.classList && carousel.classList.contains(' nbc-carousel-hide-arrows')) {419 if (carousel.classList && carousel.classList.contains('abcs-hide-arrows')) { 420 420 carousel.style.setProperty('--carousel-button-arrow-left', 'none'); 421 421 carousel.style.setProperty('--carousel-button-arrow-right', 'none'); … … 441 441 carousel.style.setProperty('--carousel-button-arrow-left', 'url("' + leftArrowSvg + '")'); 442 442 carousel.style.setProperty('--carousel-button-arrow-right', 'url("' + rightArrowSvg + '")'); 443 if (carousel.dataset) { 444 carousel.dataset.abcsCarouselArrowStyle = styleKey; 445 carousel.dataset.abcsArrowStyle = styleKey; 446 } 443 447 444 448 if (parent) { 449 if (parent.dataset) { 450 parent.dataset.abcsCarouselArrowStyle = styleKey; 451 parent.dataset.abcsArrowStyle = styleKey; 452 } 445 453 parent.style.setProperty('--carousel-button-arrow-left', 'url("' + leftArrowSvg + '")'); 446 454 parent.style.setProperty('--carousel-button-arrow-right', 'url("' + rightArrowSvg + '")'); … … 521 529 window.addEventListener('load', function () { 522 530 // Check whether --carousel-min-width is missing on some carousels 523 const carousels = document.querySelectorAll('. nbc-carousel.nbc-carousel-min-width');531 const carousels = document.querySelectorAll('.abcs.abcs-min-width'); 524 532 let needsMinWidthUpdate = false; 525 533 carousels.forEach(function (carousel) { … … 552 560 553 561 if (typeof window !== 'undefined') { 554 window. nbcCarousel = window.nbcCarousel || {};555 window. nbcCarousel.applyArrowIconsToCarousels = function (color, context, overrideConfig) {562 window.abcsCarousel = window.abcsCarousel || {}; 563 window.abcsCarousel.applyArrowIconsToCarousels = function (color, context, overrideConfig) { 556 564 const normalizedConfig = overrideConfig ? { 557 565 ...overrideConfig, -
native-blocks-carousel/trunk/assets/js/carousel-shared.js
r3394953 r3395126 2 2 'use strict'; 3 3 4 const shared = global. NativeBlocksCarouselShared || {};4 const shared = global.AnyBlockCarouselSliderShared || {}; 5 5 6 6 const DEFAULT_ARROW_STYLE = 'chevron'; … … 110 110 shared.generateArrowMarkup = generateArrowMarkup; 111 111 112 global. NativeBlocksCarouselShared = shared;112 global.AnyBlockCarouselSliderShared = shared; 113 113 })(window); 114 114 -
native-blocks-carousel/trunk/includes/Activator.php
r3394953 r3395126 3 3 * Handles plugin activation and deactivation. 4 4 * 5 * @package NativeBlocksCarousel5 * @package AnyBlockCarouselSlider 6 6 */ 7 7 8 8 declare(strict_types=1); 9 9 10 namespace Weblazer\ NativeBlocksCarousel;10 namespace Weblazer\AnyBlockCarouselSlider; 11 11 12 12 /** … … 24 24 if (\version_compare(\get_bloginfo('version'), '6.0', '<')) { 25 25 \wp_die( 26 \esc_html__('This plugin requires WordPress 6.0 or later.', ' native-blocks-carousel'),27 \esc_html__('WordPress version too low', ' native-blocks-carousel')26 \esc_html__('This plugin requires WordPress 6.0 or later.', 'any-block-carousel-slider'), 27 \esc_html__('WordPress version too low', 'any-block-carousel-slider') 28 28 ); 29 29 } … … 31 31 if (\version_compare(\PHP_VERSION, '7.4', '<')) { 32 32 \wp_die( 33 \esc_html__('This plugin requires PHP 7.4 or later.', ' native-blocks-carousel'),34 \esc_html__('PHP version too low', ' native-blocks-carousel')33 \esc_html__('This plugin requires PHP 7.4 or later.', 'any-block-carousel-slider'), 34 \esc_html__('PHP version too low', 'any-block-carousel-slider') 35 35 ); 36 36 } -
native-blocks-carousel/trunk/includes/Assets.php
r3394953 r3395126 1 1 <?php 2 2 /** 3 * Handles asset loading for Native Blocks Carousel.3 * Handles asset loading for Any Block Carousel Slider. 4 4 * 5 * @package NativeBlocksCarousel5 * @package AnyBlockCarouselSlider 6 6 */ 7 7 8 8 declare(strict_types=1); 9 9 10 namespace Weblazer\ NativeBlocksCarousel;10 namespace Weblazer\AnyBlockCarouselSlider; 11 11 12 use Weblazer\ NativeBlocksCarousel\Contracts\ServiceInterface;12 use Weblazer\AnyBlockCarouselSlider\Contracts\ServiceInterface; 13 13 14 14 /** … … 73 73 74 74 \wp_enqueue_style( 75 ' native-blocks-carousel',75 'any-block-carousel-slider', 76 76 $this->pluginUrl . 'assets/css/carousel.css', 77 77 [], … … 79 79 ); 80 80 81 \wp_enqueue_script(' native-blocks-carousel-shared');81 \wp_enqueue_script('any-block-carousel-slider-shared'); 82 82 83 83 if (!\is_admin()) { 84 \wp_enqueue_script(' native-blocks-carousel-frontend');84 \wp_enqueue_script('any-block-carousel-slider-frontend'); 85 85 } 86 86 … … 97 97 $this->registerScripts(); 98 98 99 \wp_enqueue_style(' native-blocks-carousel');99 \wp_enqueue_style('any-block-carousel-slider'); 100 100 101 $editorStylesPath = NATIVE_BLOCKS_CAROUSEL_PLUGIN_PATH . 'assets/css/carousel-editor.css';101 $editorStylesPath = ANY_BLOCK_CAROUSEL_SLIDER_PLUGIN_PATH . 'assets/css/carousel-editor.css'; 102 102 if (\file_exists($editorStylesPath)) { 103 103 $editorStyles = \file_get_contents($editorStylesPath); 104 104 if ($editorStyles) { 105 \wp_add_inline_style(' native-blocks-carousel', $editorStyles);105 \wp_add_inline_style('any-block-carousel-slider', $editorStyles); 106 106 } 107 107 } 108 108 109 \wp_enqueue_script(' native-blocks-carousel-shared');109 \wp_enqueue_script('any-block-carousel-slider-shared'); 110 110 111 \wp_enqueue_script(' native-blocks-carousel-editor');111 \wp_enqueue_script('any-block-carousel-slider-editor'); 112 112 } 113 113 … … 119 119 private function registerScripts(): void 120 120 { 121 if (!\wp_script_is(' native-blocks-carousel-shared', 'registered')) {121 if (!\wp_script_is('any-block-carousel-slider-shared', 'registered')) { 122 122 \wp_register_script( 123 ' native-blocks-carousel-shared',123 'any-block-carousel-slider-shared', 124 124 $this->pluginUrl . 'assets/js/carousel-shared.js', 125 125 [], … … 129 129 } 130 130 131 if (!\wp_script_is(' native-blocks-carousel-frontend', 'registered')) {131 if (!\wp_script_is('any-block-carousel-slider-frontend', 'registered')) { 132 132 \wp_register_script( 133 ' native-blocks-carousel-frontend',133 'any-block-carousel-slider-frontend', 134 134 $this->pluginUrl . 'assets/js/carousel-frontend-init.js', 135 [' native-blocks-carousel-shared'],135 ['any-block-carousel-slider-shared'], 136 136 $this->version, 137 137 true … … 139 139 } 140 140 141 if (!\wp_script_is(' native-blocks-carousel-editor', 'registered')) {141 if (!\wp_script_is('any-block-carousel-slider-editor', 'registered')) { 142 142 \wp_register_script( 143 ' native-blocks-carousel-editor',143 'any-block-carousel-slider-editor', 144 144 $this->pluginUrl . 'assets/js/carousel-editor.js', 145 145 [ 146 ' native-blocks-carousel-shared',146 'any-block-carousel-slider-shared', 147 147 'wp-blocks', 148 148 'wp-element', -
native-blocks-carousel/trunk/includes/Autoloader.php
r3394953 r3395126 1 1 <?php 2 2 /** 3 * Basic autoloader for Native Blocks Carouselclasses.3 * Basic autoloader for Any Block Carousel Slider classes. 4 4 * 5 * @package NativeBlocksCarousel5 * @package AnyBlockCarouselSlider 6 6 */ 7 7 8 8 declare(strict_types=1); 9 9 10 namespace Weblazer\ NativeBlocksCarousel;10 namespace Weblazer\AnyBlockCarouselSlider; 11 11 12 12 /** -
native-blocks-carousel/trunk/includes/Contracts/ServiceInterface.php
r3394953 r3395126 1 1 <?php 2 2 /** 3 * Generic contract for Native Blocks Carouselservices.3 * Generic contract for Any Block Carousel Slider services. 4 4 * 5 * @package NativeBlocksCarousel5 * @package AnyBlockCarouselSlider 6 6 */ 7 7 8 8 declare(strict_types=1); 9 9 10 namespace Weblazer\ NativeBlocksCarousel\Contracts;10 namespace Weblazer\AnyBlockCarouselSlider\Contracts; 11 11 12 12 interface ServiceInterface -
native-blocks-carousel/trunk/includes/Contracts/TranslatableInterface.php
r3393718 r3395126 3 3 * Contrat pour les services responsables du chargement des traductions. 4 4 * 5 * @package NativeBlocksCarousel5 * @package AnyBlockCarouselSlider 6 6 */ 7 7 8 8 declare(strict_types=1); 9 9 10 namespace Weblazer\ NativeBlocksCarousel\Contracts;10 namespace Weblazer\AnyBlockCarouselSlider\Contracts; 11 11 12 12 interface TranslationServiceInterface extends ServiceInterface -
native-blocks-carousel/trunk/includes/Contracts/TranslationServiceInterface.php
r3393718 r3395126 3 3 * Contrat pour les services responsables du chargement des traductions. 4 4 * 5 * @package NativeBlocksCarousel5 * @package AnyBlockCarouselSlider 6 6 */ 7 7 8 8 declare(strict_types=1); 9 9 10 namespace Weblazer\ NativeBlocksCarousel\Contracts;10 namespace Weblazer\AnyBlockCarouselSlider\Contracts; 11 11 12 12 interface TranslationServiceInterface extends ServiceInterface -
native-blocks-carousel/trunk/includes/Plugin.php
r3394953 r3395126 1 1 <?php 2 2 /** 3 * Main class for the Native Blocks Carouselplugin.3 * Main class for the Any Block Carousel Slider plugin. 4 4 * 5 * @package NativeBlocksCarousel5 * @package AnyBlockCarouselSlider 6 6 */ 7 7 8 8 declare(strict_types=1); 9 9 10 namespace Weblazer\ NativeBlocksCarousel;10 namespace Weblazer\AnyBlockCarouselSlider; 11 11 12 use Weblazer\ NativeBlocksCarousel\Contracts\ServiceInterface;13 use Weblazer\ NativeBlocksCarousel\Translations;12 use Weblazer\AnyBlockCarouselSlider\Contracts\ServiceInterface; 13 use Weblazer\AnyBlockCarouselSlider\Translations; 14 14 15 15 /** … … 54 54 new Translations(), 55 55 new Assets( 56 NATIVE_BLOCKS_CAROUSEL_VERSION,57 NATIVE_BLOCKS_CAROUSEL_PLUGIN_URL,56 ANY_BLOCK_CAROUSEL_SLIDER_VERSION, 57 ANY_BLOCK_CAROUSEL_SLIDER_PLUGIN_URL, 58 58 $theme_styles 59 59 ), -
native-blocks-carousel/trunk/includes/Renderer.php
r3394953 r3395126 3 3 * Logic responsible for injecting CSS variables into rendered blocks. 4 4 * 5 * @package NativeBlocksCarousel5 * @package AnyBlockCarouselSlider 6 6 */ 7 7 8 8 declare(strict_types=1); 9 9 10 namespace Weblazer\ NativeBlocksCarousel;11 12 use Weblazer\ NativeBlocksCarousel\Contracts\ServiceInterface;10 namespace Weblazer\AnyBlockCarouselSlider; 11 12 use Weblazer\AnyBlockCarouselSlider\Contracts\ServiceInterface; 13 13 14 14 /** … … 38 38 { 39 39 $class_name = $block['attrs']['className'] ?? ''; 40 $has_carousel_class = false !== \strpos($class_name, ' nbc-carousel')41 || false !== \strpos($block_content, ' nbc-carousel');40 $has_carousel_class = false !== \strpos($class_name, 'abcs') 41 || false !== \strpos($block_content, 'abcs'); 42 42 43 43 if (!$has_carousel_class) { … … 59 59 $processor = new \WP_HTML_Tag_Processor($block_content); 60 60 61 if ($processor->next_tag(['class_name' => ' nbc-carousel'])) {61 if ($processor->next_tag(['class_name' => 'abcs'])) { 62 62 $existing_style = $processor->get_attribute('style'); 63 63 $processor->set_attribute('style', $this->mergeStyleAttribute($existing_style, $styles_string)); … … 71 71 } 72 72 73 $pattern = '/(<(?:div|ul|figure)\s+[^>]*class="[^"]*\b nbc-carousel\b[^"]*"[^>]*?)(?:\s+style="([^"]*)")?(\s*>)/i';73 $pattern = '/(<(?:div|ul|figure)\s+[^>]*class="[^"]*\babcs\b[^"]*"[^>]*?)(?:\s+style="([^"]*)")?(\s*>)/i'; 74 74 75 75 $replacement = function (array $matches) use ($styles_string) { … … 102 102 if ( 103 103 ('core/group' !== ($block['blockName'] ?? '') && 'core/post-template' !== ($block['blockName'] ?? '')) 104 || false === \strpos($class_name, ' nbc-carousel-min-width')104 || false === \strpos($class_name, 'abcs-min-width') 105 105 ) { 106 106 return; … … 182 182 183 183 if (null === $padding_left && null === $padding_right && null === $padding_top && null === $padding_bottom) { 184 if (\preg_match('/(<(?:div|ul|figure)[^>]*class="[^"]*\b nbc-carousel\b[^"]*"[^>]*?)(?:\s+style="([^"]*)")?/i', $block_content, $carousel_matches)) {184 if (\preg_match('/(<(?:div|ul|figure)[^>]*class="[^"]*\babcs\b[^"]*"[^>]*?)(?:\s+style="([^"]*)")?/i', $block_content, $carousel_matches)) { 185 185 $style_attr = $carousel_matches[2] ?? ''; 186 186 -
native-blocks-carousel/trunk/includes/ThemeStyles.php
r3394953 r3395126 1 1 <?php 2 2 /** 3 * Handles theme-inherited styles for Native Blocks Carousel.3 * Handles theme-inherited styles for Any Block Carousel Slider. 4 4 * 5 * @package NativeBlocksCarousel5 * @package AnyBlockCarouselSlider 6 6 */ 7 7 8 8 declare(strict_types=1); 9 9 10 namespace Weblazer\ NativeBlocksCarousel;10 namespace Weblazer\AnyBlockCarouselSlider; 11 11 12 12 /** … … 64 64 65 65 if (!empty($button_bg) || !empty($button_color)) { 66 \wp_add_inline_style(' native-blocks-carousel', $custom_css);66 \wp_add_inline_style('any-block-carousel-slider', $custom_css); 67 67 } 68 68 } -
native-blocks-carousel/trunk/includes/Translations.php
r3393718 r3395126 1 1 <?php 2 2 /** 3 * Service de chargement des traductions pour Native Blocks Carousel.3 * Service de chargement des traductions pour Any Block Carousel Slider. 4 4 * 5 * @package NativeBlocksCarousel5 * @package AnyBlockCarouselSlider 6 6 */ 7 7 8 8 declare(strict_types=1); 9 9 10 namespace Weblazer\ NativeBlocksCarousel;10 namespace Weblazer\AnyBlockCarouselSlider; 11 11 12 use Weblazer\ NativeBlocksCarousel\Contracts\TranslationServiceInterface;12 use Weblazer\AnyBlockCarouselSlider\Contracts\TranslationServiceInterface; 13 13 14 14 class Translations implements TranslationServiceInterface … … 28 28 { 29 29 load_plugin_textdomain( 30 ' native-blocks-carousel',30 'any-block-carousel-slider', 31 31 false, 32 dirname(plugin_basename( NATIVE_BLOCKS_CAROUSEL_PLUGIN_FILE)) . '/languages'32 dirname(plugin_basename(ANY_BLOCK_CAROUSEL_SLIDER_PLUGIN_FILE)) . '/languages' 33 33 ); 34 34 } -
native-blocks-carousel/trunk/readme.txt
r3394953 r3395126 1 === Native Blocks Carousel===1 === Any Block Carousel Slider === 2 2 Contributors: weblazer 3 3 Donate link: https://weblazer.github.io/ 4 Tags: carousel, gutenberg, query-loop, woocommerce, css-only4 Tags: carousel, slider, block, gutenberg, query-loop 5 5 Requires at least: 6.0 6 6 Tested up to: 6.8 7 Stable tag: 1.0. 27 Stable tag: 1.0.3 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Transform any WordPress block into a responsive Gutenberg carousel with pure CSS. Works with Query Loop, Gallery, WooCommerce Products, and custom blocks. Zero JavaScript, maximum performance.12 Gutenberg carousel slider block: transform any WordPress block into a responsive carousel with pure CSS. Zero JavaScript. 13 13 14 14 == Description == 15 15 16 ** Native Blocks Carousel** instantly converts any native WordPress block (Gallery, Group, Grid, Query Loop, Post Template, WooCommerce Products, etc.) into a responsive carousel without adding a dedicated block or loading a JavaScript library. Simply enable the "Carousel" toggle in theeditor: your content stays 100% native, your DOM stays lightweight, and your Lighthouse performance scores remain intact.17 18 Unlike all-in-one carousel blocks like **Carousel Slider v2** that require you to add a "Carousel" block and manually recreate each slide ([see official listing](https://wordpress.org/plugins/carousel-block/)), **Native Blocks Carousel** hooks directly into the blocks you're already using. Result: a WordPress loop, image gallery, or product grid can become aslider in one click, without content duplication or extra maintenance.19 20 = Why Native Blocks Carousel instead of a dedicated carouselblock? =21 22 * **WordPress loops without friction** – Transform Query Loop and Post Template blocks into a "loop slider" without creating a block per slide.16 **Any Block Carousel Slider** is a Gutenberg carousel slider block plugin that instantly converts any native WordPress block (Gallery, Group, Grid, Query Loop, Post Template, WooCommerce Products, etc.) into a responsive carousel slider without adding a dedicated block or loading a JavaScript library. Simply enable the "Carousel" toggle in the Gutenberg editor: your content stays 100% native, your DOM stays lightweight, and your Lighthouse performance scores remain intact. 17 18 Unlike many all-in-one carousel slider blocks that require you to add a dedicated "Carousel" block and rebuild every slide, **Any Block Carousel Slider** hooks straight into the Gutenberg blocks you already use. The result: a WordPress loop, image gallery, or product grid can become a carousel slider in one click, without content duplication or extra maintenance. 19 20 = Why Any Block Carousel Slider instead of a dedicated carousel slider block? = 21 22 * **WordPress loops without friction** – Transform Query Loop and Post Template Gutenberg blocks into a "loop slider" without creating a block per slide. 23 23 * **Familiar editorial experience** – Content editors keep the Gutenberg interface they know (patterns, global styles, alignments, inner blocks). 24 24 * **Zero JavaScript on the frontend** – Native scroll, `scroll-snap`, GPU-friendly, no Swiper/Slick bundle to load. … … 36 36 = Quick comparison = 37 37 38 | Feature | Native Blocks Carousel | Classic carousel blocks | 39 | --- | --- | --- | 40 | Activation | Toggle on existing block | Add separate carousel block | 41 | WordPress loop | ✅ Query Loop, Post Template, CPT, products | ❌ Requires a block per slide or custom code | 42 | Frontend JavaScript | ❌ None | ✅ Swiper/Slick + custom scripts | 43 | Performance | Native CSS, no dependencies | Scripts, reflow, additional files | 44 | Content maintenance | Single source block | Content duplication in carousel block | 45 | Security | No third-party dependencies to update | Dependent library (Swiper/Slick) | 38 - **Activation**: Any Block Carousel Slider – toggle an existing Gutenberg block. Classic carousel slider blocks – add a dedicated slider block and rebuild every slide. 39 - **WordPress loop**: Any Block Carousel Slider – fonctionne avec Query Loop, Post Template, CPT et produits WooCommerce sans duplication. Les carrousels concurrents – imposent un bloc par diapositive ou du code personnalisé. 40 - **Frontend JavaScript**: Any Block Carousel Slider – zéro JavaScript, carousel slider 100 % CSS. Les carrousels concurrents – chargent Swiper/Slick et des scripts additionnels. 41 - **Performance**: Any Block Carousel Slider – DOM léger, aucun asset externe. Les carrousels concurrents – multiplient les fichiers, reflow et téléchargements. 42 - **Content maintenance**: Any Block Carousel Slider – un seul bloc Gutenberg à mettre à jour. Les carrousels concurrents – dupliquent le contenu dans des slides dédiées. 43 - **Security & upkeep**: Any Block Carousel Slider – aucune bibliothèque tierce à surveiller. Les carrousels concurrents – dépendent de librairies JS externes comme Swiper/Slick. 46 44 47 45 = Key features = 48 46 49 * **100% CSS** – Smooth carousel with `scroll-snap`, `::scroll-button`, and `::scroll-marker`. No script to bundle.47 * **100% CSS** – Smooth carousel slider with `scroll-snap`, `::scroll-button`, and `::scroll-marker`. No script to bundle. 50 48 * **Smart responsive** – Automatically handles visible columns, spacing, and control sizes according to WordPress breakpoints (1280, 1024, 782, 600, 480, 375). 51 49 * **Two width modes** – Manual mode (fixed column count) and Auto mode (fixed width like 320px) with automatic detection. 52 * ** Block spacing detection** – Respects `gap` and `padding` values defined in theeditor, including presets.50 * **Gutenberg block spacing detection** – Respects `gap` and `padding` values defined in the block editor, including presets. 53 51 * **Theme colors** – Buttons automatically inherit your theme's colors and radii (via CSS variables). 54 * **Intact semantics** – Your block's tags and classes remain unchanged: perfect for SEO, schemas, and E2E testing.55 56 = Native WordPressworkflow =57 58 1. Add or edit a supported block (Gallery, Group, Columns, Query Loop/Post Template, WooCommerce Products, arranged patterns).59 2. Enable the **Carousel** option in the sidebar panel (Layout or Block section depending on the block).52 * **Intact semantics** – Your Gutenberg block's tags and classes remain unchanged: perfect for SEO, schemas, and E2E testing. 53 54 = Native Gutenberg block workflow = 55 56 1. Add or edit a supported Gutenberg block (Gallery, Group, Columns, Query Loop/Post Template, WooCommerce Products, arranged patterns). 57 2. Enable the **Carousel** option in the Gutenberg sidebar panel (Layout or Block section depending on the block). 60 58 3. Adjust your usual settings (column count, minimum width, spacing, alignment). 61 4. Save: your block becomes a touch-friendly, accessible, and SEO-friendly carousel .59 4. Save: your block becomes a touch-friendly, accessible, and SEO-friendly carousel slider. 62 60 63 61 = Advanced customization = 64 62 65 * **Manual mode (fixed columns)** – Ideal for article sliders: 1 to 6 columns depending on screen sizes.66 * **Auto mode (fixed width)** – Perfect for product carousel s: 280px, 320px, or 360px respected pixel-perfect.63 * **Manual mode (fixed columns)** – Ideal for article carousel sliders: 1 to 6 columns depending on screen sizes. 64 * **Auto mode (fixed width)** – Perfect for product carousel sliders: 280px, 320px, or 360px respected pixel-perfect. 67 65 * **Padding and gaps** – Automatic management via CSS vars `--carousel-padding-*`, `--wp--style--block-gap`. 68 66 * **Themes & `theme.json`** – Override variables to align controls with your design system. … … 81 79 82 80 1. Go to "Plugins" → "Add New". 83 2. Search for ** Native Blocks Carousel**.81 2. Search for **Any Block Carousel Slider**. 84 82 3. Click "Install Now" then "Activate". 85 83 … … 92 90 = Usage = 93 91 94 1. Open a page, post, or template .95 2. Select a compatible block (Gallery, Group, Columns, Query Loop, WooCommerce Products, ACF block…).96 3. Enable the **Carousel** button in the settings.92 1. Open a page, post, or template in the Gutenberg editor. 93 2. Select a compatible Gutenberg block (Gallery, Group, Columns, Query Loop, WooCommerce Products, ACF block…). 94 3. Enable the **Carousel** button in the block settings. 97 95 4. Adjust your columns, minimum width, or spacing. 98 5. Publish or update: the carousel is operational.96 5. Publish or update: the carousel slider is operational. 99 97 100 98 == Frequently Asked Questions == 101 99 102 = How does Native Blocks Carousel compare to Carousel Slider v2? =103 104 Unlike Carousel Slider v2 which requires adding a dedicated "Carousel" block and manually creating each slide, Native Blocks Carousel transforms your existing blocks (Query Loop, Gallery, Products) with a simple toggle. For Query Loops specifically, Carousel Slider v2 would require creating a carousel block, then adding a Query Loop with only 1 post per slide—very impractical. Native Blocks Carousel handles this natively: one toggle, zero duplication, maximum performance.100 = How does Any Block Carousel Slider differ from traditional carousel blocks? = 101 102 Unlike traditional carousels that force you to insert a dedicated "Carousel" block and rebuild each slide by hand, Any Block Carousel Slider turns the Gutenberg blocks you already have (Query Loop, Gallery, Products, etc.) into a slider via a simple toggle. With a Query Loop for instance, legacy solutions usually require limiting the loop to one post per slide and duplicating layouts. Here, one block is enough: single action, zero duplication, maximum performance. 105 103 106 104 = Is it compatible with all themes (block themes, FSE)? = 107 105 108 Yes. The plugin reads style variables generated by your theme (classic or full site editing) and applies the carouselwithout breaking the initial grid.106 Yes. The Gutenberg carousel slider block plugin reads style variables generated by your theme (classic or full site editing) and applies the carousel slider without breaking the initial grid. 109 107 110 108 = Does it require JavaScript on the frontend? = … … 114 112 = How do I transform a Query Loop into a carousel? = 115 113 116 Enable the Query Loop block (or Post Template), configure your filters and rendering, then check **Carousel**. Posts are automatically aligned on a scrollable line with snap and CSS arrows. This is the main advantage over traditional carouselplugins that don't support Query Loops natively.114 Enable the Query Loop Gutenberg block (or Post Template), configure your filters and rendering, then check **Carousel**. Posts are automatically aligned on a scrollable line with snap and CSS arrows. This is the main advantage over traditional carousel slider plugins that don't support Query Loops natively. 117 115 118 116 = Can I mix images, titles, buttons, and forms in the same carousel? = 119 117 120 Yes. The plugin respects existing inner blocks. A Group block containing image + text + button (or a custom ACF block) is transformed as-is.118 Yes. The plugin respects existing inner Gutenberg blocks. A Group block containing image + text + button (or a custom ACF block) is transformed as-is into a carousel slider. 121 119 122 120 = WooCommerce compatible? = 123 121 124 The **Products** block (List, Hand-picked Products, On Sale, etc.) works immediately. Add to cart buttons remain interactive.122 The **Products** Gutenberg block (List, Hand-picked Products, On Sale, etc.) works immediately as a carousel slider. Add to cart buttons remain interactive. 125 123 126 124 = Is there an autoplay mode, infinite loop, or custom arrows? = … … 130 128 = Can I have multiple carousels on the same page? = 131 129 132 Yes, without limit. Each block manages its own CSS variables.130 Yes, without limit. Each Gutenberg block manages its own CSS variables for the carousel slider. 133 131 134 132 = How do I adjust buttons or position markers? = … … 149 147 == Screenshots == 150 148 151 1. "Carousel" option in the Gutenberg sidebar panel.152 2. WooCommerce products carousel rendered with 100% CSS.153 3. Block Grid converted into a responsive carousel.154 4. Native Gallery displayed in carouselmode.155 5. Custom CSS variables to adapt the design.149 1. "Carousel" option in the Gutenberg block sidebar panel. 150 2. WooCommerce products carousel slider rendered with 100% CSS. 151 3. Gutenberg Block Grid converted into a responsive carousel slider. 152 4. Native Gallery block displayed in carousel slider mode. 153 5. Custom CSS variables to adapt the carousel slider design. 156 154 157 155 == Changelog == 156 157 = 1.0.3 - 2025-11-13 = 158 * 🔄 Plugin rebranded from "Native Blocks Carousel" to "Any Block Carousel Slider". 159 * 🐛 Fixed dynamic arrow style updates in the Gutenberg editor (now works correctly in iframe contexts). 160 * 🎨 Improved block detection across editor iframes for better arrow icon synchronization. 161 * 🛠️ Enhanced multi-context carousel updates for Site Editor and Block Editor compatibility. 158 162 159 163 = 1.0.2 - 2025-11-13 = 160 164 * ✨ Added dedicated toggles in the inspector to show or hide arrows and pagination markers independently. 161 165 * 🎯 Introduced `carouselShowArrows` and `carouselShowMarkers` block attributes for fine-grained carousel controls. 162 * 🎨 Synced editor and frontend behaviors for the ` nbc-carousel-hide-arrows` and `nbc-carousel-hide-markers` classes.166 * 🎨 Synced editor and frontend behaviors for the `abcs-hide-arrows` and `abcs-hide-markers` classes. 163 167 * 🛠️ Bumped plugin version and refreshed asset headers. 164 168 … … 186 190 == Upgrade Notice == 187 191 192 = 1.0.3 = 193 Recommended update: fixes dynamic arrow style updates in the editor and improves compatibility with Site Editor iframes. 194 188 195 = 1.0.2 = 189 196 Recommended update: manage arrow and marker visibility directly from the editor with consistent styling on both admin and frontend. … … 193 200 = GitHub Repository = 194 201 195 Source code is available on GitHub: [https://github.com/WEBLAZER/ native-blocks-carousel](https://github.com/WEBLAZER/native-blocks-carousel)202 Source code is available on GitHub: [https://github.com/WEBLAZER/any-block-carousel-slider](https://github.com/WEBLAZER/any-block-carousel-slider) 196 203 197 204 = Contributions =
Note: See TracChangeset
for help on using the changeset viewer.