@eightshift/frontend-libs-tailwind 2.0.4 → 2.0.5
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 +7 -0
- package/bun.lock +19 -17
- package/package.json +4 -4
- package/scripts/editor/editor.js +23 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [2.0.5]
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- Updated dependencies.
|
|
13
|
+
- `GutenbergBlock` now overrides the ES UI components portal, after Core changed editor to be iframed. This can be disabled by passing `toolbarPortalElement={false}` and `editorPortalElement={false}`. Override only happens if the editor is iframed.
|
|
14
|
+
|
|
9
15
|
## [2.0.4]
|
|
10
16
|
|
|
11
17
|
### Changed
|
|
@@ -231,6 +237,7 @@ Co-authored with @piqusy
|
|
|
231
237
|
- Initial release.
|
|
232
238
|
|
|
233
239
|
[Unreleased]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/master...HEAD
|
|
240
|
+
[2.0.5]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/2.0.4...2.0.5
|
|
234
241
|
[2.0.4]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/2.0.3...2.0.4
|
|
235
242
|
[2.0.3]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/2.0.2...2.0.3
|
|
236
243
|
[2.0.2]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/2.0.1...2.0.2
|
package/bun.lock
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
"": {
|
|
5
5
|
"name": "@eightshift/frontend-libs-tailwind",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@eightshift/ui-components": "^5.0.
|
|
7
|
+
"@eightshift/ui-components": "^5.0.6",
|
|
8
8
|
"@stylistic/eslint-plugin-js": "^4.4.1",
|
|
9
9
|
"@stylistic/stylelint-plugin": "^3.1.2",
|
|
10
|
-
"@swc/core": "^1.
|
|
10
|
+
"@swc/core": "^1.12.0",
|
|
11
11
|
"@wordpress/dependency-extraction-webpack-plugin": "^6.25.0",
|
|
12
12
|
"browserslist": "^4.25.0",
|
|
13
13
|
"css-loader": "^7.1.2",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"husky": "^9.1.7",
|
|
20
20
|
"lightningcss": "^1.30.1",
|
|
21
21
|
"mini-css-extract-plugin": "^2.9.2",
|
|
22
|
-
"postcss": "^8.5.
|
|
22
|
+
"postcss": "^8.5.5",
|
|
23
23
|
"postcss-loader": "^8.1.1",
|
|
24
24
|
"prettier": "^3.5.3",
|
|
25
25
|
"prettier-plugin-tailwindcss": "^0.6.12",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
|
|
59
59
|
"@dual-bundle/import-meta-resolve": ["@dual-bundle/import-meta-resolve@4.1.0", "", {}, "sha512-+nxncfwHM5SgAtrVzgpzJOI1ol0PkumhVo469KCf9lUi21IGcY90G98VuHm9VRrUypmAzawAHO9bs6hqeADaVg=="],
|
|
60
60
|
|
|
61
|
-
"@eightshift/ui-components": ["@eightshift/ui-components@5.0.
|
|
61
|
+
"@eightshift/ui-components": ["@eightshift/ui-components@5.0.6", "", { "dependencies": { "@fontsource-variable/geist": "^5.2.6", "@fontsource-variable/geist-mono": "^5.2.6" }, "peerDependencies": { "react": "^18.3.1", "react-dom": "^18.3.1" } }, "sha512-GXeRaeg1sdsMt59R7MFSIZ/bbEcMNlk/e1/+x6aJt1vwToXgkljw8KtjVuVdBhvYCmoYC49xggc5uj87QedvYg=="],
|
|
62
62
|
|
|
63
63
|
"@eslint-community/eslint-utils": ["@eslint-community/eslint-utils@4.6.1", "", { "dependencies": { "eslint-visitor-keys": "^3.4.3" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "sha512-KTsJMmobmbrFLe3LDh0PC2FXpcSYJt/MLjlkh/9LEnmKYLSYmT/0EW9JWANjeoemiuZrmogti0tW5Ch+qNUYDw=="],
|
|
64
64
|
|
|
@@ -122,31 +122,31 @@
|
|
|
122
122
|
|
|
123
123
|
"@stylistic/stylelint-plugin": ["@stylistic/stylelint-plugin@3.1.2", "", { "dependencies": { "@csstools/css-parser-algorithms": "^3.0.1", "@csstools/css-tokenizer": "^3.0.1", "@csstools/media-query-list-parser": "^3.0.1", "is-plain-object": "^5.0.0", "postcss-selector-parser": "^6.1.2", "postcss-value-parser": "^4.2.0", "style-search": "^0.1.0", "stylelint": "^16.8.2" } }, "sha512-tylFJGMQo62alGazK74MNxFjMagYOHmBZiePZFOJK2n13JZta0uVkB3Bh5qodUmOLtRH+uxH297EibK14UKm8g=="],
|
|
124
124
|
|
|
125
|
-
"@swc/core": ["@swc/core@1.
|
|
125
|
+
"@swc/core": ["@swc/core@1.12.0", "", { "dependencies": { "@swc/counter": "^0.1.3", "@swc/types": "^0.1.22" }, "optionalDependencies": { "@swc/core-darwin-arm64": "1.12.0", "@swc/core-darwin-x64": "1.12.0", "@swc/core-linux-arm-gnueabihf": "1.12.0", "@swc/core-linux-arm64-gnu": "1.12.0", "@swc/core-linux-arm64-musl": "1.12.0", "@swc/core-linux-x64-gnu": "1.12.0", "@swc/core-linux-x64-musl": "1.12.0", "@swc/core-win32-arm64-msvc": "1.12.0", "@swc/core-win32-ia32-msvc": "1.12.0", "@swc/core-win32-x64-msvc": "1.12.0" }, "peerDependencies": { "@swc/helpers": ">=0.5.17" }, "optionalPeers": ["@swc/helpers"] }, "sha512-/C0kiMHPY/HnLfqXYGMGxGck3A5Y3mqwxfv+EwHTPHGjAVRfHpWAEEBTSTF5C88vVY6CvwBEkhR2TX7t8Mahcw=="],
|
|
126
126
|
|
|
127
|
-
"@swc/core-darwin-arm64": ["@swc/core-darwin-arm64@1.
|
|
127
|
+
"@swc/core-darwin-arm64": ["@swc/core-darwin-arm64@1.12.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-usLr8kC80GDv3pwH2zoEaS279kxtWY0MY3blbMFw7zA8fAjqxa8IDxm3WcgyNLNWckWn4asFfguEwz/Weem3nA=="],
|
|
128
128
|
|
|
129
|
-
"@swc/core-darwin-x64": ["@swc/core-darwin-x64@1.
|
|
129
|
+
"@swc/core-darwin-x64": ["@swc/core-darwin-x64@1.12.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-Cvv4sqDcTY7QF2Dh1vn2Xbt/1ENYQcpmrGHzITJrXzxA2aBopsz/n4yQDiyRxTR0t802m4xu0CzMoZIHvVruWQ=="],
|
|
130
130
|
|
|
131
|
-
"@swc/core-linux-arm-gnueabihf": ["@swc/core-linux-arm-gnueabihf@1.
|
|
131
|
+
"@swc/core-linux-arm-gnueabihf": ["@swc/core-linux-arm-gnueabihf@1.12.0", "", { "os": "linux", "cpu": "arm" }, "sha512-seM4/XMJMOupkzfLfHl8sRa3NdhsVZp+XgwA/vVeYZYJE4wuWUxVzhCYzwmNftVY32eF2IiRaWnhG6ho6jusnQ=="],
|
|
132
132
|
|
|
133
|
-
"@swc/core-linux-arm64-gnu": ["@swc/core-linux-arm64-gnu@1.
|
|
133
|
+
"@swc/core-linux-arm64-gnu": ["@swc/core-linux-arm64-gnu@1.12.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-Al0x33gUVxNY5tutEYpSyv7mze6qQS1ONa0HEwoRxcK9WXsX0NHLTiOSGZoCUS1SsXM37ONlbA6/Bsp1MQyP+g=="],
|
|
134
134
|
|
|
135
|
-
"@swc/core-linux-arm64-musl": ["@swc/core-linux-arm64-musl@1.
|
|
135
|
+
"@swc/core-linux-arm64-musl": ["@swc/core-linux-arm64-musl@1.12.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-OeFHz/5Hl9v75J9TYA5jQxNIYAZMqaiPpd9dYSTK2Xyqa/ZGgTtNyPhIwVfxx+9mHBf6+9c1mTlXUtACMtHmaQ=="],
|
|
136
136
|
|
|
137
|
-
"@swc/core-linux-x64-gnu": ["@swc/core-linux-x64-gnu@1.
|
|
137
|
+
"@swc/core-linux-x64-gnu": ["@swc/core-linux-x64-gnu@1.12.0", "", { "os": "linux", "cpu": "x64" }, "sha512-ltIvqNi7H0c5pRawyqjeYSKEIfZP4vv/datT3mwT6BW7muJtd1+KIDCPFLMIQ4wm/h76YQwPocsin3fzmnFdNA=="],
|
|
138
138
|
|
|
139
|
-
"@swc/core-linux-x64-musl": ["@swc/core-linux-x64-musl@1.
|
|
139
|
+
"@swc/core-linux-x64-musl": ["@swc/core-linux-x64-musl@1.12.0", "", { "os": "linux", "cpu": "x64" }, "sha512-Z/DhpjehaTK0uf+MhNB7mV9SuewpGs3P/q9/8+UsJeYoFr7yuOoPbAvrD6AqZkf6Bh7MRZ5OtG+KQgG5L+goiA=="],
|
|
140
140
|
|
|
141
|
-
"@swc/core-win32-arm64-msvc": ["@swc/core-win32-arm64-msvc@1.
|
|
141
|
+
"@swc/core-win32-arm64-msvc": ["@swc/core-win32-arm64-msvc@1.12.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-wHnvbfHIh2gfSbvuFT7qP97YCMUDh+fuiso+pcC6ug8IsMxuViNapHET4o0ZdFNWHhXJ7/s0e6w7mkOalsqQiQ=="],
|
|
142
142
|
|
|
143
|
-
"@swc/core-win32-ia32-msvc": ["@swc/core-win32-ia32-msvc@1.
|
|
143
|
+
"@swc/core-win32-ia32-msvc": ["@swc/core-win32-ia32-msvc@1.12.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-88umlXwK+7J2p4DjfWHXQpmlZgCf1ayt6Ssj+PYlAfMCR0aBiJoAMwHWrvDXEozyOrsyP1j2X6WxbmA861vL5Q=="],
|
|
144
144
|
|
|
145
|
-
"@swc/core-win32-x64-msvc": ["@swc/core-win32-x64-msvc@1.
|
|
145
|
+
"@swc/core-win32-x64-msvc": ["@swc/core-win32-x64-msvc@1.12.0", "", { "os": "win32", "cpu": "x64" }, "sha512-KR9TSRp+FEVOhbgTU6c94p/AYpsyBk7dIvlKQiDp8oKScUoyHG5yjmMBFN/BqUyTq4kj6zlgsY2rFE4R8/yqWg=="],
|
|
146
146
|
|
|
147
147
|
"@swc/counter": ["@swc/counter@0.1.3", "", {}, "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ=="],
|
|
148
148
|
|
|
149
|
-
"@swc/types": ["@swc/types@0.1.
|
|
149
|
+
"@swc/types": ["@swc/types@0.1.23", "", { "dependencies": { "@swc/counter": "^0.1.3" } }, "sha512-u1iIVZV9Q0jxY+yM2vw/hZGDNudsN85bBpTqzAQ9rzkxW9D+e3aEM4Han+ow518gSewkXgjmEK0BD79ZcNVgPw=="],
|
|
150
150
|
|
|
151
151
|
"@tannin/compile": ["@tannin/compile@1.1.0", "", { "dependencies": { "@tannin/evaluate": "^1.2.0", "@tannin/postfix": "^1.1.0" } }, "sha512-n8m9eNDfoNZoxdvWiTfW/hSPhehzLJ3zW7f8E7oT6mCROoMNWCB4TYtv041+2FMAxweiE0j7i1jubQU4MEC/Gg=="],
|
|
152
152
|
|
|
@@ -638,7 +638,7 @@
|
|
|
638
638
|
|
|
639
639
|
"pkg-dir": ["pkg-dir@4.2.0", "", { "dependencies": { "find-up": "^4.0.0" } }, "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ=="],
|
|
640
640
|
|
|
641
|
-
"postcss": ["postcss@8.5.
|
|
641
|
+
"postcss": ["postcss@8.5.5", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-d/jtm+rdNT8tpXuHY5MMtcbJFBkhXE6593XVR9UoGCH8jSFGci7jGvMGH5RYd5PBJW+00NZQt6gf7CbagJCrhg=="],
|
|
642
642
|
|
|
643
643
|
"postcss-calc": ["postcss-calc@10.1.1", "", { "dependencies": { "postcss-selector-parser": "^7.0.0", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.4.38" } }, "sha512-NYEsLHh8DgG/PRH2+G9BTuUdtf9ViS+vdoQ0YA5OQdGsfN4ztiwtDWNtBl9EKeqNMFnIu8IKZ0cLxEQ5r5KVMw=="],
|
|
644
644
|
|
|
@@ -960,6 +960,8 @@
|
|
|
960
960
|
|
|
961
961
|
"stylelint/ignore": ["ignore@7.0.5", "", {}, "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg=="],
|
|
962
962
|
|
|
963
|
+
"stylelint/postcss": ["postcss@8.5.4", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-QSa9EBe+uwlGTFmHsPKokv3B/oEMQZxfqW0QqNCyhpa6mB1afzulwn8hihglqAb2pOw+BJgNlmXQ8la2VeHB7w=="],
|
|
964
|
+
|
|
963
965
|
"stylelint/postcss-selector-parser": ["postcss-selector-parser@7.1.0", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA=="],
|
|
964
966
|
|
|
965
967
|
"supports-hyperlinks/supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eightshift/frontend-libs-tailwind",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
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,10 +34,10 @@
|
|
|
34
34
|
"homepage": "https://github.com/infinum/eightshift-frontend-libs-tailwind#readme",
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@eightshift/ui-components": "^5.0.
|
|
37
|
+
"@eightshift/ui-components": "^5.0.6",
|
|
38
38
|
"@stylistic/eslint-plugin-js": "^4.4.1",
|
|
39
39
|
"@stylistic/stylelint-plugin": "^3.1.2",
|
|
40
|
-
"@swc/core": "^1.
|
|
40
|
+
"@swc/core": "^1.12.0",
|
|
41
41
|
"@wordpress/dependency-extraction-webpack-plugin": "^6.25.0",
|
|
42
42
|
"browserslist": "^4.25.0",
|
|
43
43
|
"css-loader": "^7.1.2",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"husky": "^9.1.7",
|
|
50
50
|
"lightningcss": "^1.30.1",
|
|
51
51
|
"mini-css-extract-plugin": "^2.9.2",
|
|
52
|
-
"postcss": "^8.5.
|
|
52
|
+
"postcss": "^8.5.5",
|
|
53
53
|
"postcss-loader": "^8.1.1",
|
|
54
54
|
"prettier": "^3.5.3",
|
|
55
55
|
"prettier-plugin-tailwindcss": "^0.6.12",
|
package/scripts/editor/editor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { dispatch } from '@wordpress/data';
|
|
3
3
|
import { InspectorControls, BlockControls } from '@wordpress/block-editor';
|
|
4
|
-
import { ContainerPanel } from '@eightshift/ui-components';
|
|
4
|
+
import { ContainerPanel, PortalProvider } from '@eightshift/ui-components';
|
|
5
5
|
import { upperFirst } from '@eightshift/ui-components/utilities';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -88,6 +88,8 @@ export const lockIfUndefined = (blockClientId, attributeKey, value) => {
|
|
|
88
88
|
* @param {JSX.Element?} [props.options] - Options component
|
|
89
89
|
* @param {JSX.Element?} [props.toolbar] - Toolbar component
|
|
90
90
|
* @param {JSX.Element?} [props.editor] - Editor component
|
|
91
|
+
* @param {JSX.Element?} [props.toolbarPortalElement] - Portal override element to use for toolbar. Set to `false` to disable.
|
|
92
|
+
* @param {JSX.Element?} [props.editorPortalElement] - Portal override element to use for editor view. Set to `false` to disable.
|
|
91
93
|
* @param {boolean} [props.noOptionsContainer] - If `true`, the options component will not be wrapped in a container.
|
|
92
94
|
* @param {string} props.title - Block name. Will fall back to a name generated from the `blockName` attribute.
|
|
93
95
|
*
|
|
@@ -110,6 +112,10 @@ export const GutenbergBlock = (props) => {
|
|
|
110
112
|
toolbar: ToolbarComponent,
|
|
111
113
|
editor: EditorComponent,
|
|
112
114
|
noOptionsContainer = false,
|
|
115
|
+
toolbarPortalElement = document.querySelector('.block-editor-iframe__scale-container > iframe')?.contentWindow
|
|
116
|
+
?.document?.body,
|
|
117
|
+
editorPortalElement = document.querySelector('.block-editor-iframe__scale-container > iframe')?.contentWindow
|
|
118
|
+
?.document?.body,
|
|
113
119
|
title,
|
|
114
120
|
} = props;
|
|
115
121
|
|
|
@@ -126,13 +132,27 @@ export const GutenbergBlock = (props) => {
|
|
|
126
132
|
</InspectorControls>
|
|
127
133
|
)}
|
|
128
134
|
|
|
129
|
-
{ToolbarComponent && (
|
|
135
|
+
{ToolbarComponent && toolbarPortalElement && (
|
|
136
|
+
<PortalProvider portalElement={toolbarPortalElement}>
|
|
137
|
+
<BlockControls>
|
|
138
|
+
<ToolbarComponent {...props} />
|
|
139
|
+
</BlockControls>
|
|
140
|
+
</PortalProvider>
|
|
141
|
+
)}
|
|
142
|
+
|
|
143
|
+
{ToolbarComponent && !toolbarPortalElement && (
|
|
130
144
|
<BlockControls>
|
|
131
145
|
<ToolbarComponent {...props} />
|
|
132
146
|
</BlockControls>
|
|
133
147
|
)}
|
|
134
148
|
|
|
135
|
-
{EditorComponent &&
|
|
149
|
+
{EditorComponent && editorPortalElement && (
|
|
150
|
+
<PortalProvider portalElement={editorPortalElement}>
|
|
151
|
+
<EditorComponent {...props} />
|
|
152
|
+
</PortalProvider>
|
|
153
|
+
)}
|
|
154
|
+
|
|
155
|
+
{EditorComponent && !editorPortalElement && <EditorComponent {...props} />}
|
|
136
156
|
</>
|
|
137
157
|
);
|
|
138
158
|
};
|