@plurid/plurid-react 0.0.0-18 → 0.0.0-20

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.
Files changed (95) hide show
  1. package/distribution/components/links/Link/components/Preview/index.d.ts +1 -1
  2. package/distribution/components/links/Link/index.d.ts +1 -3
  3. package/distribution/components/planes/ExternalPlane/index.d.ts +1 -1
  4. package/distribution/components/planes/IframePlane/index.d.ts +1 -1
  5. package/distribution/components/structural/Plane/components/PlaneBridge/index.d.ts +1 -1
  6. package/distribution/components/structural/Plane/components/PlaneControls/components/SearchItem/index.d.ts +1 -1
  7. package/distribution/components/structural/Plane/components/PlaneControls/components/SearchList/index.d.ts +1 -1
  8. package/distribution/components/structural/Plane/components/PlaneControls/index.d.ts +1 -1
  9. package/distribution/components/structural/Plane/components/PlaneDebugger/index.d.ts +1 -1
  10. package/distribution/components/structural/Plane/index.d.ts +1 -3
  11. package/distribution/components/structural/Root/index.d.ts +1 -1
  12. package/distribution/components/structural/Roots/index.d.ts +1 -1
  13. package/distribution/components/structural/Space/components/SpaceDebugger/index.d.ts +1 -1
  14. package/distribution/components/structural/Space/index.d.ts +1 -1
  15. package/distribution/components/utilities/ApplicationConfigurator/index.d.ts +1 -3
  16. package/distribution/components/utilities/NotFound/index.d.ts +1 -1
  17. package/distribution/components/utilities/Origin/index.d.ts +1 -1
  18. package/distribution/components/utilities/PlaneConfigurator/index.d.ts +1 -3
  19. package/distribution/components/utilities/Toolbar/General/components/Drawer/index.d.ts +1 -1
  20. package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Global/index.d.ts +1 -1
  21. package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Shortcuts/index.d.ts +1 -1
  22. package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Space/index.d.ts +1 -1
  23. package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Technical/index.d.ts +1 -1
  24. package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Toolbar/index.d.ts +1 -1
  25. package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Transform/index.d.ts +1 -1
  26. package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Viewcube/index.d.ts +1 -1
  27. package/distribution/components/utilities/Toolbar/General/components/MenuMore/index.d.ts +1 -1
  28. package/distribution/components/utilities/Toolbar/General/components/MenuUniverses/index.d.ts +1 -1
  29. package/distribution/components/utilities/Toolbar/General/components/ToolbarRotate/index.d.ts +1 -1
  30. package/distribution/components/utilities/Toolbar/General/components/ToolbarScale/index.d.ts +1 -1
  31. package/distribution/components/utilities/Toolbar/General/components/ToolbarTranslate/index.d.ts +1 -1
  32. package/distribution/components/utilities/Toolbar/General/components/TransformArrow/index.d.ts +1 -1
  33. package/distribution/components/utilities/Toolbar/General/index.d.ts +1 -1
  34. package/distribution/components/utilities/UniverseExplorer/index.d.ts +1 -1
  35. package/distribution/components/utilities/Viewcube/components/ViewcubeFace/index.d.ts +1 -1
  36. package/distribution/components/utilities/Viewcube/components/ViewcubeModel/index.d.ts +1 -1
  37. package/distribution/components/utilities/Viewcube/index.d.ts +1 -1
  38. package/distribution/components/virtuals/List/index.d.ts +1 -1
  39. package/distribution/containers/Application/View/PlanesView/index.d.ts +1 -1
  40. package/distribution/containers/Application/View/index.d.ts +3 -2
  41. package/distribution/data/interfaces/index.d.ts +1 -1
  42. package/distribution/distribution/components/links/Link/components/Preview/index.d.ts +1 -1
  43. package/distribution/distribution/components/links/Link/index.d.ts +1 -3
  44. package/distribution/distribution/components/planes/ExternalPlane/index.d.ts +1 -1
  45. package/distribution/distribution/components/planes/IframePlane/index.d.ts +1 -1
  46. package/distribution/distribution/components/structural/Plane/components/PlaneBridge/index.d.ts +1 -1
  47. package/distribution/distribution/components/structural/Plane/components/PlaneControls/components/SearchItem/index.d.ts +1 -1
  48. package/distribution/distribution/components/structural/Plane/components/PlaneControls/components/SearchList/index.d.ts +1 -1
  49. package/distribution/distribution/components/structural/Plane/components/PlaneControls/index.d.ts +1 -1
  50. package/distribution/distribution/components/structural/Plane/components/PlaneDebugger/index.d.ts +1 -1
  51. package/distribution/distribution/components/structural/Plane/index.d.ts +1 -3
  52. package/distribution/distribution/components/structural/Root/index.d.ts +1 -1
  53. package/distribution/distribution/components/structural/Roots/index.d.ts +1 -1
  54. package/distribution/distribution/components/structural/Space/components/SpaceDebugger/index.d.ts +1 -1
  55. package/distribution/distribution/components/structural/Space/index.d.ts +1 -1
  56. package/distribution/distribution/components/utilities/ApplicationConfigurator/index.d.ts +1 -3
  57. package/distribution/distribution/components/utilities/NotFound/index.d.ts +1 -1
  58. package/distribution/distribution/components/utilities/Origin/index.d.ts +1 -1
  59. package/distribution/distribution/components/utilities/PlaneConfigurator/index.d.ts +1 -3
  60. package/distribution/distribution/components/utilities/Toolbar/General/components/Drawer/index.d.ts +1 -1
  61. package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Global/index.d.ts +1 -1
  62. package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Shortcuts/index.d.ts +1 -1
  63. package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Space/index.d.ts +1 -1
  64. package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Technical/index.d.ts +1 -1
  65. package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Toolbar/index.d.ts +1 -1
  66. package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Transform/index.d.ts +1 -1
  67. package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Viewcube/index.d.ts +1 -1
  68. package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/index.d.ts +1 -1
  69. package/distribution/distribution/components/utilities/Toolbar/General/components/MenuUniverses/index.d.ts +1 -1
  70. package/distribution/distribution/components/utilities/Toolbar/General/components/ToolbarRotate/index.d.ts +1 -1
  71. package/distribution/distribution/components/utilities/Toolbar/General/components/ToolbarScale/index.d.ts +1 -1
  72. package/distribution/distribution/components/utilities/Toolbar/General/components/ToolbarTranslate/index.d.ts +1 -1
  73. package/distribution/distribution/components/utilities/Toolbar/General/components/TransformArrow/index.d.ts +1 -1
  74. package/distribution/distribution/components/utilities/Toolbar/General/index.d.ts +1 -1
  75. package/distribution/distribution/components/utilities/UniverseExplorer/index.d.ts +1 -1
  76. package/distribution/distribution/components/utilities/Viewcube/components/ViewcubeFace/index.d.ts +1 -1
  77. package/distribution/distribution/components/utilities/Viewcube/components/ViewcubeModel/index.d.ts +1 -1
  78. package/distribution/distribution/components/utilities/Viewcube/index.d.ts +1 -1
  79. package/distribution/distribution/components/virtuals/List/index.d.ts +1 -1
  80. package/distribution/distribution/containers/Application/View/PlanesView/index.d.ts +1 -1
  81. package/distribution/distribution/containers/Application/View/index.d.ts +3 -2
  82. package/distribution/distribution/data/interfaces/index.d.ts +1 -1
  83. package/distribution/distribution/index.d.ts +15 -21
  84. package/distribution/distribution/services/logic/router/index.d.ts +3 -3
  85. package/distribution/distribution/services/logic/server/index.d.ts +1 -1
  86. package/distribution/index.d.ts +15 -21
  87. package/distribution/index.es.js +53 -25
  88. package/distribution/index.es.js.map +1 -1
  89. package/distribution/index.js +53 -25
  90. package/distribution/index.js.map +1 -1
  91. package/distribution/index.min.js +25 -25
  92. package/distribution/index.min.js.map +1 -1
  93. package/distribution/services/logic/router/index.d.ts +3 -3
  94. package/distribution/services/logic/server/index.d.ts +1 -1
  95. package/package.json +4 -4
