@eightshift/frontend-libs-tailwind 2.1.1 → 2.3.0
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 +24 -0
- package/bun.lock +421 -100
- package/linters/base.config.mjs +20 -21
- package/package.json +20 -18
- package/scripts/editor/editor.js +16 -1
package/linters/base.config.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import stylistic from '@stylistic/eslint-plugin
|
|
1
|
+
import react from 'eslint-plugin-react';
|
|
2
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
3
|
+
import stylistic from '@stylistic/eslint-plugin';
|
|
4
4
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
5
5
|
import globals from 'globals';
|
|
6
6
|
|
|
@@ -23,9 +23,9 @@ export default [
|
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
25
|
plugins: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
'@stylistic
|
|
26
|
+
react,
|
|
27
|
+
'react-hooks': reactHooks,
|
|
28
|
+
'@stylistic': stylistic,
|
|
29
29
|
},
|
|
30
30
|
rules: {
|
|
31
31
|
'newline-before-return': 'error',
|
|
@@ -35,7 +35,7 @@ export default [
|
|
|
35
35
|
'no-nested-ternary': 'error',
|
|
36
36
|
'no-underscore-dangle': ['error', { allowAfterThis: true }],
|
|
37
37
|
'no-void': 'error',
|
|
38
|
-
'@stylistic/
|
|
38
|
+
'@stylistic/semi': 'error',
|
|
39
39
|
'max-len': [
|
|
40
40
|
'error',
|
|
41
41
|
{
|
|
@@ -61,21 +61,20 @@ export default [
|
|
|
61
61
|
},
|
|
62
62
|
],
|
|
63
63
|
// React-specific.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
64
|
+
'consistent-return': 'warn',
|
|
65
|
+
'no-param-reassign': 'warn',
|
|
66
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
67
|
+
'react-hooks/exhaustive-deps': ['warn', { additionalHooks: '(useSafeLayoutEffect|useUpdateEffect)' }],
|
|
68
|
+
'react/prop-types': ['error', { skipUndeclared: true }],
|
|
69
|
+
'react/react-in-jsx-scope': 'off',
|
|
70
|
+
'react/self-closing-comp': ['warn', { component: true, html: true }],
|
|
71
|
+
'react/no-unknown-property': ['error', { ignore: ['css'] }],
|
|
72
|
+
},
|
|
73
|
+
settings: {
|
|
74
|
+
react: {
|
|
75
|
+
version: '18',
|
|
76
|
+
},
|
|
73
77
|
},
|
|
74
|
-
// settings: {
|
|
75
|
-
// react: {
|
|
76
|
-
// version: '18',
|
|
77
|
-
// },
|
|
78
|
-
// },
|
|
79
78
|
},
|
|
80
79
|
eslintPluginPrettierRecommended,
|
|
81
80
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eightshift/frontend-libs-tailwind",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
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,40 +34,42 @@
|
|
|
34
34
|
"homepage": "https://github.com/infinum/eightshift-frontend-libs-tailwind#readme",
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@stylistic/eslint-plugin
|
|
37
|
+
"@stylistic/eslint-plugin": "^5.6.1",
|
|
38
38
|
"@stylistic/stylelint-plugin": "^4.0.0",
|
|
39
|
-
"@swc/core": "^1.
|
|
40
|
-
"@wordpress/dependency-extraction-webpack-plugin": "^6.
|
|
41
|
-
"browserslist": "^4.
|
|
39
|
+
"@swc/core": "^1.15.3",
|
|
40
|
+
"@wordpress/dependency-extraction-webpack-plugin": "^6.36.0",
|
|
41
|
+
"browserslist": "^4.28.1",
|
|
42
42
|
"css-loader": "^7.1.2",
|
|
43
|
-
"css-minimizer-webpack-plugin": "^7.0.
|
|
44
|
-
"eslint": "^9.
|
|
43
|
+
"css-minimizer-webpack-plugin": "^7.0.3",
|
|
44
|
+
"eslint": "^9.39.1",
|
|
45
45
|
"eslint-config-prettier": "^10.1.8",
|
|
46
46
|
"eslint-plugin-prettier": "^5.5.4",
|
|
47
|
-
"globals": "^16.
|
|
47
|
+
"globals": "^16.5.0",
|
|
48
48
|
"husky": "^9.1.7",
|
|
49
49
|
"lightningcss": "^1.30.2",
|
|
50
50
|
"mini-css-extract-plugin": "^2.9.4",
|
|
51
51
|
"postcss": "^8.5.6",
|
|
52
52
|
"postcss-loader": "^8.2.0",
|
|
53
|
-
"prettier": "^3.
|
|
54
|
-
"prettier-plugin-tailwindcss": "^0.
|
|
53
|
+
"prettier": "^3.7.4",
|
|
54
|
+
"prettier-plugin-tailwindcss": "^0.7.2",
|
|
55
55
|
"sonner": "^2.0.7",
|
|
56
|
-
"stylelint": "^16.
|
|
56
|
+
"stylelint": "^16.26.1",
|
|
57
57
|
"stylelint-config-standard": "^39.0.1",
|
|
58
58
|
"swc-loader": "^0.2.6",
|
|
59
|
-
"terser-webpack-plugin": "^5.3.
|
|
60
|
-
"webpack": "^5.
|
|
59
|
+
"terser-webpack-plugin": "^5.3.15",
|
|
60
|
+
"webpack": "^5.103.0",
|
|
61
61
|
"webpack-cli": "^6.0.1",
|
|
62
|
-
"webpack-manifest-plugin": "^
|
|
63
|
-
"webpack-merge": "^6.0.1"
|
|
62
|
+
"webpack-manifest-plugin": "^6.0.1",
|
|
63
|
+
"webpack-merge": "^6.0.1",
|
|
64
|
+
"eslint-plugin-react": "^7.37.5",
|
|
65
|
+
"eslint-plugin-react-hooks": "^7.0.1"
|
|
64
66
|
},
|
|
65
67
|
"devDependencies": {
|
|
66
|
-
"lint-staged": "^16.2.
|
|
67
|
-
"@wordpress/api-fetch": "^7.
|
|
68
|
+
"lint-staged": "^16.2.7",
|
|
69
|
+
"@wordpress/api-fetch": "^7.36.0"
|
|
68
70
|
},
|
|
69
71
|
"peerDependencies": {
|
|
70
|
-
"@eightshift/ui-components": "^
|
|
72
|
+
"@eightshift/ui-components": "^6.0.8"
|
|
71
73
|
},
|
|
72
74
|
"sideEffects": false,
|
|
73
75
|
"lint-staged": {
|
package/scripts/editor/editor.js
CHANGED
|
@@ -90,6 +90,7 @@ export const lockIfUndefined = (blockClientId, attributeKey, value) => {
|
|
|
90
90
|
* @param {JSX.Element?} [props.editor] - Editor component
|
|
91
91
|
* @param {JSX.Element?} [props.toolbarPortalElement] - Portal override element to use for toolbar. Set to `false` to disable.
|
|
92
92
|
* @param {JSX.Element?} [props.editorPortalElement] - Portal override element to use for editor view. Set to `false` to disable.
|
|
93
|
+
* @param {JSX.Element?} [props.optionsPortalElement] - Portal override element to use for options view. Set to `false` to disable.
|
|
93
94
|
* @param {boolean} [props.noOptionsContainer] - If `true`, the options component will not be wrapped in a container.
|
|
94
95
|
* @param {string} props.title - Block name. Will fall back to a name generated from the `blockName` attribute.
|
|
95
96
|
*
|
|
@@ -116,12 +117,26 @@ export const GutenbergBlock = (props) => {
|
|
|
116
117
|
?.document?.body,
|
|
117
118
|
editorPortalElement = document.querySelector('.block-editor-iframe__scale-container > iframe')?.contentWindow
|
|
118
119
|
?.document?.body,
|
|
120
|
+
optionsPortalElement = document?.body,
|
|
119
121
|
title,
|
|
120
122
|
} = props;
|
|
121
123
|
|
|
122
124
|
return (
|
|
123
125
|
<>
|
|
124
|
-
{OptionsComponent && (
|
|
126
|
+
{OptionsComponent && optionsPortalElement && (
|
|
127
|
+
<PortalProvider portalElement={optionsPortalElement}>
|
|
128
|
+
<InspectorControls>
|
|
129
|
+
{!noOptionsContainer && (
|
|
130
|
+
<ContainerPanel title={title ?? upperFirst(props?.attributes?.blockName)}>
|
|
131
|
+
<OptionsComponent {...props} />
|
|
132
|
+
</ContainerPanel>
|
|
133
|
+
)}
|
|
134
|
+
{noOptionsContainer && <OptionsComponent {...props} />}
|
|
135
|
+
</InspectorControls>
|
|
136
|
+
</PortalProvider>
|
|
137
|
+
)}
|
|
138
|
+
|
|
139
|
+
{OptionsComponent && !optionsPortalElement && (
|
|
125
140
|
<InspectorControls>
|
|
126
141
|
{!noOptionsContainer && (
|
|
127
142
|
<ContainerPanel title={title ?? upperFirst(props?.attributes?.blockName)}>
|