@plasmicpkgs/react-slick 0.0.189 → 0.0.191
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/dist/index.d.ts +2 -10
- package/dist/react-slick.cjs.development.js +511 -513
- package/dist/react-slick.cjs.development.js.map +1 -1
- package/dist/react-slick.cjs.production.min.js +1 -1
- package/dist/react-slick.cjs.production.min.js.map +1 -1
- package/dist/react-slick.esm.js +513 -513
- package/dist/react-slick.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/react-slick.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import registerComponent from '@plasmicapp/host/registerComponent';
|
|
2
2
|
import { Button } from 'antd';
|
|
3
|
-
import React, {
|
|
3
|
+
import React, { forwardRef, useRef, useEffect, useState } from 'react';
|
|
4
4
|
import Slider from 'react-slick';
|
|
5
5
|
|
|
6
6
|
function _extends() {
|
|
@@ -31,102 +31,6 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
var _excluded = ["editingSlide", "initialSlide", "arrowColor", "className", "sliderScopeClassName"];
|
|
34
|
-
function getSlideInfo(_ref) {
|
|
35
|
-
var _ref$rows = _ref.rows,
|
|
36
|
-
rows = _ref$rows === void 0 ? 1 : _ref$rows,
|
|
37
|
-
_ref$slidesPerRow = _ref.slidesPerRow,
|
|
38
|
-
slidesPerRow = _ref$slidesPerRow === void 0 ? 1 : _ref$slidesPerRow,
|
|
39
|
-
_ref$editingSlide = _ref.editingSlide,
|
|
40
|
-
editingSlide = _ref$editingSlide === void 0 ? 0 : _ref$editingSlide,
|
|
41
|
-
children = _ref.children;
|
|
42
|
-
var slidesCnt = Array.isArray(children) ? children.length : 1;
|
|
43
|
-
var slidesPerDot = rows * slidesPerRow;
|
|
44
|
-
var dotCount = Math.ceil(slidesCnt / slidesPerDot);
|
|
45
|
-
var currentDotIndex = editingSlide >= dotCount ? dotCount - 1 : editingSlide;
|
|
46
|
-
return {
|
|
47
|
-
currentDotIndex: currentDotIndex,
|
|
48
|
-
slidesPerDot: slidesPerDot,
|
|
49
|
-
dotCount: dotCount,
|
|
50
|
-
totalSlides: slidesCnt
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function CurrentSlideDropdown(_ref2) {
|
|
54
|
-
var componentProps = _ref2.componentProps,
|
|
55
|
-
studioOps = _ref2.studioOps;
|
|
56
|
-
var _getSlideInfo = getSlideInfo(componentProps),
|
|
57
|
-
dotCount = _getSlideInfo.dotCount,
|
|
58
|
-
currentDotIndex = _getSlideInfo.currentDotIndex;
|
|
59
|
-
var options = Array.from({
|
|
60
|
-
length: dotCount
|
|
61
|
-
}, function (_, i) {
|
|
62
|
-
return i;
|
|
63
|
-
}).map(function (i) {
|
|
64
|
-
return React.createElement("option", {
|
|
65
|
-
key: i,
|
|
66
|
-
value: i.toString()
|
|
67
|
-
}, "Slide ", i);
|
|
68
|
-
});
|
|
69
|
-
var handleChange = function handleChange(e) {
|
|
70
|
-
studioOps.updateProps({
|
|
71
|
-
editingSlide: Number(e.target.value)
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
return React.createElement("div", {
|
|
75
|
-
style: {
|
|
76
|
-
width: "100%",
|
|
77
|
-
display: "flex",
|
|
78
|
-
flexDirection: "row",
|
|
79
|
-
gap: "10px",
|
|
80
|
-
justifyContent: "space-between"
|
|
81
|
-
}
|
|
82
|
-
}, React.createElement("div", null, "Current slide:"), React.createElement("select", {
|
|
83
|
-
defaultValue: currentDotIndex.toString(),
|
|
84
|
-
style: {
|
|
85
|
-
width: "100%"
|
|
86
|
-
},
|
|
87
|
-
onChange: handleChange,
|
|
88
|
-
value: currentDotIndex.toString()
|
|
89
|
-
}, options));
|
|
90
|
-
}
|
|
91
|
-
function NavigateSlides(_ref3) {
|
|
92
|
-
var componentProps = _ref3.componentProps,
|
|
93
|
-
studioOps = _ref3.studioOps;
|
|
94
|
-
var _getSlideInfo2 = getSlideInfo(componentProps),
|
|
95
|
-
dotCount = _getSlideInfo2.dotCount,
|
|
96
|
-
currentDotIndex = _getSlideInfo2.currentDotIndex;
|
|
97
|
-
return React.createElement("div", {
|
|
98
|
-
style: {
|
|
99
|
-
width: "100%",
|
|
100
|
-
display: "flex",
|
|
101
|
-
flexDirection: "row",
|
|
102
|
-
gap: "10px",
|
|
103
|
-
justifyContent: "space-between"
|
|
104
|
-
}
|
|
105
|
-
}, React.createElement(Button, {
|
|
106
|
-
style: {
|
|
107
|
-
width: "100%"
|
|
108
|
-
},
|
|
109
|
-
onClick: function onClick() {
|
|
110
|
-
var prevSlide = currentDotIndex === 0 ? dotCount - 1 : (currentDotIndex - 1) % dotCount;
|
|
111
|
-
studioOps.updateProps({
|
|
112
|
-
editingSlide: prevSlide
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
}, "Prev slide"), React.createElement(Button, {
|
|
116
|
-
style: {
|
|
117
|
-
width: "100%"
|
|
118
|
-
},
|
|
119
|
-
onClick: function onClick() {
|
|
120
|
-
var nextSlide = (currentDotIndex + 1) % dotCount;
|
|
121
|
-
studioOps.updateProps({
|
|
122
|
-
editingSlide: nextSlide
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}, "Next slide"));
|
|
126
|
-
}
|
|
127
|
-
function OutlineMessage() {
|
|
128
|
-
return React.createElement("div", null, "* To re-arrange slides, use the Outline panel");
|
|
129
|
-
}
|
|
130
34
|
var sliderHelpers = {
|
|
131
35
|
states: {
|
|
132
36
|
currentSlide: {
|
|
@@ -136,417 +40,6 @@ var sliderHelpers = {
|
|
|
136
40
|
}
|
|
137
41
|
}
|
|
138
42
|
};
|
|
139
|
-
var sliderMeta = {
|
|
140
|
-
name: "hostless-slider",
|
|
141
|
-
displayName: "Slider Carousel",
|
|
142
|
-
importName: "SliderWrapper",
|
|
143
|
-
importPath: "@plasmicpkgs/react-slick",
|
|
144
|
-
description: "[See tutorial video](https://www.youtube.com/watch?v=GMgXLbNHX8c)",
|
|
145
|
-
actions: [{
|
|
146
|
-
type: "custom-action",
|
|
147
|
-
control: CurrentSlideDropdown
|
|
148
|
-
}, {
|
|
149
|
-
type: "custom-action",
|
|
150
|
-
control: NavigateSlides
|
|
151
|
-
}, {
|
|
152
|
-
type: "button-action",
|
|
153
|
-
label: "Append new slide",
|
|
154
|
-
onClick: function onClick(_ref4) {
|
|
155
|
-
var componentProps = _ref4.componentProps,
|
|
156
|
-
studioOps = _ref4.studioOps;
|
|
157
|
-
var _getSlideInfo3 = getSlideInfo(componentProps),
|
|
158
|
-
dotCount = _getSlideInfo3.dotCount,
|
|
159
|
-
slidesPerDot = _getSlideInfo3.slidesPerDot,
|
|
160
|
-
totalSlides = _getSlideInfo3.totalSlides;
|
|
161
|
-
var editingSlide = totalSlides % slidesPerDot ? dotCount - 1 : dotCount;
|
|
162
|
-
studioOps.appendToSlot({
|
|
163
|
-
type: "img",
|
|
164
|
-
src: "",
|
|
165
|
-
styles: {
|
|
166
|
-
maxWidth: "100%"
|
|
167
|
-
}
|
|
168
|
-
}, "children");
|
|
169
|
-
studioOps.updateProps({
|
|
170
|
-
editingSlide: editingSlide
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
}, {
|
|
174
|
-
type: "button-action",
|
|
175
|
-
label: "Delete current slide",
|
|
176
|
-
hidden: function hidden(ps) {
|
|
177
|
-
var _ps$children;
|
|
178
|
-
return ((_ps$children = ps.children) == null || (_ps$children = _ps$children.type) == null ? void 0 : _ps$children.name) === "CanvasSlotPlaceholder";
|
|
179
|
-
},
|
|
180
|
-
onClick: function onClick(_ref5) {
|
|
181
|
-
var componentProps = _ref5.componentProps,
|
|
182
|
-
studioOps = _ref5.studioOps;
|
|
183
|
-
var _getSlideInfo4 = getSlideInfo(componentProps),
|
|
184
|
-
currentDotIndex = _getSlideInfo4.currentDotIndex,
|
|
185
|
-
dotCount = _getSlideInfo4.dotCount,
|
|
186
|
-
slidesPerDot = _getSlideInfo4.slidesPerDot,
|
|
187
|
-
totalSlides = _getSlideInfo4.totalSlides;
|
|
188
|
-
studioOps.removeFromSlotAt(currentDotIndex * slidesPerDot, "children");
|
|
189
|
-
var newPos = currentDotIndex;
|
|
190
|
-
if (dotCount === 1) {
|
|
191
|
-
// not the only dot
|
|
192
|
-
newPos = 0;
|
|
193
|
-
} else if (currentDotIndex !== dotCount - 1) {
|
|
194
|
-
// not the last dot
|
|
195
|
-
if (slidesPerDot === 1) {
|
|
196
|
-
newPos = currentDotIndex - 1;
|
|
197
|
-
} else {
|
|
198
|
-
newPos = currentDotIndex;
|
|
199
|
-
}
|
|
200
|
-
} else {
|
|
201
|
-
// the last dot
|
|
202
|
-
newPos = totalSlides % slidesPerDot === 1 ? currentDotIndex - 1 : currentDotIndex;
|
|
203
|
-
}
|
|
204
|
-
studioOps.updateProps({
|
|
205
|
-
editingSlide: newPos
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
}, {
|
|
209
|
-
type: "custom-action",
|
|
210
|
-
control: OutlineMessage
|
|
211
|
-
}],
|
|
212
|
-
refActions: {
|
|
213
|
-
slickGoTo: {
|
|
214
|
-
displayName: "Jump to slide",
|
|
215
|
-
argTypes: [{
|
|
216
|
-
name: "index",
|
|
217
|
-
displayName: "Slide index",
|
|
218
|
-
type: "number"
|
|
219
|
-
}, {
|
|
220
|
-
name: "dontAnimate",
|
|
221
|
-
displayName: "Animate?",
|
|
222
|
-
type: "boolean"
|
|
223
|
-
}]
|
|
224
|
-
},
|
|
225
|
-
slickNext: {
|
|
226
|
-
displayName: "Go to Next slide",
|
|
227
|
-
argTypes: []
|
|
228
|
-
},
|
|
229
|
-
slickPause: {
|
|
230
|
-
displayName: "Pause",
|
|
231
|
-
argTypes: []
|
|
232
|
-
},
|
|
233
|
-
slickPlay: {
|
|
234
|
-
displayName: "Play",
|
|
235
|
-
argTypes: []
|
|
236
|
-
},
|
|
237
|
-
slickPrev: {
|
|
238
|
-
displayName: "Go to Previous slide",
|
|
239
|
-
argTypes: []
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
|
-
props: {
|
|
243
|
-
children: {
|
|
244
|
-
type: "slot",
|
|
245
|
-
defaultValue: /*#__PURE__*/[0, 1, 2].map(function (i) {
|
|
246
|
-
return {
|
|
247
|
-
type: "vbox",
|
|
248
|
-
children: {
|
|
249
|
-
type: "img",
|
|
250
|
-
src: "https://static1.plasmic.app/components/react-slick/slide" + (i + 1) + ".png",
|
|
251
|
-
styles: {
|
|
252
|
-
maxWidth: "100%"
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
})
|
|
257
|
-
},
|
|
258
|
-
editingSlide: {
|
|
259
|
-
displayName: "Currently edited slide",
|
|
260
|
-
type: "number",
|
|
261
|
-
description: "Switch to the specified slide (first is 0). Only affects the editor, not the final page.",
|
|
262
|
-
defaultValueHint: 0,
|
|
263
|
-
defaultValue: 0,
|
|
264
|
-
editOnly: true,
|
|
265
|
-
hidden: function hidden() {
|
|
266
|
-
return true;
|
|
267
|
-
}
|
|
268
|
-
},
|
|
269
|
-
accessibility: {
|
|
270
|
-
advanced: true,
|
|
271
|
-
displayName: "Accessibility",
|
|
272
|
-
type: "boolean",
|
|
273
|
-
description: "Enables tabbing and arrow key navigation",
|
|
274
|
-
defaultValueHint: true
|
|
275
|
-
},
|
|
276
|
-
adaptiveHeight: {
|
|
277
|
-
advanced: true,
|
|
278
|
-
displayName: "Adaptive Height",
|
|
279
|
-
type: "boolean",
|
|
280
|
-
description: "Adjust the slide's height automatically",
|
|
281
|
-
defaultValueHint: false
|
|
282
|
-
},
|
|
283
|
-
arrows: {
|
|
284
|
-
displayName: "Arrows",
|
|
285
|
-
type: "boolean",
|
|
286
|
-
description: "Show next/prev arrows",
|
|
287
|
-
defaultValueHint: true
|
|
288
|
-
},
|
|
289
|
-
sliderScopeClassName: {
|
|
290
|
-
type: "styleScopeClass",
|
|
291
|
-
scopeName: "slider"
|
|
292
|
-
},
|
|
293
|
-
arrowColor: {
|
|
294
|
-
type: "color",
|
|
295
|
-
description: "Color of next/prev arrow buttons",
|
|
296
|
-
defaultValueHint: "#000000",
|
|
297
|
-
hidden: function hidden(ps) {
|
|
298
|
-
return ps.arrows === undefined ? false : !ps.arrows;
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
|
-
autoplay: {
|
|
302
|
-
displayName: "Auto Play",
|
|
303
|
-
type: "boolean",
|
|
304
|
-
description: "Automatically start scrolling",
|
|
305
|
-
defaultValueHint: false
|
|
306
|
-
},
|
|
307
|
-
autoplaySpeed: {
|
|
308
|
-
displayName: "Auto Play Speed",
|
|
309
|
-
type: "number",
|
|
310
|
-
description: "Delay between each auto scroll, in milliseconds",
|
|
311
|
-
defaultValueHint: 3000,
|
|
312
|
-
hidden: function hidden(props) {
|
|
313
|
-
return !props.autoplay;
|
|
314
|
-
}
|
|
315
|
-
},
|
|
316
|
-
centerMode: {
|
|
317
|
-
displayName: "Center Mode",
|
|
318
|
-
type: "boolean",
|
|
319
|
-
description: "Enables centered view with partial prev/next slides. Use with odd numbered slidesToShow counts",
|
|
320
|
-
defaultValueHint: false
|
|
321
|
-
},
|
|
322
|
-
centerPadding: {
|
|
323
|
-
displayName: "Center Padding",
|
|
324
|
-
type: "string",
|
|
325
|
-
description: "Side padding when in center mode (px or %)",
|
|
326
|
-
defaultValueHint: "50px",
|
|
327
|
-
hidden: function hidden(props) {
|
|
328
|
-
return !props.centerMode;
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
dots: {
|
|
332
|
-
displayName: "Dots",
|
|
333
|
-
type: "boolean",
|
|
334
|
-
description: "Show dots for each slide",
|
|
335
|
-
defaultValueHint: false
|
|
336
|
-
},
|
|
337
|
-
draggable: {
|
|
338
|
-
advanced: true,
|
|
339
|
-
displayName: "Draggable",
|
|
340
|
-
type: "boolean",
|
|
341
|
-
description: "Enables mouse dragging on desktop",
|
|
342
|
-
defaultValueHint: true
|
|
343
|
-
},
|
|
344
|
-
cssEase: {
|
|
345
|
-
advanced: true,
|
|
346
|
-
displayName: "Easing",
|
|
347
|
-
type: "string",
|
|
348
|
-
description: "Easing method for transition",
|
|
349
|
-
defaultValueHint: "linear"
|
|
350
|
-
},
|
|
351
|
-
/** Deprecated, this was apparently never working:
|
|
352
|
-
* https://github.com/akiran/react-slick/issues/363 */
|
|
353
|
-
easing: {
|
|
354
|
-
hidden: function hidden() {
|
|
355
|
-
return true;
|
|
356
|
-
},
|
|
357
|
-
advanced: true,
|
|
358
|
-
displayName: "Easing",
|
|
359
|
-
type: "string",
|
|
360
|
-
description: "Easing method for transition",
|
|
361
|
-
defaultValueHint: "linear"
|
|
362
|
-
},
|
|
363
|
-
fade: {
|
|
364
|
-
advanced: true,
|
|
365
|
-
displayName: "Fade",
|
|
366
|
-
type: "boolean",
|
|
367
|
-
description: "Cross-fade between slides",
|
|
368
|
-
defaultValueHint: false
|
|
369
|
-
},
|
|
370
|
-
focusOnSelect: {
|
|
371
|
-
advanced: true,
|
|
372
|
-
displayName: "Focus On Select",
|
|
373
|
-
type: "boolean",
|
|
374
|
-
description: "Go to slide on click",
|
|
375
|
-
defaultValueHint: false
|
|
376
|
-
},
|
|
377
|
-
infinite: {
|
|
378
|
-
displayName: "Infinite",
|
|
379
|
-
type: "boolean",
|
|
380
|
-
description: "Infinitely wrap around contents",
|
|
381
|
-
defaultValueHint: true
|
|
382
|
-
},
|
|
383
|
-
initialSlide: {
|
|
384
|
-
displayName: "Initial Slide",
|
|
385
|
-
type: "number",
|
|
386
|
-
description: "Index of the first visible slide (first is 0), accounting for multiple slides per view if applicable.",
|
|
387
|
-
defaultValueHint: 0,
|
|
388
|
-
defaultValue: 0
|
|
389
|
-
},
|
|
390
|
-
lazyLoad: {
|
|
391
|
-
advanced: true,
|
|
392
|
-
displayName: "Lazy Load",
|
|
393
|
-
type: "choice",
|
|
394
|
-
options: ["ondemand", "progressive"],
|
|
395
|
-
description: "Load images or render components on demand or progressively"
|
|
396
|
-
},
|
|
397
|
-
pauseOnDotsHover: {
|
|
398
|
-
displayName: "Pause On Dots Hover",
|
|
399
|
-
type: "boolean",
|
|
400
|
-
description: "Prevents autoplay while hovering on dots",
|
|
401
|
-
defaultValueHint: false
|
|
402
|
-
},
|
|
403
|
-
pauseOnFocus: {
|
|
404
|
-
displayName: "Pause On Focus",
|
|
405
|
-
type: "boolean",
|
|
406
|
-
description: "Prevents autoplay while focused on slides",
|
|
407
|
-
defaultValueHint: false
|
|
408
|
-
},
|
|
409
|
-
pauseOnHover: {
|
|
410
|
-
displayName: "Pause On Hover",
|
|
411
|
-
type: "boolean",
|
|
412
|
-
description: "Prevents autoplay while hovering on track",
|
|
413
|
-
defaultValueHint: true
|
|
414
|
-
},
|
|
415
|
-
rows: {
|
|
416
|
-
displayName: "Rows",
|
|
417
|
-
type: "number",
|
|
418
|
-
description: "Number of rows per slide (enables grid mode)",
|
|
419
|
-
defaultValueHint: 1
|
|
420
|
-
},
|
|
421
|
-
rtl: {
|
|
422
|
-
advanced: true,
|
|
423
|
-
displayName: "Reverse",
|
|
424
|
-
type: "boolean",
|
|
425
|
-
description: "Reverses the slide order",
|
|
426
|
-
defaultValueHint: false
|
|
427
|
-
},
|
|
428
|
-
// Looks like the `slide` prop is not being used to set the container tag:
|
|
429
|
-
// https://github.com/akiran/react-slick/issues/1318
|
|
430
|
-
// https://github.com/akiran/react-slick/pull/1885
|
|
431
|
-
// https://stackoverflow.com/questions/51492535/wrap-react-slick-li-slides-inside-ul
|
|
432
|
-
//
|
|
433
|
-
// slide: {
|
|
434
|
-
// displayName: "Slide Tag",
|
|
435
|
-
// type: "string",
|
|
436
|
-
// description: 'Slide container element type',
|
|
437
|
-
// defaultValueHint: "div",
|
|
438
|
-
// },
|
|
439
|
-
slidesPerRow: {
|
|
440
|
-
displayName: "Slides Per Row",
|
|
441
|
-
type: "number",
|
|
442
|
-
description: "Number of slides to display in grid mode, this is useful with rows option",
|
|
443
|
-
defaultValueHint: 1
|
|
444
|
-
},
|
|
445
|
-
slidesToScroll: {
|
|
446
|
-
advanced: true,
|
|
447
|
-
displayName: "Slides To Scroll",
|
|
448
|
-
type: "number",
|
|
449
|
-
description: "Number of slides to scroll at once",
|
|
450
|
-
defaultValueHint: 1
|
|
451
|
-
},
|
|
452
|
-
slidesToShow: {
|
|
453
|
-
advanced: true,
|
|
454
|
-
displayName: "Slides To Show",
|
|
455
|
-
type: "number",
|
|
456
|
-
description: "Number of slides to show in one frame",
|
|
457
|
-
defaultValueHint: 1
|
|
458
|
-
},
|
|
459
|
-
speed: {
|
|
460
|
-
advanced: true,
|
|
461
|
-
displayName: "Speed",
|
|
462
|
-
type: "number",
|
|
463
|
-
description: "Transition speed in milliseconds",
|
|
464
|
-
defaultValueHint: 500
|
|
465
|
-
},
|
|
466
|
-
swipe: {
|
|
467
|
-
advanced: true,
|
|
468
|
-
displayName: "Swipe",
|
|
469
|
-
type: "boolean",
|
|
470
|
-
description: "Enable swiping to change slides",
|
|
471
|
-
defaultValueHint: true
|
|
472
|
-
},
|
|
473
|
-
swipeToSlide: {
|
|
474
|
-
advanced: true,
|
|
475
|
-
displayName: "Swipe To Slide",
|
|
476
|
-
type: "boolean",
|
|
477
|
-
description: "Enable drag/swipe irrespective of 'slidesToScroll'",
|
|
478
|
-
defaultValueHint: false
|
|
479
|
-
},
|
|
480
|
-
touchMove: {
|
|
481
|
-
advanced: true,
|
|
482
|
-
displayName: "Touch Move",
|
|
483
|
-
type: "boolean",
|
|
484
|
-
description: "Enable slide moving on touch",
|
|
485
|
-
defaultValueHint: true
|
|
486
|
-
},
|
|
487
|
-
touchThreshold: {
|
|
488
|
-
advanced: true,
|
|
489
|
-
displayName: "Touch Threshold",
|
|
490
|
-
type: "number",
|
|
491
|
-
description: "Swipe distance threshold in pixels",
|
|
492
|
-
defaultValueHint: 5
|
|
493
|
-
},
|
|
494
|
-
useCSS: {
|
|
495
|
-
advanced: true,
|
|
496
|
-
displayName: "Use CSS",
|
|
497
|
-
type: "boolean",
|
|
498
|
-
description: "Enable/Disable CSS Transitions",
|
|
499
|
-
defaultValueHint: true
|
|
500
|
-
},
|
|
501
|
-
useTransform: {
|
|
502
|
-
advanced: true,
|
|
503
|
-
displayName: "Use Transform",
|
|
504
|
-
type: "boolean",
|
|
505
|
-
description: "Enable/Disable CSS Transforms",
|
|
506
|
-
defaultValueHint: true
|
|
507
|
-
},
|
|
508
|
-
variableWidth: {
|
|
509
|
-
advanced: true,
|
|
510
|
-
displayName: "Variable Width",
|
|
511
|
-
type: "boolean",
|
|
512
|
-
description: "Variable width slides",
|
|
513
|
-
defaultValueHint: false
|
|
514
|
-
},
|
|
515
|
-
vertical: {
|
|
516
|
-
advanced: true,
|
|
517
|
-
displayName: "Vertical",
|
|
518
|
-
type: "boolean",
|
|
519
|
-
description: "Vertical slide mode",
|
|
520
|
-
defaultValueHint: false
|
|
521
|
-
},
|
|
522
|
-
beforeChange: {
|
|
523
|
-
type: "eventHandler",
|
|
524
|
-
advanced: true,
|
|
525
|
-
argTypes: [{
|
|
526
|
-
name: "currentSlide",
|
|
527
|
-
type: "number"
|
|
528
|
-
}]
|
|
529
|
-
}
|
|
530
|
-
},
|
|
531
|
-
states: {
|
|
532
|
-
currentSlide: /*#__PURE__*/_extends({
|
|
533
|
-
type: "writable",
|
|
534
|
-
valueProp: "editingSlide",
|
|
535
|
-
onChangeProp: "beforeChange",
|
|
536
|
-
variableType: "number"
|
|
537
|
-
}, sliderHelpers.states.currentSlide)
|
|
538
|
-
},
|
|
539
|
-
componentHelpers: {
|
|
540
|
-
helpers: sliderHelpers,
|
|
541
|
-
importName: "sliderHelpers",
|
|
542
|
-
importPath: "@plasmicpkgs/react-slick"
|
|
543
|
-
},
|
|
544
|
-
defaultStyles: {
|
|
545
|
-
width: "stretch",
|
|
546
|
-
maxWidth: "100%",
|
|
547
|
-
flexDirection: "column"
|
|
548
|
-
}
|
|
549
|
-
};
|
|
550
43
|
function useDebounce(value, delay) {
|
|
551
44
|
var _useState = useState(value),
|
|
552
45
|
debouncedValue = _useState[0],
|
|
@@ -618,7 +111,7 @@ var SliderWrapper = /*#__PURE__*/forwardRef(function SliderWrapper_(props, userR
|
|
|
618
111
|
}
|
|
619
112
|
};
|
|
620
113
|
}, []);
|
|
621
|
-
var css = "\n
|
|
114
|
+
var css = "\n ." + sliderScopeClassName + " .slick-arrow:before {\n color: " + (arrowColor != null ? arrowColor : "black") + ";\n }\n ." + sliderScopeClassName + " .slick-slide img:only-child {\n " + "\n " + "\n display: inline-block;\n vertical-align: top;\n }\n ";
|
|
622
115
|
return React.createElement(React.Fragment, null, React.createElement(Slider, Object.assign({
|
|
623
116
|
className: className + " " + sliderScopeClassName,
|
|
624
117
|
ref: slider
|
|
@@ -628,13 +121,520 @@ var SliderWrapper = /*#__PURE__*/forwardRef(function SliderWrapper_(props, userR
|
|
|
628
121
|
}
|
|
629
122
|
}));
|
|
630
123
|
});
|
|
631
|
-
function registerSlider(loader
|
|
124
|
+
function registerSlider(loader) {
|
|
125
|
+
function getSlideInfo(_ref) {
|
|
126
|
+
var _ref$rows = _ref.rows,
|
|
127
|
+
rows = _ref$rows === void 0 ? 1 : _ref$rows,
|
|
128
|
+
_ref$slidesPerRow = _ref.slidesPerRow,
|
|
129
|
+
slidesPerRow = _ref$slidesPerRow === void 0 ? 1 : _ref$slidesPerRow,
|
|
130
|
+
_ref$editingSlide = _ref.editingSlide,
|
|
131
|
+
editingSlide = _ref$editingSlide === void 0 ? 0 : _ref$editingSlide,
|
|
132
|
+
children = _ref.children;
|
|
133
|
+
var slidesCnt = Array.isArray(children) ? children.length : 1;
|
|
134
|
+
var slidesPerDot = rows * slidesPerRow;
|
|
135
|
+
var dotCount = Math.ceil(slidesCnt / slidesPerDot);
|
|
136
|
+
var currentDotIndex = editingSlide >= dotCount ? dotCount - 1 : editingSlide;
|
|
137
|
+
return {
|
|
138
|
+
currentDotIndex: currentDotIndex,
|
|
139
|
+
slidesPerDot: slidesPerDot,
|
|
140
|
+
dotCount: dotCount,
|
|
141
|
+
totalSlides: slidesCnt
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function CurrentSlideDropdown(_ref2) {
|
|
145
|
+
var componentProps = _ref2.componentProps,
|
|
146
|
+
studioOps = _ref2.studioOps;
|
|
147
|
+
var _getSlideInfo = getSlideInfo(componentProps),
|
|
148
|
+
dotCount = _getSlideInfo.dotCount,
|
|
149
|
+
currentDotIndex = _getSlideInfo.currentDotIndex;
|
|
150
|
+
var options = Array.from({
|
|
151
|
+
length: dotCount
|
|
152
|
+
}, function (_, i) {
|
|
153
|
+
return i;
|
|
154
|
+
}).map(function (i) {
|
|
155
|
+
return React.createElement("option", {
|
|
156
|
+
key: i,
|
|
157
|
+
value: i.toString()
|
|
158
|
+
}, "Slide ", i);
|
|
159
|
+
});
|
|
160
|
+
var handleChange = function handleChange(e) {
|
|
161
|
+
studioOps.updateProps({
|
|
162
|
+
editingSlide: Number(e.target.value)
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
return React.createElement("div", {
|
|
166
|
+
style: {
|
|
167
|
+
width: "100%",
|
|
168
|
+
display: "flex",
|
|
169
|
+
flexDirection: "row",
|
|
170
|
+
gap: "10px",
|
|
171
|
+
justifyContent: "space-between"
|
|
172
|
+
}
|
|
173
|
+
}, React.createElement("div", null, "Current slide:"), React.createElement("select", {
|
|
174
|
+
defaultValue: currentDotIndex.toString(),
|
|
175
|
+
style: {
|
|
176
|
+
width: "100%"
|
|
177
|
+
},
|
|
178
|
+
onChange: handleChange,
|
|
179
|
+
value: currentDotIndex.toString()
|
|
180
|
+
}, options));
|
|
181
|
+
}
|
|
182
|
+
function NavigateSlides(_ref3) {
|
|
183
|
+
var componentProps = _ref3.componentProps,
|
|
184
|
+
studioOps = _ref3.studioOps;
|
|
185
|
+
var _getSlideInfo2 = getSlideInfo(componentProps),
|
|
186
|
+
dotCount = _getSlideInfo2.dotCount,
|
|
187
|
+
currentDotIndex = _getSlideInfo2.currentDotIndex;
|
|
188
|
+
return React.createElement("div", {
|
|
189
|
+
style: {
|
|
190
|
+
width: "100%",
|
|
191
|
+
display: "flex",
|
|
192
|
+
flexDirection: "row",
|
|
193
|
+
gap: "10px",
|
|
194
|
+
justifyContent: "space-between"
|
|
195
|
+
}
|
|
196
|
+
}, React.createElement(Button, {
|
|
197
|
+
style: {
|
|
198
|
+
width: "100%"
|
|
199
|
+
},
|
|
200
|
+
onClick: function onClick() {
|
|
201
|
+
var prevSlide = currentDotIndex === 0 ? dotCount - 1 : (currentDotIndex - 1) % dotCount;
|
|
202
|
+
studioOps.updateProps({
|
|
203
|
+
editingSlide: prevSlide
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
}, "Prev slide"), React.createElement(Button, {
|
|
207
|
+
style: {
|
|
208
|
+
width: "100%"
|
|
209
|
+
},
|
|
210
|
+
onClick: function onClick() {
|
|
211
|
+
var nextSlide = (currentDotIndex + 1) % dotCount;
|
|
212
|
+
studioOps.updateProps({
|
|
213
|
+
editingSlide: nextSlide
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}, "Next slide"));
|
|
217
|
+
}
|
|
218
|
+
function OutlineMessage() {
|
|
219
|
+
return React.createElement("div", null, "* To re-arrange slides, use the Outline panel");
|
|
220
|
+
}
|
|
221
|
+
var sliderMeta = {
|
|
222
|
+
name: "hostless-slider",
|
|
223
|
+
displayName: "Slider Carousel",
|
|
224
|
+
importName: "SliderWrapper",
|
|
225
|
+
importPath: "@plasmicpkgs/react-slick",
|
|
226
|
+
description: "[See tutorial video](https://www.youtube.com/watch?v=GMgXLbNHX8c)",
|
|
227
|
+
actions: [{
|
|
228
|
+
type: "custom-action",
|
|
229
|
+
control: CurrentSlideDropdown
|
|
230
|
+
}, {
|
|
231
|
+
type: "custom-action",
|
|
232
|
+
control: NavigateSlides
|
|
233
|
+
}, {
|
|
234
|
+
type: "button-action",
|
|
235
|
+
label: "Append new slide",
|
|
236
|
+
onClick: function onClick(_ref4) {
|
|
237
|
+
var componentProps = _ref4.componentProps,
|
|
238
|
+
studioOps = _ref4.studioOps;
|
|
239
|
+
var _getSlideInfo3 = getSlideInfo(componentProps),
|
|
240
|
+
dotCount = _getSlideInfo3.dotCount,
|
|
241
|
+
slidesPerDot = _getSlideInfo3.slidesPerDot,
|
|
242
|
+
totalSlides = _getSlideInfo3.totalSlides;
|
|
243
|
+
var editingSlide = totalSlides % slidesPerDot ? dotCount - 1 : dotCount;
|
|
244
|
+
studioOps.appendToSlot({
|
|
245
|
+
type: "img",
|
|
246
|
+
src: "",
|
|
247
|
+
styles: {
|
|
248
|
+
maxWidth: "100%"
|
|
249
|
+
}
|
|
250
|
+
}, "children");
|
|
251
|
+
studioOps.updateProps({
|
|
252
|
+
editingSlide: editingSlide
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}, {
|
|
256
|
+
type: "button-action",
|
|
257
|
+
label: "Delete current slide",
|
|
258
|
+
hidden: function hidden(ps) {
|
|
259
|
+
var _ps$children;
|
|
260
|
+
return ((_ps$children = ps.children) == null || (_ps$children = _ps$children.type) == null ? void 0 : _ps$children.name) === "CanvasSlotPlaceholder";
|
|
261
|
+
},
|
|
262
|
+
onClick: function onClick(_ref5) {
|
|
263
|
+
var componentProps = _ref5.componentProps,
|
|
264
|
+
studioOps = _ref5.studioOps;
|
|
265
|
+
var _getSlideInfo4 = getSlideInfo(componentProps),
|
|
266
|
+
currentDotIndex = _getSlideInfo4.currentDotIndex,
|
|
267
|
+
dotCount = _getSlideInfo4.dotCount,
|
|
268
|
+
slidesPerDot = _getSlideInfo4.slidesPerDot,
|
|
269
|
+
totalSlides = _getSlideInfo4.totalSlides;
|
|
270
|
+
studioOps.removeFromSlotAt(currentDotIndex * slidesPerDot, "children");
|
|
271
|
+
var newPos = currentDotIndex;
|
|
272
|
+
if (dotCount === 1) {
|
|
273
|
+
// not the only dot
|
|
274
|
+
newPos = 0;
|
|
275
|
+
} else if (currentDotIndex !== dotCount - 1) {
|
|
276
|
+
// not the last dot
|
|
277
|
+
if (slidesPerDot === 1) {
|
|
278
|
+
newPos = currentDotIndex - 1;
|
|
279
|
+
} else {
|
|
280
|
+
newPos = currentDotIndex;
|
|
281
|
+
}
|
|
282
|
+
} else {
|
|
283
|
+
// the last dot
|
|
284
|
+
newPos = totalSlides % slidesPerDot === 1 ? currentDotIndex - 1 : currentDotIndex;
|
|
285
|
+
}
|
|
286
|
+
studioOps.updateProps({
|
|
287
|
+
editingSlide: newPos
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
}, {
|
|
291
|
+
type: "custom-action",
|
|
292
|
+
control: OutlineMessage
|
|
293
|
+
}],
|
|
294
|
+
refActions: {
|
|
295
|
+
slickGoTo: {
|
|
296
|
+
displayName: "Jump to slide",
|
|
297
|
+
argTypes: [{
|
|
298
|
+
name: "index",
|
|
299
|
+
displayName: "Slide index",
|
|
300
|
+
type: "number"
|
|
301
|
+
}, {
|
|
302
|
+
name: "dontAnimate",
|
|
303
|
+
displayName: "Animate?",
|
|
304
|
+
type: "boolean"
|
|
305
|
+
}]
|
|
306
|
+
},
|
|
307
|
+
slickNext: {
|
|
308
|
+
displayName: "Go to Next slide",
|
|
309
|
+
argTypes: []
|
|
310
|
+
},
|
|
311
|
+
slickPause: {
|
|
312
|
+
displayName: "Pause",
|
|
313
|
+
argTypes: []
|
|
314
|
+
},
|
|
315
|
+
slickPlay: {
|
|
316
|
+
displayName: "Play",
|
|
317
|
+
argTypes: []
|
|
318
|
+
},
|
|
319
|
+
slickPrev: {
|
|
320
|
+
displayName: "Go to Previous slide",
|
|
321
|
+
argTypes: []
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
props: {
|
|
325
|
+
children: {
|
|
326
|
+
type: "slot",
|
|
327
|
+
defaultValue: [0, 1, 2].map(function (i) {
|
|
328
|
+
return {
|
|
329
|
+
type: "vbox",
|
|
330
|
+
children: {
|
|
331
|
+
type: "img",
|
|
332
|
+
src: "https://static1.plasmic.app/components/react-slick/slide" + (i + 1) + ".png",
|
|
333
|
+
styles: {
|
|
334
|
+
maxWidth: "100%"
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
})
|
|
339
|
+
},
|
|
340
|
+
editingSlide: {
|
|
341
|
+
displayName: "Currently edited slide",
|
|
342
|
+
type: "number",
|
|
343
|
+
description: "Switch to the specified slide (first is 0). Only affects the editor, not the final page.",
|
|
344
|
+
defaultValueHint: 0,
|
|
345
|
+
defaultValue: 0,
|
|
346
|
+
editOnly: true,
|
|
347
|
+
hidden: function hidden() {
|
|
348
|
+
return true;
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
accessibility: {
|
|
352
|
+
advanced: true,
|
|
353
|
+
displayName: "Accessibility",
|
|
354
|
+
type: "boolean",
|
|
355
|
+
description: "Enables tabbing and arrow key navigation",
|
|
356
|
+
defaultValueHint: true
|
|
357
|
+
},
|
|
358
|
+
adaptiveHeight: {
|
|
359
|
+
advanced: true,
|
|
360
|
+
displayName: "Adaptive Height",
|
|
361
|
+
type: "boolean",
|
|
362
|
+
description: "Adjust the slide's height automatically",
|
|
363
|
+
defaultValueHint: false
|
|
364
|
+
},
|
|
365
|
+
arrows: {
|
|
366
|
+
displayName: "Arrows",
|
|
367
|
+
type: "boolean",
|
|
368
|
+
description: "Show next/prev arrows",
|
|
369
|
+
defaultValueHint: true
|
|
370
|
+
},
|
|
371
|
+
sliderScopeClassName: {
|
|
372
|
+
type: "styleScopeClass",
|
|
373
|
+
scopeName: "slider"
|
|
374
|
+
},
|
|
375
|
+
arrowColor: {
|
|
376
|
+
type: "color",
|
|
377
|
+
description: "Color of next/prev arrow buttons",
|
|
378
|
+
defaultValueHint: "#000000",
|
|
379
|
+
hidden: function hidden(ps) {
|
|
380
|
+
return ps.arrows === undefined ? false : !ps.arrows;
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
autoplay: {
|
|
384
|
+
displayName: "Auto Play",
|
|
385
|
+
type: "boolean",
|
|
386
|
+
description: "Automatically start scrolling",
|
|
387
|
+
defaultValueHint: false
|
|
388
|
+
},
|
|
389
|
+
autoplaySpeed: {
|
|
390
|
+
displayName: "Auto Play Speed",
|
|
391
|
+
type: "number",
|
|
392
|
+
description: "Delay between each auto scroll, in milliseconds",
|
|
393
|
+
defaultValueHint: 3000,
|
|
394
|
+
hidden: function hidden(props) {
|
|
395
|
+
return !props.autoplay;
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
centerMode: {
|
|
399
|
+
displayName: "Center Mode",
|
|
400
|
+
type: "boolean",
|
|
401
|
+
description: "Enables centered view with partial prev/next slides. Use with odd numbered slidesToShow counts",
|
|
402
|
+
defaultValueHint: false
|
|
403
|
+
},
|
|
404
|
+
centerPadding: {
|
|
405
|
+
displayName: "Center Padding",
|
|
406
|
+
type: "string",
|
|
407
|
+
description: "Side padding when in center mode (px or %)",
|
|
408
|
+
defaultValueHint: "50px",
|
|
409
|
+
hidden: function hidden(props) {
|
|
410
|
+
return !props.centerMode;
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
dots: {
|
|
414
|
+
displayName: "Dots",
|
|
415
|
+
type: "boolean",
|
|
416
|
+
description: "Show dots for each slide",
|
|
417
|
+
defaultValueHint: false
|
|
418
|
+
},
|
|
419
|
+
draggable: {
|
|
420
|
+
advanced: true,
|
|
421
|
+
displayName: "Draggable",
|
|
422
|
+
type: "boolean",
|
|
423
|
+
description: "Enables mouse dragging on desktop",
|
|
424
|
+
defaultValueHint: true
|
|
425
|
+
},
|
|
426
|
+
cssEase: {
|
|
427
|
+
advanced: true,
|
|
428
|
+
displayName: "Easing",
|
|
429
|
+
type: "string",
|
|
430
|
+
description: "Easing method for transition",
|
|
431
|
+
defaultValueHint: "linear"
|
|
432
|
+
},
|
|
433
|
+
/** Deprecated, this was apparently never working:
|
|
434
|
+
* https://github.com/akiran/react-slick/issues/363 */
|
|
435
|
+
easing: {
|
|
436
|
+
hidden: function hidden() {
|
|
437
|
+
return true;
|
|
438
|
+
},
|
|
439
|
+
advanced: true,
|
|
440
|
+
displayName: "Easing",
|
|
441
|
+
type: "string",
|
|
442
|
+
description: "Easing method for transition",
|
|
443
|
+
defaultValueHint: "linear"
|
|
444
|
+
},
|
|
445
|
+
fade: {
|
|
446
|
+
advanced: true,
|
|
447
|
+
displayName: "Fade",
|
|
448
|
+
type: "boolean",
|
|
449
|
+
description: "Cross-fade between slides",
|
|
450
|
+
defaultValueHint: false
|
|
451
|
+
},
|
|
452
|
+
focusOnSelect: {
|
|
453
|
+
advanced: true,
|
|
454
|
+
displayName: "Focus On Select",
|
|
455
|
+
type: "boolean",
|
|
456
|
+
description: "Go to slide on click",
|
|
457
|
+
defaultValueHint: false
|
|
458
|
+
},
|
|
459
|
+
infinite: {
|
|
460
|
+
displayName: "Infinite",
|
|
461
|
+
type: "boolean",
|
|
462
|
+
description: "Infinitely wrap around contents",
|
|
463
|
+
defaultValueHint: true
|
|
464
|
+
},
|
|
465
|
+
initialSlide: {
|
|
466
|
+
displayName: "Initial Slide",
|
|
467
|
+
type: "number",
|
|
468
|
+
description: "Index of the first visible slide (first is 0), accounting for multiple slides per view if applicable.",
|
|
469
|
+
defaultValueHint: 0,
|
|
470
|
+
defaultValue: 0
|
|
471
|
+
},
|
|
472
|
+
lazyLoad: {
|
|
473
|
+
advanced: true,
|
|
474
|
+
displayName: "Lazy Load",
|
|
475
|
+
type: "choice",
|
|
476
|
+
options: ["ondemand", "progressive"],
|
|
477
|
+
description: "Load images or render components on demand or progressively"
|
|
478
|
+
},
|
|
479
|
+
pauseOnDotsHover: {
|
|
480
|
+
displayName: "Pause On Dots Hover",
|
|
481
|
+
type: "boolean",
|
|
482
|
+
description: "Prevents autoplay while hovering on dots",
|
|
483
|
+
defaultValueHint: false
|
|
484
|
+
},
|
|
485
|
+
pauseOnFocus: {
|
|
486
|
+
displayName: "Pause On Focus",
|
|
487
|
+
type: "boolean",
|
|
488
|
+
description: "Prevents autoplay while focused on slides",
|
|
489
|
+
defaultValueHint: false
|
|
490
|
+
},
|
|
491
|
+
pauseOnHover: {
|
|
492
|
+
displayName: "Pause On Hover",
|
|
493
|
+
type: "boolean",
|
|
494
|
+
description: "Prevents autoplay while hovering on track",
|
|
495
|
+
defaultValueHint: true
|
|
496
|
+
},
|
|
497
|
+
rows: {
|
|
498
|
+
displayName: "Rows",
|
|
499
|
+
type: "number",
|
|
500
|
+
description: "Number of rows per slide (enables grid mode)",
|
|
501
|
+
defaultValueHint: 1
|
|
502
|
+
},
|
|
503
|
+
rtl: {
|
|
504
|
+
advanced: true,
|
|
505
|
+
displayName: "Reverse",
|
|
506
|
+
type: "boolean",
|
|
507
|
+
description: "Reverses the slide order",
|
|
508
|
+
defaultValueHint: false
|
|
509
|
+
},
|
|
510
|
+
// Looks like the `slide` prop is not being used to set the container tag:
|
|
511
|
+
// https://github.com/akiran/react-slick/issues/1318
|
|
512
|
+
// https://github.com/akiran/react-slick/pull/1885
|
|
513
|
+
// https://stackoverflow.com/questions/51492535/wrap-react-slick-li-slides-inside-ul
|
|
514
|
+
//
|
|
515
|
+
// slide: {
|
|
516
|
+
// displayName: "Slide Tag",
|
|
517
|
+
// type: "string",
|
|
518
|
+
// description: 'Slide container element type',
|
|
519
|
+
// defaultValueHint: "div",
|
|
520
|
+
// },
|
|
521
|
+
slidesPerRow: {
|
|
522
|
+
displayName: "Slides Per Row",
|
|
523
|
+
type: "number",
|
|
524
|
+
description: "Number of slides to display in grid mode, this is useful with rows option",
|
|
525
|
+
defaultValueHint: 1
|
|
526
|
+
},
|
|
527
|
+
slidesToScroll: {
|
|
528
|
+
advanced: true,
|
|
529
|
+
displayName: "Slides To Scroll",
|
|
530
|
+
type: "number",
|
|
531
|
+
description: "Number of slides to scroll at once",
|
|
532
|
+
defaultValueHint: 1
|
|
533
|
+
},
|
|
534
|
+
slidesToShow: {
|
|
535
|
+
advanced: true,
|
|
536
|
+
displayName: "Slides To Show",
|
|
537
|
+
type: "number",
|
|
538
|
+
description: "Number of slides to show in one frame",
|
|
539
|
+
defaultValueHint: 1
|
|
540
|
+
},
|
|
541
|
+
speed: {
|
|
542
|
+
advanced: true,
|
|
543
|
+
displayName: "Speed",
|
|
544
|
+
type: "number",
|
|
545
|
+
description: "Transition speed in milliseconds",
|
|
546
|
+
defaultValueHint: 500
|
|
547
|
+
},
|
|
548
|
+
swipe: {
|
|
549
|
+
advanced: true,
|
|
550
|
+
displayName: "Swipe",
|
|
551
|
+
type: "boolean",
|
|
552
|
+
description: "Enable swiping to change slides",
|
|
553
|
+
defaultValueHint: true
|
|
554
|
+
},
|
|
555
|
+
swipeToSlide: {
|
|
556
|
+
advanced: true,
|
|
557
|
+
displayName: "Swipe To Slide",
|
|
558
|
+
type: "boolean",
|
|
559
|
+
description: "Enable drag/swipe irrespective of 'slidesToScroll'",
|
|
560
|
+
defaultValueHint: false
|
|
561
|
+
},
|
|
562
|
+
touchMove: {
|
|
563
|
+
advanced: true,
|
|
564
|
+
displayName: "Touch Move",
|
|
565
|
+
type: "boolean",
|
|
566
|
+
description: "Enable slide moving on touch",
|
|
567
|
+
defaultValueHint: true
|
|
568
|
+
},
|
|
569
|
+
touchThreshold: {
|
|
570
|
+
advanced: true,
|
|
571
|
+
displayName: "Touch Threshold",
|
|
572
|
+
type: "number",
|
|
573
|
+
description: "Swipe distance threshold in pixels",
|
|
574
|
+
defaultValueHint: 5
|
|
575
|
+
},
|
|
576
|
+
useCSS: {
|
|
577
|
+
advanced: true,
|
|
578
|
+
displayName: "Use CSS",
|
|
579
|
+
type: "boolean",
|
|
580
|
+
description: "Enable/Disable CSS Transitions",
|
|
581
|
+
defaultValueHint: true
|
|
582
|
+
},
|
|
583
|
+
useTransform: {
|
|
584
|
+
advanced: true,
|
|
585
|
+
displayName: "Use Transform",
|
|
586
|
+
type: "boolean",
|
|
587
|
+
description: "Enable/Disable CSS Transforms",
|
|
588
|
+
defaultValueHint: true
|
|
589
|
+
},
|
|
590
|
+
variableWidth: {
|
|
591
|
+
advanced: true,
|
|
592
|
+
displayName: "Variable Width",
|
|
593
|
+
type: "boolean",
|
|
594
|
+
description: "Variable width slides",
|
|
595
|
+
defaultValueHint: false
|
|
596
|
+
},
|
|
597
|
+
vertical: {
|
|
598
|
+
advanced: true,
|
|
599
|
+
displayName: "Vertical",
|
|
600
|
+
type: "boolean",
|
|
601
|
+
description: "Vertical slide mode",
|
|
602
|
+
defaultValueHint: false
|
|
603
|
+
},
|
|
604
|
+
beforeChange: {
|
|
605
|
+
type: "eventHandler",
|
|
606
|
+
advanced: true,
|
|
607
|
+
argTypes: [{
|
|
608
|
+
name: "currentSlide",
|
|
609
|
+
type: "number"
|
|
610
|
+
}]
|
|
611
|
+
}
|
|
612
|
+
},
|
|
613
|
+
states: {
|
|
614
|
+
currentSlide: _extends({
|
|
615
|
+
type: "writable",
|
|
616
|
+
valueProp: "editingSlide",
|
|
617
|
+
onChangeProp: "beforeChange",
|
|
618
|
+
variableType: "number"
|
|
619
|
+
}, sliderHelpers.states.currentSlide)
|
|
620
|
+
},
|
|
621
|
+
componentHelpers: {
|
|
622
|
+
helpers: sliderHelpers,
|
|
623
|
+
importName: "sliderHelpers",
|
|
624
|
+
importPath: "@plasmicpkgs/react-slick"
|
|
625
|
+
},
|
|
626
|
+
defaultStyles: {
|
|
627
|
+
width: "stretch",
|
|
628
|
+
maxWidth: "100%",
|
|
629
|
+
flexDirection: "column"
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
632
|
if (loader) {
|
|
633
|
-
loader.registerComponent(SliderWrapper,
|
|
633
|
+
loader.registerComponent(SliderWrapper, sliderMeta);
|
|
634
634
|
} else {
|
|
635
|
-
registerComponent(SliderWrapper,
|
|
635
|
+
registerComponent(SliderWrapper, sliderMeta);
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
638
|
|
|
639
|
-
export { SliderWrapper, registerSlider, sliderHelpers
|
|
639
|
+
export { SliderWrapper, registerSlider, sliderHelpers };
|
|
640
640
|
//# sourceMappingURL=react-slick.esm.js.map
|