itmar-block-packages 1.6.1 → 1.6.3
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/README.md +5 -0
- package/build/index.asset.php +1 -1
- package/build/index.js +3 -3
- package/languages/itmar-block-packages-ja-2e59d6ebc088ea4b3d475a06e1e94824.json +1 -0
- package/languages/itmar-block-packages-ja-314423d5ad20380dc5fb85a96050381e.json +1 -0
- package/languages/itmar-block-packages-ja-3e946be5d900b4a727047c8a51bb058e.json +1 -0
- package/languages/itmar-block-packages-ja-5f1760422a0125b48fdcca644f4db89f.json +1 -0
- package/languages/itmar-block-packages-ja-800102e626a7ce0305d324a5bb0ee61e.json +1 -0
- package/languages/itmar-block-packages-ja-865f209aff5ee1f8efb51f6a62e8d8e1.json +1 -0
- package/languages/itmar-block-packages-ja-88eb778e4da0e010ceace8232ab1a901.json +1 -0
- package/languages/itmar-block-packages-ja-a418e2f5e97a053f5e0785a30f28b854.json +1 -0
- package/languages/itmar-block-packages-ja-ce2d14d174f0af0f13cd9a1302cebdd7.json +1 -0
- package/languages/itmar-block-packages-ja-f55909920e3bd84845271a62dbfb8dfe.json +1 -0
- package/languages/itmar-block-packages-ja-f6bd3c69ad85ee9ae9f1315af8f44e4a.json +1 -0
- package/languages/itmar-block-packages-ja.mo +0 -0
- package/languages/itmar-block-packages-ja.po +1485 -0
- package/languages/itmar-block-packages.pot +530 -0
- package/package.json +1 -1
- package/src/BlockPlace.js +8 -2
- package/src/GridControls.js +196 -137
- package/src/IconSelectControl.js +63 -23
- package/src/ShadowStyle.js +215 -158
- package/src/TypographyControls.js +62 -30
|
@@ -4,33 +4,55 @@ import {
|
|
|
4
4
|
RadioControl,
|
|
5
5
|
ToggleControl,
|
|
6
6
|
__experimentalUnitControl as UnitControl,
|
|
7
|
-
} from
|
|
7
|
+
} from "@wordpress/components";
|
|
8
8
|
|
|
9
|
-
import Select from
|
|
10
|
-
import { __ } from
|
|
9
|
+
import Select from "react-select";
|
|
10
|
+
import { __ } from "@wordpress/i18n";
|
|
11
11
|
|
|
12
|
-
const TypographyControls = ({
|
|
12
|
+
const TypographyControls = ({
|
|
13
|
+
title,
|
|
14
|
+
fontStyle,
|
|
15
|
+
initialOpen,
|
|
16
|
+
isMobile,
|
|
17
|
+
onChange,
|
|
18
|
+
}) => {
|
|
13
19
|
const {
|
|
14
20
|
default_fontSize,
|
|
15
21
|
mobile_fontSize,
|
|
16
22
|
fontSize,
|
|
17
23
|
fontFamily,
|
|
18
24
|
fontWeight,
|
|
19
|
-
isItalic
|
|
25
|
+
isItalic,
|
|
20
26
|
} = fontStyle;
|
|
21
27
|
|
|
22
28
|
const fontFamilyOptions = [
|
|
23
|
-
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
{
|
|
30
|
+
value: "Arial, sans-serif",
|
|
31
|
+
label: "Arial",
|
|
32
|
+
fontFamily: "Arial, sans-serif",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: "Courier New, monospace",
|
|
36
|
+
label: "Courier New",
|
|
37
|
+
fontFamily: "Courier New, monospace",
|
|
38
|
+
},
|
|
39
|
+
{ value: "Georgia, serif", label: "Georgia", fontFamily: "Georgia, serif" },
|
|
40
|
+
{
|
|
41
|
+
label: "Noto Sans JP",
|
|
42
|
+
value: "Noto Sans JP, sans-serif",
|
|
43
|
+
fontFamily: "Noto Sans JP, sans-serif",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: "Texturina",
|
|
47
|
+
value: "Texturina, serif",
|
|
48
|
+
fontFamily: "Texturina, serif",
|
|
49
|
+
},
|
|
28
50
|
];
|
|
29
51
|
|
|
30
52
|
const units = [
|
|
31
|
-
{ value:
|
|
32
|
-
{ value:
|
|
33
|
-
{ value:
|
|
53
|
+
{ value: "px", label: "px" },
|
|
54
|
+
{ value: "em", label: "em" },
|
|
55
|
+
{ value: "rem", label: "rem" },
|
|
34
56
|
];
|
|
35
57
|
|
|
36
58
|
const customStyles = {
|
|
@@ -42,7 +64,9 @@ const TypographyControls = ({ title, fontStyle, initialOpen, isMobile, onChange
|
|
|
42
64
|
|
|
43
65
|
const FontSelect = ({ label, value, onChange }) => (
|
|
44
66
|
<>
|
|
45
|
-
{label &&
|
|
67
|
+
{label && (
|
|
68
|
+
<label className="components-base-control__label">{label}</label>
|
|
69
|
+
)}
|
|
46
70
|
<Select
|
|
47
71
|
options={fontFamilyOptions}
|
|
48
72
|
value={fontFamilyOptions.find((option) => option.value === value)}
|
|
@@ -55,24 +79,28 @@ const TypographyControls = ({ title, fontStyle, initialOpen, isMobile, onChange
|
|
|
55
79
|
);
|
|
56
80
|
|
|
57
81
|
return (
|
|
58
|
-
<PanelBody title={title} initialOpen={initialOpen}
|
|
82
|
+
<PanelBody title={title} initialOpen={initialOpen}>
|
|
59
83
|
<UnitControl
|
|
60
84
|
dragDirection="e"
|
|
61
85
|
onChange={(newValue) => {
|
|
62
|
-
newValue = newValue !=
|
|
63
|
-
const set_size = !isMobile
|
|
86
|
+
newValue = newValue != "" ? newValue : "0px";
|
|
87
|
+
const set_size = !isMobile
|
|
88
|
+
? { default_fontSize: newValue }
|
|
89
|
+
: { mobile_fontSize: newValue };
|
|
64
90
|
const newStyle = { ...fontStyle, ...set_size };
|
|
65
91
|
onChange(newStyle);
|
|
66
92
|
}}
|
|
67
|
-
label={
|
|
68
|
-
|
|
69
|
-
|
|
93
|
+
label={
|
|
94
|
+
!isMobile
|
|
95
|
+
? __("Size(desk top)", "block-collections")
|
|
96
|
+
: __("Size(mobile)", "block-collections")
|
|
97
|
+
}
|
|
70
98
|
value={!isMobile ? default_fontSize : mobile_fontSize}
|
|
71
99
|
units={units}
|
|
72
100
|
/>
|
|
73
101
|
|
|
74
102
|
<FontSelect
|
|
75
|
-
label={__("font family",
|
|
103
|
+
label={__("font family", "block-collections")}
|
|
76
104
|
value={fontFamily}
|
|
77
105
|
onChange={(newValue) => {
|
|
78
106
|
const newStyle = { ...fontStyle, fontFamily: newValue };
|
|
@@ -80,17 +108,19 @@ const TypographyControls = ({ title, fontStyle, initialOpen, isMobile, onChange
|
|
|
80
108
|
}}
|
|
81
109
|
/>
|
|
82
110
|
|
|
83
|
-
<label className="components-base-control__label">
|
|
84
|
-
|
|
111
|
+
<label className="components-base-control__label">
|
|
112
|
+
{__("font weight", "block-collections")}
|
|
113
|
+
</label>
|
|
114
|
+
<PanelRow className="itmar_weight_row">
|
|
85
115
|
<RadioControl
|
|
86
116
|
selected={fontWeight}
|
|
87
117
|
options={[
|
|
88
|
-
{ label:
|
|
89
|
-
{ label:
|
|
90
|
-
{ label:
|
|
91
|
-
{ label:
|
|
92
|
-
{ label:
|
|
93
|
-
{ label:
|
|
118
|
+
{ label: "LIGHT", value: "300" },
|
|
119
|
+
{ label: "REGULAR", value: "400" },
|
|
120
|
+
{ label: "MEDIUM", value: "500" },
|
|
121
|
+
{ label: "S-BOLD", value: "600" },
|
|
122
|
+
{ label: "BOLD", value: "700" },
|
|
123
|
+
{ label: "BLACK", value: "900" },
|
|
94
124
|
]}
|
|
95
125
|
onChange={(newValue) => {
|
|
96
126
|
const newStyle = { ...fontStyle, fontWeight: newValue };
|
|
@@ -99,7 +129,9 @@ const TypographyControls = ({ title, fontStyle, initialOpen, isMobile, onChange
|
|
|
99
129
|
/>
|
|
100
130
|
</PanelRow>
|
|
101
131
|
|
|
102
|
-
<label className="components-base-control__label">
|
|
132
|
+
<label className="components-base-control__label">
|
|
133
|
+
{__("Italic display", "block-collections")}
|
|
134
|
+
</label>
|
|
103
135
|
<ToggleControl
|
|
104
136
|
checked={isItalic}
|
|
105
137
|
onChange={(newValue) => {
|