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