@plurid/plurid-react 0.0.0-25 → 0.0.0-28

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.
@@ -308,6 +308,8 @@ const getSpace = state => state.space;
308
308
 
309
309
  const getLoading = state => state.space.loading;
310
310
 
311
+ const getResolvedLayout = state => state.space.resolvedLayout;
312
+
311
313
  const getTransformMatrix = state => state.space.transform;
312
314
 
313
315
  const getAnimatedTransform = state => state.space.animatedTransform;
@@ -355,6 +357,7 @@ var selectors$3 = Object.freeze({
355
357
  __proto__: null,
356
358
  getSpace: getSpace,
357
359
  getLoading: getLoading,
360
+ getResolvedLayout: getResolvedLayout,
358
361
  getTransformMatrix: getTransformMatrix,
359
362
  getAnimatedTransform: getAnimatedTransform,
360
363
  getTransformTime: getTransformTime,
@@ -379,6 +382,7 @@ const {toRadians: toRadians} = pluridFunctions.mathematics.geometry;
379
382
 
380
383
  const initialState$2 = {
381
384
  loading: true,
385
+ resolvedLayout: false,
382
386
  transform: "matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)",
383
387
  animatedTransform: false,
384
388
  transformTime: 450,
@@ -753,20 +757,6 @@ const store = store$1;
753
757
 
754
758
  const StateContext = React__default["default"].createContext({});
755
759
 
756
- const loadStateFromContext = (context, space) => {
757
- if (!context) {
758
- return;
759
- }
760
- if (!space) {
761
- if (typeof window === "undefined") {
762
- return;
763
- }
764
- const defaultContext = context.states[window.location.pathname];
765
- return defaultContext;
766
- }
767
- return context.states[space];
768
- };
769
-
770
760
  function __awaiter(thisArg, _arguments, P, generator) {
771
761
  function adopt(value) {
772
762
  return value instanceof P ? value : new P((function(resolve) {
@@ -816,17 +806,8 @@ const {getTransformRotate: getTransformRotate, getTransformTranslate: getTransfo
816
806
 
817
807
  const {rotateMatrix: rotateMatrix$1, translateMatrix: translateMatrixArray, scaleMatrix: scaleMatrix$1, multiplyArrayOfMatrices: multiplyArrayOfMatrices$1} = matrix;
818
808
 
819
- const computeApplication = (planes, configuration, view) => {
809
+ const computeApplication = (planes, configuration, view, origin = "origin") => {
820
810
  const appConfiguration = pluridEngine.general.configuration.merge(configuration);
821
- if (planes) {
822
- for (const plane of planes) {
823
- const planeData = resolvePluridPlaneData(plane);
824
- const linkPath = pluridEngine.routing.resolveRoute(planeData.route);
825
- if (!linkPath) {
826
- continue;
827
- }
828
- }
829
- }
830
811
  const currentView = view || [];
831
812
  const absoluteView = [];
832
813
  for (const viewItem of currentView) {
@@ -838,7 +819,6 @@ const computeApplication = (planes, configuration, view) => {
838
819
  absoluteView.push(viewPath.route);
839
820
  }
840
821
  }
841
- const origin = "localhost:63000";
842
822
  const registrar = new PluridPlanesRegistrar(planes, origin);
843
823
  const registrarPlanes = registrar.getAll();
844
824
  const spaceTree = new pluridEngine.space.tree.Tree({
@@ -1092,8 +1072,6 @@ const closeActivePlane = (state, pubsub) => {
1092
1072
  });
1093
1073
  };
1094
1074
 
1095
- const {direction: directionLogic} = pluridEngine.interaction;
1096
-
1097
1075
  const handleGlobalShortcuts = (dispatch, state, pubsub, event, firstPerson, locks) => {
1098
1076
  if (event.defaultPrevented) {
1099
1077
  return;
@@ -1103,128 +1081,165 @@ const handleGlobalShortcuts = (dispatch, state, pubsub, event, firstPerson, lock
1103
1081
  return;
1104
1082
  }
1105
1083
  const noModifiers = !event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey;
1084
+ const handleEvent = () => {
1085
+ event.preventDefault();
1086
+ };
1106
1087
  if (event.code === "KeyF" && noModifiers) {
1088
+ handleEvent();
1107
1089
  return dispatch(actions.configuration.toggleConfigurationSpaceFirstPerson());
1108
1090
  }
1109
1091
  if (firstPerson) {
1110
1092
  if (event.code === "KeyW" && noModifiers && locks.translationZ) {
1093
+ handleEvent();
1111
1094
  return dispatch(actions.space.viewCameraMoveForward());
1112
1095
  }
1113
1096
  if (event.code === "KeyS" && noModifiers && locks.translationZ) {
1097
+ handleEvent();
1114
1098
  return dispatch(actions.space.viewCameraMoveBackward());
1115
1099
  }
1116
1100
  if (event.code === "KeyA" && noModifiers && locks.translationX) {
1101
+ handleEvent();
1117
1102
  return dispatch(actions.space.viewCameraMoveLeft());
1118
1103
  }
1119
1104
  if (event.code === "KeyA" && event.shiftKey && locks.rotationY) {
1105
+ handleEvent();
1120
1106
  return dispatch(actions.space.viewCameraTurnLeft());
1121
1107
  }
1122
1108
  if (event.code === "KeyD" && noModifiers && locks.translationX) {
1109
+ handleEvent();
1123
1110
  return dispatch(actions.space.viewCameraMoveRight());
1124
1111
  }
1125
1112
  if (event.code === "KeyD" && event.shiftKey && locks.rotationY) {
1113
+ handleEvent();
1126
1114
  return dispatch(actions.space.viewCameraTurnRight());
1127
1115
  }
1128
1116
  if (event.code === "KeyQ" && noModifiers && locks.rotationX) {
1117
+ handleEvent();
1129
1118
  return dispatch(actions.space.viewCameraTurnUp());
1130
1119
  }
1131
1120
  if (event.code === "KeyZ" && noModifiers && locks.rotationX) {
1121
+ handleEvent();
1132
1122
  return dispatch(actions.space.viewCameraTurnDown());
1133
1123
  }
1134
1124
  if (event.code === "KeyE" && noModifiers && locks.translationY) {
1125
+ handleEvent();
1135
1126
  return dispatch(actions.space.viewCameraMoveUp());
1136
1127
  }
1137
1128
  if (event.code === "KeyC" && noModifiers && locks.translationY) {
1129
+ handleEvent();
1138
1130
  return dispatch(actions.space.viewCameraMoveDown());
1139
1131
  }
1140
1132
  }
1141
1133
  if (event.code === "KeyR" && noModifiers) {
1134
+ handleEvent();
1142
1135
  return dispatch(actions.configuration.setConfigurationSpaceTransformMode(pluridData.TRANSFORM_MODES.ROTATION));
1143
1136
  }
1144
1137
  if (event.code === "KeyT" && noModifiers) {
1138
+ handleEvent();
1145
1139
  return dispatch(actions.configuration.setConfigurationSpaceTransformMode(pluridData.TRANSFORM_MODES.TRANSLATION));
1146
1140
  }
1147
1141
  if (event.code === "KeyS" && noModifiers && !firstPerson) {
1142
+ handleEvent();
1148
1143
  return dispatch(actions.configuration.setConfigurationSpaceTransformMode(pluridData.TRANSFORM_MODES.SCALE));
1149
1144
  }
1150
1145
  if (event.key === "ArrowRight") {
1151
1146
  if (event.shiftKey && locks.rotationY) {
1147
+ handleEvent();
1152
1148
  return dispatch(actions.space.rotateLeft());
1153
1149
  }
1154
1150
  if (event.altKey && locks.translationX) {
1151
+ handleEvent();
1155
1152
  return dispatch(actions.space.translateRight());
1156
1153
  }
1157
1154
  }
1158
1155
  if (event.key === "ArrowLeft") {
1159
1156
  if (event.shiftKey && locks.rotationY) {
1157
+ handleEvent();
1160
1158
  return dispatch(actions.space.rotateRight());
1161
1159
  }
1162
1160
  if (event.altKey && locks.translationX) {
1161
+ handleEvent();
1163
1162
  return dispatch(actions.space.translateLeft());
1164
1163
  }
1165
1164
  }
1166
1165
  if (event.key === "ArrowUp") {
1167
1166
  if (event.shiftKey && event.altKey && locks.translationZ) {
1167
+ handleEvent();
1168
1168
  return dispatch(actions.space.translateIn());
1169
1169
  }
1170
1170
  if (event.shiftKey && !event.altKey && locks.rotationX) {
1171
+ handleEvent();
1171
1172
  return dispatch(actions.space.rotateUp());
1172
1173
  }
1173
1174
  if (event.altKey && !event.shiftKey && locks.translationY) {
1175
+ handleEvent();
1174
1176
  return dispatch(actions.space.translateUp());
1175
1177
  }
1176
1178
  if (event.metaKey || event.ctrlKey && locks.scale) {
1179
+ handleEvent();
1177
1180
  return dispatch(actions.space.scaleUp());
1178
1181
  }
1179
1182
  }
1180
1183
  if (event.key === "ArrowDown") {
1181
1184
  if (event.shiftKey && event.altKey && locks.translationZ) {
1185
+ handleEvent();
1182
1186
  return dispatch(actions.space.translateOut());
1183
1187
  }
1184
1188
  if (event.shiftKey && !event.altKey && locks.rotationX) {
1189
+ handleEvent();
1185
1190
  return dispatch(actions.space.rotateDown());
1186
1191
  }
1187
1192
  if (event.altKey && !event.shiftKey && locks.translationY) {
1193
+ handleEvent();
1188
1194
  return dispatch(actions.space.translateDown());
1189
1195
  }
1190
1196
  if (event.metaKey || event.ctrlKey && locks.scale) {
1197
+ handleEvent();
1191
1198
  return dispatch(actions.space.scaleDown());
1192
1199
  }
1193
1200
  }
1194
1201
  if (event.altKey && event.code === "KeyF") {
1202
+ handleEvent();
1195
1203
  focusActivePlane(dispatch, state);
1196
1204
  return;
1197
1205
  }
1198
1206
  if (event.altKey && event.code === "KeyB") {
1207
+ handleEvent();
1199
1208
  focusParentActivePlane(dispatch, state);
1200
1209
  return;
1201
1210
  }
1202
1211
  if (event.altKey && event.code === "KeyR") {
1212
+ handleEvent();
1203
1213
  refreshActivePlane(state, pubsub);
1204
1214
  return;
1205
1215
  }
1206
1216
  if (event.altKey && event.code === "KeyE") {
1217
+ handleEvent();
1207
1218
  isolateActivePlane(state, pubsub);
1208
1219
  return;
1209
1220
  }
1210
1221
  if (event.altKey && event.shiftKey && event.code === "KeyT") {
1222
+ handleEvent();
1211
1223
  openClosedPlane(pubsub);
1212
1224
  return;
1213
1225
  }
1214
1226
  if (event.altKey && event.code === "KeyW") {
1227
+ handleEvent();
1215
1228
  closeActivePlane(state, pubsub);
1216
1229
  return;
1217
1230
  }
1218
1231
  if (event.altKey && event.code === "KeyA") {
1232
+ handleEvent();
1219
1233
  focusPreviousRoot(dispatch, state);
1220
1234
  return;
1221
1235
  }
1222
1236
  if (event.altKey && event.code === "KeyD") {
1237
+ handleEvent();
1223
1238
  focusNextRoot(dispatch, state);
1224
1239
  return;
1225
1240
  }
1226
1241
  if (event.altKey && event.code === "Tab") {
1227
- event.preventDefault();
1242
+ handleEvent();
1228
1243
  if (event.shiftKey) {
1229
1244
  focusPreviousRoot(dispatch, state);
1230
1245
  } else {
@@ -1233,6 +1248,7 @@ const handleGlobalShortcuts = (dispatch, state, pubsub, event, firstPerson, lock
1233
1248
  return;
1234
1249
  }
1235
1250
  if (event.altKey && event.code.startsWith("Digit")) {
1251
+ handleEvent();
1236
1252
  const index = parseInt(event.code.replace("Digit", "")) - 1;
1237
1253
  focusRootIndex(dispatch, state, index);
1238
1254
  return;
@@ -1249,7 +1265,7 @@ const handleGlobalWheel = (dispatch, event, modes, locks) => {
1249
1265
  deltaY: event.deltaY
1250
1266
  };
1251
1267
  const absoluteThreshold = 100;
1252
- const direction = directionLogic.getWheelDirection(deltas, absoluteThreshold);
1268
+ const direction = pluridEngine.interaction.direction.getWheelDirection(deltas, absoluteThreshold);
1253
1269
  if (modes.rotation) {
1254
1270
  if (direction === pluridData.directions.left && locks.rotationY) {
1255
1271
  return dispatch(actions.space.rotateLeft());
@@ -2113,24 +2129,13 @@ const ConnectedPluridRoots = reactRedux.connect(mapStateToProperties$g, mapDispa
2113
2129
  context: StateContext
2114
2130
  })(PluridRoots);
2115
2131
 
2116
- const fadeIn = styled.keyframes`
2117
- from {
2118
- opacity: 0%;
2119
- }
2120
-
2121
- to {
2122
- opacity: 100%;
2123
- }
2124
- `;
2125
-
2126
- const fadeInAnimation = fadeInTime => styled.css`${fadeIn} ${fadeInTime}ms linear 100ms forwards`;
2127
-
2128
2132
  const StyledPluridSpace = styled__default["default"].div`
2129
2133
  position: relative;
2130
2134
  height: 100%;
2131
2135
  overflow: hidden;
2132
2136
  perspective: 2000px;
2133
2137
  outline: none;
2138
+ transition: opacity ${({fadeInTime: fadeInTime}) => fadeInTime}ms linear;
2134
2139
 
2135
2140
  background: ${({opaque: opaque, theme: theme}) => {
2136
2141
  if (opaque) {
@@ -2140,24 +2145,10 @@ const StyledPluridSpace = styled__default["default"].div`
2140
2145
  }
2141
2146
  return "transparent";
2142
2147
  }};
2143
-
2144
- /* TOFIX */
2145
- /* opacity: ${({fadeInTime: fadeInTime}) => {
2146
- if (fadeInTime) {
2147
- return "0";
2148
- }
2149
- return "1";
2150
- }};
2151
- animation: ${({isMounted: isMounted, fadeInTime: fadeInTime}) => {
2152
- if (isMounted && fadeInTime) {
2153
- return fadeInAnimation(fadeInTime);
2154
- }
2155
- return "";
2156
- }}; */
2157
2148
  `;
2158
2149
 
2159
2150
  const PluridSpace = properties => {
2160
- const {stateConfiguration: stateConfiguration, stateGeneralTheme: stateGeneralTheme} = properties;
2151
+ const {stateConfiguration: stateConfiguration, stateGeneralTheme: stateGeneralTheme, stateResolvedLayout: stateResolvedLayout} = properties;
2161
2152
  const {space: space} = stateConfiguration;
2162
2153
  const {opaque: opaque, fadeInTime: fadeInTime} = space;
2163
2154
  const [isMounted, setIsMounted] = React.useState(false);
@@ -2169,13 +2160,17 @@ const PluridSpace = properties => {
2169
2160
  opaque: opaque,
2170
2161
  isMounted: isMounted,
2171
2162
  fadeInTime: fadeInTime,
2172
- "data-plurid-entity": pluridData.PLURID_ENTITY_SPACE
2163
+ "data-plurid-entity": pluridData.PLURID_ENTITY_SPACE,
2164
+ style: {
2165
+ opacity: stateResolvedLayout ? 1 : 0
2166
+ }
2173
2167
  }, React__default["default"].createElement(ConnectedPluridRoots, null));
2174
2168
  };
2175
2169
 
2176
2170
  const mapStateToProperties$f = state => ({
2177
2171
  stateConfiguration: selectors.configuration.getConfiguration(state),
2178
- stateGeneralTheme: selectors.themes.getGeneralTheme(state)
2172
+ stateGeneralTheme: selectors.themes.getGeneralTheme(state),
2173
+ stateResolvedLayout: selectors.space.getResolvedLayout(state)
2179
2174
  });
2180
2175
 
2181
2176
  const mapDispatchToProperties$f = dispatch => ({});
@@ -2243,6 +2238,18 @@ const ConnectedOrigin = reactRedux.connect(mapStateToProperties$e, mapDispatchTo
2243
2238
  context: StateContext
2244
2239
  })(Origin);
2245
2240
 
2241
+ const fadeIn = styled.keyframes`
2242
+ from {
2243
+ opacity: 0%;
2244
+ }
2245
+
2246
+ to {
2247
+ opacity: 100%;
2248
+ }
2249
+ `;
2250
+
2251
+ const fadeInAnimation = fadeInTime => styled.css`${fadeIn} ${fadeInTime}ms linear 100ms forwards`;
2252
+
2246
2253
  var MENUS;
2247
2254
 
2248
2255
  (function(MENUS) {
@@ -4319,7 +4326,7 @@ const ConnectedPluridViewcube = reactRedux.connect(mapStateToProperties$8, mapDi
4319
4326
  const PluridViewContainer = _properties => React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement(ConnectedPluridSpace, null), React__default["default"].createElement(ConnectedOrigin, null), React__default["default"].createElement(ConnectedPluridToolbar, null), React__default["default"].createElement(ConnectedPluridViewcube, null));
4320
4327
 
4321
4328
  const PluridView = properties => {
4322
- const {planesRegistrar: planesRegistrar, customPlane: customPlane, planeContext: planeContext, planeContextValue: planeContextValue, pubsub: pubsub, planeNotFound: planeNotFound, planeRenderError: planeRenderError, matchedRoute: matchedRoute, hostname: hostname, state: state, stateConfiguration: stateConfiguration, stateTransform: stateTransform, stateSpaceView: stateSpaceView, stateTree: stateTree, stateGeneralTheme: stateGeneralTheme, dispatch: dispatch, dispatchSetConfiguration: dispatchSetConfiguration, dispatchSetGeneralTheme: dispatchSetGeneralTheme, dispatchSetInteractionTheme: dispatchSetInteractionTheme, dispatchSetSpaceField: dispatchSetSpaceField, dispatchSetSpaceLocation: dispatchSetSpaceLocation, dispatchSetAnimatedTransform: dispatchSetAnimatedTransform, dispatchSetTransformTime: dispatchSetTransformTime, dispatchSetTree: dispatchSetTree, dispatchRotateXWith: dispatchRotateXWith, dispatchRotateX: dispatchRotateX, dispatchRotateYWith: dispatchRotateYWith, dispatchRotateY: dispatchRotateY, dispatchTranslateXWith: dispatchTranslateXWith, dispatchTranslateYWith: dispatchTranslateYWith, dispatchTranslateZWith: dispatchTranslateZWith, dispatchScaleUpWith: dispatchScaleUpWith, dispatchScaleDownWith: dispatchScaleDownWith, dispatchSpaceSetViewSize: dispatchSpaceSetViewSize, dispatchSpaceSetView: dispatchSpaceSetView} = properties;
4329
+ const {planesRegistrar: planesRegistrar, customPlane: customPlane, planeContext: planeContext, planeContextValue: planeContextValue, pubsub: pubsub, planeNotFound: planeNotFound, planeRenderError: planeRenderError, matchedRoute: matchedRoute, hostname: hostname, state: state, stateConfiguration: stateConfiguration, stateResolvedLayout: stateResolvedLayout, stateTransform: stateTransform, stateSpaceView: stateSpaceView, stateTree: stateTree, stateGeneralTheme: stateGeneralTheme, dispatch: dispatch, dispatchSetConfiguration: dispatchSetConfiguration, dispatchSetGeneralTheme: dispatchSetGeneralTheme, dispatchSetInteractionTheme: dispatchSetInteractionTheme, dispatchSetSpaceField: dispatchSetSpaceField, dispatchSetSpaceLocation: dispatchSetSpaceLocation, dispatchSetAnimatedTransform: dispatchSetAnimatedTransform, dispatchSetTransformTime: dispatchSetTransformTime, dispatchSetTree: dispatchSetTree, dispatchRotateXWith: dispatchRotateXWith, dispatchRotateX: dispatchRotateX, dispatchRotateYWith: dispatchRotateYWith, dispatchRotateY: dispatchRotateY, dispatchTranslateXWith: dispatchTranslateXWith, dispatchTranslateYWith: dispatchTranslateYWith, dispatchTranslateZWith: dispatchTranslateZWith, dispatchScaleUpWith: dispatchScaleUpWith, dispatchScaleDownWith: dispatchScaleDownWith, dispatchSpaceSetViewSize: dispatchSpaceSetViewSize, dispatchSpaceSetView: dispatchSpaceSetView} = properties;
4323
4330
  const viewElement = React.useRef(null);
4324
4331
  const scrollTimeout = React.useRef();
4325
4332
  const [pluridPubSub, setPluridPubSub] = React.useState(pubsub ? [ pubsub ] : [ new PluridPubSub__default["default"] ]);
@@ -4333,6 +4340,10 @@ const PluridView = properties => {
4333
4340
  setPreventOverscroll(false);
4334
4341
  }), pluridData.PLURID_DEFAULT_PREVENT_OVERSCROLL_TIMEOUT);
4335
4342
  };
4343
+ const resolveLayout = () => {
4344
+ const layout = true;
4345
+ treeUpdate(stateSpaceView, stateConfiguration, layout);
4346
+ };
4336
4347
  const shortcutsCallback = React.useCallback((event => {
4337
4348
  const {transformLocks: transformLocks} = stateConfiguration.space;
4338
4349
  handleGlobalShortcuts(dispatch, state, pluridPubSub[0], event, stateConfiguration.space.firstPerson, transformLocks);
@@ -4347,12 +4358,13 @@ const PluridView = properties => {
4347
4358
  };
4348
4359
  handleGlobalWheel(dispatch, event, transformModes, transformLocks);
4349
4360
  }), [ dispatch, stateConfiguration.space.transformMode, stateConfiguration.space.transformLocks ]);
4350
- const treeUpdate = (view, configuration = stateConfiguration) => {
4361
+ const treeUpdate = (view, configuration = stateConfiguration, layout) => {
4351
4362
  const planes = getRegisteredPlanes(planesRegistrar);
4352
4363
  const spaceTree = new pluridEngine.space.tree.Tree({
4353
4364
  planes: planes,
4354
4365
  configuration: configuration,
4355
- view: view
4366
+ view: view,
4367
+ layout: layout
4356
4368
  }, hostname);
4357
4369
  const computedTree = spaceTree.compute();
4358
4370
  for (const statePlane of stateTree) {
@@ -4368,7 +4380,7 @@ const PluridView = properties => {
4368
4380
  dispatchSetTree(computedTree);
4369
4381
  };
4370
4382
  const treeUpdateCallback = React.useCallback((() => {
4371
- treeUpdate(stateSpaceView);
4383
+ treeUpdate(stateSpaceView, stateConfiguration);
4372
4384
  }), [ hostname, stateSpaceView, stateConfiguration, JSON.stringify(stateTree) ]);
4373
4385
  const handlePubSubSubscribe = pubsub => {
4374
4386
  const subscriptions = [ {
@@ -4869,6 +4881,15 @@ const PluridView = properties => {
4869
4881
  React.useEffect((() => {
4870
4882
  treeUpdateCallback();
4871
4883
  }), []);
4884
+ React.useEffect((() => {
4885
+ if (!stateResolvedLayout) {
4886
+ resolveLayout();
4887
+ dispatchSetSpaceField({
4888
+ field: "resolvedLayout",
4889
+ value: true
4890
+ });
4891
+ }
4892
+ }), [ stateResolvedLayout ]);
4872
4893
  const pluridContext = {
4873
4894
  planesRegistrar: planesRegistrar,
4874
4895
  planeContext: planeContext,
@@ -4898,6 +4919,7 @@ const mapStateToProperties$7 = state => ({
4898
4919
  state: state,
4899
4920
  stateConfiguration: selectors.configuration.getConfiguration(state),
4900
4921
  stateTransform: selectors.space.getTransform(state),
4922
+ stateResolvedLayout: selectors.space.getResolvedLayout(state),
4901
4923
  stateTree: selectors.space.getTree(state),
4902
4924
  stateSpaceLoading: selectors.space.getLoading(state),
4903
4925
  stateSpaceView: selectors.space.getView(state),
@@ -4938,8 +4960,8 @@ class PluridApplication extends React.Component {
4938
4960
  super(properties);
4939
4961
  this.storeID = properties.id || "default";
4940
4962
  this.context = context;
4941
- const defaultStore = this.computeStore();
4942
- this.store = store(defaultStore);
4963
+ this.prepare();
4964
+ this.store = store(this.computeStore());
4943
4965
  this.subscribeStore();
4944
4966
  }
4945
4967
  componentDidUpdate() {
@@ -4958,15 +4980,20 @@ class PluridApplication extends React.Component {
4958
4980
  return React__default["default"].createElement(reactRedux.Provider, {
4959
4981
  store: this.store,
4960
4982
  context: StateContext
4961
- }, React__default["default"].createElement(ConnectedPluridView, Object.assign({}, this.props)));
4983
+ }, React__default["default"].createElement(ConnectedPluridView, Object.assign({}, this.props, {
4984
+ planesRegistrar: this.planesRegistrar
4985
+ })));
4986
+ }
4987
+ prepare() {
4988
+ this.planesRegistrar = typeof window === "undefined" && !this.props.planesRegistrar ? new PluridPlanesRegistrar(this.props.planes, this.props.hostname) : this.props.planesRegistrar;
4962
4989
  }
4963
4990
  computeStore() {
4964
- const {view: view, planes: planes, configuration: configuration, precomputedState: precomputedState, planesRegistrar: planesRegistrar, useLocalStorage: useLocalStorage, hostname: hostname, space: space} = this.props;
4965
- registerPlanes(planes, planesRegistrar, hostname);
4991
+ const {view: view, planes: planes, configuration: configuration, precomputedState: precomputedState, useLocalStorage: useLocalStorage, hostname: hostname, space: space} = this.props;
4992
+ registerPlanes(planes, this.planesRegistrar, hostname);
4966
4993
  const currentState = this.store ? this.store.getState() : undefined;
4967
4994
  const localState = pluridEngine.state.local.load(this.storeID, useLocalStorage);
4968
- const contextState = loadStateFromContext(this.context, space);
4969
- const store = pluridEngine.state.compute(view, configuration, planesRegistrar, currentState, localState, precomputedState, contextState, hostname);
4995
+ const contextState = undefined;
4996
+ const store = pluridEngine.state.compute(view, configuration, this.planesRegistrar, currentState, localState, precomputedState, contextState, hostname);
4970
4997
  return store;
4971
4998
  }
4972
4999
  subscribeStore() {
@@ -6355,14 +6382,13 @@ const ConnectedPluridSpaceDebugger = reactRedux.connect(mapStateToProperties, ma
6355
6382
  context: StateContext
6356
6383
  })(PluridSpaceDebugger);
6357
6384
 
6358
- const serverComputeMetastate = (isoMatch, paths, globals) => __awaiter(void 0, void 0, void 0, (function*() {
6385
+ const serverComputeMetastate = (isoMatch, paths, globals, hostname = "origin") => __awaiter(void 0, void 0, void 0, (function*() {
6359
6386
  const protocol = "http";
6360
- const host = "localhost:63000";
6361
- const pluridApplications = yield collectApplicationsFromPath(isoMatch, protocol, host, globals);
6387
+ const pluridApplications = yield collectApplicationsFromPath(isoMatch, protocol, hostname, globals);
6362
6388
  const states = {};
6363
6389
  for (const application of pluridApplications) {
6364
6390
  const {planes: planes, view: view, configuration: configuration} = application;
6365
- const {computedTree: computedTree, appConfiguration: appConfiguration} = computeApplication(planes, isoMatch.data.defaultConfiguration, view);
6391
+ const {computedTree: computedTree, appConfiguration: appConfiguration} = computeApplication(planes, isoMatch.data.defaultConfiguration, view, hostname);
6366
6392
  const state = {
6367
6393
  configuration: Object.assign({}, appConfiguration),
6368
6394
  shortcuts: {
@@ -6377,6 +6403,7 @@ const serverComputeMetastate = (isoMatch, paths, globals) => __awaiter(void 0, v
6377
6403
  },
6378
6404
  space: {
6379
6405
  loading: false,
6406
+ resolvedLayout: false,
6380
6407
  animatedTransform: false,
6381
6408
  transform: "matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)",
6382
6409
  scale: 1,