Skip to content

Commit

Permalink
Revert "chore(build): fix build issue - FRONT-4686 (#3732)"
Browse files Browse the repository at this point in the history
This reverts commit c457df6.
  • Loading branch information
planctus committed Nov 25, 2024
1 parent b5e27bc commit c14a816
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 62 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"@babel/eslint-parser": "7.25.1",
"@babel/plugin-proposal-export-default-from": "7.24.7",
"@babel/plugin-transform-runtime": "7.25.4",
"@babel/plugin-syntax-dynamic-import": "7.8.3",
"@prettier/plugin-xml": "3.4.1",
"@size-limit/preset-big-lib": "11.1.5",
"babel-jest": "29.7.0",
Expand Down Expand Up @@ -88,7 +87,7 @@
"node-fetch": "2.6.7",
"immer": ">=9.0.21",
"merge": ">=2.1.1",
"browserslist": ">=4.24.2",
"browserslist": ">=4.16.5",
"node-forge": ">=1.0.0",
"nth-check": ">=2.0.1",
"prismjs": ">=1.27.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
},
...
]
- "picture_zoom" (bool) (default: false): Should the picture be animated?
- "date" (associative array) (default: {}): Predefined structure compatible with ECL Date block component
- "labels" (array) (default: []): Array of ECL Labels
- "labels_aria" (strings) (default: ''): Aria label for the labels area
Expand Down Expand Up @@ -52,7 +51,6 @@
},
sources: [],
}) %}
{% set _picture_zoom = picture_zoom|default(false) %}
{% set _date = date|default({}) %}
{% set _labels = labels|default([]) %}
{% set _labels_aria = labels_aria|default('') %}
Expand Down Expand Up @@ -100,26 +98,28 @@
{{ _extra_attributes|raw }}
>
{% if _picture is not empty and _picture.img is not empty and _picture.img.src is not empty %}
{% set _picture_extra_attrs = _picture.extra_attributes|default([]) %}
{% set _picture_extra_classes = 'ecl-content-item__picture' %}
{% if _title.link is defined %}
{% set _picture_extra_attrs = _picture_extra_attrs|merge([{ name: 'data-ecl-picture-link' }]) %}
{% endif %}
{% set _picture_class = 'ecl-content-item__picture ecl-picture' %}
{% if _picture.size is not empty %}
{% set _picture_extra_classes = _picture_extra_classes ~ ' ecl-content-item__picture--' ~ _picture.size %}
{% set _picture_class = _picture_class ~ ' ecl-content-item__picture--' ~ _picture.size %}
{% endif %}
{% if _picture.position is not empty %}
{% set _picture_extra_classes = _picture_extra_classes ~ ' ecl-content-item__picture--' ~ _picture.position %}
{% set _picture_class = _picture_class ~ ' ecl-content-item__picture--' ~ _picture.position %}
{% endif %}
{% include '@ecl/picture/picture.html.twig' with {
picture: _picture,
zoom: _picture_zoom,
extra_classes: _picture_extra_classes,
extra_image_classes: "ecl-content-item__image",
extra_attributes: _picture_extra_attrs,
} only %}
{% if _title.link is defined %}
{% set _picture_attrs = 'data-ecl-picture-link' %}
{% endif %}
<picture
class="{{ _picture_class }}"
{{- _picture_attrs -}}
>
{% if _picture.sources is not empty and _picture.sources is iterable %}
{% for _source in _picture.sources %}
<source srcset="{{ _source.src }}" media="{{ _source.media|default('') }}" type="{{ _source.type|default('') }}">
{% endfor %}
{% endif %}
<img class="ecl-content-item__image" src="{{ _picture.img.src }}" alt="{{ _picture.img.alt|default('') }}">
</picture>
{% endif %}

