PluginProbe
GutSlider – All in One Slider and Carousel Blocks for Gutenberg / 2.11.0
GutSlider – All in One Slider and Carousel Blocks for Gutenberg v2.11.0
3.2.0 3.1.0 3.0.0 2.13.2 2.13.1 2.13.0 trunk 1.0.0 2.1.0 2.10.0 2.10.1 2.11.0 2.11.1 2.11.2 2.11.3 2.11.4 2.12.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.1 2.5.3 2.5.4 2.5.5 All 57 releases
slider-blocks / src / blocks / before-after / attributes.js

attributes.js in GutSlider – All in One Slider and Carousel Blocks for Gutenberg 2.11.0, at src/blocks/before-after/attributes.js

222 lines 4.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 const {
2 generateResBoxControlAttributes,
3 generateBorderAttributes,
4 generateTypographyAttributes,
5 generateResRangeAttributes,
6 generateAlignmentAttributes,
7 generateBackgroundAttributes,
8 generateBoxShadowAttributes
9 } = window.gutSliderModules;
10
11 import {
12 AL_BG,
13 AL_BORDER,
14 AL_BRADIUS,
15 AL_BSHADOW,
16 AL_MARGIN,
17 AL_PADDING,
18 AL_TYPO,
19 BL_BG,
20 BL_BORDER,
21 BL_BRADIUS,
22 BL_BSHADOW,
23 BL_MARGIN,
24 BL_PADDING,
25 BL_TYPO,
26 CAP_ALIGN,
27 CAP_MARGIN,
28 CAP_TYPO,
29 CB_BG,
30 CB_BORDER,
31 CB_BRADIUS,
32 CB_BSHADOW,
33 CB_HEIGHT,
34 CB_WIDTH,
35 HANDLE_BG,
36 HANDLE_BSHADOW,
37 HANDLE_WIDTH,
38 HEIGHT
39 } from './constants';
40
41 const attributes = {
42 uniqueId: {
43 type: 'string'
44 },
45 preview: {
46 type: 'boolean',
47 default: false
48 },
49 blockStyle: {
50 type: 'object'
51 },
52 beforeImage: {
53 type: 'object',
54 default: {
55 id: '',
56 url: '',
57 alt: ''
58 }
59 },
60 afterImage: {
61 type: 'object',
62 default: {
63 id: '',
64 url: '',
65 alt: ''
66 }
67 },
68 sliderOptions: {
69 type: 'object',
70 default: {
71 showLabels: true,
72 labelsVisibility: 'always',
73 hoverAnimation: 'icgb__fade',
74 labelVPosition: 'icgbv__center',
75 labelHPosition: 'icgbh__center',
76 beforeLabel: 'Before',
77 afterLabel: 'After'
78 }
79 },
80 comparisonOptions: {
81 type: 'object',
82 default: {
83 disableSliding: false,
84 onlyHandleDraggable: false,
85 slideMode: 'horizontal',
86 swipeMode: 'drag',
87 initialPosition: 50
88 }
89 },
90 showCaption: {
91 type: 'boolean',
92 default: false
93 },
94 sliderCaption: {
95 type: 'string'
96 },
97 captionTag: {
98 type: 'string',
99 default: 'span'
100 },
101 blColor: {
102 type: 'string'
103 },
104 blBg: {
105 type: 'string'
106 },
107 afColor: {
108 type: 'string'
109 },
110 alBg: {
111 type: 'string'
112 },
113 capColor: {
114 type: 'string'
115 },
116 cbBlur: {
117 type: 'number'
118 },
119 handleBg: {
120 type: 'string'
121 },
122 arrowColor: {
123 type: 'string'
124 },
125 cbBg: {
126 type: 'string'
127 },
128 // Height
129 ...generateResRangeAttributes({
130 controlName: HEIGHT
131 }),
132 // Before Label
133 ...generateTypographyAttributes({
134 controlName: BL_TYPO
135 }),
136 ...generateBorderAttributes({
137 controlName: BL_BORDER
138 }),
139 ...generateResBoxControlAttributes({
140 controlName: BL_BRADIUS
141 }),
142 ...generateBackgroundAttributes({
143 controlName: BL_BG
144 }),
145 ...generateBoxShadowAttributes({
146 controlName: BL_BSHADOW
147 }),
148 ...generateResBoxControlAttributes({
149 controlName: BL_MARGIN
150 }),
151 ...generateResBoxControlAttributes({
152 controlName: BL_PADDING
153 }),
154
155 // After Label
156 ...generateTypographyAttributes({
157 controlName: AL_TYPO
158 }),
159 ...generateBorderAttributes({
160 controlName: AL_BORDER
161 }),
162 ...generateResBoxControlAttributes({
163 controlName: AL_BRADIUS
164 }),
165 ...generateBackgroundAttributes({
166 controlName: AL_BG
167 }),
168 ...generateBoxShadowAttributes({
169 controlName: AL_BSHADOW
170 }),
171 ...generateResBoxControlAttributes({
172 controlName: AL_MARGIN
173 }),
174 ...generateResBoxControlAttributes({
175 controlName: AL_PADDING
176 }),
177
178 // Caption
179 ...generateAlignmentAttributes({
180 controlName: CAP_ALIGN
181 }),
182 ...generateTypographyAttributes({
183 controlName: CAP_TYPO
184 }),
185 ...generateResBoxControlAttributes({
186 controlName: CAP_MARGIN
187 }),
188
189 // Control line
190 ...generateResRangeAttributes({
191 controlName: HANDLE_WIDTH
192 }),
193 ...generateBackgroundAttributes({
194 controlName: HANDLE_BG
195 }),
196 ...generateBoxShadowAttributes({
197 controlName: HANDLE_BSHADOW
198 }),
199
200 // Control Button
201 ...generateBorderAttributes({
202 controlName: CB_BORDER
203 }),
204 ...generateResBoxControlAttributes({
205 controlName: CB_BRADIUS
206 }),
207 ...generateBackgroundAttributes({
208 controlName: CB_BG
209 }),
210 ...generateBoxShadowAttributes({
211 controlName: CB_BSHADOW
212 }),
213 ...generateResRangeAttributes({
214 controlName: CB_WIDTH
215 }),
216 ...generateResRangeAttributes({
217 controlName: CB_HEIGHT
218 })
219 };
220
221 export default attributes;
222