@gravity-ui/page-constructor 3.1.0 → 3.1.1

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/cjs/components/BlockBase/BlockBase.js +2 -2
  3. package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.d.ts +2 -2
  4. package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +2 -2
  5. package/build/cjs/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +5 -3
  6. package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +1 -1
  7. package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +4 -2
  8. package/build/cjs/customization/BlockDecoration.d.ts +1 -1
  9. package/build/cjs/customization/BlockDecoration.js +4 -8
  10. package/build/cjs/models/constructor-items/blocks.d.ts +1 -0
  11. package/build/cjs/models/customization.d.ts +1 -1
  12. package/build/cjs/utils/blocks.d.ts +0 -1
  13. package/build/cjs/utils/blocks.js +1 -3
  14. package/build/esm/components/BlockBase/BlockBase.js +2 -2
  15. package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.d.ts +2 -2
  16. package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +2 -2
  17. package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +5 -3
  18. package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +1 -1
  19. package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +4 -2
  20. package/build/esm/customization/BlockDecoration.d.ts +1 -1
  21. package/build/esm/customization/BlockDecoration.js +4 -8
  22. package/build/esm/models/constructor-items/blocks.d.ts +1 -0
  23. package/build/esm/models/customization.d.ts +1 -1
  24. package/build/esm/utils/blocks.d.ts +0 -1
  25. package/build/esm/utils/blocks.js +0 -1
  26. package/package.json +1 -1
  27. package/server/models/constructor-items/blocks.d.ts +1 -0
  28. package/server/models/customization.d.ts +1 -1
  29. package/server/utils/blocks.d.ts +0 -1
  30. package/server/utils/blocks.js +1 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.1.1](https://github.com/gravity-ui/page-constructor/compare/v3.1.0...v3.1.1) (2023-06-07)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * constructor items inner data structure ([#386](https://github.com/gravity-ui/page-constructor/issues/386)) ([f73ccde](https://github.com/gravity-ui/page-constructor/commit/f73ccde7369f38ec887ded7534f6907e4da8b4ac))
9
+
3
10
  ## [3.1.0](https://github.com/gravity-ui/page-constructor/compare/v3.0.0...v3.1.0) (2023-06-05)
4
11
 
5
12
 
@@ -8,9 +8,9 @@ const utils_1 = require("../../utils");
8
8
  const Anchor_1 = tslib_1.__importDefault(require("../Anchor/Anchor"));
9
9
  const b = (0, utils_1.block)('block-base');
10
10
  const BlockBase = (props) => {
11
- const { anchor, visible, children, className, resetPaddings, qa } = props;
11
+ const { anchor, visible, children, className, resetPaddings, qa, index = 0 } = props;
12
12
  return (react_1.default.createElement(grid_1.Col, { className: b({ ['reset-paddings']: resetPaddings }, className), visible: visible, reset: true, dataQa: qa },
13
- react_1.default.createElement(BlockDecoration_1.BlockDecoration, null,
13
+ react_1.default.createElement(BlockDecoration_1.BlockDecoration, { id: index },
14
14
  anchor && react_1.default.createElement(Anchor_1.default, { id: anchor.url, className: b('anchor') }),
15
15
  children)));
16
16
  };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { Block, WithChildren } from '../../../../models';
3
- interface ConstructorBlockProps {
2
+ import { Block, BlockBaseProps, WithChildren } from '../../../../models';
3
+ interface ConstructorBlockProps extends Pick<BlockBaseProps, 'index'> {
4
4
  data: Block;
5
5
  }
6
6
  export declare const ConstructorBlock: React.FC<WithChildren<ConstructorBlockProps>>;
@@ -6,8 +6,8 @@ const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const BlockBase_1 = tslib_1.__importDefault(require("../../../../components/BlockBase/BlockBase"));
7
7
  const utils_1 = require("../../../../utils");
8
8
  const b = (0, utils_1.block)('constructor-block');
9
- const ConstructorBlock = ({ data, children, }) => {
9
+ const ConstructorBlock = ({ index = 0, data, children, }) => {
10
10
  const { anchor, visible, type } = data;
11
- return (react_1.default.createElement(BlockBase_1.default, { className: b({ type }), anchor: anchor, visible: visible, resetPaddings: data.resetPaddings }, children));
11
+ return (react_1.default.createElement(BlockBase_1.default, { index: index, className: b({ type }), anchor: anchor, visible: visible, resetPaddings: data.resetPaddings }, children));
12
12
  };
13
13
  exports.ConstructorBlock = ConstructorBlock;
@@ -4,7 +4,6 @@ exports.ConstructorBlocks = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
6
  const lodash_1 = tslib_1.__importDefault(require("lodash"));
7
- const blockIdContext_1 = require("../../../../context/blockIdContext");
8
7
  const innerContext_1 = require("../../../../context/innerContext");
9
8
  const utils_1 = require("../../../../utils");
10
9
  const ConstructorBlock_1 = require("../ConstructorBlock/ConstructorBlock");
@@ -35,9 +34,12 @@ const ConstructorBlocks = ({ items }) => {
35
34
  if ('children' in item && item.children) {
36
35
  children = item.children.map(renderer.bind(null, blockId));
37
36
  }
38
- itemElement = (react_1.default.createElement(ConstructorItem_1.ConstructorItem, { data: item, blockKey: blockId }, children));
37
+ itemElement = (react_1.default.createElement(ConstructorItem_1.ConstructorItem, { data: item, key: blockId, blockKey: blockId }, children));
39
38
  }
40
- return (react_1.default.createElement(blockIdContext_1.BlockIdContext.Provider, { value: blockId, key: blockId }, blockTypes.includes(item.type) ? (react_1.default.createElement(ConstructorBlock_1.ConstructorBlock, { data: item }, itemElement)) : (itemElement)));
39
+ return blockTypes.includes(item.type) ? (
40
+ //TODO: replace ConstructorBlock (and delete it) with BlockBase when all
41
+ // components relying on constructor inner structure like Slider or blog-constructor will be refactored
42
+ react_1.default.createElement(ConstructorBlock_1.ConstructorBlock, { data: item, key: blockId, index: index }, itemElement)) : (itemElement);
41
43
  };
42
44
  return react_1.default.createElement(react_1.Fragment, null, items.map(renderer.bind(null, '')));
43
45
  };
@@ -3,5 +3,5 @@ export interface ConstructorItemProps {
3
3
  data: ConstructorItemType;
4
4
  blockKey: string;
5
5
  }
6
- export declare const ConstructorItem: ({ data, children }: WithChildren<ConstructorItemProps>) => JSX.Element;
6
+ export declare const ConstructorItem: ({ data, blockKey, children }: WithChildren<ConstructorItemProps>) => JSX.Element;
7
7
  export declare const ConstructorHeader: ({ data, blockKey, }: Pick<ConstructorItemProps, 'data' | 'blockKey'>) => JSX.Element;
@@ -3,13 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConstructorHeader = exports.ConstructorItem = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
+ const blockIdContext_1 = require("../../../../context/blockIdContext");
6
7
  const innerContext_1 = require("../../../../context/innerContext");
7
8
  const BlockDecoration_1 = require("../../../../customization/BlockDecoration");
8
- const ConstructorItem = ({ data, children }) => {
9
+ const ConstructorItem = ({ data, blockKey, children }) => {
9
10
  const { itemMap } = (0, react_1.useContext)(innerContext_1.InnerContext);
10
11
  const { type } = data, rest = tslib_1.__rest(data, ["type"]);
11
12
  const Component = itemMap[type];
12
- return react_1.default.createElement(Component, Object.assign({}, rest), children);
13
+ return (react_1.default.createElement(blockIdContext_1.BlockIdContext.Provider, { value: blockKey },
14
+ react_1.default.createElement(Component, Object.assign({}, rest), children)));
13
15
  };
14
16
  exports.ConstructorItem = ConstructorItem;
15
17
  const ConstructorHeader = ({ data, blockKey, }) => (react_1.default.createElement(BlockDecoration_1.BlockDecoration, { id: data.type },
@@ -1,3 +1,3 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { BlockDecorationProps } from '../models';
3
- export declare const BlockDecoration: (props: PropsWithChildren<BlockDecorationProps>) => JSX.Element;
3
+ export declare const BlockDecoration: ({ id, children: blockChildren, }: PropsWithChildren<BlockDecorationProps>) => JSX.Element;
@@ -3,20 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BlockDecoration = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
- const blockIdContext_1 = require("../context/blockIdContext");
7
6
  const innerContext_1 = require("../context/innerContext");
8
- const utils_1 = require("../utils");
9
- const BlockDecoration = (props) => {
7
+ const BlockDecoration = ({ id, children: blockChildren, }) => {
10
8
  var _a, _b;
11
- const blockContenxtId = (0, utils_1.getBlockIndexFromId)((0, react_1.useContext)(blockIdContext_1.BlockIdContext));
12
9
  const { headerBlockTypes } = (0, react_1.useContext)(innerContext_1.InnerContext);
13
- const blockId = props.id || blockContenxtId;
14
- const isHeader = Boolean(props.id && headerBlockTypes.includes(props.id));
15
- const block = react_1.default.createElement(react_1.Fragment, null, props.children);
10
+ const isHeader = Boolean(typeof id === 'string' && headerBlockTypes.includes(id));
11
+ const block = react_1.default.createElement(react_1.Fragment, null, blockChildren);
16
12
  const blockDecorators = (_b = (_a = (0, react_1.useContext)(innerContext_1.InnerContext).customization) === null || _a === void 0 ? void 0 : _a.decorators) === null || _b === void 0 ? void 0 : _b.block;
17
13
  if (!blockDecorators) {
18
14
  return block;
19
15
  }
20
- return blockDecorators.reduce((children, decorator) => (react_1.default.createElement(react_1.Fragment, null, decorator({ children, id: blockId, isHeader }))), block);
16
+ return blockDecorators.reduce((children, decorator) => react_1.default.createElement(react_1.Fragment, null, decorator({ children, id, isHeader })), block);
21
17
  };
22
18
  exports.BlockDecoration = BlockDecoration;
@@ -30,6 +30,7 @@ export interface Childable {
30
30
  children?: SubBlock[];
31
31
  }
32
32
  export interface BlockBaseProps {
33
+ index?: number;
33
34
  anchor?: AnchorProps;
34
35
  visible?: GridColumnSize;
35
36
  resetPaddings?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  export interface BlockDecorationProps extends PropsWithChildren {
3
- id?: string;
3
+ id: string | number;
4
4
  }
5
5
  export interface BlockDecoratorProps extends PropsWithChildren {
6
6
  id: string | number;
@@ -11,4 +11,3 @@ export declare const getCustomHeaderTypes: (customBlocks?: CustomConfig) => stri
11
11
  export declare const getOrderedBlocks: (blocks: Block[], headerBlockTypes?: string[]) => Block[];
12
12
  export declare const getHeaderBlock: (blocks: Block[], headerBlockTypes?: string[]) => Block | undefined;
13
13
  export declare const getShareLink: (url: string, type: PCShareSocialNetwork, title?: string, text?: string) => string | undefined;
14
- export declare const getBlockIndexFromId: (blockId?: string) => number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBlockIndexFromId = exports.getShareLink = exports.getHeaderBlock = exports.getOrderedBlocks = exports.getCustomHeaderTypes = exports.getCustomSubBlockTypes = exports.getCustomItems = exports.getCustomBlockTypes = exports.getBlockKey = exports.getHeaderTag = void 0;
3
+ exports.getShareLink = exports.getHeaderBlock = exports.getOrderedBlocks = exports.getCustomHeaderTypes = exports.getCustomSubBlockTypes = exports.getCustomItems = exports.getCustomBlockTypes = exports.getBlockKey = exports.getHeaderTag = void 0;
4
4
  const models_1 = require("../models");
5
5
  function getHeaderTag(size) {
6
6
  switch (size) {
@@ -83,5 +83,3 @@ const getShareLink = (url, type, title, text) => {
83
83
  }
84
84
  };
85
85
  exports.getShareLink = getShareLink;
86
- const getBlockIndexFromId = (blockId) => { var _a; return Number((_a = blockId === null || blockId === void 0 ? void 0 : blockId.split('-')) === null || _a === void 0 ? void 0 : _a.slice(-1).pop()); };
87
- exports.getBlockIndexFromId = getBlockIndexFromId;
@@ -6,9 +6,9 @@ import Anchor from '../Anchor/Anchor';
6
6
  import './BlockBase.css';
7
7
  const b = block('block-base');
8
8
  const BlockBase = (props) => {
9
- const { anchor, visible, children, className, resetPaddings, qa } = props;
9
+ const { anchor, visible, children, className, resetPaddings, qa, index = 0 } = props;
10
10
  return (React.createElement(Col, { className: b({ ['reset-paddings']: resetPaddings }, className), visible: visible, reset: true, dataQa: qa },
11
- React.createElement(BlockDecoration, null,
11
+ React.createElement(BlockDecoration, { id: index },
12
12
  anchor && React.createElement(Anchor, { id: anchor.url, className: b('anchor') }),
13
13
  children)));
14
14
  };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { Block, WithChildren } from '../../../../models';
3
- interface ConstructorBlockProps {
2
+ import { Block, BlockBaseProps, WithChildren } from '../../../../models';
3
+ interface ConstructorBlockProps extends Pick<BlockBaseProps, 'index'> {
4
4
  data: Block;
5
5
  }
6
6
  export declare const ConstructorBlock: React.FC<WithChildren<ConstructorBlockProps>>;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import BlockBase from '../../../../components/BlockBase/BlockBase';
3
3
  import { block } from '../../../../utils';
4
4
  const b = block('constructor-block');
5
- export const ConstructorBlock = ({ data, children, }) => {
5
+ export const ConstructorBlock = ({ index = 0, data, children, }) => {
6
6
  const { anchor, visible, type } = data;
7
- return (React.createElement(BlockBase, { className: b({ type }), anchor: anchor, visible: visible, resetPaddings: data.resetPaddings }, children));
7
+ return (React.createElement(BlockBase, { index: index, className: b({ type }), anchor: anchor, visible: visible, resetPaddings: data.resetPaddings }, children));
8
8
  };
@@ -1,6 +1,5 @@
1
1
  import React, { Fragment, useContext } from 'react';
2
2
  import _ from 'lodash';
3
- import { BlockIdContext } from '../../../../context/blockIdContext';
4
3
  import { InnerContext } from '../../../../context/innerContext';
5
4
  import { getBlockKey } from '../../../../utils';
6
5
  import { ConstructorBlock } from '../ConstructorBlock/ConstructorBlock';
@@ -31,9 +30,12 @@ export const ConstructorBlocks = ({ items }) => {
31
30
  if ('children' in item && item.children) {
32
31
  children = item.children.map(renderer.bind(null, blockId));
33
32
  }
34
- itemElement = (React.createElement(ConstructorItem, { data: item, blockKey: blockId }, children));
33
+ itemElement = (React.createElement(ConstructorItem, { data: item, key: blockId, blockKey: blockId }, children));
35
34
  }
36
- return (React.createElement(BlockIdContext.Provider, { value: blockId, key: blockId }, blockTypes.includes(item.type) ? (React.createElement(ConstructorBlock, { data: item }, itemElement)) : (itemElement)));
35
+ return blockTypes.includes(item.type) ? (
36
+ //TODO: replace ConstructorBlock (and delete it) with BlockBase when all
37
+ // components relying on constructor inner structure like Slider or blog-constructor will be refactored
38
+ React.createElement(ConstructorBlock, { data: item, key: blockId, index: index }, itemElement)) : (itemElement);
37
39
  };
38
40
  return React.createElement(Fragment, null, items.map(renderer.bind(null, '')));
39
41
  };
@@ -3,5 +3,5 @@ export interface ConstructorItemProps {
3
3
  data: ConstructorItemType;
4
4
  blockKey: string;
5
5
  }
6
- export declare const ConstructorItem: ({ data, children }: WithChildren<ConstructorItemProps>) => JSX.Element;
6
+ export declare const ConstructorItem: ({ data, blockKey, children }: WithChildren<ConstructorItemProps>) => JSX.Element;
7
7
  export declare const ConstructorHeader: ({ data, blockKey, }: Pick<ConstructorItemProps, 'data' | 'blockKey'>) => JSX.Element;
@@ -1,12 +1,14 @@
1
1
  import { __rest } from "tslib";
2
2
  import React, { useContext } from 'react';
3
+ import { BlockIdContext } from '../../../../context/blockIdContext';
3
4
  import { InnerContext } from '../../../../context/innerContext';
4
5
  import { BlockDecoration } from '../../../../customization/BlockDecoration';
5
- export const ConstructorItem = ({ data, children }) => {
6
+ export const ConstructorItem = ({ data, blockKey, children }) => {
6
7
  const { itemMap } = useContext(InnerContext);
7
8
  const { type } = data, rest = __rest(data, ["type"]);
8
9
  const Component = itemMap[type];
9
- return React.createElement(Component, Object.assign({}, rest), children);
10
+ return (React.createElement(BlockIdContext.Provider, { value: blockKey },
11
+ React.createElement(Component, Object.assign({}, rest), children)));
10
12
  };
11
13
  export const ConstructorHeader = ({ data, blockKey, }) => (React.createElement(BlockDecoration, { id: data.type },
12
14
  React.createElement(ConstructorItem, { data: data, key: data.type, blockKey: blockKey })));
@@ -1,3 +1,3 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { BlockDecorationProps } from '../models';
3
- export declare const BlockDecoration: (props: PropsWithChildren<BlockDecorationProps>) => JSX.Element;
3
+ export declare const BlockDecoration: ({ id, children: blockChildren, }: PropsWithChildren<BlockDecorationProps>) => JSX.Element;
@@ -1,17 +1,13 @@
1
1
  import React, { Fragment, useContext } from 'react';
2
- import { BlockIdContext } from '../context/blockIdContext';
3
2
  import { InnerContext } from '../context/innerContext';
4
- import { getBlockIndexFromId } from '../utils';
5
- export const BlockDecoration = (props) => {
3
+ export const BlockDecoration = ({ id, children: blockChildren, }) => {
6
4
  var _a, _b;
7
- const blockContenxtId = getBlockIndexFromId(useContext(BlockIdContext));
8
5
  const { headerBlockTypes } = useContext(InnerContext);
9
- const blockId = props.id || blockContenxtId;
10
- const isHeader = Boolean(props.id && headerBlockTypes.includes(props.id));
11
- const block = React.createElement(Fragment, null, props.children);
6
+ const isHeader = Boolean(typeof id === 'string' && headerBlockTypes.includes(id));
7
+ const block = React.createElement(Fragment, null, blockChildren);
12
8
  const blockDecorators = (_b = (_a = useContext(InnerContext).customization) === null || _a === void 0 ? void 0 : _a.decorators) === null || _b === void 0 ? void 0 : _b.block;
13
9
  if (!blockDecorators) {
14
10
  return block;
15
11
  }
16
- return blockDecorators.reduce((children, decorator) => (React.createElement(Fragment, null, decorator({ children, id: blockId, isHeader }))), block);
12
+ return blockDecorators.reduce((children, decorator) => React.createElement(Fragment, null, decorator({ children, id, isHeader })), block);
17
13
  };
@@ -30,6 +30,7 @@ export interface Childable {
30
30
  children?: SubBlock[];
31
31
  }
32
32
  export interface BlockBaseProps {
33
+ index?: number;
33
34
  anchor?: AnchorProps;
34
35
  visible?: GridColumnSize;
35
36
  resetPaddings?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  export interface BlockDecorationProps extends PropsWithChildren {
3
- id?: string;
3
+ id: string | number;
4
4
  }
5
5
  export interface BlockDecoratorProps extends PropsWithChildren {
6
6
  id: string | number;
@@ -11,4 +11,3 @@ export declare const getCustomHeaderTypes: (customBlocks?: CustomConfig) => stri
11
11
  export declare const getOrderedBlocks: (blocks: Block[], headerBlockTypes?: string[]) => Block[];
12
12
  export declare const getHeaderBlock: (blocks: Block[], headerBlockTypes?: string[]) => Block | undefined;
13
13
  export declare const getShareLink: (url: string, type: PCShareSocialNetwork, title?: string, text?: string) => string | undefined;
14
- export declare const getBlockIndexFromId: (blockId?: string) => number;
@@ -71,4 +71,3 @@ export const getShareLink = (url, type, title, text) => {
71
71
  return undefined;
72
72
  }
73
73
  };
74
- export const getBlockIndexFromId = (blockId) => { var _a; return Number((_a = blockId === null || blockId === void 0 ? void 0 : blockId.split('-')) === null || _a === void 0 ? void 0 : _a.slice(-1).pop()); };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -30,6 +30,7 @@ export interface Childable {
30
30
  children?: SubBlock[];
31
31
  }
32
32
  export interface BlockBaseProps {
33
+ index?: number;
33
34
  anchor?: AnchorProps;
34
35
  visible?: GridColumnSize;
35
36
  resetPaddings?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  export interface BlockDecorationProps extends PropsWithChildren {
3
- id?: string;
3
+ id: string | number;
4
4
  }
5
5
  export interface BlockDecoratorProps extends PropsWithChildren {
6
6
  id: string | number;
@@ -11,4 +11,3 @@ export declare const getCustomHeaderTypes: (customBlocks?: CustomConfig) => stri
11
11
  export declare const getOrderedBlocks: (blocks: Block[], headerBlockTypes?: string[]) => Block[];
12
12
  export declare const getHeaderBlock: (blocks: Block[], headerBlockTypes?: string[]) => Block | undefined;
13
13
  export declare const getShareLink: (url: string, type: PCShareSocialNetwork, title?: string, text?: string) => string | undefined;
14
- export declare const getBlockIndexFromId: (blockId?: string) => number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBlockIndexFromId = exports.getShareLink = exports.getHeaderBlock = exports.getOrderedBlocks = exports.getCustomHeaderTypes = exports.getCustomSubBlockTypes = exports.getCustomItems = exports.getCustomBlockTypes = exports.getBlockKey = exports.getHeaderTag = void 0;
3
+ exports.getShareLink = exports.getHeaderBlock = exports.getOrderedBlocks = exports.getCustomHeaderTypes = exports.getCustomSubBlockTypes = exports.getCustomItems = exports.getCustomBlockTypes = exports.getBlockKey = exports.getHeaderTag = void 0;
4
4
  const models_1 = require("../models");
5
5
  function getHeaderTag(size) {
6
6
  switch (size) {
@@ -83,5 +83,3 @@ const getShareLink = (url, type, title, text) => {
83
83
  }
84
84
  };
85
85
  exports.getShareLink = getShareLink;
86
- const getBlockIndexFromId = (blockId) => { var _a; return Number((_a = blockId === null || blockId === void 0 ? void 0 : blockId.split('-')) === null || _a === void 0 ? void 0 : _a.slice(-1).pop()); };
87
- exports.getBlockIndexFromId = getBlockIndexFromId;