@threekit-tools/treble 0.0.90-next-01 → 0.0.90-next-03
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/hooks/useRoomBuilder/constants.d.ts +2 -26
- package/dist/hooks/useRoomBuilder/constants.js +66 -45
- package/dist/hooks/useRoomBuilder/dataHandlers.js +23 -19
- package/dist/hooks/useRoomBuilder/index.js +8 -14
- package/dist/hooks/useRoomBuilder/types.d.ts +23 -8
- package/dist/icons/types.d.ts +1 -1
- package/dist/store/treble.js +4 -3
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,29 +1,5 @@
|
|
|
1
|
-
import { ICoordinate2D } from './types';
|
|
2
|
-
export declare
|
|
3
|
-
WALLS = "_tkSpace_walls",
|
|
4
|
-
WINDOWS = "_tkSpace_windows",
|
|
5
|
-
DOORS = "_tkSpace_doors",
|
|
6
|
-
OPENINGS = "_tkSpace_openings"
|
|
7
|
-
}
|
|
8
|
-
export declare enum IWallAttributes {
|
|
9
|
-
START_X = "_tkSpace_startX",
|
|
10
|
-
START_Y = "_tkSpace_startY",
|
|
11
|
-
START_Z = "_tkSpace_startZ",
|
|
12
|
-
END_X = "_tkSpace_endX",
|
|
13
|
-
END_Y = "_tkSpace_endY",
|
|
14
|
-
END_Z = "_tkSpace_endZ",
|
|
15
|
-
CONNECTIONS = "_tkSpace_connections",
|
|
16
|
-
WALL_HEIGHT = "_tkSpace_wallHeight",
|
|
17
|
-
WALL_THICKNESS = "_tkSpace_wallThickness"
|
|
18
|
-
}
|
|
19
|
-
export declare enum IFeatureAttribute {
|
|
20
|
-
POSITION_X = "_tkSpace_offsetX",
|
|
21
|
-
POSITION_Y = "_tkSpace_offsetY",
|
|
22
|
-
POSITION_Z = "_tkSpace_offsetZ",
|
|
23
|
-
CONNECTED_TO = "_tkSpace_connectedTo",
|
|
24
|
-
FEATURE_HEIGHT = "_tkSpace_featureHeight",
|
|
25
|
-
FEATURE_LENGTH = "_tkSpace_featureWidth"
|
|
26
|
-
}
|
|
1
|
+
import { ICoordinate2D, IRoomBuilderAttributes } from './types';
|
|
2
|
+
export declare const attributeNameDefaults: IRoomBuilderAttributes;
|
|
27
3
|
export declare const SCALE = 0.02;
|
|
28
4
|
export declare const SNAP_PROXIMITY = 16;
|
|
29
5
|
export declare const ZOOM_MAX = 100;
|
|
@@ -1,36 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _a, _b, _c;
|
|
2
|
+
var _a, _b, _c, _d;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.WALL_SNAP_DISTANCE = exports.UI_ANCHOR_DISTANCE = exports.FEATURE_LENGTH = exports.FEATURE_LABELS = exports.UNIT_FACTORS = exports.UNIT_LABELS = exports.WALL_PADDING_FOR_FEATURE = exports.MIN_WALL_LENGTH = exports.TRANSLATE_DEFAULT = exports.TRANSLATE_MIN = exports.TRANSLATE_MAX = exports.ZOOM_DEFAULT = exports.ZOOM_MIN = exports.ZOOM_MAX = exports.SNAP_PROXIMITY = exports.SCALE = exports.
|
|
4
|
+
exports.WALL_SNAP_DISTANCE = exports.UI_ANCHOR_DISTANCE = exports.FEATURE_LENGTH = exports.FEATURE_LABELS = exports.UNIT_FACTORS = exports.UNIT_LABELS = exports.WALL_PADDING_FOR_FEATURE = exports.MIN_WALL_LENGTH = exports.TRANSLATE_DEFAULT = exports.TRANSLATE_MIN = exports.TRANSLATE_MAX = exports.ZOOM_DEFAULT = exports.ZOOM_MIN = exports.ZOOM_MAX = exports.SNAP_PROXIMITY = exports.SCALE = exports.attributeNameDefaults = void 0;
|
|
5
5
|
var types_1 = require("./types");
|
|
6
|
-
var
|
|
7
|
-
(function (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})(
|
|
13
|
-
var
|
|
14
|
-
(function (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})(
|
|
25
|
-
var
|
|
26
|
-
(function (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})(
|
|
6
|
+
var RoomBuilderAttributes;
|
|
7
|
+
(function (RoomBuilderAttributes) {
|
|
8
|
+
RoomBuilderAttributes["WALLS"] = "_tkSpace_walls";
|
|
9
|
+
RoomBuilderAttributes["WINDOWS"] = "_tkSpace_windows";
|
|
10
|
+
RoomBuilderAttributes["DOORS"] = "_tkSpace_doors";
|
|
11
|
+
RoomBuilderAttributes["OPENINGS"] = "_tkSpace_openings";
|
|
12
|
+
})(RoomBuilderAttributes || (RoomBuilderAttributes = {}));
|
|
13
|
+
var WallAttributes;
|
|
14
|
+
(function (WallAttributes) {
|
|
15
|
+
WallAttributes["START_X"] = "_tkSpace_startX";
|
|
16
|
+
WallAttributes["START_Y"] = "_tkSpace_startY";
|
|
17
|
+
WallAttributes["START_Z"] = "_tkSpace_startZ";
|
|
18
|
+
WallAttributes["END_X"] = "_tkSpace_endX";
|
|
19
|
+
WallAttributes["END_Y"] = "_tkSpace_endY";
|
|
20
|
+
WallAttributes["END_Z"] = "_tkSpace_endZ";
|
|
21
|
+
WallAttributes["CONNECTIONS"] = "_tkSpace_connections";
|
|
22
|
+
WallAttributes["WALL_HEIGHT"] = "_tkSpace_wallHeight";
|
|
23
|
+
WallAttributes["WALL_THICKNESS"] = "_tkSpace_wallThickness";
|
|
24
|
+
})(WallAttributes || (WallAttributes = {}));
|
|
25
|
+
var FeatureAttribute;
|
|
26
|
+
(function (FeatureAttribute) {
|
|
27
|
+
FeatureAttribute["POSITION_X"] = "_tkSpace_offsetX";
|
|
28
|
+
FeatureAttribute["POSITION_Y"] = "_tkSpace_offsetY";
|
|
29
|
+
FeatureAttribute["POSITION_Z"] = "_tkSpace_offsetZ";
|
|
30
|
+
FeatureAttribute["CONNECTED_TO"] = "_tkSpace_connectedTo";
|
|
31
|
+
FeatureAttribute["FEATURE_HEIGHT"] = "_tkSpace_featureHeight";
|
|
32
|
+
FeatureAttribute["FEATURE_LENGTH"] = "_tkSpace_featureWidth";
|
|
33
|
+
})(FeatureAttribute || (FeatureAttribute = {}));
|
|
34
|
+
exports.attributeNameDefaults = (_a = {},
|
|
35
|
+
_a[types_1.IElements.WALL] = RoomBuilderAttributes.WALLS,
|
|
36
|
+
_a[types_1.IElements.WINDOW] = RoomBuilderAttributes.WINDOWS,
|
|
37
|
+
_a[types_1.IElements.OPENING] = RoomBuilderAttributes.OPENINGS,
|
|
38
|
+
_a[types_1.IElements.DOOR] = RoomBuilderAttributes.DOORS,
|
|
39
|
+
_a.featurePositionX = FeatureAttribute.POSITION_X,
|
|
40
|
+
_a.featurePositionY = FeatureAttribute.POSITION_Y,
|
|
41
|
+
_a.featurePositionZ = FeatureAttribute.POSITION_Z,
|
|
42
|
+
_a.featureConnectedTo = FeatureAttribute.CONNECTED_TO,
|
|
43
|
+
_a.featureHeight = FeatureAttribute.FEATURE_HEIGHT,
|
|
44
|
+
_a.featureLength = FeatureAttribute.FEATURE_LENGTH,
|
|
45
|
+
_a.wallStartX = WallAttributes.START_X,
|
|
46
|
+
_a.wallStartY = WallAttributes.START_Y,
|
|
47
|
+
_a.wallStartZ = WallAttributes.START_Z,
|
|
48
|
+
_a.wallEndX = WallAttributes.END_X,
|
|
49
|
+
_a.wallEndY = WallAttributes.END_Y,
|
|
50
|
+
_a.wallEndZ = WallAttributes.END_Z,
|
|
51
|
+
_a.wallConnections = WallAttributes.CONNECTIONS,
|
|
52
|
+
_a.wallThickness = WallAttributes.WALL_THICKNESS,
|
|
53
|
+
_a.wallHeight = WallAttributes.WALL_HEIGHT,
|
|
54
|
+
_a);
|
|
34
55
|
exports.SCALE = 0.02;
|
|
35
56
|
exports.SNAP_PROXIMITY = 16;
|
|
36
57
|
exports.ZOOM_MAX = 100;
|
|
@@ -41,23 +62,23 @@ exports.TRANSLATE_MIN = [400, 400];
|
|
|
41
62
|
exports.TRANSLATE_DEFAULT = [-200, -200];
|
|
42
63
|
exports.MIN_WALL_LENGTH = 50;
|
|
43
64
|
exports.WALL_PADDING_FOR_FEATURE = 20;
|
|
44
|
-
exports.UNIT_LABELS = (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
_a);
|
|
50
|
-
exports.UNIT_FACTORS = (_b = {},
|
|
51
|
-
_b[types_1.IUnits.CM] = 100,
|
|
52
|
-
_b[types_1.IUnits.METER] = 1,
|
|
53
|
-
_b[types_1.IUnits.FEET] = 3.28084,
|
|
54
|
-
_b[types_1.IUnits.INCH] = 39.37,
|
|
65
|
+
exports.UNIT_LABELS = (_b = {},
|
|
66
|
+
_b[types_1.IUnits.FEET] = 'ft',
|
|
67
|
+
_b[types_1.IUnits.METER] = 'm',
|
|
68
|
+
_b[types_1.IUnits.INCH] = 'in',
|
|
69
|
+
_b[types_1.IUnits.CM] = 'cm',
|
|
55
70
|
_b);
|
|
56
|
-
exports.
|
|
57
|
-
_c[types_1.
|
|
58
|
-
_c[types_1.
|
|
59
|
-
_c[types_1.
|
|
71
|
+
exports.UNIT_FACTORS = (_c = {},
|
|
72
|
+
_c[types_1.IUnits.CM] = 100,
|
|
73
|
+
_c[types_1.IUnits.METER] = 1,
|
|
74
|
+
_c[types_1.IUnits.FEET] = 3.28084,
|
|
75
|
+
_c[types_1.IUnits.INCH] = 39.37,
|
|
60
76
|
_c);
|
|
77
|
+
exports.FEATURE_LABELS = (_d = {},
|
|
78
|
+
_d[types_1.IElements.WINDOW] = 'Window',
|
|
79
|
+
_d[types_1.IElements.DOOR] = 'Door',
|
|
80
|
+
_d[types_1.IElements.OPENING] = 'Opening',
|
|
81
|
+
_d);
|
|
61
82
|
exports.FEATURE_LENGTH = 120;
|
|
62
83
|
exports.UI_ANCHOR_DISTANCE = -60;
|
|
63
84
|
exports.WALL_SNAP_DISTANCE = 12;
|
|
@@ -26,15 +26,16 @@ function prepWallsAndVerticesIncoming(wallsAttribute, config) {
|
|
|
26
26
|
var _a;
|
|
27
27
|
var walls = [];
|
|
28
28
|
var vertices = {};
|
|
29
|
+
var attributeName = config.attributes;
|
|
29
30
|
((wallsAttribute === null || wallsAttribute === void 0 ? void 0 : wallsAttribute.value) || []).forEach(function (_a, i) {
|
|
30
31
|
var assetId = _a.assetId, configuration = _a.configuration;
|
|
31
32
|
var point1 = [
|
|
32
|
-
(configuration === null || configuration === void 0 ? void 0 : configuration[
|
|
33
|
-
(configuration === null || configuration === void 0 ? void 0 : configuration[
|
|
33
|
+
(configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.wallStartX]) / config.config.scale,
|
|
34
|
+
(configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.wallStartZ]) / config.config.scale,
|
|
34
35
|
];
|
|
35
36
|
var point2 = [
|
|
36
|
-
(configuration === null || configuration === void 0 ? void 0 : configuration[
|
|
37
|
-
(configuration === null || configuration === void 0 ? void 0 : configuration[
|
|
37
|
+
(configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.wallEndX]) / config.config.scale,
|
|
38
|
+
(configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.wallEndZ]) / config.config.scale,
|
|
38
39
|
];
|
|
39
40
|
var point1Str = JSON.stringify(point1);
|
|
40
41
|
var point2Str = JSON.stringify(point2);
|
|
@@ -51,8 +52,8 @@ function prepWallsAndVerticesIncoming(wallsAttribute, config) {
|
|
|
51
52
|
assetId: assetId,
|
|
52
53
|
line: [point1, point2],
|
|
53
54
|
path: (0, geometry_1.addThicknessToLine)([point1, point2], config.config.styles.wall.thickness),
|
|
54
|
-
height: configuration === null || configuration === void 0 ? void 0 : configuration[
|
|
55
|
-
thickness: configuration === null || configuration === void 0 ? void 0 : configuration[
|
|
55
|
+
height: configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.wallHeight],
|
|
56
|
+
thickness: configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.wallThickness],
|
|
56
57
|
connections: connections,
|
|
57
58
|
});
|
|
58
59
|
});
|
|
@@ -60,13 +61,14 @@ function prepWallsAndVerticesIncoming(wallsAttribute, config) {
|
|
|
60
61
|
}
|
|
61
62
|
function prepFeatureIncoming(walls, featureAttribute, config) {
|
|
62
63
|
var _a;
|
|
64
|
+
var attributeName = config.attributes;
|
|
63
65
|
var feature = [];
|
|
64
66
|
(_a = featureAttribute === null || featureAttribute === void 0 ? void 0 : featureAttribute.value) === null || _a === void 0 ? void 0 : _a.forEach(function (_a) {
|
|
65
67
|
var assetId = _a.assetId, configuration = _a.configuration;
|
|
66
|
-
var offset = (configuration === null || configuration === void 0 ? void 0 : configuration[
|
|
67
|
-
var length = (configuration === null || configuration === void 0 ? void 0 : configuration[
|
|
68
|
+
var offset = (configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.featurePositionX]) / config.config.scale;
|
|
69
|
+
var length = (configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.featureLength]) / config.config.scale ||
|
|
68
70
|
constants_1.FEATURE_LENGTH;
|
|
69
|
-
var connectedTo = (configuration === null || configuration === void 0 ? void 0 : configuration[
|
|
71
|
+
var connectedTo = (configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.featureConnectedTo]) || '';
|
|
70
72
|
var wallIndex = prepConnectionIncoming(connectedTo)[1];
|
|
71
73
|
var featureLine = (0, geometry_1.getLineAtOffsetOnLineSegment)(walls[wallIndex].line, offset, length);
|
|
72
74
|
var path = (0, geometry_1.addThicknessToLine)(featureLine, config.config.styles.feature.thickness);
|
|
@@ -92,6 +94,7 @@ function prepAttributesIncoming(attributes, config) {
|
|
|
92
94
|
}
|
|
93
95
|
exports.prepAttributesIncoming = prepAttributesIncoming;
|
|
94
96
|
function prepFeaturesOutgoing(features, config) {
|
|
97
|
+
var attributeName = config.attributes;
|
|
95
98
|
return features.map(function (feature) {
|
|
96
99
|
var _a, _b;
|
|
97
100
|
var assetId = feature.assetId, offset = feature.offset, length = feature.length;
|
|
@@ -100,8 +103,8 @@ function prepFeaturesOutgoing(features, config) {
|
|
|
100
103
|
feature.connectedTo[1],
|
|
101
104
|
]);
|
|
102
105
|
var configuration = Object.entries((_a = {},
|
|
103
|
-
_a[
|
|
104
|
-
_a[
|
|
106
|
+
_a[attributeName.featureLength] = length,
|
|
107
|
+
_a[attributeName.featurePositionX] = offset,
|
|
105
108
|
_a)).reduce(function (output, _a) {
|
|
106
109
|
var _b;
|
|
107
110
|
var key = _a[0], value = _a[1];
|
|
@@ -109,7 +112,7 @@ function prepFeaturesOutgoing(features, config) {
|
|
|
109
112
|
_b[key] = value ? value * config.config.scale : value,
|
|
110
113
|
_b));
|
|
111
114
|
}, (_b = {},
|
|
112
|
-
_b[
|
|
115
|
+
_b[attributeName.featureConnectedTo] = connectedTo,
|
|
113
116
|
_b));
|
|
114
117
|
return {
|
|
115
118
|
assetId: assetId,
|
|
@@ -118,6 +121,7 @@ function prepFeaturesOutgoing(features, config) {
|
|
|
118
121
|
});
|
|
119
122
|
}
|
|
120
123
|
function prepWallsOutgoing(walls, config) {
|
|
124
|
+
var attributeName = config.attributes;
|
|
121
125
|
return walls.map(function (wall) {
|
|
122
126
|
var _a, _b;
|
|
123
127
|
var line = wall.line, height = wall.height, thickness = wall.thickness;
|
|
@@ -129,12 +133,12 @@ function prepWallsOutgoing(walls, config) {
|
|
|
129
133
|
});
|
|
130
134
|
var _c = line.flat(), x1 = _c[0], y1 = _c[1], x2 = _c[2], y2 = _c[3];
|
|
131
135
|
var configuration = Object.entries((_a = {},
|
|
132
|
-
_a[
|
|
133
|
-
_a[
|
|
134
|
-
_a[
|
|
135
|
-
_a[
|
|
136
|
-
_a[
|
|
137
|
-
_a[
|
|
136
|
+
_a[attributeName.wallStartX] = x1,
|
|
137
|
+
_a[attributeName.wallStartZ] = y1,
|
|
138
|
+
_a[attributeName.wallEndX] = x2,
|
|
139
|
+
_a[attributeName.wallEndZ] = y2,
|
|
140
|
+
_a[attributeName.wallHeight] = height,
|
|
141
|
+
_a[attributeName.wallThickness] = thickness,
|
|
138
142
|
_a)).reduce(function (output, _a) {
|
|
139
143
|
var _b;
|
|
140
144
|
var key = _a[0], value = _a[1];
|
|
@@ -142,7 +146,7 @@ function prepWallsOutgoing(walls, config) {
|
|
|
142
146
|
_b[key] = value ? value * config.config.scale : value,
|
|
143
147
|
_b));
|
|
144
148
|
}, (_b = {},
|
|
145
|
-
_b[
|
|
149
|
+
_b[attributeName.wallConnections] = JSON.stringify(connections),
|
|
146
150
|
_b));
|
|
147
151
|
return {
|
|
148
152
|
assetId: wall.assetId,
|
|
@@ -49,7 +49,6 @@ var roomBuilder_1 = require("../../store/roomBuilder");
|
|
|
49
49
|
var useThreekitInitStatus_1 = __importDefault(require("../useThreekitInitStatus"));
|
|
50
50
|
var useRoomBuilder = function (props) {
|
|
51
51
|
var _a;
|
|
52
|
-
var _b;
|
|
53
52
|
var attributesState = (0, useConfigurator_1.default)()[0];
|
|
54
53
|
var hasLoaded = (0, useThreekitInitStatus_1.default)();
|
|
55
54
|
var dispatch = (0, store_1.useThreekitDispatch)();
|
|
@@ -59,8 +58,8 @@ var useRoomBuilder = function (props) {
|
|
|
59
58
|
var modeValue = (0, store_1.useThreekitSelector)(roomBuilder_1.getMode);
|
|
60
59
|
var showDimensions = (0, store_1.useThreekitSelector)(roomBuilder_1.getShowDimensions);
|
|
61
60
|
var angleSnappingEnabled = (0, store_1.useThreekitSelector)(roomBuilder_1.getAngleSnappingEnabled);
|
|
62
|
-
var
|
|
63
|
-
var
|
|
61
|
+
var _b = (0, react_1.useState)(null), selectedElement = _b[0], setSelectedElement = _b[1];
|
|
62
|
+
var _c = (0, react_1.useState)(null), selectedWallAsset = _c[0], setSelectedWallAsset = _c[1];
|
|
64
63
|
var canvasRef = (0, react_1.useRef)(null);
|
|
65
64
|
var selectElementPending = (0, react_1.useRef)(null);
|
|
66
65
|
var translationAnchorRef = (0, react_1.useRef)(null);
|
|
@@ -70,16 +69,11 @@ var useRoomBuilder = function (props) {
|
|
|
70
69
|
snapProximity: constants_1.SNAP_PROXIMITY,
|
|
71
70
|
zoomDefault: zoom || constants_1.ZOOM_DEFAULT,
|
|
72
71
|
translateDefault: translation || constants_1.TRANSLATE_DEFAULT,
|
|
73
|
-
styles: ((
|
|
72
|
+
styles: ((_a = props.config) === null || _a === void 0 ? void 0 : _a.theme) && themes_1.default[props.config.theme]
|
|
74
73
|
? themes_1.default[props.config.theme]
|
|
75
74
|
: themes_1.default[themes_1.IThemes.DEFAULT],
|
|
76
75
|
}, props.config);
|
|
77
|
-
var attributeNames = Object.assign(
|
|
78
|
-
_a[types_1.IElements.WALL] = constants_1.IRoomBuilderAttributes.WALLS,
|
|
79
|
-
_a[types_1.IElements.WINDOW] = constants_1.IRoomBuilderAttributes.WINDOWS,
|
|
80
|
-
_a[types_1.IElements.OPENING] = constants_1.IRoomBuilderAttributes.OPENINGS,
|
|
81
|
-
_a[types_1.IElements.DOOR] = constants_1.IRoomBuilderAttributes.DOORS,
|
|
82
|
-
_a), props.attributes);
|
|
76
|
+
var attributeNames = Object.assign(constants_1.attributeNameDefaults, props.attributes);
|
|
83
77
|
var roomBuilderRef = (0, react_1.useRef)(new RoomBuilderState_1.default(__assign(__assign({}, props), { config: preppedConfig, attributes: attributeNames })));
|
|
84
78
|
var drawRoom = function () { return roomBuilderRef.current.drawRoom(canvasRef.current); };
|
|
85
79
|
(0, react_1.useEffect)(function () {
|
|
@@ -151,10 +145,10 @@ var useRoomBuilder = function (props) {
|
|
|
151
145
|
var layoutIds = props.layouts || [];
|
|
152
146
|
dispatch((0, roomBuilder_1.hydrateLayouts)(layoutIds, {
|
|
153
147
|
walls: attributeNames[types_1.IElements.WALL],
|
|
154
|
-
startX:
|
|
155
|
-
startZ:
|
|
156
|
-
endX:
|
|
157
|
-
endZ:
|
|
148
|
+
startX: attributeNames.wallStartX,
|
|
149
|
+
startZ: attributeNames.wallStartZ,
|
|
150
|
+
endX: attributeNames.wallEndX,
|
|
151
|
+
endZ: attributeNames.wallStartZ,
|
|
158
152
|
}));
|
|
159
153
|
}, [hasLoaded, JSON.stringify(props.layouts)]);
|
|
160
154
|
var updateZoom = function (value) {
|
|
@@ -231,17 +231,32 @@ export interface IRoomBuilderConfigUser extends IRoomBuilderConfigShared<Partial
|
|
|
231
231
|
}
|
|
232
232
|
export interface IRoomBuilderAttributes {
|
|
233
233
|
[IElements.WALL]: string;
|
|
234
|
-
[IElements.WINDOW]
|
|
235
|
-
[IElements.DOOR]
|
|
236
|
-
[IElements.OPENING]
|
|
237
|
-
|
|
238
|
-
|
|
234
|
+
[IElements.WINDOW]: string;
|
|
235
|
+
[IElements.DOOR]: string;
|
|
236
|
+
[IElements.OPENING]: string;
|
|
237
|
+
featurePositionX: string;
|
|
238
|
+
featurePositionY: string;
|
|
239
|
+
featurePositionZ: string;
|
|
240
|
+
featureConnectedTo: string;
|
|
241
|
+
featureHeight: string;
|
|
242
|
+
featureLength: string;
|
|
243
|
+
wallStartX: string;
|
|
244
|
+
wallStartY: string;
|
|
245
|
+
wallStartZ: string;
|
|
246
|
+
wallEndX: string;
|
|
247
|
+
wallEndY: string;
|
|
248
|
+
wallEndZ: string;
|
|
249
|
+
wallConnections: string;
|
|
250
|
+
wallThickness: string;
|
|
251
|
+
wallHeight: string;
|
|
252
|
+
}
|
|
253
|
+
interface IRoomBuilderPropsShared<T, U> {
|
|
239
254
|
config: T;
|
|
240
|
-
attributes:
|
|
255
|
+
attributes: U;
|
|
241
256
|
layouts?: Array<string>;
|
|
242
257
|
}
|
|
243
|
-
export interface IRoomBuilderHookProps extends IRoomBuilderPropsShared<undefined | Partial<IRoomBuilderConfigUser>> {
|
|
258
|
+
export interface IRoomBuilderHookProps extends IRoomBuilderPropsShared<undefined | Partial<IRoomBuilderConfigUser>, undefined | Partial<IRoomBuilderAttributes>> {
|
|
244
259
|
}
|
|
245
|
-
export interface IRoomBuilderStateProps extends IRoomBuilderPropsShared<IRoomBuilderConfigInternal> {
|
|
260
|
+
export interface IRoomBuilderStateProps extends IRoomBuilderPropsShared<IRoomBuilderConfigInternal, IRoomBuilderAttributes> {
|
|
246
261
|
}
|
|
247
262
|
export {};
|
package/dist/icons/types.d.ts
CHANGED
package/dist/store/treble.js
CHANGED
|
@@ -260,7 +260,7 @@ var initPlayer = function (config) {
|
|
|
260
260
|
exports.initPlayer = initPlayer;
|
|
261
261
|
var launch = function (launchConfig) {
|
|
262
262
|
return function (dispatch) { return __awaiter(void 0, void 0, void 0, function () {
|
|
263
|
-
var config, productId, credentials, productsRaw, products, threekitEnv, serverUrl, playerConfig, envCredentials, _a, assetIdRaw, stageId, configurationId, initialConfigurationRaw, assetId, threekitDomainRaw, authToken, el, threekitDomain, initialConfiguration, updatedAssetId, params, configId, configuration;
|
|
263
|
+
var config, productId, credentials, productsRaw, products, threekitEnv, serverUrl, playerConfig, envCredentials, _a, assetIdRaw, stageId, configurationId, initialConfigurationRaw, assetId, threekitDomainRaw, authToken, playerScriptUrl, el, threekitDomain, initialConfiguration, updatedAssetId, params, configId, configuration;
|
|
264
264
|
var _b, _c, _d, _e, _f, _g, _h;
|
|
265
265
|
return __generator(this, function (_j) {
|
|
266
266
|
switch (_j.label) {
|
|
@@ -324,7 +324,7 @@ var launch = function (launchConfig) {
|
|
|
324
324
|
_a = products[productId][threekitEnv] || {}, assetIdRaw = _a.assetId, stageId = _a.stageId, configurationId = _a.configurationId, initialConfigurationRaw = _a.initialConfiguration;
|
|
325
325
|
assetId = (launchConfig === null || launchConfig === void 0 ? void 0 : launchConfig.assetId) || assetIdRaw;
|
|
326
326
|
threekitDomainRaw = envCredentials.threekitDomain || "".concat(threekitEnv, ".threekit.com");
|
|
327
|
-
authToken = envCredentials.publicToken;
|
|
327
|
+
authToken = envCredentials.publicToken, playerScriptUrl = envCredentials.playerScriptUrl;
|
|
328
328
|
if (playerConfig.elementId) {
|
|
329
329
|
el = document.getElementById(playerConfig.elementId);
|
|
330
330
|
if (el)
|
|
@@ -362,7 +362,8 @@ var launch = function (launchConfig) {
|
|
|
362
362
|
return [2, console.error('missing assetId')];
|
|
363
363
|
return [4, new Promise(function (resolve) {
|
|
364
364
|
var script = document.createElement('script');
|
|
365
|
-
script.src =
|
|
365
|
+
script.src =
|
|
366
|
+
playerScriptUrl || "".concat(threekitDomain, "/app/js/threekit-player-bundle.js");
|
|
366
367
|
script.id = 'threekit-player-bundle';
|
|
367
368
|
script.onload = function () { return resolve(); };
|
|
368
369
|
document.head.appendChild(script);
|
package/dist/types.d.ts
CHANGED