@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.
- package/distribution/distribution/services/logic/router/index.d.ts +2 -2
- package/distribution/index.es.js +17 -5
- package/distribution/index.es.js.map +1 -1
- package/distribution/index.js +17 -5
- package/distribution/index.js.map +1 -1
- package/distribution/index.min.js +525 -525
- package/distribution/index.min.js.map +1 -1
- package/distribution/services/logic/router/index.d.ts +2 -2
- package/package.json +30 -30
|
@@ -41,8 +41,8 @@ export declare const collectApplicationsFromPath: (isoMatch: PluridRouteMatch, p
|
|
|
41
41
|
}[]>;
|
|
42
42
|
export declare const gatherPluridPlanes: (routes: PluridRoute<PluridReactComponent>[], planes: PluridRoutePlane<PluridReactComponent>[] | undefined) => PluridPlane<PluridReactComponent<any, import("@plurid/plurid-data").PluridPlaneComponentProperty | PluridRouteComponentProperty>>[];
|
|
43
43
|
export declare const renderMultispace: (matchedRoute: PluridRouteMatch) => (() => () => JSX.Element) | (() => React.FC<any>);
|
|
44
|
-
export declare const computePluridRoute: (matchedRoute: PluridRouteMatch | undefined, planesRegistrar: planes.Registrar<PluridReactComponent>, isoMatcher: routing.IsoMatcher<PluridReactComponent>, directPlane?: PluridRouteMatch
|
|
45
|
-
export declare const computeInitialMatchedPath: (staticContext?: PluridRouterStatic
|
|
44
|
+
export declare const computePluridRoute: (matchedRoute: PluridRouteMatch | undefined, planesRegistrar: planes.Registrar<PluridReactComponent>, isoMatcher: routing.IsoMatcher<PluridReactComponent>, directPlane?: PluridRouteMatch) => any;
|
|
45
|
+
export declare const computeInitialMatchedPath: (staticContext?: PluridRouterStatic) => string;
|
|
46
46
|
export declare const getDirectPlaneMatch: (matchedPath: string, routes: PluridRoute<PluridReactComponent>[], planes: PluridRoutePlane<PluridReactComponent>[] | undefined) => {
|
|
47
47
|
matchRoute: PluridRoute<PluridReactComponent<any, import("@plurid/plurid-data").PluridPlaneComponentProperty | PluridRouteComponentProperty>, any> | undefined;
|
|
48
48
|
matchPlane: PluridRoutePlane<PluridReactComponent<any, import("@plurid/plurid-data").PluridPlaneComponentProperty | PluridRouteComponentProperty>> | undefined;
|
package/distribution/index.es.js
CHANGED
|
@@ -5004,12 +5004,12 @@ const PluridView = properties => {
|
|
|
5004
5004
|
};
|
|
5005
5005
|
handleGlobalWheel(dispatch, event, transformModes, transformLocks);
|
|
5006
5006
|
}), [ dispatch, stateConfiguration.space.transformMode, stateConfiguration.space.transformLocks ]);
|
|
5007
|
-
const
|
|
5007
|
+
const treeUpdate = (view, configuration = stateConfiguration) => {
|
|
5008
5008
|
const planes = getRegisteredPlanes(planesRegistrar);
|
|
5009
5009
|
const spaceTree = new space$1.tree.Tree({
|
|
5010
5010
|
planes: planes,
|
|
5011
|
-
configuration:
|
|
5012
|
-
view:
|
|
5011
|
+
configuration: configuration,
|
|
5012
|
+
view: view
|
|
5013
5013
|
});
|
|
5014
5014
|
const computedTree = spaceTree.compute();
|
|
5015
5015
|
for (const statePlane of stateTree) {
|
|
@@ -5022,6 +5022,9 @@ const PluridView = properties => {
|
|
|
5022
5022
|
}
|
|
5023
5023
|
}
|
|
5024
5024
|
dispatchSetTree(computedTree);
|
|
5025
|
+
};
|
|
5026
|
+
const treeUpdateCallback = useCallback((() => {
|
|
5027
|
+
treeUpdate(stateSpaceView);
|
|
5025
5028
|
}), [ stateSpaceView, stateConfiguration ]);
|
|
5026
5029
|
const handlePubSubSubscribe = pubsub => {
|
|
5027
5030
|
const configurationIndex = pubsub.subscribe({
|
|
@@ -5119,6 +5122,7 @@ const PluridView = properties => {
|
|
|
5119
5122
|
const {plane: plane} = data;
|
|
5120
5123
|
const updatedView = [ ...stateSpaceView, plane ];
|
|
5121
5124
|
dispatchSpaceSetView(updatedView);
|
|
5125
|
+
treeUpdate(updatedView);
|
|
5122
5126
|
}
|
|
5123
5127
|
});
|
|
5124
5128
|
const viewSetPlanesIndex = pubsub.subscribe({
|
|
@@ -5126,6 +5130,7 @@ const PluridView = properties => {
|
|
|
5126
5130
|
callback: data => {
|
|
5127
5131
|
const {view: view} = data;
|
|
5128
5132
|
dispatchSpaceSetView([ ...view ]);
|
|
5133
|
+
treeUpdate(view);
|
|
5129
5134
|
}
|
|
5130
5135
|
});
|
|
5131
5136
|
const viewRemovePlaneIndex = pubsub.subscribe({
|
|
@@ -5139,6 +5144,7 @@ const PluridView = properties => {
|
|
|
5139
5144
|
return true;
|
|
5140
5145
|
}));
|
|
5141
5146
|
dispatchSpaceSetView(updatedView);
|
|
5147
|
+
treeUpdate(updatedView);
|
|
5142
5148
|
}
|
|
5143
5149
|
});
|
|
5144
5150
|
return () => {
|
|
@@ -5407,6 +5413,9 @@ const PluridView = properties => {
|
|
|
5407
5413
|
handlePubSubPublish(pubsub);
|
|
5408
5414
|
}
|
|
5409
5415
|
}), [ pluridPubSub.length, stateConfiguration, stateTransform ]);
|
|
5416
|
+
useEffect((() => {
|
|
5417
|
+
treeUpdateCallback();
|
|
5418
|
+
}), []);
|
|
5410
5419
|
const pluridContext = {
|
|
5411
5420
|
planesRegistrar: planesRegistrar,
|
|
5412
5421
|
planeContext: planeContext,
|
|
@@ -5926,7 +5935,10 @@ const computePluridRoute = (matchedRoute, planesRegistrar, isoMatcher, directPla
|
|
|
5926
5935
|
}
|
|
5927
5936
|
return () => () => React.createElement(React.Fragment, null);
|
|
5928
5937
|
}
|
|
5929
|
-
const {exterior: exterior, view: view, planes: planes, spaces: spaces, defaultConfiguration: defaultConfiguration, slotted: slotted} = matchedRoute.data;
|
|
5938
|
+
const {exterior: exterior, view: view, planes: planes, spaces: spaces, defaultConfiguration: defaultConfiguration, slotted: slotted, resolver: resolver} = matchedRoute.data;
|
|
5939
|
+
if (resolver) {
|
|
5940
|
+
resolver(undefined);
|
|
5941
|
+
}
|
|
5930
5942
|
const pluridRouteProperty = {
|
|
5931
5943
|
value: matchedRoute.match.value,
|
|
5932
5944
|
parameters: matchedRoute.match.parameters,
|
|
@@ -6308,7 +6320,7 @@ const PluridLink = properties => {
|
|
|
6308
6320
|
const [showLink, setShowLink] = useState(false);
|
|
6309
6321
|
const [planeID, setPlaneID] = useState("");
|
|
6310
6322
|
const [pluridPlaneID, setPluridPlaneID] = useState("");
|
|
6311
|
-
const [parentPlaneID, setParentPlaneID] = useState(
|
|
6323
|
+
const [parentPlaneID, setParentPlaneID] = useState(getPluridPlaneIDByData$1(linkElement.current));
|
|
6312
6324
|
const [linkCoordinates, setLinkCoordinates] = useState(defaultLinkCoordinates);
|
|
6313
6325
|
const getPluridLinkCoordinates = () => {
|
|
6314
6326
|
const link = linkElement.current;
|