REFACTOR The component to handle the reusable internal-link class with animation

This commit is contained in:
Antoine M 2025-10-01 12:31:06 +02:00
parent b3fa948ccf
commit ff22479995
6 changed files with 451 additions and 741 deletions

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'ab439be1f5ca3b00f5a3'); <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'a525998fbdc557e3c6f8');

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,6 @@ $text = isset($attributes['text']) ? $attributes['text'] : '';
$color = isset($attributes['color']) ? $attributes['color'] : 'red'; $color = isset($attributes['color']) ? $attributes['color'] : 'red';
$svg_arrow_path = get_template_directory() . '/resources/img/carhop-fleche-lien-externe-full.svg';
$wrapper_attributes = get_block_wrapper_attributes([ $wrapper_attributes = get_block_wrapper_attributes([
@ -22,14 +21,4 @@ $link_url = isset($link['url']) ? esc_url($link['url']) : '#';
<a href="<?php echo $link_url; ?>" <?php echo $wrapper_attributes; ?>> <a href="<?php echo $link_url; ?>" <?php echo $wrapper_attributes; ?>>
<?php echo esc_html($text); ?> <?php echo esc_html($text); ?>
<div class="icon">
<svg id="fleche-lien-externe-full" viewBox="0 0 32 32" style="--cta-current-color: <?php echo esc_attr($color); ?>">
<g>
<path class="cls-1" d="M21.15,10.59l-9.38,10.02" />
<path class="cls-1" d="M21.15,21.4v-10.81h-10.32" />
</g>
<circle class="cls-1" cx="16" cy="16" r="15" />
</svg>
</div>
</a> </a>

View File

@ -68,9 +68,9 @@ export default function Edit({ attributes, setAttributes }) {
onChange={(text) => setAttributes({ text })} onChange={(text) => setAttributes({ text })}
allowedFormats={[]} allowedFormats={[]}
/> />
<div className="icon"> {/* <div className="icon">
<ArrowIcon style={{ "--cta-current-color": color }} /> <ArrowIcon style={{ "--cta-current-color": color }} />
</div> </div> */}
</div> </div>
</> </>
); );

View File

@ -5,7 +5,6 @@ $text = isset($attributes['text']) ? $attributes['text'] : '';
$color = isset($attributes['color']) ? $attributes['color'] : 'red'; $color = isset($attributes['color']) ? $attributes['color'] : 'red';
$svg_arrow_path = get_template_directory() . '/resources/img/carhop-fleche-lien-externe-full.svg';
$wrapper_attributes = get_block_wrapper_attributes([ $wrapper_attributes = get_block_wrapper_attributes([
@ -22,14 +21,4 @@ $link_url = isset($link['url']) ? esc_url($link['url']) : '#';
<a href="<?php echo $link_url; ?>" <?php echo $wrapper_attributes; ?>> <a href="<?php echo $link_url; ?>" <?php echo $wrapper_attributes; ?>>
<?php echo esc_html($text); ?> <?php echo esc_html($text); ?>
<div class="icon">
<svg id="fleche-lien-externe-full" viewBox="0 0 32 32" style="--cta-current-color: <?php echo esc_attr($color); ?>">
<g>
<path class="cls-1" d="M21.15,10.59l-9.38,10.02" />
<path class="cls-1" d="M21.15,21.4v-10.81h-10.32" />
</g>
<circle class="cls-1" cx="16" cy="16" r="15" />
</svg>
</div>
</a> </a>