@eightshift/frontend-libs-tailwind 1.4.2 → 1.4.4
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/.husky/pre-commit +0 -0
- package/CHANGELOG.md +112 -35
- package/blocks/init/src/Blocks/components/paragraph/components/paragraph-editor.js +0 -2
- package/blocks/init/src/Blocks/custom/column/manifest.json +1 -1
- package/blocks/init/src/Blocks/custom/paragraph/components/paragraph-editor.js +3 -27
- package/blocks/init/src/Blocks/custom/paragraph/manifest.json +3 -0
- package/bun.lockb +0 -0
- package/package.json +91 -90
- package/scripts/editor/registration.js +7 -1
- package/scripts/plugins/yoast-seo.js +1 -1
package/.husky/pre-commit
CHANGED
|
File without changes
|
package/CHANGELOG.md
CHANGED
|
@@ -1,72 +1,149 @@
|
|
|
1
|
-
|
|
2
1
|
# Change Log for the Eightshift Frontend Libs Tailwind
|
|
2
|
+
|
|
3
3
|
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
|
-
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## [1.4.4]
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Support for `supports` key in block manifests during block registration.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Built-in Paragraph block now uses the new block splitting logic from WP 6.6
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
20
|
+
## [1.4.3]
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Fixing Yoast SEO plugin helpers.
|
|
25
|
+
- Manifests in some default blocks not using `base` as a `part`.
|
|
26
|
+
- Image sizing in the default Image block when set to stretch.
|
|
27
|
+
- Class for gradient *top* direction in wrapper.
|
|
28
|
+
|
|
29
|
+
## [1.4.2]
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
8
33
|
- Fixed bug with `combinations` output in `tailwindClasses` helper.
|
|
9
|
-
- Fixed CSS `url()` imports for images not working
|
|
34
|
+
- Fixed CSS `url()` imports for images not working due to Webpack config.
|
|
35
|
+
|
|
36
|
+
## [1.4.1]
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
10
39
|
|
|
11
|
-
|
|
12
|
-
- `tailwindClasses` check will now work fine even if no `parts` are defined.
|
|
40
|
+
- `tailwindClasses` check will now work even if no `parts` are defined.
|
|
13
41
|
|
|
14
|
-
## [1.4.0]
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
42
|
+
## [1.4.0]
|
|
43
|
+
|
|
44
|
+
### Added
|
|
45
|
+
|
|
46
|
+
- Introduced new, more flexible `tailwindClasses` function.
|
|
47
|
+
- Added basic warnings for misconfigurations of parts and options.
|
|
20
48
|
- Updated block and component schemas with new Tailwind functionalities.
|
|
21
|
-
- Updated dependencies.
|
|
22
49
|
- Updated default blocks with new Tailwind functions.
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
|
|
53
|
+
- **Potentially breaking**: `twClassesEditor` is now appended to `twClasses`. Use `twClassesEditorOnly` for editor-only classes.
|
|
54
|
+
- **Potentially breaking**: The `parts` key in manifest now supports specifying multiple parts using a comma-separated string.
|
|
55
|
+
- Classes can now be applied to multiple parts in one option or combination, including responsive options.
|
|
23
56
|
- Default Stylelint config will no longer report `@tailwind` rules.
|
|
57
|
+
- Updated dependencies.
|
|
58
|
+
|
|
59
|
+
## [1.3.3]
|
|
60
|
+
|
|
61
|
+
### Changed
|
|
24
62
|
|
|
25
|
-
## [1.3.3] - 2024-09-24
|
|
26
63
|
- Updating schema.
|
|
27
64
|
|
|
28
|
-
## [1.3.2]
|
|
65
|
+
## [1.3.2]
|
|
66
|
+
|
|
67
|
+
### Fixed
|
|
68
|
+
|
|
29
69
|
- Fixing theme options to use stringified JSON instead of an object.
|
|
30
70
|
|
|
31
|
-
## [1.3.1]
|
|
32
|
-
|
|
71
|
+
## [1.3.1]
|
|
72
|
+
|
|
73
|
+
### Added
|
|
74
|
+
|
|
75
|
+
- Helper `getFilteredAttributes` for SSR components to filter unwanted attributes and optimize output.
|
|
76
|
+
|
|
77
|
+
## [1.3.0]
|
|
78
|
+
|
|
79
|
+
### Added
|
|
33
80
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
81
|
+
- `twClasses` and `twClassesEditor` can now be passed as arrays.
|
|
82
|
+
|
|
83
|
+
### Changed
|
|
84
|
+
|
|
85
|
+
- Updated schemas to support the changes in `twClasses`/`twClassesEditor`.
|
|
86
|
+
- Tailwind output functions now output custom classes if no Tailwind classes are detected.
|
|
38
87
|
- Tweaked Prettier config.
|
|
39
88
|
- Updated dependencies.
|
|
40
89
|
|
|
41
|
-
## [1.2.0]
|
|
90
|
+
## [1.2.0]
|
|
91
|
+
|
|
92
|
+
### Fixed
|
|
93
|
+
|
|
42
94
|
- Fixed default `perPage` param in `wpSearchRoute`.
|
|
43
|
-
-
|
|
44
|
-
|
|
95
|
+
- Fixed bugs in built-in blocks.
|
|
96
|
+
|
|
97
|
+
### Added
|
|
98
|
+
|
|
99
|
+
- Added support for `hidden` prop and accepted types passthrough for image and file pickers.
|
|
100
|
+
|
|
101
|
+
### Changed
|
|
102
|
+
|
|
45
103
|
- Updated dependencies.
|
|
46
104
|
|
|
47
|
-
## [1.1.1]
|
|
105
|
+
## [1.1.1]
|
|
106
|
+
|
|
107
|
+
### Fixed
|
|
108
|
+
|
|
48
109
|
- Fixed default global manifest.
|
|
110
|
+
|
|
111
|
+
### Removed
|
|
112
|
+
|
|
49
113
|
- Removed erroneous styles.
|
|
50
114
|
|
|
51
|
-
## [1.1.0]
|
|
115
|
+
## [1.1.0]
|
|
116
|
+
|
|
117
|
+
### Added
|
|
118
|
+
|
|
119
|
+
- Added new options to the fetch script: `truncateTitle` and `labelProp`.
|
|
120
|
+
- Added `hidden` prop to `BlockInserter`.
|
|
121
|
+
- Added `PickerPlaceholder` component.
|
|
122
|
+
- Added dynamic parts option and `getTwDynamicPart` helper.
|
|
123
|
+
|
|
124
|
+
### Changed
|
|
125
|
+
|
|
52
126
|
- Updated dependencies.
|
|
53
127
|
- Tweaked fetch script to use WP `apiFetch`.
|
|
54
|
-
-
|
|
55
|
-
- Removed `urlBase` option from fetch script, as it's no longer needed.
|
|
56
|
-
- Updated some built-in blocks
|
|
57
|
-
- Moved fonts from Google Fonts to built-in.
|
|
58
|
-
- Removed `.gitignore` ESLint ignore.
|
|
128
|
+
- Updated some built-in blocks.
|
|
59
129
|
- Tweaked ESLint config.
|
|
60
130
|
- Updated base blocks.
|
|
61
|
-
- Added `hidden` prop to `BlockInserter`.
|
|
62
|
-
- Added `PickerPlaceholder` component.
|
|
63
|
-
- Added option for dynamic parts and the `getTwDynamicPart` helper.
|
|
64
131
|
|
|
65
|
-
|
|
132
|
+
### Removed
|
|
133
|
+
|
|
134
|
+
- Removed `urlBase` option from fetch script.
|
|
135
|
+
- Moved fonts from Google Fonts to built-in.
|
|
136
|
+
- Removed `.gitignore` ESLint ignore.
|
|
137
|
+
|
|
138
|
+
## [1.0.0]
|
|
139
|
+
|
|
140
|
+
### Added
|
|
141
|
+
|
|
66
142
|
- Initial release.
|
|
67
143
|
|
|
68
144
|
[Unreleased]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/master...HEAD
|
|
69
|
-
|
|
145
|
+
[1.4.4]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.3...1.4.4
|
|
146
|
+
[1.4.3]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.2...1.4.3
|
|
70
147
|
[1.4.2]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.1...1.4.2
|
|
71
148
|
[1.4.1]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.0...1.4.1
|
|
72
149
|
[1.4.0]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.3.3...1.4.0
|
|
@@ -9,7 +9,6 @@ export const ParagraphEditor = (attributes) => {
|
|
|
9
9
|
placeholder = __('Add content', '%g_textdomain%'),
|
|
10
10
|
additionalClass,
|
|
11
11
|
|
|
12
|
-
onSplit,
|
|
13
12
|
mergeBlocks,
|
|
14
13
|
onReplace,
|
|
15
14
|
onRemove,
|
|
@@ -30,7 +29,6 @@ export const ParagraphEditor = (attributes) => {
|
|
|
30
29
|
value={paragraphContent}
|
|
31
30
|
onChange={(value) => setAttributes({ [getAttrKey('paragraphContent', attributes, manifest)]: value })}
|
|
32
31
|
allowedFormats={['core/bold', 'core/link', 'core/italic']}
|
|
33
|
-
onSplit={onSplit}
|
|
34
32
|
onMerge={mergeBlocks}
|
|
35
33
|
onReplace={onReplace}
|
|
36
34
|
onRemove={onRemove}
|
|
@@ -1,37 +1,13 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { createBlock } from '@wordpress/blocks';
|
|
1
|
+
import React from 'react';
|
|
3
2
|
import { tailwindClasses, props } from '@eightshift/frontend-libs-tailwind/scripts';
|
|
4
3
|
import { ParagraphEditor as EditorComponent } from '../../../components/paragraph/components/paragraph-editor';
|
|
5
4
|
import manifest from './../manifest.json';
|
|
6
|
-
import globalManifest from './../../../manifest.json';
|
|
7
|
-
|
|
8
|
-
export const ParagraphEditor = (keyProps) => {
|
|
9
|
-
const { attributes, setAttributes, onReplace, mergeBlocks } = keyProps;
|
|
10
|
-
|
|
11
|
-
const propsObject = props('paragraph', attributes);
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Block-splitting logic. If content is available, creates
|
|
15
|
-
* a new block with the attributes of the original.
|
|
16
|
-
*
|
|
17
|
-
* @param {*} value Content value.
|
|
18
|
-
*/
|
|
19
|
-
const splitBlocks = (value) => {
|
|
20
|
-
if (!value) {
|
|
21
|
-
return createBlock(`${globalManifest.namespace}/${manifest.blockName}`);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return createBlock(`${globalManifest.namespace}/${manifest.blockName}`, {
|
|
25
|
-
...attributes,
|
|
26
|
-
[`${propsObject.prefix}Content`]: value,
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
5
|
|
|
6
|
+
export const ParagraphEditor = ({ attributes, setAttributes, onReplace, mergeBlocks }) => {
|
|
30
7
|
return (
|
|
31
8
|
<EditorComponent
|
|
32
|
-
{...
|
|
9
|
+
{...props('paragraph', attributes)}
|
|
33
10
|
setAttributes={setAttributes}
|
|
34
|
-
onSplit={splitBlocks}
|
|
35
11
|
mergeBlocks={mergeBlocks}
|
|
36
12
|
onReplace={onReplace}
|
|
37
13
|
onRemove={onReplace ? () => onReplace([]) : undefined}
|
package/bun.lockb
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,91 +1,92 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
2
|
+
"name": "@eightshift/frontend-libs-tailwind",
|
|
3
|
+
"version": "1.4.4",
|
|
4
|
+
"description": "A framework for creating modern Gutenberg themes with styling provided by Tailwind CSS.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Eightshift team",
|
|
7
|
+
"email": "team@eightshift.com",
|
|
8
|
+
"url": "https://eightshift.com/"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/infinum/eightshift-frontend-libs-tailwind.git"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"frontend",
|
|
16
|
+
"css",
|
|
17
|
+
"mixin",
|
|
18
|
+
"js",
|
|
19
|
+
"utility",
|
|
20
|
+
"module",
|
|
21
|
+
"WordPress",
|
|
22
|
+
"tailwind",
|
|
23
|
+
"TailwindCSS"
|
|
24
|
+
],
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/infinum/eightshift-frontend-libs-tailwind/issues"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"lintStyle": "stylelint **/*.css",
|
|
30
|
+
"lintJs": "npx eslint",
|
|
31
|
+
"lint": "npm run lintJs && npm run lintStyle",
|
|
32
|
+
"prepare": "husky"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://github.com/infinum/eightshift-frontend-libs-tailwind#readme",
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@eightshift/ui-components": "^1.7.0",
|
|
38
|
+
"@stylistic/eslint-plugin-js": "^2.10.1",
|
|
39
|
+
"@stylistic/stylelint-plugin": "^3.1.1",
|
|
40
|
+
"@swc/core": "^1.8.0",
|
|
41
|
+
"@wordpress/api-fetch": "^7.11.0",
|
|
42
|
+
"@wordpress/block-editor": "^14.6.0",
|
|
43
|
+
"@wordpress/dependency-extraction-webpack-plugin": "^5.9.0",
|
|
44
|
+
"@wordpress/dom-ready": "^4.11.0",
|
|
45
|
+
"@wordpress/server-side-render": "^5.11.0",
|
|
46
|
+
"browserslist": "^4.24.2",
|
|
47
|
+
"css-loader": "^7.1.2",
|
|
48
|
+
"css-minimizer-webpack-plugin": "^7.0.0",
|
|
49
|
+
"eslint": "^9.14.0",
|
|
50
|
+
"eslint-config-prettier": "^9.1.0",
|
|
51
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
52
|
+
"globals": "^15.12.0",
|
|
53
|
+
"husky": "^9.1.6",
|
|
54
|
+
"lightningcss": "^1.28.1",
|
|
55
|
+
"mini-css-extract-plugin": "^2.9.2",
|
|
56
|
+
"postcss": "^8.4.47",
|
|
57
|
+
"postcss-loader": "^8.1.1",
|
|
58
|
+
"prettier": "^3.3.3",
|
|
59
|
+
"prettier-plugin-tailwindcss": "^0.6.8",
|
|
60
|
+
"sonner": "^1.7.0",
|
|
61
|
+
"stylelint": "^16.10.0",
|
|
62
|
+
"stylelint-config-standard": "^36.0.1",
|
|
63
|
+
"swc-loader": "^0.2.6",
|
|
64
|
+
"terser-webpack-plugin": "^5.3.10",
|
|
65
|
+
"webpack": "^5.96.1",
|
|
66
|
+
"webpack-cli": "^5.1.4",
|
|
67
|
+
"webpack-manifest-plugin": "^5.0.0",
|
|
68
|
+
"webpack-merge": "^6.0.1"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"embla-carousel": "^8.3.1",
|
|
72
|
+
"fluid-tailwind": "^1.0.3",
|
|
73
|
+
"lint-staged": "^15.2.10",
|
|
74
|
+
"micromodal": "^0.4.10",
|
|
75
|
+
"ol": "^10.2.1",
|
|
76
|
+
"ol-mapbox-style": "^12.3.5",
|
|
77
|
+
"tailwindcss": "^3.4.14",
|
|
78
|
+
"tailwindcss-animate": "^1.0.7"
|
|
79
|
+
},
|
|
80
|
+
"sideEffects": false,
|
|
81
|
+
"lint-staged": {
|
|
82
|
+
"*.css": [
|
|
83
|
+
"npm run lintStyle"
|
|
84
|
+
],
|
|
85
|
+
"*.js": [
|
|
86
|
+
"npm run lintJs"
|
|
87
|
+
],
|
|
88
|
+
"*.php": [
|
|
89
|
+
"composer test"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -860,6 +860,11 @@ export const registerBlock = (
|
|
|
860
860
|
...getExample('', blockManifest),
|
|
861
861
|
};
|
|
862
862
|
|
|
863
|
+
// Block supports.
|
|
864
|
+
if (typeof blockManifest['supports'] === 'undefined') {
|
|
865
|
+
blockManifest['supports'] = {};
|
|
866
|
+
}
|
|
867
|
+
|
|
863
868
|
return {
|
|
864
869
|
blockName: fullBlockName,
|
|
865
870
|
options: {
|
|
@@ -887,7 +892,8 @@ export const registerBlock = (
|
|
|
887
892
|
return customName;
|
|
888
893
|
},
|
|
889
894
|
supports: {
|
|
890
|
-
|
|
895
|
+
...blockManifest['supports'],
|
|
896
|
+
__experimentalMetadata: true, // Required for renaming blocks.
|
|
891
897
|
},
|
|
892
898
|
},
|
|
893
899
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import domReady from '@wordpress/dom-ready';
|
|
2
2
|
import apiFetch from '@wordpress/api-fetch';
|
|
3
3
|
import { subscribe, select } from '@wordpress/data';
|
|
4
|
-
import { debounce, isEmpty } from '
|
|
4
|
+
import { debounce, isEmpty } from '@eightshift/ui-components/utilities';
|
|
5
5
|
|
|
6
6
|
/* global YoastSEO */
|
|
7
7
|
|