@plurid/plurid-react 0.0.0-17 → 0.0.0-18
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/distribution/components/links/Link/components/Preview/index.d.ts +1 -1
- package/distribution/components/links/Link/index.d.ts +7 -2
- package/distribution/components/links/RouterLink/index.d.ts +1 -0
- package/distribution/components/planes/ExternalPlane/index.d.ts +1 -1
- package/distribution/components/planes/IframePlane/index.d.ts +1 -1
- package/distribution/components/structural/Plane/components/PlaneBridge/index.d.ts +1 -1
- package/distribution/components/structural/Plane/components/PlaneControls/components/SearchItem/index.d.ts +1 -1
- package/distribution/components/structural/Plane/components/PlaneControls/components/SearchList/index.d.ts +1 -1
- package/distribution/components/structural/Plane/components/PlaneControls/index.d.ts +1 -1
- package/distribution/components/structural/Plane/components/PlaneDebugger/index.d.ts +1 -1
- package/distribution/components/structural/Plane/index.d.ts +3 -1
- package/distribution/components/structural/Root/index.d.ts +1 -1
- package/distribution/components/structural/Roots/index.d.ts +4 -11
- package/distribution/components/structural/Roots/styled.d.ts +0 -7
- package/distribution/components/structural/Space/components/SpaceDebugger/index.d.ts +1 -1
- package/distribution/components/structural/Space/index.d.ts +1 -1
- package/distribution/components/utilities/ApplicationConfigurator/index.d.ts +3 -1
- package/distribution/components/utilities/ErrorBoundary/index.d.ts +2 -1
- package/distribution/components/utilities/NotFound/index.d.ts +1 -1
- package/distribution/components/utilities/Origin/index.d.ts +15 -0
- package/distribution/components/utilities/Origin/styled.d.ts +7 -0
- package/distribution/components/utilities/PlaneConfigurator/index.d.ts +3 -1
- package/distribution/components/utilities/Portal/index.d.ts +2 -0
- package/distribution/components/utilities/Toolbar/General/components/Drawer/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Global/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Shortcuts/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Space/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Technical/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Toolbar/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Transform/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Viewcube/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/data.d.ts +1 -0
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuUniverses/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/ToolbarRotate/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/ToolbarScale/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/ToolbarTranslate/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/TransformArrow/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/TransformArrow/styled.d.ts +6 -1
- package/distribution/components/utilities/Toolbar/General/index.d.ts +1 -1
- package/distribution/components/utilities/UniverseExplorer/index.d.ts +1 -1
- package/distribution/components/utilities/Viewcube/components/ViewcubeFace/index.d.ts +1 -1
- package/distribution/components/utilities/Viewcube/components/ViewcubeModel/index.d.ts +1 -1
- package/distribution/components/utilities/Viewcube/index.d.ts +1 -1
- package/distribution/components/virtuals/List/index.d.ts +1 -1
- package/distribution/containers/Application/View/PlanesView/index.d.ts +1 -3
- package/distribution/containers/Application/View/index.d.ts +1 -1
- package/distribution/containers/Application/View/logic.d.ts +1 -0
- package/distribution/containers/RouterBrowser/index.d.ts +1 -0
- package/distribution/containers/RouterStatic/index.d.ts +1 -0
- package/distribution/data/interfaces/index.d.ts +2 -3
- package/distribution/distribution/components/links/Link/components/Preview/index.d.ts +1 -1
- package/distribution/distribution/components/links/Link/index.d.ts +7 -2
- package/distribution/distribution/components/links/RouterLink/index.d.ts +1 -0
- package/distribution/distribution/components/planes/ExternalPlane/index.d.ts +1 -1
- package/distribution/distribution/components/planes/IframePlane/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Plane/components/PlaneBridge/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Plane/components/PlaneControls/components/SearchItem/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Plane/components/PlaneControls/components/SearchList/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Plane/components/PlaneControls/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Plane/components/PlaneDebugger/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Plane/index.d.ts +3 -1
- package/distribution/distribution/components/structural/Root/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Roots/index.d.ts +4 -11
- package/distribution/distribution/components/structural/Roots/styled.d.ts +0 -7
- package/distribution/distribution/components/structural/Space/components/SpaceDebugger/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Space/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/ApplicationConfigurator/index.d.ts +3 -1
- package/distribution/distribution/components/utilities/ErrorBoundary/index.d.ts +2 -1
- package/distribution/distribution/components/utilities/NotFound/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Origin/index.d.ts +15 -0
- package/distribution/distribution/components/utilities/Origin/styled.d.ts +7 -0
- package/distribution/distribution/components/utilities/PlaneConfigurator/index.d.ts +3 -1
- package/distribution/distribution/components/utilities/Portal/index.d.ts +2 -0
- package/distribution/distribution/components/utilities/Toolbar/General/components/Drawer/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Global/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Shortcuts/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Space/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Technical/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Toolbar/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Transform/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Viewcube/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/data.d.ts +1 -0
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuUniverses/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/ToolbarRotate/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/ToolbarScale/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/ToolbarTranslate/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/TransformArrow/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/TransformArrow/styled.d.ts +6 -1
- package/distribution/distribution/components/utilities/Toolbar/General/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/UniverseExplorer/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Viewcube/components/ViewcubeFace/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Viewcube/components/ViewcubeModel/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Viewcube/index.d.ts +1 -1
- package/distribution/distribution/components/virtuals/List/index.d.ts +1 -1
- package/distribution/distribution/containers/Application/View/PlanesView/index.d.ts +1 -3
- package/distribution/distribution/containers/Application/View/index.d.ts +1 -1
- package/distribution/distribution/containers/Application/View/logic.d.ts +1 -0
- package/distribution/distribution/containers/RouterBrowser/index.d.ts +1 -0
- package/distribution/distribution/containers/RouterStatic/index.d.ts +1 -0
- package/distribution/distribution/data/interfaces/index.d.ts +2 -3
- package/distribution/distribution/index.d.ts +21 -14
- package/distribution/distribution/services/logic/router/index.d.ts +4 -4
- package/distribution/distribution/services/logic/server/index.d.ts +2 -2
- package/distribution/distribution/services/logic/transform/index.d.ts +2 -0
- package/distribution/distribution/services/state/modules/space/actions/index.d.ts +2 -0
- package/distribution/distribution/services/state/modules/space/resolvers/index.d.ts +2 -0
- package/distribution/distribution/services/state/modules/space/selectors/index.d.ts +8 -0
- package/distribution/distribution/services/state/modules/space/types/index.d.ts +16 -1
- package/distribution/distribution/services/state/selectors/index.d.ts +8 -0
- package/distribution/distribution/services/state/store/reducers/index.d.ts +1 -1
- package/distribution/distribution/services/styled/index.d.ts +1 -1
- package/distribution/index.d.ts +21 -14
- package/distribution/index.es.js +565 -388
- package/distribution/index.es.js.map +1 -1
- package/distribution/index.js +562 -385
- package/distribution/index.js.map +1 -1
- package/distribution/index.min.js +73 -71
- package/distribution/index.min.js.map +1 -1
- package/distribution/services/logic/router/index.d.ts +4 -4
- package/distribution/services/logic/server/index.d.ts +2 -2
- package/distribution/services/logic/transform/index.d.ts +2 -0
- package/distribution/services/state/modules/space/actions/index.d.ts +2 -0
- package/distribution/services/state/modules/space/resolvers/index.d.ts +2 -0
- package/distribution/services/state/modules/space/selectors/index.d.ts +8 -0
- package/distribution/services/state/modules/space/types/index.d.ts +16 -1
- package/distribution/services/state/selectors/index.d.ts +8 -0
- package/distribution/services/state/store/reducers/index.d.ts +1 -1
- package/distribution/services/styled/index.d.ts +1 -1
- package/package.json +34 -34
package/distribution/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defaultConfiguration, TRANSFORM_MODES, LAYOUT_TYPES, TRANSLATION_STEP, ROTATION_STEP, SCALE_STEP, SCALE_UPPER_LIMIT, SCALE_LOWER_LIMIT, PLURID_ENTITY_PLANE_BRIDGE, PLURID_ENTITY_PLANE_CONTROLS, PLURID_ENTITY_PLANE_CONTENT, PLURID_ENTITY_PLANE, PLURID_ENTITY_ROOT,
|
|
1
|
+
import { defaultConfiguration, TRANSFORM_MODES, LAYOUT_TYPES, TRANSLATION_STEP, ROTATION_STEP, SCALE_STEP, SCALE_UPPER_LIMIT, SCALE_LOWER_LIMIT, PLURID_ENTITY_PLANE_BRIDGE, PLURID_ENTITY_PLANE_CONTROLS, PLURID_ENTITY_PLANE_CONTENT, PLURID_ENTITY_PLANE, PLURID_ENTITY_ROOT, PLURID_ENTITY_ROOTS, PLURID_ENTITY_SPACE, SIZES, PLURID_ENTITY_TRANSFORM_ORIGIN, internationalization, TRANSFORM_TOUCHES, layoutNames, defaultShortcuts, shortcutsNames, TOOLBAR_DRAWERS, PLURID_ENTITY_TOOLBAR, PLURID_ENTITY_VIEWCUBE, PLURID_PUBSUB_TOPIC, PLURID_ENTITY_VIEW, PLURID_ROUTE_DEFAULT_PATH_VALUE, PLURID_ROUTE_DEFAULT_PATH, PLURID_ROUTE_DEFAULT_SPACE_VALUE, PLURID_ROUTE_DEFAULT_SPACE, PLURID_ROUTE_DEFAULT_UNIVERSE_VALUE, PLURID_ROUTE_DEFAULT_UNIVERSE, PLURID_ROUTE_DEFAULT_CLUSTER_VALUE, PLURID_ROUTE_DEFAULT_CLUSTER, PLURID_ROUTE_SEPARATOR, PLURID_ENTITY_MULTISPACE, PLURID_ROUTER_LOCATION_CHANGED, PLURID_ROUTER_STORAGE, PLURID_ROUTER_LOCATION_STORED, PLURID_ENTITY_LINK, PLURID_DEFAULT_CONFIGURATION_LINK_PREVIEW_FADE_IN, PLURID_DEFAULT_CONFIGURATION_LINK_PREVIEW_FADE_OUT, PLURID_DEFAULT_CONFIGURATION_LINK_SUFFIX, PLURID_ENTITY_APPLICATION_CONFIGURATOR, PLURID_ENTITY_PLANE_CONFIGURATOR } from "@plurid/plurid-data";
|
|
2
2
|
|
|
3
3
|
export { PLURID_PUBSUB_TOPIC, PLURID_ROUTER_LOCATION_CHANGED, PLURID_ROUTER_LOCATION_STORED, SIZES, LAYOUT_TYPES as SPACE_LAYOUT, TRANSFORM_MODES, TRANSFORM_TOUCHES } from "@plurid/plurid-data";
|
|
4
4
|
|
|
5
|
-
import { general as general$1,
|
|
5
|
+
import { interaction, general as general$1, cleanTemplate, planes, internatiolate, space as space$1, state, utilities, routing, pluridRouterNavigate } from "@plurid/plurid-engine";
|
|
6
6
|
|
|
7
7
|
export { pluridRouterNavigate } from "@plurid/plurid-engine";
|
|
8
8
|
|
|
@@ -18,7 +18,7 @@ import { combineReducers, createStore, applyMiddleware } from "redux";
|
|
|
18
18
|
|
|
19
19
|
import thunk from "redux-thunk";
|
|
20
20
|
|
|
21
|
-
import { mathematics, dom, meta, uuid, storage } from "@plurid/plurid-functions";
|
|
21
|
+
import { mathematics, objects, dom, meta, uuid, storage } from "@plurid/plurid-functions";
|
|
22
22
|
|
|
23
23
|
import themes$1, { plurid, decomposeColor } from "@plurid/plurid-themes";
|
|
24
24
|
|
|
@@ -705,8 +705,12 @@ var shortcuts = Object.freeze({
|
|
|
705
705
|
Types: index$f
|
|
706
706
|
});
|
|
707
707
|
|
|
708
|
+
const SET_SPACE_FIELD = "SET_SPACE_FIELD";
|
|
709
|
+
|
|
708
710
|
const SET_SPACE_LOADING = "SET_SPACE_LOADING";
|
|
709
711
|
|
|
712
|
+
const SET_TRANSFORM = "SET_TRANSFORM";
|
|
713
|
+
|
|
710
714
|
const SET_ANIMATED_TRANSFORM = "SET_ANIMATED_TRANSFORM";
|
|
711
715
|
|
|
712
716
|
const SET_TRANSFORM_TIME = "SET_TRANSFORM_TIME";
|
|
@@ -795,7 +799,9 @@ const SPACE_SET_CULLED_VIEW = "SPACE_SET_CULLED_VIEW";
|
|
|
795
799
|
|
|
796
800
|
var index$b = Object.freeze({
|
|
797
801
|
__proto__: null,
|
|
802
|
+
SET_SPACE_FIELD: SET_SPACE_FIELD,
|
|
798
803
|
SET_SPACE_LOADING: SET_SPACE_LOADING,
|
|
804
|
+
SET_TRANSFORM: SET_TRANSFORM,
|
|
799
805
|
SET_ANIMATED_TRANSFORM: SET_ANIMATED_TRANSFORM,
|
|
800
806
|
SET_TRANSFORM_TIME: SET_TRANSFORM_TIME,
|
|
801
807
|
SET_SPACE_LOCATION: SET_SPACE_LOCATION,
|
|
@@ -841,11 +847,21 @@ var index$b = Object.freeze({
|
|
|
841
847
|
SPACE_SET_CULLED_VIEW: SPACE_SET_CULLED_VIEW
|
|
842
848
|
});
|
|
843
849
|
|
|
850
|
+
const setSpaceField$1 = payload => ({
|
|
851
|
+
type: SET_SPACE_FIELD,
|
|
852
|
+
payload: payload
|
|
853
|
+
});
|
|
854
|
+
|
|
844
855
|
const setSpaceLoading$1 = payload => ({
|
|
845
856
|
type: SET_SPACE_LOADING,
|
|
846
857
|
payload: payload
|
|
847
858
|
});
|
|
848
859
|
|
|
860
|
+
const setTransform$1 = payload => ({
|
|
861
|
+
type: SET_TRANSFORM,
|
|
862
|
+
payload: payload
|
|
863
|
+
});
|
|
864
|
+
|
|
849
865
|
const setAnimatedTransform$1 = payload => ({
|
|
850
866
|
type: SET_ANIMATED_TRANSFORM,
|
|
851
867
|
payload: payload
|
|
@@ -1040,7 +1056,9 @@ const spaceSetCulledView$1 = payload => ({
|
|
|
1040
1056
|
|
|
1041
1057
|
var index$a = Object.freeze({
|
|
1042
1058
|
__proto__: null,
|
|
1059
|
+
setSpaceField: setSpaceField$1,
|
|
1043
1060
|
setSpaceLoading: setSpaceLoading$1,
|
|
1061
|
+
setTransform: setTransform$1,
|
|
1044
1062
|
setAnimatedTransform: setAnimatedTransform$1,
|
|
1045
1063
|
setTransformTime: setTransformTime$1,
|
|
1046
1064
|
setSpaceLocation: setSpaceLocation$1,
|
|
@@ -1088,6 +1106,7 @@ var index$a = Object.freeze({
|
|
|
1088
1106
|
|
|
1089
1107
|
const initialState$2 = {
|
|
1090
1108
|
loading: true,
|
|
1109
|
+
transform: "matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)",
|
|
1091
1110
|
animatedTransform: false,
|
|
1092
1111
|
transformTime: 450,
|
|
1093
1112
|
scale: 1,
|
|
@@ -1122,303 +1141,393 @@ const initialState$2 = {
|
|
|
1122
1141
|
culledView: []
|
|
1123
1142
|
};
|
|
1124
1143
|
|
|
1144
|
+
const {quaternion: quaternion, matrix: matrix} = interaction;
|
|
1145
|
+
|
|
1146
|
+
const {matrixArrayToCSSMatrix: matrixArrayToCSSMatrix$1, rotateMatrix: rotateMatrix$1, multiplyArrayOfMatrices: multiplyArrayOfMatrices$1, scaleMatrix: scaleMatrix$1, translateMatrix: translateMatrix$2} = matrix;
|
|
1147
|
+
|
|
1148
|
+
const {degToRad: degToRad$2} = quaternion;
|
|
1149
|
+
|
|
1150
|
+
const computeMatrix = spaceState => {
|
|
1151
|
+
const {translationX: translationX, translationY: translationY, translationZ: translationZ, rotationX: rotationX, rotationY: rotationY, scale: scale} = spaceState;
|
|
1152
|
+
const innerWidth = typeof window === "undefined" ? 720 : window.innerWidth / 2;
|
|
1153
|
+
const innerHeight = typeof window === "undefined" ? 400 : window.innerHeight / 2;
|
|
1154
|
+
const transformOriginX = translationX * -1 + innerWidth;
|
|
1155
|
+
const transformOriginY = translationY * -1 + innerHeight;
|
|
1156
|
+
const transformOriginZ = translationZ * -1;
|
|
1157
|
+
const rotationMatrix = rotateMatrix$1(degToRad$2(-rotationX), degToRad$2(-rotationY));
|
|
1158
|
+
const translationMatrix = translateMatrix$2(translationX, translationY, translationZ);
|
|
1159
|
+
const scalationMatrix = scaleMatrix$1(scale);
|
|
1160
|
+
const transformMatrix = multiplyArrayOfMatrices$1([ translationMatrix, multiplyArrayOfMatrices$1([ translateMatrix$2(transformOriginX, transformOriginY, transformOriginZ), rotationMatrix, translateMatrix$2(-transformOriginX, -transformOriginY, -transformOriginZ) ]), scalationMatrix ]);
|
|
1161
|
+
const transform = matrixArrayToCSSMatrix$1(transformMatrix);
|
|
1162
|
+
return transform;
|
|
1163
|
+
};
|
|
1164
|
+
|
|
1125
1165
|
const {toRadians: toRadians} = mathematics.geometry;
|
|
1126
1166
|
|
|
1127
|
-
const
|
|
1128
|
-
loading: action.payload
|
|
1129
|
-
});
|
|
1167
|
+
const getNewState = state => objects.clone(state, "any");
|
|
1130
1168
|
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1133
|
-
|
|
1169
|
+
const setSpaceField = (state, action) => {
|
|
1170
|
+
const {field: field, value: value} = action.payload;
|
|
1171
|
+
const newState = getNewState(state);
|
|
1172
|
+
newState[field] = value;
|
|
1173
|
+
return Object.assign({}, newState);
|
|
1174
|
+
};
|
|
1134
1175
|
|
|
1135
|
-
const
|
|
1136
|
-
|
|
1137
|
-
})
|
|
1176
|
+
const setSpaceLoading = (state, action) => {
|
|
1177
|
+
const newState = getNewState(state);
|
|
1178
|
+
return Object.assign(Object.assign({}, newState), {
|
|
1179
|
+
loading: action.payload
|
|
1180
|
+
});
|
|
1181
|
+
};
|
|
1138
1182
|
|
|
1139
|
-
const
|
|
1183
|
+
const setTransform = (state, action) => {
|
|
1184
|
+
const {translationX: translationX, translationY: translationY, translationZ: translationZ, rotationX: rotationX, rotationY: rotationY, scale: scale} = action.payload;
|
|
1185
|
+
const resolvedTranslationX = translationX !== null && translationX !== void 0 ? translationX : state.translationX;
|
|
1186
|
+
const resolvedTranslationY = translationY !== null && translationY !== void 0 ? translationY : state.translationY;
|
|
1187
|
+
const resolvedTranslationZ = translationZ !== null && translationZ !== void 0 ? translationZ : state.translationZ;
|
|
1188
|
+
const resolvedRotationX = rotationX !== null && rotationX !== void 0 ? rotationX : state.rotationX;
|
|
1189
|
+
const resolvedRotationY = rotationY !== null && rotationY !== void 0 ? rotationY : state.rotationY;
|
|
1190
|
+
const resolvedScale = scale !== null && scale !== void 0 ? scale : state.scale;
|
|
1191
|
+
const newState = getNewState(state);
|
|
1192
|
+
return Object.assign(Object.assign({}, newState), {
|
|
1193
|
+
translationX: resolvedTranslationX,
|
|
1194
|
+
translationY: resolvedTranslationY,
|
|
1195
|
+
translationZ: resolvedTranslationZ,
|
|
1196
|
+
rotationX: resolvedRotationX,
|
|
1197
|
+
rotationY: resolvedRotationY,
|
|
1198
|
+
scale: resolvedScale
|
|
1199
|
+
});
|
|
1200
|
+
};
|
|
1140
1201
|
|
|
1141
|
-
const
|
|
1142
|
-
const
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
translationX: translationX,
|
|
1146
|
-
translationZ: translationZ
|
|
1202
|
+
const setAnimatedTransform = (state, action) => {
|
|
1203
|
+
const newState = getNewState(state);
|
|
1204
|
+
return Object.assign(Object.assign({}, newState), {
|
|
1205
|
+
animatedTransform: action.payload
|
|
1147
1206
|
});
|
|
1148
1207
|
};
|
|
1149
1208
|
|
|
1150
|
-
const
|
|
1151
|
-
const
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
translationX: translationX,
|
|
1155
|
-
translationZ: translationZ
|
|
1209
|
+
const setTransformTime = (state, action) => {
|
|
1210
|
+
const newState = getNewState(state);
|
|
1211
|
+
return Object.assign(Object.assign({}, newState), {
|
|
1212
|
+
transformTime: action.payload
|
|
1156
1213
|
});
|
|
1157
1214
|
};
|
|
1158
1215
|
|
|
1216
|
+
const setSpaceLocation = (state, action) => {
|
|
1217
|
+
const newState = getNewState(state);
|
|
1218
|
+
return Object.assign(Object.assign({}, newState), action.payload);
|
|
1219
|
+
};
|
|
1220
|
+
|
|
1221
|
+
const viewCameraMoveForward = state => {
|
|
1222
|
+
const newState = getNewState(state);
|
|
1223
|
+
newState.translationZ = state.translationZ + TRANSLATION_STEP * 6 * Math.cos(toRadians(-state.rotationY));
|
|
1224
|
+
newState.translationX = state.translationX + TRANSLATION_STEP * 6 * Math.sin(toRadians(-state.rotationY));
|
|
1225
|
+
newState.transform = computeMatrix(newState);
|
|
1226
|
+
return Object.assign({}, newState);
|
|
1227
|
+
};
|
|
1228
|
+
|
|
1229
|
+
const viewCameraMoveBackward = state => {
|
|
1230
|
+
const newState = getNewState(state);
|
|
1231
|
+
newState.translationZ = state.translationZ - TRANSLATION_STEP * 6 * Math.cos(toRadians(-state.rotationY));
|
|
1232
|
+
newState.translationX = state.translationX - TRANSLATION_STEP * 6 * Math.sin(toRadians(-state.rotationY));
|
|
1233
|
+
newState.transform = computeMatrix(newState);
|
|
1234
|
+
return Object.assign({}, newState);
|
|
1235
|
+
};
|
|
1236
|
+
|
|
1159
1237
|
const viewCameraMoveLeft = state => {
|
|
1160
|
-
const
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
});
|
|
1238
|
+
const newState = getNewState(state);
|
|
1239
|
+
newState.translationX = state.translationX + TRANSLATION_STEP * 3 * Math.cos(toRadians(state.rotationY));
|
|
1240
|
+
newState.translationZ = state.translationZ + TRANSLATION_STEP * 3 * Math.sin(toRadians(state.rotationY));
|
|
1241
|
+
newState.transform = computeMatrix(newState);
|
|
1242
|
+
return Object.assign({}, newState);
|
|
1166
1243
|
};
|
|
1167
1244
|
|
|
1168
1245
|
const viewCameraMoveRight = state => {
|
|
1169
|
-
const
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
});
|
|
1246
|
+
const newState = getNewState(state);
|
|
1247
|
+
newState.translationX = state.translationX - TRANSLATION_STEP * 3 * Math.cos(toRadians(state.rotationY));
|
|
1248
|
+
newState.translationZ = state.translationZ - TRANSLATION_STEP * 3 * Math.sin(toRadians(state.rotationY));
|
|
1249
|
+
newState.transform = computeMatrix(newState);
|
|
1250
|
+
return Object.assign({}, newState);
|
|
1175
1251
|
};
|
|
1176
1252
|
|
|
1177
1253
|
const viewCameraMoveUp = state => {
|
|
1178
|
-
const
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
});
|
|
1254
|
+
const newState = getNewState(state);
|
|
1255
|
+
newState.translationY = state.translationY + TRANSLATION_STEP * 3;
|
|
1256
|
+
newState.transform = computeMatrix(newState);
|
|
1257
|
+
return Object.assign({}, newState);
|
|
1182
1258
|
};
|
|
1183
1259
|
|
|
1184
1260
|
const viewCameraMoveDown = state => {
|
|
1185
|
-
const
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
});
|
|
1261
|
+
const newState = getNewState(state);
|
|
1262
|
+
newState.translationY = state.translationY - TRANSLATION_STEP * 3;
|
|
1263
|
+
newState.transform = computeMatrix(newState);
|
|
1264
|
+
return Object.assign({}, newState);
|
|
1189
1265
|
};
|
|
1190
1266
|
|
|
1191
1267
|
const viewCameraTurnUp = state => {
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
});
|
|
1268
|
+
const newState = getNewState(state);
|
|
1269
|
+
newState.rotationX = (state.rotationX + ROTATION_STEP) % 360;
|
|
1270
|
+
newState.transform = computeMatrix(newState);
|
|
1271
|
+
return Object.assign({}, newState);
|
|
1196
1272
|
};
|
|
1197
1273
|
|
|
1198
1274
|
const viewCameraTurnDown = state => {
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
});
|
|
1275
|
+
const newState = getNewState(state);
|
|
1276
|
+
newState.rotationX = (state.rotationX - ROTATION_STEP) % 360;
|
|
1277
|
+
newState.transform = computeMatrix(newState);
|
|
1278
|
+
return Object.assign({}, newState);
|
|
1203
1279
|
};
|
|
1204
1280
|
|
|
1205
1281
|
const viewCameraTurnLeft = state => {
|
|
1206
|
-
const
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
});
|
|
1282
|
+
const newState = getNewState(state);
|
|
1283
|
+
newState.rotationY = (state.rotationY - ROTATION_STEP) % 360;
|
|
1284
|
+
newState.transform = computeMatrix(newState);
|
|
1285
|
+
return Object.assign({}, newState);
|
|
1210
1286
|
};
|
|
1211
1287
|
|
|
1212
1288
|
const viewCameraTurnRight = state => {
|
|
1213
|
-
const
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
});
|
|
1289
|
+
const newState = getNewState(state);
|
|
1290
|
+
newState.rotationY = (state.rotationY + ROTATION_STEP) % 360;
|
|
1291
|
+
newState.transform = computeMatrix(newState);
|
|
1292
|
+
return Object.assign({}, newState);
|
|
1217
1293
|
};
|
|
1218
1294
|
|
|
1219
1295
|
const rotateUp = state => {
|
|
1220
|
-
const
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
});
|
|
1296
|
+
const newState = getNewState(state);
|
|
1297
|
+
newState.rotationX = (state.rotationX + ROTATION_STEP) % 360;
|
|
1298
|
+
newState.transform = computeMatrix(newState);
|
|
1299
|
+
return Object.assign({}, newState);
|
|
1224
1300
|
};
|
|
1225
1301
|
|
|
1226
1302
|
const rotateDown = state => {
|
|
1227
|
-
const
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
});
|
|
1303
|
+
const newState = getNewState(state);
|
|
1304
|
+
newState.rotationX = (state.rotationX - ROTATION_STEP) % 360;
|
|
1305
|
+
newState.transform = computeMatrix(newState);
|
|
1306
|
+
return Object.assign({}, newState);
|
|
1231
1307
|
};
|
|
1232
1308
|
|
|
1233
|
-
const rotateX = (state, action) =>
|
|
1234
|
-
|
|
1235
|
-
|
|
1309
|
+
const rotateX = (state, action) => {
|
|
1310
|
+
const newState = getNewState(state);
|
|
1311
|
+
newState.rotationX = action.payload;
|
|
1312
|
+
newState.transform = computeMatrix(newState);
|
|
1313
|
+
return Object.assign({}, newState);
|
|
1314
|
+
};
|
|
1236
1315
|
|
|
1237
1316
|
const rotateXWith = (state, action) => {
|
|
1238
|
-
const
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
});
|
|
1317
|
+
const newState = getNewState(state);
|
|
1318
|
+
newState.rotationX = state.rotationX + action.payload;
|
|
1319
|
+
newState.transform = computeMatrix(newState);
|
|
1320
|
+
return Object.assign({}, newState);
|
|
1242
1321
|
};
|
|
1243
1322
|
|
|
1244
1323
|
const rotateLeft = state => {
|
|
1245
|
-
const
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
});
|
|
1324
|
+
const newState = getNewState(state);
|
|
1325
|
+
newState.rotationY = (state.rotationY + ROTATION_STEP) % 360;
|
|
1326
|
+
newState.transform = computeMatrix(newState);
|
|
1327
|
+
return Object.assign({}, newState);
|
|
1249
1328
|
};
|
|
1250
1329
|
|
|
1251
1330
|
const rotateRight = state => {
|
|
1252
|
-
const
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
});
|
|
1331
|
+
const newState = getNewState(state);
|
|
1332
|
+
newState.rotationY = (state.rotationY - ROTATION_STEP) % 360;
|
|
1333
|
+
newState.transform = computeMatrix(newState);
|
|
1334
|
+
return Object.assign({}, newState);
|
|
1256
1335
|
};
|
|
1257
1336
|
|
|
1258
|
-
const rotateY = (state, action) =>
|
|
1259
|
-
|
|
1260
|
-
|
|
1337
|
+
const rotateY = (state, action) => {
|
|
1338
|
+
const newState = getNewState(state);
|
|
1339
|
+
newState.rotationY = action.payload;
|
|
1340
|
+
newState.transform = computeMatrix(newState);
|
|
1341
|
+
return Object.assign({}, newState);
|
|
1342
|
+
};
|
|
1261
1343
|
|
|
1262
1344
|
const rotateYWith = (state, action) => {
|
|
1263
|
-
const
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
});
|
|
1345
|
+
const newState = getNewState(state);
|
|
1346
|
+
newState.rotationY = state.rotationY + action.payload;
|
|
1347
|
+
newState.transform = computeMatrix(newState);
|
|
1348
|
+
return Object.assign({}, newState);
|
|
1267
1349
|
};
|
|
1268
1350
|
|
|
1269
1351
|
const translateUp = state => {
|
|
1270
|
-
const
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
});
|
|
1352
|
+
const newState = getNewState(state);
|
|
1353
|
+
newState.translationY = state.translationY - TRANSLATION_STEP;
|
|
1354
|
+
newState.transform = computeMatrix(newState);
|
|
1355
|
+
return Object.assign({}, newState);
|
|
1274
1356
|
};
|
|
1275
1357
|
|
|
1276
1358
|
const translateDown = state => {
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
});
|
|
1359
|
+
const newState = getNewState(state);
|
|
1360
|
+
newState.translationY = state.translationY + TRANSLATION_STEP;
|
|
1361
|
+
newState.transform = computeMatrix(newState);
|
|
1362
|
+
return Object.assign({}, newState);
|
|
1281
1363
|
};
|
|
1282
1364
|
|
|
1283
1365
|
const translateLeft = state => {
|
|
1284
|
-
const
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
});
|
|
1366
|
+
const newState = getNewState(state);
|
|
1367
|
+
newState.translationX = state.translationX - TRANSLATION_STEP * Math.cos(toRadians(state.rotationY));
|
|
1368
|
+
newState.translationZ = state.translationZ - TRANSLATION_STEP * Math.sin(toRadians(state.rotationY));
|
|
1369
|
+
newState.transform = computeMatrix(newState);
|
|
1370
|
+
return Object.assign({}, newState);
|
|
1290
1371
|
};
|
|
1291
1372
|
|
|
1292
1373
|
const translateRight = state => {
|
|
1293
|
-
const
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
});
|
|
1374
|
+
const newState = getNewState(state);
|
|
1375
|
+
newState.translationX = state.translationX + TRANSLATION_STEP * Math.cos(toRadians(state.rotationY));
|
|
1376
|
+
newState.translationZ = state.translationZ + TRANSLATION_STEP * Math.sin(toRadians(state.rotationY));
|
|
1377
|
+
newState.transform = computeMatrix(newState);
|
|
1378
|
+
return Object.assign({}, newState);
|
|
1299
1379
|
};
|
|
1300
1380
|
|
|
1301
1381
|
const translateIn = state => {
|
|
1302
|
-
const
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
});
|
|
1382
|
+
const newState = getNewState(state);
|
|
1383
|
+
newState.translationZ = state.translationZ - TRANSLATION_STEP * 3 * Math.cos(toRadians(-state.rotationY));
|
|
1384
|
+
newState.translationX = state.translationX - TRANSLATION_STEP * 3 * Math.sin(toRadians(-state.rotationY));
|
|
1385
|
+
newState.transform = computeMatrix(newState);
|
|
1386
|
+
return Object.assign({}, newState);
|
|
1308
1387
|
};
|
|
1309
1388
|
|
|
1310
1389
|
const translateOut = state => {
|
|
1311
|
-
const
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
});
|
|
1390
|
+
const newState = getNewState(state);
|
|
1391
|
+
newState.translationZ = state.translationZ + TRANSLATION_STEP * 3 * Math.cos(toRadians(-state.rotationY));
|
|
1392
|
+
newState.translationX = state.translationX + TRANSLATION_STEP * 3 * Math.sin(toRadians(-state.rotationY));
|
|
1393
|
+
newState.transform = computeMatrix(newState);
|
|
1394
|
+
return Object.assign({}, newState);
|
|
1317
1395
|
};
|
|
1318
1396
|
|
|
1319
1397
|
const translateXWith = (state, action) => {
|
|
1320
|
-
const
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
});
|
|
1398
|
+
const newState = getNewState(state);
|
|
1399
|
+
newState.translationX = state.translationX + action.payload * Math.cos(toRadians(state.rotationY));
|
|
1400
|
+
newState.translationZ = state.translationZ + action.payload * Math.sin(toRadians(state.rotationY));
|
|
1401
|
+
newState.transform = computeMatrix(newState);
|
|
1402
|
+
return Object.assign({}, newState);
|
|
1326
1403
|
};
|
|
1327
1404
|
|
|
1328
1405
|
const translateYWith = (state, action) => {
|
|
1329
|
-
const
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
});
|
|
1406
|
+
const newState = getNewState(state);
|
|
1407
|
+
newState.translationY = state.translationY + action.payload;
|
|
1408
|
+
newState.transform = computeMatrix(newState);
|
|
1409
|
+
return Object.assign({}, newState);
|
|
1333
1410
|
};
|
|
1334
1411
|
|
|
1335
1412
|
const scaleUp = state => {
|
|
1336
1413
|
const computedScale = state.scale + SCALE_STEP;
|
|
1337
1414
|
const scale = computedScale < SCALE_UPPER_LIMIT ? computedScale : SCALE_UPPER_LIMIT;
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1415
|
+
const newState = getNewState(state);
|
|
1416
|
+
newState.scale = scale;
|
|
1417
|
+
newState.transform = computeMatrix(newState);
|
|
1418
|
+
return Object.assign({}, newState);
|
|
1341
1419
|
};
|
|
1342
1420
|
|
|
1343
1421
|
const scaleDown = state => {
|
|
1344
1422
|
const computedScale = state.scale - SCALE_STEP;
|
|
1345
1423
|
const scale = computedScale > SCALE_LOWER_LIMIT ? computedScale : SCALE_LOWER_LIMIT;
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1424
|
+
const newState = getNewState(state);
|
|
1425
|
+
newState.scale = scale;
|
|
1426
|
+
newState.transform = computeMatrix(newState);
|
|
1427
|
+
return Object.assign({}, newState);
|
|
1349
1428
|
};
|
|
1350
1429
|
|
|
1351
1430
|
const scaleUpWith = (state, action) => {
|
|
1352
1431
|
const computedScale = state.scale + Math.abs(action.payload);
|
|
1353
1432
|
const scale = computedScale < SCALE_UPPER_LIMIT ? computedScale : SCALE_UPPER_LIMIT;
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1433
|
+
const newState = getNewState(state);
|
|
1434
|
+
newState.scale = scale;
|
|
1435
|
+
newState.transform = computeMatrix(newState);
|
|
1436
|
+
return Object.assign({}, newState);
|
|
1357
1437
|
};
|
|
1358
1438
|
|
|
1359
1439
|
const scaleDownWith = (state, action) => {
|
|
1360
1440
|
const computedScale = state.scale - Math.abs(action.payload);
|
|
1361
1441
|
const scale = computedScale > SCALE_LOWER_LIMIT ? computedScale : SCALE_LOWER_LIMIT;
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1442
|
+
const newState = getNewState(state);
|
|
1443
|
+
newState.scale = scale;
|
|
1444
|
+
newState.transform = computeMatrix(newState);
|
|
1445
|
+
return Object.assign({}, newState);
|
|
1365
1446
|
};
|
|
1366
1447
|
|
|
1367
|
-
const setInitialTree = (state, action) =>
|
|
1368
|
-
|
|
1369
|
-
})
|
|
1448
|
+
const setInitialTree = (state, action) => {
|
|
1449
|
+
const newState = getNewState(state);
|
|
1450
|
+
return Object.assign(Object.assign({}, newState), {
|
|
1451
|
+
initialTree: [ ...action.payload ]
|
|
1452
|
+
});
|
|
1453
|
+
};
|
|
1370
1454
|
|
|
1371
|
-
const setTree = (state, action) =>
|
|
1372
|
-
|
|
1373
|
-
})
|
|
1455
|
+
const setTree = (state, action) => {
|
|
1456
|
+
const newState = getNewState(state);
|
|
1457
|
+
return Object.assign(Object.assign({}, newState), {
|
|
1458
|
+
tree: [ ...action.payload ]
|
|
1459
|
+
});
|
|
1460
|
+
};
|
|
1374
1461
|
|
|
1375
|
-
const setActiveUniverse = (state, action) =>
|
|
1376
|
-
|
|
1377
|
-
})
|
|
1462
|
+
const setActiveUniverse = (state, action) => {
|
|
1463
|
+
const newState = getNewState(state);
|
|
1464
|
+
return Object.assign(Object.assign({}, newState), {
|
|
1465
|
+
activeUniverseID: action.payload
|
|
1466
|
+
});
|
|
1467
|
+
};
|
|
1378
1468
|
|
|
1379
|
-
const spaceResetTransform = state =>
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1469
|
+
const spaceResetTransform = state => {
|
|
1470
|
+
const newState = getNewState(state);
|
|
1471
|
+
newState.scale = 1;
|
|
1472
|
+
newState.rotationX = 0;
|
|
1473
|
+
newState.rotationY = 0;
|
|
1474
|
+
newState.translationX = 0;
|
|
1475
|
+
newState.translationY = 0;
|
|
1476
|
+
newState.translationZ = 0;
|
|
1477
|
+
newState.transform = computeMatrix(newState);
|
|
1478
|
+
return Object.assign({}, newState);
|
|
1479
|
+
};
|
|
1387
1480
|
|
|
1388
|
-
const setViewSize = (state, action) =>
|
|
1389
|
-
|
|
1390
|
-
})
|
|
1481
|
+
const setViewSize = (state, action) => {
|
|
1482
|
+
const newState = getNewState(state);
|
|
1483
|
+
return Object.assign(Object.assign({}, newState), {
|
|
1484
|
+
viewSize: Object.assign({}, action.payload)
|
|
1485
|
+
});
|
|
1486
|
+
};
|
|
1391
1487
|
|
|
1392
|
-
const setSpaceSize = (state, action) =>
|
|
1393
|
-
|
|
1394
|
-
})
|
|
1488
|
+
const setSpaceSize = (state, action) => {
|
|
1489
|
+
const newState = getNewState(state);
|
|
1490
|
+
return Object.assign(Object.assign({}, newState), {
|
|
1491
|
+
spaceSize: Object.assign({}, action.payload)
|
|
1492
|
+
});
|
|
1493
|
+
};
|
|
1395
1494
|
|
|
1396
1495
|
const updateSpaceTreePlane = (state, action) => {
|
|
1397
|
-
const
|
|
1398
|
-
|
|
1496
|
+
const newState = getNewState(state);
|
|
1497
|
+
const updatedTree = general$1.tree.updateTreePlane(newState.tree, action.payload);
|
|
1498
|
+
return Object.assign(Object.assign({}, newState), {
|
|
1399
1499
|
tree: updatedTree
|
|
1400
1500
|
});
|
|
1401
1501
|
};
|
|
1402
1502
|
|
|
1403
1503
|
const updateSpaceLinkCoordinates = (state, action) => {
|
|
1404
1504
|
const {planeID: planeID, linkCoordinates: linkCoordinates} = action.payload;
|
|
1405
|
-
const
|
|
1406
|
-
|
|
1505
|
+
const newState = getNewState(state);
|
|
1506
|
+
const updatedTree = general$1.tree.updateTreeByPlaneIDWithLinkCoordinates(newState.tree, planeID, linkCoordinates);
|
|
1507
|
+
return Object.assign(Object.assign({}, newState), {
|
|
1407
1508
|
tree: updatedTree
|
|
1408
1509
|
});
|
|
1409
1510
|
};
|
|
1410
1511
|
|
|
1411
|
-
const spaceSetView = (state, action) =>
|
|
1412
|
-
|
|
1413
|
-
})
|
|
1512
|
+
const spaceSetView = (state, action) => {
|
|
1513
|
+
const newState = getNewState(state);
|
|
1514
|
+
return Object.assign(Object.assign({}, newState), {
|
|
1515
|
+
view: action.payload
|
|
1516
|
+
});
|
|
1517
|
+
};
|
|
1414
1518
|
|
|
1415
|
-
const spaceSetCulledView = (state, action) =>
|
|
1416
|
-
|
|
1417
|
-
})
|
|
1519
|
+
const spaceSetCulledView = (state, action) => {
|
|
1520
|
+
const newState = getNewState(state);
|
|
1521
|
+
return Object.assign(Object.assign({}, newState), {
|
|
1522
|
+
culledView: action.payload
|
|
1523
|
+
});
|
|
1524
|
+
};
|
|
1418
1525
|
|
|
1419
1526
|
var index$9 = Object.freeze({
|
|
1420
1527
|
__proto__: null,
|
|
1528
|
+
setSpaceField: setSpaceField,
|
|
1421
1529
|
setSpaceLoading: setSpaceLoading,
|
|
1530
|
+
setTransform: setTransform,
|
|
1422
1531
|
setAnimatedTransform: setAnimatedTransform,
|
|
1423
1532
|
setTransformTime: setTransformTime,
|
|
1424
1533
|
setSpaceLocation: setSpaceLocation,
|
|
@@ -1469,9 +1578,15 @@ const reducer$2 = (state = initialState$2, action) => {
|
|
|
1469
1578
|
case SET_STATE:
|
|
1470
1579
|
return Object.assign(Object.assign({}, state), action.payload.space);
|
|
1471
1580
|
|
|
1581
|
+
case SET_SPACE_FIELD:
|
|
1582
|
+
return setSpaceField(state, action);
|
|
1583
|
+
|
|
1472
1584
|
case SET_SPACE_LOADING:
|
|
1473
1585
|
return setSpaceLoading(state, action);
|
|
1474
1586
|
|
|
1587
|
+
case SET_TRANSFORM:
|
|
1588
|
+
return setTransform(state, action);
|
|
1589
|
+
|
|
1475
1590
|
case SET_ANIMATED_TRANSFORM:
|
|
1476
1591
|
return setAnimatedTransform(state, action);
|
|
1477
1592
|
|
|
@@ -1608,6 +1723,8 @@ const reducer$2 = (state = initialState$2, action) => {
|
|
|
1608
1723
|
|
|
1609
1724
|
const getLoading = state => state.space.loading;
|
|
1610
1725
|
|
|
1726
|
+
const getTransformMatrix = state => state.space.transform;
|
|
1727
|
+
|
|
1611
1728
|
const getAnimatedTransform = state => state.space.animatedTransform;
|
|
1612
1729
|
|
|
1613
1730
|
const getTransformTime = state => state.space.transformTime;
|
|
@@ -1647,6 +1764,7 @@ const getCulledView = state => state.space.culledView;
|
|
|
1647
1764
|
|
|
1648
1765
|
var index$8 = {
|
|
1649
1766
|
getLoading: getLoading,
|
|
1767
|
+
getTransformMatrix: getTransformMatrix,
|
|
1650
1768
|
getAnimatedTransform: getAnimatedTransform,
|
|
1651
1769
|
getTransformTime: getTransformTime,
|
|
1652
1770
|
getRotationX: getRotationX,
|
|
@@ -2276,8 +2394,7 @@ const StyledPluridPlane = styled.div`
|
|
|
2276
2394
|
height: auto;
|
|
2277
2395
|
width: 100%;
|
|
2278
2396
|
font-size: 0.9rem;
|
|
2279
|
-
font-family:
|
|
2280
|
-
'Open Sans', 'Helvetica Neue', 'Lucida Sans', sans-serif;
|
|
2397
|
+
font-family: ${({theme: theme}) => theme.fontFamilySansSerif};
|
|
2281
2398
|
transition: background-color 300ms linear;
|
|
2282
2399
|
|
|
2283
2400
|
display: grid;
|
|
@@ -2322,14 +2439,14 @@ const PluridPlaneBridge = properties => {
|
|
|
2322
2439
|
});
|
|
2323
2440
|
};
|
|
2324
2441
|
|
|
2325
|
-
const mapStateToProperties$
|
|
2442
|
+
const mapStateToProperties$i = state => ({
|
|
2326
2443
|
stateGeneralTheme: selectors.themes.getGeneralTheme(state),
|
|
2327
2444
|
stateConfiguration: selectors.configuration.getConfiguration(state)
|
|
2328
2445
|
});
|
|
2329
2446
|
|
|
2330
|
-
const mapDispatchToProperties$
|
|
2447
|
+
const mapDispatchToProperties$i = dispatch => ({});
|
|
2331
2448
|
|
|
2332
|
-
const ConnectedPluridPlaneBridge = connect(mapStateToProperties$
|
|
2449
|
+
const ConnectedPluridPlaneBridge = connect(mapStateToProperties$i, mapDispatchToProperties$i, null, {
|
|
2333
2450
|
context: StateContext
|
|
2334
2451
|
})(PluridPlaneBridge);
|
|
2335
2452
|
|
|
@@ -2380,9 +2497,9 @@ const PluridPlaneControls = properties => {
|
|
|
2380
2497
|
const {route: route, routeDivisions: routeDivisions} = treePlane;
|
|
2381
2498
|
const {protocol: protocol, host: host} = routeDivisions;
|
|
2382
2499
|
const gateway = "gateway";
|
|
2383
|
-
|
|
2384
|
-
const [path, setPath] = useState(
|
|
2385
|
-
|
|
2500
|
+
`${protocol}://${host.value}/${gateway}?plurid=` + encodeURIComponent(route);
|
|
2501
|
+
const [path, setPath] = useState(treePlane.route);
|
|
2502
|
+
useState(false);
|
|
2386
2503
|
const [showSearch, setShowSearch] = useState(false);
|
|
2387
2504
|
const onPathInput = event => {
|
|
2388
2505
|
setPath(event.target.value);
|
|
@@ -2410,29 +2527,27 @@ const PluridPlaneControls = properties => {
|
|
|
2410
2527
|
"data-plurid-entity": PLURID_ENTITY_PLANE_CONTROLS
|
|
2411
2528
|
}, React.createElement(StyledPluridPlaneControlsLeft, null), React.createElement(StyledPluridPlaneControlsCenter, null, React.createElement(PluridTextline, {
|
|
2412
2529
|
theme: interactionTheme,
|
|
2413
|
-
text:
|
|
2530
|
+
text: path,
|
|
2414
2531
|
atChange: onPathInput,
|
|
2415
2532
|
atKeyDown: handleOnKeyDown,
|
|
2416
2533
|
ariaLabel: "Plurid Pathbar"
|
|
2417
2534
|
})), React.createElement(StyledPluridPlaneControlsRight, null));
|
|
2418
2535
|
};
|
|
2419
2536
|
|
|
2420
|
-
const mapStateToProps$
|
|
2537
|
+
const mapStateToProps$g = state => ({
|
|
2421
2538
|
configuration: selectors.configuration.getConfiguration(state),
|
|
2422
2539
|
generalTheme: selectors.themes.getGeneralTheme(state),
|
|
2423
2540
|
interactionTheme: selectors.themes.getInteractionTheme(state)
|
|
2424
2541
|
});
|
|
2425
2542
|
|
|
2426
|
-
const mapDispatchToProps$
|
|
2543
|
+
const mapDispatchToProps$g = dispatch => ({});
|
|
2427
2544
|
|
|
2428
|
-
const ConnectedPluridPlaneControls = connect(mapStateToProps$
|
|
2545
|
+
const ConnectedPluridPlaneControls = connect(mapStateToProps$g, mapDispatchToProps$g, null, {
|
|
2429
2546
|
context: StateContext
|
|
2430
2547
|
})(PluridPlaneControls);
|
|
2431
2548
|
|
|
2432
2549
|
const StyledPluridPlaneContent = styled.div`
|
|
2433
2550
|
position: relative;
|
|
2434
|
-
font-family: initial !important;
|
|
2435
|
-
font-size: initial !important;
|
|
2436
2551
|
`;
|
|
2437
2552
|
|
|
2438
2553
|
const PluridPlaneContent = properties => {
|
|
@@ -2484,17 +2599,17 @@ const PluridPlane = properties => {
|
|
|
2484
2599
|
}, React.createElement(PluridPlaneContent, Object.assign({}, planeContentProperties), children)) : React.createElement(PluridPlaneContent, Object.assign({}, planeContentProperties), children)));
|
|
2485
2600
|
};
|
|
2486
2601
|
|
|
2487
|
-
const mapStateToProps$
|
|
2602
|
+
const mapStateToProps$f = state => ({
|
|
2488
2603
|
stateViewSize: selectors.space.getViewSize(state),
|
|
2489
2604
|
stateGeneralTheme: selectors.themes.getGeneralTheme(state),
|
|
2490
2605
|
stateConfiguration: selectors.configuration.getConfiguration(state)
|
|
2491
2606
|
});
|
|
2492
2607
|
|
|
2493
|
-
const mapDispatchToProps$
|
|
2608
|
+
const mapDispatchToProps$f = dispatch => ({
|
|
2494
2609
|
dispatchUpdateSpaceTreePlane: treePlane => dispatch(actions.space.updateSpaceTreePlane(treePlane))
|
|
2495
2610
|
});
|
|
2496
2611
|
|
|
2497
|
-
const ConnectedPluridPlane = connect(mapStateToProps$
|
|
2612
|
+
const ConnectedPluridPlane = connect(mapStateToProps$f, mapDispatchToProps$f, null, {
|
|
2498
2613
|
context: StateContext
|
|
2499
2614
|
})(PluridPlane);
|
|
2500
2615
|
|
|
@@ -2636,112 +2751,47 @@ const PluridRoot = properties => {
|
|
|
2636
2751
|
}, React.createElement(Plane, Object.assign({}, planeProperties)))), childrenPlanes);
|
|
2637
2752
|
};
|
|
2638
2753
|
|
|
2639
|
-
const mapStateToProperties$
|
|
2754
|
+
const mapStateToProperties$h = state => ({});
|
|
2640
2755
|
|
|
2641
|
-
const mapDispatchToProperties$
|
|
2756
|
+
const mapDispatchToProperties$h = dispatch => ({});
|
|
2642
2757
|
|
|
2643
|
-
const ConnectedPluridRoot = connect(mapStateToProperties$
|
|
2758
|
+
const ConnectedPluridRoot = connect(mapStateToProperties$h, mapDispatchToProperties$h, null, {
|
|
2644
2759
|
context: StateContext
|
|
2645
2760
|
})(PluridRoot);
|
|
2646
2761
|
|
|
2647
2762
|
const StyledPluridRoots = styled.div`
|
|
2648
2763
|
transform-style: preserve-3d;
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
const StyledTransformOrigin = styled.div`
|
|
2652
|
-
background-color: ${({theme: theme}) => theme.backgroundColorTertiaryAlpha};
|
|
2653
|
-
height: ${({transformOriginSize: transformOriginSize}) => {
|
|
2654
|
-
switch (transformOriginSize) {
|
|
2655
|
-
case SIZES.SMALL:
|
|
2656
|
-
return "5px";
|
|
2657
|
-
|
|
2658
|
-
case SIZES.NORMAL:
|
|
2659
|
-
return "10px";
|
|
2660
|
-
|
|
2661
|
-
case SIZES.LARGE:
|
|
2662
|
-
return "15px";
|
|
2663
|
-
|
|
2664
|
-
default:
|
|
2665
|
-
return "10px";
|
|
2666
|
-
}
|
|
2667
|
-
}};
|
|
2668
|
-
width: ${({transformOriginSize: transformOriginSize}) => {
|
|
2669
|
-
switch (transformOriginSize) {
|
|
2670
|
-
case SIZES.SMALL:
|
|
2671
|
-
return "5px";
|
|
2672
|
-
|
|
2673
|
-
case SIZES.NORMAL:
|
|
2674
|
-
return "10px";
|
|
2675
|
-
|
|
2676
|
-
case SIZES.LARGE:
|
|
2677
|
-
return "15px";
|
|
2678
|
-
|
|
2679
|
-
default:
|
|
2680
|
-
return "10px";
|
|
2681
|
-
}
|
|
2682
|
-
}};
|
|
2683
|
-
|
|
2684
|
-
position: absolute;
|
|
2685
|
-
z-index: 999;
|
|
2686
|
-
border-radius: 100px;
|
|
2687
|
-
user-select: none;
|
|
2688
|
-
pointer-events: none;
|
|
2689
|
-
touch-action: none;
|
|
2764
|
+
transform-origin: 0 0 0;
|
|
2690
2765
|
`;
|
|
2691
2766
|
|
|
2692
2767
|
const PluridRoots = properties => {
|
|
2693
|
-
const {
|
|
2694
|
-
const {space: space} = stateConfiguration;
|
|
2695
|
-
const {transformOrigin: transformOrigin} = space;
|
|
2696
|
-
const {show: showTransformOrigin, size: transformOriginSize} = transformOrigin;
|
|
2697
|
-
const innerWidth = typeof window === "undefined" ? 720 : window.innerWidth / 2;
|
|
2698
|
-
const innerHeight = typeof window === "undefined" ? 400 : window.innerHeight / 2;
|
|
2699
|
-
const transformOriginX = spaceTranslationX * -1 + innerWidth;
|
|
2700
|
-
const transformOriginY = spaceTranslationY * -1 + innerHeight;
|
|
2701
|
-
const transformOriginZ = spaceTranslationZ * -1;
|
|
2702
|
-
const transformOriginSizeDifference = transformOriginSize === SIZES.SMALL ? 2.5 : transformOriginSize === SIZES.NORMAL ? 5 : 7.5;
|
|
2768
|
+
const {spaceTransformMatrix: spaceTransformMatrix, spaceAnimatedTransform: spaceAnimatedTransform, spaceTransformTime: spaceTransformTime, stateTree: stateTree} = properties;
|
|
2703
2769
|
return React.createElement(StyledPluridRoots, {
|
|
2704
2770
|
suppressHydrationWarning: true,
|
|
2705
2771
|
style: {
|
|
2706
2772
|
width: "100%",
|
|
2707
2773
|
height: typeof window !== "undefined" ? window.innerHeight + "px" : "821px",
|
|
2708
|
-
transform:
|
|
2709
|
-
transition:
|
|
2710
|
-
transformOrigin: cleanTemplate(`\n ${transformOriginX}px\n ${transformOriginY}px\n ${transformOriginZ}px\n `)
|
|
2774
|
+
transform: spaceTransformMatrix,
|
|
2775
|
+
transition: spaceAnimatedTransform ? `transform ${spaceTransformTime}ms ease-in-out` : "initial"
|
|
2711
2776
|
},
|
|
2712
2777
|
"data-plurid-entity": PLURID_ENTITY_ROOTS
|
|
2713
|
-
},
|
|
2714
|
-
suppressHydrationWarning: true,
|
|
2715
|
-
theme: interactionTheme,
|
|
2716
|
-
transformOriginSize: transformOriginSize,
|
|
2717
|
-
style: {
|
|
2718
|
-
transform: cleanTemplate(`\n rotateY(${-spaceRotationY}deg)\n translateX(${transformOriginX - transformOriginSizeDifference}px)\n translateY(${transformOriginY - transformOriginSizeDifference}px)\n translateZ(${transformOriginZ + 5}px)\n `),
|
|
2719
|
-
transformOrigin: cleanTemplate(`\n ${transformOriginX - transformOriginSizeDifference}px\n ${transformOriginY - transformOriginSizeDifference}px\n ${transformOriginZ}px\n `)
|
|
2720
|
-
},
|
|
2721
|
-
"data-plurid-entity": PLURID_ENTITY_TRANSFORM_ORIGIN
|
|
2722
|
-
}), stateTree.map((plane => React.createElement(ConnectedPluridRoot, {
|
|
2778
|
+
}, stateTree.map((plane => React.createElement(ConnectedPluridRoot, {
|
|
2723
2779
|
key: plane.planeID,
|
|
2724
2780
|
plane: plane
|
|
2725
2781
|
}))));
|
|
2726
2782
|
};
|
|
2727
2783
|
|
|
2728
|
-
const mapStateToProperties$
|
|
2784
|
+
const mapStateToProperties$g = state => ({
|
|
2729
2785
|
stateConfiguration: selectors.configuration.getConfiguration(state),
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
spaceScale: selectors.space.getScale(state),
|
|
2734
|
-
spaceRotationX: selectors.space.getRotationX(state),
|
|
2735
|
-
spaceRotationY: selectors.space.getRotationY(state),
|
|
2736
|
-
spaceTranslationX: selectors.space.getTranslationX(state),
|
|
2737
|
-
spaceTranslationY: selectors.space.getTranslationY(state),
|
|
2738
|
-
spaceTranslationZ: selectors.space.getTranslationZ(state),
|
|
2786
|
+
spaceTransformMatrix: selectors.space.getTransformMatrix(state),
|
|
2787
|
+
spaceAnimatedTransform: selectors.space.getAnimatedTransform(state),
|
|
2788
|
+
spaceTransformTime: selectors.space.getTransformTime(state),
|
|
2739
2789
|
stateTree: selectors.space.getTree(state)
|
|
2740
2790
|
});
|
|
2741
2791
|
|
|
2742
|
-
const mapDispatchToProperties$
|
|
2792
|
+
const mapDispatchToProperties$g = dispatch => ({});
|
|
2743
2793
|
|
|
2744
|
-
const ConnectedPluridRoots = connect(mapStateToProperties$
|
|
2794
|
+
const ConnectedPluridRoots = connect(mapStateToProperties$g, mapDispatchToProperties$g, null, {
|
|
2745
2795
|
context: StateContext
|
|
2746
2796
|
})(PluridRoots);
|
|
2747
2797
|
|
|
@@ -2805,17 +2855,76 @@ const PluridSpace = properties => {
|
|
|
2805
2855
|
}, React.createElement(ConnectedPluridRoots, null));
|
|
2806
2856
|
};
|
|
2807
2857
|
|
|
2808
|
-
const mapStateToProperties$
|
|
2858
|
+
const mapStateToProperties$f = state => ({
|
|
2809
2859
|
stateConfiguration: selectors.configuration.getConfiguration(state),
|
|
2810
2860
|
stateGeneralTheme: selectors.themes.getGeneralTheme(state)
|
|
2811
2861
|
});
|
|
2812
2862
|
|
|
2813
|
-
const mapDispatchToProperties$
|
|
2863
|
+
const mapDispatchToProperties$f = dispatch => ({});
|
|
2814
2864
|
|
|
2815
|
-
const ConnectedPluridSpace = connect(mapStateToProperties$
|
|
2865
|
+
const ConnectedPluridSpace = connect(mapStateToProperties$f, mapDispatchToProperties$f, null, {
|
|
2816
2866
|
context: StateContext
|
|
2817
2867
|
})(PluridSpace);
|
|
2818
2868
|
|
|
2869
|
+
const resolveSize = ({size: size}) => {
|
|
2870
|
+
switch (size) {
|
|
2871
|
+
case SIZES.SMALL:
|
|
2872
|
+
return "5px";
|
|
2873
|
+
|
|
2874
|
+
case SIZES.NORMAL:
|
|
2875
|
+
return "10px";
|
|
2876
|
+
|
|
2877
|
+
case SIZES.LARGE:
|
|
2878
|
+
return "15px";
|
|
2879
|
+
|
|
2880
|
+
default:
|
|
2881
|
+
return "10px";
|
|
2882
|
+
}
|
|
2883
|
+
};
|
|
2884
|
+
|
|
2885
|
+
const StyledOrigin = styled.div`
|
|
2886
|
+
background-color: ${({theme: theme}) => theme.backgroundColorTertiaryAlpha};
|
|
2887
|
+
height: ${resolveSize};
|
|
2888
|
+
width: ${resolveSize};
|
|
2889
|
+
|
|
2890
|
+
position: absolute;
|
|
2891
|
+
top: 50%;
|
|
2892
|
+
left: 50%;
|
|
2893
|
+
transform: translateX(-50%) translateY(-50%);
|
|
2894
|
+
z-index: 99999;
|
|
2895
|
+
border-radius: 100px;
|
|
2896
|
+
user-select: none;
|
|
2897
|
+
pointer-events: none;
|
|
2898
|
+
touch-action: none;
|
|
2899
|
+
`;
|
|
2900
|
+
|
|
2901
|
+
const Origin = properties => {
|
|
2902
|
+
const {stateGeneralTheme: stateGeneralTheme, stateConfiguration: stateConfiguration} = properties;
|
|
2903
|
+
const {space: space} = stateConfiguration;
|
|
2904
|
+
const {transformOrigin: transformOrigin} = space;
|
|
2905
|
+
const {show: showTransformOrigin, size: transformOriginSize} = transformOrigin;
|
|
2906
|
+
if (!showTransformOrigin) {
|
|
2907
|
+
return React.createElement(React.Fragment, null);
|
|
2908
|
+
}
|
|
2909
|
+
return React.createElement(StyledOrigin, {
|
|
2910
|
+
theme: stateGeneralTheme,
|
|
2911
|
+
size: transformOriginSize,
|
|
2912
|
+
"data-plurid-entity": PLURID_ENTITY_TRANSFORM_ORIGIN
|
|
2913
|
+
});
|
|
2914
|
+
};
|
|
2915
|
+
|
|
2916
|
+
const mapStateToProperties$e = state => ({
|
|
2917
|
+
stateGeneralTheme: selectors.themes.getGeneralTheme(state),
|
|
2918
|
+
stateInteractionTheme: selectors.themes.getInteractionTheme(state),
|
|
2919
|
+
stateConfiguration: selectors.configuration.getConfiguration(state)
|
|
2920
|
+
});
|
|
2921
|
+
|
|
2922
|
+
const mapDispatchToProperties$e = dispatch => ({});
|
|
2923
|
+
|
|
2924
|
+
const ConnectedOrigin = connect(mapStateToProperties$e, mapDispatchToProperties$e, null, {
|
|
2925
|
+
context: StateContext
|
|
2926
|
+
})(Origin);
|
|
2927
|
+
|
|
2819
2928
|
var MENUS;
|
|
2820
2929
|
|
|
2821
2930
|
(function(MENUS) {
|
|
@@ -3076,16 +3185,16 @@ const PluridMenuUniverses = properties => {
|
|
|
3076
3185
|
}, React.createElement(StyledPluridMenuUniversesScroll, null));
|
|
3077
3186
|
};
|
|
3078
3187
|
|
|
3079
|
-
const mapStateToProps$
|
|
3188
|
+
const mapStateToProps$e = state => ({
|
|
3080
3189
|
interactionTheme: selectors.themes.getInteractionTheme(state),
|
|
3081
3190
|
activeUniverseID: selectors.space.getActiveUniverseID(state)
|
|
3082
3191
|
});
|
|
3083
3192
|
|
|
3084
|
-
const mapDispatchToProps$
|
|
3193
|
+
const mapDispatchToProps$e = dispatch => ({
|
|
3085
3194
|
dispatchSetActiveUniverse: documentID => dispatch(actions.space.setActiveUniverse(documentID))
|
|
3086
3195
|
});
|
|
3087
3196
|
|
|
3088
|
-
const ConnectedPluridMenuUniverses = connect(mapStateToProps$
|
|
3197
|
+
const ConnectedPluridMenuUniverses = connect(mapStateToProps$e, mapDispatchToProps$e, null, {
|
|
3089
3198
|
context: StateContext
|
|
3090
3199
|
})(PluridMenuUniverses);
|
|
3091
3200
|
|
|
@@ -3159,14 +3268,14 @@ const PluridDrawer = properties => {
|
|
|
3159
3268
|
}, heading)), toggled && React.createElement(StyledPluridDrawerItems, null, items));
|
|
3160
3269
|
};
|
|
3161
3270
|
|
|
3162
|
-
const mapStateToProps$
|
|
3271
|
+
const mapStateToProps$d = state => ({
|
|
3163
3272
|
interactionTheme: selectors.themes.getInteractionTheme(state),
|
|
3164
3273
|
configuration: selectors.configuration.getConfiguration(state)
|
|
3165
3274
|
});
|
|
3166
3275
|
|
|
3167
|
-
const mapDispatchToProps$
|
|
3276
|
+
const mapDispatchToProps$d = dispatch => ({});
|
|
3168
3277
|
|
|
3169
|
-
const ConnectedPluridDrawer = connect(mapStateToProps$
|
|
3278
|
+
const ConnectedPluridDrawer = connect(mapStateToProps$d, mapDispatchToProps$d, null, {
|
|
3170
3279
|
context: StateContext
|
|
3171
3280
|
})(PluridDrawer);
|
|
3172
3281
|
|
|
@@ -3298,13 +3407,13 @@ const PluridMenuMoreGlobal = properties => {
|
|
|
3298
3407
|
})));
|
|
3299
3408
|
};
|
|
3300
3409
|
|
|
3301
|
-
const mapStateToProps$
|
|
3410
|
+
const mapStateToProps$c = state => ({
|
|
3302
3411
|
stateLanguage: selectors.configuration.getConfiguration(state).global.language,
|
|
3303
3412
|
interactionTheme: selectors.themes.getInteractionTheme(state),
|
|
3304
3413
|
configuration: selectors.configuration.getConfiguration(state)
|
|
3305
3414
|
});
|
|
3306
3415
|
|
|
3307
|
-
const mapDispatchToProps$
|
|
3416
|
+
const mapDispatchToProps$c = dispatch => ({
|
|
3308
3417
|
dispatchSetConfigurationThemeGeneralAction: theme => dispatch(actions.configuration.setConfigurationThemeGeneralAction(theme)),
|
|
3309
3418
|
dispatchSetConfigurationThemeInteractionAction: theme => dispatch(actions.configuration.setConfigurationThemeInteractionAction(theme)),
|
|
3310
3419
|
dispatchSetConfigurationLanguage: language => dispatch(actions.configuration.setConfigurationLanguageAction(language)),
|
|
@@ -3312,7 +3421,7 @@ const mapDispatchToProps$d = dispatch => ({
|
|
|
3312
3421
|
dispatchSetInteractionTheme: theme => dispatch(actions.themes.setInteractionTheme(theme))
|
|
3313
3422
|
});
|
|
3314
3423
|
|
|
3315
|
-
const ConnectedPluridMenuMoreGlobal = connect(mapStateToProps$
|
|
3424
|
+
const ConnectedPluridMenuMoreGlobal = connect(mapStateToProps$c, mapDispatchToProps$c, null, {
|
|
3316
3425
|
context: StateContext
|
|
3317
3426
|
})(PluridMenuMoreGlobal);
|
|
3318
3427
|
|
|
@@ -3373,19 +3482,19 @@ const PluridMenuMoreTransform = properties => {
|
|
|
3373
3482
|
})));
|
|
3374
3483
|
};
|
|
3375
3484
|
|
|
3376
|
-
const mapStateToProps$
|
|
3485
|
+
const mapStateToProps$b = state => ({
|
|
3377
3486
|
stateLanguage: selectors.configuration.getConfiguration(state).global.language,
|
|
3378
3487
|
interactionTheme: selectors.themes.getInteractionTheme(state),
|
|
3379
3488
|
configuration: selectors.configuration.getConfiguration(state)
|
|
3380
3489
|
});
|
|
3381
3490
|
|
|
3382
|
-
const mapDispatchToProps$
|
|
3491
|
+
const mapDispatchToProps$b = dispatch => ({
|
|
3383
3492
|
dispatchToggleConfigurationSpaceTransformMultimode: multimode => dispatch(actions.configuration.toggleConfigurationSpaceTransformMultimode(multimode)),
|
|
3384
3493
|
dispatchSetConfigurationSpaceTransformTouch: touch => dispatch(actions.configuration.setConfigurationSpaceTransformTouch(touch)),
|
|
3385
3494
|
dispatchSetConfigurationSpaceTransformLocks: lock => dispatch(actions.configuration.setConfigurationSpaceTransformLocks(lock))
|
|
3386
3495
|
});
|
|
3387
3496
|
|
|
3388
|
-
const ConnectedPluridMenuMoreTransform = connect(mapStateToProps$
|
|
3497
|
+
const ConnectedPluridMenuMoreTransform = connect(mapStateToProps$b, mapDispatchToProps$b, null, {
|
|
3389
3498
|
context: StateContext
|
|
3390
3499
|
})(PluridMenuMoreTransform);
|
|
3391
3500
|
|
|
@@ -3447,12 +3556,12 @@ const PluridMenuMoreSpace = properties => {
|
|
|
3447
3556
|
})));
|
|
3448
3557
|
};
|
|
3449
3558
|
|
|
3450
|
-
const mapStateToProps$
|
|
3559
|
+
const mapStateToProps$a = state => ({
|
|
3451
3560
|
interactionTheme: selectors.themes.getInteractionTheme(state),
|
|
3452
3561
|
configuration: selectors.configuration.getConfiguration(state)
|
|
3453
3562
|
});
|
|
3454
3563
|
|
|
3455
|
-
const mapDispatchToProps$
|
|
3564
|
+
const mapDispatchToProps$a = dispatch => ({
|
|
3456
3565
|
dispatchSetConfigurationPlaneOpacity: value => dispatch(actions.configuration.setConfigurationPlaneOpacity(value)),
|
|
3457
3566
|
dispatchToggleConfigurationSpaceTransparentUI: () => dispatch(actions.configuration.toggleConfigurationSpaceTransparentUI()),
|
|
3458
3567
|
dispatchToggleConfigurationSpaceShowTransformOrigin: () => dispatch(actions.configuration.toggleConfigurationSpaceShowTransformOrigin()),
|
|
@@ -3460,7 +3569,7 @@ const mapDispatchToProps$b = dispatch => ({
|
|
|
3460
3569
|
dispatchSetConfigurationSpaceLayoutType: layoutType => dispatch(actions.configuration.setConfigurationSpaceLayoutType(layoutType))
|
|
3461
3570
|
});
|
|
3462
3571
|
|
|
3463
|
-
const ConnectedPluridMenuMoreSpace = connect(mapStateToProps$
|
|
3572
|
+
const ConnectedPluridMenuMoreSpace = connect(mapStateToProps$a, mapDispatchToProps$a, null, {
|
|
3464
3573
|
context: StateContext
|
|
3465
3574
|
})(PluridMenuMoreSpace);
|
|
3466
3575
|
|
|
@@ -3507,21 +3616,21 @@ const PluridMenuMoreToolbar = properties => {
|
|
|
3507
3616
|
})));
|
|
3508
3617
|
};
|
|
3509
3618
|
|
|
3510
|
-
const mapStateToProps$
|
|
3619
|
+
const mapStateToProps$9 = state => ({
|
|
3511
3620
|
stateLanguage: selectors.configuration.getConfiguration(state).global.language,
|
|
3512
3621
|
interactionTheme: selectors.themes.getInteractionTheme(state),
|
|
3513
3622
|
configuration: selectors.configuration.getConfiguration(state),
|
|
3514
3623
|
viewSize: selectors.space.getViewSize(state)
|
|
3515
3624
|
});
|
|
3516
3625
|
|
|
3517
|
-
const mapDispatchToProps$
|
|
3626
|
+
const mapDispatchToProps$9 = dispatch => ({
|
|
3518
3627
|
dispatchToggleConfigurationToolbarConceal: () => dispatch(actions.configuration.toggleConfigurationToolbarConceal()),
|
|
3519
3628
|
dispatchToggleConfigurationToolbarTransformIcons: () => dispatch(actions.configuration.toggleConfigurationToolbarTransformIcons()),
|
|
3520
3629
|
dispatchToggleConfigurationToolbarTransformButtons: () => dispatch(actions.configuration.toggleConfigurationToolbarTransformButtons()),
|
|
3521
3630
|
dispatchToggleConfigurationToolbarOpaque: () => dispatch(actions.configuration.toggleConfigurationToolbarOpaque())
|
|
3522
3631
|
});
|
|
3523
3632
|
|
|
3524
|
-
const ConnectedPluridMenuMoreToolbar = connect(mapStateToProps$
|
|
3633
|
+
const ConnectedPluridMenuMoreToolbar = connect(mapStateToProps$9, mapDispatchToProps$9, null, {
|
|
3525
3634
|
context: StateContext
|
|
3526
3635
|
})(PluridMenuMoreToolbar);
|
|
3527
3636
|
|
|
@@ -3562,20 +3671,20 @@ const PluridMenuMoreViewcube = properties => {
|
|
|
3562
3671
|
}))));
|
|
3563
3672
|
};
|
|
3564
3673
|
|
|
3565
|
-
const mapStateToProps$
|
|
3674
|
+
const mapStateToProps$8 = state => ({
|
|
3566
3675
|
stateLanguage: selectors.configuration.getConfiguration(state).global.language,
|
|
3567
3676
|
interactionTheme: selectors.themes.getInteractionTheme(state),
|
|
3568
3677
|
configuration: selectors.configuration.getConfiguration(state)
|
|
3569
3678
|
});
|
|
3570
3679
|
|
|
3571
|
-
const mapDispatchToProps$
|
|
3680
|
+
const mapDispatchToProps$8 = dispatch => ({
|
|
3572
3681
|
dispatchToggleConfigurationViewcubeHide: toggle => dispatch(actions.configuration.toggleConfigurationViewcubeHide(toggle)),
|
|
3573
3682
|
dispatchToggleConfigurationViewcubeButtons: toggle => dispatch(actions.configuration.toggleConfigurationViewcubeButtons(toggle)),
|
|
3574
3683
|
dispatchToggleConfigurationViewcubeOpaque: toggle => dispatch(actions.configuration.toggleConfigurationViewcubeOpaque(toggle)),
|
|
3575
3684
|
dispatchToggleConfigurationViewcubeConceal: () => dispatch(actions.configuration.toggleConfigurationViewcubeConceal())
|
|
3576
3685
|
});
|
|
3577
3686
|
|
|
3578
|
-
const ConnectedPluridMenuMoreViewcube = connect(mapStateToProps$
|
|
3687
|
+
const ConnectedPluridMenuMoreViewcube = connect(mapStateToProps$8, mapDispatchToProps$8, null, {
|
|
3579
3688
|
context: StateContext
|
|
3580
3689
|
})(PluridMenuMoreViewcube);
|
|
3581
3690
|
|
|
@@ -3603,17 +3712,17 @@ const PluridMenuMoreTechnical = properties => {
|
|
|
3603
3712
|
})));
|
|
3604
3713
|
};
|
|
3605
3714
|
|
|
3606
|
-
const mapStateToProps$
|
|
3715
|
+
const mapStateToProps$7 = state => ({
|
|
3607
3716
|
stateLanguage: selectors.configuration.getConfiguration(state).global.language,
|
|
3608
3717
|
stateConfiguration: selectors.configuration.getConfiguration(state),
|
|
3609
3718
|
stateInteractionTheme: selectors.themes.getInteractionTheme(state)
|
|
3610
3719
|
});
|
|
3611
3720
|
|
|
3612
|
-
const mapDispatchToProps$
|
|
3721
|
+
const mapDispatchToProps$7 = dispatch => ({
|
|
3613
3722
|
dispatchSetConfigurationSpaceCullingDistance: value => dispatch(actions.configuration.setConfigurationSpaceCullingDistance(value))
|
|
3614
3723
|
});
|
|
3615
3724
|
|
|
3616
|
-
const ConnectedPluridMenuMoreTechnical = connect(mapStateToProps$
|
|
3725
|
+
const ConnectedPluridMenuMoreTechnical = connect(mapStateToProps$7, mapDispatchToProps$7, null, {
|
|
3617
3726
|
context: StateContext
|
|
3618
3727
|
})(PluridMenuMoreTechnical);
|
|
3619
3728
|
|
|
@@ -3638,14 +3747,14 @@ const PluridMenuMoreShortcuts = properties => {
|
|
|
3638
3747
|
})));
|
|
3639
3748
|
};
|
|
3640
3749
|
|
|
3641
|
-
const mapStateToProps$
|
|
3750
|
+
const mapStateToProps$6 = state => ({
|
|
3642
3751
|
interactionTheme: selectors.themes.getInteractionTheme(state),
|
|
3643
3752
|
configuration: selectors.configuration.getConfiguration(state)
|
|
3644
3753
|
});
|
|
3645
3754
|
|
|
3646
|
-
const mapDispatchToProps$
|
|
3755
|
+
const mapDispatchToProps$6 = dispatch => ({});
|
|
3647
3756
|
|
|
3648
|
-
const ConnectedPluridMenuMoreShortcuts = connect(mapStateToProps$
|
|
3757
|
+
const ConnectedPluridMenuMoreShortcuts = connect(mapStateToProps$6, mapDispatchToProps$6, null, {
|
|
3649
3758
|
context: StateContext
|
|
3650
3759
|
})(PluridMenuMoreShortcuts);
|
|
3651
3760
|
|
|
@@ -3748,19 +3857,19 @@ const PluridMoreMenu = properties => {
|
|
|
3748
3857
|
}))));
|
|
3749
3858
|
};
|
|
3750
3859
|
|
|
3751
|
-
const mapStateToProperties$
|
|
3860
|
+
const mapStateToProperties$d = state => ({
|
|
3752
3861
|
stateLanguage: selectors.configuration.getConfiguration(state).global.language,
|
|
3753
3862
|
stateInteractionTheme: selectors.themes.getInteractionTheme(state),
|
|
3754
3863
|
stateConfiguration: selectors.configuration.getConfiguration(state),
|
|
3755
3864
|
stateToolbarMenuScrollPosition: selectors.ui.getToolbarScrollPosition(state)
|
|
3756
3865
|
});
|
|
3757
3866
|
|
|
3758
|
-
const mapDispatchToProperties$
|
|
3867
|
+
const mapDispatchToProperties$d = dispatch => ({
|
|
3759
3868
|
dispatchToggleConfigurationToolbarToggleDrawer: drawer => dispatch(actions.configuration.toggleConfigurationToolbarToggleDrawer(drawer)),
|
|
3760
3869
|
dispatchSetUIToolbarScrollPosition: value => dispatch(actions.ui.setUIToolbarScrollPosition(value))
|
|
3761
3870
|
});
|
|
3762
3871
|
|
|
3763
|
-
const ConnectedPluridMoreMenu = connect(mapStateToProperties$
|
|
3872
|
+
const ConnectedPluridMoreMenu = connect(mapStateToProperties$d, mapDispatchToProperties$d, null, {
|
|
3764
3873
|
context: StateContext
|
|
3765
3874
|
})(PluridMoreMenu);
|
|
3766
3875
|
|
|
@@ -3785,55 +3894,75 @@ const StyledPluridTransformArrow = styled.div`
|
|
|
3785
3894
|
display: grid;
|
|
3786
3895
|
place-content: center;
|
|
3787
3896
|
padding: 2px;
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3897
|
+
|
|
3898
|
+
background-color: ${({pressed: pressed, theme: theme}) => {
|
|
3899
|
+
if (pressed) {
|
|
3900
|
+
return theme.backgroundColorTertiary;
|
|
3791
3901
|
}
|
|
3792
3902
|
return "initial";
|
|
3793
3903
|
}};
|
|
3794
3904
|
|
|
3795
3905
|
:hover {
|
|
3796
|
-
background-color: ${
|
|
3906
|
+
background-color: ${({theme: theme}) => theme.backgroundColorTertiary};
|
|
3797
3907
|
}
|
|
3798
3908
|
`;
|
|
3799
3909
|
|
|
3910
|
+
const arrowSigns = {
|
|
3911
|
+
left: "◀",
|
|
3912
|
+
right: "▶",
|
|
3913
|
+
up: "▲",
|
|
3914
|
+
down: "▼"
|
|
3915
|
+
};
|
|
3916
|
+
|
|
3800
3917
|
const PluridTransformArrow = properties => {
|
|
3801
3918
|
const {direction: direction, transform: transform, interactionTheme: interactionTheme} = properties;
|
|
3802
|
-
|
|
3919
|
+
const arrowSign = arrowSigns[direction];
|
|
3920
|
+
const pressingInterval = useRef(null);
|
|
3803
3921
|
const arrowElement = useRef(null);
|
|
3804
|
-
const [arrowSign, setArrowSign] = useState("");
|
|
3805
3922
|
const [pressed, setPressed] = useState(false);
|
|
3806
|
-
|
|
3807
|
-
switch (
|
|
3808
|
-
case "
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3923
|
+
const handleTouch = event => {
|
|
3924
|
+
switch (event.type) {
|
|
3925
|
+
case "tap":
|
|
3926
|
+
transform();
|
|
3927
|
+
if (pressingInterval.current) {
|
|
3928
|
+
setPressed(false);
|
|
3929
|
+
clearInterval(pressingInterval.current);
|
|
3930
|
+
}
|
|
3814
3931
|
break;
|
|
3815
3932
|
|
|
3816
|
-
case "
|
|
3817
|
-
|
|
3933
|
+
case "press":
|
|
3934
|
+
setPressed(true);
|
|
3935
|
+
pressingInterval.current = setInterval((() => {
|
|
3936
|
+
transform();
|
|
3937
|
+
}), 30);
|
|
3818
3938
|
break;
|
|
3819
3939
|
|
|
3820
|
-
case "
|
|
3821
|
-
|
|
3940
|
+
case "pressup":
|
|
3941
|
+
setPressed(false);
|
|
3942
|
+
if (pressingInterval.current) {
|
|
3943
|
+
clearInterval(pressingInterval.current);
|
|
3944
|
+
}
|
|
3822
3945
|
break;
|
|
3823
3946
|
}
|
|
3824
|
-
}
|
|
3947
|
+
};
|
|
3948
|
+
const handleMouseLeave = () => {
|
|
3949
|
+
if (pressingInterval.current) {
|
|
3950
|
+
setPressed(false);
|
|
3951
|
+
clearInterval(pressingInterval.current);
|
|
3952
|
+
}
|
|
3953
|
+
};
|
|
3825
3954
|
useEffect((() => {
|
|
3826
3955
|
if (typeof window === "undefined") {
|
|
3827
3956
|
return;
|
|
3828
3957
|
}
|
|
3829
3958
|
let touch;
|
|
3830
|
-
const
|
|
3959
|
+
const loadTouch = () => __awaiter(void 0, void 0, void 0, (function*() {
|
|
3831
3960
|
const HammerImport = yield loadHammer();
|
|
3832
3961
|
const Hammer = HammerImport.default;
|
|
3833
3962
|
touch = new Hammer(arrowElement.current);
|
|
3834
3963
|
touch.on("tap press pressup", handleTouch);
|
|
3835
3964
|
}));
|
|
3836
|
-
|
|
3965
|
+
loadTouch();
|
|
3837
3966
|
return () => {
|
|
3838
3967
|
if (touch) {
|
|
3839
3968
|
touch.off("tap press pressup", handleTouch);
|
|
@@ -3843,17 +3972,18 @@ const PluridTransformArrow = properties => {
|
|
|
3843
3972
|
return React.createElement(StyledPluridTransformArrow, {
|
|
3844
3973
|
ref: arrowElement,
|
|
3845
3974
|
theme: interactionTheme,
|
|
3846
|
-
pressed: pressed
|
|
3975
|
+
pressed: pressed,
|
|
3976
|
+
onMouseLeave: () => handleMouseLeave()
|
|
3847
3977
|
}, arrowSign);
|
|
3848
3978
|
};
|
|
3849
3979
|
|
|
3850
|
-
const mapStateToProps$
|
|
3980
|
+
const mapStateToProps$5 = state => ({
|
|
3851
3981
|
interactionTheme: selectors.themes.getInteractionTheme(state)
|
|
3852
3982
|
});
|
|
3853
3983
|
|
|
3854
|
-
const mapDispatchToProps$
|
|
3984
|
+
const mapDispatchToProps$5 = dispatch => ({});
|
|
3855
3985
|
|
|
3856
|
-
const ConnectedPluridTransformArrow = connect(mapStateToProps$
|
|
3986
|
+
const ConnectedPluridTransformArrow = connect(mapStateToProps$5, mapDispatchToProps$5, null, {
|
|
3857
3987
|
context: StateContext
|
|
3858
3988
|
})(PluridTransformArrow);
|
|
3859
3989
|
|
|
@@ -3883,19 +4013,19 @@ const PluridToolbarRotate = properties => {
|
|
|
3883
4013
|
})));
|
|
3884
4014
|
};
|
|
3885
4015
|
|
|
3886
|
-
const mapStateToProps$
|
|
4016
|
+
const mapStateToProps$4 = state => ({
|
|
3887
4017
|
stateLanguage: selectors.configuration.getConfiguration(state).global.language,
|
|
3888
4018
|
interactionTheme: selectors.themes.getInteractionTheme(state)
|
|
3889
4019
|
});
|
|
3890
4020
|
|
|
3891
|
-
const mapDispatchToProps$
|
|
4021
|
+
const mapDispatchToProps$4 = dispatch => ({
|
|
3892
4022
|
rotateUp: () => dispatch(actions.space.rotateUp()),
|
|
3893
4023
|
rotateDown: () => dispatch(actions.space.rotateDown()),
|
|
3894
4024
|
rotateLeft: () => dispatch(actions.space.rotateLeft()),
|
|
3895
4025
|
rotateRight: () => dispatch(actions.space.rotateRight())
|
|
3896
4026
|
});
|
|
3897
4027
|
|
|
3898
|
-
const ConnectedPluridToolbarRotate = connect(mapStateToProps$
|
|
4028
|
+
const ConnectedPluridToolbarRotate = connect(mapStateToProps$4, mapDispatchToProps$4, null, {
|
|
3899
4029
|
context: StateContext
|
|
3900
4030
|
})(PluridToolbarRotate);
|
|
3901
4031
|
|
|
@@ -3931,17 +4061,17 @@ const PluridToolbarScale = properties => {
|
|
|
3931
4061
|
}));
|
|
3932
4062
|
};
|
|
3933
4063
|
|
|
3934
|
-
const mapStateToProps$
|
|
4064
|
+
const mapStateToProps$3 = state => ({
|
|
3935
4065
|
stateLanguage: selectors.configuration.getConfiguration(state).global.language,
|
|
3936
4066
|
interactionTheme: selectors.themes.getInteractionTheme(state)
|
|
3937
4067
|
});
|
|
3938
4068
|
|
|
3939
|
-
const mapDispatchToProps$
|
|
4069
|
+
const mapDispatchToProps$3 = dispatch => ({
|
|
3940
4070
|
scaleUp: () => dispatch(actions.space.scaleUp()),
|
|
3941
4071
|
scaleDown: () => dispatch(actions.space.scaleDown())
|
|
3942
4072
|
});
|
|
3943
4073
|
|
|
3944
|
-
const ConnectedPluridToolbarScale = connect(mapStateToProps$
|
|
4074
|
+
const ConnectedPluridToolbarScale = connect(mapStateToProps$3, mapDispatchToProps$3, null, {
|
|
3945
4075
|
context: StateContext
|
|
3946
4076
|
})(PluridToolbarScale);
|
|
3947
4077
|
|
|
@@ -3983,19 +4113,19 @@ const PluridToolbarTranslate = properties => {
|
|
|
3983
4113
|
})));
|
|
3984
4114
|
};
|
|
3985
4115
|
|
|
3986
|
-
const
|
|
4116
|
+
const mapStateToProperties$c = state => ({
|
|
3987
4117
|
stateLanguage: selectors.configuration.getConfiguration(state).global.language,
|
|
3988
4118
|
interactionTheme: selectors.themes.getInteractionTheme(state)
|
|
3989
4119
|
});
|
|
3990
4120
|
|
|
3991
|
-
const
|
|
4121
|
+
const mapDispatchToProperties$c = dispatch => ({
|
|
3992
4122
|
translateUp: () => dispatch(actions.space.translateUp()),
|
|
3993
4123
|
translateDown: () => dispatch(actions.space.translateDown()),
|
|
3994
4124
|
translateLeft: () => dispatch(actions.space.translateLeft()),
|
|
3995
4125
|
translateRight: () => dispatch(actions.space.translateRight())
|
|
3996
4126
|
});
|
|
3997
4127
|
|
|
3998
|
-
const ConnectedPluridToolbarTranslate = connect(
|
|
4128
|
+
const ConnectedPluridToolbarTranslate = connect(mapStateToProperties$c, mapDispatchToProperties$c, null, {
|
|
3999
4129
|
context: StateContext
|
|
4000
4130
|
})(PluridToolbarTranslate);
|
|
4001
4131
|
|
|
@@ -4006,6 +4136,7 @@ const PluridToolbar = properties => {
|
|
|
4006
4136
|
const {firstPerson: firstPerson, transformMode: transformMode, fadeInTime: fadeInTime} = space;
|
|
4007
4137
|
const {toolbar: toolbar} = elements;
|
|
4008
4138
|
const {conceal: conceal, opaque: opaque, transformIcons: transformIcons, transformButtons: transformButtons} = toolbar;
|
|
4139
|
+
const showToolbar = toolbar.show;
|
|
4009
4140
|
const menuTimeout = useRef(null);
|
|
4010
4141
|
const [mouseIn, setMouseIn] = useState(false);
|
|
4011
4142
|
const [showMenu, setShowMenu] = useState(MENUS.NONE);
|
|
@@ -4058,6 +4189,9 @@ const PluridToolbar = properties => {
|
|
|
4058
4189
|
}
|
|
4059
4190
|
};
|
|
4060
4191
|
}), [ mouseIn ]);
|
|
4192
|
+
if (!showToolbar) {
|
|
4193
|
+
return React.createElement(React.Fragment, null);
|
|
4194
|
+
}
|
|
4061
4195
|
return React.createElement(StyledToolbar, {
|
|
4062
4196
|
onMouseEnter: () => setMouseIn(true),
|
|
4063
4197
|
onMouseLeave: () => setMouseIn(false),
|
|
@@ -4622,6 +4756,10 @@ const StyledPluridViewcubeModelCube = styled.div`
|
|
|
4622
4756
|
height: 50px;
|
|
4623
4757
|
`;
|
|
4624
4758
|
|
|
4759
|
+
const {matrixArrayToCSSMatrix: matrixArrayToCSSMatrix, rotateMatrix: rotateMatrix, multiplyArrayOfMatrices: multiplyArrayOfMatrices, scaleMatrix: scaleMatrix, translateMatrix: translateMatrix$1} = interaction.matrix;
|
|
4760
|
+
|
|
4761
|
+
const {degToRad: degToRad$1} = interaction.quaternion;
|
|
4762
|
+
|
|
4625
4763
|
const PluridViewcubeModel = properties => {
|
|
4626
4764
|
const {mouseOver: mouseOver, stateLanguage: stateLanguage, spaceRotationX: spaceRotationX, spaceRotationY: spaceRotationY, stateAnimatedTransform: stateAnimatedTransform, stateTransformTime: stateTransformTime} = properties;
|
|
4627
4765
|
const [hoveredZone, setHoveredZone] = useState("");
|
|
@@ -4629,15 +4767,35 @@ const PluridViewcubeModel = properties => {
|
|
|
4629
4767
|
const handleMouseLeave = () => {
|
|
4630
4768
|
setHoveredZone("");
|
|
4631
4769
|
};
|
|
4770
|
+
const computeTransform = () => {
|
|
4771
|
+
const offsets = {
|
|
4772
|
+
x: 32,
|
|
4773
|
+
y: 23,
|
|
4774
|
+
z: 0
|
|
4775
|
+
};
|
|
4776
|
+
const transformOrigins = {
|
|
4777
|
+
x: 0,
|
|
4778
|
+
y: 0,
|
|
4779
|
+
z: 0
|
|
4780
|
+
};
|
|
4781
|
+
const scale = 1;
|
|
4782
|
+
const rotationMatrix = rotateMatrix(degToRad$1(-spaceRotationX), degToRad$1(-spaceRotationY));
|
|
4783
|
+
const translationMatrix = translateMatrix$1(offsets.x, offsets.y, offsets.z);
|
|
4784
|
+
const scalationMatrix = scaleMatrix(scale);
|
|
4785
|
+
const transformMatrix = multiplyArrayOfMatrices([ translationMatrix, multiplyArrayOfMatrices([ translateMatrix$1(transformOrigins.x, transformOrigins.y, transformOrigins.z), rotationMatrix, translateMatrix$1(-transformOrigins.x, -transformOrigins.y, -transformOrigins.z) ]), scalationMatrix ]);
|
|
4786
|
+
const transform = matrixArrayToCSSMatrix(transformMatrix);
|
|
4787
|
+
return transform;
|
|
4788
|
+
};
|
|
4632
4789
|
useEffect((() => {
|
|
4633
4790
|
if (!hoveredZone) {
|
|
4634
4791
|
setActiveZone("");
|
|
4635
4792
|
}
|
|
4636
4793
|
}), [ spaceRotationX, spaceRotationY ]);
|
|
4794
|
+
const transform = computeTransform();
|
|
4637
4795
|
return React.createElement(StyledPluridViewcubeModel, null, React.createElement(StyledPluridViewcubeModelContainer, null, React.createElement(StyledPluridViewcubeModelCube, {
|
|
4638
4796
|
suppressHydrationWarning: true,
|
|
4639
4797
|
style: {
|
|
4640
|
-
transform:
|
|
4798
|
+
transform: transform,
|
|
4641
4799
|
transition: mouseOver || stateAnimatedTransform ? `transform ${stateTransformTime}ms ease-in-out` : ""
|
|
4642
4800
|
},
|
|
4643
4801
|
onMouseLeave: () => handleMouseLeave()
|
|
@@ -4712,6 +4870,7 @@ const PluridViewcube = properties => {
|
|
|
4712
4870
|
const {viewcube: viewcube} = elements;
|
|
4713
4871
|
const {buttons: buttons, conceal: conceal} = viewcube;
|
|
4714
4872
|
const {fadeInTime: fadeInTime} = space;
|
|
4873
|
+
const showViewcube = viewcube.show;
|
|
4715
4874
|
const [mouseOver, setMouseOver] = useState(false);
|
|
4716
4875
|
const [isMounted, setIsMounted] = useState(false);
|
|
4717
4876
|
const animatedRotate = (type, value) => {
|
|
@@ -4742,6 +4901,9 @@ const PluridViewcube = properties => {
|
|
|
4742
4901
|
useEffect((() => {
|
|
4743
4902
|
setIsMounted(true);
|
|
4744
4903
|
}), []);
|
|
4904
|
+
if (!showViewcube) {
|
|
4905
|
+
return React.createElement(React.Fragment, null);
|
|
4906
|
+
}
|
|
4745
4907
|
return React.createElement(StyledPluridViewcube, {
|
|
4746
4908
|
onMouseEnter: () => setMouseOver(true),
|
|
4747
4909
|
onMouseLeave: () => setMouseOver(false),
|
|
@@ -4806,18 +4968,9 @@ const ConnectedPluridViewcube = connect(mapStateToProperties$8, mapDispatchToPro
|
|
|
4806
4968
|
context: StateContext
|
|
4807
4969
|
})(PluridViewcube);
|
|
4808
4970
|
|
|
4809
|
-
const PluridPlanesView = properties =>
|
|
4810
|
-
const {stateConfiguration: stateConfiguration} = properties;
|
|
4811
|
-
const {elements: elements} = stateConfiguration;
|
|
4812
|
-
const {toolbar: toolbar, viewcube: viewcube} = elements;
|
|
4813
|
-
const showToolbar = toolbar.show;
|
|
4814
|
-
const showViewcube = viewcube.show;
|
|
4815
|
-
return React.createElement(React.Fragment, null, React.createElement(ConnectedPluridSpace, null), showToolbar && React.createElement(ConnectedPluridToolbar, null), showViewcube && React.createElement(ConnectedPluridViewcube, null));
|
|
4816
|
-
};
|
|
4971
|
+
const PluridPlanesView = properties => React.createElement(React.Fragment, null, React.createElement(ConnectedPluridSpace, null), React.createElement(ConnectedOrigin, null), React.createElement(ConnectedPluridToolbar, null), React.createElement(ConnectedPluridViewcube, null));
|
|
4817
4972
|
|
|
4818
|
-
const mapStateToProps$2 = state => ({
|
|
4819
|
-
stateConfiguration: selectors.configuration.getConfiguration(state)
|
|
4820
|
-
});
|
|
4973
|
+
const mapStateToProps$2 = state => ({});
|
|
4821
4974
|
|
|
4822
4975
|
const mapDispatchToProps$2 = dispatch => ({});
|
|
4823
4976
|
|
|
@@ -5246,9 +5399,6 @@ const PluridView = properties => {
|
|
|
5246
5399
|
handlePubSubPublish(pubsub);
|
|
5247
5400
|
}
|
|
5248
5401
|
}), [ pluridPubSub.length, stateConfiguration, stateTransform ]);
|
|
5249
|
-
useEffect((() => {
|
|
5250
|
-
treeUpdateCallback();
|
|
5251
|
-
}), [ stateSpaceView ]);
|
|
5252
5402
|
const pluridContext = {
|
|
5253
5403
|
planesRegistrar: planesRegistrar,
|
|
5254
5404
|
planeContext: planeContext,
|
|
@@ -6107,13 +6257,21 @@ const {resolveRoute: resolveRoute, computePlaneAddress: computePlaneAddress} = r
|
|
|
6107
6257
|
|
|
6108
6258
|
const {getPlanesRegistrar: getPlanesRegistrar, getPluridPlaneIDByData: getPluridPlaneIDByData$1} = planes;
|
|
6109
6259
|
|
|
6260
|
+
const {degToRad: degToRad, radToDeg: radToDeg} = interaction.quaternion;
|
|
6261
|
+
|
|
6262
|
+
const {multiplyMatrices: multiplyMatrices, translateMatrix: translateMatrix, rotateYMatrix: rotateYMatrix} = interaction.transform.general;
|
|
6263
|
+
|
|
6264
|
+
const {getTransformRotate: getTransformRotate, getTransformTranslate: getTransformTranslate, getTransformScale: getTransformScale} = interaction.transform.matrix3d;
|
|
6265
|
+
|
|
6110
6266
|
const PluridLink = properties => {
|
|
6111
|
-
const {children: children, route: planeRoute, devisible: _devisible, suffix: _suffix, atClick: atClick, style: style, className: className, stateTree: stateTree, stateGeneralTheme: stateGeneralTheme, stateConfiguration: stateConfiguration, stateViewSize: stateViewSize, dispatchSetTree: dispatchSetTree, dispatchUpdateSpaceLinkCoordinates: dispatchUpdateSpaceLinkCoordinates} = properties;
|
|
6267
|
+
const {children: children, route: planeRoute, devisible: _devisible, suffix: _suffix, atClick: atClick, style: style, className: className, stateTree: stateTree, stateGeneralTheme: stateGeneralTheme, stateConfiguration: stateConfiguration, stateViewSize: stateViewSize, dispatchSetTree: dispatchSetTree, dispatchSetAnimatedTransform: dispatchSetAnimatedTransform, dispatchSetTransform: dispatchSetTransform, dispatchSetSpaceField: dispatchSetSpaceField, dispatchUpdateSpaceLinkCoordinates: dispatchUpdateSpaceLinkCoordinates} = properties;
|
|
6112
6268
|
const planeControls = stateConfiguration.elements.plane.controls.show;
|
|
6113
6269
|
const previewAppearTime = PLURID_DEFAULT_CONFIGURATION_LINK_PREVIEW_FADE_IN;
|
|
6114
6270
|
const previewDisappearTime = PLURID_DEFAULT_CONFIGURATION_LINK_PREVIEW_FADE_OUT;
|
|
6115
6271
|
const planeRouteResolved = computePlaneAddress(planeRoute);
|
|
6116
6272
|
const absolutePlaneRoute = resolveRoute(planeRouteResolved, stateConfiguration.network.protocol, stateConfiguration.network.host);
|
|
6273
|
+
const suffix = _suffix !== null && _suffix !== void 0 ? _suffix : PLURID_DEFAULT_CONFIGURATION_LINK_SUFFIX;
|
|
6274
|
+
const devisible = _devisible !== null && _devisible !== void 0 ? _devisible : false;
|
|
6117
6275
|
const context = useContext(Context);
|
|
6118
6276
|
if (!context) {
|
|
6119
6277
|
return React.createElement(React.Fragment, null, children);
|
|
@@ -6133,8 +6291,6 @@ const PluridLink = properties => {
|
|
|
6133
6291
|
const [pluridPlaneID, setPluridPlaneID] = useState("");
|
|
6134
6292
|
const [parentPlaneID, setParentPlaneID] = useState("");
|
|
6135
6293
|
const [linkCoordinates, setLinkCoordinates] = useState(defaultLinkCoordinates);
|
|
6136
|
-
const [suffix, setSuffix] = useState(_suffix !== null && _suffix !== void 0 ? _suffix : PLURID_DEFAULT_CONFIGURATION_LINK_SUFFIX);
|
|
6137
|
-
const [devisible, setDevisible] = useState(_devisible !== null && _devisible !== void 0 ? _devisible : false);
|
|
6138
6294
|
const getPluridLinkCoordinates = () => {
|
|
6139
6295
|
const link = linkElement.current;
|
|
6140
6296
|
if (!link) {
|
|
@@ -6184,38 +6340,69 @@ const PluridLink = properties => {
|
|
|
6184
6340
|
y: y
|
|
6185
6341
|
};
|
|
6186
6342
|
};
|
|
6187
|
-
const
|
|
6188
|
-
const linkCoordinates = getPluridLinkCoordinates();
|
|
6189
|
-
const payload = {
|
|
6190
|
-
planeID: pluridPlaneID,
|
|
6191
|
-
linkCoordinates: linkCoordinates
|
|
6192
|
-
};
|
|
6193
|
-
dispatchUpdateSpaceLinkCoordinates(payload);
|
|
6194
|
-
};
|
|
6195
|
-
const updateTreeWithLink = () => {
|
|
6343
|
+
const updateTreeWithLink = event => {
|
|
6196
6344
|
if (!parentPlaneID || !absolutePlaneRoute) {
|
|
6197
6345
|
return;
|
|
6198
6346
|
}
|
|
6199
6347
|
const {route: route} = absolutePlaneRoute;
|
|
6200
6348
|
const linkCoordinates = getPluridLinkCoordinates();
|
|
6201
|
-
const {pluridPlaneID: pluridPlaneID, updatedTree: updatedTree} = space$1.tree.logic.updateTreeWithNewPlane(route, parentPlaneID, linkCoordinates, stateTree, planesRegistry.getAll(), stateConfiguration);
|
|
6349
|
+
const {pluridPlaneID: pluridPlaneID, updatedTree: updatedTree, updatedTreePlane: updatedTreePlane} = space$1.tree.logic.updateTreeWithNewPlane(route, parentPlaneID, linkCoordinates, stateTree, planesRegistry.getAll(), stateConfiguration);
|
|
6202
6350
|
if (pluridPlaneID) {
|
|
6351
|
+
navigateToPluridPlane(event, updatedTreePlane);
|
|
6203
6352
|
dispatchSetTree(updatedTree);
|
|
6204
6353
|
setShowLink(true);
|
|
6205
6354
|
setPluridPlaneID(pluridPlaneID);
|
|
6206
6355
|
}
|
|
6207
6356
|
};
|
|
6208
|
-
const toggleLinkFromTree =
|
|
6209
|
-
const updatedTree = space$1.tree.logic.togglePlaneFromTree(stateTree, pluridPlaneID);
|
|
6357
|
+
const toggleLinkFromTree = event => {
|
|
6358
|
+
const {updatedTree: updatedTree, updatedPlane: updatedPlane} = space$1.tree.logic.togglePlaneFromTree(stateTree, pluridPlaneID);
|
|
6359
|
+
navigateToPluridPlane(event, updatedPlane);
|
|
6210
6360
|
dispatchSetTree(updatedTree);
|
|
6211
6361
|
setShowLink((show => !show));
|
|
6212
6362
|
setShowPreview(false);
|
|
6213
6363
|
};
|
|
6214
|
-
const
|
|
6364
|
+
const navigateToPluridPlane = (event, updatedPlane) => {
|
|
6365
|
+
if (!updatedPlane) {
|
|
6366
|
+
return;
|
|
6367
|
+
}
|
|
6368
|
+
if (showLink) {
|
|
6369
|
+
return;
|
|
6370
|
+
}
|
|
6371
|
+
if (event.ctrlKey || event.metaKey) {
|
|
6372
|
+
return;
|
|
6373
|
+
}
|
|
6374
|
+
const {location: location} = updatedPlane;
|
|
6375
|
+
const {translateX: translateX, translateY: translateY, translateZ: translateZ, rotateY: rotateY} = location;
|
|
6376
|
+
const zSign1 = rotateY < 100 ? 1 : -1;
|
|
6377
|
+
const zSign2 = rotateY < 100 ? -1 : 1;
|
|
6378
|
+
const xOffset = rotateY < 100 ? 200 : 0;
|
|
6379
|
+
const newMatrix = multiplyMatrices(multiplyMatrices(multiplyMatrices(translateMatrix(-translateX, -translateY, zSign1 * translateZ), rotateYMatrix(degToRad(rotateY))), translateMatrix(translateX, translateY, zSign2 * translateZ)), translateMatrix(-(translateX + xOffset), -translateY, zSign1 * translateZ));
|
|
6380
|
+
const matrix3d = `matrix3d(${newMatrix.flat().join(",")})`;
|
|
6381
|
+
const rotate = getTransformRotate(matrix3d);
|
|
6382
|
+
const translate = getTransformTranslate(matrix3d);
|
|
6383
|
+
const scale = getTransformScale(matrix3d);
|
|
6384
|
+
dispatchSetAnimatedTransform(true);
|
|
6385
|
+
dispatchSetSpaceField({
|
|
6386
|
+
field: "transform",
|
|
6387
|
+
value: matrix3d
|
|
6388
|
+
});
|
|
6389
|
+
dispatchSetTransform({
|
|
6390
|
+
translationX: translate.translateX,
|
|
6391
|
+
translationY: translate.translateY,
|
|
6392
|
+
translationZ: translate.translateZ,
|
|
6393
|
+
rotationX: radToDeg(rotate.rotateX),
|
|
6394
|
+
rotationY: radToDeg(rotate.rotateY) * -1,
|
|
6395
|
+
scale: scale.scale
|
|
6396
|
+
});
|
|
6397
|
+
setTimeout((() => {
|
|
6398
|
+
dispatchSetAnimatedTransform(false);
|
|
6399
|
+
}), 500);
|
|
6400
|
+
};
|
|
6401
|
+
const handleShowPluridPlane = event => {
|
|
6215
6402
|
if (!showLink && !pluridPlaneID) {
|
|
6216
|
-
updateTreeWithLink();
|
|
6403
|
+
updateTreeWithLink(event);
|
|
6217
6404
|
} else {
|
|
6218
|
-
toggleLinkFromTree();
|
|
6405
|
+
toggleLinkFromTree(event);
|
|
6219
6406
|
}
|
|
6220
6407
|
};
|
|
6221
6408
|
const handleClick = useCallback((event => {
|
|
@@ -6223,21 +6410,8 @@ const PluridLink = properties => {
|
|
|
6223
6410
|
if (atClick !== undefined) {
|
|
6224
6411
|
atClick(event);
|
|
6225
6412
|
}
|
|
6226
|
-
handleShowPluridPlane();
|
|
6413
|
+
handleShowPluridPlane(event);
|
|
6227
6414
|
}), [ linkElement.current, stateTree ]);
|
|
6228
|
-
useEffect((() => {
|
|
6229
|
-
if (_suffix !== undefined) {
|
|
6230
|
-
setSuffix(_suffix);
|
|
6231
|
-
}
|
|
6232
|
-
if (_devisible !== undefined) {
|
|
6233
|
-
setDevisible(_devisible);
|
|
6234
|
-
}
|
|
6235
|
-
}), [ _suffix, _devisible ]);
|
|
6236
|
-
useEffect((() => {
|
|
6237
|
-
if (showLink) {
|
|
6238
|
-
updateLinkCoordinates();
|
|
6239
|
-
}
|
|
6240
|
-
}), [ stateViewSize ]);
|
|
6241
6415
|
useEffect((() => {
|
|
6242
6416
|
const parentPlaneID = getPluridPlaneIDByData$1(linkElement.current);
|
|
6243
6417
|
setParentPlaneID(parentPlaneID);
|
|
@@ -6298,6 +6472,9 @@ const mapStateToProperties$5 = state => ({
|
|
|
6298
6472
|
|
|
6299
6473
|
const mapDispatchToProperties$5 = dispatch => ({
|
|
6300
6474
|
dispatchSetTree: tree => dispatch(actions.space.setTree(tree)),
|
|
6475
|
+
dispatchSetAnimatedTransform: payload => dispatch(actions.space.setAnimatedTransform(payload)),
|
|
6476
|
+
dispatchSetTransform: payload => dispatch(actions.space.setTransform(payload)),
|
|
6477
|
+
dispatchSetSpaceField: payload => dispatch(actions.space.setSpaceField(payload)),
|
|
6301
6478
|
dispatchUpdateSpaceLinkCoordinates: payload => dispatch(actions.space.updateSpaceLinkCoordinates(payload))
|
|
6302
6479
|
});
|
|
6303
6480
|
|