@threekit-tools/treble 0.0.81 → 0.0.84
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/Treble/Treble.d.ts +11 -5
- package/dist/Treble/Treble.js +41 -12
- package/dist/Treble/index.d.ts +2 -2
- package/dist/Treble/index.js +7 -3
- package/dist/Treble/{Snapshots.d.ts → snapshots.d.ts} +4 -9
- package/dist/Treble/snapshots.js +247 -0
- package/dist/Treble/{Wishlist.d.ts → wishlist.d.ts} +2 -6
- package/dist/Treble/wishlist.js +135 -0
- package/dist/api/catalog.js +6 -6
- package/dist/api/configurations.js +3 -3
- package/dist/api/datatables.js +5 -5
- package/dist/api/index.js +5 -1
- package/dist/api/orders.d.ts +5 -7
- package/dist/api/orders.js +12 -12
- package/dist/api/price.js +2 -2
- package/dist/api/products.js +2 -2
- package/dist/components/Accordion/index.js +6 -7
- package/dist/components/AttributeTitle/index.d.ts +0 -9
- package/dist/components/AttributeTitle/index.js +0 -9
- package/dist/components/AttributeValue/index.d.ts +0 -6
- package/dist/components/AttributeValue/index.js +2 -8
- package/dist/components/Button/index.d.ts +0 -27
- package/dist/components/Button/index.js +0 -27
- package/dist/components/Cards/index.d.ts +2 -55
- package/dist/components/Cards/index.js +3 -60
- package/dist/components/Drawer/index.js +7 -16
- package/dist/components/Dropdown/index.d.ts +2 -59
- package/dist/components/Dropdown/index.js +11 -72
- package/dist/components/FlatForm/index.d.ts +0 -21
- package/dist/components/FlatForm/index.js +10 -25
- package/dist/components/Modal/index.js +2 -15
- package/dist/components/Player/index.d.ts +1 -1
- package/dist/components/PortalToArOverlay/index.js +5 -1
- package/dist/components/PortalToElement/index.js +0 -8
- package/dist/components/ProductDescription/index.d.ts +0 -6
- package/dist/components/ProductDescription/index.js +0 -6
- package/dist/components/ProductName/index.d.ts +0 -9
- package/dist/components/ProductName/index.js +0 -9
- package/dist/components/Share/index.d.ts +0 -12
- package/dist/components/Share/index.js +2 -14
- package/dist/components/Snapshots/index.d.ts +0 -8
- package/dist/components/Snapshots/index.js +2 -10
- package/dist/components/Strips/index.d.ts +2 -55
- package/dist/components/Strips/index.js +3 -60
- package/dist/components/Swatch/index.d.ts +2 -64
- package/dist/components/Swatch/index.js +3 -69
- package/dist/components/Switch/index.d.ts +2 -34
- package/dist/components/Switch/index.js +2 -38
- package/dist/components/Tabs/index.js +5 -1
- package/dist/components/TextInput/index.d.ts +2 -1
- package/dist/components/TextInput/index.js +2 -3
- package/dist/components/ThreekitProvider/index.js +5 -1
- package/dist/components/Tiles/index.d.ts +2 -29
- package/dist/components/Tiles/index.js +3 -33
- package/dist/components/TilesGroup/index.d.ts +2 -26
- package/dist/components/TilesGroup/index.js +3 -30
- package/dist/components/TotalPrice/index.d.ts +0 -6
- package/dist/components/TotalPrice/index.js +0 -6
- package/dist/components/TrebleApp/index.js +5 -1
- package/dist/components/Upload/index.d.ts +2 -1
- package/dist/components/Upload/index.js +21 -17
- package/dist/components/UploadArea/index.d.ts +2 -1
- package/dist/components/UploadArea/index.js +18 -15
- package/dist/components/Wishlist/index.d.ts +0 -3
- package/dist/components/Wishlist/index.js +12 -10
- package/dist/components/Zoom/index.d.ts +0 -17
- package/dist/components/Zoom/index.js +5 -21
- package/dist/components/formComponents.d.ts +12 -0
- package/dist/components/formComponents.js +10 -8
- package/dist/components/message/index.d.ts +0 -9
- package/dist/components/message/index.js +4 -31
- package/dist/connection.js +2 -2
- package/dist/constants.d.ts +0 -49
- package/dist/constants.js +1 -59
- package/dist/hooks/useAttribute/index.d.ts +1 -1
- package/dist/hooks/useAttribute/index.js +6 -6
- package/dist/hooks/useConfigurationLoader/index.js +5 -5
- package/dist/hooks/useNestedConfigurator/index.js +2 -2
- package/dist/hooks/useShare/index.js +3 -3
- package/dist/hooks/useSingleAnimation/index.js +20 -25
- package/dist/http/datatables.js +0 -1
- package/dist/http/index.js +5 -1
- package/dist/http/orders.d.ts +6 -8
- package/dist/icons/Spinner.js +5 -1
- package/dist/icons/index.d.ts +0 -41
- package/dist/icons/index.js +0 -42
- package/dist/index.d.ts +42 -3
- package/dist/index.js +84 -26
- package/dist/store/attributes.d.ts +0 -12
- package/dist/store/attributes.js +2 -15
- package/dist/store/index.d.ts +1 -1
- package/dist/store/price.d.ts +0 -12
- package/dist/store/price.js +2 -16
- package/dist/store/product.d.ts +6 -21
- package/dist/store/product.js +26 -38
- package/dist/store/translations.d.ts +1 -13
- package/dist/store/translations.js +2 -12
- package/dist/store/treble.d.ts +1 -16
- package/dist/store/treble.js +31 -66
- package/dist/store/wishlist.d.ts +0 -12
- package/dist/store/wishlist.js +4 -17
- package/dist/types.d.ts +118 -65
- package/dist/types.js +54 -0
- package/dist/utils.d.ts +10 -10
- package/dist/utils.js +8 -16
- package/package.json +16 -4
- package/dist/Treble/Snapshots.js +0 -251
- package/dist/Treble/Wishlist.js +0 -136
- package/dist/hooks/useImageEditor/index.d.ts +0 -14
- package/dist/hooks/useImageEditor/index.js +0 -320
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { ATTRIBUTE_TYPES } from '../../types';
|
|
3
4
|
import { IFormComponentProps, IOption } from '../containers/formInputContainer';
|
|
4
5
|
export interface IDropdown extends IFormComponentProps<IOption> {
|
|
5
6
|
showThumbnail?: boolean;
|
|
@@ -10,33 +11,11 @@ export interface IDropdown extends IFormComponentProps<IOption> {
|
|
|
10
11
|
export declare const Dropdown: {
|
|
11
12
|
(props: IDropdown): JSX.Element;
|
|
12
13
|
propTypes: {
|
|
13
|
-
/**
|
|
14
|
-
* Is the attribute name on the initialized asset that we are
|
|
15
|
-
* using this component for. If the attribute prop is used,
|
|
16
|
-
* the component will ignore the props for: `value`, `options`, `onClick`.
|
|
17
|
-
*/
|
|
18
14
|
attribute: PropTypes.Requireable<string>;
|
|
19
|
-
/**
|
|
20
|
-
* Used to add a title to the input
|
|
21
|
-
*/
|
|
22
15
|
title: PropTypes.Requireable<string>;
|
|
23
|
-
/**
|
|
24
|
-
* Used to provide a custom description for the input component
|
|
25
|
-
*/
|
|
26
16
|
description: PropTypes.Requireable<string>;
|
|
27
|
-
/**
|
|
28
|
-
* Selected value from the option set. Should match the 'value' property
|
|
29
|
-
* of one of the items in the options array.
|
|
30
|
-
*/
|
|
31
17
|
value: PropTypes.Requireable<string>;
|
|
32
|
-
/**
|
|
33
|
-
* Handles the user seletion by passing the value of the selected
|
|
34
|
-
* option as the argument into the onClick callback.
|
|
35
|
-
*/
|
|
36
18
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
37
|
-
/**
|
|
38
|
-
* The options set to be displayed for the user
|
|
39
|
-
*/
|
|
40
19
|
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
41
20
|
name: PropTypes.Requireable<string>;
|
|
42
21
|
description: PropTypes.Requireable<string>;
|
|
@@ -46,49 +25,13 @@ export declare const Dropdown: {
|
|
|
46
25
|
color: PropTypes.Requireable<string>;
|
|
47
26
|
disabled: PropTypes.Requireable<boolean>;
|
|
48
27
|
}> | null | undefined)[]>;
|
|
49
|
-
/**
|
|
50
|
-
* Used to add a custom class name to each of the components html elements
|
|
51
|
-
*/
|
|
52
28
|
className: PropTypes.Requireable<string>;
|
|
53
|
-
/**
|
|
54
|
-
* By default the thumbnail (image/color value) is soruced from the `_thumbnail`
|
|
55
|
-
* metadata key in the option's Catalog Item. This metadata key can be overwritten
|
|
56
|
-
* by passing in the prefered key value to the **thumbnailFromMetadata** prop.
|
|
57
|
-
*/
|
|
58
29
|
metadataKeyThumbnail: PropTypes.Requireable<string>;
|
|
59
|
-
/**
|
|
60
|
-
* By default the description is soruced from the `_description` metadata
|
|
61
|
-
* key in the option's Catalog Item. This metadata key can be overwritten
|
|
62
|
-
* by passing in the prefered key value to the **metadataKeyDescription**
|
|
63
|
-
* prop.
|
|
64
|
-
*/
|
|
65
30
|
metadataKeyDescription: PropTypes.Requireable<string>;
|
|
66
|
-
/**
|
|
67
|
-
* By default the price of an item is soruced from the pricebook entry for
|
|
68
|
-
* the option's Catalog Item. The price can alternatively be soruced from
|
|
69
|
-
* the option's Catalog Item metadata, by specifying the key under which the
|
|
70
|
-
* price can be found as the **metadataKeyPrice** prop.
|
|
71
|
-
*/
|
|
72
31
|
metadataKeyPrice: PropTypes.Requireable<string>;
|
|
73
|
-
/**
|
|
74
|
-
* A boolean to set whether or all the Cards should display thumbnails
|
|
75
|
-
* for the options.
|
|
76
|
-
*/
|
|
77
32
|
showThumbnail: PropTypes.Requireable<boolean>;
|
|
78
|
-
/**
|
|
79
|
-
* A boolean to set whether or all the Cards should display the description
|
|
80
|
-
* for the options.
|
|
81
|
-
*/
|
|
82
33
|
showDescription: PropTypes.Requireable<boolean>;
|
|
83
|
-
/**
|
|
84
|
-
* A boolean to set whether or all the Cards should display the price
|
|
85
|
-
* for the options.
|
|
86
|
-
*/
|
|
87
34
|
showPrice: PropTypes.Requireable<boolean>;
|
|
88
|
-
/**
|
|
89
|
-
* The maximum height the dropdown area should extend to before scrolling
|
|
90
|
-
* is introduced
|
|
91
|
-
*/
|
|
92
35
|
dropdownMaxHeight: PropTypes.Requireable<string>;
|
|
93
36
|
};
|
|
94
37
|
defaultProps: {
|
|
@@ -107,7 +50,7 @@ export declare const Dropdown: {
|
|
|
107
50
|
dropdownMaxHeight: string;
|
|
108
51
|
};
|
|
109
52
|
componentName: string;
|
|
110
|
-
compatibleAttributes: Set<
|
|
53
|
+
compatibleAttributes: Set<ATTRIBUTE_TYPES>;
|
|
111
54
|
};
|
|
112
55
|
declare const _default: (props: IDropdown) => JSX.Element | null;
|
|
113
56
|
export default _default;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -28,9 +32,9 @@ var prop_types_1 = __importDefault(require("prop-types"));
|
|
|
28
32
|
var FormComponentTitle_1 = __importDefault(require("../FormComponentTitle"));
|
|
29
33
|
var FormComponentDescription_1 = __importDefault(require("../FormComponentDescription"));
|
|
30
34
|
var dropdown_styles_1 = require("./dropdown.styles");
|
|
31
|
-
var
|
|
35
|
+
var CaretDown_1 = __importDefault(require("../../icons/CaretDown"));
|
|
32
36
|
var utils_1 = require("../../utils");
|
|
33
|
-
var
|
|
37
|
+
var types_1 = require("../../types");
|
|
34
38
|
var formInputContainer_1 = __importDefault(require("../containers/formInputContainer"));
|
|
35
39
|
var Thumbnail = function (props) {
|
|
36
40
|
var imageUrl = props.imageUrl, color = props.color, name = props.name, className = props.className;
|
|
@@ -78,11 +82,7 @@ var Dropdown = function (props) {
|
|
|
78
82
|
return (react_1.default.createElement("div", { className: cls },
|
|
79
83
|
react_1.default.createElement(FormComponentTitle_1.default, { title: title, className: cls }),
|
|
80
84
|
react_1.default.createElement(FormComponentDescription_1.default, { description: description, className: cls }),
|
|
81
|
-
react_1.default.createElement(dropdown_styles_1.DropdownWrapper
|
|
82
|
-
// active={!hide}
|
|
83
|
-
, {
|
|
84
|
-
// active={!hide}
|
|
85
|
-
ref: ref, className: "".concat(cls, " dropdown") },
|
|
85
|
+
react_1.default.createElement(dropdown_styles_1.DropdownWrapper, { ref: ref, className: "".concat(cls, " dropdown") },
|
|
86
86
|
react_1.default.createElement(dropdown_styles_1.DropdownMain, { active: !hide, className: "".concat(cls, " selected"), onClick: function () { return setHide(!hide); }, hasPlaceholder: !value },
|
|
87
87
|
react_1.default.createElement(Thumbnail, { imageUrl: selectedOpt === null || selectedOpt === void 0 ? void 0 : selectedOpt.imageUrl, color: selectedOpt === null || selectedOpt === void 0 ? void 0 : selectedOpt.color, name: selectedOpt === null || selectedOpt === void 0 ? void 0 : selectedOpt.name, className: "".concat(cls, " selected") }),
|
|
88
88
|
react_1.default.createElement("div", null,
|
|
@@ -90,7 +90,7 @@ var Dropdown = function (props) {
|
|
|
90
90
|
react_1.default.createElement(Description, { description: selectedOpt === null || selectedOpt === void 0 ? void 0 : selectedOpt.description, className: "".concat(cls, " selected") })),
|
|
91
91
|
react_1.default.createElement(Price, { price: selectedOpt === null || selectedOpt === void 0 ? void 0 : selectedOpt.price, className: cls }),
|
|
92
92
|
react_1.default.createElement(dropdown_styles_1.IconWrapper, null,
|
|
93
|
-
react_1.default.createElement(
|
|
93
|
+
react_1.default.createElement(CaretDown_1.default, null))),
|
|
94
94
|
react_1.default.createElement(dropdown_styles_1.DropdownOptions, { hide: hide, dropdownMaxHeight: dropdownMaxHeight },
|
|
95
95
|
react_1.default.createElement("div", null, options === null || options === void 0 ? void 0 : options.map(function (el, i) {
|
|
96
96
|
var _a = Object.assign({}, el, {
|
|
@@ -114,33 +114,11 @@ var Dropdown = function (props) {
|
|
|
114
114
|
};
|
|
115
115
|
exports.Dropdown = Dropdown;
|
|
116
116
|
exports.Dropdown.propTypes = {
|
|
117
|
-
/**
|
|
118
|
-
* Is the attribute name on the initialized asset that we are
|
|
119
|
-
* using this component for. If the attribute prop is used,
|
|
120
|
-
* the component will ignore the props for: `value`, `options`, `onClick`.
|
|
121
|
-
*/
|
|
122
117
|
attribute: prop_types_1.default.string,
|
|
123
|
-
/**
|
|
124
|
-
* Used to add a title to the input
|
|
125
|
-
*/
|
|
126
118
|
title: prop_types_1.default.string,
|
|
127
|
-
/**
|
|
128
|
-
* Used to provide a custom description for the input component
|
|
129
|
-
*/
|
|
130
119
|
description: prop_types_1.default.string,
|
|
131
|
-
/**
|
|
132
|
-
* Selected value from the option set. Should match the 'value' property
|
|
133
|
-
* of one of the items in the options array.
|
|
134
|
-
*/
|
|
135
120
|
value: prop_types_1.default.string,
|
|
136
|
-
/**
|
|
137
|
-
* Handles the user seletion by passing the value of the selected
|
|
138
|
-
* option as the argument into the onClick callback.
|
|
139
|
-
*/
|
|
140
121
|
onClick: prop_types_1.default.func,
|
|
141
|
-
/**
|
|
142
|
-
* The options set to be displayed for the user
|
|
143
|
-
*/
|
|
144
122
|
options: prop_types_1.default.arrayOf(prop_types_1.default.shape({
|
|
145
123
|
name: prop_types_1.default.string,
|
|
146
124
|
description: prop_types_1.default.string,
|
|
@@ -150,64 +128,25 @@ exports.Dropdown.propTypes = {
|
|
|
150
128
|
color: prop_types_1.default.string,
|
|
151
129
|
disabled: prop_types_1.default.bool,
|
|
152
130
|
})),
|
|
153
|
-
/**
|
|
154
|
-
* Used to add a custom class name to each of the components html elements
|
|
155
|
-
*/
|
|
156
131
|
className: prop_types_1.default.string,
|
|
157
|
-
/**
|
|
158
|
-
* By default the thumbnail (image/color value) is soruced from the `_thumbnail`
|
|
159
|
-
* metadata key in the option's Catalog Item. This metadata key can be overwritten
|
|
160
|
-
* by passing in the prefered key value to the **thumbnailFromMetadata** prop.
|
|
161
|
-
*/
|
|
162
132
|
metadataKeyThumbnail: prop_types_1.default.string,
|
|
163
|
-
/**
|
|
164
|
-
* By default the description is soruced from the `_description` metadata
|
|
165
|
-
* key in the option's Catalog Item. This metadata key can be overwritten
|
|
166
|
-
* by passing in the prefered key value to the **metadataKeyDescription**
|
|
167
|
-
* prop.
|
|
168
|
-
*/
|
|
169
133
|
metadataKeyDescription: prop_types_1.default.string,
|
|
170
|
-
/**
|
|
171
|
-
* By default the price of an item is soruced from the pricebook entry for
|
|
172
|
-
* the option's Catalog Item. The price can alternatively be soruced from
|
|
173
|
-
* the option's Catalog Item metadata, by specifying the key under which the
|
|
174
|
-
* price can be found as the **metadataKeyPrice** prop.
|
|
175
|
-
*/
|
|
176
134
|
metadataKeyPrice: prop_types_1.default.string,
|
|
177
|
-
/**
|
|
178
|
-
* A boolean to set whether or all the Cards should display thumbnails
|
|
179
|
-
* for the options.
|
|
180
|
-
*/
|
|
181
135
|
showThumbnail: prop_types_1.default.bool,
|
|
182
|
-
/**
|
|
183
|
-
* A boolean to set whether or all the Cards should display the description
|
|
184
|
-
* for the options.
|
|
185
|
-
*/
|
|
186
136
|
showDescription: prop_types_1.default.bool,
|
|
187
|
-
/**
|
|
188
|
-
* A boolean to set whether or all the Cards should display the price
|
|
189
|
-
* for the options.
|
|
190
|
-
*/
|
|
191
137
|
showPrice: prop_types_1.default.bool,
|
|
192
|
-
/**
|
|
193
|
-
* The maximum height the dropdown area should extend to before scrolling
|
|
194
|
-
* is introduced
|
|
195
|
-
*/
|
|
196
138
|
dropdownMaxHeight: prop_types_1.default.string,
|
|
197
139
|
};
|
|
198
140
|
exports.Dropdown.defaultProps = {
|
|
199
141
|
description: undefined,
|
|
200
142
|
className: undefined,
|
|
201
|
-
// Default use
|
|
202
143
|
attribute: undefined,
|
|
203
|
-
// Default user overrides
|
|
204
144
|
metadataKeyThumbnail: '_thumbnail',
|
|
205
145
|
metadataKeyDescription: undefined,
|
|
206
146
|
metadataKeyPrice: undefined,
|
|
207
147
|
showThumbnail: true,
|
|
208
148
|
showPrice: true,
|
|
209
149
|
showDescription: true,
|
|
210
|
-
// Custom use
|
|
211
150
|
value: undefined,
|
|
212
151
|
options: undefined,
|
|
213
152
|
onClick: undefined,
|
|
@@ -215,7 +154,7 @@ exports.Dropdown.defaultProps = {
|
|
|
215
154
|
};
|
|
216
155
|
exports.Dropdown.componentName = 'dropdown';
|
|
217
156
|
exports.Dropdown.compatibleAttributes = new Set([
|
|
218
|
-
|
|
219
|
-
|
|
157
|
+
types_1.ATTRIBUTE_TYPES.ASSET,
|
|
158
|
+
types_1.ATTRIBUTE_TYPES.STRING,
|
|
220
159
|
]);
|
|
221
160
|
exports.default = (0, formInputContainer_1.default)(exports.Dropdown);
|
|
@@ -12,36 +12,15 @@ interface FlatFormProps {
|
|
|
12
12
|
export declare const FlatForm: {
|
|
13
13
|
(props: FlatFormProps): JSX.Element | null;
|
|
14
14
|
propTypes: {
|
|
15
|
-
/**
|
|
16
|
-
* Used to add a title to Form (defaults to the intialized Catalog Item's name)
|
|
17
|
-
*/
|
|
18
15
|
title: PropTypes.Requireable<string>;
|
|
19
|
-
/**
|
|
20
|
-
* Alignement for the title. Options include `left`, `center` or `right`
|
|
21
|
-
*/
|
|
22
16
|
alignTitle: PropTypes.Requireable<string>;
|
|
23
|
-
/**
|
|
24
|
-
* Used to add a description to Form
|
|
25
|
-
*/
|
|
26
17
|
description: PropTypes.Requireable<string>;
|
|
27
|
-
/**
|
|
28
|
-
* The attributes prop allows us to specify which components to use for
|
|
29
|
-
* our attributes and what props we want to pass into their components.
|
|
30
|
-
*
|
|
31
|
-
* The attributes prop takes and object with the keys matching the name
|
|
32
|
-
* of the attribute you wish to target and value as an object includeing
|
|
33
|
-
* the component to use and props to pass in.
|
|
34
|
-
*/
|
|
35
18
|
attributes: PropTypes.Requireable<{
|
|
36
19
|
[x: string]: PropTypes.InferProps<{
|
|
37
20
|
component: PropTypes.Requireable<string>;
|
|
38
21
|
props: PropTypes.Requireable<object>;
|
|
39
22
|
}> | null | undefined;
|
|
40
23
|
}>;
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
* Used to add a custom class name to each of the components html elements
|
|
44
|
-
*/
|
|
45
24
|
className: PropTypes.Requireable<string>;
|
|
46
25
|
};
|
|
47
26
|
defaultProps: {
|
|
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
16
20
|
}) : (function(o, m, k, k2) {
|
|
17
21
|
if (k2 === undefined) k2 = k;
|
|
18
22
|
o[k2] = m[k];
|
|
@@ -42,7 +46,7 @@ var ProductDescription_1 = __importDefault(require("../ProductDescription"));
|
|
|
42
46
|
var formComponents_1 = __importStar(require("../formComponents"));
|
|
43
47
|
var utils_1 = require("../../utils");
|
|
44
48
|
var useConfigurator_1 = __importDefault(require("../../hooks/useConfigurator"));
|
|
45
|
-
var
|
|
49
|
+
var types_1 = require("../../types");
|
|
46
50
|
var FlatForm = function (props) {
|
|
47
51
|
var _a = Object.assign({
|
|
48
52
|
alignTitle: 'center',
|
|
@@ -64,10 +68,12 @@ var FlatForm = function (props) {
|
|
|
64
68
|
var Component;
|
|
65
69
|
var props = ((_b = (_a = (attributes || {})) === null || _a === void 0 ? void 0 : _a[attr.name]) === null || _b === void 0 ? void 0 : _b.props) || {};
|
|
66
70
|
var type = attr.type;
|
|
67
|
-
if (attr.type ===
|
|
71
|
+
if (attr.type === types_1.ATTRIBUTE_TYPES.ASSET &&
|
|
72
|
+
attr.assetType === types_1.ASSET_TYPES.UPLOAD) {
|
|
68
73
|
type = attr.assetType;
|
|
69
74
|
}
|
|
70
|
-
else if (attr.type ===
|
|
75
|
+
else if (attr.type === types_1.ATTRIBUTE_TYPES.STRING &&
|
|
76
|
+
attr.values.length === 0) {
|
|
71
77
|
type = formComponents_1.FORM_COMPONENT_TYPES.stringInput;
|
|
72
78
|
}
|
|
73
79
|
if ((_d = (_c = (attributes || {})) === null || _c === void 0 ? void 0 : _c[attr.name]) === null || _d === void 0 ? void 0 : _d.component) {
|
|
@@ -89,34 +95,13 @@ var FlatForm = function (props) {
|
|
|
89
95
|
};
|
|
90
96
|
exports.FlatForm = FlatForm;
|
|
91
97
|
exports.FlatForm.propTypes = {
|
|
92
|
-
/**
|
|
93
|
-
* Used to add a title to Form (defaults to the intialized Catalog Item's name)
|
|
94
|
-
*/
|
|
95
98
|
title: prop_types_1.default.string,
|
|
96
|
-
/**
|
|
97
|
-
* Alignement for the title. Options include `left`, `center` or `right`
|
|
98
|
-
*/
|
|
99
99
|
alignTitle: prop_types_1.default.string,
|
|
100
|
-
/**
|
|
101
|
-
* Used to add a description to Form
|
|
102
|
-
*/
|
|
103
100
|
description: prop_types_1.default.string,
|
|
104
|
-
/**
|
|
105
|
-
* The attributes prop allows us to specify which components to use for
|
|
106
|
-
* our attributes and what props we want to pass into their components.
|
|
107
|
-
*
|
|
108
|
-
* The attributes prop takes and object with the keys matching the name
|
|
109
|
-
* of the attribute you wish to target and value as an object includeing
|
|
110
|
-
* the component to use and props to pass in.
|
|
111
|
-
*/
|
|
112
101
|
attributes: prop_types_1.default.objectOf(prop_types_1.default.shape({
|
|
113
102
|
component: prop_types_1.default.string,
|
|
114
103
|
props: prop_types_1.default.object,
|
|
115
104
|
})),
|
|
116
|
-
/**
|
|
117
|
-
*
|
|
118
|
-
* Used to add a custom class name to each of the components html elements
|
|
119
|
-
*/
|
|
120
105
|
className: prop_types_1.default.string,
|
|
121
106
|
};
|
|
122
107
|
exports.FlatForm.defaultProps = {
|
|
@@ -20,14 +20,14 @@ var prop_types_1 = __importDefault(require("prop-types"));
|
|
|
20
20
|
var react_dom_1 = __importDefault(require("react-dom"));
|
|
21
21
|
var modal_styles_1 = require("./modal.styles");
|
|
22
22
|
var utils_1 = require("../../utils");
|
|
23
|
-
var
|
|
23
|
+
var Remove_1 = __importDefault(require("../../icons/Remove"));
|
|
24
24
|
var ModalComponent = function (props) {
|
|
25
25
|
var title = props.title, children = props.children, handleClose = props.handleClose, showHeader = props.showHeader, className = props.className;
|
|
26
26
|
return (react_1.default.createElement(modal_styles_1.Wrapper, { onClick: function (e) { return e.stopPropagation(); }, className: "".concat(className, " modal-main") },
|
|
27
27
|
showHeader ? (react_1.default.createElement(modal_styles_1.Header, { className: "".concat(className, " modal-header") },
|
|
28
28
|
react_1.default.createElement("div", { className: "".concat(className, " modal-title") }, title),
|
|
29
29
|
react_1.default.createElement("div", { onClick: handleClose },
|
|
30
|
-
react_1.default.createElement(
|
|
30
|
+
react_1.default.createElement(Remove_1.default, null)))) : null,
|
|
31
31
|
react_1.default.createElement(modal_styles_1.Content, { className: "".concat(className, " modal-content") }, children)));
|
|
32
32
|
};
|
|
33
33
|
exports.ModalComponent = ModalComponent;
|
|
@@ -39,22 +39,9 @@ var Modal = function (props) {
|
|
|
39
39
|
};
|
|
40
40
|
exports.Modal = Modal;
|
|
41
41
|
exports.ModalComponent.propTypes = {
|
|
42
|
-
/**
|
|
43
|
-
* The title to be shown in the Modal header
|
|
44
|
-
*/
|
|
45
42
|
title: prop_types_1.default.string,
|
|
46
|
-
/**
|
|
47
|
-
* Callback function to close the modal. Can be used with custom UI
|
|
48
|
-
* components in the Modal
|
|
49
|
-
*/
|
|
50
43
|
handleClose: prop_types_1.default.func,
|
|
51
|
-
/**
|
|
52
|
-
* Whether or not to render the default Modal header
|
|
53
|
-
*/
|
|
54
44
|
showHeader: prop_types_1.default.bool,
|
|
55
|
-
/**
|
|
56
|
-
* Used to add a custom class name to each of the components html elements
|
|
57
|
-
*/
|
|
58
45
|
className: prop_types_1.default.string,
|
|
59
46
|
};
|
|
60
47
|
exports.ModalComponent.defaultProps = {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -24,15 +24,7 @@ var PortalToElement = function (props) {
|
|
|
24
24
|
};
|
|
25
25
|
exports.PortalToElement = PortalToElement;
|
|
26
26
|
exports.PortalToElement.propTypes = {
|
|
27
|
-
/**
|
|
28
|
-
* The id of the HTML element you want the content to be rendered in
|
|
29
|
-
*/
|
|
30
27
|
to: prop_types_1.default.string,
|
|
31
|
-
/**
|
|
32
|
-
* Defines the behaviour if the HTML element is not found. If strict is
|
|
33
|
-
* set to `true` the content will not render, if set to `false` the
|
|
34
|
-
* content will render out in its defualt flow.
|
|
35
|
-
*/
|
|
36
28
|
strict: prop_types_1.default.bool,
|
|
37
29
|
};
|
|
38
30
|
exports.PortalToElement.defaultProps = {};
|
|
@@ -7,13 +7,7 @@ interface IProductDescription {
|
|
|
7
7
|
export declare const ProductDescriptionComponent: {
|
|
8
8
|
(props: IProductDescription): JSX.Element;
|
|
9
9
|
propTypes: {
|
|
10
|
-
/**
|
|
11
|
-
* The description displayed to the user
|
|
12
|
-
*/
|
|
13
10
|
description: PropTypes.Requireable<string>;
|
|
14
|
-
/**
|
|
15
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
16
|
-
*/
|
|
17
11
|
className: PropTypes.Requireable<string>;
|
|
18
12
|
};
|
|
19
13
|
defaultProps: {
|
|
@@ -28,13 +28,7 @@ var ProductDescription = function (props) {
|
|
|
28
28
|
return (react_1.default.createElement(exports.ProductDescriptionComponent, { className: className, description: ((_a = metadata === null || metadata === void 0 ? void 0 : metadata._description) === null || _a === void 0 ? void 0 : _a.toString()) || description }));
|
|
29
29
|
};
|
|
30
30
|
exports.ProductDescriptionComponent.propTypes = {
|
|
31
|
-
/**
|
|
32
|
-
* The description displayed to the user
|
|
33
|
-
*/
|
|
34
31
|
description: prop_types_1.default.string,
|
|
35
|
-
/**
|
|
36
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
37
|
-
*/
|
|
38
32
|
className: prop_types_1.default.string,
|
|
39
33
|
};
|
|
40
34
|
exports.ProductDescriptionComponent.defaultProps = {
|
|
@@ -8,17 +8,8 @@ interface ITitle {
|
|
|
8
8
|
export declare const ProductNameComponent: {
|
|
9
9
|
(props: ITitle): JSX.Element;
|
|
10
10
|
propTypes: {
|
|
11
|
-
/**
|
|
12
|
-
* The title displayed to the user
|
|
13
|
-
*/
|
|
14
11
|
title: PropTypes.Requireable<string>;
|
|
15
|
-
/**
|
|
16
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
17
|
-
*/
|
|
18
12
|
className: PropTypes.Requireable<string>;
|
|
19
|
-
/**
|
|
20
|
-
* The CSS Text alignment property. Options: 'left' | 'center' | 'right'
|
|
21
|
-
*/
|
|
22
13
|
align: PropTypes.Requireable<string>;
|
|
23
14
|
};
|
|
24
15
|
defaultProps: {
|
|
@@ -24,17 +24,8 @@ var ProductName = function (props) {
|
|
|
24
24
|
};
|
|
25
25
|
exports.ProductName = ProductName;
|
|
26
26
|
exports.ProductNameComponent.propTypes = {
|
|
27
|
-
/**
|
|
28
|
-
* The title displayed to the user
|
|
29
|
-
*/
|
|
30
27
|
title: prop_types_1.default.string,
|
|
31
|
-
/**
|
|
32
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
33
|
-
*/
|
|
34
28
|
className: prop_types_1.default.string,
|
|
35
|
-
/**
|
|
36
|
-
* The CSS Text alignment property. Options: 'left' | 'center' | 'right'
|
|
37
|
-
*/
|
|
38
29
|
align: prop_types_1.default.string,
|
|
39
30
|
};
|
|
40
31
|
exports.ProductNameComponent.defaultProps = {
|
|
@@ -11,20 +11,8 @@ export declare const Share: {
|
|
|
11
11
|
(props: ShareProps): JSX.Element | null;
|
|
12
12
|
propTypes: {
|
|
13
13
|
className: PropTypes.Requireable<string>;
|
|
14
|
-
/**
|
|
15
|
-
* The presentational type of the input component. Options
|
|
16
|
-
* include: `hollow`, `standard`, `accent`, `primary`
|
|
17
|
-
*/
|
|
18
14
|
type: PropTypes.Requireable<string>;
|
|
19
|
-
/**
|
|
20
|
-
* Used to set the shape of the Widget button. Options
|
|
21
|
-
* include: `square`, `round`
|
|
22
|
-
*/
|
|
23
15
|
shape: PropTypes.Requireable<string>;
|
|
24
|
-
/**
|
|
25
|
-
* Used to set an overwrite of the message presented to the user
|
|
26
|
-
* when the share URL has been successfully copied.
|
|
27
|
-
*/
|
|
28
16
|
message: PropTypes.Requireable<string>;
|
|
29
17
|
};
|
|
30
18
|
defaultProps: {
|
|
@@ -7,7 +7,7 @@ exports.Share = void 0;
|
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
8
|
var prop_types_1 = __importDefault(require("prop-types"));
|
|
9
9
|
var Button_1 = __importDefault(require("../Button"));
|
|
10
|
-
var
|
|
10
|
+
var Share_1 = __importDefault(require("../../icons/Share"));
|
|
11
11
|
var useThreekitInitStatus_1 = __importDefault(require("../../hooks/useThreekitInitStatus"));
|
|
12
12
|
var useShare_1 = __importDefault(require("../../hooks/useShare"));
|
|
13
13
|
var utils_1 = require("../../utils");
|
|
@@ -21,25 +21,13 @@ var Share = function (props) {
|
|
|
21
21
|
var handleClick = function () {
|
|
22
22
|
handleShare(message);
|
|
23
23
|
};
|
|
24
|
-
return (react_1.default.createElement(Button_1.default, { className: cls, shape: shape, type: type, icon:
|
|
24
|
+
return (react_1.default.createElement(Button_1.default, { className: cls, shape: shape, type: type, icon: Share_1.default.iconName, onClick: handleClick }));
|
|
25
25
|
};
|
|
26
26
|
exports.Share = Share;
|
|
27
27
|
exports.Share.propTypes = {
|
|
28
28
|
className: prop_types_1.default.string,
|
|
29
|
-
/**
|
|
30
|
-
* The presentational type of the input component. Options
|
|
31
|
-
* include: `hollow`, `standard`, `accent`, `primary`
|
|
32
|
-
*/
|
|
33
29
|
type: prop_types_1.default.string,
|
|
34
|
-
/**
|
|
35
|
-
* Used to set the shape of the Widget button. Options
|
|
36
|
-
* include: `square`, `round`
|
|
37
|
-
*/
|
|
38
30
|
shape: prop_types_1.default.string,
|
|
39
|
-
/**
|
|
40
|
-
* Used to set an overwrite of the message presented to the user
|
|
41
|
-
* when the share URL has been successfully copied.
|
|
42
|
-
*/
|
|
43
31
|
message: prop_types_1.default.string,
|
|
44
32
|
};
|
|
45
33
|
exports.Share.defaultProps = {
|
|
@@ -13,15 +13,7 @@ export declare const Snapshots: {
|
|
|
13
13
|
(props: SnapshotProps): JSX.Element | null;
|
|
14
14
|
propTypes: {
|
|
15
15
|
className: PropTypes.Requireable<string>;
|
|
16
|
-
/**
|
|
17
|
-
* The presentational type of the input component. Options
|
|
18
|
-
* include: `hollow`, `standard`, `accent`, `primary`
|
|
19
|
-
*/
|
|
20
16
|
type: PropTypes.Requireable<string>;
|
|
21
|
-
/**
|
|
22
|
-
* Used to set the shape of the Widget button. Options
|
|
23
|
-
* include: `square`, `round`
|
|
24
|
-
*/
|
|
25
17
|
shape: PropTypes.Requireable<string>;
|
|
26
18
|
};
|
|
27
19
|
defaultProps: {
|
|
@@ -7,7 +7,7 @@ exports.Snapshots = void 0;
|
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
8
|
var prop_types_1 = __importDefault(require("prop-types"));
|
|
9
9
|
var Button_1 = __importDefault(require("../Button"));
|
|
10
|
-
var
|
|
10
|
+
var Download_1 = __importDefault(require("../../icons/Download"));
|
|
11
11
|
var useThreekitInitStatus_1 = __importDefault(require("../../hooks/useThreekitInitStatus"));
|
|
12
12
|
var useSnapshot_1 = __importDefault(require("../../hooks/useSnapshot"));
|
|
13
13
|
var utils_1 = require("../../utils");
|
|
@@ -19,20 +19,12 @@ var Snapshots = function (props) {
|
|
|
19
19
|
if (!hasLoaded)
|
|
20
20
|
return null;
|
|
21
21
|
var cls = (0, utils_1.generateWidgetClassName)('snapshots', className);
|
|
22
|
-
return (react_1.default.createElement(Button_1.default, { className: cls, shape: shape, type: type, icon:
|
|
22
|
+
return (react_1.default.createElement(Button_1.default, { className: cls, shape: shape, type: type, icon: Download_1.default.iconName, onClick: takeSnapshot }));
|
|
23
23
|
};
|
|
24
24
|
exports.Snapshots = Snapshots;
|
|
25
25
|
exports.Snapshots.propTypes = {
|
|
26
26
|
className: prop_types_1.default.string,
|
|
27
|
-
/**
|
|
28
|
-
* The presentational type of the input component. Options
|
|
29
|
-
* include: `hollow`, `standard`, `accent`, `primary`
|
|
30
|
-
*/
|
|
31
27
|
type: prop_types_1.default.string,
|
|
32
|
-
/**
|
|
33
|
-
* Used to set the shape of the Widget button. Options
|
|
34
|
-
* include: `square`, `round`
|
|
35
|
-
*/
|
|
36
28
|
shape: prop_types_1.default.string,
|
|
37
29
|
};
|
|
38
30
|
exports.Snapshots.defaultProps = {
|