@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.
- package/distribution/components/links/Link/components/Preview/index.d.ts +1 -1
- package/distribution/components/links/Link/index.d.ts +1 -3
- package/distribution/components/planes/ExternalPlane/index.d.ts +1 -1
- package/distribution/components/planes/IframePlane/index.d.ts +1 -1
- package/distribution/components/structural/Plane/components/PlaneBridge/index.d.ts +1 -1
- package/distribution/components/structural/Plane/components/PlaneControls/components/SearchItem/index.d.ts +1 -1
- package/distribution/components/structural/Plane/components/PlaneControls/components/SearchList/index.d.ts +1 -1
- package/distribution/components/structural/Plane/components/PlaneControls/index.d.ts +1 -1
- package/distribution/components/structural/Plane/components/PlaneDebugger/index.d.ts +1 -1
- package/distribution/components/structural/Plane/index.d.ts +1 -3
- package/distribution/components/structural/Root/index.d.ts +1 -1
- package/distribution/components/structural/Roots/index.d.ts +1 -1
- package/distribution/components/structural/Space/components/SpaceDebugger/index.d.ts +1 -1
- package/distribution/components/structural/Space/index.d.ts +1 -1
- package/distribution/components/utilities/ApplicationConfigurator/index.d.ts +1 -3
- package/distribution/components/utilities/NotFound/index.d.ts +1 -1
- package/distribution/components/utilities/Origin/index.d.ts +1 -1
- package/distribution/components/utilities/PlaneConfigurator/index.d.ts +1 -3
- package/distribution/components/utilities/Toolbar/General/components/Drawer/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Global/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Shortcuts/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Space/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Technical/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Toolbar/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Transform/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Viewcube/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuUniverses/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/ToolbarRotate/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/ToolbarScale/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/ToolbarTranslate/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/TransformArrow/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/index.d.ts +1 -1
- package/distribution/components/utilities/UniverseExplorer/index.d.ts +1 -1
- package/distribution/components/utilities/Viewcube/components/ViewcubeFace/index.d.ts +1 -1
- package/distribution/components/utilities/Viewcube/components/ViewcubeModel/index.d.ts +1 -1
- package/distribution/components/utilities/Viewcube/index.d.ts +1 -1
- package/distribution/components/virtuals/List/index.d.ts +1 -1
- package/distribution/containers/Application/View/PlanesView/index.d.ts +1 -1
- package/distribution/containers/Application/View/index.d.ts +3 -2
- package/distribution/data/interfaces/index.d.ts +1 -1
- package/distribution/distribution/components/links/Link/components/Preview/index.d.ts +1 -1
- package/distribution/distribution/components/links/Link/index.d.ts +1 -3
- package/distribution/distribution/components/planes/ExternalPlane/index.d.ts +1 -1
- package/distribution/distribution/components/planes/IframePlane/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Plane/components/PlaneBridge/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Plane/components/PlaneControls/components/SearchItem/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Plane/components/PlaneControls/components/SearchList/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Plane/components/PlaneControls/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Plane/components/PlaneDebugger/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Plane/index.d.ts +1 -3
- package/distribution/distribution/components/structural/Root/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Roots/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Space/components/SpaceDebugger/index.d.ts +1 -1
- package/distribution/distribution/components/structural/Space/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/ApplicationConfigurator/index.d.ts +1 -3
- package/distribution/distribution/components/utilities/NotFound/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Origin/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/PlaneConfigurator/index.d.ts +1 -3
- package/distribution/distribution/components/utilities/Toolbar/General/components/Drawer/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Global/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Shortcuts/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Space/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Technical/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Toolbar/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Transform/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Viewcube/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuMore/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/MenuUniverses/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/ToolbarRotate/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/ToolbarScale/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/ToolbarTranslate/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/components/TransformArrow/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Toolbar/General/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/UniverseExplorer/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Viewcube/components/ViewcubeFace/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Viewcube/components/ViewcubeModel/index.d.ts +1 -1
- package/distribution/distribution/components/utilities/Viewcube/index.d.ts +1 -1
- package/distribution/distribution/components/virtuals/List/index.d.ts +1 -1
- package/distribution/distribution/containers/Application/View/PlanesView/index.d.ts +1 -1
- package/distribution/distribution/containers/Application/View/index.d.ts +3 -2
- package/distribution/distribution/data/interfaces/index.d.ts +1 -1
- package/distribution/distribution/index.d.ts +15 -21
- package/distribution/distribution/services/logic/router/index.d.ts +3 -3
- package/distribution/distribution/services/logic/server/index.d.ts +1 -1
- package/distribution/index.d.ts +15 -21
- package/distribution/index.es.js +40 -21
- package/distribution/index.es.js.map +1 -1
- package/distribution/index.js +40 -21
- package/distribution/index.js.map +1 -1
- package/distribution/index.min.js +24 -24
- package/distribution/index.min.js.map +1 -1
- package/distribution/services/logic/router/index.d.ts +3 -3
- package/distribution/services/logic/server/index.d.ts +1 -1
- package/package.json +4 -4
package/distribution/index.js
CHANGED
|
@@ -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 => {
|
|
@@ -5052,6 +5052,15 @@ const PluridView = properties => {
|
|
|
5052
5052
|
view: stateSpaceView
|
|
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);
|
|
5056
5065
|
}), [ stateSpaceView, stateConfiguration ]);
|
|
5057
5066
|
const handlePubSubSubscribe = pubsub => {
|
|
@@ -5209,10 +5218,10 @@ const PluridView = properties => {
|
|
|
5209
5218
|
};
|
|
5210
5219
|
const handleSwipe = event => {
|
|
5211
5220
|
const {transformMode: transformMode} = stateConfiguration.space;
|
|
5212
|
-
const {velocity: velocity, distance: distance, direction: direction} = event;
|
|
5213
5221
|
if (transformMode === pluridData.TRANSFORM_MODES.ALL) {
|
|
5214
5222
|
return;
|
|
5215
5223
|
}
|
|
5224
|
+
const {velocity: velocity, distance: distance, direction: direction} = event;
|
|
5216
5225
|
const rotationMode = transformMode === pluridData.TRANSFORM_MODES.ROTATION;
|
|
5217
5226
|
const translationMode = transformMode === pluridData.TRANSFORM_MODES.TRANSLATION;
|
|
5218
5227
|
const scalationMode = transformMode === pluridData.TRANSFORM_MODES.SCALE;
|
|
@@ -5266,10 +5275,10 @@ const PluridView = properties => {
|
|
|
5266
5275
|
};
|
|
5267
5276
|
const handlePan = event => {
|
|
5268
5277
|
const {transformMode: transformMode} = stateConfiguration.space;
|
|
5269
|
-
const {velocity: velocity, distance: distance, direction: direction} = event;
|
|
5270
5278
|
if (transformMode === pluridData.TRANSFORM_MODES.ALL) {
|
|
5271
5279
|
return;
|
|
5272
5280
|
}
|
|
5281
|
+
const {velocity: velocity, distance: distance, direction: direction} = event;
|
|
5273
5282
|
const rotationMode = transformMode === pluridData.TRANSFORM_MODES.ROTATION;
|
|
5274
5283
|
const translationMode = transformMode === pluridData.TRANSFORM_MODES.TRANSLATION;
|
|
5275
5284
|
const scalationMode = transformMode === pluridData.TRANSFORM_MODES.SCALE;
|
|
@@ -5390,18 +5399,17 @@ const PluridView = properties => {
|
|
|
5390
5399
|
}));
|
|
5391
5400
|
handleTouch();
|
|
5392
5401
|
return () => {
|
|
5402
|
+
if (!touch) {
|
|
5403
|
+
return;
|
|
5404
|
+
}
|
|
5393
5405
|
const {transformTouch: transformTouch} = stateConfiguration.space;
|
|
5394
5406
|
if (transformTouch === pluridData.TRANSFORM_TOUCHES.PAN) {
|
|
5395
|
-
|
|
5396
|
-
touch.off("pan", handlePan);
|
|
5397
|
-
}
|
|
5407
|
+
touch.off("pan", handlePan);
|
|
5398
5408
|
} else {
|
|
5399
|
-
|
|
5400
|
-
touch.off("swipe", handleSwipe);
|
|
5401
|
-
}
|
|
5409
|
+
touch.off("swipe", handleSwipe);
|
|
5402
5410
|
}
|
|
5403
5411
|
};
|
|
5404
|
-
}), [ viewElement.current, stateConfiguration.space.transformTouch ]);
|
|
5412
|
+
}), [ viewElement.current, stateConfiguration.space.transformTouch, stateConfiguration.space.transformMode ]);
|
|
5405
5413
|
React.useEffect((() => {
|
|
5406
5414
|
const handleGamepadConnect = event => {
|
|
5407
5415
|
const gamepad = navigator.getGamepads()[event.gamepad.index];
|
|
@@ -5463,6 +5471,7 @@ const PluridView = properties => {
|
|
|
5463
5471
|
const mapStateToProperties$7 = state => ({
|
|
5464
5472
|
stateConfiguration: selectors.configuration.getConfiguration(state),
|
|
5465
5473
|
stateTransform: selectors.space.getTransform(state),
|
|
5474
|
+
stateTree: selectors.space.getTree(state),
|
|
5466
5475
|
stateSpaceLoading: selectors.space.getLoading(state),
|
|
5467
5476
|
stateSpaceView: selectors.space.getView(state)
|
|
5468
5477
|
});
|
|
@@ -5663,13 +5672,23 @@ const computeIndexedPlanes = (routes, protocol, host) => {
|
|
|
5663
5672
|
return indexedPlanes;
|
|
5664
5673
|
};
|
|
5665
5674
|
|
|
5666
|
-
const collectApplicationsFromPath = (isoMatch, protocol, host) => {
|
|
5675
|
+
const collectApplicationsFromPath = (isoMatch, protocol, host, globals) => __awaiter(void 0, void 0, void 0, (function*() {
|
|
5667
5676
|
const path = {
|
|
5668
|
-
planes:
|
|
5669
|
-
spaces:
|
|
5670
|
-
view:
|
|
5671
|
-
value:
|
|
5677
|
+
planes: [],
|
|
5678
|
+
spaces: [],
|
|
5679
|
+
view: [],
|
|
5680
|
+
value: ""
|
|
5672
5681
|
};
|
|
5682
|
+
if (isoMatch.kind === "Route") {
|
|
5683
|
+
let routeData = isoMatch.data;
|
|
5684
|
+
if (isoMatch.data.resolver) {
|
|
5685
|
+
routeData = yield isoMatch.data.resolver(globals);
|
|
5686
|
+
}
|
|
5687
|
+
path.planes = routeData.planes || [];
|
|
5688
|
+
path.spaces = routeData.spaces || [];
|
|
5689
|
+
path.view = routeData.view || [];
|
|
5690
|
+
path.value = isoMatch.data.value || "";
|
|
5691
|
+
}
|
|
5673
5692
|
const {planes: planes, spaces: spaces, view: view} = path;
|
|
5674
5693
|
const plurids = [];
|
|
5675
5694
|
if (spaces) {
|
|
@@ -5730,7 +5749,7 @@ const collectApplicationsFromPath = (isoMatch, protocol, host) => {
|
|
|
5730
5749
|
plurids.push(pluridApplication);
|
|
5731
5750
|
}
|
|
5732
5751
|
return plurids;
|
|
5733
|
-
};
|
|
5752
|
+
}));
|
|
5734
5753
|
|
|
5735
5754
|
const gatherPluridPlanes = (routes, planes) => {
|
|
5736
5755
|
const pluridPlanes = [];
|
|
@@ -6408,7 +6427,7 @@ const PluridLink = properties => {
|
|
|
6408
6427
|
if (showLink) {
|
|
6409
6428
|
return;
|
|
6410
6429
|
}
|
|
6411
|
-
if (event.
|
|
6430
|
+
if (event.altKey || event.metaKey) {
|
|
6412
6431
|
return;
|
|
6413
6432
|
}
|
|
6414
6433
|
const {location: location} = updatedPlane;
|
|
@@ -6946,11 +6965,11 @@ const computeApplication = (indexedPlanes, planes, configuration, view) => {
|
|
|
6946
6965
|
return data;
|
|
6947
6966
|
};
|
|
6948
6967
|
|
|
6949
|
-
const serverComputeMetastate = (isoMatch, paths) => {
|
|
6968
|
+
const serverComputeMetastate = (isoMatch, paths, globals) => __awaiter(void 0, void 0, void 0, (function*() {
|
|
6950
6969
|
const protocol = "http";
|
|
6951
6970
|
const host = "localhost:63000";
|
|
6952
6971
|
const indexedPlanes = computeIndexedPlanes(paths, protocol, host);
|
|
6953
|
-
const pluridApplications = collectApplicationsFromPath(isoMatch);
|
|
6972
|
+
const pluridApplications = yield collectApplicationsFromPath(isoMatch, protocol, host, globals);
|
|
6954
6973
|
const states = {};
|
|
6955
6974
|
for (const application of pluridApplications) {
|
|
6956
6975
|
const {planes: planes, view: view} = application;
|
|
@@ -7008,13 +7027,13 @@ const serverComputeMetastate = (isoMatch, paths) => {
|
|
|
7008
7027
|
return {
|
|
7009
7028
|
states: states
|
|
7010
7029
|
};
|
|
7011
|
-
};
|
|
7030
|
+
}));
|
|
7012
7031
|
|
|
7013
7032
|
const usePluridRouter = () => {
|
|
7014
7033
|
const [routerValue, setRouterValue] = React.useState("");
|
|
7015
7034
|
React.useEffect((() => {
|
|
7016
7035
|
const fetchState = () => {
|
|
7017
|
-
const state = pluridFunctions.storage.loadState(
|
|
7036
|
+
const state = pluridFunctions.storage.loadState(pluridData.PLURID_ROUTER_STORAGE);
|
|
7018
7037
|
if (state) {
|
|
7019
7038
|
setRouterValue(state);
|
|
7020
7039
|
}
|