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 / any-content / attributes.js

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

305 lines 6.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import * as Constants from './constants';
2 const {
3 generateResBoxControlAttributes,
4 generateBorderAttributes,
5 generateResRangeAttributes,
6 generateAlignmentAttributes,
7 generateResBtnsAttributes
8 } = window.gutSliderModules;
9 const {
10 COLUMNS,
11 COLUMNS_GAP,
12 SLIDE_HEIGHT,
13 SLIDE_PADDING,
14 SLIDE_MARGIN,
15 CONTENT_WIDTH,
16 CONTENT_HPOSITION,
17 CONTENT_VPOSITION,
18 CONTENT_ALIGN,
19 CONTENT_HALIGN,
20 CONTENT_PADDING,
21 NAV_BORDER,
22 NAV_BRADIUS,
23 NAV_WIDTH,
24 NAV_HEIGHT,
25 NAV_ICON_SIZE,
26 NAV_MARGIN,
27 NAV_GAP,
28 PAG_BORDER,
29 PAG_BRADIUS,
30 PAG_WIDTH,
31 PAG_HEIGHT,
32 PAG_MARGIN,
33 APAG_BORDER,
34 APAG_BRADIUS,
35 APAG_WIDTH,
36 APAG_HEIGHT,
37 FRAC_SIZE,
38 PROG_SIZE
39 } = 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 sliderType: {
53 type: 'string',
54 default: 'slider'
55 },
56 addNewSlide: {
57 type: 'boolean',
58 default: false
59 },
60 // carousel settings
61 infiniteLoop: {
62 type: 'boolean',
63 default: true
64 },
65 autoplay: {
66 type: 'boolean',
67 default: false
68 },
69 autoplayDelay: {
70 type: 'number'
71 },
72 pauseOnHover: {
73 type: 'boolean',
74 default: true
75 },
76 reverseDirection: {
77 type: 'boolean',
78 default: false
79 },
80 stopOnLastSlide: {
81 type: 'boolean',
82 default: false
83 },
84 speed: {
85 type: 'number'
86 },
87 centerMode: {
88 type: 'boolean',
89 default: false
90 },
91 showNavigation: {
92 type: 'boolean',
93 default: true
94 },
95 showPagination: {
96 type: 'boolean',
97 default: true
98 },
99 paginationType: {
100 type: 'string',
101 default: 'bullets'
102 },
103 dynamicBullets: {
104 type: 'boolean',
105 default: false
106 },
107 keyboardControl: {
108 type: 'boolean',
109 default: false
110 },
111 mousewheelControl: {
112 type: 'boolean',
113 default: false
114 },
115 slideEffect: {
116 type: 'string',
117 default: 'slide'
118 },
119 carouselEffect: {
120 type: 'string',
121 default: 'slide'
122 },
123 creativeEffectStyle: {
124 type: 'string',
125 default: 'style-3'
126 },
127 sliderOptions: {
128 type: 'object',
129 default: {}
130 },
131 // remote navigation
132 enableRemoteNav: {
133 type: 'boolean',
134 default: false
135 },
136 remotePrevSelector: {
137 type: 'string'
138 },
139 remoteNextSelector: {
140 type: 'string'
141 },
142 // navigation style
143 navColor: {
144 type: 'string'
145 },
146 navBgColor: {
147 type: 'string'
148 },
149 navHoverColor: {
150 type: 'string'
151 },
152 navHoverBgColor: {
153 type: 'string'
154 },
155 navContainerPosition: {
156 type: 'string',
157 default: 'nav_inside'
158 },
159 navPosition: {
160 type: 'string',
161 default: 'nav_cc'
162 },
163 customNavIcon: {
164 type: 'boolean',
165 default: false
166 },
167 navIconSource: {
168 type: 'string',
169 default: 'library'
170 },
171 navPrevIcon: {
172 type: 'string',
173 default: 'arrowLeft'
174 },
175 navNextIcon: {
176 type: 'string',
177 default: 'arrowRight'
178 },
179 customPrevSVG: {
180 type: 'string'
181 },
182 customNextSVG: {
183 type: 'string'
184 },
185 // pagination style
186 pagColor: {
187 type: 'string'
188 },
189 activePagColor: {
190 type: 'string'
191 },
192 // fraction pagination
193 pagFracColor: {
194 type: 'string'
195 },
196 pagFracCurrentColor: {
197 type: 'string'
198 },
199 fracDividerColor: {
200 type: 'string'
201 },
202 progressColor: {
203 type: 'string'
204 },
205 activeProgressColor: {
206 type: 'string'
207 },
208 // generators
209 ...generateResRangeAttributes({
210 controlName: COLUMNS
211 }),
212 ...generateResRangeAttributes({
213 controlName: COLUMNS_GAP
214 }),
215 ...generateResRangeAttributes({
216 controlName: SLIDE_HEIGHT
217 }),
218 ...generateResBoxControlAttributes({
219 controlName: SLIDE_PADDING
220 }),
221 ...generateResBoxControlAttributes({
222 controlName: SLIDE_MARGIN
223 }),
224 // content
225 ...generateResRangeAttributes({
226 controlName: CONTENT_WIDTH
227 }),
228 ...generateAlignmentAttributes({
229 controlName: CONTENT_HPOSITION
230 }),
231 ...generateAlignmentAttributes({
232 controlName: CONTENT_VPOSITION
233 }),
234 ...generateAlignmentAttributes({
235 controlName: CONTENT_ALIGN
236 }),
237 ...generateResBoxControlAttributes({
238 controlName: CONTENT_PADDING
239 }),
240 ...generateResBtnsAttributes({
241 controlName: CONTENT_HALIGN
242 }),
243 // Navigation Style
244 ...generateBorderAttributes({
245 controlName: NAV_BORDER
246 }),
247 ...generateResBoxControlAttributes({
248 controlName: NAV_BRADIUS
249 }),
250 ...generateResRangeAttributes({
251 controlName: NAV_WIDTH
252 }),
253 ...generateResRangeAttributes({
254 controlName: NAV_HEIGHT
255 }),
256 ...generateResRangeAttributes({
257 controlName: NAV_ICON_SIZE
258 }),
259 ...generateResBoxControlAttributes({
260 controlName: NAV_MARGIN
261 }),
262 ...generateResRangeAttributes({
263 controlName: NAV_GAP
264 }),
265 // Pagination Style
266 ...generateBorderAttributes({
267 controlName: PAG_BORDER
268 }),
269 ...generateResBoxControlAttributes({
270 controlName: PAG_BRADIUS
271 }),
272 ...generateResRangeAttributes({
273 controlName: PAG_WIDTH
274 }),
275 ...generateResRangeAttributes({
276 controlName: PAG_HEIGHT
277 }),
278 ...generateResBoxControlAttributes({
279 controlName: PAG_MARGIN
280 }),
281 // Active Pagination Style
282 ...generateBorderAttributes({
283 controlName: APAG_BORDER
284 }),
285 ...generateResBoxControlAttributes({
286 controlName: APAG_BRADIUS
287 }),
288 ...generateResRangeAttributes({
289 controlName: APAG_WIDTH
290 }),
291 ...generateResRangeAttributes({
292 controlName: APAG_HEIGHT
293 }),
294 // Fraction pagination
295 ...generateResRangeAttributes({
296 controlName: FRAC_SIZE
297 }),
298 // Progress pagination
299 ...generateResRangeAttributes({
300 controlName: PROG_SIZE
301 })
302 };
303
304 export default attributes;
305