@gravity-ui/page-constructor 3.14.0 → 3.15.0

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.
@@ -4,13 +4,16 @@ const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importDefault(require("react"));
5
5
  const uikit_1 = require("@gravity-ui/uikit");
6
6
  const Foldable_1 = tslib_1.__importDefault(require("../../../components/Foldable/Foldable"));
7
+ const hooks_1 = require("../../../hooks");
7
8
  const utils_1 = require("../../../utils");
8
9
  const models_1 = require("../../models");
9
10
  const NavigationList_1 = require("../NavigationList/NavigationList");
10
11
  const b = (0, utils_1.block)('mobile-navigation');
11
12
  const MobileNavigation = (_a) => {
12
13
  var { isOpened, topItems, bottomItems } = _a, props = tslib_1.__rest(_a, ["isOpened", "topItems", "bottomItems"]);
13
- if (typeof window === 'undefined') {
14
+ const [isMounted, setIsMounted] = react_1.default.useState(false);
15
+ (0, hooks_1.useMount)(() => setIsMounted(true));
16
+ if (!isMounted) {
14
17
  return null;
15
18
  }
16
19
  return (react_1.default.createElement(uikit_1.Portal, null,
@@ -2,6 +2,7 @@ import { __rest } from "tslib";
2
2
  import React from 'react';
3
3
  import { Portal } from '@gravity-ui/uikit';
4
4
  import Foldable from '../../../components/Foldable/Foldable';
5
+ import { useMount } from '../../../hooks';
5
6
  import { block } from '../../../utils';
6
7
  import { ItemColumnName, NavigationLayout } from '../../models';
7
8
  import { NavigationList } from '../NavigationList/NavigationList';
@@ -9,7 +10,9 @@ import './MobileNavigation.css';
9
10
  const b = block('mobile-navigation');
10
11
  const MobileNavigation = (_a) => {
11
12
  var { isOpened, topItems, bottomItems } = _a, props = __rest(_a, ["isOpened", "topItems", "bottomItems"]);
12
- if (typeof window === 'undefined') {
13
+ const [isMounted, setIsMounted] = React.useState(false);
14
+ useMount(() => setIsMounted(true));
15
+ if (!isMounted) {
13
16
  return null;
14
17
  }
15
18
  return (React.createElement(Portal, null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "3.14.0",
3
+ "version": "3.15.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {