@threekit-tools/treble 0.0.36 → 0.0.37-codepen-0
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,6 +38,12 @@ export declare const Swatch: {
|
|
|
38
38
|
* Handles the user seletion by passing the value of the selected
|
|
39
39
|
* option as the argument into the onClick callback.
|
|
40
40
|
*/
|
|
41
|
+
size: PropTypes.Requireable<string>;
|
|
42
|
+
/**
|
|
43
|
+
* The size of the for a swatch option. The size should be a valid CSS
|
|
44
|
+
* height/width property.
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
41
47
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
42
48
|
/**
|
|
43
49
|
* The options set to be displayed for the user
|
|
@@ -24,10 +24,10 @@ var SwatchInfo = function (props) {
|
|
|
24
24
|
react_1.default.createElement("div", null))));
|
|
25
25
|
};
|
|
26
26
|
var Thumbnail = function (props) {
|
|
27
|
-
var imageUrl = props.imageUrl, color = props.color, name = props.name, shape = props.shape, className = props.className;
|
|
27
|
+
var imageUrl = props.imageUrl, color = props.color, name = props.name, shape = props.shape, size = props.size, className = props.className;
|
|
28
28
|
if (!imageUrl && !color)
|
|
29
29
|
return react_1.default.createElement("div", null);
|
|
30
|
-
return (react_1.default.createElement(swatch_styles_1.OptionThumbnail, { className: "".concat(className, " option-thumbnail"), color: color, shape: shape }, imageUrl ? react_1.default.createElement("img", { src: imageUrl, alt: name || '' }) : react_1.default.createElement("span", null)));
|
|
30
|
+
return (react_1.default.createElement(swatch_styles_1.OptionThumbnail, { className: "".concat(className, " option-thumbnail"), color: color, shape: shape, size: size }, imageUrl ? react_1.default.createElement("img", { src: imageUrl, alt: name || '' }) : react_1.default.createElement("span", null)));
|
|
31
31
|
};
|
|
32
32
|
var Swatch = function (props) {
|
|
33
33
|
var _a = Object.assign({ shape: 'round', size: '60px' }, props), title = _a.title, shape = _a.shape, description = _a.description, options = _a.options, value = _a.value, onClick = _a.onClick, customClassName = _a.className, showThumbnail = _a.showThumbnail, showPrice = _a.showPrice, showDescription = _a.showDescription, size = _a.size;
|
|
@@ -47,7 +47,7 @@ var Swatch = function (props) {
|
|
|
47
47
|
var clsOpt = "".concat(cls, "-option option-").concat(i, " ").concat(optionValue).concat(selected ? ' selected' : '');
|
|
48
48
|
return (react_1.default.createElement(swatch_styles_1.OptionWrapper, { key: i, onClick: function () { return onClick && onClick(optionValue); }, selected: selected, className: clsOpt, shape: shape, size: size },
|
|
49
49
|
react_1.default.createElement("div", null,
|
|
50
|
-
react_1.default.createElement(Thumbnail, { imageUrl: imageUrl, color: color, shape: shape, className: clsOpt })),
|
|
50
|
+
react_1.default.createElement(Thumbnail, { imageUrl: imageUrl, color: color, shape: shape, className: clsOpt, size: size })),
|
|
51
51
|
react_1.default.createElement(SwatchInfo, { title: name, price: price, description: description })));
|
|
52
52
|
}))));
|
|
53
53
|
};
|
|
@@ -81,6 +81,12 @@ exports.Swatch.propTypes = {
|
|
|
81
81
|
* Handles the user seletion by passing the value of the selected
|
|
82
82
|
* option as the argument into the onClick callback.
|
|
83
83
|
*/
|
|
84
|
+
size: prop_types_1.default.string,
|
|
85
|
+
/**
|
|
86
|
+
* The size of the for a swatch option. The size should be a valid CSS
|
|
87
|
+
* height/width property.
|
|
88
|
+
*
|
|
89
|
+
*/
|
|
84
90
|
onClick: prop_types_1.default.func,
|
|
85
91
|
/**
|
|
86
92
|
* The options set to be displayed for the user
|
package/dist/utils.js
CHANGED
|
@@ -351,30 +351,24 @@ var isUuid = function (str) {
|
|
|
351
351
|
exports.isUuid = isUuid;
|
|
352
352
|
var loadTrebleConfig = function () {
|
|
353
353
|
var config = {};
|
|
354
|
-
try {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
if (treble)
|
|
373
|
-
config.treble = treble;
|
|
374
|
-
}
|
|
375
|
-
catch (e) {
|
|
376
|
-
console.log(e);
|
|
377
|
-
}
|
|
354
|
+
// try {
|
|
355
|
+
// const project = require(`/threekit.config.js`).default;
|
|
356
|
+
// if (project) config.project = project;
|
|
357
|
+
// } catch (e) {
|
|
358
|
+
// console.log(e);
|
|
359
|
+
// }
|
|
360
|
+
// try {
|
|
361
|
+
// const player = require('/.treble/player.config.js').default;
|
|
362
|
+
// if (player) config.player = player;
|
|
363
|
+
// } catch (e) {
|
|
364
|
+
// console.log(e);
|
|
365
|
+
// }
|
|
366
|
+
// try {
|
|
367
|
+
// const treble = require('/.treble/treble.config.js').default;
|
|
368
|
+
// if (treble) config.treble = treble;
|
|
369
|
+
// } catch (e) {
|
|
370
|
+
// console.log(e);
|
|
371
|
+
// }
|
|
378
372
|
return config;
|
|
379
373
|
};
|
|
380
374
|
exports.loadTrebleConfig = loadTrebleConfig;
|