{% if _date is not empty %}
{% include '@ecl/date-block/date-block.html.twig' with _date|merge({
extra_classes: 'ecl-content-item__date'
Expand Down
12 changes: 2 additions & 10 deletions src/implementations/twig/components/picture/picture.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
...
]
- "lazy" (boolean) (default: false): Should the picture be loaded using lazy loading?
- "zoom" (boolean) (default: false): Should the picture have a zoom animation?
- "extra_classes" (optional) (string) (default: ''): Extra css classes, added to the root picture tag
- "extra_image_classes" (optional) (string) (default: ''): Extra css classes, added to to the img tag
- "extra_attributes" (optional) (array) (default: [])
Expand All @@ -27,17 +26,12 @@

{% set _picture = picture|default({}) %}
{% set _lazy = lazy|default(false) %}
{% set _zoom = zoom|default(false) %}
{% set _extra_image_classes = extra_image_classes|default('') %}
{% set _css_class = 'ecl-picture' %}
{% set _extra_attributes = '' %}

{# Internal logic - Process properties #}

{% if _zoom %}
{% set _css_class = _css_class ~ ' ecl-picture--zoom' %}
{% endif %}

{% if extra_classes is defined and extra_classes is not empty %}
{% set _css_class = _css_class ~ ' ' ~ extra_classes %}
{% endif %}
Expand All @@ -54,10 +48,7 @@

{# Print the result #}

<picture
class="{{ _css_class }}"
{{ _extra_attributes|raw }}
>
<picture class="{{ _css_class }}"{{ _extra_attributes|raw }}>
{% if _picture.sources is not empty and _picture.sources is iterable %}
{% for _source in _picture.sources %}
{% if _source.media == 's' %}
Expand All @@ -69,6 +60,7 @@
{% elseif _source.media == 'xl' %}
{% set _source = _source|merge({'media': '(min-width: 1140px)'}) %}
{% endif %}

<source
{% if _source.src is not empty %}
srcset="{{ _source.src }}"
Expand Down
26 changes: 1 addition & 25 deletions src/implementations/twig/components/video/video.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@
...
],
- "controls" (boolean) (default: true)
- "autoplay" (boolean) (default: false)
- "muted" (boolean) (default: false)
- "loop" (boolean) (default: false)
- "sr_video_label" (string) (default: ''): additional label for the video item; for screen readers
- "sr_video_player" (string) (default: ''): additional label for the video player; for screen readers
- "zoom" (boolean) (default: false): Should the poster picture have a zoom animation?
- "extra_classes" (optional) (string) (default: ''): Extra css classes, added to the root picture tag
- "extra_attributes" (optional) (array) (default: [])
- "name" (string) Attribute name, eg. 'data-test'
Expand All @@ -40,34 +36,14 @@
{% set _controls = controls ?? true %}
{% set _poster = poster|default('') %}
{% set _title = title|default('') %}
{% set _autoplay = autoplay|default(false) %}
{% set _muted = muted|default(false) %}
{% set _loop = loop|default(false) %}
{% set _sr_video_player = sr_video_player|default('') %}
{% set _sr_video_label = sr_video_label|default('') %}
{% set _zoom = zoom|default(false) %}
{% set _extra_attributes = '' %}

{% if _zoom %}
{% set _css_class = _css_class ~ ' ecl-video--zoom' %}
{% endif %}

{% if _controls %}
{% set _extra_attributes = 'controls' %}
{% endif %}

{% if _autoplay %}
{% set _extra_attributes = _extra_attributes ? _extra_attributes ~ ' autoplay' : 'autoplay' %}
{% endif %}

{% if _muted %}
{% set _extra_attributes = _extra_attributes ? _extra_attributes ~ ' muted' : 'muted' %}
{% endif %}

{% if _loop %}
{% set _extra_attributes = _extra_attributes ? _extra_attributes ~ ' loop' : 'loop' %}
{% endif %}

{% if _title is not empty and _sr_video_label is not empty %}
{% set _title = _title ~ ' - ' ~ _sr_video_label %}
{% elseif _title is not empty and _sr_video_player is not empty %}
Expand Down Expand Up @@ -132,4 +108,4 @@
{% endif %}
</video>

{% endapply %}
{% endapply %}
9 changes: 1 addition & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,6 @@
dependencies:
"@babel/helper-plugin-utils" "^7.14.5"

"@babel/[email protected]":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3"
integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==
dependencies:
"@babel/helper-plugin-utils" "^7.8.0"

"@babel/plugin-syntax-export-default-from@^7.24.7":
version "7.25.9"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.25.9.tgz#86614767a9ff140366f0c3766ef218beb32a730a"
Expand Down Expand Up @@ -5230,7 +5223,7 @@ browserify-zlib@^0.2.0:
dependencies:
pako "~1.0.5"

browserslist@>=4.24.2, browserslist@^4.0.0, browserslist@^4.18.1, browserslist@^4.23.3, browserslist@^4.24.0, browserslist@^4.24.2:
browserslist@>=4.16.5, browserslist@^4.0.0, browserslist@^4.18.1, browserslist@^4.23.3, browserslist@^4.24.0, browserslist@^4.24.2:
version "4.24.2"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580"
integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==
Expand Down

0 comments on commit c14a816

Please sign in to comment.