@plurid/plurid-react 0.0.0-19 → 0.0.0-21

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.
@@ -5044,12 +5044,12 @@ const PluridView = properties => {
5044
5044
  };
5045
5045
  handleGlobalWheel(dispatch, event, transformModes, transformLocks);
5046
5046
  }), [ dispatch, stateConfiguration.space.transformMode, stateConfiguration.space.transformLocks ]);
5047
- const treeUpdateCallback = React.useCallback((() => {
5047
+ const treeUpdate = (view, configuration = stateConfiguration) => {
5048
5048
  const planes = getRegisteredPlanes(planesRegistrar);
5049
5049
  const spaceTree = new pluridEngine.space.tree.Tree({
5050
5050
  planes: planes,
5051
- configuration: stateConfiguration,
5052
- view: stateSpaceView
5051
+ configuration: configuration,
5052
+ view: view
5053
5053
  });
5054
5054
  const computedTree = spaceTree.compute();
5055
5055
  for (const statePlane of stateTree) {
@@ -5062,6 +5062,9 @@ const PluridView = properties => {
5062
5062
  }
5063
5063
  }
5064
5064
  dispatchSetTree(computedTree);
5065
+ };
5066
+ const treeUpdateCallback = React.useCallback((() => {
5067
+ treeUpdate(stateSpaceView);
5065
5068
  }), [ stateSpaceView, stateConfiguration ]);
5066
5069
  const handlePubSubSubscribe = pubsub => {
5067
5070
  const configurationIndex = pubsub.subscribe({
@@ -5159,6 +5162,7 @@ const PluridView = properties => {
5159
5162
  const {plane: plane} = data;
5160
5163
  const updatedView = [ ...stateSpaceView, plane ];
5161
5164
  dispatchSpaceSetView(updatedView);
5165
+ treeUpdate(updatedView);
5162
5166
  }
5163
5167
  });
5164
5168
  const viewSetPlanesIndex = pubsub.subscribe({
@@ -5166,6 +5170,7 @@ const PluridView = properties => {
5166
5170
  callback: data => {
5167
5171
  const {view: view} = data;
5168
5172
  dispatchSpaceSetView([ ...view ]);
5173
+ treeUpdate(view);
5169
5174
  }
5170
5175
  });
5171
5176
  const viewRemovePlaneIndex = pubsub.subscribe({
@@ -5179,6 +5184,7 @@ const PluridView = properties => {
5179
5184
  return true;
5180
5185
  }));
5181
5186
  dispatchSpaceSetView(updatedView);
5187
+ treeUpdate(updatedView);
5182
5188
  }
5183
5189
  });
5184
5190
  return () => {
@@ -5447,6 +5453,9 @@ const PluridView = properties => {
5447
5453
  handlePubSubPublish(pubsub);
5448
5454
  }
5449
5455
  }), [ pluridPubSub.length, stateConfiguration, stateTransform ]);
5456
+ React.useEffect((() => {
5457
+ treeUpdateCallback();
5458
+ }), []);
5450
5459
  const pluridContext = {
5451
5460
  planesRegistrar: planesRegistrar,
5452
5461
  planeContext: planeContext,
@@ -5966,7 +5975,10 @@ const computePluridRoute = (matchedRoute, planesRegistrar, isoMatcher, directPla
5966
5975
  }
5967
5976
  return () => () => React__default["default"].createElement(React__default["default"].Fragment, null);
5968
5977
  }
5969
- const {exterior: exterior, view: view, planes: planes, spaces: spaces, defaultConfiguration: defaultConfiguration, slotted: slotted} = matchedRoute.data;
5978
+ const {exterior: exterior, view: view, planes: planes, spaces: spaces, defaultConfiguration: defaultConfiguration, slotted: slotted, resolver: resolver} = matchedRoute.data;
5979
+ if (resolver) {
5980
+ resolver(undefined);
5981
+ }
5970
5982
  const pluridRouteProperty = {
5971
5983
  value: matchedRoute.match.value,
5972
5984
  parameters: matchedRoute.match.parameters,
@@ -6348,7 +6360,7 @@ const PluridLink = properties => {
6348
6360
  const [showLink, setShowLink] = React.useState(false);
6349
6361
  const [planeID, setPlaneID] = React.useState("");
6350
6362
  const [pluridPlaneID, setPluridPlaneID] = React.useState("");
6351
- const [parentPlaneID, setParentPlaneID] = React.useState("");
6363
+ const [parentPlaneID, setParentPlaneID] = React.useState(getPluridPlaneIDByData$1(linkElement.current));
6352
6364
  const [linkCoordinates, setLinkCoordinates] = React.useState(defaultLinkCoordinates);
6353
6365
  const getPluridLinkCoordinates = () => {
6354
6366
  const link = linkElement.current;