@eightshift/frontend-libs-tailwind 1.4.0 → 1.4.2
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 +9 -0
- package/bun.lockb +0 -0
- package/package.json +1 -2
- package/scripts/editor/tailwindcss.js +10 -5
- package/webpack/base.mjs +9 -23
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/).
|
|
6
6
|
|
|
7
|
+
## [1.4.2] - 2024-10-03
|
|
8
|
+
- Fixed bug with `combinations` output in `tailwindClasses` helper.
|
|
9
|
+
- Fixed CSS `url()` imports for images not working because of Webpack config.
|
|
10
|
+
|
|
11
|
+
## [1.4.1] - 2024-10-01
|
|
12
|
+
- `tailwindClasses` check will now work fine even if no `parts` are defined.
|
|
13
|
+
|
|
7
14
|
## [1.4.0] - 2024-09-30
|
|
8
15
|
- Introduced new, more flexible, and simpler to use `tailwindClasses` function. Replaces `getTwPart`, `getTwDynamicPart`, and `getTwClasses`.
|
|
9
16
|
- **Potentially breaking**: `twClassesEditor` is now appended to `twClasses`. If you need editor-only classes, you can now use the `twClassesEditorOnly` key. Editor-only classes replace `twClasses`, but will also have classes from `twClassesEditor`.
|
|
@@ -60,6 +67,8 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a
|
|
|
60
67
|
|
|
61
68
|
[Unreleased]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/master...HEAD
|
|
62
69
|
|
|
70
|
+
[1.4.2]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.1...1.4.2
|
|
71
|
+
[1.4.1]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.0...1.4.1
|
|
63
72
|
[1.4.0]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.3.3...1.4.0
|
|
64
73
|
[1.3.3]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.3.2...1.3.3
|
|
65
74
|
[1.3.2]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.3.1...1.3.2
|
package/bun.lockb
ADDED
|
Binary file
|
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.2",
|
|
4
4
|
"description": "A framework for creating modern Gutenberg themes with styling provided by Tailwind CSS.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Eightshift team",
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"eslint": "^9.11.1",
|
|
44
44
|
"eslint-config-prettier": "^9.1.0",
|
|
45
45
|
"eslint-plugin-prettier": "^5.2.1",
|
|
46
|
-
"file-loader": "^6.2.0",
|
|
47
46
|
"globals": "^15.9.0",
|
|
48
47
|
"husky": "^9.1.6",
|
|
49
48
|
"lightningcss": "^1.27.0",
|
|
@@ -435,12 +435,12 @@ const processCombination = (partName, combo, attributes, manifest) => {
|
|
|
435
435
|
for (const [attributeName, allowedValue] of Object.entries(combo?.attributes ?? {})) {
|
|
436
436
|
const optionValue = checkAttr(attributeName, attributes, manifest, true);
|
|
437
437
|
|
|
438
|
-
|
|
438
|
+
const isArrayCondition = Array.isArray(allowedValue);
|
|
439
|
+
|
|
440
|
+
if (isArrayCondition && !allowedValue.includes(optionValue)) {
|
|
439
441
|
matches = false;
|
|
440
442
|
break;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
if (optionValue !== allowedValue) {
|
|
443
|
+
} else if (!isArrayCondition && optionValue !== allowedValue) {
|
|
444
444
|
matches = false;
|
|
445
445
|
break;
|
|
446
446
|
}
|
|
@@ -508,7 +508,12 @@ export const tailwindClasses = (part, attributes, manifest, ...custom) => {
|
|
|
508
508
|
|
|
509
509
|
let partName = 'base';
|
|
510
510
|
|
|
511
|
-
if (
|
|
511
|
+
if (
|
|
512
|
+
part !== 'base' &&
|
|
513
|
+
part?.length > 0 &&
|
|
514
|
+
typeof manifest?.tailwind?.parts?.[part] !== 'undefined' &&
|
|
515
|
+
allParts.includes(part)
|
|
516
|
+
) {
|
|
512
517
|
partName = part;
|
|
513
518
|
} else if (part !== 'base') {
|
|
514
519
|
throw new Error(`Part '${part}' is not defined in the manifest.`);
|
package/webpack/base.mjs
CHANGED
|
@@ -78,29 +78,6 @@ export default (options) => {
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
// Module for Images.
|
|
82
|
-
if (!options.overrides.includes('images')) {
|
|
83
|
-
module.rules.push({
|
|
84
|
-
test: /\.(png|svg|jpg|jpeg|gif|ico|webp)$/i,
|
|
85
|
-
use: [
|
|
86
|
-
{
|
|
87
|
-
loader: 'url-loader',
|
|
88
|
-
options: {
|
|
89
|
-
limit: 8192,
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
type: 'javascript/auto',
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
module.rules.push({
|
|
97
|
-
test: /\.(png|svg|jpg|jpeg|gif|ico|webp)$/i,
|
|
98
|
-
exclude: [/fonts/, /node_modules/],
|
|
99
|
-
use: 'file-loader?name=[name].[ext]',
|
|
100
|
-
dependency: { not: ['url'] },
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
81
|
// Module for CSS.
|
|
105
82
|
if (!options.overrides.includes('css')) {
|
|
106
83
|
module.rules.push({
|
|
@@ -128,6 +105,15 @@ export default (options) => {
|
|
|
128
105
|
});
|
|
129
106
|
}
|
|
130
107
|
|
|
108
|
+
// Module for Images.
|
|
109
|
+
if (!options.overrides.includes('images')) {
|
|
110
|
+
module.rules.push({
|
|
111
|
+
test: /\.(png|svg|jpg|jpeg|gif|ico|webp)$/i,
|
|
112
|
+
exclude: [/fonts/, /node_modules/],
|
|
113
|
+
type: 'asset/resource',
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
131
117
|
const resolve = {
|
|
132
118
|
symlinks: false,
|
|
133
119
|
};
|