@plurid/plurid-react 0.0.0-28 → 0.0.0-30

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.
@@ -2100,13 +2100,16 @@ const StyledPluridRoots = styled__default["default"].div`
2100
2100
  `;
2101
2101
 
2102
2102
  const PluridRoots = properties => {
2103
- const {spaceTransformMatrix: spaceTransformMatrix, spaceAnimatedTransform: spaceAnimatedTransform, spaceTransformTime: spaceTransformTime, stateTree: stateTree} = properties;
2103
+ const {spaceTransformMatrix: spaceTransformMatrix, spaceAnimatedTransform: spaceAnimatedTransform, spaceTransformTime: spaceTransformTime, stateTree: stateTree, stateResolvedLayout: stateResolvedLayout} = properties;
2104
+ const width = "100%";
2105
+ const height = stateResolvedLayout ? window.innerHeight + "px" : 0;
2106
+ const transition = spaceAnimatedTransform ? `transform ${spaceTransformTime}ms ease-in-out` : "initial";
2104
2107
  return React__default["default"].createElement(StyledPluridRoots, {
2105
2108
  style: {
2106
- width: "100%",
2107
- height: typeof window !== "undefined" ? window.innerHeight + "px" : "821px",
2108
- transform: spaceTransformMatrix,
2109
- transition: spaceAnimatedTransform ? `transform ${spaceTransformTime}ms ease-in-out` : "initial"
2109
+ width: width,
2110
+ height: height,
2111
+ transition: transition,
2112
+ transform: spaceTransformMatrix
2110
2113
  },
2111
2114
  "data-plurid-entity": pluridData.PLURID_ENTITY_ROOTS
2112
2115
  }, stateTree.map((plane => React__default["default"].createElement(ConnectedPluridRoot, {
@@ -2120,7 +2123,8 @@ const mapStateToProperties$g = state => ({
2120
2123
  spaceTransformMatrix: selectors.space.getTransformMatrix(state),
2121
2124
  spaceAnimatedTransform: selectors.space.getAnimatedTransform(state),
2122
2125
  spaceTransformTime: selectors.space.getTransformTime(state),
2123
- stateTree: selectors.space.getTree(state)
2126
+ stateTree: selectors.space.getTree(state),
2127
+ stateResolvedLayout: selectors.space.getResolvedLayout(state)
2124
2128
  });
2125
2129
 
2126
2130
  const mapDispatchToProperties$g = dispatch => ({});
@@ -5452,9 +5456,37 @@ const PluridScrollTop = styled__default["default"].div`
5452
5456
  width: 0;
5453
5457
  `;
5454
5458
 
5459
+ const StyledFadeIn = styled__default["default"].div`
5460
+ position: absolute;
5461
+ top: 0;
5462
+ left: 0;
5463
+ right: 0;
5464
+ bottom: 0;
5465
+ background-color: black;
5466
+ pointer-events: none;
5467
+ z-index: 999999;
5468
+ `;
5469
+
5470
+ const FadeIn = properties => {
5471
+ const {time: time} = properties;
5472
+ const [fadedIn, setFadedIn] = React.useState(false);
5473
+ React.useEffect((() => {
5474
+ if (time > 0) {
5475
+ setTimeout((() => {
5476
+ setFadedIn(true);
5477
+ }), time);
5478
+ }
5479
+ }), []);
5480
+ if (fadedIn || time === 0) {
5481
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
5482
+ }
5483
+ return React__default["default"].createElement(StyledFadeIn, null);
5484
+ };
5485
+
5455
5486
  const PluridRouterBrowser = properties => {
5456
- const {routes: routes, planes: planes, exterior: exterior, shell: shell, hostname: hostname, scrollToTop: scrollToTop, static: staticContext, view: cleanNavigationView, cleanNavigation: cleanNavigation, notFoundPath: notFoundPathProperty} = properties;
5487
+ const {routes: routes, planes: planes, exterior: exterior, shell: shell, hostname: hostname, scrollToTop: scrollToTop, fadeIn: fadeInProperty, static: staticContext, view: cleanNavigationView, cleanNavigation: cleanNavigation, notFoundPath: notFoundPathProperty} = properties;
5457
5488
  const notFoundPath = notFoundPathProperty || "/not-found";
5489
+ const fadeIn = fadeInProperty !== null && fadeInProperty !== void 0 ? fadeInProperty : 10;
5458
5490
  const pluridPlanes = gatherPluridPlanes(routes, planes);
5459
5491
  const topContainer = React.useRef(null);
5460
5492
  const pluridPlanesRegistrar = React.useRef(new PluridPlanesRegistrar(pluridPlanes, hostname));
@@ -5550,7 +5582,9 @@ const PluridRouterBrowser = properties => {
5550
5582
  PluridRouterShell.displayName = "PluridRouterShell";
5551
5583
  }
5552
5584
  }
5553
- return React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement(PluridScrollTop, {
5585
+ return React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement(FadeIn, {
5586
+ time: fadeIn
5587
+ }), React__default["default"].createElement(PluridScrollTop, {
5554
5588
  ref: topContainer
5555
5589
  }), PluridRouterExterior && React__default["default"].createElement(PluridRouterExterior, {
5556
5590
  matchedRoute: matchedRoute
@@ -5560,10 +5594,10 @@ const PluridRouterBrowser = properties => {
5560
5594
  };
5561
5595
 
5562
5596
  const PluridRouterStatic = properties => {
5563
- const {path: path, directPlane: directPlane, routes: routes, planes: planes, exterior: exterior, shell: shell, protocol: protocolProperty, hostname: hostnameProperty, gateway: gateway, gatewayQuery: gatewayQueryProperty, gatewayEndpoint: gatewayEndpointProperty} = properties;
5597
+ const {path: path, directPlane: directPlane, routes: routes, planes: planes, exterior: exterior, shell: shell, protocol: protocolProperty, hostname: hostnameProperty, gateway: gateway, gatewayQuery: gatewayQueryProperty, gatewayEndpoint: gatewayEndpointProperty, routerProperties: routerProperties} = properties;
5564
5598
  const protocol = protocolProperty || "http";
5565
5599
  const hostname = hostnameProperty || "origin";
5566
- return React__default["default"].createElement(PluridRouterBrowser, {
5600
+ return React__default["default"].createElement(PluridRouterBrowser, Object.assign({
5567
5601
  routes: routes,
5568
5602
  planes: planes,
5569
5603
  exterior: exterior,
@@ -5574,7 +5608,7 @@ const PluridRouterStatic = properties => {
5574
5608
  },
5575
5609
  protocol: protocol,
5576
5610
  hostname: hostname
5577
- });
5611
+ }, routerProperties));
5578
5612
  };
5579
5613
 
5580
5614
  class PluridProvider extends React.Component {