@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.
@@ -9,7 +9,7 @@ export interface PluridRouterStaticOwnProperties {
9
9
  routes: PluridRoute<PluridReactComponent>[];
10
10
  planes: PluridRoutePlane<PluridReactComponent>[];
11
11
  protocol?: string;
12
- host?: string;
12
+ hostname?: string;
13
13
  gateway?: boolean;
14
14
  gatewayQuery?: string;
15
15
  gatewayEndpoint?: string;
@@ -9,7 +9,7 @@ export interface PluridRouterStaticOwnProperties {
9
9
  routes: PluridRoute<PluridReactComponent>[];
10
10
  planes: PluridRoutePlane<PluridReactComponent>[];
11
11
  protocol?: string;
12
- host?: string;
12
+ hostname?: string;
13
13
  gateway?: boolean;
14
14
  gatewayQuery?: string;
15
15
  gatewayEndpoint?: string;
@@ -40,12 +40,12 @@ export declare const collectApplicationsFromPath: (isoMatch: PluridRouteMatch, p
40
40
  view: string[];
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
- 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) => any;
43
+ export declare const renderMultispace: (matchedRoute: PluridRouteMatch, hostname?: string) => (() => () => JSX.Element) | (() => React.FC<any>);
44
+ export declare const computePluridRoute: (matchedRoute: PluridRouteMatch | undefined, planesRegistrar: planes.Registrar<PluridReactComponent>, isoMatcher: routing.IsoMatcher<PluridReactComponent>, directPlane?: PluridRouteMatch, hostname?: string) => any;
45
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;
49
49
  matchPath: string | undefined;
50
50
  };
51
- export declare const renderDirectPlane: (routePlane: PluridRouteMatch, planesRegistrar: planes.Registrar<PluridReactComponent>) => () => any;
51
+ export declare const renderDirectPlane: (routePlane: PluridRouteMatch, planesRegistrar: planes.Registrar<PluridReactComponent>, hostname?: string) => () => any;
@@ -1,4 +1,4 @@
1
- import { defaultConfiguration, TRANSFORM_MODES, LAYOUT_TYPES, TRANSLATION_STEP, ROTATION_STEP, SCALE_STEP, SCALE_UPPER_LIMIT, SCALE_LOWER_LIMIT, PLURID_ENTITY_PLANE_BRIDGE, PLURID_ENTITY_PLANE_CONTROLS, PLURID_ENTITY_PLANE_CONTENT, PLURID_ENTITY_PLANE, PLURID_ENTITY_ROOT, PLURID_ENTITY_ROOTS, PLURID_ENTITY_SPACE, SIZES, PLURID_ENTITY_TRANSFORM_ORIGIN, internationalization, TRANSFORM_TOUCHES, layoutNames, defaultShortcuts, shortcutsNames, TOOLBAR_DRAWERS, PLURID_ENTITY_TOOLBAR, PLURID_ENTITY_VIEWCUBE, PLURID_PUBSUB_TOPIC, PLURID_ENTITY_VIEW, PLURID_ROUTE_DEFAULT_PATH_VALUE, PLURID_ROUTE_DEFAULT_PATH, PLURID_ROUTE_DEFAULT_SPACE_VALUE, PLURID_ROUTE_DEFAULT_SPACE, PLURID_ROUTE_DEFAULT_UNIVERSE_VALUE, PLURID_ROUTE_DEFAULT_UNIVERSE, PLURID_ROUTE_DEFAULT_CLUSTER_VALUE, PLURID_ROUTE_DEFAULT_CLUSTER, PLURID_ROUTE_SEPARATOR, PLURID_ENTITY_MULTISPACE, PLURID_ROUTER_LOCATION_CHANGED, PLURID_ROUTER_STORAGE, PLURID_ROUTER_LOCATION_STORED, PLURID_ENTITY_LINK, PLURID_DEFAULT_CONFIGURATION_LINK_PREVIEW_FADE_IN, PLURID_DEFAULT_CONFIGURATION_LINK_PREVIEW_FADE_OUT, PLURID_DEFAULT_CONFIGURATION_LINK_SUFFIX, PLURID_ENTITY_APPLICATION_CONFIGURATOR, PLURID_ENTITY_PLANE_CONFIGURATOR } from "@plurid/plurid-data";
1
+ import { defaultConfiguration, TRANSFORM_MODES, LAYOUT_TYPES, TRANSLATION_STEP, ROTATION_STEP, SCALE_STEP, SCALE_UPPER_LIMIT, SCALE_LOWER_LIMIT, PLURID_ENTITY_PLANE_BRIDGE, PLURID_ENTITY_PLANE_CONTROLS, PLURID_ENTITY_PLANE_CONTENT, PLURID_ENTITY_PLANE, PLURID_ENTITY_ROOT, PLURID_ENTITY_ROOTS, PLURID_ENTITY_SPACE, SIZES, PLURID_ENTITY_TRANSFORM_ORIGIN, internationalization, TRANSFORM_TOUCHES, layoutNames, defaultShortcuts, shortcutsNames, TOOLBAR_DRAWERS, PLURID_ENTITY_TOOLBAR, PLURID_ENTITY_VIEWCUBE, PLURID_ENTITY_VIEW, PLURID_PUBSUB_TOPIC, PLURID_ROUTE_DEFAULT_PATH_VALUE, PLURID_ROUTE_DEFAULT_PATH, PLURID_ROUTE_DEFAULT_SPACE_VALUE, PLURID_ROUTE_DEFAULT_SPACE, PLURID_ROUTE_DEFAULT_UNIVERSE_VALUE, PLURID_ROUTE_DEFAULT_UNIVERSE, PLURID_ROUTE_DEFAULT_CLUSTER_VALUE, PLURID_ROUTE_DEFAULT_CLUSTER, PLURID_ROUTE_SEPARATOR, PLURID_ENTITY_MULTISPACE, PLURID_ROUTER_LOCATION_CHANGED, PLURID_ROUTER_STORAGE, PLURID_ROUTER_LOCATION_STORED, PLURID_ENTITY_LINK, PLURID_DEFAULT_CONFIGURATION_LINK_PREVIEW_FADE_IN, PLURID_DEFAULT_CONFIGURATION_LINK_PREVIEW_FADE_OUT, PLURID_DEFAULT_CONFIGURATION_LINK_SUFFIX, PLURID_ENTITY_APPLICATION_CONFIGURATOR, PLURID_ENTITY_PLANE_CONFIGURATOR } from "@plurid/plurid-data";
2
2
 
3
3
  export { PLURID_PUBSUB_TOPIC, PLURID_ROUTER_LOCATION_CHANGED, PLURID_ROUTER_LOCATION_STORED, SIZES, LAYOUT_TYPES as SPACE_LAYOUT, TRANSFORM_MODES, TRANSFORM_TOUCHES } from "@plurid/plurid-data";
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, 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;
4991
+ 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;
4992
4992
  const viewElement = useRef(null);
4993
4993
  const [pluridPubSub, setPluridPubSub] = useState(pubsub ? [ pubsub ] : []);
4994
4994
  const shortcutsCallback = useCallback((event => {
@@ -5010,7 +5010,7 @@ const PluridView = properties => {
5010
5010
  planes: planes,
5011
5011
  configuration: configuration,
5012
5012
  view: view
5013
- });
5013
+ }, hostname);
5014
5014
  const computedTree = spaceTree.compute();
5015
5015
  for (const statePlane of stateTree) {
5016
5016
  for (const [index, computedPlane] of computedTree.entries()) {
@@ -5749,13 +5749,13 @@ const gatherPluridPlanes = (routes, planes) => {
5749
5749
  return pluridPlanes;
5750
5750
  };
5751
5751
 
5752
- const renderMultispace = matchedRoute => {
5752
+ const renderMultispace = (matchedRoute, hostname = "origin") => {
5753
5753
  var _a, _b, _c, _d, _e, _f;
5754
5754
  if (matchedRoute.kind !== "Route") {
5755
5755
  return () => () => React.createElement(React.Fragment, null);
5756
5756
  }
5757
5757
  const protocol = "http";
5758
- const host = "localhost:63000";
5758
+ const host = hostname;
5759
5759
  const {match: match, data: path} = matchedRoute;
5760
5760
  const {parameters: parameters, query: query} = match;
5761
5761
  const pluridRouteProperty = {
@@ -5852,7 +5852,8 @@ const renderMultispace = matchedRoute => {
5852
5852
  planes: planes,
5853
5853
  view: view,
5854
5854
  configuration: space.configuration,
5855
- planesRegistrar: pluridPlanesRegistrar
5855
+ planesRegistrar: pluridPlanesRegistrar,
5856
+ hostname: hostname
5856
5857
  });
5857
5858
  spacesArray.push(App);
5858
5859
  }
@@ -5888,7 +5889,8 @@ const renderMultispace = matchedRoute => {
5888
5889
  id: path.value,
5889
5890
  planes: pluridPlanes,
5890
5891
  view: view,
5891
- configuration: path.defaultConfiguration
5892
+ configuration: path.defaultConfiguration,
5893
+ hostname: hostname
5892
5894
  });
5893
5895
  spacesArray.push(App);
5894
5896
  }
@@ -5918,7 +5920,7 @@ const renderMultispace = matchedRoute => {
5918
5920
  };
5919
5921
  };
5920
5922
 
5921
- const computePluridRoute = (matchedRoute, planesRegistrar, isoMatcher, directPlane) => {
5923
+ const computePluridRoute = (matchedRoute, planesRegistrar, isoMatcher, directPlane, hostname = "origin") => {
5922
5924
  if (directPlane || (matchedRoute === null || matchedRoute === void 0 ? void 0 : matchedRoute.kind) === "RoutePlane") {
5923
5925
  const match = directPlane || matchedRoute;
5924
5926
  if (!match) {
@@ -5967,7 +5969,8 @@ const computePluridRoute = (matchedRoute, planesRegistrar, isoMatcher, directPla
5967
5969
  planesRegistrar: planesRegistrar,
5968
5970
  configuration: defaultConfiguration,
5969
5971
  pubsub: pubsub,
5970
- matchedRoute: matchedRoute
5972
+ matchedRoute: matchedRoute,
5973
+ hostname: hostname
5971
5974
  });
5972
5975
  const PluridRoute = () => React.createElement(React.Fragment, null, PluridRouteExterior && React.createElement(PluridRouteExterior, {
5973
5976
  plurid: pluridRouteProperty,
@@ -6027,7 +6030,7 @@ const getDirectPlaneMatch = (matchedPath, routes, planes) => {
6027
6030
  };
6028
6031
  };
6029
6032
 
6030
- const renderDirectPlane = (routePlane, planesRegistrar) => {
6033
+ const renderDirectPlane = (routePlane, planesRegistrar, hostname = "origin") => {
6031
6034
  if (routePlane.match.query.flat) {
6032
6035
  const flat = routePlane.match.query.flat.toLowerCase();
6033
6036
  const renderFlat = flat === "true" || flat === "1";
@@ -6051,7 +6054,8 @@ const renderDirectPlane = (routePlane, planesRegistrar) => {
6051
6054
  const PluridRoute = () => React.createElement(React.Fragment, null, React.createElement(PluridApplication, {
6052
6055
  view: [ routePlane.match.value ],
6053
6056
  planesRegistrar: planesRegistrar,
6054
- configuration: defaultConfiguration
6057
+ configuration: defaultConfiguration,
6058
+ hostname: hostname
6055
6059
  }));
6056
6060
  return PluridRoute;
6057
6061
  };
@@ -6063,18 +6067,18 @@ const {Registrar: PluridPlanesRegistrar} = planes;
6063
6067
  const {IsoMatcher: PluridIsoMatcher$1} = routing;
6064
6068
 
6065
6069
  const PluridRouterBrowser = properties => {
6066
- const {routes: routes, planes: planes, exterior: exterior, shell: shell, static: staticContext, view: cleanNavigationView, cleanNavigation: cleanNavigation, notFoundPath: notFoundPathProperty} = properties;
6070
+ const {routes: routes, planes: planes, exterior: exterior, shell: shell, hostname: hostname, static: staticContext, view: cleanNavigationView, cleanNavigation: cleanNavigation, notFoundPath: notFoundPathProperty} = properties;
6067
6071
  const notFoundPath = notFoundPathProperty || "/not-found";
6068
6072
  const pluridPlanes = gatherPluridPlanes(routes, planes);
6069
6073
  const pluridPlanesRegistrar = useRef(new PluridPlanesRegistrar(pluridPlanes));
6070
6074
  const pluridIsoMatcher = useRef(new PluridIsoMatcher$1({
6071
6075
  routes: routes,
6072
6076
  routePlanes: planes
6073
- }));
6077
+ }, hostname));
6074
6078
  const mounted = useMounted();
6075
6079
  const [matchedPath, setMatchedPath] = useState(computeInitialMatchedPath(staticContext));
6076
6080
  const [matchedRoute, setMatchedRoute] = useState(pluridIsoMatcher.current.match(matchedPath, "route"));
6077
- const [PluridRoute, setPluridRoute] = useState(computePluridRoute(matchedRoute, pluridPlanesRegistrar.current, pluridIsoMatcher.current, staticContext && staticContext.directPlane ? pluridIsoMatcher.current.match(staticContext.directPlane, "route") : undefined));
6081
+ const [PluridRoute, setPluridRoute] = useState(computePluridRoute(matchedRoute, pluridPlanesRegistrar.current, pluridIsoMatcher.current, staticContext && staticContext.directPlane ? pluridIsoMatcher.current.match(staticContext.directPlane, "route") : undefined, hostname));
6078
6082
  const handleLocation = event => {
6079
6083
  let matchedPath;
6080
6084
  if (event && event.detail && event.detail.path && !matchedPath) {
@@ -6108,7 +6112,7 @@ const PluridRouterBrowser = properties => {
6108
6112
  }
6109
6113
  let matchedRoute = pluridIsoMatcher.current.match(matchedPath, "route");
6110
6114
  if (matchedRoute && matchedRoute.kind === "RoutePlane") {
6111
- const DirectPlane = renderDirectPlane(matchedRoute, pluridPlanesRegistrar.current);
6115
+ const DirectPlane = renderDirectPlane(matchedRoute, pluridPlanesRegistrar.current, hostname);
6112
6116
  setMatchedRoute(matchedRoute);
6113
6117
  setPluridRoute(DirectPlane);
6114
6118
  return;
@@ -6117,7 +6121,7 @@ const PluridRouterBrowser = properties => {
6117
6121
  matchedRoute = pluridIsoMatcher.current.match(notFoundPath, "route");
6118
6122
  }
6119
6123
  setMatchedRoute(matchedRoute);
6120
- setPluridRoute(computePluridRoute(matchedRoute, pluridPlanesRegistrar.current, pluridIsoMatcher.current));
6124
+ setPluridRoute(computePluridRoute(matchedRoute, pluridPlanesRegistrar.current, pluridIsoMatcher.current, hostname));
6121
6125
  }), [ mounted, matchedPath ]);
6122
6126
  useEffect((() => {
6123
6127
  if (!matchedRoute) {
@@ -6157,9 +6161,9 @@ const PluridRouterBrowser = properties => {
6157
6161
  };
6158
6162
 
6159
6163
  const PluridRouterStatic = properties => {
6160
- const {path: path, directPlane: directPlane, routes: routes, planes: planes, exterior: exterior, shell: shell, protocol: protocolProperty, host: hostProperty, gateway: gateway, gatewayQuery: gatewayQueryProperty, gatewayEndpoint: gatewayEndpointProperty} = properties;
6164
+ const {path: path, directPlane: directPlane, routes: routes, planes: planes, exterior: exterior, shell: shell, protocol: protocolProperty, hostname: hostnameProperty, gateway: gateway, gatewayQuery: gatewayQueryProperty, gatewayEndpoint: gatewayEndpointProperty} = properties;
6161
6165
  const protocol = protocolProperty || "http";
6162
- const host = hostProperty || "localhost:63000";
6166
+ const hostname = hostnameProperty || "localhost:63000";
6163
6167
  return React.createElement(PluridRouterBrowser, {
6164
6168
  routes: routes,
6165
6169
  planes: planes,
@@ -6170,7 +6174,7 @@ const PluridRouterStatic = properties => {
6170
6174
  directPlane: directPlane
6171
6175
  },
6172
6176
  protocol: protocol,
6173
- host: host
6177
+ hostname: hostname
6174
6178
  });
6175
6179
  };
6176
6180