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
package/src/ShadowStyle.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
__experimentalPanelColorGradientSettings as PanelColorGradientSettings,
|
|
5
|
-
} from '@wordpress/block-editor';
|
|
1
|
+
import { __ } from "@wordpress/i18n";
|
|
2
|
+
import { __experimentalPanelColorGradientSettings as PanelColorGradientSettings } from "@wordpress/block-editor";
|
|
6
3
|
import {
|
|
7
4
|
PanelBody,
|
|
8
5
|
PanelRow,
|
|
9
6
|
ToggleControl,
|
|
10
7
|
RangeControl,
|
|
11
|
-
RadioControl
|
|
12
|
-
} from
|
|
13
|
-
import { useState, useEffect } from
|
|
14
|
-
import { dispatch } from
|
|
15
|
-
import { hslToRgb16, HexToRGB, rgb16ToHsl } from
|
|
8
|
+
RadioControl,
|
|
9
|
+
} from "@wordpress/components";
|
|
10
|
+
import { useState, useEffect } from "@wordpress/element";
|
|
11
|
+
import { dispatch } from "@wordpress/data";
|
|
12
|
+
import { hslToRgb16, HexToRGB, rgb16ToHsl } from "./hslToRgb";
|
|
16
13
|
|
|
17
14
|
//方向と距離
|
|
18
15
|
const dirctionDigit = (direction, distance) => {
|
|
@@ -55,23 +52,23 @@ const dirctionDigit = (direction, distance) => {
|
|
|
55
52
|
destBottomRight = distance;
|
|
56
53
|
break;
|
|
57
54
|
}
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
)
|
|
66
|
-
}
|
|
55
|
+
return {
|
|
56
|
+
topLeft: destTopLeft,
|
|
57
|
+
topRight: destTopRight,
|
|
58
|
+
bottomLeft: destBottomLeft,
|
|
59
|
+
bottmRight: destBottomRight,
|
|
60
|
+
};
|
|
61
|
+
};
|
|
67
62
|
|
|
68
63
|
// グラデーションの色値は通常'linear-gradient'または'radial-gradient'で始まるので、
|
|
69
64
|
// これらのキーワードを探すことでグラデーションかどうかを判断します。
|
|
70
65
|
function isGradient(colorValue) {
|
|
71
|
-
return
|
|
66
|
+
return (
|
|
67
|
+
colorValue.includes("linear-gradient") ||
|
|
68
|
+
colorValue.includes("radial-gradient")
|
|
69
|
+
);
|
|
72
70
|
}
|
|
73
71
|
|
|
74
|
-
|
|
75
72
|
export const ShadowElm = (shadowState) => {
|
|
76
73
|
//let baseColor;
|
|
77
74
|
const {
|
|
@@ -94,41 +91,50 @@ export const ShadowElm = (shadowState) => {
|
|
|
94
91
|
glassblur,
|
|
95
92
|
glassopa,
|
|
96
93
|
hasOutline,
|
|
97
|
-
baseColor
|
|
94
|
+
baseColor,
|
|
98
95
|
} = shadowState;
|
|
99
96
|
|
|
100
97
|
//ノーマル
|
|
101
|
-
if (shadowType ===
|
|
98
|
+
if (shadowType === "nomal") {
|
|
102
99
|
//boxshadowの生成
|
|
103
|
-
const ShadowStyle =
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
100
|
+
const ShadowStyle =
|
|
101
|
+
embos === "dent"
|
|
102
|
+
? {
|
|
103
|
+
style: {
|
|
104
|
+
boxShadow: `${lateral}px ${longitude}px ${nomalBlur}px ${spread}px transparent, inset ${lateral}px ${longitude}px ${nomalBlur}px ${spread}px ${shadowColor}`,
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
: {
|
|
108
|
+
style: {
|
|
109
|
+
boxShadow: `${lateral}px ${longitude}px ${nomalBlur}px ${spread}px ${shadowColor}, inset ${lateral}px ${longitude}px ${nomalBlur}px ${spread}px transparent`,
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
112
|
//Shadowのスタイルを返す
|
|
113
113
|
return ShadowStyle;
|
|
114
114
|
}
|
|
115
115
|
//ニューモフィズム
|
|
116
|
-
else if (shadowType ===
|
|
117
|
-
|
|
116
|
+
else if (shadowType === "newmor") {
|
|
118
117
|
//背景がグラデーションのときはセットしない
|
|
119
118
|
if (isGradient(baseColor)) {
|
|
120
|
-
dispatch(
|
|
121
|
-
|
|
122
|
-
__(
|
|
123
|
-
|
|
119
|
+
dispatch("core/notices").createNotice(
|
|
120
|
+
"error",
|
|
121
|
+
__(
|
|
122
|
+
"Neumorphism cannot be set when the background color is a gradient. ",
|
|
123
|
+
"itmar_guest_contact_block"
|
|
124
|
+
),
|
|
125
|
+
{ type: "snackbar", isDismissible: true }
|
|
124
126
|
);
|
|
125
127
|
return null;
|
|
126
128
|
}
|
|
127
129
|
//ボタン背景色のHSL値
|
|
128
130
|
const hslValue = rgb16ToHsl(baseColor);
|
|
129
131
|
//影の明るさを変更
|
|
130
|
-
const lightVal =
|
|
131
|
-
|
|
132
|
+
const lightVal =
|
|
133
|
+
hslValue.lightness + intensity < 100
|
|
134
|
+
? hslValue.lightness + intensity
|
|
135
|
+
: 100;
|
|
136
|
+
const darkVal =
|
|
137
|
+
hslValue.lightness - intensity > 0 ? hslValue.lightness - intensity : 0;
|
|
132
138
|
const lightValue = hslToRgb16(hslValue.hue, hslValue.saturation, lightVal);
|
|
133
139
|
const darkValue = hslToRgb16(hslValue.hue, hslValue.saturation, darkVal);
|
|
134
140
|
//boxshadowの生成
|
|
@@ -137,90 +143,105 @@ export const ShadowElm = (shadowState) => {
|
|
|
137
143
|
|
|
138
144
|
const baseStyle = {
|
|
139
145
|
style: {
|
|
140
|
-
border:
|
|
141
|
-
background: baseColor
|
|
142
|
-
}
|
|
143
|
-
}
|
|
146
|
+
border: "none",
|
|
147
|
+
background: baseColor,
|
|
148
|
+
},
|
|
149
|
+
};
|
|
144
150
|
|
|
145
|
-
const newmorStyle =
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
const newmorStyle =
|
|
152
|
+
embos === "swell"
|
|
153
|
+
? {
|
|
154
|
+
style: {
|
|
155
|
+
...baseStyle.style,
|
|
156
|
+
boxShadow: `${dircObj.topLeft}px ${dircObj.topRight}px ${blur}px ${darkValue}, ${dircObj.bottomLeft}px ${dircObj.bottmRight}px ${blur}px ${lightValue}, inset ${dircObj.topLeft}px ${dircObj.topRight}px ${blur}px transparent, inset ${dircObj.bottomLeft}px ${dircObj.bottmRight}px ${blur}px transparent`,
|
|
157
|
+
},
|
|
158
|
+
}
|
|
159
|
+
: {
|
|
160
|
+
style: {
|
|
161
|
+
...baseStyle.style,
|
|
162
|
+
boxShadow: `${dircObj.topLeft}px ${dircObj.topRight}px ${blur}px transparent, ${dircObj.bottomLeft}px ${dircObj.bottmRight}px ${blur}px transparent, inset ${dircObj.topLeft}px ${dircObj.topRight}px ${blur}px ${darkValue}, inset ${dircObj.bottomLeft}px ${dircObj.bottmRight}px ${blur}px ${lightValue}`,
|
|
163
|
+
},
|
|
164
|
+
};
|
|
156
165
|
|
|
157
166
|
//Shadowのスタイルを返す
|
|
158
167
|
return newmorStyle;
|
|
159
168
|
}
|
|
160
169
|
|
|
161
170
|
//クレイモーフィズム
|
|
162
|
-
else if (shadowType ===
|
|
171
|
+
else if (shadowType === "claymor") {
|
|
163
172
|
//背景がグラデーションのときはセットしない
|
|
164
173
|
if (isGradient(baseColor)) {
|
|
165
|
-
dispatch(
|
|
166
|
-
|
|
167
|
-
__(
|
|
168
|
-
|
|
174
|
+
dispatch("core/notices").createNotice(
|
|
175
|
+
"error",
|
|
176
|
+
__(
|
|
177
|
+
"claymorphism cannot be set when the background color is a gradient. ",
|
|
178
|
+
"itmar_guest_contact_block"
|
|
179
|
+
),
|
|
180
|
+
{ type: "snackbar", isDismissible: true }
|
|
169
181
|
);
|
|
170
182
|
return null;
|
|
171
183
|
}
|
|
172
|
-
const rgbValue = HexToRGB(baseColor)
|
|
173
|
-
const outsetObj = dirctionDigit(clayDirection, expand)
|
|
174
|
-
const insetObj = dirctionDigit(clayDirection, depth)
|
|
184
|
+
const rgbValue = HexToRGB(baseColor);
|
|
185
|
+
const outsetObj = dirctionDigit(clayDirection, expand);
|
|
186
|
+
const insetObj = dirctionDigit(clayDirection, depth);
|
|
175
187
|
const baseStyle = {
|
|
176
188
|
style: {
|
|
177
189
|
background: `rgba(255, 255, 255, ${opacity})`,
|
|
178
190
|
backdropFilter: `blur(${bdBlur}px)`,
|
|
179
|
-
border:
|
|
180
|
-
}
|
|
181
|
-
}
|
|
191
|
+
border: "none",
|
|
192
|
+
},
|
|
193
|
+
};
|
|
182
194
|
const claymorStyle = {
|
|
183
195
|
...baseStyle,
|
|
184
196
|
style: {
|
|
185
197
|
...baseStyle.style,
|
|
186
|
-
boxShadow: `${outsetObj.topLeft}px ${outsetObj.bottmRight}px ${
|
|
187
|
-
|
|
188
|
-
|
|
198
|
+
boxShadow: `${outsetObj.topLeft}px ${outsetObj.bottmRight}px ${
|
|
199
|
+
expand * 2
|
|
200
|
+
}px 0px rgba(${rgbValue.red}, ${rgbValue.green}, ${
|
|
201
|
+
rgbValue.blue
|
|
202
|
+
}, 0.5), inset ${insetObj.topRight}px ${
|
|
203
|
+
insetObj.bottomLeft
|
|
204
|
+
}px 16px 0px rgba(${rgbValue.red}, ${rgbValue.green}, ${
|
|
205
|
+
rgbValue.blue
|
|
206
|
+
}, 0.6), inset 0px 11px 28px 0px rgb(255, 255, 255)`,
|
|
207
|
+
},
|
|
208
|
+
};
|
|
189
209
|
//attributesに保存
|
|
190
210
|
return claymorStyle;
|
|
191
211
|
}
|
|
192
212
|
|
|
193
213
|
//グラスモーフィズム
|
|
194
|
-
else if (shadowType ===
|
|
195
|
-
|
|
214
|
+
else if (shadowType === "glassmor") {
|
|
196
215
|
const baseStyle = {
|
|
197
216
|
style: {
|
|
198
217
|
backgroundColor: `rgba(255, 255, 255, ${glassopa})`,
|
|
199
|
-
...hasOutline ? { border: `1px solid rgba(255, 255, 255, 0.4)` } : {},
|
|
218
|
+
...(hasOutline ? { border: `1px solid rgba(255, 255, 255, 0.4)` } : {}),
|
|
200
219
|
borderRightColor: `rgba(255, 255, 255, 0.2)`,
|
|
201
220
|
borderBottomColor: `rgba(255, 255, 255, 0.2)`,
|
|
202
|
-
backdropFilter: `blur( ${glassblur}px )
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
const glassmorStyle =
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
221
|
+
backdropFilter: `blur( ${glassblur}px )`,
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
const glassmorStyle =
|
|
225
|
+
embos === "swell"
|
|
226
|
+
? {
|
|
227
|
+
...baseStyle,
|
|
228
|
+
style: {
|
|
229
|
+
...baseStyle.style,
|
|
230
|
+
boxShadow: `0 8px 12px 0 rgba( 31, 38, 135, 0.37 ), inset 0 8px 12px 0 transparent`,
|
|
231
|
+
},
|
|
232
|
+
}
|
|
233
|
+
: {
|
|
234
|
+
...baseStyle,
|
|
235
|
+
style: {
|
|
236
|
+
...baseStyle.style,
|
|
237
|
+
boxShadow: `0 8px 12px 0 transparent, inset 0 8px 12px 0 rgba( 31, 38, 135, 0.37 )`,
|
|
238
|
+
},
|
|
239
|
+
};
|
|
219
240
|
|
|
220
241
|
//attributesに保存
|
|
221
242
|
return glassmorStyle;
|
|
222
243
|
}
|
|
223
|
-
}
|
|
244
|
+
};
|
|
224
245
|
|
|
225
246
|
const ShadowStyle = ({ shadowStyle, onChange }) => {
|
|
226
247
|
const [shadowState, setShadowState] = useState(shadowStyle);
|
|
@@ -244,51 +265,66 @@ const ShadowStyle = ({ shadowStyle, onChange }) => {
|
|
|
244
265
|
expand,
|
|
245
266
|
glassblur,
|
|
246
267
|
glassopa,
|
|
247
|
-
hasOutline
|
|
268
|
+
hasOutline,
|
|
248
269
|
} = shadowState;
|
|
249
270
|
|
|
250
271
|
//シャドーのスタイル変更と背景色変更に伴う親コンポーネントの変更
|
|
251
272
|
useEffect(() => {
|
|
252
273
|
const shadowElm = ShadowElm(shadowState);
|
|
253
|
-
if (shadowElm) onChange(shadowElm, shadowState)
|
|
274
|
+
if (shadowElm) onChange(shadowElm, shadowState);
|
|
254
275
|
}, [shadowState]);
|
|
255
276
|
|
|
256
277
|
return (
|
|
257
278
|
<>
|
|
258
|
-
<PanelBody
|
|
279
|
+
<PanelBody
|
|
280
|
+
title={__("Shadow Type", "block-collections")}
|
|
281
|
+
initialOpen={true}
|
|
282
|
+
>
|
|
259
283
|
<div className="itmar_shadow_type">
|
|
260
284
|
<RadioControl
|
|
261
285
|
selected={shadowType}
|
|
262
286
|
options={[
|
|
263
|
-
{ label: __("Nomal",
|
|
264
|
-
{
|
|
265
|
-
|
|
266
|
-
|
|
287
|
+
{ label: __("Nomal", "block-collections"), value: "nomal" },
|
|
288
|
+
{
|
|
289
|
+
label: __("Neumorphism", "block-collections"),
|
|
290
|
+
value: "newmor",
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
label: __("Claymorphism", "block-collections"),
|
|
294
|
+
value: "claymor",
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
label: __("Grassmophism", "block-collections"),
|
|
298
|
+
value: "glassmor",
|
|
299
|
+
},
|
|
267
300
|
]}
|
|
268
|
-
onChange={(changeOption) =>
|
|
301
|
+
onChange={(changeOption) =>
|
|
302
|
+
setShadowState({ ...shadowState, shadowType: changeOption })
|
|
303
|
+
}
|
|
269
304
|
/>
|
|
270
305
|
</div>
|
|
271
|
-
{
|
|
306
|
+
{shadowType !== "claymor" && (
|
|
272
307
|
<div className="embos">
|
|
273
308
|
<RadioControl
|
|
274
|
-
label={__("unevenness",
|
|
309
|
+
label={__("unevenness", "block-collections")}
|
|
275
310
|
selected={embos}
|
|
276
|
-
options={[
|
|
277
|
-
|
|
278
|
-
{
|
|
279
|
-
|
|
280
|
-
]}
|
|
281
|
-
onChange={(changeOption) => setShadowState({ ...shadowState, embos: changeOption })}
|
|
311
|
+
options={[{ value: "swell" }, { value: "dent" }]}
|
|
312
|
+
onChange={(changeOption) =>
|
|
313
|
+
setShadowState({ ...shadowState, embos: changeOption })
|
|
314
|
+
}
|
|
282
315
|
/>
|
|
283
316
|
</div>
|
|
284
|
-
}
|
|
317
|
+
)}
|
|
285
318
|
</PanelBody>
|
|
286
319
|
|
|
287
|
-
{shadowType ===
|
|
288
|
-
<PanelBody
|
|
320
|
+
{shadowType === "nomal" && (
|
|
321
|
+
<PanelBody
|
|
322
|
+
title={__("Nomal settings", "block-collections")}
|
|
323
|
+
initialOpen={false}
|
|
324
|
+
>
|
|
289
325
|
<RangeControl
|
|
290
326
|
value={spread}
|
|
291
|
-
label={__("Spread",
|
|
327
|
+
label={__("Spread", "block-collections")}
|
|
292
328
|
max={50}
|
|
293
329
|
min={0}
|
|
294
330
|
onChange={(val) => setShadowState({ ...shadowState, spread: val })}
|
|
@@ -296,7 +332,7 @@ const ShadowStyle = ({ shadowStyle, onChange }) => {
|
|
|
296
332
|
/>
|
|
297
333
|
<RangeControl
|
|
298
334
|
value={lateral}
|
|
299
|
-
label={__("Lateral direction",
|
|
335
|
+
label={__("Lateral direction", "block-collections")}
|
|
300
336
|
max={50}
|
|
301
337
|
min={0}
|
|
302
338
|
onChange={(val) => setShadowState({ ...shadowState, lateral: val })}
|
|
@@ -304,55 +340,66 @@ const ShadowStyle = ({ shadowStyle, onChange }) => {
|
|
|
304
340
|
/>
|
|
305
341
|
<RangeControl
|
|
306
342
|
value={longitude}
|
|
307
|
-
label={__("Longitudinal direction",
|
|
343
|
+
label={__("Longitudinal direction", "block-collections")}
|
|
308
344
|
max={50}
|
|
309
345
|
min={0}
|
|
310
|
-
onChange={(val) =>
|
|
346
|
+
onChange={(val) =>
|
|
347
|
+
setShadowState({ ...shadowState, longitude: val })
|
|
348
|
+
}
|
|
311
349
|
withInputField={false}
|
|
312
350
|
/>
|
|
313
351
|
<RangeControl
|
|
314
352
|
value={nomalBlur}
|
|
315
|
-
label={__("Blur",
|
|
353
|
+
label={__("Blur", "block-collections")}
|
|
316
354
|
max={20}
|
|
317
355
|
min={0}
|
|
318
|
-
onChange={(val) =>
|
|
356
|
+
onChange={(val) =>
|
|
357
|
+
setShadowState({ ...shadowState, nomalBlur: val })
|
|
358
|
+
}
|
|
319
359
|
withInputField={false}
|
|
320
360
|
/>
|
|
321
361
|
<PanelColorGradientSettings
|
|
322
|
-
title={__("Shadow Color Setting",
|
|
362
|
+
title={__("Shadow Color Setting", "block-collections")}
|
|
323
363
|
settings={[
|
|
324
364
|
{
|
|
325
365
|
colorValue: shadowColor,
|
|
326
|
-
label: __("Choose Shadow color",
|
|
327
|
-
onColorChange: (newValue) =>
|
|
366
|
+
label: __("Choose Shadow color", "block-collections"),
|
|
367
|
+
onColorChange: (newValue) =>
|
|
368
|
+
setShadowState({ ...shadowState, shadowColor: newValue }),
|
|
328
369
|
},
|
|
329
370
|
]}
|
|
330
371
|
/>
|
|
331
|
-
|
|
332
372
|
</PanelBody>
|
|
333
|
-
}
|
|
373
|
+
)}
|
|
334
374
|
|
|
335
|
-
{shadowType ===
|
|
336
|
-
<PanelBody
|
|
375
|
+
{shadowType === "newmor" && (
|
|
376
|
+
<PanelBody
|
|
377
|
+
title={__("Neumorphism settings", "block-collections")}
|
|
378
|
+
initialOpen={false}
|
|
379
|
+
>
|
|
337
380
|
<RangeControl
|
|
338
381
|
value={distance}
|
|
339
|
-
label={__("Distance",
|
|
382
|
+
label={__("Distance", "block-collections")}
|
|
340
383
|
max={50}
|
|
341
384
|
min={0}
|
|
342
|
-
onChange={(val) =>
|
|
385
|
+
onChange={(val) =>
|
|
386
|
+
setShadowState({ ...shadowState, distance: val })
|
|
387
|
+
}
|
|
343
388
|
withInputField={false}
|
|
344
389
|
/>
|
|
345
390
|
<RangeControl
|
|
346
391
|
value={intensity}
|
|
347
|
-
label={__("Intensity",
|
|
392
|
+
label={__("Intensity", "block-collections")}
|
|
348
393
|
max={100}
|
|
349
394
|
min={0}
|
|
350
|
-
onChange={(val) =>
|
|
395
|
+
onChange={(val) =>
|
|
396
|
+
setShadowState({ ...shadowState, intensity: val })
|
|
397
|
+
}
|
|
351
398
|
withInputField={false}
|
|
352
399
|
/>
|
|
353
400
|
<RangeControl
|
|
354
401
|
value={blur}
|
|
355
|
-
label={__("Blur",
|
|
402
|
+
label={__("Blur", "block-collections")}
|
|
356
403
|
max={20}
|
|
357
404
|
min={0}
|
|
358
405
|
onChange={(val) => setShadowState({ ...shadowState, blur: val })}
|
|
@@ -363,29 +410,30 @@ const ShadowStyle = ({ shadowStyle, onChange }) => {
|
|
|
363
410
|
<RadioControl
|
|
364
411
|
selected={newDirection}
|
|
365
412
|
options={[
|
|
366
|
-
{ value:
|
|
367
|
-
{ value:
|
|
368
|
-
{ value:
|
|
369
|
-
{ value:
|
|
413
|
+
{ value: "top_left" },
|
|
414
|
+
{ value: "top_right" },
|
|
415
|
+
{ value: "bottom_left" },
|
|
416
|
+
{ value: "bottom_right" },
|
|
370
417
|
]}
|
|
371
|
-
onChange={(changeOption) =>
|
|
418
|
+
onChange={(changeOption) =>
|
|
419
|
+
setShadowState({ ...shadowState, newDirection: changeOption })
|
|
420
|
+
}
|
|
372
421
|
/>
|
|
373
422
|
</div>
|
|
374
|
-
|
|
375
423
|
</PanelRow>
|
|
376
|
-
|
|
377
424
|
</PanelBody>
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
425
|
+
)}
|
|
426
|
+
{shadowType === "claymor" && (
|
|
427
|
+
<PanelBody
|
|
428
|
+
title={__("Claymorphism settings", "block-collections")}
|
|
429
|
+
initialOpen={false}
|
|
430
|
+
>
|
|
383
431
|
<RangeControl
|
|
384
432
|
value={opacity}
|
|
385
|
-
label={__("Opacity",
|
|
433
|
+
label={__("Opacity", "block-collections")}
|
|
386
434
|
max={1}
|
|
387
435
|
min={0}
|
|
388
|
-
step={.1}
|
|
436
|
+
step={0.1}
|
|
389
437
|
onChange={(val) => setShadowState({ ...shadowState, opacity: val })}
|
|
390
438
|
withInputField={false}
|
|
391
439
|
/>
|
|
@@ -417,47 +465,56 @@ const ShadowStyle = ({ shadowStyle, onChange }) => {
|
|
|
417
465
|
<RadioControl
|
|
418
466
|
selected={clayDirection}
|
|
419
467
|
options={[
|
|
420
|
-
{ value:
|
|
421
|
-
{ value:
|
|
422
|
-
{ value:
|
|
468
|
+
{ value: "right_bottom" },
|
|
469
|
+
{ value: "top_right" },
|
|
470
|
+
{ value: "top" },
|
|
423
471
|
]}
|
|
424
|
-
onChange={(changeOption) =>
|
|
472
|
+
onChange={(changeOption) =>
|
|
473
|
+
setShadowState({ ...shadowState, clayDirection: changeOption })
|
|
474
|
+
}
|
|
425
475
|
/>
|
|
426
476
|
</div>
|
|
427
477
|
</PanelBody>
|
|
428
|
-
}
|
|
478
|
+
)}
|
|
429
479
|
|
|
430
|
-
{shadowType ===
|
|
431
|
-
<PanelBody
|
|
480
|
+
{shadowType === "glassmor" && (
|
|
481
|
+
<PanelBody
|
|
482
|
+
title={__("Grassmophism settings", "block-collections")}
|
|
483
|
+
initialOpen={false}
|
|
484
|
+
>
|
|
432
485
|
<RangeControl
|
|
433
486
|
value={glassblur}
|
|
434
|
-
label={__("Glass blur",
|
|
487
|
+
label={__("Glass blur", "block-collections")}
|
|
435
488
|
max={20}
|
|
436
489
|
min={0}
|
|
437
|
-
onChange={(val) =>
|
|
490
|
+
onChange={(val) =>
|
|
491
|
+
setShadowState({ ...shadowState, glassblur: val })
|
|
492
|
+
}
|
|
438
493
|
withInputField={false}
|
|
439
494
|
/>
|
|
440
495
|
<RangeControl
|
|
441
496
|
value={glassopa}
|
|
442
|
-
label={__("Glass Opacity",
|
|
497
|
+
label={__("Glass Opacity", "block-collections")}
|
|
443
498
|
max={1}
|
|
444
499
|
min={0}
|
|
445
|
-
step={.1}
|
|
446
|
-
onChange={(val) =>
|
|
500
|
+
step={0.1}
|
|
501
|
+
onChange={(val) =>
|
|
502
|
+
setShadowState({ ...shadowState, glassopa: val })
|
|
503
|
+
}
|
|
447
504
|
withInputField={false}
|
|
448
505
|
/>
|
|
449
506
|
<fieldset>
|
|
450
507
|
<ToggleControl
|
|
451
|
-
label={__("Show outline",
|
|
508
|
+
label={__("Show outline", "block-collections")}
|
|
452
509
|
checked={hasOutline}
|
|
453
|
-
onChange={() =>
|
|
510
|
+
onChange={() =>
|
|
511
|
+
setShadowState({ ...shadowState, hasOutline: !hasOutline })
|
|
512
|
+
}
|
|
454
513
|
/>
|
|
455
514
|
</fieldset>
|
|
456
515
|
</PanelBody>
|
|
457
|
-
}
|
|
516
|
+
)}
|
|
458
517
|
</>
|
|
459
|
-
|
|
460
518
|
);
|
|
461
519
|
};
|
|
462
520
|
export default ShadowStyle;
|
|
463
|
-
|