@threekit-tools/treble 0.0.91-next-03 → 0.0.92
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 +2 -2
- package/dist/Treble/Treble.js +3 -3
- package/dist/Treble/index.d.ts +1 -1
- package/dist/Treble/index.js +1 -1
- package/dist/Treble/snapshot.d.ts +1 -1
- package/dist/Treble/snapshots.d.ts +22 -0
- package/dist/Treble/snapshots.js +247 -0
- package/dist/Treble/wishlist.d.ts +1 -1
- package/dist/Treble/wishlist.js +1 -1
- package/dist/api/catalog.js +1 -1
- package/dist/api/configurations.js +1 -1
- package/dist/api/datatables.js +1 -1
- package/dist/api/orders.js +1 -1
- package/dist/api/price.js +1 -1
- package/dist/api/products.d.ts +2 -2
- package/dist/api/products.js +1 -1
- package/dist/components/BreatheAnimation/index.js +1 -1
- package/dist/components/Button/index.d.ts +2 -2
- package/dist/components/DraggableHint/draggableIndicator.styles.d.ts +1 -1
- package/dist/components/PlayerLoadingSpinner/playerLoadingSpinner.styles.d.ts +1 -1
- package/dist/components/Share/index.js +1 -1
- package/dist/components/Share/share.styles.d.ts +1 -1
- package/dist/components/ThreekitProvider/index.js +3 -2
- package/dist/components/TurntableAnimation/index.js +1 -1
- package/dist/components/Upload/index.js +1 -1
- package/dist/components/UploadArea/index.js +1 -1
- package/dist/components/Wishlist/index.js +1 -1
- package/dist/connection.d.ts +4 -1
- package/dist/connection.js +16 -53
- package/dist/hooks/useAttribute/index.d.ts +4 -4
- package/dist/hooks/useAttribute/index.js +2 -6
- package/dist/hooks/useConfigurationLoader/index.js +1 -1
- package/dist/hooks/useConfigurator/index.d.ts +3 -3
- package/dist/hooks/useDevTools/index.d.ts +1 -1
- package/dist/hooks/useNestedConfigurator/index.d.ts +2 -2
- package/dist/hooks/useNestedConfigurator/index.js +3 -2
- package/dist/hooks/usePlayer/index.d.ts +1 -1
- package/dist/hooks/usePlayerPortal/index.d.ts +1 -1
- package/dist/hooks/useProductCache/index.js +1 -1
- package/dist/hooks/useResetProduct/index.d.ts +1 -1
- package/dist/hooks/useResetProduct/index.js +1 -1
- package/dist/hooks/useRoomBuilder/RoomBuilderState.d.ts +95 -0
- package/dist/hooks/useRoomBuilder/RoomBuilderState.js +1237 -0
- package/dist/hooks/useRoomBuilder/constants.d.ts +41 -0
- package/dist/hooks/useRoomBuilder/constants.js +48 -0
- package/dist/hooks/useRoomBuilder/dataHandlers.d.ts +18 -0
- package/dist/hooks/useRoomBuilder/dataHandlers.js +187 -0
- package/dist/hooks/useRoomBuilder/draw.d.ts +55 -0
- package/dist/hooks/useRoomBuilder/draw.js +573 -0
- package/dist/hooks/useRoomBuilder/findLoops.d.ts +5 -0
- package/dist/hooks/useRoomBuilder/findLoops.js +99 -0
- package/dist/hooks/useRoomBuilder/geometry.d.ts +33 -0
- package/dist/hooks/useRoomBuilder/geometry.js +325 -0
- package/dist/hooks/useRoomBuilder/index.d.ts +40 -0
- package/dist/hooks/useRoomBuilder/index.js +303 -0
- package/dist/hooks/useRoomBuilder/messaging.d.ts +8 -0
- package/dist/hooks/useRoomBuilder/messaging.js +18 -0
- package/dist/hooks/useRoomBuilder/themes.d.ts +12 -0
- package/dist/hooks/useRoomBuilder/themes.js +273 -0
- package/dist/hooks/useRoomBuilder/types.d.ts +238 -0
- package/dist/hooks/useRoomBuilder/types.js +36 -0
- package/dist/hooks/useRoomBuilder/validators.d.ts +36 -0
- package/dist/hooks/useRoomBuilder/validators.js +362 -0
- package/dist/hooks/useShare/index.d.ts +1 -1
- package/dist/hooks/useShare/index.js +1 -1
- package/dist/hooks/useSingleAnimation/index.js +1 -1
- package/dist/hooks/useSnapshot/index.d.ts +1 -1
- package/dist/hooks/useWishlist/index.d.ts +1 -1
- package/dist/hooks/useZoom/index.d.ts +1 -1
- package/dist/http/orders.d.ts +1 -1
- package/dist/icons/Draw.js +3 -3
- package/dist/icons/Window.js +4 -4
- package/dist/icons/index.js +0 -26
- package/dist/index.d.ts +2 -16
- package/dist/index.js +5 -33
- package/dist/store/attributes.d.ts +1 -2
- package/dist/store/attributes.js +1 -1
- package/dist/store/index.d.ts +2 -9
- package/dist/store/index.js +1 -3
- package/dist/store/price.js +1 -1
- package/dist/store/product.d.ts +1 -1
- package/dist/store/product.js +8 -5
- package/dist/store/translations.js +1 -1
- package/dist/store/treble.d.ts +4 -2
- package/dist/store/treble.js +60 -43
- package/dist/store/wishlist.d.ts +1 -1
- package/dist/store/wishlist.js +1 -1
- package/dist/types.d.ts +25 -21
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/package.json +2 -1
package/dist/Treble/Treble.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import threekitAPI from '../api';
|
|
2
2
|
import { IThreekitPlayer, IThreekitPrivatePlayer, IThreekitPrivateConfigurator } from '../types';
|
|
3
3
|
import { IWishlist } from './wishlist';
|
|
4
|
-
import
|
|
4
|
+
import snapshots from './snapshots';
|
|
5
5
|
import { ISaveConfiguration } from '../api/configurations';
|
|
6
6
|
import { ICreateOrder } from '../api/orders';
|
|
7
7
|
import { ICartItem } from '../http/orders';
|
|
@@ -22,7 +22,7 @@ declare class Treble {
|
|
|
22
22
|
_player: IThreekitPrivatePlayer;
|
|
23
23
|
wishlist: IWishlist;
|
|
24
24
|
private _snapshots;
|
|
25
|
-
takeSnapshots: (typeof
|
|
25
|
+
takeSnapshots: (typeof snapshots)['takeSnapshots'];
|
|
26
26
|
_debugMode: boolean;
|
|
27
27
|
constructor({ player, orgId }: ITreble);
|
|
28
28
|
createOrder: (order?: IOrder) => Promise<import("../http/orders").IOrderResponse>;
|
package/dist/Treble/Treble.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -45,7 +45,7 @@ var types_1 = require("../types");
|
|
|
45
45
|
var constants_1 = require("../constants");
|
|
46
46
|
var utils_1 = require("../utils");
|
|
47
47
|
var wishlist_1 = __importDefault(require("./wishlist"));
|
|
48
|
-
var
|
|
48
|
+
var snapshots_1 = __importDefault(require("./snapshots"));
|
|
49
49
|
var Treble = (function () {
|
|
50
50
|
function Treble(_a) {
|
|
51
51
|
var player = _a.player, orgId = _a.orgId;
|
|
@@ -147,7 +147,7 @@ var Treble = (function () {
|
|
|
147
147
|
};
|
|
148
148
|
this._api = api_1.default;
|
|
149
149
|
this.wishlist = (0, wishlist_1.default)(orgId);
|
|
150
|
-
this._snapshots =
|
|
150
|
+
this._snapshots = snapshots_1.default;
|
|
151
151
|
this.takeSnapshots = this._snapshots.takeSnapshots;
|
|
152
152
|
this._player = player.enableApi(types_1.PRIVATE_APIS.PLAYER);
|
|
153
153
|
this._debugMode = constants_1.TREBLE_DEBUG;
|
package/dist/Treble/index.d.ts
CHANGED
package/dist/Treble/index.js
CHANGED
|
@@ -19,6 +19,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
var Treble_1 = __importDefault(require("./Treble"));
|
|
21
21
|
__exportStar(require("./Treble"), exports);
|
|
22
|
-
__exportStar(require("./
|
|
22
|
+
__exportStar(require("./snapshots"), exports);
|
|
23
23
|
__exportStar(require("./wishlist"), exports);
|
|
24
24
|
exports.default = Treble_1.default;
|
|
@@ -17,6 +17,6 @@ interface IGetSnapshot {
|
|
|
17
17
|
}
|
|
18
18
|
declare const _default: {
|
|
19
19
|
getSnapshot: ({ size, format }: IGetSnapshot) => Promise<string>;
|
|
20
|
-
takeSnapshots: (camerasList: ISnapshotsCameras, snapshotsConfig: ITakeSnapshotsConfig) => Promise<void | string[] |
|
|
20
|
+
takeSnapshots: (camerasList: ISnapshotsCameras, snapshotsConfig: ITakeSnapshotsConfig) => Promise<void | string[] | Blob[] | File[] | null>;
|
|
21
21
|
};
|
|
22
22
|
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare type ISnapshotsCameras = undefined | string | Array<string | undefined>;
|
|
2
|
+
interface SnapshotSize {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ITakeSnapshotsConfig {
|
|
7
|
+
attributeName?: string;
|
|
8
|
+
output?: string;
|
|
9
|
+
format?: string;
|
|
10
|
+
size?: SnapshotSize;
|
|
11
|
+
filename?: string;
|
|
12
|
+
useStage?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface IGetSnapshot {
|
|
15
|
+
size: SnapshotSize;
|
|
16
|
+
format: string;
|
|
17
|
+
}
|
|
18
|
+
declare const _default: {
|
|
19
|
+
getSnapshot: ({ size, format }: IGetSnapshot) => Promise<string>;
|
|
20
|
+
takeSnapshots: (camerasList: ISnapshotsCameras, snapshotsConfig: ITakeSnapshotsConfig) => Promise<void | string[] | Blob[] | File[] | null>;
|
|
21
|
+
};
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var api_1 = __importDefault(require("../api"));
|
|
43
|
+
var constants_1 = require("../constants");
|
|
44
|
+
var types_1 = require("../types");
|
|
45
|
+
var utils_1 = require("../utils");
|
|
46
|
+
var DEFAULT_CAMERA_CONFIG = {
|
|
47
|
+
filename: "snapshot",
|
|
48
|
+
size: { width: 1920, height: 1080 },
|
|
49
|
+
format: types_1.SNAPSHOT_FORMATS.PNG,
|
|
50
|
+
attributeName: constants_1.ATTRIBUTES_RESERVED.camera,
|
|
51
|
+
output: types_1.SNAPSHOT_OUTPUTS.BLOB,
|
|
52
|
+
useStage: false,
|
|
53
|
+
};
|
|
54
|
+
var cameraValues;
|
|
55
|
+
var getCameraValue = function (configurator, cameraAttrName) {
|
|
56
|
+
if (cameraAttrName === void 0) { cameraAttrName = constants_1.ATTRIBUTES_RESERVED.camera; }
|
|
57
|
+
var attribute = configurator
|
|
58
|
+
.getDisplayAttributes()
|
|
59
|
+
.find(function (el) { return el.name === cameraAttrName; });
|
|
60
|
+
if (!attribute)
|
|
61
|
+
return undefined;
|
|
62
|
+
return attribute.value;
|
|
63
|
+
};
|
|
64
|
+
var getCamerasMap = function (configurator, cameraAttrName) {
|
|
65
|
+
if (cameraAttrName === void 0) { cameraAttrName = constants_1.ATTRIBUTES_RESERVED.camera; }
|
|
66
|
+
if (cameraValues)
|
|
67
|
+
return cameraValues;
|
|
68
|
+
var attribute = configurator
|
|
69
|
+
.getDisplayAttributes()
|
|
70
|
+
.find(function (el) { return el.name === cameraAttrName; });
|
|
71
|
+
if (!attribute) {
|
|
72
|
+
cameraValues = {};
|
|
73
|
+
return cameraValues;
|
|
74
|
+
}
|
|
75
|
+
var cameraAttribute = attribute;
|
|
76
|
+
cameraAttribute.values.forEach(function (el) {
|
|
77
|
+
var _a;
|
|
78
|
+
var value = cameraAttribute.type === types_1.ATTRIBUTE_TYPES.ASSET
|
|
79
|
+
? { assetId: el.assetId }
|
|
80
|
+
: el.value;
|
|
81
|
+
cameraValues = Object.assign(cameraValues || {}, (_a = {},
|
|
82
|
+
_a[el.label] = value,
|
|
83
|
+
_a));
|
|
84
|
+
}, {});
|
|
85
|
+
return cameraValues;
|
|
86
|
+
};
|
|
87
|
+
var getSnapshot = function (_a) {
|
|
88
|
+
var size = _a.size, format = _a.format;
|
|
89
|
+
return window.threekit.player.snapshotAsync({
|
|
90
|
+
size: size,
|
|
91
|
+
mimeType: "image/".concat(types_1.SNAPSHOT_FORMATS[format]),
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
var getSnapshots = function (cameras, snapshotConfig) { return __awaiter(void 0, void 0, void 0, function () {
|
|
95
|
+
var attributeName, size, format, configurator, _a, camerasMap, snapshots;
|
|
96
|
+
return __generator(this, function (_b) {
|
|
97
|
+
switch (_b.label) {
|
|
98
|
+
case 0:
|
|
99
|
+
attributeName = snapshotConfig.attributeName || DEFAULT_CAMERA_CONFIG.attributeName;
|
|
100
|
+
size = snapshotConfig.size || DEFAULT_CAMERA_CONFIG.size;
|
|
101
|
+
format = snapshotConfig.format || DEFAULT_CAMERA_CONFIG.format;
|
|
102
|
+
if (!(snapshotConfig === null || snapshotConfig === void 0 ? void 0 : snapshotConfig.useStage)) return [3, 2];
|
|
103
|
+
return [4, window.threekit.player.getStageConfigurator()];
|
|
104
|
+
case 1:
|
|
105
|
+
_a = _b.sent();
|
|
106
|
+
return [3, 3];
|
|
107
|
+
case 2:
|
|
108
|
+
_a = window.threekit.configurator;
|
|
109
|
+
_b.label = 3;
|
|
110
|
+
case 3:
|
|
111
|
+
configurator = _a;
|
|
112
|
+
camerasMap = getCamerasMap(configurator, attributeName);
|
|
113
|
+
if (!camerasMap)
|
|
114
|
+
return [2, Promise.resolve([])];
|
|
115
|
+
snapshots = [];
|
|
116
|
+
return [2, cameras.reduce(function (snapshotPromise, camera) {
|
|
117
|
+
return snapshotPromise.then(function () {
|
|
118
|
+
return new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
|
|
119
|
+
var snapshotStr;
|
|
120
|
+
var _a;
|
|
121
|
+
return __generator(this, function (_b) {
|
|
122
|
+
switch (_b.label) {
|
|
123
|
+
case 0:
|
|
124
|
+
if (!camera) return [3, 2];
|
|
125
|
+
return [4, configurator.setConfiguration((_a = {},
|
|
126
|
+
_a[attributeName] = camerasMap[camera],
|
|
127
|
+
_a))];
|
|
128
|
+
case 1:
|
|
129
|
+
_b.sent();
|
|
130
|
+
_b.label = 2;
|
|
131
|
+
case 2: return [4, getSnapshot({ size: size, format: format })];
|
|
132
|
+
case 3:
|
|
133
|
+
snapshotStr = _b.sent();
|
|
134
|
+
snapshots.push(snapshotStr);
|
|
135
|
+
resolve(snapshots);
|
|
136
|
+
return [2];
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}); });
|
|
140
|
+
});
|
|
141
|
+
}, Promise.resolve(snapshots))];
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}); };
|
|
145
|
+
var takeSnapshots = function (camerasList, snapshotsConfig) { return __awaiter(void 0, void 0, void 0, function () {
|
|
146
|
+
var filename, size, format, attributeName, output, configurator, _a, cameras, snapshotsRaw, snapshotData, camerasMap_1, currentCamera, cameraPosition, _b, attachments, response, urlsArray, snapshotBlobs, snapshotFiles;
|
|
147
|
+
var _c;
|
|
148
|
+
return __generator(this, function (_d) {
|
|
149
|
+
switch (_d.label) {
|
|
150
|
+
case 0:
|
|
151
|
+
filename = (snapshotsConfig === null || snapshotsConfig === void 0 ? void 0 : snapshotsConfig.filename) || DEFAULT_CAMERA_CONFIG.filename;
|
|
152
|
+
size = (snapshotsConfig === null || snapshotsConfig === void 0 ? void 0 : snapshotsConfig.size) || DEFAULT_CAMERA_CONFIG.size;
|
|
153
|
+
format = (snapshotsConfig === null || snapshotsConfig === void 0 ? void 0 : snapshotsConfig.format) || DEFAULT_CAMERA_CONFIG.format;
|
|
154
|
+
attributeName = (snapshotsConfig === null || snapshotsConfig === void 0 ? void 0 : snapshotsConfig.attributeName) || DEFAULT_CAMERA_CONFIG.attributeName;
|
|
155
|
+
output = (snapshotsConfig === null || snapshotsConfig === void 0 ? void 0 : snapshotsConfig.output) || DEFAULT_CAMERA_CONFIG.output;
|
|
156
|
+
if (!(snapshotsConfig === null || snapshotsConfig === void 0 ? void 0 : snapshotsConfig.useStage)) return [3, 2];
|
|
157
|
+
return [4, window.threekit.player.getStageConfigurator()];
|
|
158
|
+
case 1:
|
|
159
|
+
_a = _d.sent();
|
|
160
|
+
return [3, 3];
|
|
161
|
+
case 2:
|
|
162
|
+
_a = window.threekit.configurator;
|
|
163
|
+
_d.label = 3;
|
|
164
|
+
case 3:
|
|
165
|
+
configurator = _a;
|
|
166
|
+
cameras = Array.isArray(camerasList) ? camerasList : [camerasList];
|
|
167
|
+
if (!(cameras.length === 1 && cameras[0] === undefined)) return [3, 5];
|
|
168
|
+
return [4, getSnapshot({ size: size, format: format })];
|
|
169
|
+
case 4:
|
|
170
|
+
snapshotData = _d.sent();
|
|
171
|
+
snapshotsRaw = [snapshotData];
|
|
172
|
+
return [3, 8];
|
|
173
|
+
case 5:
|
|
174
|
+
camerasMap_1 = getCamerasMap(configurator, attributeName);
|
|
175
|
+
if (!camerasMap_1)
|
|
176
|
+
return [2, null];
|
|
177
|
+
cameras = cameras.filter(function (el) { return el === undefined || Object.keys(camerasMap_1).includes(el); });
|
|
178
|
+
currentCamera = getCameraValue(configurator, attributeName);
|
|
179
|
+
cameraPosition = (0, utils_1.getCameraPosition)(window.threekit.player.camera);
|
|
180
|
+
return [4, getSnapshots(cameras, snapshotsConfig)];
|
|
181
|
+
case 6:
|
|
182
|
+
snapshotsRaw = _d.sent();
|
|
183
|
+
return [4, configurator.setConfiguration((_c = {},
|
|
184
|
+
_c[attributeName] = currentCamera,
|
|
185
|
+
_c))];
|
|
186
|
+
case 7:
|
|
187
|
+
_d.sent();
|
|
188
|
+
(0, utils_1.setCameraPosition)(window.threekit.player.camera, cameraPosition);
|
|
189
|
+
_d.label = 8;
|
|
190
|
+
case 8:
|
|
191
|
+
_b = output;
|
|
192
|
+
switch (_b) {
|
|
193
|
+
case types_1.SNAPSHOT_OUTPUTS.URL: return [3, 9];
|
|
194
|
+
case types_1.SNAPSHOT_OUTPUTS.DOWNLOAD: return [3, 11];
|
|
195
|
+
case types_1.SNAPSHOT_OUTPUTS.BLOB: return [3, 12];
|
|
196
|
+
case types_1.SNAPSHOT_OUTPUTS.FILE: return [3, 13];
|
|
197
|
+
case types_1.SNAPSHOT_OUTPUTS.DATA_URL: return [3, 14];
|
|
198
|
+
}
|
|
199
|
+
return [3, 14];
|
|
200
|
+
case 9:
|
|
201
|
+
attachments = snapshotsRaw.reduce(function (output, el, idx) {
|
|
202
|
+
var _a;
|
|
203
|
+
var cameraName = (camerasList === null || camerasList === void 0 ? void 0 : camerasList[idx])
|
|
204
|
+
? (0, utils_1.regularToKebabCase)(camerasList[idx] || 'default')
|
|
205
|
+
: filename;
|
|
206
|
+
var preppedFilename = cameraName === filename
|
|
207
|
+
? "".concat(filename, ".").concat(format)
|
|
208
|
+
: "".concat(filename, "-").concat(cameraName, ".").concat(format);
|
|
209
|
+
var file = (0, utils_1.dataURItoFile)(el, preppedFilename);
|
|
210
|
+
return Object.assign(output, (_a = {}, _a[cameraName] = file, _a));
|
|
211
|
+
}, {});
|
|
212
|
+
return [4, api_1.default.configurations.save({
|
|
213
|
+
assetId: window.threekit.player.assetId,
|
|
214
|
+
configuration: window.threekit.configurator.getConfiguration(),
|
|
215
|
+
attachments: attachments,
|
|
216
|
+
})];
|
|
217
|
+
case 10:
|
|
218
|
+
response = _d.sent();
|
|
219
|
+
urlsArray = Object.values(response.data.attachments);
|
|
220
|
+
return [2, Promise.resolve(urlsArray)];
|
|
221
|
+
case 11:
|
|
222
|
+
snapshotsRaw.forEach(function (snapshotBlob, idx) {
|
|
223
|
+
var cameraName = (camerasList === null || camerasList === void 0 ? void 0 : camerasList[idx])
|
|
224
|
+
? "-".concat((0, utils_1.regularToKebabCase)(camerasList[idx] || 'default'))
|
|
225
|
+
: '';
|
|
226
|
+
(0, utils_1.downloadSnapshot)(snapshotBlob, "".concat(filename).concat(cameraName, ".").concat(format));
|
|
227
|
+
});
|
|
228
|
+
return [2, Promise.resolve()];
|
|
229
|
+
case 12:
|
|
230
|
+
snapshotBlobs = snapshotsRaw.map(function (el) { return (0, utils_1.dataURItoBlob)(el); });
|
|
231
|
+
return [2, Promise.resolve(snapshotBlobs)];
|
|
232
|
+
case 13:
|
|
233
|
+
snapshotFiles = snapshotsRaw.map(function (el, idx) {
|
|
234
|
+
var cameraName = (camerasList === null || camerasList === void 0 ? void 0 : camerasList[idx])
|
|
235
|
+
? "-".concat((0, utils_1.regularToKebabCase)(camerasList[idx] || 'default'))
|
|
236
|
+
: '';
|
|
237
|
+
return (0, utils_1.dataURItoFile)(el, "".concat(filename).concat(cameraName, ".").concat(format));
|
|
238
|
+
});
|
|
239
|
+
return [2, Promise.resolve(snapshotFiles)];
|
|
240
|
+
case 14: return [2, Promise.resolve(snapshotsRaw)];
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
}); };
|
|
244
|
+
exports.default = {
|
|
245
|
+
getSnapshot: getSnapshot,
|
|
246
|
+
takeSnapshots: takeSnapshots,
|
|
247
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IConfigurationResponse } from '../http/configurations';
|
|
2
2
|
import { ISaveConfiguration } from '../api/configurations';
|
|
3
|
-
export type WishlistArray = Array<IConfigurationResponse>;
|
|
3
|
+
export declare type WishlistArray = Array<IConfigurationResponse>;
|
|
4
4
|
export interface IWishlist {
|
|
5
5
|
getWishlist(): Promise<Array<IConfigurationResponse>>;
|
|
6
6
|
addItem(config?: Omit<ISaveConfiguration, 'configuration'>): Promise<Array<IConfigurationResponse>>;
|
package/dist/Treble/wishlist.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/dist/api/catalog.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/dist/api/datatables.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/dist/api/orders.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/dist/api/price.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/dist/api/products.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type ITranslation = Record<string, string | undefined>;
|
|
2
|
-
export type ITranslationMap = Record<string, ITranslation>;
|
|
1
|
+
declare type ITranslation = Record<string, string | undefined>;
|
|
2
|
+
export declare type ITranslationMap = Record<string, ITranslation>;
|
|
3
3
|
export declare const fetchTranslations: () => Promise<ITranslationMap>;
|
|
4
4
|
export {};
|
package/dist/api/products.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
export type BUTTON_TYPES = 'hollow' | 'standard' | 'accent' | 'primary' | 'threekit';
|
|
4
|
-
export type BUTTON_SHAPES = 'round' | 'shape';
|
|
3
|
+
export declare type BUTTON_TYPES = 'hollow' | 'standard' | 'accent' | 'primary' | 'threekit';
|
|
4
|
+
export declare type BUTTON_SHAPES = 'round' | 'shape';
|
|
5
5
|
interface IButton {
|
|
6
6
|
type: BUTTON_TYPES;
|
|
7
7
|
icon?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DraggableIndicatorProps } from './index';
|
|
2
|
-
type HandWrapperProps = Pick<DraggableIndicatorProps, 'color' | 'duration'>;
|
|
2
|
+
declare type HandWrapperProps = Pick<DraggableIndicatorProps, 'color' | 'duration'>;
|
|
3
3
|
export declare const Wrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
4
4
|
export declare const HandWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, HandWrapperProps, never>;
|
|
5
5
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PlayerLoadingSpinnerProps } from './index';
|
|
2
|
-
type WrapperProps = Pick<PlayerLoadingSpinnerProps, 'duration' | 'size'>;
|
|
2
|
+
declare type WrapperProps = Pick<PlayerLoadingSpinnerProps, 'duration' | 'size'>;
|
|
3
3
|
export declare const Wrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, WrapperProps, never>;
|
|
4
4
|
export {};
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
38
|
function step(op) {
|
|
39
39
|
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (
|
|
40
|
+
while (_) try {
|
|
41
41
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
42
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
43
|
switch (op[0]) {
|
|
@@ -37,13 +37,14 @@ var GlobalStyles_styles_1 = __importDefault(require("./GlobalStyles.styles"));
|
|
|
37
37
|
var DevTools_1 = __importDefault(require("../DevTools"));
|
|
38
38
|
var App = function (props) {
|
|
39
39
|
var dispatch = (0, store_1.useThreekitDispatch)();
|
|
40
|
-
var playerConfig = props.playerConfig, assetId = props.assetId, productId = props.productId, project = props.project, locale = props.locale, threekitEnv = props.threekitEnv, eventHandlers = props.eventHandlers;
|
|
40
|
+
var playerConfig = props.playerConfig, assetId = props.assetId, customId = props.customId, productId = props.productId, project = props.project, locale = props.locale, threekitEnv = props.threekitEnv, eventHandlers = props.eventHandlers;
|
|
41
41
|
(0, react_1.useEffect)(function () {
|
|
42
42
|
var init = function () {
|
|
43
43
|
dispatch((0, treble_1.launch)({
|
|
44
44
|
playerConfig: playerConfig,
|
|
45
45
|
productId: productId,
|
|
46
46
|
assetId: assetId,
|
|
47
|
+
customId: customId,
|
|
47
48
|
project: project,
|
|
48
49
|
locale: locale,
|
|
49
50
|
threekitEnv: threekitEnv,
|
|
@@ -59,7 +60,7 @@ var ThreekitProvider = function (props) {
|
|
|
59
60
|
return (react_1.default.createElement(react_redux_1.Provider, { store: (0, store_1.default)(props.reducer) },
|
|
60
61
|
react_1.default.createElement(styled_components_1.ThemeProvider, { theme: theme_1.default },
|
|
61
62
|
react_1.default.createElement(GlobalStyles_styles_1.default, null),
|
|
62
|
-
react_1.default.createElement(App, { locale: props.locale, assetId: props.assetId, productId: props.productId, project: props.project, playerConfig: props.playerConfig, threekitEnv: props.threekitEnv, eventHandlers: props.eventHandlers }, props.children),
|
|
63
|
+
react_1.default.createElement(App, { locale: props.locale, assetId: props.assetId, customId: props.customId, productId: props.productId, project: props.project, playerConfig: props.playerConfig, threekitEnv: props.threekitEnv, eventHandlers: props.eventHandlers }, props.children),
|
|
63
64
|
constants_1.TREBLE_DEBUG ? null : react_1.default.createElement(DevTools_1.default, null))));
|
|
64
65
|
};
|
|
65
66
|
exports.default = ThreekitProvider;
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
38
|
function step(op) {
|
|
39
39
|
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (
|
|
40
|
+
while (_) try {
|
|
41
41
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
42
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
43
|
switch (op[0]) {
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
38
|
function step(op) {
|
|
39
39
|
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (
|
|
40
|
+
while (_) try {
|
|
41
41
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
42
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
43
|
switch (op[0]) {
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
38
|
function step(op) {
|
|
39
39
|
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (
|
|
40
|
+
while (_) try {
|
|
41
41
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
42
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
43
|
switch (op[0]) {
|
package/dist/connection.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export interface IConnectionConfig {
|
|
|
3
3
|
authToken?: string;
|
|
4
4
|
orgId?: string;
|
|
5
5
|
assetId?: string;
|
|
6
|
+
customId?: string;
|
|
6
7
|
threekitDomain?: string;
|
|
7
8
|
serverUrl?: string;
|
|
8
9
|
cacheParameters?: ICacheParameters;
|
|
@@ -11,15 +12,17 @@ export declare class ThreekitConnection {
|
|
|
11
12
|
_authToken: string;
|
|
12
13
|
_orgId: string;
|
|
13
14
|
_assetId: string;
|
|
15
|
+
_customId: string;
|
|
14
16
|
_threekitDomain: string;
|
|
15
17
|
_serverUrl: string;
|
|
16
18
|
_cacheParameters?: ICacheParameters;
|
|
17
19
|
constructor();
|
|
18
|
-
connect(config: IConnectionConfig):
|
|
20
|
+
connect(config: IConnectionConfig): void;
|
|
19
21
|
getConnection(): {
|
|
20
22
|
authToken: string;
|
|
21
23
|
orgId: string;
|
|
22
24
|
assetId: string;
|
|
25
|
+
customId: string;
|
|
23
26
|
threekitDomain: string;
|
|
24
27
|
serverUrl: string;
|
|
25
28
|
cacheParameters: ICacheParameters | undefined;
|