@gravity-ui/page-constructor 3.13.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.
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ConstructorItem as ConstructorItemType } from '../../../../models';
3
- interface ConstructorBlocksProps {
3
+ export interface ConstructorBlocksProps {
4
4
  items: ConstructorItemType[];
5
5
  }
6
6
  export declare const ConstructorBlocks: React.FC<ConstructorBlocksProps>;
7
- export {};
@@ -0,0 +1,2 @@
1
+ export type { ConstructorBlocksProps } from './ConstructorBlocks';
2
+ export { ConstructorBlocks } from './ConstructorBlocks';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConstructorBlocks = void 0;
4
+ var ConstructorBlocks_1 = require("./ConstructorBlocks");
5
+ Object.defineProperty(exports, "ConstructorBlocks", { enumerable: true, get: function () { return ConstructorBlocks_1.ConstructorBlocks; } });
@@ -2,3 +2,4 @@ export type { PageConstructorProps } from './PageConstructor';
2
2
  export { PageConstructor } from './PageConstructor';
3
3
  export type { PageConstructorProviderProps } from './Provider';
4
4
  export { PageConstructorProvider } from './Provider';
5
+ export * from './components';
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PageConstructorProvider = exports.PageConstructor = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  var PageConstructor_1 = require("./PageConstructor");
5
6
  Object.defineProperty(exports, "PageConstructor", { enumerable: true, get: function () { return PageConstructor_1.PageConstructor; } });
6
7
  var Provider_1 = require("./Provider");
7
8
  Object.defineProperty(exports, "PageConstructorProvider", { enumerable: true, get: function () { return Provider_1.PageConstructorProvider; } });
9
+ tslib_1.__exportStar(require("./components"), exports);
@@ -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,
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ConstructorItem as ConstructorItemType } from '../../../../models';
3
- interface ConstructorBlocksProps {
3
+ export interface ConstructorBlocksProps {
4
4
  items: ConstructorItemType[];
5
5
  }
6
6
  export declare const ConstructorBlocks: React.FC<ConstructorBlocksProps>;
7
- export {};
@@ -0,0 +1,2 @@
1
+ export type { ConstructorBlocksProps } from './ConstructorBlocks';
2
+ export { ConstructorBlocks } from './ConstructorBlocks';
@@ -0,0 +1 @@
1
+ export { ConstructorBlocks } from './ConstructorBlocks';
@@ -2,3 +2,4 @@ export type { PageConstructorProps } from './PageConstructor';
2
2
  export { PageConstructor } from './PageConstructor';
3
3
  export type { PageConstructorProviderProps } from './Provider';
4
4
  export { PageConstructorProvider } from './Provider';
5
+ export * from './components';
@@ -1,2 +1,3 @@
1
1
  export { PageConstructor } from './PageConstructor';
2
2
  export { PageConstructorProvider } from './Provider';
3
+ export * from './components';
@@ -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.13.0",
3
+ "version": "3.15.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {