@threekit-tools/treble 0.0.83 → 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.
Files changed (46) hide show
  1. package/dist/Treble/Treble.d.ts +9 -3
  2. package/dist/Treble/Treble.js +37 -7
  3. package/dist/Treble/index.d.ts +2 -2
  4. package/dist/Treble/index.js +2 -2
  5. package/dist/Treble/{Snapshots.d.ts → snapshots.d.ts} +4 -9
  6. package/dist/Treble/snapshots.js +247 -0
  7. package/dist/Treble/{Wishlist.d.ts → wishlist.d.ts} +2 -6
  8. package/dist/Treble/wishlist.js +135 -0
  9. package/dist/api/orders.d.ts +5 -7
  10. package/dist/components/AttributeValue/index.js +2 -2
  11. package/dist/components/Cards/index.d.ts +2 -1
  12. package/dist/components/Cards/index.js +3 -3
  13. package/dist/components/Dropdown/index.d.ts +2 -1
  14. package/dist/components/Dropdown/index.js +3 -3
  15. package/dist/components/FlatForm/index.js +5 -3
  16. package/dist/components/Player/index.d.ts +1 -1
  17. package/dist/components/Strips/index.d.ts +2 -1
  18. package/dist/components/Strips/index.js +3 -3
  19. package/dist/components/Swatch/index.d.ts +2 -1
  20. package/dist/components/Swatch/index.js +3 -3
  21. package/dist/components/Switch/index.d.ts +2 -1
  22. package/dist/components/Switch/index.js +2 -2
  23. package/dist/components/TextInput/index.d.ts +2 -1
  24. package/dist/components/TextInput/index.js +2 -2
  25. package/dist/components/Tiles/index.d.ts +2 -1
  26. package/dist/components/Tiles/index.js +3 -3
  27. package/dist/components/TilesGroup/index.d.ts +2 -1
  28. package/dist/components/TilesGroup/index.js +3 -3
  29. package/dist/components/Upload/index.d.ts +2 -1
  30. package/dist/components/Upload/index.js +2 -2
  31. package/dist/components/UploadArea/index.d.ts +2 -1
  32. package/dist/components/UploadArea/index.js +2 -2
  33. package/dist/components/formComponents.d.ts +12 -0
  34. package/dist/components/formComponents.js +5 -5
  35. package/dist/constants.d.ts +0 -22
  36. package/dist/constants.js +1 -23
  37. package/dist/hooks/useSingleAnimation/index.js +15 -14
  38. package/dist/http/orders.d.ts +6 -8
  39. package/dist/store/product.js +3 -1
  40. package/dist/types.d.ts +71 -24
  41. package/dist/types.js +54 -0
  42. package/dist/utils.d.ts +2 -2
  43. package/dist/utils.js +5 -4
  44. package/package.json +1 -1
  45. package/dist/Treble/Snapshots.js +0 -250
  46. package/dist/Treble/Wishlist.js +0 -136
