@eightshift/frontend-libs-tailwind 1.4.3 → 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/CHANGELOG.md CHANGED
@@ -6,11 +6,25 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a
6
6
 
7
7
  ---
8
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
+
9
20
  ## [1.4.3]
10
21
 
11
22
  ### Fixed
12
23
 
13
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.
14
28
 
15
29
  ## [1.4.2]
16
30
 
@@ -128,6 +142,7 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a
128
142
  - Initial release.
129
143
 
130
144
  [Unreleased]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/master...HEAD
145
+ [1.4.4]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.3...1.4.4
131
146
  [1.4.3]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.2...1.4.3
132
147
  [1.4.2]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.1...1.4.2
133
148
  [1.4.1]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.0...1.4.1
@@ -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, { 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eightshift/frontend-libs-tailwind",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
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,47 +34,47 @@
34
34
  "homepage": "https://github.com/infinum/eightshift-frontend-libs-tailwind#readme",
35
35
  "license": "MIT",
36
36
  "dependencies": {
37
- "@eightshift/ui-components": "^1.6.1",
38
- "@stylistic/eslint-plugin-js": "^2.8.0",
39
- "@stylistic/stylelint-plugin": "^3.1.0",
40
- "@swc/core": "^1.7.26",
41
- "@wordpress/api-fetch": "^7.8.0",
42
- "@wordpress/block-editor": "^14.3.0",
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
43
  "@wordpress/dependency-extraction-webpack-plugin": "^5.9.0",
44
- "@wordpress/dom-ready": "^4.8.0",
45
- "@wordpress/server-side-render": "^5.8.0",
46
- "browserslist": "^4.24.0",
44
+ "@wordpress/dom-ready": "^4.11.0",
45
+ "@wordpress/server-side-render": "^5.11.0",
46
+ "browserslist": "^4.24.2",
47
47
  "css-loader": "^7.1.2",
48
48
  "css-minimizer-webpack-plugin": "^7.0.0",
49
- "eslint": "^9.11.1",
49
+ "eslint": "^9.14.0",
50
50
  "eslint-config-prettier": "^9.1.0",
51
51
  "eslint-plugin-prettier": "^5.2.1",
52
- "globals": "^15.9.0",
52
+ "globals": "^15.12.0",
53
53
  "husky": "^9.1.6",
54
- "lightningcss": "^1.27.0",
55
- "mini-css-extract-plugin": "^2.9.1",
54
+ "lightningcss": "^1.28.1",
55
+ "mini-css-extract-plugin": "^2.9.2",
56
56
  "postcss": "^8.4.47",
57
57
  "postcss-loader": "^8.1.1",
58
58
  "prettier": "^3.3.3",
59
59
  "prettier-plugin-tailwindcss": "^0.6.8",
60
- "sonner": "^1.5.0",
61
- "stylelint": "^16.9.0",
60
+ "sonner": "^1.7.0",
61
+ "stylelint": "^16.10.0",
62
62
  "stylelint-config-standard": "^36.0.1",
63
63
  "swc-loader": "^0.2.6",
64
64
  "terser-webpack-plugin": "^5.3.10",
65
- "webpack": "^5.95.0",
65
+ "webpack": "^5.96.1",
66
66
  "webpack-cli": "^5.1.4",
67
67
  "webpack-manifest-plugin": "^5.0.0",
68
68
  "webpack-merge": "^6.0.1"
69
69
  },
70
70
  "devDependencies": {
71
- "embla-carousel": "^8.3.0",
71
+ "embla-carousel": "^8.3.1",
72
72
  "fluid-tailwind": "^1.0.3",
73
73
  "lint-staged": "^15.2.10",
74
74
  "micromodal": "^0.4.10",
75
75
  "ol": "^10.2.1",
76
76
  "ol-mapbox-style": "^12.3.5",
77
- "tailwindcss": "^3.4.13",
77
+ "tailwindcss": "^3.4.14",
78
78
  "tailwindcss-animate": "^1.0.7"
79
79
  },
80
80
  "sideEffects": false,
@@ -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
  };