Plugin Directory

Changeset 3447648


Ignore:
Timestamp:
01/27/2026 09:09:30 AM (2 months ago)
Author:
valentingrenier
Message:

Update trunk to version 1.0.1

Location:
simple-block-animations/trunk
Files:
5 edited

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  
    6363
    6464        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(
    7365            'default_duration',
    7466            __( 'Durée par défaut', 'simple-block-animations' ),
     
    8678    private static function get_default_settings() {
    8779        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,
    9182        );
    9283    }
     
    10091    public static function sanitize_settings( $input ) {
    10192        $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         }
    10693
    10794        if ( isset( $input['default_duration'] ) ) {
     
    143130     */
    144131    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>';
    164133    }
    165134
  • simple-block-animations/trunk/readme.txt

    r3447636 r3447648  
    1919* 5 animation types (fade, slide up/down/left/right)
    2020* Customizable duration and delay
    21 * Works with all core blocks
     21* Works with all blocks (core, third-party, and custom blocks)
    2222* Lightweight (CSS + Intersection Observer)
    2323* No jQuery or heavy libraries
     
    2626**Supported Blocks:**
    2727
    28 Works with all WordPress core blocks and Meta Box blocks.
     28Works with all WordPress blocks, including core blocks, third-party blocks, and custom blocks.
    2929
    3030**Development:**
  • simple-block-animations/trunk/simple-block-animations.php

    r3418495 r3447648  
    4949            SIMPBLAN_Settings::OPTION_NAME,
    5050            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,
    5453            )
    5554        );
Note: See TracChangeset for help on using the changeset viewer.