Changeset 3447648
- Timestamp:
- 01/27/2026 09:09:30 AM (2 months ago)
- Location:
- simple-block-animations/trunk
- Files:
-
- 5 edited
-
build/editor.asset.php (modified) (1 diff)
-
build/editor.js (modified) (1 diff)
-
includes/class-settings.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
simple-block-animations.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
simple-block-animations/trunk/build/editor.asset.php
r3447636 r3447648 1 <?php return array('dependencies' => array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => ' 4b65daa793fdf4b13da0');1 <?php return array('dependencies' => array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'f400d11a7bfe48ebb351'); -
simple-block-animations/trunk/build/editor.js
r3447636 r3447648 1 (()=>{"use strict";const e=window.wp.i18n,n=window.wp.hooks,a=window.wp.compose, t=window.wp.element,i=window.wp.blockEditor,o=window.wp.components;if(!window.simpleBlockAnimationsAttributesFiltersAdded){function l(e,n){return n.startsWith("core/")?{...e,attributes:{...e.attributes,isAnimated:{type:"boolean",default:!1},animationType:{type:"string",default:"fade-in"},animationDuration:{type:"number",default:.6},animationDelay:{type:"number",default:0}}}:e}window.simpleBlockAnimationsAttributesFiltersAdded=!0;const s=(0,a.createHigherOrderComponent)(n=>a=>{const{name:l,attributes:s,setAttributes:m}=a,{isAnimated:r,animationType:c,animationDuration:d,animationDelay:_}=s;return l.startsWith("core/")?(0,t.createElement)(t.Fragment,null,(0,t.createElement)(n,a),(0,t.createElement)(i.InspectorControls,{group:"settings"},(0,t.createElement)(o.PanelBody,{title:(0,e.__)("Animations","simple_block_animations"),initialOpen:!0},(0,t.createElement)(o.ToggleControl,{label:(0,e.__)("Animer le bloc","simple_block_animations"),checked:r,onChange:e=>{m({isAnimated:e})}}),r&&(0,t.createElement)(o.SelectControl,{label:(0,e.__)("Type d'animation","simple_block_animations"),value:c,options:[{label:(0,e.__)("Fondu","simple_block_animations"),value:"fade-in"},{label:(0,e.__)("Fondu - Bas vers haut","simple_block_animations"),value:"fade-in-up"},{label:(0,e.__)("Fondu - Haut vers bas","simple_block_animations"),value:"fade-in-down"},{label:(0,e.__)("Fondu - Gauche vers droite","simple_block_animations"),value:"fade-in-left"},{label:(0,e.__)("Fondu - Droite vers gauche","simple_block_animations"),value:"fade-in-right"}],onChange:e=>{m({animationType:e})}}),r&&(0,t.createElement)(o.RangeControl,{label:(0,e.__)("Durée de l'animation","simple_block_animations"),value:d,onChange:e=>{m({animationDuration:e})},min:.2,max:2,step:.1,help:(0,e.__)("Durée en secondes","simple_block_animations")}),r&&(0,t.createElement)(o.RangeControl,{label:(0,e.__)("Délai de l'animation","simple_block_animations"),value:_,onChange:e=>{m({animationDelay:e})},min:0,max:1,step:.1,help:(0,e.__)("Durée en secondes","simple_block_animations")})))):(0,t.createElement)(n,a)},"withAnimationControls");function m(e,n,a){if(!n.name.startsWith("core/")&&!n.name.startsWith("meta-box/"))return e;const{isAnimated:t,animationType:i,animationDuration:o,animationDelay:l}=a;if(t){const n=`animate-${i}`;return{...e,className:e.className?`${e.className} ${n}`:n,style:{...e.style,"--animation-duration":`${o}s`,"--animation-delay":`${l}s`}}}return e}(0,n.addFilter)("blocks.registerBlockType","simple_block_animations/animation-attributes",l),(0,n.addFilter)("editor.BlockEdit","simple_block_animations/with-animation-controls",s),(0,n.addFilter)("blocks.getSaveContent.extraProps","simple_block_animations/add-animation-classes",m)}})();1 (()=>{"use strict";const e=window.wp.i18n,n=window.wp.hooks,a=window.wp.compose,i=window.wp.element,t=window.wp.blockEditor,o=window.wp.components;if(!window.simpleBlockAnimationsAttributesFiltersAdded){function l(e,n){return{...e,attributes:{...e.attributes,isAnimated:{type:"boolean",default:!1},animationType:{type:"string",default:"fade-in"},animationDuration:{type:"number",default:.6},animationDelay:{type:"number",default:0}}}}window.simpleBlockAnimationsAttributesFiltersAdded=!0;const s=(0,a.createHigherOrderComponent)(n=>a=>{const{name:l,attributes:s,setAttributes:m}=a,{isAnimated:r,animationType:d,animationDuration:c,animationDelay:_}=s;return s&&void 0!==r?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(n,a),(0,i.createElement)(t.InspectorControls,{group:"settings"},(0,i.createElement)(o.PanelBody,{title:(0,e.__)("Animations","simple_block_animations"),initialOpen:!0},(0,i.createElement)(o.ToggleControl,{label:(0,e.__)("Animer le bloc","simple_block_animations"),checked:r,onChange:e=>{m({isAnimated:e})}}),r&&(0,i.createElement)(o.SelectControl,{label:(0,e.__)("Type d'animation","simple_block_animations"),value:d,options:[{label:(0,e.__)("Fondu","simple_block_animations"),value:"fade-in"},{label:(0,e.__)("Fondu - Bas vers haut","simple_block_animations"),value:"fade-in-up"},{label:(0,e.__)("Fondu - Haut vers bas","simple_block_animations"),value:"fade-in-down"},{label:(0,e.__)("Fondu - Gauche vers droite","simple_block_animations"),value:"fade-in-left"},{label:(0,e.__)("Fondu - Droite vers gauche","simple_block_animations"),value:"fade-in-right"}],onChange:e=>{m({animationType:e})}}),r&&(0,i.createElement)(o.RangeControl,{label:(0,e.__)("Durée de l'animation","simple_block_animations"),value:c,onChange:e=>{m({animationDuration:e})},min:.2,max:2,step:.1,help:(0,e.__)("Durée en secondes","simple_block_animations")}),r&&(0,i.createElement)(o.RangeControl,{label:(0,e.__)("Délai de l'animation","simple_block_animations"),value:_,onChange:e=>{m({animationDelay:e})},min:0,max:1,step:.1,help:(0,e.__)("Durée en secondes","simple_block_animations")})))):(0,i.createElement)(n,a)},"withAnimationControls");function m(e,n,a){const{isAnimated:i,animationType:t,animationDuration:o,animationDelay:l}=a;if(i){const n=`animate-${t}`;return{...e,className:e.className?`${e.className} ${n}`:n,style:{...e.style,"--animation-duration":`${o}s`,"--animation-delay":`${l}s`}}}return e}(0,n.addFilter)("blocks.registerBlockType","simple_block_animations/animation-attributes",l),(0,n.addFilter)("editor.BlockEdit","simple_block_animations/with-animation-controls",s),(0,n.addFilter)("blocks.getSaveContent.extraProps","simple_block_animations/add-animation-classes",m)}})(); -
simple-block-animations/trunk/includes/class-settings.php
r3418495 r3447648 63 63 64 64 add_settings_field( 65 'enabled_block_types',66 __( 'Types de blocs supportés', 'simple-block-animations' ),67 array( __CLASS__, 'render_block_types_field' ),68 'simple-block-animations',69 'simpblan_main'70 );71 72 add_settings_field(73 65 'default_duration', 74 66 __( 'Durée par défaut', 'simple-block-animations' ), … … 86 78 private static function get_default_settings() { 87 79 return array( 88 'enabled_block_types' => array( 'core', 'meta-box' ), 89 'default_duration' => 0.6, 90 'default_delay' => 0, 80 'default_duration' => 0.6, 81 'default_delay' => 0, 91 82 ); 92 83 } … … 100 91 public static function sanitize_settings( $input ) { 101 92 $sanitized = array(); 102 103 if ( isset( $input['enabled_block_types'] ) && is_array( $input['enabled_block_types'] ) ) {104 $sanitized['enabled_block_types'] = array_map( 'sanitize_text_field', $input['enabled_block_types'] );105 }106 93 107 94 if ( isset( $input['default_duration'] ) ) { … … 143 130 */ 144 131 public static function render_main_section() { 145 echo '<p>' . esc_html__( 'Configurez les options par défaut pour les animations de blocs.', 'simple-block-animations' ) . '</p>'; 146 } 147 148 /** 149 * Render block types field 150 */ 151 public static function render_block_types_field() { 152 $options = get_option( self::OPTION_NAME, self::get_default_settings() ); 153 $enabled = $options['enabled_block_types'] ?? array( 'core', 'meta-box' ); 154 ?> 155 <label> 156 <input type="checkbox" name="<?php echo esc_attr( self::OPTION_NAME ); ?>[enabled_block_types][]" value="core" <?php checked( in_array( 'core', $enabled, true ) ); ?>> 157 <?php esc_html_e( 'Blocs WordPress Core', 'simple-block-animations' ); ?> 158 </label><br> 159 <label> 160 <input type="checkbox" name="<?php echo esc_attr( self::OPTION_NAME ); ?>[enabled_block_types][]" value="meta-box" <?php checked( in_array( 'meta-box', $enabled, true ) ); ?>> 161 <?php esc_html_e( 'Blocs Meta Box', 'simple-block-animations' ); ?> 162 </label> 163 <?php 132 echo '<p>' . esc_html__( 'Configurez les options par défaut pour les animations de blocs. Les animations sont maintenant supportées pour tous les types de blocs.', 'simple-block-animations' ) . '</p>'; 164 133 } 165 134 -
simple-block-animations/trunk/readme.txt
r3447636 r3447648 19 19 * 5 animation types (fade, slide up/down/left/right) 20 20 * Customizable duration and delay 21 * Works with all core blocks21 * Works with all blocks (core, third-party, and custom blocks) 22 22 * Lightweight (CSS + Intersection Observer) 23 23 * No jQuery or heavy libraries … … 26 26 **Supported Blocks:** 27 27 28 Works with all WordPress core blocks and Meta Boxblocks.28 Works with all WordPress blocks, including core blocks, third-party blocks, and custom blocks. 29 29 30 30 **Development:** -
simple-block-animations/trunk/simple-block-animations.php
r3418495 r3447648 49 49 SIMPBLAN_Settings::OPTION_NAME, 50 50 array( 51 'enabled_block_types' => array( 'core', 'meta-box' ), 52 'default_duration' => 0.6, 53 'default_delay' => 0, 51 'default_duration' => 0.6, 52 'default_delay' => 0, 54 53 ) 55 54 );
Note: See TracChangeset
for help on using the changeset viewer.