@eightshift/frontend-libs-tailwind 1.4.6 → 1.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/blocks/init/src/Blocks/components/button/button.php +5 -0
- package/blocks/init/src/Blocks/components/button/manifest.json +3 -0
- package/blocks/init/src/Blocks/components/icon/icon.php +18 -1
- package/blocks/init/src/Blocks/components/icon/manifest.json +4 -0
- package/blocks/init/src/Blocks/components/image/image.php +9 -4
- package/blocks/init/src/Blocks/wrapper/manifest.json +7 -1
- package/package.json +20 -20
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,16 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [1.4.7]
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- Fixed Image component "image" part tailwind class output if not set.
|
|
13
|
+
- Fix Image component responsive output Co-authored-by: goran.alkovic@infinum.com
|
|
14
|
+
- Add "Auto" width to wrapperContent and set is as defaults
|
|
15
|
+
- Add a buttonType attribute to Button component
|
|
16
|
+
- Implement a11y for Icon component either by setting aria-hidden to true (default) or using the existing iconName label from manifest options key
|
|
17
|
+
- Updated dependencies.
|
|
18
|
+
|
|
9
19
|
## [1.4.6]
|
|
10
20
|
|
|
11
21
|
### Changed
|
|
@@ -159,6 +169,7 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a
|
|
|
159
169
|
- Initial release.
|
|
160
170
|
|
|
161
171
|
[Unreleased]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/master...HEAD
|
|
172
|
+
[1.4.7]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.6...1.4.7
|
|
162
173
|
[1.4.6]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.5...1.4.6
|
|
163
174
|
[1.4.5]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.4...1.4.5
|
|
164
175
|
[1.4.4]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.3...1.4.4
|
|
@@ -19,6 +19,7 @@ if (!$buttonUse) {
|
|
|
19
19
|
$additionalClass = $attributes['additionalClass'] ?? '';
|
|
20
20
|
$additionalAttributes = $attributes['additionalAttributes'] ?? [];
|
|
21
21
|
$buttonId = Helpers::checkAttr('buttonId', $attributes, $manifest);
|
|
22
|
+
$buttonType = Helpers::checkAttr('buttonType', $attributes, $manifest);
|
|
22
23
|
|
|
23
24
|
$buttonUrl = Helpers::checkAttr('buttonUrl', $attributes, $manifest);
|
|
24
25
|
$buttonIsNewTab = Helpers::checkAttr('buttonIsNewTab', $attributes, $manifest);
|
|
@@ -59,6 +60,10 @@ if (!empty($buttonAriaLabel)) {
|
|
|
59
60
|
$buttonAttrs['class'] = Helpers::tailwindClasses('base', $attributes, $manifest, 'button', $additionalClass);
|
|
60
61
|
|
|
61
62
|
$buttonTag = !empty($buttonUrl) ? 'a' : 'button';
|
|
63
|
+
|
|
64
|
+
if (empty($buttonUrl) && !empty($buttonType)) {
|
|
65
|
+
$buttonAttrs['type'] = $buttonType;
|
|
66
|
+
}
|
|
62
67
|
?>
|
|
63
68
|
|
|
64
69
|
<<?php echo $buttonTag; // phpcs:ignore Eightshift.Security.HelpersEscape.OutputNotEscaped ?>
|
|
@@ -19,6 +19,7 @@ if (!$iconUse) {
|
|
|
19
19
|
$additionalClass = $attributes['additionalClass'] ?? '';
|
|
20
20
|
|
|
21
21
|
$iconName = Helpers::checkAttr('iconName', $attributes, $manifest);
|
|
22
|
+
$iconAriaHidden = Helpers::checkAttr('iconAriaHidden', $attributes, $manifest);
|
|
22
23
|
|
|
23
24
|
if (!isset($manifest['icons'][$iconName])) {
|
|
24
25
|
return;
|
|
@@ -29,7 +30,23 @@ $icon = $manifest['icons'][$iconName];
|
|
|
29
30
|
$className = Helpers::tailwindClasses('base', $attributes, $manifest, $additionalClass);
|
|
30
31
|
|
|
31
32
|
if (!empty($className)) {
|
|
32
|
-
$icon = str_replace('<svg ', '<svg class="' .
|
|
33
|
+
$icon = str_replace('<svg ', '<svg class="' . esc_attr($className) . '" ', $icon);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if ($iconAriaHidden) {
|
|
37
|
+
$icon = str_replace('<svg ', '<svg aria-hidden="true" ', $icon);
|
|
38
|
+
} else {
|
|
39
|
+
$iconTitle = '';
|
|
40
|
+
$iconOption = array_filter($manifest['options']['iconName'], fn($option) => $option['value'] === $iconName);
|
|
41
|
+
|
|
42
|
+
if (!empty($iconOption)) {
|
|
43
|
+
$iconTitle = reset($iconOption)['label'];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (!empty($iconTitle)) {
|
|
47
|
+
$titleTag = '<title>' . esc_html($iconTitle) . '</title>';
|
|
48
|
+
$icon = str_replace('</svg>', $titleTag . '</svg>', $icon);
|
|
49
|
+
}
|
|
33
50
|
}
|
|
34
51
|
|
|
35
52
|
// phpcs:ignore Eightshift.Security.HelpersEscape.OutputNotEscaped
|
|
@@ -25,7 +25,11 @@ $imageAlt = get_post_meta($imageData['_default']['id'], '_wp_attachment_image_al
|
|
|
25
25
|
$isDesktopFirst = $imageData['_desktopFirst'] ?? false;
|
|
26
26
|
|
|
27
27
|
$breakpointData = Helpers::getSettingsGlobalVariablesBreakpoints();
|
|
28
|
-
$breakpoints = Helpers::getTwBreakpoints();
|
|
28
|
+
$breakpoints = Helpers::getTwBreakpoints($isDesktopFirst);
|
|
29
|
+
|
|
30
|
+
if (!$isDesktopFirst) {
|
|
31
|
+
$breakpoints = array_reverse($breakpoints);
|
|
32
|
+
}
|
|
29
33
|
?>
|
|
30
34
|
|
|
31
35
|
<picture
|
|
@@ -33,7 +37,8 @@ $breakpoints = Helpers::getTwBreakpoints();
|
|
|
33
37
|
class="<?php echo esc_attr($additionalClass['picture']); ?>"
|
|
34
38
|
<?php } ?>
|
|
35
39
|
>
|
|
36
|
-
<?php
|
|
40
|
+
<?php
|
|
41
|
+
foreach ($breakpoints as $breakpoint) { ?>
|
|
37
42
|
<?php
|
|
38
43
|
if (!isset($imageData[$breakpoint])) {
|
|
39
44
|
continue;
|
|
@@ -45,7 +50,7 @@ $breakpoints = Helpers::getTwBreakpoints();
|
|
|
45
50
|
continue;
|
|
46
51
|
}
|
|
47
52
|
|
|
48
|
-
$breakpointWidth = $breakpointData[$breakpoint];
|
|
53
|
+
$breakpointWidth = $breakpointData[str_replace('max-', '', $breakpoint)];
|
|
49
54
|
|
|
50
55
|
$widthMode = $isDesktopFirst ? 'max-width' : 'min-width';
|
|
51
56
|
|
|
@@ -57,7 +62,7 @@ $breakpoints = Helpers::getTwBreakpoints();
|
|
|
57
62
|
<img
|
|
58
63
|
src="<?php echo esc_url($imageData['_default']['url'] ?? ''); ?>"
|
|
59
64
|
alt="<?php echo esc_attr($imageAlt); ?>"
|
|
60
|
-
class="<?php echo esc_attr(Helpers::tailwindClasses('base', $attributes, $manifest, $additionalClass['image'] ??
|
|
65
|
+
class="<?php echo esc_attr(Helpers::tailwindClasses('base', $attributes, $manifest, $additionalClass['image'] ?? '')); ?>"
|
|
61
66
|
/>
|
|
62
67
|
</picture>
|
|
63
68
|
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"wrapperContentWidth": {
|
|
91
91
|
"type": "object",
|
|
92
92
|
"default": {
|
|
93
|
-
"_default": "
|
|
93
|
+
"_default": "auto",
|
|
94
94
|
"_desktopFirst": true
|
|
95
95
|
}
|
|
96
96
|
},
|
|
@@ -289,6 +289,11 @@
|
|
|
289
289
|
}
|
|
290
290
|
],
|
|
291
291
|
"wrapperContentWidth": [
|
|
292
|
+
{
|
|
293
|
+
"label": "Auto",
|
|
294
|
+
"value": "auto",
|
|
295
|
+
"separator": "below"
|
|
296
|
+
},
|
|
292
297
|
{
|
|
293
298
|
"label": "Full",
|
|
294
299
|
"value": "full",
|
|
@@ -439,6 +444,7 @@
|
|
|
439
444
|
"wrapperContentWidth": {
|
|
440
445
|
"responsive": true,
|
|
441
446
|
"twClasses": {
|
|
447
|
+
"auto": "w-auto",
|
|
442
448
|
"full": "w-full",
|
|
443
449
|
"half": "w-1/2",
|
|
444
450
|
"one-third": "w-1/3",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eightshift/frontend-libs-tailwind",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.7",
|
|
4
4
|
"description": "A framework for creating modern Gutenberg themes with styling provided by Tailwind CSS.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Eightshift team",
|
|
@@ -34,35 +34,35 @@
|
|
|
34
34
|
"homepage": "https://github.com/infinum/eightshift-frontend-libs-tailwind#readme",
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@eightshift/ui-components": "^1.
|
|
38
|
-
"@stylistic/eslint-plugin-js": "^2.
|
|
37
|
+
"@eightshift/ui-components": "^1.9.1",
|
|
38
|
+
"@stylistic/eslint-plugin-js": "^2.12.1",
|
|
39
39
|
"@stylistic/stylelint-plugin": "^3.1.1",
|
|
40
|
-
"@swc/core": "^1.
|
|
41
|
-
"@wordpress/api-fetch": "^7.
|
|
42
|
-
"@wordpress/block-editor": "^14.
|
|
40
|
+
"@swc/core": "^1.10.1",
|
|
41
|
+
"@wordpress/api-fetch": "^7.14.0",
|
|
42
|
+
"@wordpress/block-editor": "^14.9.0",
|
|
43
43
|
"@wordpress/dependency-extraction-webpack-plugin": "^5.9.0",
|
|
44
|
-
"@wordpress/dom-ready": "^4.
|
|
45
|
-
"@wordpress/server-side-render": "^5.
|
|
46
|
-
"browserslist": "^4.24.
|
|
44
|
+
"@wordpress/dom-ready": "^4.14.0",
|
|
45
|
+
"@wordpress/server-side-render": "^5.14.0",
|
|
46
|
+
"browserslist": "^4.24.3",
|
|
47
47
|
"css-loader": "^7.1.2",
|
|
48
48
|
"css-minimizer-webpack-plugin": "^7.0.0",
|
|
49
|
-
"eslint": "^9.
|
|
49
|
+
"eslint": "^9.17.0",
|
|
50
50
|
"eslint-config-prettier": "^9.1.0",
|
|
51
51
|
"eslint-plugin-prettier": "^5.2.1",
|
|
52
|
-
"globals": "^15.
|
|
52
|
+
"globals": "^15.13.0",
|
|
53
53
|
"husky": "^9.1.7",
|
|
54
54
|
"lightningcss": "^1.28.2",
|
|
55
55
|
"mini-css-extract-plugin": "^2.9.2",
|
|
56
56
|
"postcss": "^8.4.49",
|
|
57
57
|
"postcss-loader": "^8.1.1",
|
|
58
|
-
"prettier": "^3.4.
|
|
58
|
+
"prettier": "^3.4.2",
|
|
59
59
|
"prettier-plugin-tailwindcss": "^0.6.9",
|
|
60
|
-
"sonner": "^1.7.
|
|
61
|
-
"stylelint": "^16.
|
|
60
|
+
"sonner": "^1.7.1",
|
|
61
|
+
"stylelint": "^16.12.0",
|
|
62
62
|
"stylelint-config-standard": "^36.0.1",
|
|
63
63
|
"swc-loader": "^0.2.6",
|
|
64
|
-
"terser-webpack-plugin": "^5.3.
|
|
65
|
-
"webpack": "^5.
|
|
64
|
+
"terser-webpack-plugin": "^5.3.11",
|
|
65
|
+
"webpack": "^5.97.1",
|
|
66
66
|
"webpack-cli": "^5.1.4",
|
|
67
67
|
"webpack-manifest-plugin": "^5.0.0",
|
|
68
68
|
"webpack-merge": "^6.0.1"
|
|
@@ -70,11 +70,11 @@
|
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"embla-carousel": "^8.5.1",
|
|
72
72
|
"fluid-tailwind": "^1.0.4",
|
|
73
|
-
"lint-staged": "^15.2.
|
|
73
|
+
"lint-staged": "^15.2.11",
|
|
74
74
|
"micromodal": "^0.4.10",
|
|
75
|
-
"ol": "^10.
|
|
76
|
-
"ol-mapbox-style": "^12.
|
|
77
|
-
"tailwindcss": "^3.4.
|
|
75
|
+
"ol": "^10.3.1",
|
|
76
|
+
"ol-mapbox-style": "^12.4.0",
|
|
77
|
+
"tailwindcss": "^3.4.17",
|
|
78
78
|
"tailwindcss-animate": "^1.0.7"
|
|
79
79
|
},
|
|
80
80
|
"sideEffects": false,
|