@secretstache/wordpress-gutenberg 0.4.3 → 0.4.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/build/styles.css
CHANGED
@@ -7,8 +7,8 @@
|
|
7
7
|
.block-editor__container .editor-visual-editor.is-resizable + .edit-post-layout__metaboxes {
|
8
8
|
display: none; }
|
9
9
|
.block-editor__container .editor-visual-editor .editor-styles-wrapper .edit-post-visual-editor__post-title-wrapper {
|
10
|
-
margin-top: 10px;
|
11
|
-
margin-bottom: 10px; }
|
10
|
+
margin-top: 10px !important;
|
11
|
+
margin-bottom: 10px !important; }
|
12
12
|
.block-editor__container .editor-visual-editor .editor-styles-wrapper .edit-post-visual-editor__post-title-wrapper h1.editor-post-title {
|
13
13
|
margin: 0;
|
14
14
|
border-bottom: 1px dashed #ddd;
|
package/package.json
CHANGED
@@ -1,15 +1,20 @@
|
|
1
1
|
import { TabPanel } from '@wordpress/components';
|
2
|
-
import { useCallback } from '@wordpress/element';
|
2
|
+
import { useCallback, useEffect, useState } from '@wordpress/element';
|
3
3
|
|
4
4
|
import { SpacingControl } from './SpacingControl.js';
|
5
5
|
|
6
|
+
const getTabName = (deviceType = 'Desktop') => {
|
7
|
+
return deviceType === 'Desktop' ? 'desktop' : 'mobile';
|
8
|
+
};
|
9
|
+
|
6
10
|
export const ResponsiveSpacingControl = ({
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
max = 6,
|
12
|
+
min = -1,
|
13
|
+
hasMargin = true,
|
14
|
+
hasPadding = true,
|
15
|
+
onChange,
|
16
|
+
value = { desktop: { margin: {}, padding: {} }, mobile: { margin: {}, padding: {} } },
|
17
|
+
deviceType,
|
13
18
|
}) => {
|
14
19
|
const handleDesktopChange = useCallback(
|
15
20
|
(desktop) => {
|
@@ -31,9 +36,20 @@ export const ResponsiveSpacingControl = ({
|
|
31
36
|
[ onChange, value.desktop ],
|
32
37
|
);
|
33
38
|
|
39
|
+
const initialTabName = getTabName(deviceType);
|
40
|
+
|
41
|
+
const [ selectedTab, setSelectedTab ] = useState(initialTabName);
|
42
|
+
|
43
|
+
useEffect(() => {
|
44
|
+
setSelectedTab(getTabName());
|
45
|
+
}, [ deviceType ]);
|
46
|
+
|
34
47
|
return (
|
35
48
|
<TabPanel
|
36
49
|
className="bc-responsive-spacing-control"
|
50
|
+
initialTabName={initialTabName}
|
51
|
+
onSelect={setSelectedTab}
|
52
|
+
selectedTabName={selectedTab}
|
37
53
|
tabs={[
|
38
54
|
{ name: 'desktop', title: 'Desktop', className: 'bc-responsive-spacing-tab bc-responsive-spacing-tab--desktop' },
|
39
55
|
{ name: 'mobile', title: 'Mobile', className: 'bc-responsive-spacing-tab bc-responsive-spacing-tab--mobile' },
|
package/src/styles/styles.scss
CHANGED