@gravity-ui/page-constructor 1.0.1 → 1.0.3

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,70 +1,52 @@
1
1
  # Changelog
2
2
 
3
- ## [1.0.1](https://github.com/gravity-ui/page-constructor/compare/v1.0.0...v1.0.1) (2022-10-03)
3
+ ## [1.0.3](https://github.com/gravity-ui/page-constructor/compare/v1.0.2...v1.0.3) (2022-10-05)
4
4
 
5
5
 
6
6
  ### Bug Fixes
7
7
 
8
- * add repository links to readme ([a6ed8b9](https://github.com/gravity-ui/page-constructor/commit/a6ed8b9af5f71e8b0eed3bb52f3309a715c5a48b))
8
+ * add yfm js import ([d9a77df](https://github.com/gravity-ui/page-constructor/commit/d9a77df743d68db9353bf6edbada38fbd81ce59f))
9
+ * content centered styles priority ([3d2bad2](https://github.com/gravity-ui/page-constructor/commit/3d2bad24947d86fbd4cf3735beff49c0dfe74382))
10
+ * content layout centered styles ([d0dcc59](https://github.com/gravity-ui/page-constructor/commit/d0dcc5988d3b08e483fe288295c904f16f903a94))
11
+ * displaying video with fillWidthMedia param in HeaderBlock ([560b867](https://github.com/gravity-ui/page-constructor/commit/560b86776074a6249546d7c51324a201de9c04c4))
12
+ * header block dark theme html ([d0cb1ce](https://github.com/gravity-ui/page-constructor/commit/d0cb1cebecafcd8385be32b33182b30b6bdb198c))
13
+ * semantic colors for yfm ([40cd81f](https://github.com/gravity-ui/page-constructor/commit/40cd81ff9f0bf9407a84e181e10e23702aa67eb2))
9
14
 
10
- ## 1.0.0 (2022-10-03)
15
+ ## [1.0.2](https://github.com/gravity-ui/page-constructor/compare/v1.0.1...v1.0.2) (2022-10-04)
11
16
 
12
17
 
13
- ### Features
18
+ ### Bug Fixes
14
19
 
15
- * add blocks translations A-C ([f8d1e76](https://github.com/gravity-ui/page-constructor/commit/f8d1e76cb373b457141a0d4384c2a9a2fb688c30))
16
- * add commitlint ([dfbbf83](https://github.com/gravity-ui/page-constructor/commit/dfbbf83ea435978a1926c3038e965fd48797919f))
17
- * add github workflow ([bd204ec](https://github.com/gravity-ui/page-constructor/commit/bd204eca48c204138ef78c202986683d78a84840))
18
- * add react 18 types supporting ([cd4d1b0](https://github.com/gravity-ui/page-constructor/commit/cd4d1b0f2d075ddcd44adb998bbbeef7fb75117e))
19
- * add translations for blocks ([64e0999](https://github.com/gravity-ui/page-constructor/commit/64e0999ed166a66294b44a81082a00f366e7d53f))
20
- * add translations for components and sub blocks stories ([b8d8125](https://github.com/gravity-ui/page-constructor/commit/b8d8125cf9cab76b225e41159a5613fe75b56416))
21
- * migrate from yandex-cloud to gravity-ui ([3509b63](https://github.com/gravity-ui/page-constructor/commit/3509b63fe1b9507115ff5a3078322dfa39701450))
22
- * **PageConstructor:** add serviceId loadable [CLOUDFRONT-9364] ([#64](https://github.com/gravity-ui/page-constructor/issues/64)) ([4cc16cd](https://github.com/gravity-ui/page-constructor/commit/4cc16cd1a1dcfc0c17d38b92619456b22f3cf078))
23
- * prepare to publishing ([a259f69](https://github.com/gravity-ui/page-constructor/commit/a259f693c581bc34519d73063182c880dfcdb78d))
24
- * translate chapter names ([e922e27](https://github.com/gravity-ui/page-constructor/commit/e922e27657f12aebcd7bb62acb23a783f8a349ba))
25
- * translate components cards urls ([05382bd](https://github.com/gravity-ui/page-constructor/commit/05382bd3038c6aa0fad98bc2270f6869d2b62ca8))
26
- * translate englisht pt.1 ([945423a](https://github.com/gravity-ui/page-constructor/commit/945423a73807fdb0d8f29bba9210f94e6d3185dd))
27
- * translate questions readme ([4da6a8f](https://github.com/gravity-ui/page-constructor/commit/4da6a8fdab85ca68a35a182cd6b841bba6ab3334))
28
- * update hs form CLOUDFRONT-11339 ([478e762](https://github.com/gravity-ui/page-constructor/commit/478e762457cee318e3a9f1e9b27623def80f0603))
20
+ * readme ([be265cd](https://github.com/gravity-ui/page-constructor/commit/be265cd6cdc3a9212ba5a7f6ad4b7b4073dcf7fb))
21
+
22
+ ## [1.0.1](https://github.com/gravity-ui/page-constructor/compare/v1.0.0...v1.0.1) (2022-10-03)
29
23
 
30
24
 
31
25
  ### Bug Fixes
32
26
 
33
- * add postcss-scss ([9d30c31](https://github.com/gravity-ui/page-constructor/commit/9d30c3132dee6809523c2021051328a23ab402be))
34
- * add card-with image schema ([#85](https://github.com/gravity-ui/page-constructor/issues/85)) ([82af438](https://github.com/gravity-ui/page-constructor/commit/82af4382fd9bb37089f3ffc00b4bc8b3ddb36d7a))
35
- * add CHANGELOG and CONTRIBUTING to prettier ignore ([d3def9c](https://github.com/gravity-ui/page-constructor/commit/d3def9c6557f51de330dbcaca64dc56dbc84ce04))
36
- * add dummy test ([9e5e769](https://github.com/gravity-ui/page-constructor/commit/9e5e76901cbd8b3b7b6cac2e757351e58f022bad))
37
- * add paddings to submited message block NOTICKET ([54665d1](https://github.com/gravity-ui/page-constructor/commit/54665d1818f5c63988ae5e5d485a3b10cf5f88ae))
38
- * children types ([dee1176](https://github.com/gravity-ui/page-constructor/commit/dee11769e2058f552e77612450a08790e8c28ba5))
39
- * lint ([3d448fa](https://github.com/gravity-ui/page-constructor/commit/3d448fa879fa20e00e0b9b89ba952ef0b3588184))
40
- * lint fix comand ([5533ab4](https://github.com/gravity-ui/page-constructor/commit/5533ab433aeb2d209913ddeef9364518f84ef882))
41
- * lint prettier ([c57092c](https://github.com/gravity-ui/page-constructor/commit/c57092c9e7c63b5d15a1037598253adc0e578129))
42
- * remove hekpers and sources ([49f9220](https://github.com/gravity-ui/page-constructor/commit/49f9220c094b70e0d86df9552bf6a81e316a3796))
43
- * remove helper decorator ([c512a17](https://github.com/gravity-ui/page-constructor/commit/c512a17abe63be6802e8d6ba82a153e132f8bec7))
44
- * remove withThemeValueContext ([339bbb4](https://github.com/gravity-ui/page-constructor/commit/339bbb418bfb60f82c84e9da0bf0eb6981186dae))
45
- * reword handlers disclamer comments & extend HubspotEventHandlers in HubspotFormProps NOTICKET ([f254205](https://github.com/gravity-ui/page-constructor/commit/f254205a6cf8487a59ed8b3759681e40650760d7))
46
- * storybook launch ([65254de](https://github.com/gravity-ui/page-constructor/commit/65254ded6c23f5f5951e4e8fa18474c0ec154b18))
47
- * turn main readme back to english ([e30267c](https://github.com/gravity-ui/page-constructor/commit/e30267ca710898fd5996341e8315f128c95ca609))
27
+ * add repository links to readme ([a6ed8b9](https://github.com/gravity-ui/page-constructor/commit/a6ed8b9af5f71e8b0eed3bb52f3309a715c5a48b))
48
28
 
49
29
  ## 1.0.0
50
30
 
51
- - Discontinued support for v1 blocks.
31
+ - V1 blocks support was discontinued.
32
+
33
+ - `@yandex-data-ui/common`, `@yandex-data-ui/cloud-schemas`, and `@yandex-data-ui/cloud-components` was deleted from dependencies.
52
34
 
53
- - Deleted the `@yandex-data-ui/common`, `@yandex-data-ui/cloud-schemas`, and `@yandex-data-ui/cloud-components` dependencies.
35
+ - All the constructor elements was grouped into blocks, sub-blocks and components.
54
36
 
55
- - Grouped all the constructor elements into blocks and sub-blocks.
37
+ - PageConstructor component was refactored.
56
38
 
57
- - Refactored the PageConstructor component.
39
+ - Validators was Refactored.
58
40
 
59
- - Refactored the validators.
41
+ - Project build engine was moved from `@yandex-data-ui/ui-core` to `gulp`.
60
42
 
61
- - Moved a project build from `@yandex-data-ui/ui-core` to `gulp`.
43
+ - Storybook was updated.
62
44
 
63
- - Updated the Storybook.
45
+ - Project was moved to @gravity-ui.
64
46
 
65
- - Moved to @gravity-ui.
47
+ - LICENSE.md and CONTRIBUTING.md was added
66
48
 
67
- - Added LICENSE and CONTRIBUTING.md.
49
+ - Translate all docs and stories to english
68
50
 
69
51
  ## 0.60.5
70
52
 
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Page Constructor · [![npm package](https://img.shields.io/npm/v/@gravity-ui/page-constructor)](https://www.npmjs.com/package/@gravity-ui/page-constructor) [![CI](https://img.shields.io/github/workflow/status/gravity-ui/page-constructor/CI/main?label=CI&logo=github)](https://github.com/gravity-ui/page-constructor/actions/workflows/ci.yml?query=branch:main) [![storybook](https://img.shields.io/badge/Storybook-deployed-ff4685)](https://preview.yandexcloud.dev/page-constructor/)
1
+ # @gravity-ui/page-constructor · [![npm package](https://img.shields.io/npm/v/@gravity-ui/page-constructor)](https://www.npmjs.com/package/@gravity-ui/page-constructor) [![CI](https://img.shields.io/github/workflow/status/gravity-ui/page-constructor/CI/main?label=CI&logo=github)](https://github.com/gravity-ui/page-constructor/actions/workflows/ci.yml?query=branch:main) [![storybook](https://img.shields.io/badge/Storybook-deployed-ff4685)](https://preview.yandexcloud.dev/page-constructor/)
2
2
 
3
3
  ## Install
4
4
 
@@ -12,7 +12,7 @@ npm install @gravity-ui/page-constructor
12
12
 
13
13
  When creating pages, component-based approach is used: a page is built using a set of ready-made blocks that can be placed in any order. Each block has a certain type and set of input data parameters.
14
14
 
15
- For the format of input data and list of available blocks, see the [documentation](http://localhost:7009/?path=/story/information--containers).
15
+ For the format of input data and list of available blocks, see the [documentation](https://preview.yandexcloud.dev/page-constructor/?path=/story/information--blocks).
16
16
 
17
17
  ### Getting started
18
18
 
@@ -32,8 +32,8 @@ const Page: WithChildren<PageProps> = ({content}) => (
32
32
 
33
33
  ```typescript
34
34
  interface PageConstructorProps {
35
- content: PageContent; //Block description in JSON format.
36
- shouldRenderBlock?: ShouldRenderBlock; // A function that is invoked when rendering each block and that lets you set conditions for its display.
35
+ content: PageContent; //Blocks data in JSON format.
36
+ shouldRenderBlock?: ShouldRenderBlock; // A function that is invoked when rendering each block and lets you set conditions for its display.
37
37
  custom?: Custom; //Custom blocks (see `Customization`).
38
38
  renderMenu?: () => React.ReactNode; //A function that renders the page menu with navigation (we plan to add rendering for the default menu version).
39
39
  }
@@ -97,7 +97,7 @@ To pass custom blocks to the constructor:
97
97
 
98
98
  2. In your code, create an object with the block type (string) as a key and an imported block component as a value.
99
99
 
100
- 3. Pass the object you created to the `custom.blocks` or `custom.headers` parameter of the `PageConstructor` component (`custom.headers` specifies the block headers to be rendered separately above general content).
100
+ 3. Pass the object you created to the `custom.blocks`, `custom.headers` or `custom.subBlocks` parameter of the `PageConstructor` component (`custom.headers` specifies the block headers to be rendered separately above general content).
101
101
 
102
102
  4. Now you can use the created block in input data (the `content` parameter) by specifying its type and data.
103
103
 
@@ -150,21 +150,22 @@ Sub-blocks are components that can be used in the block `children` property. In
150
150
 
151
151
  ### How to add a new block to the `page-constructor`
152
152
 
153
- 1. In the `src/blocks` or `src/sub-blocks` directory, create a folder with the block/sub-block code.
153
+ 1. In the `src/blocks` or `src/sub-blocks` directory, create a folder with the block or sub-block code.
154
154
 
155
155
  2. Add the block or sub-block name to enum `BlockType` or`SubBlockType` and describe its properties in the `src/models/blocks.ts` or `src/models/sub-blocks.ts` file in a similar way to the existing ones.
156
156
 
157
- 3. Add export for the block in the `src/blocks/index.ts` file and for the sub-block in the `src/components/index.ts` file.
157
+ 3. Add export for the block in the `src/blocks/index.ts` file and for the sub-block in the `src/sub-blocks/index.ts` file.
158
158
 
159
159
  4. Add a new component or block to mapping in `src/constructor-items.ts`.
160
160
 
161
161
  5. Add a validator for the new block:
162
162
 
163
- - Add a `schema.ts` file to the block/sub-block directory. In this file, describe a parameter validator for the component in [`json-schema`](http://json-schema.org/) format.
163
+ - Add a `schema.ts` file to the block or sub-block directory. In this file, describe a parameter validator for the component in [`json-schema`](http://json-schema.org/) format.
164
164
  - Export it in the `schema/validators/blocks.ts` or `schema/validators/sub-blocks.ts` file.
165
165
  - Add it to `enum` or `selectCases` in the `schema/index.ts` file.
166
166
 
167
167
  6. In the block directory, add the `README.md` file with a description of input parameters.
168
+ 7. In the block directory add storybook demo in `__stories__` folder. (All demo content for story should be placed in `data.json` at story dir)
168
169
 
169
170
  ### Themes
170
171
 
@@ -26,9 +26,6 @@ unpredictable css rules order in build */
26
26
  margin-left: auto;
27
27
  margin-right: auto;
28
28
  }
29
- .pc-content-layout-block__files_centered .pc-content-layout-block__file {
30
- justify-content: center;
31
- }
32
29
  .pc-content-layout-block__files a {
33
30
  text-decoration: none;
34
31
  }
@@ -22,7 +22,7 @@ unpredictable css rules order in build */
22
22
  }
23
23
  .pc-header-block__content_theme_dark .pc-header-block__title,
24
24
  .pc-header-block__content_theme_dark .pc-header-block__description .yfm,
25
- .pc-header-block__content_theme_dark .pc-header-block__description .yfm > * {
25
+ .pc-header-block__content_theme_dark .pc-header-block__description .yfm * {
26
26
  color: var(--yc-color-text-light-primary);
27
27
  }
28
28
  .pc-header-block__content_vertical-offset {
@@ -141,6 +141,14 @@ unpredictable css rules order in build */
141
141
  .pc-header-block__background.pc-header-block__background_full-width-media > div, .pc-header-block__background.pc-header-block__background_media.pc-header-block__background_full-width-media > div {
142
142
  max-width: none;
143
143
  }
144
+ .pc-header-block__background.pc-header-block__background_full-width-media .pc-header-block__background-media, .pc-header-block__background.pc-header-block__background_media.pc-header-block__background_full-width-media .pc-header-block__background-media {
145
+ height: 100%;
146
+ }
147
+ .pc-header-block__background.pc-header-block__background_full-width-media video, .pc-header-block__background.pc-header-block__background_media.pc-header-block__background_full-width-media video {
148
+ height: 100%;
149
+ width: 100%;
150
+ object-fit: cover;
151
+ }
144
152
  .pc-header-block__background_full-width-media {
145
153
  --pc-border-radius: 0;
146
154
  }
@@ -14,7 +14,7 @@ const ThemeValueContext_1 = require("../../context/theme/ThemeValueContext");
14
14
  const b = (0, utils_1.block)('header-block');
15
15
  const Background = ({ background }) => {
16
16
  const { url, color, disableCompress, fullWidth, fullWidthMedia } = background;
17
- return (0, guards_1.headerHasMediaBackground)(background) ? (react_1.default.createElement(components_1.BackgroundMedia, Object.assign({}, background, { className: b('background', { media: true, 'full-width-media': fullWidthMedia }) }))) : (react_1.default.createElement(components_1.BackgroundImage, { src: url, className: b('background', { 'full-width-media': fullWidthMedia }), imageClassName: b('background-img'), style: { backgroundColor: fullWidth ? 'none' : color }, disableCompress: disableCompress }));
17
+ return (0, guards_1.headerHasMediaBackground)(background) ? (react_1.default.createElement(components_1.BackgroundMedia, Object.assign({}, background, { mediaClassName: b('background-media'), className: b('background', { media: true, 'full-width-media': fullWidthMedia }) }))) : (react_1.default.createElement(components_1.BackgroundImage, { src: url, className: b('background', { 'full-width-media': fullWidthMedia }), imageClassName: b('background-img'), style: { backgroundColor: fullWidth ? 'none' : color }, disableCompress: disableCompress }));
18
18
  };
19
19
  const FullWidthBackground = ({ background }) => (react_1.default.createElement("div", { className: b('background', { ['full-width']: true }), style: { backgroundColor: background === null || background === void 0 ? void 0 : background.color } }));
20
20
  const HeaderBlock = (props) => {
@@ -1,6 +1,7 @@
1
1
  import { MediaProps, Animatable } from '../../models';
2
2
  export interface FullProps extends MediaProps, Animatable {
3
3
  className?: string;
4
+ mediaClassName?: string;
4
5
  }
5
- declare const BackgroundMedia: ({ className, color, animated, parallax, video, ...props }: FullProps) => JSX.Element;
6
+ declare const BackgroundMedia: ({ className, color, animated, parallax, video, mediaClassName, ...props }: FullProps) => JSX.Element;
6
7
  export default BackgroundMedia;
@@ -8,10 +8,10 @@ const AnimateBlock_1 = (0, tslib_1.__importDefault)(require("../AnimateBlock/Ani
8
8
  const mobileContext_1 = require("../../context/mobileContext");
9
9
  const b = (0, utils_1.block)('BackgroundMedia');
10
10
  const BackgroundMedia = (_a) => {
11
- var { className, color, animated, parallax = true, video } = _a, props = (0, tslib_1.__rest)(_a, ["className", "color", "animated", "parallax", "video"]);
11
+ var { className, color, animated, parallax = true, video, mediaClassName } = _a, props = (0, tslib_1.__rest)(_a, ["className", "color", "animated", "parallax", "video", "mediaClassName"]);
12
12
  const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
13
13
  return (react_1.default.createElement(AnimateBlock_1.default, { className: b(null, className), style: { backgroundColor: color }, animate: animated },
14
- react_1.default.createElement(Media_1.default, Object.assign({ className: b('media'), imageClassName: b('image'), videoClassName: b('video'), isBackground: true }, Object.assign({ height: 720, color,
14
+ react_1.default.createElement(Media_1.default, Object.assign({ className: b('media', mediaClassName), imageClassName: b('image'), videoClassName: b('video'), isBackground: true }, Object.assign({ height: 720, color,
15
15
  parallax, video: isMobile ? undefined : video }, props)))));
16
16
  };
17
17
  exports.default = BackgroundMedia;
@@ -28,11 +28,13 @@ unpredictable css rules order in build */
28
28
  unpredictable css rules order in build */
29
29
  .yfm_constructor {
30
30
  font-family: var(--yc-font-family-sans);
31
+ color: var(--yc-color-text-primary);
31
32
  }
32
33
  .yfm_constructor code,
33
34
  .yfm_constructor kbd,
34
35
  .yfm_constructor pre {
35
36
  font-family: var(--yc-font-family-monospace);
37
+ color: var(--yc-color-text-primary);
36
38
  }
37
39
  .yfm_constructor.yfm_constructor h1,
38
40
  .yfm_constructor.yfm_constructor h2,
@@ -97,6 +99,15 @@ unpredictable css rules order in build */
97
99
  --pc-text-header-color: var(--yc-color-text-link-hover);
98
100
  color: var(--yc-color-text-link-hover);
99
101
  }
102
+ .yfm_constructor table {
103
+ color: var(--yc-color-text-primary);
104
+ border: 1px solid var(--yc-color-line-generic);
105
+ background: var(--yc-color-base-background);
106
+ }
107
+ .yfm_constructor thead,
108
+ .yfm_constructor table tr:nth-child(2n) {
109
+ background-color: var(--yc-color-base-generic);
110
+ }
100
111
 
101
112
  .yfm_constructor_table table {
102
113
  border: 0;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ShouldRenderBlock, CustomConfig, PageContent, CustomItems } from '../../models';
3
3
  import { blockMap, subBlockMap } from '../../constructor-items';
4
+ import '@doc-tools/transform/dist/js/yfm';
4
5
  export declare type ItemMap = typeof blockMap & typeof subBlockMap & CustomItems;
5
6
  export interface PageConstructorProps {
6
7
  content?: PageContent;
@@ -15,6 +15,7 @@ const ConstructorRow_1 = require("./components/ConstructorRow");
15
15
  const ConstructorFootnotes_1 = require("./components/ConstructorFootnotes");
16
16
  const ConstructorItem_1 = require("./components/ConstructorItem");
17
17
  const ConstructorBlocks_1 = require("./components/ConstructorBlocks");
18
+ require("@doc-tools/transform/dist/js/yfm");
18
19
  const b = (0, utils_1.block)('page-constructor');
19
20
  const Constructor = (props) => {
20
21
  const { context, headerBlockTypes } = (0, react_1.useMemo)(() => {
@@ -48,7 +48,6 @@ function getColClass(params) {
48
48
  const { className = '', sizes, offsets, orders, hidden, visible, alignSelf, justifyContent, reset, } = params;
49
49
  return [
50
50
  types_1.GridColumnClassPrefix.Col,
51
- className,
52
51
  alignSelf,
53
52
  justifyContent && getJustifyClass(justifyContent),
54
53
  sizes && getSizeClass(sizes),
@@ -57,6 +56,7 @@ function getColClass(params) {
57
56
  hidden && getVisibilityClasses(hidden, types_1.GridColumnVisibilityClass.None),
58
57
  visible && getVisibilityClasses(visible, types_1.GridColumnVisibilityClass.Block),
59
58
  reset && getResetClass(),
59
+ className,
60
60
  ]
61
61
  .filter(Boolean)
62
62
  .join(' ');
@@ -6,6 +6,11 @@
6
6
 
7
7
  /* use this for style redefinitions to awoid problems with
8
8
  unpredictable css rules order in build */
9
+ .pc-content__notice .yfm ol,
10
+ .pc-content__notice .yfm ul, .pc-content__text .yfm ol,
11
+ .pc-content__text .yfm ul {
12
+ padding-left: 1.4em;
13
+ }
9
14
  .pc-content__notice.pc-content__notice .yfm,
10
15
  .pc-content__notice.pc-content__notice .yfm > * {
11
16
  color: var(--yc-color-text-secondary);
@@ -30,10 +35,11 @@ unpredictable css rules order in build */
30
35
  display: inline-block;
31
36
  margin-right: 32px;
32
37
  }
33
- .pc-content_centered {
38
+ .pc-content_centered.pc-content_centered {
34
39
  margin: 0 auto;
35
40
  text-align: center;
36
41
  }
42
+
37
43
  .pc-content_centered .pc-content__link a {
38
44
  justify-content: center;
39
45
  }
@@ -26,9 +26,6 @@ unpredictable css rules order in build */
26
26
  margin-left: auto;
27
27
  margin-right: auto;
28
28
  }
29
- .pc-content-layout-block__files_centered .pc-content-layout-block__file {
30
- justify-content: center;
31
- }
32
29
  .pc-content-layout-block__files a {
33
30
  text-decoration: none;
34
31
  }
@@ -22,7 +22,7 @@ unpredictable css rules order in build */
22
22
  }
23
23
  .pc-header-block__content_theme_dark .pc-header-block__title,
24
24
  .pc-header-block__content_theme_dark .pc-header-block__description .yfm,
25
- .pc-header-block__content_theme_dark .pc-header-block__description .yfm > * {
25
+ .pc-header-block__content_theme_dark .pc-header-block__description .yfm * {
26
26
  color: var(--yc-color-text-light-primary);
27
27
  }
28
28
  .pc-header-block__content_vertical-offset {
@@ -141,6 +141,14 @@ unpredictable css rules order in build */
141
141
  .pc-header-block__background.pc-header-block__background_full-width-media > div, .pc-header-block__background.pc-header-block__background_media.pc-header-block__background_full-width-media > div {
142
142
  max-width: none;
143
143
  }
144
+ .pc-header-block__background.pc-header-block__background_full-width-media .pc-header-block__background-media, .pc-header-block__background.pc-header-block__background_media.pc-header-block__background_full-width-media .pc-header-block__background-media {
145
+ height: 100%;
146
+ }
147
+ .pc-header-block__background.pc-header-block__background_full-width-media video, .pc-header-block__background.pc-header-block__background_media.pc-header-block__background_full-width-media video {
148
+ height: 100%;
149
+ width: 100%;
150
+ object-fit: cover;
151
+ }
144
152
  .pc-header-block__background_full-width-media {
145
153
  --pc-border-radius: 0;
146
154
  }
@@ -11,7 +11,7 @@ import './Header.css';
11
11
  const b = block('header-block');
12
12
  const Background = ({ background }) => {
13
13
  const { url, color, disableCompress, fullWidth, fullWidthMedia } = background;
14
- return headerHasMediaBackground(background) ? (React.createElement(BackgroundMedia, Object.assign({}, background, { className: b('background', { media: true, 'full-width-media': fullWidthMedia }) }))) : (React.createElement(BackgroundImage, { src: url, className: b('background', { 'full-width-media': fullWidthMedia }), imageClassName: b('background-img'), style: { backgroundColor: fullWidth ? 'none' : color }, disableCompress: disableCompress }));
14
+ return headerHasMediaBackground(background) ? (React.createElement(BackgroundMedia, Object.assign({}, background, { mediaClassName: b('background-media'), className: b('background', { media: true, 'full-width-media': fullWidthMedia }) }))) : (React.createElement(BackgroundImage, { src: url, className: b('background', { 'full-width-media': fullWidthMedia }), imageClassName: b('background-img'), style: { backgroundColor: fullWidth ? 'none' : color }, disableCompress: disableCompress }));
15
15
  };
16
16
  const FullWidthBackground = ({ background }) => (React.createElement("div", { className: b('background', { ['full-width']: true }), style: { backgroundColor: background === null || background === void 0 ? void 0 : background.color } }));
17
17
  export const HeaderBlock = (props) => {
@@ -2,6 +2,7 @@ import { MediaProps, Animatable } from '../../models';
2
2
  import './BackgroundMedia.css';
3
3
  export interface FullProps extends MediaProps, Animatable {
4
4
  className?: string;
5
+ mediaClassName?: string;
5
6
  }
6
- declare const BackgroundMedia: ({ className, color, animated, parallax, video, ...props }: FullProps) => JSX.Element;
7
+ declare const BackgroundMedia: ({ className, color, animated, parallax, video, mediaClassName, ...props }: FullProps) => JSX.Element;
7
8
  export default BackgroundMedia;
@@ -7,10 +7,10 @@ import { MobileContext } from '../../context/mobileContext';
7
7
  import './BackgroundMedia.css';
8
8
  const b = block('BackgroundMedia');
9
9
  const BackgroundMedia = (_a) => {
10
- var { className, color, animated, parallax = true, video } = _a, props = __rest(_a, ["className", "color", "animated", "parallax", "video"]);
10
+ var { className, color, animated, parallax = true, video, mediaClassName } = _a, props = __rest(_a, ["className", "color", "animated", "parallax", "video", "mediaClassName"]);
11
11
  const isMobile = useContext(MobileContext);
12
12
  return (React.createElement(AnimateBlock, { className: b(null, className), style: { backgroundColor: color }, animate: animated },
13
- React.createElement(Media, Object.assign({ className: b('media'), imageClassName: b('image'), videoClassName: b('video'), isBackground: true }, Object.assign({ height: 720, color,
13
+ React.createElement(Media, Object.assign({ className: b('media', mediaClassName), imageClassName: b('image'), videoClassName: b('video'), isBackground: true }, Object.assign({ height: 720, color,
14
14
  parallax, video: isMobile ? undefined : video }, props)))));
15
15
  };
16
16
  export default BackgroundMedia;
@@ -28,11 +28,13 @@ unpredictable css rules order in build */
28
28
  unpredictable css rules order in build */
29
29
  .yfm_constructor {
30
30
  font-family: var(--yc-font-family-sans);
31
+ color: var(--yc-color-text-primary);
31
32
  }
32
33
  .yfm_constructor code,
33
34
  .yfm_constructor kbd,
34
35
  .yfm_constructor pre {
35
36
  font-family: var(--yc-font-family-monospace);
37
+ color: var(--yc-color-text-primary);
36
38
  }
37
39
  .yfm_constructor.yfm_constructor h1,
38
40
  .yfm_constructor.yfm_constructor h2,
@@ -97,6 +99,15 @@ unpredictable css rules order in build */
97
99
  --pc-text-header-color: var(--yc-color-text-link-hover);
98
100
  color: var(--yc-color-text-link-hover);
99
101
  }
102
+ .yfm_constructor table {
103
+ color: var(--yc-color-text-primary);
104
+ border: 1px solid var(--yc-color-line-generic);
105
+ background: var(--yc-color-base-background);
106
+ }
107
+ .yfm_constructor thead,
108
+ .yfm_constructor table tr:nth-child(2n) {
109
+ background-color: var(--yc-color-base-generic);
110
+ }
100
111
 
101
112
  .yfm_constructor_table table {
102
113
  border: 0;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ShouldRenderBlock, CustomConfig, PageContent, CustomItems } from '../../models';
3
3
  import { blockMap, subBlockMap } from '../../constructor-items';
4
+ import '@doc-tools/transform/dist/js/yfm';
4
5
  import './PageConstructor.css';
5
6
  export declare type ItemMap = typeof blockMap & typeof subBlockMap & CustomItems;
6
7
  export interface PageConstructorProps {
@@ -12,6 +12,7 @@ import { ConstructorRow } from './components/ConstructorRow';
12
12
  import { ConstructorFootnotes } from './components/ConstructorFootnotes';
13
13
  import { ConstructorHeader } from './components/ConstructorItem';
14
14
  import { ConstructorBlocks } from './components/ConstructorBlocks';
15
+ import '@doc-tools/transform/dist/js/yfm';
15
16
  import './PageConstructor.css';
16
17
  const b = cnBlock('page-constructor');
17
18
  export const Constructor = (props) => {
@@ -38,7 +38,6 @@ export function getColClass(params) {
38
38
  const { className = '', sizes, offsets, orders, hidden, visible, alignSelf, justifyContent, reset, } = params;
39
39
  return [
40
40
  GridColumnClassPrefix.Col,
41
- className,
42
41
  alignSelf,
43
42
  justifyContent && getJustifyClass(justifyContent),
44
43
  sizes && getSizeClass(sizes),
@@ -47,6 +46,7 @@ export function getColClass(params) {
47
46
  hidden && getVisibilityClasses(hidden, GridColumnVisibilityClass.None),
48
47
  visible && getVisibilityClasses(visible, GridColumnVisibilityClass.Block),
49
48
  reset && getResetClass(),
49
+ className,
50
50
  ]
51
51
  .filter(Boolean)
52
52
  .join(' ');
@@ -6,6 +6,11 @@
6
6
 
7
7
  /* use this for style redefinitions to awoid problems with
8
8
  unpredictable css rules order in build */
9
+ .pc-content__notice .yfm ol,
10
+ .pc-content__notice .yfm ul, .pc-content__text .yfm ol,
11
+ .pc-content__text .yfm ul {
12
+ padding-left: 1.4em;
13
+ }
9
14
  .pc-content__notice.pc-content__notice .yfm,
10
15
  .pc-content__notice.pc-content__notice .yfm > * {
11
16
  color: var(--yc-color-text-secondary);
@@ -30,10 +35,11 @@ unpredictable css rules order in build */
30
35
  display: inline-block;
31
36
  margin-right: 32px;
32
37
  }
33
- .pc-content_centered {
38
+ .pc-content_centered.pc-content_centered {
34
39
  margin: 0 auto;
35
40
  text-align: center;
36
41
  }
42
+
37
43
  .pc-content_centered .pc-content__link a {
38
44
  justify-content: center;
39
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
package/styles/styles.css CHANGED
@@ -203,11 +203,13 @@ unpredictable css rules order in build */
203
203
  unpredictable css rules order in build */
204
204
  .yfm_constructor {
205
205
  font-family: var(--yc-font-family-sans);
206
+ color: var(--yc-color-text-primary);
206
207
  }
207
208
  .yfm_constructor code,
208
209
  .yfm_constructor kbd,
209
210
  .yfm_constructor pre {
210
211
  font-family: var(--yc-font-family-monospace);
212
+ color: var(--yc-color-text-primary);
211
213
  }
212
214
  .yfm_constructor.yfm_constructor h1,
213
215
  .yfm_constructor.yfm_constructor h2,
@@ -272,6 +274,15 @@ unpredictable css rules order in build */
272
274
  --pc-text-header-color: var(--yc-color-text-link-hover);
273
275
  color: var(--yc-color-text-link-hover);
274
276
  }
277
+ .yfm_constructor table {
278
+ color: var(--yc-color-text-primary);
279
+ border: 1px solid var(--yc-color-line-generic);
280
+ background: var(--yc-color-base-background);
281
+ }
282
+ .yfm_constructor thead,
283
+ .yfm_constructor table tr:nth-child(2n) {
284
+ background-color: var(--yc-color-base-generic);
285
+ }
275
286
 
276
287
  .yfm_constructor_table table {
277
288
  border: 0;
package/styles/yfm.scss CHANGED
@@ -5,11 +5,13 @@
5
5
  .yfm_constructor {
6
6
  $block: &;
7
7
  font-family: var(--yc-font-family-sans);
8
+ color: var(--yc-color-text-primary);
8
9
 
9
10
  code,
10
11
  kbd,
11
12
  pre {
12
13
  font-family: var(--yc-font-family-monospace);
14
+ color: var(--yc-color-text-primary);
13
15
  }
14
16
 
15
17
  @include add-specificity(&) {
@@ -80,6 +82,17 @@
80
82
  a {
81
83
  @include link();
82
84
  }
85
+
86
+ table {
87
+ color: var(--yc-color-text-primary);
88
+ border: 1px solid var(--yc-color-line-generic);
89
+ background: var(--yc-color-base-background);
90
+ }
91
+
92
+ thead,
93
+ table tr:nth-child(2n) {
94
+ background-color: var(--yc-color-base-generic);
95
+ }
83
96
  }
84
97
 
85
98
  .yfm_constructor_table {