@plurid/plurid-react 0.0.0-21 → 0.0.0-22
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/containers/RouterStatic/index.d.ts +1 -1
- package/distribution/distribution/containers/RouterStatic/index.d.ts +1 -1
- package/distribution/distribution/services/logic/router/index.d.ts +3 -3
- package/distribution/index.es.js +23 -19
- package/distribution/index.es.js.map +1 -1
- package/distribution/index.js +22 -18
- package/distribution/index.js.map +1 -1
- package/distribution/index.min.js +2 -2
- package/distribution/index.min.js.map +1 -1
- package/distribution/services/logic/router/index.d.ts +3 -3
- package/package.json +17 -17
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, 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;
|
|
5031
|
+
const {planesRegistrar: planesRegistrar, customPlane: customPlane, planeContext: planeContext, planeContextValue: planeContextValue, pubsub: pubsub, planeNotFound: planeNotFound, planeRenderError: planeRenderError, matchedRoute: matchedRoute, hostname: hostname, 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 => {
|
|
@@ -5050,7 +5050,7 @@ const PluridView = properties => {
|
|
|
5050
5050
|
planes: planes,
|
|
5051
5051
|
configuration: configuration,
|
|
5052
5052
|
view: view
|
|
5053
|
-
});
|
|
5053
|
+
}, hostname);
|
|
5054
5054
|
const computedTree = spaceTree.compute();
|
|
5055
5055
|
for (const statePlane of stateTree) {
|
|
5056
5056
|
for (const [index, computedPlane] of computedTree.entries()) {
|
|
@@ -5789,13 +5789,13 @@ const gatherPluridPlanes = (routes, planes) => {
|
|
|
5789
5789
|
return pluridPlanes;
|
|
5790
5790
|
};
|
|
5791
5791
|
|
|
5792
|
-
const renderMultispace = matchedRoute => {
|
|
5792
|
+
const renderMultispace = (matchedRoute, hostname = "origin") => {
|
|
5793
5793
|
var _a, _b, _c, _d, _e, _f;
|
|
5794
5794
|
if (matchedRoute.kind !== "Route") {
|
|
5795
5795
|
return () => () => React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
5796
5796
|
}
|
|
5797
5797
|
const protocol = "http";
|
|
5798
|
-
const host =
|
|
5798
|
+
const host = hostname;
|
|
5799
5799
|
const {match: match, data: path} = matchedRoute;
|
|
5800
5800
|
const {parameters: parameters, query: query} = match;
|
|
5801
5801
|
const pluridRouteProperty = {
|
|
@@ -5892,7 +5892,8 @@ const renderMultispace = matchedRoute => {
|
|
|
5892
5892
|
planes: planes,
|
|
5893
5893
|
view: view,
|
|
5894
5894
|
configuration: space.configuration,
|
|
5895
|
-
planesRegistrar: pluridPlanesRegistrar
|
|
5895
|
+
planesRegistrar: pluridPlanesRegistrar,
|
|
5896
|
+
hostname: hostname
|
|
5896
5897
|
});
|
|
5897
5898
|
spacesArray.push(App);
|
|
5898
5899
|
}
|
|
@@ -5928,7 +5929,8 @@ const renderMultispace = matchedRoute => {
|
|
|
5928
5929
|
id: path.value,
|
|
5929
5930
|
planes: pluridPlanes,
|
|
5930
5931
|
view: view,
|
|
5931
|
-
configuration: path.defaultConfiguration
|
|
5932
|
+
configuration: path.defaultConfiguration,
|
|
5933
|
+
hostname: hostname
|
|
5932
5934
|
});
|
|
5933
5935
|
spacesArray.push(App);
|
|
5934
5936
|
}
|
|
@@ -5958,7 +5960,7 @@ const renderMultispace = matchedRoute => {
|
|
|
5958
5960
|
};
|
|
5959
5961
|
};
|
|
5960
5962
|
|
|
5961
|
-
const computePluridRoute = (matchedRoute, planesRegistrar, isoMatcher, directPlane) => {
|
|
5963
|
+
const computePluridRoute = (matchedRoute, planesRegistrar, isoMatcher, directPlane, hostname = "origin") => {
|
|
5962
5964
|
if (directPlane || (matchedRoute === null || matchedRoute === void 0 ? void 0 : matchedRoute.kind) === "RoutePlane") {
|
|
5963
5965
|
const match = directPlane || matchedRoute;
|
|
5964
5966
|
if (!match) {
|
|
@@ -6007,7 +6009,8 @@ const computePluridRoute = (matchedRoute, planesRegistrar, isoMatcher, directPla
|
|
|
6007
6009
|
planesRegistrar: planesRegistrar,
|
|
6008
6010
|
configuration: defaultConfiguration,
|
|
6009
6011
|
pubsub: pubsub,
|
|
6010
|
-
matchedRoute: matchedRoute
|
|
6012
|
+
matchedRoute: matchedRoute,
|
|
6013
|
+
hostname: hostname
|
|
6011
6014
|
});
|
|
6012
6015
|
const PluridRoute = () => React__default["default"].createElement(React__default["default"].Fragment, null, PluridRouteExterior && React__default["default"].createElement(PluridRouteExterior, {
|
|
6013
6016
|
plurid: pluridRouteProperty,
|
|
@@ -6067,7 +6070,7 @@ const getDirectPlaneMatch = (matchedPath, routes, planes) => {
|
|
|
6067
6070
|
};
|
|
6068
6071
|
};
|
|
6069
6072
|
|
|
6070
|
-
const renderDirectPlane = (routePlane, planesRegistrar) => {
|
|
6073
|
+
const renderDirectPlane = (routePlane, planesRegistrar, hostname = "origin") => {
|
|
6071
6074
|
if (routePlane.match.query.flat) {
|
|
6072
6075
|
const flat = routePlane.match.query.flat.toLowerCase();
|
|
6073
6076
|
const renderFlat = flat === "true" || flat === "1";
|
|
@@ -6091,7 +6094,8 @@ const renderDirectPlane = (routePlane, planesRegistrar) => {
|
|
|
6091
6094
|
const PluridRoute = () => React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement(PluridApplication, {
|
|
6092
6095
|
view: [ routePlane.match.value ],
|
|
6093
6096
|
planesRegistrar: planesRegistrar,
|
|
6094
|
-
configuration: defaultConfiguration
|
|
6097
|
+
configuration: defaultConfiguration,
|
|
6098
|
+
hostname: hostname
|
|
6095
6099
|
}));
|
|
6096
6100
|
return PluridRoute;
|
|
6097
6101
|
};
|
|
@@ -6103,18 +6107,18 @@ const {Registrar: PluridPlanesRegistrar} = pluridEngine.planes;
|
|
|
6103
6107
|
const {IsoMatcher: PluridIsoMatcher$1} = pluridEngine.routing;
|
|
6104
6108
|
|
|
6105
6109
|
const PluridRouterBrowser = properties => {
|
|
6106
|
-
const {routes: routes, planes: planes, exterior: exterior, shell: shell, static: staticContext, view: cleanNavigationView, cleanNavigation: cleanNavigation, notFoundPath: notFoundPathProperty} = properties;
|
|
6110
|
+
const {routes: routes, planes: planes, exterior: exterior, shell: shell, hostname: hostname, static: staticContext, view: cleanNavigationView, cleanNavigation: cleanNavigation, notFoundPath: notFoundPathProperty} = properties;
|
|
6107
6111
|
const notFoundPath = notFoundPathProperty || "/not-found";
|
|
6108
6112
|
const pluridPlanes = gatherPluridPlanes(routes, planes);
|
|
6109
6113
|
const pluridPlanesRegistrar = React.useRef(new PluridPlanesRegistrar(pluridPlanes));
|
|
6110
6114
|
const pluridIsoMatcher = React.useRef(new PluridIsoMatcher$1({
|
|
6111
6115
|
routes: routes,
|
|
6112
6116
|
routePlanes: planes
|
|
6113
|
-
}));
|
|
6117
|
+
}, hostname));
|
|
6114
6118
|
const mounted = pluridFunctionsReact.useMounted();
|
|
6115
6119
|
const [matchedPath, setMatchedPath] = React.useState(computeInitialMatchedPath(staticContext));
|
|
6116
6120
|
const [matchedRoute, setMatchedRoute] = React.useState(pluridIsoMatcher.current.match(matchedPath, "route"));
|
|
6117
|
-
const [PluridRoute, setPluridRoute] = React.useState(computePluridRoute(matchedRoute, pluridPlanesRegistrar.current, pluridIsoMatcher.current, staticContext && staticContext.directPlane ? pluridIsoMatcher.current.match(staticContext.directPlane, "route") : undefined));
|
|
6121
|
+
const [PluridRoute, setPluridRoute] = React.useState(computePluridRoute(matchedRoute, pluridPlanesRegistrar.current, pluridIsoMatcher.current, staticContext && staticContext.directPlane ? pluridIsoMatcher.current.match(staticContext.directPlane, "route") : undefined, hostname));
|
|
6118
6122
|
const handleLocation = event => {
|
|
6119
6123
|
let matchedPath;
|
|
6120
6124
|
if (event && event.detail && event.detail.path && !matchedPath) {
|
|
@@ -6148,7 +6152,7 @@ const PluridRouterBrowser = properties => {
|
|
|
6148
6152
|
}
|
|
6149
6153
|
let matchedRoute = pluridIsoMatcher.current.match(matchedPath, "route");
|
|
6150
6154
|
if (matchedRoute && matchedRoute.kind === "RoutePlane") {
|
|
6151
|
-
const DirectPlane = renderDirectPlane(matchedRoute, pluridPlanesRegistrar.current);
|
|
6155
|
+
const DirectPlane = renderDirectPlane(matchedRoute, pluridPlanesRegistrar.current, hostname);
|
|
6152
6156
|
setMatchedRoute(matchedRoute);
|
|
6153
6157
|
setPluridRoute(DirectPlane);
|
|
6154
6158
|
return;
|
|
@@ -6157,7 +6161,7 @@ const PluridRouterBrowser = properties => {
|
|
|
6157
6161
|
matchedRoute = pluridIsoMatcher.current.match(notFoundPath, "route");
|
|
6158
6162
|
}
|
|
6159
6163
|
setMatchedRoute(matchedRoute);
|
|
6160
|
-
setPluridRoute(computePluridRoute(matchedRoute, pluridPlanesRegistrar.current, pluridIsoMatcher.current));
|
|
6164
|
+
setPluridRoute(computePluridRoute(matchedRoute, pluridPlanesRegistrar.current, pluridIsoMatcher.current, hostname));
|
|
6161
6165
|
}), [ mounted, matchedPath ]);
|
|
6162
6166
|
React.useEffect((() => {
|
|
6163
6167
|
if (!matchedRoute) {
|
|
@@ -6197,9 +6201,9 @@ const PluridRouterBrowser = properties => {
|
|
|
6197
6201
|
};
|
|
6198
6202
|
|
|
6199
6203
|
const PluridRouterStatic = properties => {
|
|
6200
|
-
const {path: path, directPlane: directPlane, routes: routes, planes: planes, exterior: exterior, shell: shell, protocol: protocolProperty,
|
|
6204
|
+
const {path: path, directPlane: directPlane, routes: routes, planes: planes, exterior: exterior, shell: shell, protocol: protocolProperty, hostname: hostnameProperty, gateway: gateway, gatewayQuery: gatewayQueryProperty, gatewayEndpoint: gatewayEndpointProperty} = properties;
|
|
6201
6205
|
const protocol = protocolProperty || "http";
|
|
6202
|
-
const
|
|
6206
|
+
const hostname = hostnameProperty || "localhost:63000";
|
|
6203
6207
|
return React__default["default"].createElement(PluridRouterBrowser, {
|
|
6204
6208
|
routes: routes,
|
|
6205
6209
|
planes: planes,
|
|
@@ -6210,7 +6214,7 @@ const PluridRouterStatic = properties => {
|
|
|
6210
6214
|
directPlane: directPlane
|
|
6211
6215
|
},
|
|
6212
6216
|
protocol: protocol,
|
|
6213
|
-
|
|
6217
|
+
hostname: hostname
|
|
6214
6218
|
});
|
|
6215
6219
|
};
|
|
6216
6220
|
|