@gravity-ui/page-constructor 1.6.0-alpha.1 → 1.6.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.6.1](https://github.com/gravity-ui/page-constructor/compare/v1.4.1...v1.6.1) (2022-11-10)
4
+
5
+ ### Bug Fixes
6
+
7
+ * fix storybook's content
8
+
9
+
3
10
  ## [1.6.0](https://github.com/gravity-ui/page-constructor/pulls?q=is%3Apr+is%3Aclosed) (2022-11-09)
4
11
 
5
12
  ### Features
@@ -12,8 +12,6 @@ unpredictable css rules order in build */
12
12
  }
13
13
  .pc-ExtendedFeaturesBlock__item {
14
14
  margin-top: 32px;
15
- }
16
- .pc-ExtendedFeaturesBlock__item.col {
17
15
  padding-right: 32px;
18
16
  }
19
17
  .pc-ExtendedFeaturesBlock__item-title {
@@ -76,15 +74,12 @@ unpredictable css rules order in build */
76
74
  height: 32px;
77
75
  background-size: cover;
78
76
  display: block;
79
- margin-bottom: 12px;
77
+ margin-bottom: 8px;
80
78
  }
81
79
  @media (max-width: 577px) {
82
80
  .pc-ExtendedFeaturesBlock__item {
83
81
  margin-top: 32px;
84
82
  }
85
- .pc-ExtendedFeaturesBlock__item.col {
86
- padding-right: 8px;
87
- }
88
83
  }
