@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 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
- ## [1.4.2] - 2024-10-03
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 because of Webpack config.
34
+ - Fixed CSS `url()` imports for images not working due to Webpack config.
35
+
36
+ ## [1.4.1]
37
+
38
+ ### Changed
10
39
 
11
- ## [1.4.1] - 2024-10-01
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] - 2024-09-30
15
- - Introduced new, more flexible, and simpler to use `tailwindClasses` function. Replaces `getTwPart`, `getTwDynamicPart`, and `getTwClasses`.
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`.
17
- - **Potentially breaking**: `parts` key in manifest now supports specifying multiple parts just with a comma-separated string.
18
- - You can now apply classes to multiple parts within one option or combination! Also work with responsive options.
19
- - There are now (basic) warnings for misconfigurations of parts and options.
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] - 2024-09-19
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] - 2024-09-13
32
- - Helper `getFilteredAttributes` used on SSR components to filter out unwanted attributes and optimize the output.
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
- ## [1.3.0] - 2024-08-08
35
- - `twClasses` and `twClassesEditor` can now be passed as an array
36
- - Updated schemas to account for the `twClasses`/`twClassesEditor` changes.
37
- - Tailwind output functions will now output the custom classes if no Tailwind classes are in the output.
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] - 2024-08-08
90
+ ## [1.2.0]
91
+
92
+ ### Fixed
93
+
42
94
  - Fixed default `perPage` param in `wpSearchRoute`.
43
- - Updated image and file pickers with support for `hidden` prop and accepted types passthrough.
44
- - Fixed some reported bugs in a couple of built-in blocks.
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] - 2024-07-11
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] - 2024-07-09
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
- - Added new options to the fetch script: `truncateTitle` and `labelProp`
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
- ## [1.0.0] - 2024-06-17
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}
@@ -569,7 +569,7 @@
569
569
  },
570
570
  "columnGradientDirection": {
571
571
  "twClasses": {
572
- "to-t": "bg-gradient-to-r",
572
+ "to-t": "bg-gradient-to-t",
573
573
  "to-tr": "bg-gradient-to-tr",
574
574
  "to-r": "bg-gradient-to-r",
575
575
  "to-br": "bg-gradient-to-br",
@@ -1,37 +1,13 @@
1
- import React, { useMemo } from '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
- {...propsObject}
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}
@@ -75,5 +75,8 @@
75
75
  }
76
76
  }
77
77
  }
78
+ },
79
+ "supports": {
80
+ "splitting": true
78
81
  }
79
82
  }
package/bun.lockb CHANGED
File without changes
package/package.json CHANGED
@@ -1,91 +1,92 @@
1
1
  {
2
- "name": "@eightshift/frontend-libs-tailwind",
3
- "version": "1.4.2",
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
- "homepage": "https://github.com/infinum/eightshift-frontend-libs-tailwind#readme",
29
- "license": "MIT",
30
- "dependencies": {
31
- "@eightshift/ui-components": "^1.6.1",
32
- "@stylistic/eslint-plugin-js": "^2.8.0",
33
- "@stylistic/stylelint-plugin": "^3.1.0",
34
- "@swc/core": "^1.7.26",
35
- "@wordpress/api-fetch": "^7.8.0",
36
- "@wordpress/block-editor": "^14.3.0",
37
- "@wordpress/dependency-extraction-webpack-plugin": "^5.9.0",
38
- "@wordpress/dom-ready": "^4.8.0",
39
- "@wordpress/server-side-render": "^5.8.0",
40
- "browserslist": "^4.24.0",
41
- "css-loader": "^7.1.2",
42
- "css-minimizer-webpack-plugin": "^7.0.0",
43
- "eslint": "^9.11.1",
44
- "eslint-config-prettier": "^9.1.0",
45
- "eslint-plugin-prettier": "^5.2.1",
46
- "globals": "^15.9.0",
47
- "husky": "^9.1.6",
48
- "lightningcss": "^1.27.0",
49
- "mini-css-extract-plugin": "^2.9.1",
50
- "postcss": "^8.4.47",
51
- "postcss-loader": "^8.1.1",
52
- "prettier": "^3.3.3",
53
- "prettier-plugin-tailwindcss": "^0.6.8",
54
- "sonner": "^1.5.0",
55
- "stylelint": "^16.9.0",
56
- "stylelint-config-standard": "^36.0.1",
57
- "swc-loader": "^0.2.6",
58
- "terser-webpack-plugin": "^5.3.10",
59
- "webpack": "^5.95.0",
60
- "webpack-cli": "^5.1.4",
61
- "webpack-manifest-plugin": "^5.0.0",
62
- "webpack-merge": "^6.0.1"
63
- },
64
- "devDependencies": {
65
- "embla-carousel": "^8.3.0",
66
- "fluid-tailwind": "^1.0.3",
67
- "lint-staged": "^15.2.10",
68
- "micromodal": "^0.4.10",
69
- "ol": "^10.2.1",
70
- "ol-mapbox-style": "^12.3.5",
71
- "tailwindcss": "^3.4.13",
72
- "tailwindcss-animate": "^1.0.7"
73
- },
74
- "sideEffects": false,
75
- "lint-staged": {
76
- "*.css": [
77
- "npm run lintStyle"
78
- ],
79
- "*.js": [
80
- "npm run lintJs"
81
- ],
82
- "*.php": [
83
- "composer test"
84
- ]
85
- },
86
- "scripts": {
87
- "lintStyle": "stylelint **/*.css",
88
- "lintJs": "npx eslint",
89
- "lint": "npm run lintJs && npm run lintStyle"
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
- __experimentalMetadata: true,
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 '../helpers';
4
+ import { debounce, isEmpty } from '@eightshift/ui-components/utilities';
5
5
 
6
6
  /* global YoastSEO */
7
7