@@ -5028,7 +5028,7 @@ const handleView = view => {
5028
5028
  const {getRegisteredPlanes: getRegisteredPlanes} = pluridEngine.planes;
5029
5029
 
5030
5030
  const PluridView = properties => {
5031
- const {planesRegistrar: planesRegistrar, customPlane: customPlane, planeContext: planeContext, planeContextValue: planeContextValue, pubsub: pubsub, planeNotFound: planeNotFound, planeRenderError: planeRenderError, matchedRoute: matchedRoute, stateConfiguration: stateConfiguration, stateTransform: stateTransform, stateSpaceView: stateSpaceView, dispatch: dispatch, dispatchSetConfiguration: dispatchSetConfiguration, dispatchSetGeneralTheme: dispatchSetGeneralTheme, dispatchSetInteractionTheme: dispatchSetInteractionTheme, dispatchSetSpaceLocation: dispatchSetSpaceLocation, dispatchSetAnimatedTransform: dispatchSetAnimatedTransform, dispatchSetTransformTime: dispatchSetTransformTime, dispatchSetTree: dispatchSetTree, dispatchRotateXWith: dispatchRotateXWith, dispatchRotateX: dispatchRotateX, dispatchRotateYWith: dispatchRotateYWith, dispatchRotateY: dispatchRotateY, dispatchTranslateXWith: dispatchTranslateXWith, dispatchTranslateYWith: dispatchTranslateYWith, dispatchScaleUpWith: dispatchScaleUpWith, dispatchScaleDownWith: dispatchScaleDownWith, dispatchSpaceSetViewSize: dispatchSpaceSetViewSize, dispatchSpaceSetView: dispatchSpaceSetView} = properties;
5031
+ const {planesRegistrar: planesRegistrar, customPlane: customPlane, planeContext: planeContext, planeContextValue: planeContextValue, pubsub: pubsub, planeNotFound: planeNotFound, planeRenderError: planeRenderError, matchedRoute: matchedRoute, stateConfiguration: stateConfiguration, stateTransform: stateTransform, stateSpaceView: stateSpaceView, stateTree: stateTree, dispatch: dispatch, dispatchSetConfiguration: dispatchSetConfiguration, dispatchSetGeneralTheme: dispatchSetGeneralTheme, dispatchSetInteractionTheme: dispatchSetInteractionTheme, dispatchSetSpaceLocation: dispatchSetSpaceLocation, dispatchSetAnimatedTransform: dispatchSetAnimatedTransform, dispatchSetTransformTime: dispatchSetTransformTime, dispatchSetTree: dispatchSetTree, dispatchRotateXWith: dispatchRotateXWith, dispatchRotateX: dispatchRotateX, dispatchRotateYWith: dispatchRotateYWith, dispatchRotateY: dispatchRotateY, dispatchTranslateXWith: dispatchTranslateXWith, dispatchTranslateYWith: dispatchTranslateYWith, dispatchScaleUpWith: dispatchScaleUpWith, dispatchScaleDownWith: dispatchScaleDownWith, dispatchSpaceSetViewSize: dispatchSpaceSetViewSize, dispatchSpaceSetView: dispatchSpaceSetView} = properties;
5032
5032
  const viewElement = React.useRef(null);
5033
5033
  const [pluridPubSub, setPluridPubSub] = React.useState(pubsub ? [ pubsub ] : []);
5034
5034
  const shortcutsCallback = React.useCallback((event => {
@@ -5044,15 +5044,27 @@ 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
+ for (const statePlane of stateTree) {
5056
+ for (const [index, computedPlane] of computedTree.entries()) {
5057
+ if (statePlane.route === computedPlane.route) {
5058
+ if (statePlane.children) {
5059
+ computedTree[index].children = statePlane.children;
5060
+ }
5061
+ }
5062
+ }
5063
+ }
5055
5064
  dispatchSetTree(computedTree);
5065
+ };
5066
+ const treeUpdateCallback = React.useCallback((() => {
5067
+ treeUpdate(stateSpaceView);
5056
5068
  }), [ stateSpaceView, stateConfiguration ]);
5057
5069
  const handlePubSubSubscribe = pubsub => {
5058
5070
  const configurationIndex = pubsub.subscribe({
@@ -5150,6 +5162,7 @@ const PluridView = properties => {
5150
5162
  const {plane: plane} = data;
5151
5163
  const updatedView = [ ...stateSpaceView, plane ];
5152
5164
  dispatchSpaceSetView(updatedView);
5165
+ treeUpdate(updatedView);
5153
5166
  }
5154
5167
  });
5155
5168
  const viewSetPlanesIndex = pubsub.subscribe({
@@ -5157,6 +5170,7 @@ const PluridView = properties => {
5157
5170
  callback: data => {
5158
5171
  const {view: view} = data;
5159
5172
  dispatchSpaceSetView([ ...view ]);
5173
+ treeUpdate(view);
5160
5174
  }
5161
5175
  });
5162
5176
  const viewRemovePlaneIndex = pubsub.subscribe({
@@ -5170,6 +5184,7 @@ const PluridView = properties => {
5170
5184
  return true;
5171
5185
  }));
5172
5186
  dispatchSpaceSetView(updatedView);
5187
+ treeUpdate(updatedView);
5173
5188
  }
5174
5189
  });
5175
5190
  return () => {
@@ -5209,10 +5224,10 @@ const PluridView = properties => {
5209
5224
  };
5210
5225
  const handleSwipe = event => {
5211
5226
  const {transformMode: transformMode} = stateConfiguration.space;
5212
- const {velocity: velocity, distance: distance, direction: direction} = event;
5213
5227
  if (transformMode === pluridData.TRANSFORM_MODES.ALL) {
5214
5228
  return;
5215
5229
  }
5230
+ const {velocity: velocity, distance: distance, direction: direction} = event;
5216
5231
  const rotationMode = transformMode === pluridData.TRANSFORM_MODES.ROTATION;
5217
5232
  const translationMode = transformMode === pluridData.TRANSFORM_MODES.TRANSLATION;
5218
5233
  const scalationMode = transformMode === pluridData.TRANSFORM_MODES.SCALE;
@@ -5266,10 +5281,10 @@ const PluridView = properties => {
5266
5281
  };
5267
5282
  const handlePan = event => {
5268
5283
  const {transformMode: transformMode} = stateConfiguration.space;
5269
- const {velocity: velocity, distance: distance, direction: direction} = event;
5270
5284
  if (transformMode === pluridData.TRANSFORM_MODES.ALL) {
5271
5285
  return;
5272
5286
  }
5287
+ const {velocity: velocity, distance: distance, direction: direction} = event;
5273
5288
  const rotationMode = transformMode === pluridData.TRANSFORM_MODES.ROTATION;
5274
5289
  const translationMode = transformMode === pluridData.TRANSFORM_MODES.TRANSLATION;
5275
5290
  const scalationMode = transformMode === pluridData.TRANSFORM_MODES.SCALE;
@@ -5390,18 +5405,17 @@ const PluridView = properties => {
5390
5405
  }));
5391
5406
  handleTouch();
5392
5407
  return () => {
5408
+ if (!touch) {
5409
+ return;
5410
+ }
5393
5411
  const {transformTouch: transformTouch} = stateConfiguration.space;
5394
5412
  if (transformTouch === pluridData.TRANSFORM_TOUCHES.PAN) {
5395
- if (touch) {
5396
- touch.off("pan", handlePan);
5397
- }
5413
+ touch.off("pan", handlePan);
5398
5414
  } else {
5399
- if (touch) {
5400
- touch.off("swipe", handleSwipe);
5401
- }
5415
+ touch.off("swipe", handleSwipe);
5402
5416
  }
5403
5417
  };
5404
- }), [ viewElement.current, stateConfiguration.space.transformTouch ]);
5418
+ }), [ viewElement.current, stateConfiguration.space.transformTouch, stateConfiguration.space.transformMode ]);
5405
5419
  React.useEffect((() => {
5406
5420
  const handleGamepadConnect = event => {
5407
5421
  const gamepad = navigator.getGamepads()[event.gamepad.index];
@@ -5463,6 +5477,7 @@ const PluridView = properties => {
5463
5477
  const mapStateToProperties$7 = state => ({
5464
5478
  stateConfiguration: selectors.configuration.getConfiguration(state),
5465
5479
  stateTransform: selectors.space.getTransform(state),
5480
+ stateTree: selectors.space.getTree(state),
5466
5481
  stateSpaceLoading: selectors.space.getLoading(state),
5467
5482
  stateSpaceView: selectors.space.getView(state)
5468
5483
  });
@@ -5663,13 +5678,23 @@ const computeIndexedPlanes = (routes, protocol, host) => {
5663
5678
  return indexedPlanes;
5664
5679
  };
5665
5680
 
5666
- const collectApplicationsFromPath = (isoMatch, protocol, host) => {
5681
+ const collectApplicationsFromPath = (isoMatch, protocol, host, globals) => __awaiter(void 0, void 0, void 0, (function*() {
5667
5682
  const path = {
5668
- planes: isoMatch.data.planes || [],
5669
- spaces: isoMatch.data.spaces || [],
5670
- view: isoMatch.data.view || [],
5671
- value: isoMatch.data.value || ""
5683
+ planes: [],
5684
+ spaces: [],
5685
+ view: [],
5686
+ value: ""
5672
5687
  };
5688
+ if (isoMatch.kind === "Route") {
5689
+ let routeData = isoMatch.data;
5690
+ if (isoMatch.data.resolver) {
5691
+ routeData = yield isoMatch.data.resolver(globals);
5692
+ }
5693
+ path.planes = routeData.planes || [];
5694
+ path.spaces = routeData.spaces || [];
5695
+ path.view = routeData.view || [];
5696
+ path.value = isoMatch.data.value || "";
5697
+ }
5673
5698
  const {planes: planes, spaces: spaces, view: view} = path;
5674
5699
  const plurids = [];
5675
5700
  if (spaces) {
@@ -5730,7 +5755,7 @@ const collectApplicationsFromPath = (isoMatch, protocol, host) => {
5730
5755
  plurids.push(pluridApplication);
5731
5756
  }
5732
5757
  return plurids;
5733
- };
5758
+ }));
5734
5759
 
5735
5760
  const gatherPluridPlanes = (routes, planes) => {
5736
5761
  const pluridPlanes = [];
@@ -5947,7 +5972,10 @@ const computePluridRoute = (matchedRoute, planesRegistrar, isoMatcher, directPla
5947
5972
  }
5948
5973
  return () => () => React__default["default"].createElement(React__default["default"].Fragment, null);
5949
5974
  }
5950
- const {exterior: exterior, view: view, planes: planes, spaces: spaces, defaultConfiguration: defaultConfiguration, slotted: slotted} = matchedRoute.data;
5975
+ const {exterior: exterior, view: view, planes: planes, spaces: spaces, defaultConfiguration: defaultConfiguration, slotted: slotted, resolver: resolver} = matchedRoute.data;
5976
+ if (resolver) {
5977
+ resolver(undefined);
5978
+ }
5951
5979
  const pluridRouteProperty = {
5952
5980
  value: matchedRoute.match.value,
5953
5981
  parameters: matchedRoute.match.parameters,
@@ -6408,7 +6436,7 @@ const PluridLink = properties => {
6408
6436
  if (showLink) {
6409
6437
  return;
6410
6438
  }
6411
- if (event.ctrlKey || event.metaKey) {
6439
+ if (event.altKey || event.metaKey) {
6412
6440
  return;
6413
6441
  }
6414
6442
  const {location: location} = updatedPlane;
@@ -6946,11 +6974,11 @@ const computeApplication = (indexedPlanes, planes, configuration, view) => {
6946
6974
  return data;
6947
6975
  };
6948
6976
 
6949
- const serverComputeMetastate = (isoMatch, paths) => {
6977
+ const serverComputeMetastate = (isoMatch, paths, globals) => __awaiter(void 0, void 0, void 0, (function*() {
6950
6978
  const protocol = "http";
6951
6979
  const host = "localhost:63000";
6952
6980
  const indexedPlanes = computeIndexedPlanes(paths, protocol, host);
6953
- const pluridApplications = collectApplicationsFromPath(isoMatch);
6981
+ const pluridApplications = yield collectApplicationsFromPath(isoMatch, protocol, host, globals);
6954
6982
  const states = {};
6955
6983
  for (const application of pluridApplications) {
6956
6984
  const {planes: planes, view: view} = application;
@@ -7008,13 +7036,13 @@ const serverComputeMetastate = (isoMatch, paths) => {
7008
7036
  return {
7009
7037
  states: states
7010
7038
  };
7011
- };
7039
+ }));
7012
7040
 
7013
7041
  const usePluridRouter = () => {
7014
7042
  const [routerValue, setRouterValue] = React.useState("");
7015
7043
  React.useEffect((() => {
7016
7044
  const fetchState = () => {
7017
- const state = pluridFunctions.storage.loadState("__PLURID_ROUTER__");
7045
+ const state = pluridFunctions.storage.loadState(pluridData.PLURID_ROUTER_STORAGE);
7018
7046
  if (state) {
7019
7047
  setRouterValue(state);
7020
7048
  }