89
84
  @media (min-width: 769px) {
90
85
  .pc-ExtendedFeaturesBlock.pc-AnimateBlock .pc-ExtendedFeaturesBlock__item, .pc-AnimateBlock .pc-ExtendedFeaturesBlock .pc-ExtendedFeaturesBlock__item {
@@ -2,40 +2,26 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ExtendedFeaturesBlock = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const react_1 = (0, tslib_1.__importStar)(require("react"));
5
+ const react_1 = (0, tslib_1.__importDefault)(require("react"));
6
6
  const utils_1 = require("../../utils");
7
7
  const grid_1 = require("../../grid");
8
8
  const components_1 = require("../../components/");
9
- const sub_blocks_1 = require("../../sub-blocks");
10
- const Image_1 = (0, tslib_1.__importDefault)(require("../../components/Image/Image"));
11
- const ThemeValueContext_1 = require("../../context/theme/ThemeValueContext");
12
- const utils_2 = require("../../components/Media/Image/utils");
13
9
  const b = (0, utils_1.block)('ExtendedFeaturesBlock');
14
10
  const DEFAULT_SIZES = {
15
11
  all: 12,
16
12
  sm: 6,
17
13
  md: 4,
18
14
  };
19
- const ExtendedFeaturesBlock = ({ title, description, items, colSizes = DEFAULT_SIZES, animated, }) => {
20
- const { themeValue: theme } = (0, react_1.useContext)(ThemeValueContext_1.ThemeValueContext);
21
- return (react_1.default.createElement(components_1.AnimateBlock, { className: b(), animate: animated },
22
- react_1.default.createElement(components_1.BlockHeader, { title: title, description: description, className: b('header') }),
23
- react_1.default.createElement("div", { className: b('items') },
24
- react_1.default.createElement(grid_1.Row, null, items.map(({ title: itemTitle, text, link, links, label, icon }) => {
25
- const itemLinks = links || [];
26
- const iconThemed = icon && (0, utils_1.getThemedValue)(icon, theme);
27
- const iconData = iconThemed && (0, utils_2.getMediaImage)(iconThemed);
28
- if (link) {
29
- itemLinks.push(link);
30
- }
31
- return (react_1.default.createElement(grid_1.Col, { className: b('item'), key: text || itemTitle, sizes: colSizes },
32
- iconData && react_1.default.createElement(Image_1.default, Object.assign({}, iconData, { className: b('icon') })),
33
- react_1.default.createElement("div", { className: b('container') },
34
- itemTitle && (react_1.default.createElement("h5", { className: b('item-title') },
35
- react_1.default.createElement(components_1.HTML, null, itemTitle),
36
- label && (react_1.default.createElement("div", { className: b('item-label') }, label)))),
37
- react_1.default.createElement(sub_blocks_1.Content, { text: text, links: itemLinks, size: "s", colSizes: { all: 12, md: 12 } }))));
38
- })))));
39
- };
15
+ const ExtendedFeaturesBlock = ({ title, description, items, colSizes = DEFAULT_SIZES, animated, }) => (react_1.default.createElement(components_1.AnimateBlock, { className: b(), animate: animated },
16
+ react_1.default.createElement(components_1.BlockHeader, { title: title, description: description, className: b('header') }),
17
+ react_1.default.createElement("div", { className: b('items') },
18
+ react_1.default.createElement(grid_1.Row, null, items.map(({ title: itemTitle, text, link, label, icon }) => (react_1.default.createElement(grid_1.Col, { className: b('item'), key: text || itemTitle, sizes: colSizes },
19
+ icon && react_1.default.createElement("img", { src: icon, className: b('icon') }),
20
+ itemTitle && (react_1.default.createElement("h5", { className: b('item-title', { 'has-label': Boolean(label) }) },
21
+ react_1.default.createElement(components_1.HTML, null, itemTitle),
22
+ label && react_1.default.createElement("div", { className: b('item-label') }, label))),
23
+ text && (react_1.default.createElement("div", { className: b('item-text') },
24
+ react_1.default.createElement(components_1.HTML, null, text))),
25
+ link && react_1.default.createElement(components_1.Link, Object.assign({ className: b('item-link') }, link)))))))));
40
26
  exports.ExtendedFeaturesBlock = ExtendedFeaturesBlock;
41
27
  exports.default = exports.ExtendedFeaturesBlock;
@@ -118,10 +118,8 @@ export interface ExtendedFeaturesItem {
118
118
  title?: string;
119
119
  text?: string;
120
120
  label?: string;
121
- icon?: ThemedImage;
122
- /** @deprecated **/
121
+ icon?: string;
123
122
  link?: LinkProps;
124
- links?: LinkProps[];
125
123
  }
126
124
  export interface ExtendedFeaturesProps extends Animatable {
127
125
  items: ExtendedFeaturesItem[];
@@ -152,20 +152,10 @@ const config = {
152
152
  fields: ['description'],
153
153
  transformer: yfmTransformer,
154
154
  },
155
- // {
156
- // fields: ['items'],
157
- // transformer: typografTransformer,
158
- // parser: parseFeatures,
159
- // },
160
155
  {
161
156
  fields: ['items'],
162
157
  transformer: typografTransformer,
163
- parser: (0, exports.createItemsParser)(['title']),
164
- },
165
- {
166
- fields: ['items'],
167
- transformer: yfmTransformer,
168
- parser: (0, exports.createItemsParser)(['text', 'additionalInfo']),
158
+ parser: parseFeatures,
169
159
  },
170
160
  ],
171
161
  [models_1.BlockType.PromoFeaturesBlock]: {
@@ -12,8 +12,6 @@ unpredictable css rules order in build */
12
12
  }
13
13
  .pc-ExtendedFeaturesBlock__item {
14
14
  margin-top: 32px;
15
- }
16
- .pc-ExtendedFeaturesBlock__item.col {
17
15
  padding-right: 32px;
18
16
  }
19
17
  .pc-ExtendedFeaturesBlock__item-title {
@@ -76,15 +74,12 @@ unpredictable css rules order in build */
76
74
  height: 32px;
77
75
  background-size: cover;
78
76
  display: block;
79
- margin-bottom: 12px;
77
+ margin-bottom: 8px;
80
78
  }
81
79
  @media (max-width: 577px) {
82
80
  .pc-ExtendedFeaturesBlock__item {
83
81
  margin-top: 32px;
84
82
  }
85
- .pc-ExtendedFeaturesBlock__item.col {
86
- padding-right: 8px;
87
- }
88
83
  }
89
84
  @media (min-width: 769px) {
90
85
  .pc-ExtendedFeaturesBlock.pc-AnimateBlock .pc-ExtendedFeaturesBlock__item, .pc-AnimateBlock .pc-ExtendedFeaturesBlock .pc-ExtendedFeaturesBlock__item {
@@ -1,11 +1,7 @@
1
- import React, { useContext } from 'react';
2
- import { block, getThemedValue } from '../../utils';
1
+ import React from 'react';
2
+ import { block } from '../../utils';
3
3
  import { Row, Col } from '../../grid';
4
- import { AnimateBlock, BlockHeader, HTML } from '../../components/';
5
- import { Content } from '../../sub-blocks';
6
- import Image from '../../components/Image/Image';
7
- import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
8
- import { getMediaImage } from '../../components/Media/Image/utils';
4
+ import { Link, HTML, AnimateBlock, BlockHeader } from '../../components/';
9
5
  import './ExtendedFeatures.css';
10
6
  const b = block('ExtendedFeaturesBlock');
11
7
  const DEFAULT_SIZES = {
@@ -13,25 +9,15 @@ const DEFAULT_SIZES = {
13
9
  sm: 6,
14
10
  md: 4,
15
11
  };
16
- export const ExtendedFeaturesBlock = ({ title, description, items, colSizes = DEFAULT_SIZES, animated, }) => {
17
- const { themeValue: theme } = useContext(ThemeValueContext);
18
- return (React.createElement(AnimateBlock, { className: b(), animate: animated },
19
- React.createElement(BlockHeader, { title: title, description: description, className: b('header') }),
20
- React.createElement("div", { className: b('items') },
21
- React.createElement(Row, null, items.map(({ title: itemTitle, text, link, links, label, icon }) => {
22
- const itemLinks = links || [];
23
- const iconThemed = icon && getThemedValue(icon, theme);
24
- const iconData = iconThemed && getMediaImage(iconThemed);
25
- if (link) {
26
- itemLinks.push(link);
27
- }
28
- return (React.createElement(Col, { className: b('item'), key: text || itemTitle, sizes: colSizes },
29
- iconData && React.createElement(Image, Object.assign({}, iconData, { className: b('icon') })),
30
- React.createElement("div", { className: b('container') },
31
- itemTitle && (React.createElement("h5", { className: b('item-title') },
32
- React.createElement(HTML, null, itemTitle),
33
- label && (React.createElement("div", { className: b('item-label') }, label)))),
34
- React.createElement(Content, { text: text, links: itemLinks, size: "s", colSizes: { all: 12, md: 12 } }))));
35
- })))));
36
- };
12
+ export const ExtendedFeaturesBlock = ({ title, description, items, colSizes = DEFAULT_SIZES, animated, }) => (React.createElement(AnimateBlock, { className: b(), animate: animated },
13
+ React.createElement(BlockHeader, { title: title, description: description, className: b('header') }),
14
+ React.createElement("div", { className: b('items') },
15
+ React.createElement(Row, null, items.map(({ title: itemTitle, text, link, label, icon }) => (React.createElement(Col, { className: b('item'), key: text || itemTitle, sizes: colSizes },
16
+ icon && React.createElement("img", { src: icon, className: b('icon') }),
17
+ itemTitle && (React.createElement("h5", { className: b('item-title', { 'has-label': Boolean(label) }) },
18
+ React.createElement(HTML, null, itemTitle),
19
+ label && React.createElement("div", { className: b('item-label') }, label))),
20
+ text && (React.createElement("div", { className: b('item-text') },
21
+ React.createElement(HTML, null, text))),
22
+ link && React.createElement(Link, Object.assign({ className: b('item-link') }, link)))))))));
37
23
  export default ExtendedFeaturesBlock;
@@ -118,10 +118,8 @@ export interface ExtendedFeaturesItem {
118
118
  title?: string;
119
119
  text?: string;
120
120
  label?: string;
121
- icon?: ThemedImage;
122
- /** @deprecated **/
121
+ icon?: string;
123
122
  link?: LinkProps;
124
- links?: LinkProps[];
125
123
  }
126
124
  export interface ExtendedFeaturesProps extends Animatable {
127
125
  items: ExtendedFeaturesItem[];
@@ -146,20 +146,10 @@ const config = {
146
146
  fields: ['description'],
147
147
  transformer: yfmTransformer,
148
148
  },
149
- // {
150
- // fields: ['items'],
151
- // transformer: typografTransformer,
152
- // parser: parseFeatures,
153
- // },
154
149
  {
155
150
  fields: ['items'],
156
151
  transformer: typografTransformer,
157
- parser: createItemsParser(['title']),
158
- },
159
- {
160
- fields: ['items'],
161
- transformer: yfmTransformer,
162
- parser: createItemsParser(['text', 'additionalInfo']),
152
+ parser: parseFeatures,
163
153
  },
164
154
  ],
165
155
  [BlockType.PromoFeaturesBlock]: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "1.6.0-alpha.1",
3
+ "version": "1.6.1",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -121,8 +121,5 @@
121
121
  "*.{json,yaml,yml,md}": [
122
122
  "prettier --write"
123
123
  ]
124
- },
125
- "publishConfig": {
126
- "tag": "alpha"
127
124
  }
128
125
  }
@@ -118,10 +118,8 @@ export interface ExtendedFeaturesItem {
118
118
  title?: string;
119
119
  text?: string;
120
120
  label?: string;
121
- icon?: ThemedImage;
122
- /** @deprecated **/
121
+ icon?: string;
123
122
  link?: LinkProps;
124
- links?: LinkProps[];
125
123
  }
126
124
  export interface ExtendedFeaturesProps extends Animatable {
127
125
  items: ExtendedFeaturesItem[];
@@ -165,20 +165,10 @@ const config = {
165
165
  fields: ['description'],
166
166
  transformer: yfmTransformer,
167
167
  },
168
- // {
169
- // fields: ['items'],
170
- // transformer: typografTransformer,
171
- // parser: parseFeatures,
172
- // },
173
168
  {
174
169
  fields: ['items'],
175
170
  transformer: typografTransformer,
176
- parser: (0, exports.createItemsParser)(['title']),
177
- },
178
- {
179
- fields: ['items'],
180
- transformer: yfmTransformer,
181
- parser: (0, exports.createItemsParser)(['text', 'additionalInfo']),
171
+ parser: parseFeatures,
182
172
  },
183
173
  ],
184
174
  [models_1.BlockType.PromoFeaturesBlock]: {