@@ -34,7 +34,7 @@ var FormComponentDescription_1 = __importDefault(require("../FormComponentDescri
34
34
  var dropdown_styles_1 = require("./dropdown.styles");
35
35
  var CaretDown_1 = __importDefault(require("../../icons/CaretDown"));
36
36
  var utils_1 = require("../../utils");
37
- var constants_1 = require("../../constants");
37
+ var types_1 = require("../../types");
38
38
  var formInputContainer_1 = __importDefault(require("../containers/formInputContainer"));
39
39
  var Thumbnail = function (props) {
40
40
  var imageUrl = props.imageUrl, color = props.color, name = props.name, className = props.className;
@@ -154,7 +154,7 @@ exports.Dropdown.defaultProps = {
154
154
  };
155
155
  exports.Dropdown.componentName = 'dropdown';
156
156
  exports.Dropdown.compatibleAttributes = new Set([
157
- constants_1.ATTRIBUTE_TYPES.asset,
158
- constants_1.ATTRIBUTE_TYPES.string,
157
+ types_1.ATTRIBUTE_TYPES.ASSET,
158
+ types_1.ATTRIBUTE_TYPES.STRING,
159
159
  ]);
160
160
  exports.default = (0, formInputContainer_1.default)(exports.Dropdown);
@@ -46,7 +46,7 @@ var ProductDescription_1 = __importDefault(require("../ProductDescription"));
46
46
  var formComponents_1 = __importStar(require("../formComponents"));
47
47
  var utils_1 = require("../../utils");
48
48
  var useConfigurator_1 = __importDefault(require("../../hooks/useConfigurator"));
49
- var constants_1 = require("../../constants");
49
+ var types_1 = require("../../types");
50
50
  var FlatForm = function (props) {
51
51
  var _a = Object.assign({
52
52
  alignTitle: 'center',
@@ -68,10 +68,12 @@ var FlatForm = function (props) {
68
68
  var Component;
69
69
  var props = ((_b = (_a = (attributes || {})) === null || _a === void 0 ? void 0 : _a[attr.name]) === null || _b === void 0 ? void 0 : _b.props) || {};
70
70
  var type = attr.type;
71
- if (attr.type === 'Asset' && attr.assetType === constants_1.ASSET_TYPES.upload) {
71
+ if (attr.type === types_1.ATTRIBUTE_TYPES.ASSET &&
72
+ attr.assetType === types_1.ASSET_TYPES.UPLOAD) {
72
73
  type = attr.assetType;
73
74
  }
74
- else if (attr.type === 'String' && attr.values.length === 0) {
75
+ else if (attr.type === types_1.ATTRIBUTE_TYPES.STRING &&
76
+ attr.values.length === 0) {
75
77
  type = formComponents_1.FORM_COMPONENT_TYPES.stringInput;
76
78
  }
77
79
  if ((_d = (_c = (attributes || {})) === null || _c === void 0 ? void 0 : _c[attr.name]) === null || _d === void 0 ? void 0 : _d.component) {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  export interface IProps {
3
- children: React.ReactNode;
3
+ children?: React.ReactNode;
4
4
  }
5
5
  export interface PlayerProps extends IProps {
6
6
  height?: string;
@@ -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 IStrips extends IFormComponentProps<IOption> {
5
6
  showThumbnail?: boolean;
@@ -46,7 +47,7 @@ export declare const Strips: {
46
47
  onClick: undefined;
47
48
  };
48
49
  componentName: string;
49
- compatibleAttributes: Set<string>;
50
+ compatibleAttributes: Set<ATTRIBUTE_TYPES>;
50
51
  };
51
52
  declare const _default: (props: IStrips) => JSX.Element | null;
52
53
  export default _default;
@@ -11,7 +11,7 @@ var FormComponentDescription_1 = __importDefault(require("../FormComponentDescri
11
11
  var strips_styles_1 = require("./strips.styles");
12
12
  var shared_styles_1 = require("../shared.styles");
13
13
  var utils_1 = require("../../utils");
14
- var constants_1 = require("../../constants");
14
+ var types_1 = require("../../types");
15
15
  var formInputContainer_1 = __importDefault(require("../containers/formInputContainer"));
16
16
  var Thumbnail = function (props) {
17
17
  var imageUrl = props.imageUrl, color = props.color, name = props.name, className = props.className;
@@ -100,7 +100,7 @@ exports.Strips.defaultProps = {
100
100
  };
101
101
  exports.Strips.componentName = 'strips';
102
102
  exports.Strips.compatibleAttributes = new Set([
103
- constants_1.ATTRIBUTE_TYPES.asset,
104
- constants_1.ATTRIBUTE_TYPES.string,
103
+ types_1.ATTRIBUTE_TYPES.ASSET,
104
+ types_1.ATTRIBUTE_TYPES.STRING,
105
105
  ]);
106
106
  exports.default = (0, formInputContainer_1.default)(exports.Strips);
@@ -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 ISwatch extends IFormComponentProps<IOption> {
5
6
  showThumbnail?: boolean;
@@ -51,7 +52,7 @@ export declare const Swatch: {
51
52
  onClick: undefined;
52
53
  };
53
54
  componentName: string;
54
- compatibleAttributes: Set<string>;
55
+ compatibleAttributes: Set<ATTRIBUTE_TYPES>;
55
56
  };
56
57
  declare const _default: (props: ISwatch) => JSX.Element | null;
57
58
  export default _default;
@@ -11,7 +11,7 @@ var FormComponentDescription_1 = __importDefault(require("../FormComponentDescri
11
11
  var swatch_styles_1 = require("./swatch.styles");
12
12
  var shared_styles_1 = require("../shared.styles");
13
13
  var utils_1 = require("../../utils");
14
- var constants_1 = require("../../constants");
14
+ var types_1 = require("../../types");
15
15
  var formInputContainer_1 = __importDefault(require("../containers/formInputContainer"));
16
16
  var SwatchInfo = function (props) {
17
17
  var title = props.title, price = props.price, description = props.description;
@@ -94,7 +94,7 @@ exports.Swatch.defaultProps = {
94
94
  };
95
95
  exports.Swatch.componentName = 'swatch';
96
96
  exports.Swatch.compatibleAttributes = new Set([
97
- constants_1.ATTRIBUTE_TYPES.asset,
98
- constants_1.ATTRIBUTE_TYPES.string,
97
+ types_1.ATTRIBUTE_TYPES.ASSET,
98
+ types_1.ATTRIBUTE_TYPES.STRING,
99
99
  ]);
100
100
  exports.default = (0, formInputContainer_1.default)(exports.Swatch);
@@ -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 ISwitch extends IFormComponentProps<IOption> {
5
6
  showDescription?: boolean;
@@ -27,7 +28,7 @@ export declare const Switch: {
27
28
  onClick: undefined;
28
29
  };
29
30
  componentName: string;
30
- compatibleAttributes: Set<string>;
31
+ compatibleAttributes: Set<ATTRIBUTE_TYPES>;
31
32
  };
32
33
  declare const _default: (props: ISwitch) => JSX.Element | null;
33
34
  export default _default;
@@ -11,7 +11,7 @@ var FormComponentDescription_1 = __importDefault(require("../FormComponentDescri
11
11
  var switch_styles_1 = require("./switch.styles");
12
12
  var shared_styles_1 = require("../shared.styles");
13
13
  var utils_1 = require("../../utils");
14
- var constants_1 = require("../../constants");
14
+ var types_1 = require("../../types");
15
15
  var formInputContainer_1 = __importDefault(require("../containers/formInputContainer"));
16
16
  var Switch = function (props) {
17
17
  var title = props.title, value = props.value, onChange = props.onChange, description = props.description, customClassName = props.className, showDescription = props.showDescription;
@@ -46,5 +46,5 @@ exports.Switch.defaultProps = {
46
46
  onClick: undefined,
47
47
  };
48
48
  exports.Switch.componentName = 'Switch';
49
- exports.Switch.compatibleAttributes = new Set([constants_1.ATTRIBUTE_TYPES.boolean]);
49
+ exports.Switch.compatibleAttributes = new Set([types_1.ATTRIBUTE_TYPES.BOOLEAN]);
50
50
  exports.default = (0, formInputContainer_1.default)(exports.Switch);
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { ATTRIBUTE_TYPES } from '../../types';
2
3
  import { IFormComponentProps } from '../containers/formInputContainer';
3
4
  export interface ITextInput extends IFormComponentProps<undefined> {
4
5
  maxLength?: number;
@@ -6,7 +7,7 @@ export interface ITextInput extends IFormComponentProps<undefined> {
6
7
  export declare const TextInput: {
7
8
  (props: ITextInput): JSX.Element;
8
9
  componentName: string;
9
- compatibleAttributes: Set<string>;
10
+ compatibleAttributes: Set<ATTRIBUTE_TYPES>;
10
11
  };
11
12
  declare const _default: (props: ITextInput) => JSX.Element | null;
12
13
  export default _default;
@@ -10,7 +10,7 @@ var FormComponentDescription_1 = __importDefault(require("../FormComponentDescri
10
10
  var textInput_styles_1 = require("./textInput.styles");
11
11
  var shared_styles_1 = require("../shared.styles");
12
12
  var utils_1 = require("../../utils");
13
- var constants_1 = require("../../constants");
13
+ var types_1 = require("../../types");
14
14
  var formInputContainer_1 = __importDefault(require("../containers/formInputContainer"));
15
15
  var TextInput = function (props) {
16
16
  var title = props.title, description = props.description, value = props.value, onChange = props.onChange, maxLength = props.maxLength, customClassName = props.className;
@@ -24,5 +24,5 @@ var TextInput = function (props) {
24
24
  };
25
25
  exports.TextInput = TextInput;
26
26
  exports.TextInput.componentName = 'text-input';
27
- exports.TextInput.compatibleAttributes = new Set([constants_1.ATTRIBUTE_TYPES.string]);
27
+ exports.TextInput.compatibleAttributes = new Set([types_1.ATTRIBUTE_TYPES.STRING]);
28
28
  exports.default = (0, formInputContainer_1.default)(exports.TextInput);
@@ -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, IOptionShared } from '../containers/formInputContainer';
4
5
  export interface ITiles extends IFormComponentProps<IOptionShared> {
5
6
  columns?: number;
@@ -32,7 +33,7 @@ export declare const Tiles: {
32
33
  onClick: undefined;
33
34
  };
34
35
  componentName: string;
35
- compatibleAttributes: Set<string>;
36
+ compatibleAttributes: Set<ATTRIBUTE_TYPES>;
36
37
  };
37
38
  declare const _default: (props: ITiles) => JSX.Element | null;
38
39
  export default _default;
@@ -11,7 +11,7 @@ var FormComponentDescription_1 = __importDefault(require("../FormComponentDescri
11
11
  var tiles_styles_1 = require("./tiles.styles");
12
12
  var shared_styles_1 = require("../shared.styles");
13
13
  var utils_1 = require("../../utils");
14
- var constants_1 = require("../../constants");
14
+ var types_1 = require("../../types");
15
15
  var formInputContainer_1 = __importDefault(require("../containers/formInputContainer"));
16
16
  var Tiles = function (props) {
17
17
  var _a = Object.assign({ columns: 2 }, props), title = _a.title, description = _a.description, options = _a.options, customClassName = _a.className, columns = _a.columns;
@@ -54,7 +54,7 @@ exports.Tiles.defaultProps = {
54
54
  };
55
55
  exports.Tiles.componentName = 'tiles';
56
56
  exports.Tiles.compatibleAttributes = new Set([
57
- constants_1.ATTRIBUTE_TYPES.asset,
58
- constants_1.ATTRIBUTE_TYPES.string,
57
+ types_1.ATTRIBUTE_TYPES.ASSET,
58
+ types_1.ATTRIBUTE_TYPES.STRING,
59
59
  ]);
60
60
  exports.default = (0, formInputContainer_1.default)(exports.Tiles);
@@ -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, IOptionShared } from '../containers/formInputContainer';
4
5
  export interface ITilesGroup extends IFormComponentProps<IOptionShared> {
5
6
  columns?: number;
@@ -30,7 +31,7 @@ export declare const TilesGroup: {
30
31
  onClick: undefined;
31
32
  };
32
33
  componentName: string;
33
- compatibleAttributes: Set<string>;
34
+ compatibleAttributes: Set<ATTRIBUTE_TYPES>;
34
35
  };
35
36
  declare const _default: (props: ITilesGroup) => JSX.Element | null;
36
37
  export default _default;
@@ -11,7 +11,7 @@ var FormComponentDescription_1 = __importDefault(require("../FormComponentDescri
11
11
  var tilesGroup_styles_1 = require("./tilesGroup.styles");
12
12
  var shared_styles_1 = require("../shared.styles");
13
13
  var utils_1 = require("../../utils");
14
- var constants_1 = require("../../constants");
14
+ var types_1 = require("../../types");
15
15
  var formInputContainer_1 = __importDefault(require("../containers/formInputContainer"));
16
16
  var TilesGroup = function (props) {
17
17
  var _a = Object.assign({ stretch: true }, props), stretch = _a.stretch, title = _a.title, description = _a.description, options = _a.options, customClassName = _a.className;
@@ -52,7 +52,7 @@ exports.TilesGroup.defaultProps = {
52
52
  };
53
53
  exports.TilesGroup.componentName = 'tiles-group';
54
54
  exports.TilesGroup.compatibleAttributes = new Set([
55
- constants_1.ATTRIBUTE_TYPES.asset,
56
- constants_1.ATTRIBUTE_TYPES.string,
55
+ types_1.ATTRIBUTE_TYPES.ASSET,
56
+ types_1.ATTRIBUTE_TYPES.STRING,
57
57
  ]);
58
58
  exports.default = (0, formInputContainer_1.default)(exports.TilesGroup);
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { ATTRIBUTE_TYPES } from '../../types';
2
3
  import { IFormComponentProps, IOptionShared } from '../containers/formInputContainer';
3
4
  export interface IUpload extends Pick<IFormComponentProps<IOptionShared>, 'title' | 'description' | 'className' | 'value'> {
4
5
  onChange: (file: File | undefined) => Promise<void>;
@@ -6,7 +7,7 @@ export interface IUpload extends Pick<IFormComponentProps<IOptionShared>, 'title
6
7
  export declare const Upload: {
7
8
  (props: IUpload): JSX.Element;
8
9
  componentName: string;
9
- compatibleAttributes: Set<string>;
10
+ compatibleAttributes: Set<ATTRIBUTE_TYPES>;
10
11
  };
11
12
  declare const _default: (props: IUpload) => JSX.Element | null;
12
13
  export default _default;
@@ -64,10 +64,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
64
64
  Object.defineProperty(exports, "__esModule", { value: true });
65
65
  exports.Upload = void 0;
66
66
  var react_1 = __importStar(require("react"));
67
- var constants_1 = require("../../constants");
68
67
  var FormComponentTitle_1 = __importDefault(require("../FormComponentTitle"));
69
68
  var FormComponentDescription_1 = __importDefault(require("../FormComponentDescription"));
70
69
  var shared_styles_1 = require("../shared.styles");
70
+ var types_1 = require("../../types");
71
71
  var utils_1 = require("../../utils");
72
72
  var Spinner_1 = __importDefault(require("../../icons/Spinner"));
73
73
  var Add_1 = __importDefault(require("../../icons/Add"));
@@ -142,5 +142,5 @@ var Upload = function (props) {
142
142
  };
143
143
  exports.Upload = Upload;
144
144
  exports.Upload.componentName = 'upload';
145
- exports.Upload.compatibleAttributes = new Set([constants_1.ATTRIBUTE_TYPES.asset]);
145
+ exports.Upload.compatibleAttributes = new Set([types_1.ATTRIBUTE_TYPES.ASSET]);
146
146
  exports.default = (0, formInputContainer_1.default)(exports.Upload);
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { ATTRIBUTE_TYPES } from '../../types';
2
3
  import { IFormComponentProps, IOptionShared } from '../containers/formInputContainer';
3
4
  export interface IUpload extends Pick<IFormComponentProps<IOptionShared>, 'title' | 'description' | 'className' | 'value'> {
4
5
  onChange: (file: File) => Promise<void>;
@@ -6,7 +7,7 @@ export interface IUpload extends Pick<IFormComponentProps<IOptionShared>, 'title
6
7
  export declare const UploadArea: {
7
8
  (props: IUpload): JSX.Element;
8
9
  componentName: string;
9
- compatibleAttributes: Set<string>;
10
+ compatibleAttributes: Set<ATTRIBUTE_TYPES>;
10
11
  };
11
12
  declare const _default: (props: IUpload) => JSX.Element | null;
12
13
  export default _default;
@@ -64,10 +64,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
64
64
  Object.defineProperty(exports, "__esModule", { value: true });
65
65
  exports.UploadArea = void 0;
66
66
  var react_1 = __importStar(require("react"));
67
- var constants_1 = require("../../constants");
68
67
  var FormComponentTitle_1 = __importDefault(require("../FormComponentTitle"));
69
68
  var FormComponentDescription_1 = __importDefault(require("../FormComponentDescription"));
70
69
  var shared_styles_1 = require("../shared.styles");
70
+ var types_1 = require("../../types");
71
71
  var utils_1 = require("../../utils");
72
72
  var Spinner_1 = __importDefault(require("../../icons/Spinner"));
73
73
  var Image_1 = __importDefault(require("../../icons/Image"));
@@ -137,5 +137,5 @@ var UploadArea = function (props) {
137
137
  };
138
138
  exports.UploadArea = UploadArea;
139
139
  exports.UploadArea.componentName = 'upload-area';
140
- exports.UploadArea.compatibleAttributes = new Set([constants_1.ATTRIBUTE_TYPES.asset]);
140
+ exports.UploadArea.compatibleAttributes = new Set([types_1.ATTRIBUTE_TYPES.ASSET]);
141
141
  exports.default = (0, formInputContainer_1.default)(exports.UploadArea);
@@ -8,5 +8,17 @@ export declare const formComponents: {
8
8
  } | {
9
9
  [x: string]: (props: import("./Upload").IUpload) => JSX.Element | null;
10
10
  };
11
+ Asset: {
12
+ [x: string]: ((props: import("./Cards").ICards) => JSX.Element | null) | ((props: import("./Tiles").ITiles) => JSX.Element | null);
13
+ };
14
+ String: {
15
+ [x: string]: ((props: import("./Cards").ICards) => JSX.Element | null) | ((props: import("./Tiles").ITiles) => JSX.Element | null) | ((props: import("./TextInput").ITextInput) => JSX.Element | null);
16
+ };
17
+ upload: {
18
+ [x: string]: (props: import("./Upload").IUpload) => JSX.Element | null;
19
+ };
20
+ Boolean: {
21
+ [x: string]: (props: import("./Switch").ISwitch) => JSX.Element | null;
22
+ };
11
23
  };
12
24
  export default formComponents;
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  var _a, _b, _c, _d, _e, _f;
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
27
  exports.formComponents = exports.FORM_COMPONENT_TYPES = void 0;
28
- var constants_1 = require("../constants");
28
+ var types_1 = require("../types");
29
29
  var Cards_1 = __importStar(require("./Cards"));
30
30
  var Dropdown_1 = __importStar(require("./Dropdown"));
31
31
  var Strips_1 = __importStar(require("./Strips"));
@@ -39,7 +39,7 @@ exports.FORM_COMPONENT_TYPES = {
39
39
  stringInput: 'string-input',
40
40
  };
41
41
  exports.formComponents = (_a = {},
42
- _a[constants_1.ATTRIBUTE_TYPES.asset] = (_b = {},
42
+ _a[types_1.ATTRIBUTE_TYPES.ASSET] = (_b = {},
43
43
  _b[Strips_1.Strips.componentName] = Strips_1.default,
44
44
  _b[Cards_1.Cards.componentName] = Cards_1.default,
45
45
  _b[Dropdown_1.Dropdown.componentName] = Dropdown_1.default,
@@ -47,7 +47,7 @@ exports.formComponents = (_a = {},
47
47
  _b[Tiles_1.Tiles.componentName] = Tiles_1.default,
48
48
  _b[TilesGroup_1.TilesGroup.componentName] = TilesGroup_1.default,
49
49
  _b),
50
- _a[constants_1.ATTRIBUTE_TYPES.string] = (_c = {},
50
+ _a[types_1.ATTRIBUTE_TYPES.STRING] = (_c = {},
51
51
  _c[Tiles_1.Tiles.componentName] = Tiles_1.default,
52
52
  _c[Dropdown_1.Dropdown.componentName] = Dropdown_1.default,
53
53
  _c[Cards_1.Cards.componentName] = Cards_1.default,
@@ -59,10 +59,10 @@ exports.formComponents = (_a = {},
59
59
  _a[exports.FORM_COMPONENT_TYPES.stringInput] = (_d = {},
60
60
  _d[TextInput_1.TextInput.componentName] = TextInput_1.default,
61
61
  _d),
62
- _a[constants_1.ASSET_TYPES.upload] = (_e = {},
62
+ _a[types_1.ASSET_TYPES.UPLOAD] = (_e = {},
63
63
  _e[Upload_1.Upload.componentName] = Upload_1.default,
64
64
  _e),
65
- _a[constants_1.ATTRIBUTE_TYPES.boolean] = (_f = {},
65
+ _a[types_1.ATTRIBUTE_TYPES.BOOLEAN] = (_f = {},
66
66
  _f[Switch_1.Switch.componentName] = Switch_1.default,
67
67
  _f),
68
68
  _a);
@@ -20,17 +20,6 @@ export declare const DEFAULT_PLAYER_CONFIG: {
20
20
  showShare: boolean;
21
21
  allowMobileVerticalOrbit: boolean;
22
22
  };
23
- export declare const ATTRIBUTE_TYPES: {
24
- asset: string;
25
- string: string;
26
- number: string;
27
- color: string;
28
- boolean: string;
29
- };
30
- export declare const ASSET_TYPES: {
31
- item: string;
32
- upload: string;
33
- };
34
23
  export declare const SORT_OPTIONS: {
35
24
  ascending: string;
36
25
  descending: string;
@@ -49,17 +38,6 @@ export declare const METADATA_RESERVED: {
49
38
  rotate: string;
50
39
  scale: string;
51
40
  };
52
- export declare const SNAPSHOT_FORMATS: {
53
- png: string;
54
- jpeg: string;
55
- };
56
- export declare const SNAPSHOT_OUTPUTS: {
57
- url: string;
58
- download: string;
59
- dataUrl: string;
60
- blob: string;
61
- file: string;
62
- };
63
41
  export declare const WISHLIST_LOCALSTORAGE_KEY = "tk_wishlist";
64
42
  export declare const DATATABLE_FORMATS: {
65
43
  csv: string;
package/dist/constants.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
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;
4
+ exports.DATATABLE_FORMATS = exports.WISHLIST_LOCALSTORAGE_KEY = exports.METADATA_RESERVED = exports.ATTRIBUTES_RESERVED = exports.SORT_OPTIONS = 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;
5
5
  exports.TREBLE_DEBUG = !!process.env.TREBLE_DEBUG;
6
6
  exports.DEFAULT_CLASS_NAME = 'threekit-react';
7
7
  exports.CLASS_NAME_PREFIX = 'tk';
@@ -24,17 +24,6 @@ exports.DEFAULT_PLAYER_CONFIG = {
24
24
  showShare: false,
25
25
  allowMobileVerticalOrbit: false,
26
26
  };
27
- exports.ATTRIBUTE_TYPES = {
28
- asset: 'Asset',
29
- string: 'String',
30
- number: 'Number',
31
- color: 'Color',
32
- boolean: 'Boolean',
33
- };
34
- exports.ASSET_TYPES = {
35
- item: 'item',
36
- upload: 'upload',
37
- };
38
27
  exports.SORT_OPTIONS = {
39
28
  ascending: 'ascending',
40
29
  descending: 'descending',
@@ -53,17 +42,6 @@ exports.METADATA_RESERVED = {
53
42
  rotate: '_rotate',
54
43
  scale: '_scale',
55
44
  };
56
- exports.SNAPSHOT_FORMATS = {
57
- png: 'png',
58
- jpeg: 'jpeg',
59
- };
60
- exports.SNAPSHOT_OUTPUTS = {
61
- url: 'url',
62
- download: 'download',
63
- dataUrl: 'dataUrl',
64
- blob: 'blob',
65
- file: 'file',
66
- };
67
45
  exports.WISHLIST_LOCALSTORAGE_KEY = 'tk_wishlist';
68
46
  exports.DATATABLE_FORMATS = {
69
47
  csv: 'csv',
@@ -53,6 +53,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
53
53
  var react_1 = require("react");
54
54
  var useThreekitInitStatus_1 = __importDefault(require("../useThreekitInitStatus"));
55
55
  var utils_1 = require("../../utils");
56
+ var types_1 = require("../../types");
56
57
  var prepAnimateConfig = function (config) {
57
58
  return new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
58
59
  var totalDuration, player, assetId, nodesRaw, nodes;
@@ -60,10 +61,10 @@ var prepAnimateConfig = function (config) {
60
61
  switch (_a.label) {
61
62
  case 0:
62
63
  totalDuration = config.duration * 1000 || 0;
63
- player = window.threekit.player.enableApi('player');
64
+ player = window.threekit.player.enableApi(types_1.PRIVATE_APIS.PLAYER);
64
65
  return [4, player.getAssetInstance(window.threekit.player.scene.find({
65
66
  id: window.threekit.player.instanceId,
66
- plug: 'Proxy',
67
+ plug: types_1.PLUG_TYPES.PROXY,
67
68
  property: 'asset',
68
69
  }))];
69
70
  case 1:
@@ -81,8 +82,8 @@ var prepAnimateConfig = function (config) {
81
82
  window.threekit.player.scene.get({
82
83
  from: assetId,
83
84
  id: nodeId,
84
- plug: 'Transform',
85
- property: 'translation',
85
+ plug: types_1.PLUG_TYPES.TRANSFORM,
86
+ property: types_1.TRANSFORM_PROPERTY_TYPES.TRANSLATION,
86
87
  }),
87
88
  Object.assign({ x: 0, y: 0, z: 0 }, nodeData.translation),
88
89
  ],
@@ -93,8 +94,8 @@ var prepAnimateConfig = function (config) {
93
94
  window.threekit.player.scene.get({
94
95
  from: assetId,
95
96
  id: nodeId,
96
- plug: 'Transform',
97
- property: 'rotation',
97
+ plug: types_1.PLUG_TYPES.TRANSFORM,
98
+ property: types_1.TRANSFORM_PROPERTY_TYPES.ROTATION,
98
99
  }),
99
100
  Object.assign({ x: 0, y: 0, z: 0 }, nodeData.rotation),
100
101
  ],
@@ -105,8 +106,8 @@ var prepAnimateConfig = function (config) {
105
106
  window.threekit.player.scene.get({
106
107
  from: assetId,
107
108
  id: nodeId,
108
- plug: 'Transform',
109
- property: 'scale',
109
+ plug: types_1.PLUG_TYPES.TRANSFORM,
110
+ property: types_1.TRANSFORM_PROPERTY_TYPES.SCALE,
110
111
  }),
111
112
  Object.assign({ x: 0, y: 0, z: 0 }, nodeData.scale),
112
113
  ],
@@ -184,8 +185,8 @@ var useAnimation = function (animationConfig) {
184
185
  window.threekit.player.scene.set({
185
186
  from: ref.current.assetId,
186
187
  id: nodeConfig.nodeId,
187
- plug: 'Transform',
188
- property: 'translation',
188
+ plug: types_1.PLUG_TYPES.TRANSFORM,
189
+ property: types_1.TRANSFORM_PROPERTY_TYPES.TRANSLATION,
189
190
  }, translation);
190
191
  }
191
192
  if ('rotation' in nodeConfig) {
@@ -202,8 +203,8 @@ var useAnimation = function (animationConfig) {
202
203
  window.threekit.player.scene.set({
203
204
  from: ref.current.assetId,
204
205
  id: nodeConfig.nodeId,
205
- plug: 'Transform',
206
- property: 'rotation',
206
+ plug: types_1.PLUG_TYPES.TRANSFORM,
207
+ property: types_1.TRANSFORM_PROPERTY_TYPES.ROTATION,
207
208
  }, rotation);
208
209
  }
209
210
  if ('scale' in nodeConfig) {
@@ -220,8 +221,8 @@ var useAnimation = function (animationConfig) {
220
221
  window.threekit.player.scene.set({
221
222
  from: ref.current.assetId,
222
223
  id: nodeConfig.nodeId,
223
- plug: 'Transform',
224
- property: 'scale',
224
+ plug: types_1.PLUG_TYPES.TRANSFORM,
225
+ property: types_1.TRANSFORM_PROPERTY_TYPES.SCALE,
225
226
  }, scale);
226
227
  }
227
228
  });
@@ -1,19 +1,17 @@
1
1
  import { IMultiPageResponse } from './request';
2
2
  export declare type STATUSES = 'List';
3
- interface ICartItem {
3
+ export interface ICartItem {
4
4
  count: number;
5
- metadata: null | Record<string, string>;
5
+ metadata?: null | Record<string, string>;
6
6
  configurationId: string;
7
7
  }
8
- export interface ICart {
9
- cart: Array<ICartItem>;
10
- }
11
- interface IOrderShared extends ICart {
12
- name: string;
8
+ interface IOrderShared {
9
+ name?: string;
13
10
  orgId: string;
14
11
  platform: Record<string, any>;
15
12
  metadata: Record<string, string>;
16
13
  status: STATUSES;
14
+ cart: Array<ICartItem>;
17
15
  }
18
16
  interface IOrderRequest extends IOrderShared {
19
17
  }
@@ -30,7 +28,7 @@ interface IOrdersResponse extends IMultiPageResponse {
30
28
  orders: Array<IOrderResponse>;
31
29
  }
32
30
  export declare const createOrder: (data: IOrderRequest) => Promise<import("axios").AxiosResponse<IOrderResponse>>;
33
- export declare const editOrderCart: (orderId: string, data: ICart) => Promise<import("axios").AxiosResponse<IOrderResponse>>;
31
+ export declare const editOrderCart: (orderId: string, data: Array<ICartItem>) => Promise<import("axios").AxiosResponse<IOrderResponse>>;
34
32
  export declare const getOrder: (orderId: string) => Promise<import("axios").AxiosResponse<IOrderResponse>>;
35
33
  export declare const fetchOrders: () => Promise<import("axios").AxiosResponse<IOrdersResponse>>;
36
34
  export {};
@@ -52,6 +52,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
53
  exports.removeProductIdx = exports.changeActiveCacheIdx = exports.loadNewProduct = exports.loadProduct = exports.cacheActiveProduct = exports.initProduct = exports.getProductCache = exports.getActiveCacheIdx = exports.getMetadata = exports.getName = exports.getProductId = exports.decrementActiveCacheIdx = exports.incrementActiveCacheIdx = exports.setActiveCacheIdx = exports.removeFromCache = exports.updateActiveProductCache = exports.appendToCache = exports.setMetadata = exports.setName = exports.setProductId = exports.PRODUCTS = void 0;
54
54
  var toolkit_1 = require("@reduxjs/toolkit");
55
+ var types_1 = require("../types");
55
56
  var connection_1 = __importDefault(require("../connection"));
56
57
  var treble_1 = require("./treble");
57
58
  exports.setProductId = (0, toolkit_1.createAction)('treble/set-product-id');
@@ -168,7 +169,8 @@ var cacheActiveProduct = function (config) {
168
169
  var thumbnail = config === null || config === void 0 ? void 0 : config.thumbnail;
169
170
  var connectionObj = connection_1.default.getConnection();
170
171
  delete connectionObj.threekitDomain;
171
- var configuration = window.threekit.configurator.getConfiguration();
172
+ var player = window.threekit.player.enableApi(types_1.PRIVATE_APIS.PLAYER);
173
+ var configuration = player.configurator.getFullConfiguration();
172
174
  var data = { connection: connectionObj, configuration: configuration };
173
175
  var product = Object.assign({
174
176
  id: state.product.id,