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

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 +40 -21
  88. package/distribution/index.es.js.map +1 -1
  89. package/distribution/index.js +40 -21
  90. package/distribution/index.js.map +1 -1
  91. package/distribution/index.min.js +24 -24
  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
@@ -4988,7 +4988,7 @@ const handleView = view => {
4988
4988
  const {getRegisteredPlanes: getRegisteredPlanes} = planes;
4989
4989
 
4990
4990
  const PluridView = properties => {
4991
- 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;
4991
+ 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;
4992
4992
  const viewElement = useRef(null);
4993
4993
  const [pluridPubSub, setPluridPubSub] = useState(pubsub ? [ pubsub ] : []);
4994
4994
  const shortcutsCallback = useCallback((event => {
@@ -5012,6 +5012,15 @@ const PluridView = properties => {
5012
5012
  view: stateSpaceView
5013
5013
  });
5014
5014
  const computedTree = spaceTree.compute();
5015
+ for (const statePlane of stateTree) {
5016
+ for (const [index, computedPlane] of computedTree.entries()) {
5017
+ if (statePlane.route === computedPlane.route) {
5018
+ if (statePlane.children) {
5019
+ computedTree[index].children = statePlane.children;
5020
+ }
5021
+ }
5022
+ }
5023
+ }
5015
5024
  dispatchSetTree(computedTree);
5016
5025
  }), [ stateSpaceView, stateConfiguration ]);
5017
5026
  const handlePubSubSubscribe = pubsub => {
@@ -5169,10 +5178,10 @@ const PluridView = properties => {
5169
5178
  };
5170
5179
  const handleSwipe = event => {
5171
5180
  const {transformMode: transformMode} = stateConfiguration.space;
5172
- const {velocity: velocity, distance: distance, direction: direction} = event;
5173
5181
  if (transformMode === TRANSFORM_MODES.ALL) {
5174
5182
  return;
5175
5183
  }
5184
+ const {velocity: velocity, distance: distance, direction: direction} = event;
5176
5185
  const rotationMode = transformMode === TRANSFORM_MODES.ROTATION;
5177
5186
  const translationMode = transformMode === TRANSFORM_MODES.TRANSLATION;
5178
5187
  const scalationMode = transformMode === TRANSFORM_MODES.SCALE;
@@ -5226,10 +5235,10 @@ const PluridView = properties => {
5226
5235
  };
5227
5236
  const handlePan = event => {
5228
5237
  const {transformMode: transformMode} = stateConfiguration.space;
5229
- const {velocity: velocity, distance: distance, direction: direction} = event;
5230
5238
  if (transformMode === TRANSFORM_MODES.ALL) {
5231
5239
  return;
5232
5240
  }
5241
+ const {velocity: velocity, distance: distance, direction: direction} = event;
5233
5242
  const rotationMode = transformMode === TRANSFORM_MODES.ROTATION;
5234
5243
  const translationMode = transformMode === TRANSFORM_MODES.TRANSLATION;
5235
5244
  const scalationMode = transformMode === TRANSFORM_MODES.SCALE;
@@ -5350,18 +5359,17 @@ const PluridView = properties => {
5350
5359
  }));
5351
5360
  handleTouch();
5352
5361
  return () => {
5362
+ if (!touch) {
5363
+ return;
5364
+ }
5353
5365
  const {transformTouch: transformTouch} = stateConfiguration.space;
5354
5366
  if (transformTouch === TRANSFORM_TOUCHES.PAN) {
5355
- if (touch) {
5356
- touch.off("pan", handlePan);
5357
- }
5367
+ touch.off("pan", handlePan);
5358
5368
  } else {
5359
- if (touch) {
5360
- touch.off("swipe", handleSwipe);
5361
- }
5369
+ touch.off("swipe", handleSwipe);
5362
5370
  }
5363
5371
  };
5364
- }), [ viewElement.current, stateConfiguration.space.transformTouch ]);
5372
+ }), [ viewElement.current, stateConfiguration.space.transformTouch, stateConfiguration.space.transformMode ]);
5365
5373
  useEffect((() => {
5366
5374
  const handleGamepadConnect = event => {
5367
5375
  const gamepad = navigator.getGamepads()[event.gamepad.index];
@@ -5423,6 +5431,7 @@ const PluridView = properties => {
5423
5431
  const mapStateToProperties$7 = state => ({
5424
5432
  stateConfiguration: selectors.configuration.getConfiguration(state),
5425
5433
  stateTransform: selectors.space.getTransform(state),
5434
+ stateTree: selectors.space.getTree(state),
5426
5435
  stateSpaceLoading: selectors.space.getLoading(state),
5427
5436
  stateSpaceView: selectors.space.getView(state)
5428
5437
  });
@@ -5623,13 +5632,23 @@ const computeIndexedPlanes = (routes, protocol, host) => {
5623
5632
  return indexedPlanes;
5624
5633
  };
5625
5634
 
5626
- const collectApplicationsFromPath = (isoMatch, protocol, host) => {
5635
+ const collectApplicationsFromPath = (isoMatch, protocol, host, globals) => __awaiter(void 0, void 0, void 0, (function*() {
5627
5636
  const path = {
5628
- planes: isoMatch.data.planes || [],
5629
- spaces: isoMatch.data.spaces || [],
5630
- view: isoMatch.data.view || [],
5631
- value: isoMatch.data.value || ""
5637
+ planes: [],
5638
+ spaces: [],
5639
+ view: [],
5640
+ value: ""
5632
5641
  };
5642
+ if (isoMatch.kind === "Route") {
5643
+ let routeData = isoMatch.data;
5644
+ if (isoMatch.data.resolver) {
5645
+ routeData = yield isoMatch.data.resolver(globals);
5646
+ }
5647
+ path.planes = routeData.planes || [];
5648
+ path.spaces = routeData.spaces || [];
5649
+ path.view = routeData.view || [];
5650
+ path.value = isoMatch.data.value || "";
5651
+ }
5633
5652
  const {planes: planes, spaces: spaces, view: view} = path;
5634
5653
  const plurids = [];
5635
5654
  if (spaces) {
@@ -5690,7 +5709,7 @@ const collectApplicationsFromPath = (isoMatch, protocol, host) => {
5690
5709
  plurids.push(pluridApplication);
5691
5710
  }
5692
5711
  return plurids;
5693
- };
5712
+ }));
5694
5713
 
5695
5714
  const gatherPluridPlanes = (routes, planes) => {
5696
5715
  const pluridPlanes = [];
@@ -6368,7 +6387,7 @@ const PluridLink = properties => {
6368
6387
  if (showLink) {
6369
6388
  return;
6370
6389
  }
6371
- if (event.ctrlKey || event.metaKey) {
6390
+ if (event.altKey || event.metaKey) {
6372
6391
  return;
6373
6392
  }
6374
6393
  const {location: location} = updatedPlane;
@@ -6906,11 +6925,11 @@ const computeApplication = (indexedPlanes, planes, configuration, view) => {
6906
6925
  return data;
6907
6926
  };
6908
6927
 
6909
- const serverComputeMetastate = (isoMatch, paths) => {
6928
+ const serverComputeMetastate = (isoMatch, paths, globals) => __awaiter(void 0, void 0, void 0, (function*() {
6910
6929
  const protocol = "http";
6911
6930
  const host = "localhost:63000";
6912
6931
  const indexedPlanes = computeIndexedPlanes(paths, protocol, host);
6913
- const pluridApplications = collectApplicationsFromPath(isoMatch);
6932
+ const pluridApplications = yield collectApplicationsFromPath(isoMatch, protocol, host, globals);
6914
6933
  const states = {};
6915
6934
  for (const application of pluridApplications) {
6916
6935
  const {planes: planes, view: view} = application;
@@ -6968,13 +6987,13 @@ const serverComputeMetastate = (isoMatch, paths) => {
6968
6987
  return {
6969
6988
  states: states
6970
6989
  };
6971
- };
6990
+ }));
6972
6991
 
6973
6992
  const usePluridRouter = () => {
6974
6993
  const [routerValue, setRouterValue] = useState("");
6975
6994
  useEffect((() => {
6976
6995
  const fetchState = () => {
6977
- const state = storage.loadState("__PLURID_ROUTER__");
6996
+ const state = storage.loadState(PLURID_ROUTER_STORAGE);
6978
6997
  if (state) {
6979
6998
  setRouterValue(state);
6980
6999
  }