@threekit-tools/treble 0.0.82 → 0.0.83
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/Snapshots.js +31 -32
- package/dist/Treble/Treble.js +3 -4
- package/dist/Treble/Wishlist.js +8 -8
- package/dist/api/catalog.js +6 -6
- package/dist/api/configurations.js +3 -3
- package/dist/api/datatables.js +5 -5
- 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 +1 -6
- 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 +0 -6
- package/dist/components/Button/index.d.ts +0 -27
- package/dist/components/Button/index.js +0 -27
- package/dist/components/Cards/index.d.ts +0 -54
- package/dist/components/Cards/index.js +0 -57
- package/dist/components/Drawer/index.js +0 -13
- package/dist/components/Dropdown/index.d.ts +0 -58
- package/dist/components/Dropdown/index.js +1 -66
- package/dist/components/FlatForm/index.d.ts +0 -21
- package/dist/components/FlatForm/index.js +0 -21
- package/dist/components/Modal/index.js +0 -13
- 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 +0 -12
- package/dist/components/Snapshots/index.d.ts +0 -8
- package/dist/components/Snapshots/index.js +0 -8
- package/dist/components/Strips/index.d.ts +0 -54
- package/dist/components/Strips/index.js +0 -57
- package/dist/components/Swatch/index.d.ts +0 -63
- package/dist/components/Swatch/index.js +0 -66
- package/dist/components/Switch/index.d.ts +0 -33
- package/dist/components/Switch/index.js +0 -36
- package/dist/components/TextInput/index.js +0 -1
- package/dist/components/Tiles/index.d.ts +0 -28
- package/dist/components/Tiles/index.js +0 -30
- package/dist/components/TilesGroup/index.d.ts +0 -25
- package/dist/components/TilesGroup/index.js +0 -27
- package/dist/components/TotalPrice/index.d.ts +0 -6
- package/dist/components/TotalPrice/index.js +0 -6
- package/dist/components/Upload/index.js +5 -6
- package/dist/components/UploadArea/index.js +4 -5
- package/dist/components/Wishlist/index.d.ts +1 -4
- package/dist/components/Wishlist/index.js +2 -5
- package/dist/components/Zoom/index.d.ts +1 -18
- package/dist/components/Zoom/index.js +0 -17
- package/dist/components/formComponents.js +0 -2
- package/dist/components/message/index.d.ts +0 -9
- package/dist/components/message/index.js +0 -9
- package/dist/connection.js +2 -2
- package/dist/constants.d.ts +0 -27
- package/dist/constants.js +0 -36
- 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 +5 -11
- package/dist/http/datatables.js +0 -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 -30
- package/dist/store/attributes.d.ts +0 -12
- package/dist/store/attributes.js +2 -15
- package/dist/store/price.d.ts +0 -12
- package/dist/store/price.js +2 -16
- package/dist/store/product.d.ts +2 -17
- package/dist/store/product.js +23 -37
- package/dist/store/translations.d.ts +0 -12
- package/dist/store/translations.js +2 -12
- package/dist/store/treble.d.ts +0 -15
- 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 +0 -34
- package/dist/utils.js +3 -12
- package/package.json +16 -4
|
@@ -7,13 +7,7 @@ interface IPrice {
|
|
|
7
7
|
export declare const TotalPriceComponent: {
|
|
8
8
|
(props: IPrice): JSX.Element;
|
|
9
9
|
propTypes: {
|
|
10
|
-
/**
|
|
11
|
-
* The price displayed to the user
|
|
12
|
-
*/
|
|
13
10
|
price: 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: {
|
|
@@ -27,13 +27,7 @@ var TotalPrice = function (props) {
|
|
|
27
27
|
};
|
|
28
28
|
exports.TotalPrice = TotalPrice;
|
|
29
29
|
exports.TotalPriceComponent.propTypes = {
|
|
30
|
-
/**
|
|
31
|
-
* The price displayed to the user
|
|
32
|
-
*/
|
|
33
30
|
price: prop_types_1.default.string,
|
|
34
|
-
/**
|
|
35
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
36
|
-
*/
|
|
37
31
|
className: prop_types_1.default.string,
|
|
38
32
|
};
|
|
39
33
|
exports.TotalPriceComponent.defaultProps = {
|
|
@@ -94,21 +94,20 @@ var Upload = function (props) {
|
|
|
94
94
|
switch (_a.label) {
|
|
95
95
|
case 0:
|
|
96
96
|
setIsUploading(true);
|
|
97
|
-
return [4
|
|
97
|
+
return [4, onChange(file)];
|
|
98
98
|
case 1:
|
|
99
99
|
_a.sent();
|
|
100
100
|
setIsUploading(false);
|
|
101
101
|
if (!file)
|
|
102
|
-
return [2
|
|
102
|
+
return [2];
|
|
103
103
|
reader = new FileReader();
|
|
104
104
|
reader.onload = function () {
|
|
105
105
|
if (!imgRef.current)
|
|
106
106
|
return;
|
|
107
|
-
// @ts-ignore
|
|
108
107
|
imgRef.current.src = reader.result;
|
|
109
108
|
};
|
|
110
109
|
reader.readAsDataURL(file);
|
|
111
|
-
return [2
|
|
110
|
+
return [2];
|
|
112
111
|
}
|
|
113
112
|
});
|
|
114
113
|
}); };
|
|
@@ -120,9 +119,9 @@ var Upload = function (props) {
|
|
|
120
119
|
var _a;
|
|
121
120
|
return __generator(this, function (_b) {
|
|
122
121
|
if (!((_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0]) || !onChange)
|
|
123
|
-
return [2
|
|
122
|
+
return [2];
|
|
124
123
|
handleUpload(e.target.files[0]);
|
|
125
|
-
return [2
|
|
124
|
+
return [2];
|
|
126
125
|
});
|
|
127
126
|
}); } }),
|
|
128
127
|
react_1.default.createElement("button", { type: "button", onClick: handleClick }, isUploading ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -92,7 +92,7 @@ var UploadArea = function (props) {
|
|
|
92
92
|
switch (_a.label) {
|
|
93
93
|
case 0:
|
|
94
94
|
setIsUploading(true);
|
|
95
|
-
return [4
|
|
95
|
+
return [4, onChange(file)];
|
|
96
96
|
case 1:
|
|
97
97
|
_a.sent();
|
|
98
98
|
setIsUploading(false);
|
|
@@ -101,11 +101,10 @@ var UploadArea = function (props) {
|
|
|
101
101
|
reader.onload = function () {
|
|
102
102
|
if (!imgRef.current)
|
|
103
103
|
return;
|
|
104
|
-
// @ts-ignore
|
|
105
104
|
imgRef.current.src = reader.result;
|
|
106
105
|
};
|
|
107
106
|
reader.readAsDataURL(file);
|
|
108
|
-
return [2
|
|
107
|
+
return [2];
|
|
109
108
|
}
|
|
110
109
|
});
|
|
111
110
|
}); };
|
|
@@ -117,9 +116,9 @@ var UploadArea = function (props) {
|
|
|
117
116
|
var _a;
|
|
118
117
|
return __generator(this, function (_b) {
|
|
119
118
|
if (!((_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0]) || !onChange)
|
|
120
|
-
return [2
|
|
119
|
+
return [2];
|
|
121
120
|
handleUpload(e.target.files[0]);
|
|
122
|
-
return [2
|
|
121
|
+
return [2];
|
|
123
122
|
});
|
|
124
123
|
}); } }),
|
|
125
124
|
react_1.default.createElement("button", { type: "button", onClick: handleClick }, isUploading ? (react_1.default.createElement(uploadArea_styles_1.UploadingWrapper, null,
|
|
@@ -19,9 +19,6 @@ export declare const WishlistButton: (props: WidgetButtonProps) => JSX.Element;
|
|
|
19
19
|
export declare const Wishlist: {
|
|
20
20
|
(props: WishlistProps): JSX.Element | null;
|
|
21
21
|
propTypes: {
|
|
22
|
-
/**
|
|
23
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
24
|
-
*/
|
|
25
22
|
className: PropTypes.Requireable<string>;
|
|
26
23
|
};
|
|
27
24
|
defaultProps: {
|
|
@@ -30,6 +27,6 @@ export declare const Wishlist: {
|
|
|
30
27
|
type: string;
|
|
31
28
|
};
|
|
32
29
|
componentName: string;
|
|
33
|
-
Icon: import("
|
|
30
|
+
Icon: import("../../icons").IIcon;
|
|
34
31
|
};
|
|
35
32
|
export default Wishlist;
|
|
@@ -96,11 +96,11 @@ var Wishlist = function (props) {
|
|
|
96
96
|
var handleAddToWishlist = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
97
97
|
return __generator(this, function (_a) {
|
|
98
98
|
switch (_a.label) {
|
|
99
|
-
case 0: return [4
|
|
99
|
+
case 0: return [4, addToWishlist()];
|
|
100
100
|
case 1:
|
|
101
101
|
_a.sent();
|
|
102
102
|
setShowWishlist(true);
|
|
103
|
-
return [2
|
|
103
|
+
return [2];
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
}); };
|
|
@@ -116,9 +116,6 @@ var Wishlist = function (props) {
|
|
|
116
116
|
};
|
|
117
117
|
exports.Wishlist = Wishlist;
|
|
118
118
|
exports.Wishlist.propTypes = {
|
|
119
|
-
/**
|
|
120
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
121
|
-
*/
|
|
122
119
|
className: prop_types_1.default.string,
|
|
123
120
|
};
|
|
124
121
|
exports.Wishlist.defaultProps = {
|
|
@@ -15,27 +15,10 @@ export declare const ZoomInComponent: (props: ZoomComponentProps) => JSX.Element
|
|
|
15
15
|
export declare const Zoom: {
|
|
16
16
|
(props: ZoomProps): JSX.Element;
|
|
17
17
|
propTypes: {
|
|
18
|
-
/**
|
|
19
|
-
* The number of steps, for both zoom-in and out, that we want to increment the zoom by.
|
|
20
|
-
*/
|
|
21
18
|
step: PropTypes.Requireable<number>;
|
|
22
|
-
/**
|
|
23
|
-
* Used to the set the orientation/alignment of the buttons.
|
|
24
|
-
*/
|
|
25
19
|
orientation: PropTypes.Requireable<string>;
|
|
26
|
-
/**
|
|
27
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
28
|
-
*/
|
|
29
20
|
className: PropTypes.Requireable<string>;
|
|
30
|
-
/**
|
|
31
|
-
* The presentational type of the input component. Options
|
|
32
|
-
* include: `hollow`, `standard`, `accent`, `primary`
|
|
33
|
-
*/
|
|
34
21
|
type: PropTypes.Requireable<string>;
|
|
35
|
-
/**
|
|
36
|
-
* Used to set the shape of the Widget button. Options
|
|
37
|
-
* include: `square`, `round`
|
|
38
|
-
*/
|
|
39
22
|
shape: PropTypes.Requireable<string>;
|
|
40
23
|
};
|
|
41
24
|
defaultProps: {
|
|
@@ -46,7 +29,7 @@ export declare const Zoom: {
|
|
|
46
29
|
type: string;
|
|
47
30
|
};
|
|
48
31
|
componentName: string;
|
|
49
|
-
Icon: import("
|
|
32
|
+
Icon: import("../../icons").IIcon;
|
|
50
33
|
ZoomOut: (props: ZoomComponentProps) => JSX.Element | null;
|
|
51
34
|
ZoomIn: (props: ZoomComponentProps) => JSX.Element | null;
|
|
52
35
|
};
|
|
@@ -83,27 +83,10 @@ var Zoom = function (props) {
|
|
|
83
83
|
};
|
|
84
84
|
exports.Zoom = Zoom;
|
|
85
85
|
exports.Zoom.propTypes = {
|
|
86
|
-
/**
|
|
87
|
-
* The number of steps, for both zoom-in and out, that we want to increment the zoom by.
|
|
88
|
-
*/
|
|
89
86
|
step: prop_types_1.default.number,
|
|
90
|
-
/**
|
|
91
|
-
* Used to the set the orientation/alignment of the buttons.
|
|
92
|
-
*/
|
|
93
87
|
orientation: prop_types_1.default.string,
|
|
94
|
-
/**
|
|
95
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
96
|
-
*/
|
|
97
88
|
className: prop_types_1.default.string,
|
|
98
|
-
/**
|
|
99
|
-
* The presentational type of the input component. Options
|
|
100
|
-
* include: `hollow`, `standard`, `accent`, `primary`
|
|
101
|
-
*/
|
|
102
89
|
type: prop_types_1.default.string,
|
|
103
|
-
/**
|
|
104
|
-
* Used to set the shape of the Widget button. Options
|
|
105
|
-
* include: `square`, `round`
|
|
106
|
-
*/
|
|
107
90
|
shape: prop_types_1.default.string,
|
|
108
91
|
};
|
|
109
92
|
exports.Zoom.defaultProps = {
|
|
@@ -33,13 +33,11 @@ var Swatch_1 = __importStar(require("./Swatch"));
|
|
|
33
33
|
var Tiles_1 = __importStar(require("./Tiles"));
|
|
34
34
|
var TilesGroup_1 = __importStar(require("./TilesGroup"));
|
|
35
35
|
var Upload_1 = __importStar(require("./Upload"));
|
|
36
|
-
// import UploadArea, { UploadArea as UploadAreaComponent } from './UploadArea';
|
|
37
36
|
var TextInput_1 = __importStar(require("./TextInput"));
|
|
38
37
|
var Switch_1 = __importStar(require("./Switch"));
|
|
39
38
|
exports.FORM_COMPONENT_TYPES = {
|
|
40
39
|
stringInput: 'string-input',
|
|
41
40
|
};
|
|
42
|
-
// First option for each attribute type is the default value
|
|
43
41
|
exports.formComponents = (_a = {},
|
|
44
42
|
_a[constants_1.ATTRIBUTE_TYPES.asset] = (_b = {},
|
|
45
43
|
_b[Strips_1.Strips.componentName] = Strips_1.default,
|
|
@@ -12,17 +12,8 @@ interface MessageComponentProps {
|
|
|
12
12
|
export declare const MessageComponent: {
|
|
13
13
|
(props: MessageComponentProps): JSX.Element | null;
|
|
14
14
|
propTypes: {
|
|
15
|
-
/**
|
|
16
|
-
* The content to be displayed in the message
|
|
17
|
-
*/
|
|
18
15
|
content: PropTypes.Requireable<string>;
|
|
19
|
-
/**
|
|
20
|
-
* The icon to display before the message
|
|
21
|
-
*/
|
|
22
16
|
icon: PropTypes.Requireable<string>;
|
|
23
|
-
/**
|
|
24
|
-
* Used to add a custom class name to each of the components html elements
|
|
25
|
-
*/
|
|
26
17
|
className: PropTypes.Requireable<string>;
|
|
27
18
|
};
|
|
28
19
|
defaultProps: {
|
|
@@ -72,17 +72,8 @@ var info = function (content, icon) {
|
|
|
72
72
|
}, (messagesConfig.duration || 2 + (typeof content === 'string' ? 0.05 * content.length : 0.5)) * 1000);
|
|
73
73
|
};
|
|
74
74
|
exports.MessageComponent.propTypes = {
|
|
75
|
-
/**
|
|
76
|
-
* The content to be displayed in the message
|
|
77
|
-
*/
|
|
78
75
|
content: prop_types_1.default.string,
|
|
79
|
-
/**
|
|
80
|
-
* The icon to display before the message
|
|
81
|
-
*/
|
|
82
76
|
icon: prop_types_1.default.string,
|
|
83
|
-
/**
|
|
84
|
-
* Used to add a custom class name to each of the components html elements
|
|
85
|
-
*/
|
|
86
77
|
className: prop_types_1.default.string,
|
|
87
78
|
};
|
|
88
79
|
exports.MessageComponent.defaultProps = {
|
package/dist/connection.js
CHANGED
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.ThreekitConnection = void 0;
|
|
40
|
-
var ThreekitConnection =
|
|
40
|
+
var ThreekitConnection = (function () {
|
|
41
41
|
function ThreekitConnection() {
|
|
42
42
|
this._authToken = '';
|
|
43
43
|
this._orgId = '';
|
|
@@ -58,7 +58,7 @@ var ThreekitConnection = /** @class */ (function () {
|
|
|
58
58
|
this._serverUrl = config.serverUrl;
|
|
59
59
|
if (config.threekitDomain)
|
|
60
60
|
this._threekitDomain = "https://".concat(config.threekitDomain);
|
|
61
|
-
return [2
|
|
61
|
+
return [2];
|
|
62
62
|
});
|
|
63
63
|
});
|
|
64
64
|
};
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/*****************************************************
|
|
2
|
-
* Treble Config
|
|
3
|
-
****************************************************/
|
|
4
1
|
export declare const TREBLE_DEBUG: boolean;
|
|
5
2
|
export declare const DEFAULT_CLASS_NAME = "threekit-react";
|
|
6
3
|
export declare const CLASS_NAME_PREFIX = "tk";
|
|
@@ -11,17 +8,8 @@ export declare const TOOL_CLASS_NAME: string;
|
|
|
11
8
|
export declare const DISPLAY_CLASS_NAME: string;
|
|
12
9
|
export declare const FORM_CLASS_NAME: string;
|
|
13
10
|
export declare const IS_TREBLE_SCRIPTS: boolean;
|
|
14
|
-
/*****************************************************
|
|
15
|
-
* Treble Products Workflow
|
|
16
|
-
****************************************************/
|
|
17
11
|
export declare const TK_PRODUCT_ID_PARAM_KEY = "tkProduct";
|
|
18
|
-
/*****************************************************
|
|
19
|
-
* Saved Configuration Workflow
|
|
20
|
-
****************************************************/
|
|
21
12
|
export declare const TK_SAVED_CONFIG_PARAM_KEY = "tkConfigId";
|
|
22
|
-
/*****************************************************
|
|
23
|
-
* Threekit Player Initialization Defaults
|
|
24
|
-
****************************************************/
|
|
25
13
|
export declare const TK_PLAYER_LOADER_DIV = "tk-ply-loader";
|
|
26
14
|
export declare const TK_PLAYER_ROOT_DIV = "tk-ply-root";
|
|
27
15
|
export declare const DEFAULT_PLAYER_CONFIG: {
|
|
@@ -32,9 +20,6 @@ export declare const DEFAULT_PLAYER_CONFIG: {
|
|
|
32
20
|
showShare: boolean;
|
|
33
21
|
allowMobileVerticalOrbit: boolean;
|
|
34
22
|
};
|
|
35
|
-
/*****************************************************
|
|
36
|
-
* Attributes
|
|
37
|
-
****************************************************/
|
|
38
23
|
export declare const ATTRIBUTE_TYPES: {
|
|
39
24
|
asset: string;
|
|
40
25
|
string: string;
|
|
@@ -53,9 +38,6 @@ export declare const SORT_OPTIONS: {
|
|
|
53
38
|
export declare const ATTRIBUTES_RESERVED: {
|
|
54
39
|
camera: string;
|
|
55
40
|
};
|
|
56
|
-
/*****************************************************
|
|
57
|
-
* Reserved Catalog Item Metadata Properties
|
|
58
|
-
****************************************************/
|
|
59
41
|
export declare const METADATA_RESERVED: {
|
|
60
42
|
description: string;
|
|
61
43
|
thumbnail: string;
|
|
@@ -67,9 +49,6 @@ export declare const METADATA_RESERVED: {
|
|
|
67
49
|
rotate: string;
|
|
68
50
|
scale: string;
|
|
69
51
|
};
|
|
70
|
-
/*****************************************************
|
|
71
|
-
* Snapshot
|
|
72
|
-
****************************************************/
|
|
73
52
|
export declare const SNAPSHOT_FORMATS: {
|
|
74
53
|
png: string;
|
|
75
54
|
jpeg: string;
|
|
@@ -81,13 +60,7 @@ export declare const SNAPSHOT_OUTPUTS: {
|
|
|
81
60
|
blob: string;
|
|
82
61
|
file: string;
|
|
83
62
|
};
|
|
84
|
-
/*****************************************************
|
|
85
|
-
* Wishlist
|
|
86
|
-
****************************************************/
|
|
87
63
|
export declare const WISHLIST_LOCALSTORAGE_KEY = "tk_wishlist";
|
|
88
|
-
/*****************************************************
|
|
89
|
-
* Datatables
|
|
90
|
-
****************************************************/
|
|
91
64
|
export declare const DATATABLE_FORMATS: {
|
|
92
65
|
csv: string;
|
|
93
66
|
json: string;
|
package/dist/constants.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*****************************************************
|
|
3
|
-
* Treble Config
|
|
4
|
-
****************************************************/
|
|
5
2
|
var _a;
|
|
6
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
4
|
exports.DATATABLE_FORMATS = exports.WISHLIST_LOCALSTORAGE_KEY = exports.SNAPSHOT_OUTPUTS = exports.SNAPSHOT_FORMATS = exports.METADATA_RESERVED = exports.ATTRIBUTES_RESERVED = exports.SORT_OPTIONS = exports.ASSET_TYPES = exports.ATTRIBUTE_TYPES = exports.DEFAULT_PLAYER_CONFIG = exports.TK_PLAYER_ROOT_DIV = exports.TK_PLAYER_LOADER_DIV = exports.TK_SAVED_CONFIG_PARAM_KEY = exports.TK_PRODUCT_ID_PARAM_KEY = exports.IS_TREBLE_SCRIPTS = exports.FORM_CLASS_NAME = exports.DISPLAY_CLASS_NAME = exports.TOOL_CLASS_NAME = exports.LAYOUT_CLASS_NAME = exports.WIDGET_CLASS_NAME = exports.INPUT_COMPONENT_CLASS_NAME = exports.CLASS_NAME_PREFIX = exports.DEFAULT_CLASS_NAME = exports.TREBLE_DEBUG = void 0;
|
|
@@ -15,39 +12,18 @@ exports.TOOL_CLASS_NAME = "".concat(exports.DEFAULT_CLASS_NAME, " ").concat(expo
|
|
|
15
12
|
exports.DISPLAY_CLASS_NAME = "".concat(exports.DEFAULT_CLASS_NAME, " ").concat(exports.CLASS_NAME_PREFIX, "-display");
|
|
16
13
|
exports.FORM_CLASS_NAME = "".concat(exports.DEFAULT_CLASS_NAME, " ").concat(exports.CLASS_NAME_PREFIX, "-form");
|
|
17
14
|
exports.IS_TREBLE_SCRIPTS = ((_a = process.env.TREBLE_SCRIPTS) === null || _a === void 0 ? void 0 : _a.toString()) === 'true';
|
|
18
|
-
/*****************************************************
|
|
19
|
-
* Treble Products Workflow
|
|
20
|
-
****************************************************/
|
|
21
15
|
exports.TK_PRODUCT_ID_PARAM_KEY = 'tkProduct';
|
|
22
|
-
/*****************************************************
|
|
23
|
-
* Saved Configuration Workflow
|
|
24
|
-
****************************************************/
|
|
25
16
|
exports.TK_SAVED_CONFIG_PARAM_KEY = 'tkConfigId';
|
|
26
|
-
/*****************************************************
|
|
27
|
-
* Threekit Player Initialization Defaults
|
|
28
|
-
****************************************************/
|
|
29
17
|
exports.TK_PLAYER_LOADER_DIV = 'tk-ply-loader';
|
|
30
18
|
exports.TK_PLAYER_ROOT_DIV = 'tk-ply-root';
|
|
31
19
|
exports.DEFAULT_PLAYER_CONFIG = {
|
|
32
|
-
// authToken: undefined,
|
|
33
|
-
// elementId: undefined,
|
|
34
|
-
// cache: undefined,
|
|
35
|
-
// stageId: undefined,
|
|
36
|
-
// assetId: undefined,
|
|
37
20
|
showConfigurator: false,
|
|
38
|
-
// initialConfiguration: undefined,
|
|
39
21
|
showLoadingThumbnail: false,
|
|
40
22
|
showLoadingProgress: true,
|
|
41
|
-
// onLoadingProgress: undefined,
|
|
42
23
|
showAR: false,
|
|
43
24
|
showShare: false,
|
|
44
|
-
// locale: undefined,
|
|
45
25
|
allowMobileVerticalOrbit: false,
|
|
46
|
-
// publishStage: undefined,
|
|
47
26
|
};
|
|
48
|
-
/*****************************************************
|
|
49
|
-
* Attributes
|
|
50
|
-
****************************************************/
|
|
51
27
|
exports.ATTRIBUTE_TYPES = {
|
|
52
28
|
asset: 'Asset',
|
|
53
29
|
string: 'String',
|
|
@@ -66,9 +42,6 @@ exports.SORT_OPTIONS = {
|
|
|
66
42
|
exports.ATTRIBUTES_RESERVED = {
|
|
67
43
|
camera: '_camera',
|
|
68
44
|
};
|
|
69
|
-
/*****************************************************
|
|
70
|
-
* Reserved Catalog Item Metadata Properties
|
|
71
|
-
****************************************************/
|
|
72
45
|
exports.METADATA_RESERVED = {
|
|
73
46
|
description: '_description',
|
|
74
47
|
thumbnail: '_thumbnail',
|
|
@@ -80,9 +53,6 @@ exports.METADATA_RESERVED = {
|
|
|
80
53
|
rotate: '_rotate',
|
|
81
54
|
scale: '_scale',
|
|
82
55
|
};
|
|
83
|
-
/*****************************************************
|
|
84
|
-
* Snapshot
|
|
85
|
-
****************************************************/
|
|
86
56
|
exports.SNAPSHOT_FORMATS = {
|
|
87
57
|
png: 'png',
|
|
88
58
|
jpeg: 'jpeg',
|
|
@@ -94,13 +64,7 @@ exports.SNAPSHOT_OUTPUTS = {
|
|
|
94
64
|
blob: 'blob',
|
|
95
65
|
file: 'file',
|
|
96
66
|
};
|
|
97
|
-
/*****************************************************
|
|
98
|
-
* Wishlist
|
|
99
|
-
****************************************************/
|
|
100
67
|
exports.WISHLIST_LOCALSTORAGE_KEY = 'tk_wishlist';
|
|
101
|
-
/*****************************************************
|
|
102
|
-
* Datatables
|
|
103
|
-
****************************************************/
|
|
104
68
|
exports.DATATABLE_FORMATS = {
|
|
105
69
|
csv: 'csv',
|
|
106
70
|
json: 'json',
|
|
@@ -62,17 +62,17 @@ var useAttribute = function (attributeName) {
|
|
|
62
62
|
return __generator(this, function (_b) {
|
|
63
63
|
switch (_b.label) {
|
|
64
64
|
case 0:
|
|
65
|
-
if (!(attribute.type === 'Asset' && attribute.assetType === 'upload')) return [3
|
|
66
|
-
if (!!value) return [3
|
|
65
|
+
if (!(attribute.type === 'Asset' && attribute.assetType === 'upload')) return [3, 4];
|
|
66
|
+
if (!!value) return [3, 1];
|
|
67
67
|
preppedValue = (0, utils_1.selectionToConfiguration)('', attribute.type);
|
|
68
|
-
return [3
|
|
69
|
-
case 1: return [4
|
|
68
|
+
return [3, 3];
|
|
69
|
+
case 1: return [4, api_1.default.catalog.uploadAsset(value)];
|
|
70
70
|
case 2:
|
|
71
71
|
assetId = _b.sent();
|
|
72
72
|
if (assetId)
|
|
73
73
|
preppedValue = (0, utils_1.selectionToConfiguration)(assetId, attribute.type);
|
|
74
74
|
_b.label = 3;
|
|
75
|
-
case 3: return [3
|
|
75
|
+
case 3: return [3, 5];
|
|
76
76
|
case 4:
|
|
77
77
|
preppedValue = (0, utils_1.selectionToConfiguration)(value, attribute.type);
|
|
78
78
|
_b.label = 5;
|
|
@@ -80,7 +80,7 @@ var useAttribute = function (attributeName) {
|
|
|
80
80
|
dispatch((0, attributes_1.setConfiguration)((_a = {},
|
|
81
81
|
_a[attributeName] = preppedValue,
|
|
82
82
|
_a)));
|
|
83
|
-
return [2
|
|
83
|
+
return [2];
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
}); };
|
|
@@ -50,16 +50,16 @@ var useConfigurationLoader = function () {
|
|
|
50
50
|
switch (_a.label) {
|
|
51
51
|
case 0:
|
|
52
52
|
if (!configurationId)
|
|
53
|
-
return [2
|
|
54
|
-
return [4
|
|
53
|
+
return [2];
|
|
54
|
+
return [4, api_1.default.configurations.fetch(configurationId)];
|
|
55
55
|
case 1:
|
|
56
56
|
configuration = _a.sent();
|
|
57
57
|
if (!configuration)
|
|
58
|
-
return [2
|
|
59
|
-
return [4
|
|
58
|
+
return [2];
|
|
59
|
+
return [4, dispatch((0, attributes_1.setConfiguration)(configuration.data.variant))];
|
|
60
60
|
case 2:
|
|
61
61
|
_a.sent();
|
|
62
|
-
return [2
|
|
62
|
+
return [2, Promise.resolve()];
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
}); };
|
|
@@ -75,14 +75,14 @@ var useNestedConfigurator = function (address) {
|
|
|
75
75
|
switch (_c.label) {
|
|
76
76
|
case 0:
|
|
77
77
|
dispatch((0, treble_1.setPlayerLoading)(true));
|
|
78
|
-
return [4
|
|
78
|
+
return [4, ((_a = configurator.current) === null || _a === void 0 ? void 0 : _a.setConfiguration(config))];
|
|
79
79
|
case 1:
|
|
80
80
|
_c.sent();
|
|
81
81
|
dispatch((0, treble_1.setPlayerLoading)(false));
|
|
82
82
|
updatedAttrs = (_b = configurator.current) === null || _b === void 0 ? void 0 : _b.getDisplayAttributes();
|
|
83
83
|
if (updatedAttrs)
|
|
84
84
|
setAttributes(updatedAttrs);
|
|
85
|
-
return [2
|
|
85
|
+
return [2];
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
}); };
|
|
@@ -53,15 +53,15 @@ var useShare = function () {
|
|
|
53
53
|
var configuration;
|
|
54
54
|
return __generator(this, function (_a) {
|
|
55
55
|
switch (_a.label) {
|
|
56
|
-
case 0: return [4
|
|
56
|
+
case 0: return [4, window.threekit.treble.saveConfiguration()];
|
|
57
57
|
case 1:
|
|
58
58
|
configuration = _a.sent();
|
|
59
59
|
if (!configuration)
|
|
60
|
-
return [2
|
|
60
|
+
return [2, Promise.resolve(undefined)];
|
|
61
61
|
(0, utils_1.copyToClipboard)(configuration.resumableUrl);
|
|
62
62
|
if (msg === null || msg === void 0 ? void 0 : msg.length)
|
|
63
63
|
message_1.default.info(msg);
|
|
64
|
-
return [2
|
|
64
|
+
return [2, Promise.resolve((configuration === null || configuration === void 0 ? void 0 : configuration.resumableUrl) || undefined)];
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
});
|
|
@@ -61,7 +61,7 @@ var prepAnimateConfig = function (config) {
|
|
|
61
61
|
case 0:
|
|
62
62
|
totalDuration = config.duration * 1000 || 0;
|
|
63
63
|
player = window.threekit.player.enableApi('player');
|
|
64
|
-
return [4
|
|
64
|
+
return [4, player.getAssetInstance(window.threekit.player.scene.find({
|
|
65
65
|
id: window.threekit.player.instanceId,
|
|
66
66
|
plug: 'Proxy',
|
|
67
67
|
property: 'asset',
|
|
@@ -129,7 +129,7 @@ var prepAnimateConfig = function (config) {
|
|
|
129
129
|
_b));
|
|
130
130
|
}, {});
|
|
131
131
|
resolve([assetId, totalDuration, nodes]);
|
|
132
|
-
return [2
|
|
132
|
+
return [2];
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
135
|
}); });
|
|
@@ -147,25 +147,19 @@ var useAnimation = function (animationConfig) {
|
|
|
147
147
|
if (!isLoaded)
|
|
148
148
|
return [undefined, undefined];
|
|
149
149
|
var animateFrame = function (timestamp) {
|
|
150
|
-
// if (startTime.current === undefined) startTime.current = timestamp;
|
|
151
|
-
// const elapsed = timestamp - startTime.current;
|
|
152
150
|
if (ref.current.startTime === undefined)
|
|
153
151
|
ref.current.startTime = timestamp;
|
|
154
152
|
var elapsed = timestamp - ref.current.startTime;
|
|
155
153
|
Object.values(ref.current.nodes).forEach(function (nodeConfig) {
|
|
156
154
|
if (!ref.current.isTransformed) {
|
|
157
|
-
// If its too early we don't animate
|
|
158
155
|
if (elapsed < nodeConfig.paddingStart)
|
|
159
156
|
return;
|
|
160
|
-
// If its too early we don't animate
|
|
161
157
|
if (elapsed > nodeConfig.duration + nodeConfig.paddingStart)
|
|
162
158
|
return;
|
|
163
159
|
}
|
|
164
160
|
else if (ref.current.isTransformed) {
|
|
165
|
-
// If its too early we don't animate
|
|
166
161
|
if (elapsed < nodeConfig.paddingEnd)
|
|
167
162
|
return;
|
|
168
|
-
// If its too early we don't animate
|
|
169
163
|
if (elapsed > nodeConfig.duration + nodeConfig.paddingEnd)
|
|
170
164
|
return;
|
|
171
165
|
}
|
|
@@ -246,8 +240,8 @@ var useAnimation = function (animationConfig) {
|
|
|
246
240
|
switch (_b.label) {
|
|
247
241
|
case 0:
|
|
248
242
|
ref.current.startTime = undefined;
|
|
249
|
-
if (!!ref.current.nodes) return [3
|
|
250
|
-
return [4
|
|
243
|
+
if (!!ref.current.nodes) return [3, 2];
|
|
244
|
+
return [4, prepAnimateConfig(animationConfig)];
|
|
251
245
|
case 1:
|
|
252
246
|
_a = _b.sent(), ref.current.assetId = _a[0], ref.current.totalDuration = _a[1], ref.current.nodes = _a[2];
|
|
253
247
|
ref.current.isTransformed = false;
|
|
@@ -255,7 +249,7 @@ var useAnimation = function (animationConfig) {
|
|
|
255
249
|
case 2:
|
|
256
250
|
setAnimationInProgress(true);
|
|
257
251
|
window.requestAnimationFrame(animateFrame);
|
|
258
|
-
return [2
|
|
252
|
+
return [2];
|
|
259
253
|
}
|
|
260
254
|
});
|
|
261
255
|
}); };
|
package/dist/http/datatables.js
CHANGED
|
@@ -16,7 +16,6 @@ var getDatatable = function (datatableId) {
|
|
|
16
16
|
error = 'Requires a datatableId';
|
|
17
17
|
if (error)
|
|
18
18
|
throw new Error(error);
|
|
19
|
-
// return threekitRequest.get<Array<IDatatable>>(
|
|
20
19
|
return request_1.default.get("".concat(DATATABLES_API_ROUTE, "/").concat(datatableId, "/download"));
|
|
21
20
|
};
|
|
22
21
|
exports.getDatatable = getDatatable;
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -1,49 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import AddIcon from './Add';
|
|
3
|
-
import ArrowLeftIcon from './ArrowLeft';
|
|
4
|
-
import ArrowRightIcon from './ArrowRight';
|
|
5
|
-
import CameraIcon from './Camera';
|
|
6
|
-
import CaretDownIcon from './CaretDown';
|
|
7
|
-
import CaretUpIcon from './CaretUp';
|
|
8
|
-
import CaretLeftIcon from './CaretLeft';
|
|
9
|
-
import CaretRightIcon from './CaretRight';
|
|
10
|
-
import CartIcon from './Cart';
|
|
11
|
-
import CheckmateIcon from './Checkmate';
|
|
12
|
-
import ClipboardIcon from './Clipboard';
|
|
13
|
-
import ColorPickerIcon from './ColorPicker';
|
|
14
|
-
import CopyIcon from './Copy';
|
|
15
|
-
import DeleteIcon from './Delete';
|
|
16
|
-
import DoubleCaretLeftIcon from './DoubleCaretLeft';
|
|
17
|
-
import DoubleCaretRightIcon from './DoubleCaretRight';
|
|
18
|
-
import DownloadIcon from './Download';
|
|
19
|
-
import DragIcon from './Drag';
|
|
20
|
-
import EditIcon from './Edit';
|
|
21
|
-
import HeartIcon from './Heart';
|
|
22
|
-
import ImageIcon from './Image';
|
|
23
|
-
import InfoIcon from './Info';
|
|
24
|
-
import MailIcon from './Mail';
|
|
25
|
-
import MenuIcon from './Menu';
|
|
26
|
-
import MoreIcon from './More';
|
|
27
|
-
import NewWindowIcon from './NewWindow';
|
|
28
|
-
import PauseIcon from './Pause';
|
|
29
|
-
import PlayIcon from './Play';
|
|
30
|
-
import RedoIcon from './Redo';
|
|
31
|
-
import RemoveIcon from './Remove';
|
|
32
|
-
import RulerIcon from './Ruler';
|
|
33
|
-
import SearchIcon from './Search';
|
|
34
|
-
import SettingsIcon from './Settings';
|
|
35
|
-
import ShareIcon from './Share';
|
|
36
|
-
import SwitchIcon from './Switch';
|
|
37
|
-
import TagIcon from './Tag';
|
|
38
|
-
import UndoIcon from './Undo';
|
|
39
|
-
import WishlistIcon from './Wishlist';
|
|
40
|
-
import ZoomInIcon from './ZoomIn';
|
|
41
|
-
import ZoomOutIcon from './ZoomOut';
|
|
42
2
|
import SpinnerIcon from './Spinner';
|
|
43
3
|
export interface IIcon extends React.FC {
|
|
44
4
|
iconName: string;
|
|
45
5
|
}
|
|
46
|
-
export { AddIcon, ArrowLeftIcon, ArrowRightIcon, CameraIcon, CaretDownIcon, CaretUpIcon, CaretLeftIcon, CaretRightIcon, CartIcon, CheckmateIcon, ClipboardIcon, ColorPickerIcon, CopyIcon, DeleteIcon, DoubleCaretLeftIcon, DoubleCaretRightIcon, DownloadIcon, DragIcon, EditIcon, HeartIcon, ImageIcon, InfoIcon, MailIcon, MenuIcon, MoreIcon, NewWindowIcon, PauseIcon, PlayIcon, RedoIcon, RemoveIcon, RulerIcon, SearchIcon, SettingsIcon, ShareIcon, SwitchIcon, TagIcon, UndoIcon, WishlistIcon, ZoomInIcon, ZoomOutIcon, SpinnerIcon, };
|
|
47
6
|
declare const _default: {
|
|
48
7
|
[x: string]: IIcon | typeof SpinnerIcon;
|
|
49
8
|
};
|