@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.
@@ -6,9 +6,10 @@ export interface PluridSpaceOwnProperties {
6
6
  export interface PluridSpaceStateProperties {
7
7
  stateConfiguration: PluridConfiguration;
8
8
  stateGeneralTheme: Theme;
9
+ stateResolvedLayout: boolean;
9
10
  }
10
11
  export interface PluridSpaceDispatchProperties {
11
12
  }
12
13
  export declare type PluridSpaceProperties = PluridSpaceOwnProperties & PluridSpaceStateProperties & PluridSpaceDispatchProperties;
13
- declare const ConnectedPluridSpace: import("react-redux").ConnectedComponent<React.FC<PluridSpaceProperties>, Omit<PluridSpaceProperties, "stateGeneralTheme" | "stateConfiguration"> & import("react-redux").ConnectProps>;
14
+ declare const ConnectedPluridSpace: import("react-redux").ConnectedComponent<React.FC<PluridSpaceProperties>, Omit<PluridSpaceProperties, "stateGeneralTheme" | "stateConfiguration" | "stateResolvedLayout"> & import("react-redux").ConnectProps>;
14
15
  export default ConnectedPluridSpace;
@@ -14,6 +14,7 @@ export interface PluridViewStateProperties {
14
14
  state: AppState;
15
15
  stateConfiguration: PluridAppConfiguration;
16
16
  stateSpaceLoading: boolean;
17
+ stateResolvedLayout: boolean;
17
18
  stateTransform: SpaceTransform;
18
19
  stateTree: TreePlane[];
19
20
  stateSpaceView: PluridApplicationView;
@@ -44,5 +45,5 @@ export interface PluridViewDispatchProperties {
44
45
  dispatchSpaceSetView: DispatchAction<typeof actions.space.spaceSetView>;
45
46
  }
46
47
  export declare type PluridViewProperties = PluridViewOwnProperties & PluridViewStateProperties & PluridViewDispatchProperties;
47
- declare const ConnectedPluridView: import("react-redux").ConnectedComponent<React.FC<PluridViewProperties>, Omit<PluridViewProperties, "dispatch" | "stateGeneralTheme" | "stateConfiguration" | "stateTree" | "dispatchSetSpaceField" | "dispatchSetGeneralTheme" | "dispatchSetInteractionTheme" | "dispatchRotateX" | "dispatchRotateY" | "dispatchSetAnimatedTransform" | "dispatchRotateXWith" | "dispatchRotateYWith" | "state" | "stateSpaceLoading" | "stateTransform" | "stateSpaceView" | "dispatchSetConfiguration" | "dispatchSetConfigurationMicro" | "dispatchSetSpaceLoading" | "dispatchSetTransformTime" | "dispatchSetSpaceLocation" | "dispatchSetTree" | "dispatchTranslateXWith" | "dispatchTranslateYWith" | "dispatchTranslateZWith" | "dispatchScaleUpWith" | "dispatchScaleDownWith" | "dispatchSpaceSetViewSize" | "dispatchSpaceSetView"> & import("react-redux").ConnectProps>;
48
+ declare const ConnectedPluridView: import("react-redux").ConnectedComponent<React.FC<PluridViewProperties>, Omit<PluridViewProperties, "dispatch" | "stateGeneralTheme" | "stateConfiguration" | "stateTree" | "dispatchSetSpaceField" | "stateResolvedLayout" | "dispatchSetGeneralTheme" | "dispatchSetInteractionTheme" | "dispatchRotateX" | "dispatchRotateY" | "dispatchSetAnimatedTransform" | "dispatchRotateXWith" | "dispatchRotateYWith" | "state" | "stateSpaceLoading" | "stateTransform" | "stateSpaceView" | "dispatchSetConfiguration" | "dispatchSetConfigurationMicro" | "dispatchSetSpaceLoading" | "dispatchSetTransformTime" | "dispatchSetSpaceLocation" | "dispatchSetTree" | "dispatchTranslateXWith" | "dispatchTranslateYWith" | "dispatchTranslateZWith" | "dispatchScaleUpWith" | "dispatchScaleDownWith" | "dispatchSpaceSetViewSize" | "dispatchSpaceSetView"> & import("react-redux").ConnectProps>;
48
49
  export default ConnectedPluridView;
@@ -8,10 +8,12 @@ declare class PluridApplication extends Component<PluridApplicationProperties<Pl
8
8
  private store;
9
9
  private storeUnubscriber;
10
10
  private storeID;
11
+ private planesRegistrar;
11
12
  constructor(properties: PluridApplicationProperties<PluridReactComponent>, context: React.ContextType<typeof PluridProviderContext>);
12
13
  componentDidUpdate(): void;
13
14
  componentWillUnmount(): void;
14
15
  render(): JSX.Element;
16
+ private prepare;
15
17
  private computeStore;
16
18
  private subscribeStore;
17
19
  }
@@ -87,7 +87,7 @@ declare const Plurid: {
87
87
  readonly NAVIGATE_TO_ROOT: "space.navigateToRoot";
88
88
  };
89
89
  /** Server */
90
- serverComputeMetastate: (isoMatch: PluridRouteMatch, paths: PluridRoute<PluridReactComponent<any, PluridPlaneComponentProperty | PluridRouteComponentProperty>, any>[], globals: Record<string, string> | undefined) => Promise<import("@plurid/plurid-data").PluridMetastate>;
90
+ serverComputeMetastate: (isoMatch: PluridRouteMatch, paths: PluridRoute<PluridReactComponent<any, PluridPlaneComponentProperty | PluridRouteComponentProperty>, any>[], globals: Record<string, string> | undefined, hostname?: string) => Promise<import("@plurid/plurid-data").PluridMetastate>;
91
91
  /** Router */
92
92
  IsoMatcher: typeof routing.IsoMatcher;
93
93
  routerNavigate: (path: string) => void;
@@ -272,6 +272,8 @@ const getSpace = state => state.space;
272
272
 
273
273
  const getLoading = state => state.space.loading;
274
274
 
275
+ const getResolvedLayout = state => state.space.resolvedLayout;
276
+
275
277
  const getTransformMatrix = state => state.space.transform;
276
278
 
277
279
  const getAnimatedTransform = state => state.space.animatedTransform;
@@ -319,6 +321,7 @@ var selectors$3 = Object.freeze({
319
321
  __proto__: null,
320
322
  getSpace: getSpace,
321
323
  getLoading: getLoading,
324
+ getResolvedLayout: getResolvedLayout,
322
325
  getTransformMatrix: getTransformMatrix,
323
326
  getAnimatedTransform: getAnimatedTransform,
324
327
  getTransformTime: getTransformTime,
@@ -343,6 +346,7 @@ const {toRadians: toRadians} = mathematics.geometry;
343
346
 
344
347
  const initialState$2 = {
345
348
  loading: true,
349
+ resolvedLayout: false,
346
350
  transform: "matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)",
347
351
  animatedTransform: false,
348
352
  transformTime: 450,
@@ -717,20 +721,6 @@ const store = store$1;
717
721
 
718
722
  const StateContext = React.createContext({});
719
723
 
720
- const loadStateFromContext = (context, space) => {
721
- if (!context) {
722
- return;
723
- }
724
- if (!space) {
725
- if (typeof window === "undefined") {
726
- return;
727
- }
728
- const defaultContext = context.states[window.location.pathname];
729
- return defaultContext;
730
- }
731
- return context.states[space];
732
- };
733
-
734
724
  function __awaiter(thisArg, _arguments, P, generator) {
735
725
  function adopt(value) {
736
726
  return value instanceof P ? value : new P((function(resolve) {
@@ -780,17 +770,8 @@ const {getTransformRotate: getTransformRotate, getTransformTranslate: getTransfo
780
770
 
781
771
  const {rotateMatrix: rotateMatrix$1, translateMatrix: translateMatrixArray, scaleMatrix: scaleMatrix$1, multiplyArrayOfMatrices: multiplyArrayOfMatrices$1} = matrix;
782
772
 
783
- const computeApplication = (planes, configuration, view) => {
773
+ const computeApplication = (planes, configuration, view, origin = "origin") => {
784
774
  const appConfiguration = general$2.configuration.merge(configuration);
785
- if (planes) {
786
- for (const plane of planes) {
787
- const planeData = resolvePluridPlaneData(plane);
788
- const linkPath = routing.resolveRoute(planeData.route);
789
- if (!linkPath) {
790
- continue;
791
- }
792
- }
793
- }
794
775
  const currentView = view || [];
795
776
  const absoluteView = [];
796
777
  for (const viewItem of currentView) {
@@ -802,7 +783,6 @@ const computeApplication = (planes, configuration, view) => {
802
783
  absoluteView.push(viewPath.route);
803
784
  }
804
785
  }
805
- const origin = "localhost:63000";
806
786
  const registrar = new PluridPlanesRegistrar(planes, origin);
807
787
  const registrarPlanes = registrar.getAll();
808
788
  const spaceTree = new space$2.tree.Tree({
@@ -1056,8 +1036,6 @@ const closeActivePlane = (state, pubsub) => {
1056
1036
  });
1057
1037
  };
1058
1038
 
1059
- const {direction: directionLogic} = interaction;
1060
-
1061
1039
  const handleGlobalShortcuts = (dispatch, state, pubsub, event, firstPerson, locks) => {
1062
1040
  if (event.defaultPrevented) {
1063
1041
  return;
@@ -1067,128 +1045,165 @@ const handleGlobalShortcuts = (dispatch, state, pubsub, event, firstPerson, lock
1067
1045
  return;
1068
1046
  }
1069
1047
  const noModifiers = !event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey;
1048
+ const handleEvent = () => {
1049
+ event.preventDefault();
1050
+ };
1070
1051
  if (event.code === "KeyF" && noModifiers) {
1052
+ handleEvent();
1071
1053
  return dispatch(actions.configuration.toggleConfigurationSpaceFirstPerson());
1072
1054
  }
1073
1055
  if (firstPerson) {
1074
1056
  if (event.code === "KeyW" && noModifiers && locks.translationZ) {
1057
+ handleEvent();
1075
1058
  return dispatch(actions.space.viewCameraMoveForward());
1076
1059
  }
1077
1060
  if (event.code === "KeyS" && noModifiers && locks.translationZ) {
1061
+ handleEvent();
1078
1062
  return dispatch(actions.space.viewCameraMoveBackward());
1079
1063
  }
1080
1064
  if (event.code === "KeyA" && noModifiers && locks.translationX) {
1065
+ handleEvent();
1081
1066
  return dispatch(actions.space.viewCameraMoveLeft());
1082
1067
  }
1083
1068
  if (event.code === "KeyA" && event.shiftKey && locks.rotationY) {
1069
+ handleEvent();
1084
1070
  return dispatch(actions.space.viewCameraTurnLeft());
1085
1071
  }
1086
1072
  if (event.code === "KeyD" && noModifiers && locks.translationX) {
1073
+ handleEvent();
1087
1074
  return dispatch(actions.space.viewCameraMoveRight());
1088
1075
  }
1089
1076
  if (event.code === "KeyD" && event.shiftKey && locks.rotationY) {
1077
+ handleEvent();
1090
1078
  return dispatch(actions.space.viewCameraTurnRight());
1091
1079
  }
1092
1080
  if (event.code === "KeyQ" && noModifiers && locks.rotationX) {
1081
+ handleEvent();
1093
1082
  return dispatch(actions.space.viewCameraTurnUp());
1094
1083
  }
1095
1084
  if (event.code === "KeyZ" && noModifiers && locks.rotationX) {
1085
+ handleEvent();
1096
1086
  return dispatch(actions.space.viewCameraTurnDown());
1097
1087
  }
1098
1088
  if (event.code === "KeyE" && noModifiers && locks.translationY) {
1089
+ handleEvent();
1099
1090
  return dispatch(actions.space.viewCameraMoveUp());
1100
1091
  }
1101
1092
  if (event.code === "KeyC" && noModifiers && locks.translationY) {
1093
+ handleEvent();
1102
1094
  return dispatch(actions.space.viewCameraMoveDown());
1103
1095
  }
1104
1096
  }
1105
1097
  if (event.code === "KeyR" && noModifiers) {
1098
+ handleEvent();
1106
1099
  return dispatch(actions.configuration.setConfigurationSpaceTransformMode(TRANSFORM_MODES.ROTATION));
1107
1100
  }
1108
1101
  if (event.code === "KeyT" && noModifiers) {
1102
+ handleEvent();
1109
1103
  return dispatch(actions.configuration.setConfigurationSpaceTransformMode(TRANSFORM_MODES.TRANSLATION));
1110
1104
  }
1111
1105
  if (event.code === "KeyS" && noModifiers && !firstPerson) {
1106
+ handleEvent();
1112
1107
  return dispatch(actions.configuration.setConfigurationSpaceTransformMode(TRANSFORM_MODES.SCALE));
1113
1108
  }
1114
1109
  if (event.key === "ArrowRight") {
1115
1110
  if (event.shiftKey && locks.rotationY) {
1111
+ handleEvent();
1116
1112
  return dispatch(actions.space.rotateLeft());
1117
1113
  }
1118
1114
  if (event.altKey && locks.translationX) {
1115
+ handleEvent();
1119
1116
  return dispatch(actions.space.translateRight());
1120
1117
  }
1121
1118
  }
1122
1119
  if (event.key === "ArrowLeft") {
1123
1120
  if (event.shiftKey && locks.rotationY) {
1121
+ handleEvent();
1124
1122
  return dispatch(actions.space.rotateRight());
1125
1123
  }
1126
1124
  if (event.altKey && locks.translationX) {
1125
+ handleEvent();
1127
1126
  return dispatch(actions.space.translateLeft());
1128
1127
  }
1129
1128
  }
1130
1129
  if (event.key === "ArrowUp") {
1131
1130
  if (event.shiftKey && event.altKey && locks.translationZ) {
1131
+ handleEvent();
1132
1132
  return dispatch(actions.space.translateIn());
1133
1133
  }
1134
1134
  if (event.shiftKey && !event.altKey && locks.rotationX) {
1135
+ handleEvent();
1135
1136
  return dispatch(actions.space.rotateUp());
1136
1137
  }
1137
1138
  if (event.altKey && !event.shiftKey && locks.translationY) {
1139
+ handleEvent();
1138
1140
  return dispatch(actions.space.translateUp());
1139
1141
  }
1140
1142
  if (event.metaKey || event.ctrlKey && locks.scale) {
1143
+ handleEvent();
1141
1144
  return dispatch(actions.space.scaleUp());
1142
1145
  }
1143
1146
  }
1144
1147
  if (event.key === "ArrowDown") {
1145
1148
  if (event.shiftKey && event.altKey && locks.translationZ) {
1149
+ handleEvent();
1146
1150
  return dispatch(actions.space.translateOut());
1147
1151
  }
1148
1152
  if (event.shiftKey && !event.altKey && locks.rotationX) {
1153
+ handleEvent();
1149
1154
  return dispatch(actions.space.rotateDown());
1150
1155
  }
1151
1156
  if (event.altKey && !event.shiftKey && locks.translationY) {
1157
+ handleEvent();
1152
1158
  return dispatch(actions.space.translateDown());
1153
1159
  }
1154
1160
  if (event.metaKey || event.ctrlKey && locks.scale) {
1161
+ handleEvent();
1155
1162
  return dispatch(actions.space.scaleDown());
1156
1163
  }
1157
1164
  }
1158
1165
  if (event.altKey && event.code === "KeyF") {
1166
+ handleEvent();
1159
1167
  focusActivePlane(dispatch, state);
1160
1168
  return;
1161
1169
  }
1162
1170
  if (event.altKey && event.code === "KeyB") {
1171
+ handleEvent();
1163
1172
  focusParentActivePlane(dispatch, state);
1164
1173
  return;
1165
1174
  }
1166
1175
  if (event.altKey && event.code === "KeyR") {
1176
+ handleEvent();
1167
1177
  refreshActivePlane(state, pubsub);
1168
1178
  return;
1169
1179
  }
1170
1180
  if (event.altKey && event.code === "KeyE") {
1181
+ handleEvent();
1171
1182
  isolateActivePlane(state, pubsub);
1172
1183
  return;
1173
1184
  }
1174
1185
  if (event.altKey && event.shiftKey && event.code === "KeyT") {
1186
+ handleEvent();
1175
1187
  openClosedPlane(pubsub);
1176
1188
  return;
1177
1189
  }
1178
1190
  if (event.altKey && event.code === "KeyW") {
1191
+ handleEvent();
1179
1192
  closeActivePlane(state, pubsub);
1180
1193
  return;
1181
1194
  }
1182
1195
  if (event.altKey && event.code === "KeyA") {
1196
+ handleEvent();
1183
1197
  focusPreviousRoot(dispatch, state);
1184
1198
  return;
1185
1199
  }
1186
1200
  if (event.altKey && event.code === "KeyD") {
1201
+ handleEvent();
1187
1202
  focusNextRoot(dispatch, state);
1188
1203
  return;
1189
1204
  }
1190
1205
  if (event.altKey && event.code === "Tab") {
1191
- event.preventDefault();
1206
+ handleEvent();
1192
1207
  if (event.shiftKey) {
1193
1208
  focusPreviousRoot(dispatch, state);
1194
1209
  } else {
@@ -1197,6 +1212,7 @@ const handleGlobalShortcuts = (dispatch, state, pubsub, event, firstPerson, lock
1197
1212
  return;
1198
1213
  }
1199
1214
  if (event.altKey && event.code.startsWith("Digit")) {
1215
+ handleEvent();
1200
1216
  const index = parseInt(event.code.replace("Digit", "")) - 1;
1201
1217
  focusRootIndex(dispatch, state, index);
1202
1218
  return;
@@ -1213,7 +1229,7 @@ const handleGlobalWheel = (dispatch, event, modes, locks) => {
1213
1229
  deltaY: event.deltaY
1214
1230
  };
1215
1231
  const absoluteThreshold = 100;
1216
- const direction = directionLogic.getWheelDirection(deltas, absoluteThreshold);
1232
+ const direction = interaction.direction.getWheelDirection(deltas, absoluteThreshold);
1217
1233
  if (modes.rotation) {
1218
1234
  if (direction === directions.left && locks.rotationY) {
1219
1235
  return dispatch(actions.space.rotateLeft());
@@ -2075,24 +2091,13 @@ const ConnectedPluridRoots = connect(mapStateToProperties$g, mapDispatchToProper
2075
2091
  context: StateContext
2076
2092
  })(PluridRoots);
2077
2093
 
2078
- const fadeIn = keyframes`
2079
- from {
2080
- opacity: 0%;
2081
- }
2082
-
2083
- to {
2084
- opacity: 100%;
2085
- }
2086
- `;
2087
-
2088
- const fadeInAnimation = fadeInTime => css`${fadeIn} ${fadeInTime}ms linear 100ms forwards`;
2089
-
2090
2094
  const StyledPluridSpace = styled.div`
2091
2095
  position: relative;
2092
2096
  height: 100%;
2093
2097
  overflow: hidden;
2094
2098
  perspective: 2000px;
2095
2099
  outline: none;
2100
+ transition: opacity ${({fadeInTime: fadeInTime}) => fadeInTime}ms linear;
2096
2101
 
2097
2102
  background: ${({opaque: opaque, theme: theme}) => {
2098
2103
  if (opaque) {
@@ -2102,24 +2107,10 @@ const StyledPluridSpace = styled.div`
2102
2107
  }
2103
2108
  return "transparent";
2104
2109
  }};
2105
-
2106
- /* TOFIX */
2107
- /* opacity: ${({fadeInTime: fadeInTime}) => {
2108
- if (fadeInTime) {
2109
- return "0";
2110
- }
2111
- return "1";
2112
- }};
2113
- animation: ${({isMounted: isMounted, fadeInTime: fadeInTime}) => {
2114
- if (isMounted && fadeInTime) {
2115
- return fadeInAnimation(fadeInTime);
2116
- }
2117
- return "";
2118
- }}; */
2119
2110
  `;
2120
2111
 
2121
2112
  const PluridSpace = properties => {
2122
- const {stateConfiguration: stateConfiguration, stateGeneralTheme: stateGeneralTheme} = properties;
2113
+ const {stateConfiguration: stateConfiguration, stateGeneralTheme: stateGeneralTheme, stateResolvedLayout: stateResolvedLayout} = properties;
2123
2114
  const {space: space} = stateConfiguration;
2124
2115
  const {opaque: opaque, fadeInTime: fadeInTime} = space;
2125
2116
  const [isMounted, setIsMounted] = useState(false);
@@ -2131,13 +2122,17 @@ const PluridSpace = properties => {
2131
2122
  opaque: opaque,
2132
2123
  isMounted: isMounted,
2133
2124
  fadeInTime: fadeInTime,
2134
- "data-plurid-entity": PLURID_ENTITY_SPACE
2125
+ "data-plurid-entity": PLURID_ENTITY_SPACE,
2126
+ style: {
2127
+ opacity: stateResolvedLayout ? 1 : 0
2128
+ }
2135
2129
  }, React.createElement(ConnectedPluridRoots, null));
2136
2130
  };
2137
2131
 
2138
2132
  const mapStateToProperties$f = state => ({
2139
2133
  stateConfiguration: selectors.configuration.getConfiguration(state),
2140
- stateGeneralTheme: selectors.themes.getGeneralTheme(state)
2134
+ stateGeneralTheme: selectors.themes.getGeneralTheme(state),
2135
+ stateResolvedLayout: selectors.space.getResolvedLayout(state)
2141
2136
  });
2142
2137
 
2143
2138
  const mapDispatchToProperties$f = dispatch => ({});
@@ -2205,6 +2200,18 @@ const ConnectedOrigin = connect(mapStateToProperties$e, mapDispatchToProperties$
2205
2200
  context: StateContext
2206
2201
  })(Origin);
2207
2202
 
2203
+ const fadeIn = keyframes`
2204
+ from {
2205
+ opacity: 0%;
2206
+ }
2207
+
2208
+ to {
2209
+ opacity: 100%;
2210
+ }
2211
+ `;
2212
+
2213
+ const fadeInAnimation = fadeInTime => css`${fadeIn} ${fadeInTime}ms linear 100ms forwards`;
2214
+
2208
2215
  var MENUS;
2209
2216
 
2210
2217
  (function(MENUS) {
@@ -4281,7 +4288,7 @@ const ConnectedPluridViewcube = connect(mapStateToProperties$8, mapDispatchToPro
4281
4288
  const PluridViewContainer = _properties => React.createElement(React.Fragment, null, React.createElement(ConnectedPluridSpace, null), React.createElement(ConnectedOrigin, null), React.createElement(ConnectedPluridToolbar, null), React.createElement(ConnectedPluridViewcube, null));
4282
4289
 
4283
4290
  const PluridView = properties => {
4284
- 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;
4291
+ 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;
4285
4292
  const viewElement = useRef(null);
4286
4293
  const scrollTimeout = useRef();
4287
4294
  const [pluridPubSub, setPluridPubSub] = useState(pubsub ? [ pubsub ] : [ new PluridPubSub ]);
@@ -4295,6 +4302,10 @@ const PluridView = properties => {
4295
4302
  setPreventOverscroll(false);
4296
4303
  }), PLURID_DEFAULT_PREVENT_OVERSCROLL_TIMEOUT);
4297
4304
  };
4305
+ const resolveLayout = () => {
4306
+ const layout = true;
4307
+ treeUpdate(stateSpaceView, stateConfiguration, layout);
4308
+ };
4298
4309
  const shortcutsCallback = useCallback((event => {
4299
4310
  const {transformLocks: transformLocks} = stateConfiguration.space;
4300
4311
  handleGlobalShortcuts(dispatch, state, pluridPubSub[0], event, stateConfiguration.space.firstPerson, transformLocks);
@@ -4309,12 +4320,13 @@ const PluridView = properties => {
4309
4320
  };
4310
4321
  handleGlobalWheel(dispatch, event, transformModes, transformLocks);
4311
4322
  }), [ dispatch, stateConfiguration.space.transformMode, stateConfiguration.space.transformLocks ]);
4312
- const treeUpdate = (view, configuration = stateConfiguration) => {
4323
+ const treeUpdate = (view, configuration = stateConfiguration, layout) => {
4313
4324
  const planes = getRegisteredPlanes(planesRegistrar);
4314
4325
  const spaceTree = new space$2.tree.Tree({
4315
4326
  planes: planes,
4316
4327
  configuration: configuration,
4317
- view: view
4328
+ view: view,
4329
+ layout: layout
4318
4330
  }, hostname);
4319
4331
  const computedTree = spaceTree.compute();
4320
4332
  for (const statePlane of stateTree) {
@@ -4330,7 +4342,7 @@ const PluridView = properties => {
4330
4342
  dispatchSetTree(computedTree);
4331
4343
  };
4332
4344
  const treeUpdateCallback = useCallback((() => {
4333
- treeUpdate(stateSpaceView);
4345
+ treeUpdate(stateSpaceView, stateConfiguration);
4334
4346
  }), [ hostname, stateSpaceView, stateConfiguration, JSON.stringify(stateTree) ]);
4335
4347
  const handlePubSubSubscribe = pubsub => {
4336
4348
  const subscriptions = [ {
@@ -4831,6 +4843,15 @@ const PluridView = properties => {
4831
4843
  useEffect((() => {
4832
4844
  treeUpdateCallback();
4833
4845
  }), []);
4846
+ useEffect((() => {
4847
+ if (!stateResolvedLayout) {
4848
+ resolveLayout();
4849
+ dispatchSetSpaceField({
4850
+ field: "resolvedLayout",
4851
+ value: true
4852
+ });
4853
+ }
4854
+ }), [ stateResolvedLayout ]);
4834
4855
  const pluridContext = {
4835
4856
  planesRegistrar: planesRegistrar,
4836
4857
  planeContext: planeContext,
@@ -4860,6 +4881,7 @@ const mapStateToProperties$7 = state => ({
4860
4881
  state: state,
4861
4882
  stateConfiguration: selectors.configuration.getConfiguration(state),
4862
4883
  stateTransform: selectors.space.getTransform(state),
4884
+ stateResolvedLayout: selectors.space.getResolvedLayout(state),
4863
4885
  stateTree: selectors.space.getTree(state),
4864
4886
  stateSpaceLoading: selectors.space.getLoading(state),
4865
4887
  stateSpaceView: selectors.space.getView(state),
@@ -4900,8 +4922,8 @@ class PluridApplication extends Component {
4900
4922
  super(properties);
4901
4923
  this.storeID = properties.id || "default";
4902
4924
  this.context = context;
4903
- const defaultStore = this.computeStore();
4904
- this.store = store(defaultStore);
4925
+ this.prepare();
4926
+ this.store = store(this.computeStore());
4905
4927
  this.subscribeStore();
4906
4928
  }
4907
4929
  componentDidUpdate() {
@@ -4920,15 +4942,20 @@ class PluridApplication extends Component {
4920
4942
  return React.createElement(Provider, {
4921
4943
  store: this.store,
4922
4944
  context: StateContext
4923
- }, React.createElement(ConnectedPluridView, Object.assign({}, this.props)));
4945
+ }, React.createElement(ConnectedPluridView, Object.assign({}, this.props, {
4946
+ planesRegistrar: this.planesRegistrar
4947
+ })));
4948
+ }
4949
+ prepare() {
4950
+ this.planesRegistrar = typeof window === "undefined" && !this.props.planesRegistrar ? new PluridPlanesRegistrar(this.props.planes, this.props.hostname) : this.props.planesRegistrar;
4924
4951
  }
4925
4952
  computeStore() {
4926
- const {view: view, planes: planes, configuration: configuration, precomputedState: precomputedState, planesRegistrar: planesRegistrar, useLocalStorage: useLocalStorage, hostname: hostname, space: space} = this.props;
4927
- registerPlanes(planes, planesRegistrar, hostname);
4953
+ const {view: view, planes: planes, configuration: configuration, precomputedState: precomputedState, useLocalStorage: useLocalStorage, hostname: hostname, space: space} = this.props;
4954
+ registerPlanes(planes, this.planesRegistrar, hostname);
4928
4955
  const currentState = this.store ? this.store.getState() : undefined;
4929
4956
  const localState = state.local.load(this.storeID, useLocalStorage);
4930
- const contextState = loadStateFromContext(this.context, space);
4931
- const store = state.compute(view, configuration, planesRegistrar, currentState, localState, precomputedState, contextState, hostname);
4957
+ const contextState = undefined;
4958
+ const store = state.compute(view, configuration, this.planesRegistrar, currentState, localState, precomputedState, contextState, hostname);
4932
4959
  return store;
4933
4960
  }
4934
4961
  subscribeStore() {
@@ -6317,14 +6344,13 @@ const ConnectedPluridSpaceDebugger = connect(mapStateToProperties, mapDispatchTo
6317
6344
  context: StateContext
6318
6345
  })(PluridSpaceDebugger);
6319
6346
 
6320
- const serverComputeMetastate = (isoMatch, paths, globals) => __awaiter(void 0, void 0, void 0, (function*() {
6347
+ const serverComputeMetastate = (isoMatch, paths, globals, hostname = "origin") => __awaiter(void 0, void 0, void 0, (function*() {
6321
6348
  const protocol = "http";
6322
- const host = "localhost:63000";
6323
- const pluridApplications = yield collectApplicationsFromPath(isoMatch, protocol, host, globals);
6349
+ const pluridApplications = yield collectApplicationsFromPath(isoMatch, protocol, hostname, globals);
6324
6350
  const states = {};
6325
6351
  for (const application of pluridApplications) {
6326
6352
  const {planes: planes, view: view, configuration: configuration} = application;
6327
- const {computedTree: computedTree, appConfiguration: appConfiguration} = computeApplication(planes, isoMatch.data.defaultConfiguration, view);
6353
+ const {computedTree: computedTree, appConfiguration: appConfiguration} = computeApplication(planes, isoMatch.data.defaultConfiguration, view, hostname);
6328
6354
  const state = {
6329
6355
  configuration: Object.assign({}, appConfiguration),
6330
6356
  shortcuts: {
@@ -6339,6 +6365,7 @@ const serverComputeMetastate = (isoMatch, paths, globals) => __awaiter(void 0, v
6339
6365
  },
6340
6366
  space: {
6341
6367
  loading: false,
6368
+ resolvedLayout: false,
6342
6369
  animatedTransform: false,
6343
6370
  transform: "matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)",
6344
6371
  scale: 1,