@gravity-ui/page-constructor 8.15.0 → 8.16.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.
Files changed (40) hide show
  1. package/README.md +31 -9
  2. package/build/docs/INDEX.md +191 -0
  3. package/build/docs/blocks/Banner.md +59 -0
  4. package/build/docs/blocks/CardLayout.md +79 -0
  5. package/build/docs/blocks/Companies.md +67 -0
  6. package/build/docs/blocks/ContentLayout.md +54 -0
  7. package/build/docs/blocks/ExtendedFeatures.md +74 -0
  8. package/build/docs/blocks/FilterBlock.md +112 -0
  9. package/build/docs/blocks/FoldableList.md +78 -0
  10. package/build/docs/blocks/Footer.md +110 -0
  11. package/build/docs/blocks/Form.md +89 -0
  12. package/build/docs/blocks/Header.md +70 -0
  13. package/build/docs/blocks/HeaderSlider.md +70 -0
  14. package/build/docs/blocks/Hero.md +67 -0
  15. package/build/docs/blocks/Icons.md +61 -0
  16. package/build/docs/blocks/Info.md +73 -0
  17. package/build/docs/blocks/Map.md +81 -0
  18. package/build/docs/blocks/Media.md +63 -0
  19. package/build/docs/blocks/PromoFeaturesBlock.md +74 -0
  20. package/build/docs/blocks/Questions.md +78 -0
  21. package/build/docs/blocks/Share.md +45 -0
  22. package/build/docs/blocks/Slider.md +89 -0
  23. package/build/docs/blocks/SliderOld.md +63 -0
  24. package/build/docs/blocks/Table.md +64 -0
  25. package/build/docs/blocks/Tabs.md +92 -0
  26. package/build/docs/guides/data-preparation-ru.md +257 -0
  27. package/build/docs/guides/data-preparation.md +259 -0
  28. package/build/docs/sub-blocks/BackgroundCard.md +63 -0
  29. package/build/docs/sub-blocks/BannerCard.md +57 -0
  30. package/build/docs/sub-blocks/BasicCard.md +60 -0
  31. package/build/docs/sub-blocks/Content.md +58 -0
  32. package/build/docs/sub-blocks/Divider.md +47 -0
  33. package/build/docs/sub-blocks/HubspotForm.md +47 -0
  34. package/build/docs/sub-blocks/ImageCard.md +59 -0
  35. package/build/docs/sub-blocks/LayoutItem.md +70 -0
  36. package/build/docs/sub-blocks/MediaCard.md +66 -0
  37. package/build/docs/sub-blocks/PriceCard.md +60 -0
  38. package/build/docs/sub-blocks/PriceDetailed.md +74 -0
  39. package/build/docs/sub-blocks/Quote.md +74 -0
  40. package/package.json +3 -2
package/README.md CHANGED
@@ -582,17 +582,39 @@ The Memory Bank is located in the `memory-bank/` directory and consists of regul
582
582
  - `usage/` - Component-specific usage documentation
583
583
  - `storybookComponents.md` - Storybook integration details
584
584
 
585
- ### For AI Agents
585
+ ## Tests
586
586
 
587
- When working with AI agents on this project, the Memory Bank serves as a comprehensive knowledge base that helps agents understand:
587
+ Comprehensive documentation is available at the provided [link](./test-utils/docs/README.md).
588
588
 
589
- - Project structure and patterns
590
- - Component APIs and usage examples
591
- - Development workflows and best practices
592
- - Current implementation status and next steps
589
+ ## License
593
590
 
594
- AI agents can read these files to quickly get up to speed with the project context and make more informed decisions about code changes and implementations.
591
+ Distributed under the MIT License. See [LICENSE](LICENSE) for details.
595
592
 
596
- ## Tests
593
+ ## For AI agents
597
594
 
598
- Comprehensive documentation is available at the provided [link](./test-utils/docs/README.md).
595
+ A library for rendering whole web pages or page sections from declarative JSON/YAML config, using a set of ready-made, orderable blocks — reach for it to build marketing/landing pages, not general application UI.
596
+
597
+ ### When to use
598
+
599
+ - Data-driven pages: render a `content` config of typed blocks with `PageConstructor` wrapped in `PageConstructorProvider`.
600
+ - Marketing, landing, and documentation pages assembled from prebuilt blocks (headers, media, cards, etc.).
601
+ - Server-side YFM processing of block text via the `@gravity-ui/page-constructor/server` utilities (`contentTransformer`, `fullTransform`).
602
+ - Reusing just the responsive grid (`Grid`/`Row`/`Col`) or `Navigation` component standalone.
603
+
604
+ ### When not to use
605
+
606
+ - General application UI (buttons, forms, modals) — use [`@gravity-ui/uikit`](https://github.com/gravity-ui/uikit).
607
+ - Editing Markdown/YFM content — use [`@gravity-ui/markdown-editor`](https://github.com/gravity-ui/markdown-editor).
608
+ - App navigation shells (aside header) — use [`@gravity-ui/navigation`](https://github.com/gravity-ui/navigation); this package's `Navigation` is a page-level top nav.
609
+
610
+ ### Common pitfalls
611
+
612
+ - **`PageConstructor` must be wrapped in `PageConstructorProvider`.** Rendering it bare breaks context (locale, theme, SSR, analytics).
613
+ - **The content prop is `content`, shaped `{blocks: [...]}`.** Each block object needs a `type` matching a known block plus its data fields; there is no `data`/`config` prop.
614
+ - **YFM in block text needs server processing.** Markdown-like fields render as plain text unless you run content through `contentTransformer`/`fullTransform` from `@gravity-ui/page-constructor/server`; `@diplodoc/transform` is a required peer dependency.
615
+ - **Import the SCSS styles.** Add `@gravity-ui/page-constructor/styles/styles.scss` (SCSS, not CSS); custom blocks import the same file to reuse mixins/variables.
616
+ - **Vite needs `vite-plugin-dynamic-import`.** Dynamic block imports fail under Vite without it.
617
+
618
+ ## Documentation for AI agents
619
+
620
+ Agent-readable documentation for the installed version is located in `node_modules/@gravity-ui/page-constructor/build/docs/INDEX.md`.
@@ -0,0 +1,191 @@
1
+ # @gravity-ui/page-constructor documentation
2
+
3
+ Documentation for the **installed** version of `@gravity-ui/page-constructor`.
4
+ Your training data may be outdated — these files are the source of truth.
5
+
6
+ Paths are relative to this file (`node_modules/@gravity-ui/page-constructor/build/docs/`).
7
+
8
+ ## For AI agents
9
+
10
+ A library for rendering whole web pages or page sections from declarative JSON/YAML config, using a set of ready-made, orderable blocks — reach for it to build marketing/landing pages, not general application UI.
11
+
12
+ ### When to use
13
+
14
+ - Data-driven pages: render a `content` config of typed blocks with `PageConstructor` wrapped in `PageConstructorProvider`.
15
+ - Marketing, landing, and documentation pages assembled from prebuilt blocks (headers, media, cards, etc.).
16
+ - Server-side YFM processing of block text via the `@gravity-ui/page-constructor/server` utilities (`contentTransformer`, `fullTransform`).
17
+ - Reusing just the responsive grid (`Grid`/`Row`/`Col`) or `Navigation` component standalone.
18
+
19
+ ### When not to use
20
+
21
+ - General application UI (buttons, forms, modals) — use [`@gravity-ui/uikit`](https://github.com/gravity-ui/uikit).
22
+ - Editing Markdown/YFM content — use [`@gravity-ui/markdown-editor`](https://github.com/gravity-ui/markdown-editor).
23
+ - App navigation shells (aside header) — use [`@gravity-ui/navigation`](https://github.com/gravity-ui/navigation); this package's `Navigation` is a page-level top nav.
24
+
25
+ ### Common pitfalls
26
+
27
+ - **`PageConstructor` must be wrapped in `PageConstructorProvider`.** Rendering it bare breaks context (locale, theme, SSR, analytics).
28
+ - **The content prop is `content`, shaped `{blocks: [...]}`.** Each block object needs a `type` matching a known block plus its data fields; there is no `data`/`config` prop.
29
+ - **YFM in block text needs server processing.** Markdown-like fields render as plain text unless you run content through `contentTransformer`/`fullTransform` from `@gravity-ui/page-constructor/server`; `@diplodoc/transform` is a required peer dependency.
30
+ - **Import the SCSS styles.** Add `@gravity-ui/page-constructor/styles/styles.scss` (SCSS, not CSS); custom blocks import the same file to reuse mixins/variables.
31
+ - **Vite needs `vite-plugin-dynamic-import`.** Dynamic block imports fail under Vite without it.
32
+
33
+ ## Install
34
+
35
+ ```shell
36
+ npm install @gravity-ui/page-constructor
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ First, we need a React project and some kind of server. For example, you can create a React project using Vite and an Express server, or you can create Next.js application - it will have a client and server side at once.
42
+
43
+ Install the required dependencies:
44
+
45
+ ```shell
46
+ npm install @gravity-ui/page-constructor @diplodoc/transform @gravity-ui/uikit
47
+ ```
48
+
49
+ Insert the `Page Constructor` to the page. To work correctly, it must be wrapped in a `PageConstructorProvider`:
50
+
51
+ ```tsx
52
+ import {PageConstructor, PageConstructorProvider} from '@gravity-ui/page-constructor';
53
+ import '@gravity-ui/page-constructor/styles/styles.scss';
54
+
55
+ const App = () => {
56
+ const content = {
57
+ blocks: [
58
+ {
59
+ type: 'header-block',
60
+ title: 'Hello world',
61
+ background: {color: '#f0f0f0'},
62
+ description:
63
+ '**Congratulations!** Have you built a [page-constructor](https://github.com/gravity-ui/page-constructor) into your website',
64
+ },
65
+ ],
66
+ };
67
+
68
+ return (
69
+ <PageConstructorProvider>
70
+ <PageConstructor content={content} />
71
+ </PageConstructorProvider>
72
+ );
73
+ };
74
+
75
+ export default App;
76
+ ```
77
+
78
+ This was the simplest example of a connection. In order for YFM markup to work, you need to process content on the server and receive it on the client.
79
+
80
+ If your server is a separate application, then you need to install page-constructor:
81
+
82
+ ```shell
83
+ npm install @gravity-ui/page-constructor
84
+ ```
85
+
86
+ To process YFM in all base blocks, call the `contentTransformer` and pass the content and options there:
87
+
88
+ ```ts
89
+ const express = require('express');
90
+ const app = express();
91
+ const {contentTransformer} = require('@gravity-ui/page-constructor/server');
92
+
93
+ const content = {
94
+ blocks: [
95
+ {
96
+ type: 'header-block',
97
+ title: 'Hello world',
98
+ background: {color: '#f0f0f0'},
99
+ description:
100
+ '**Congratulations!** Have you built a [page-constructor](https://github.com/gravity-ui/page-constructor) into your website',
101
+ },
102
+ ],
103
+ };
104
+
105
+ app.get('/content', (req, res) => {
106
+ res.send({content: contentTransformer({content, options: {lang: 'en'}})});
107
+ });
108
+
109
+ app.listen(3000);
110
+ ```
111
+
112
+ On the client, add an endpoint call to receive content:
113
+
114
+ ```tsx
115
+ import {PageConstructor, PageConstructorProvider} from '@gravity-ui/page-constructor';
116
+ import '@gravity-ui/page-constructor/styles/styles.scss';
117
+ import {useEffect, useState} from 'react';
118
+
119
+ const App = () => {
120
+ const [content, setContent] = useState();
121
+
122
+ useEffect(() => {
123
+ (async () => {
124
+ const response = await fetch('http://localhost:3000/content').then((r) => r.json());
125
+ setContent(response.content);
126
+ })();
127
+ }, []);
128
+
129
+ return (
130
+ <PageConstructorProvider>
131
+ <PageConstructor content={content} />
132
+ </PageConstructorProvider>
133
+ );
134
+ };
135
+
136
+ export default App;
137
+ ```
138
+
139
+ ### Ready-made template
140
+
141
+ To start a new project, you can use the [ready-made template on Next.js ](https://github.com/gravity-ui/page-constructor-website-template) which we have prepared.
142
+
143
+ ### Static site builder
144
+
145
+ [Page Constructor Builder](https://github.com/gravity-ui/page-constructor-builder) - command-line utility for building static pages from YAML configurations using the @gravity-ui/page-constructor
146
+
147
+ ## Guides
148
+
149
+ - [Data preparation](./guides/data-preparation.md) — This chapter provides documentaion for server utilities for transforming content, including Yandex Flavored Markdown (YFM) to HTML conversion and text processing. Key features include:
150
+ - [Подготовка данных](./guides/data-preparation-ru.md) — Документацию по серверным утилитам для преобразования контента, включая конвертацию Yandex Flavored Markdown (YFM) в HTML и обработку текста. Основные возможности:
151
+
152
+ ## Blocks
153
+
154
+ - [Banner](./blocks/Banner.md) — Renders a compact promotional card with a title, subtitle, an optional background image or color, and a single call-to-action button. Use it to highlight a feature, announce a release, or drive traffic to a landing page from anywhere in the page flow.
155
+ - [CardLayout](./blocks/CardLayout.md) — Renders a responsive grid of arbitrary cards (children) with an optional header and a decorative background image. Use it whenever you need to lay out a homogeneous set of cards — basic, image, background, price, or layout-item — in a row that adapts to the viewport.
156
+ - [Companies](./blocks/Companies.md) — Renders a heading with a logo strip — a set of responsive images (desktop / tablet / mobile) shown beneath an optional title and description. Use it for "trusted by" or "powered by" logo rows that must adapt per device and theme.
157
+ - [ContentLayout](./blocks/ContentLayout.md) — Renders a single-column content section (title, body text, optional list, links, and buttons) paired with an optional list of downloadable files and a background. Use it for documentation-style sections, terms, descriptions, or anywhere a focused block of text with file attachments is needed.
158
+ - [ExtendedFeatures](./blocks/ExtendedFeatures.md) — Renders a responsive grid of feature cards, each with an icon, title, text, an optional label (New / Preview), and an optional link. Use it to present a list of product features, capabilities, or benefits in a compact, icon-driven layout.
159
+ - [FilterBlock](./blocks/FilterBlock.md) — Renders a set of cards grouped by tags, with a row of toggle buttons that lets the visitor filter the visible cards by tag. Use it to present a catalog of cards (articles, features, products) that the user can narrow down without leaving the page.
160
+ - [FoldableList](./blocks/FoldableList.md) — Renders a two-column block: a content panel on the left (title, text, links, buttons) and a list of collapsible items on the right, each with its own title, YFM text, and optional link. Use it for FAQ-style or specification pages where each row expands to reveal more detail.
161
+ - [Footer](./blocks/Footer.md) — A configurable page footer assembled from optional floors: navigation columns, contacts (social icons), disclaimer, copyright (legal links, language switcher, logo), and an attribution strip.
162
+ - [Form](./blocks/Form.md) — A two-column block that renders a third-party form (Yandex Forms or HubSpot) alongside optional YFM text content, with a configurable layout direction and background.
163
+ - [Header](./blocks/Header.md) — Renders a full-width page header with a title, optional overtitle/description, call-to-action buttons, breadcrumbs, and an optional media asset (image, video, or video iframe) positioned to the right or centered. Use it as the primary hero/landing block at the top of a page.
164
+ - [HeaderSlider](./blocks/HeaderSlider.md) — Renders a carousel of full-bleed header-block slides — each slide carries its own title, description, buttons, and background media. Use it when the top of the page needs to rotate multiple equally important campaigns or announcements instead of a single hero.
165
+ - [Hero](./blocks/Hero.md) — Renders a modern, content-driven hero block: an overtitle, a rich content column (title, body text, list, links, buttons) and a media column (image/video/iframe) that adapts to its intrinsic aspect ratio. Use it as the primary landing block when you want more layout flexibility than the classic Header provides.
166
+ - [Icons](./blocks/Icons.md) — Renders a responsive grid of small icon items, each consisting of an image and a caption. Items can optionally be wrapped in links, turning the grid into a navigable set of icon links.
167
+ - [Info](./blocks/Info.md) — Renders a two-column information section: a left content column and a right content column, each with its own title, text, lists, buttons, and links, placed inside an optional themed background container.
168
+ - [Map](./blocks/Map.md) — A media-and-content block that embeds an interactive Yandex Map inside a card, paired with an optional title, description, links, and buttons.
169
+ - [Media](./blocks/Media.md) — Renders a two-column layout that pairs a content column (title, body, list, links, button) with a media column (image, video, YouTube, iframe, or DataLens embed). Use it for feature or explainer sections where text and a rich media asset need to sit side by side.
170
+ - [PromoFeaturesBlock](./blocks/PromoFeaturesBlock.md) — Renders a masonry layout of promotional feature cards, each pairing a title, YFM text, and an optional media asset, displayed against a full-width background. Use it for marketing sections that showcase several value propositions with rich imagery in a non-uniform grid.
171
+ - [Questions](./blocks/Questions.md) — Renders an FAQ block: a left content panel (title, text, links, buttons) and a list of expandable question/answer rows on the right. Automatically emits FAQPage JSON-LD microdata so search engines can index the answers as rich results.
172
+ - [Share](./blocks/Share.md) — Renders a row of social-network share buttons that share the current page URL.
173
+ - [Slider](./blocks/Slider.md) — A carousel block that renders any number of child cards as swipeable slides, with optional title, description, dots, arrows, autoplay, and per-breakpoint slide counts. Built on top of Swiper.
174
+ - [SliderOld](./blocks/SliderOld.md)
175
+ - [Table](./blocks/Table.md) — Renders a title followed by a comparison-style table whose cells are plain strings or numbers. A legend column can be marked with disk or tick markers, and an optional legend list explains the marked columns.
176
+ - [Tabs](./blocks/Tabs.md) — Renders a set of tab buttons that switch between rich content panels. Each tab panel pairs a content column (title, text, lists, buttons, links) with an optional media column (image, video, YouTube, iframe, DataLens), with control over column order, sizing, and border treatment.
177
+
178
+ ## Sub-blocks
179
+
180
+ - [BackgroundCard](./sub-blocks/BackgroundCard.md) — A card that renders text content (title, text, links, buttons, or a content list) over a decorative background image or solid color. Useful for promotional cards inside a card layout.
181
+ - [BannerCard](./sub-blocks/BannerCard.md) — A compact banner card with a title, optional subtitle, a single call-to-action button, and a decorative background image. Designed to draw attention inside a card layout.
182
+ - [BasicCard](./sub-blocks/BasicCard.md) — A general-purpose card with an optional icon (image or Gravity UI icon) and text content (title, text, links, buttons, or a content list). The simplest and most versatile card.
183
+ - [Content](./sub-blocks/Content.md) — A text content block rendering a title, body text, additional info, links, buttons, and/or an icon content list. Used on its own as the textual portion of a content layout.
184
+ - [Divider](./sub-blocks/Divider.md) — A spacing/separator element that adds vertical space between sibling items, optionally drawing a horizontal line. Useful for tuning rhythm inside a layout.
185
+ - [HubspotForm](./sub-blocks/HubspotForm.md) — Embeds a HubSpot form inside a page. Loads the HubSpot scripts on demand and renders the form into a container; emits analytics events on submit and supports default field values and form event handlers.
186
+ - [ImageCard](./sub-blocks/ImageCard.md) — A card pairing a foreground image with text content (title, text, links, buttons, or a content list). The image and content can be ordered in either direction.
187
+ - [LayoutItem](./sub-blocks/LayoutItem.md) — Renders a two-part card: a media area (image, video, YouTube, etc.) stacked above a text content area with optional title, body, buttons, links, list, and meta info. Used as the primary content unit inside card-grid blocks.
188
+ - [MediaCard](./sub-blocks/MediaCard.md) — Wraps a single media element (image, image slider, video, YouTube, iframe, or DataLens) inside a card with an optional border. Pure media card — no text content.
189
+ - [PriceCard](./sub-blocks/PriceCard.md) — Renders a pricing card: a title, a price (with optional period and details), a description, a checklist of features, and optional buttons and links. Typically placed in a grid to compare plans.
190
+ - [PriceDetailed](./sub-blocks/PriceDetailed.md)
191
+ - [Quote](./sub-blocks/Quote.md) — Renders a customer testimonial / quote card: a logo, the quote body, an optional author (name + avatar + description), and an optional CTA button. Paired with a large image on the side.
@@ -0,0 +1,59 @@
1
+ # Banner
2
+
3
+ Renders a compact promotional card with a title, subtitle, an optional background image or color, and a single call-to-action button. Use it to highlight a feature, announce a release, or drive traffic to a landing page from anywhere in the page flow.
4
+
5
+ ## Block type
6
+
7
+ `type: 'banner-block'`
8
+
9
+ ## When to use
10
+
11
+ - Mid-page promotional card with a clear single CTA.
12
+ - When you need a compact, image-rich block that fits alongside other content.
13
+ - As a stand-alone banner or as a card inside grid-based layouts (also registered as `banner-card`).
14
+
15
+ ## Example
16
+
17
+ ```json
18
+ {
19
+ "type": "banner-block",
20
+ "title": "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
21
+ "subtitle": "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.",
22
+ "image": {
23
+ "light": "/images/banner-light.png",
24
+ "dark": "/images/banner-dark.png"
25
+ },
26
+ "color": {"light": "#EFF2F8", "dark": "#262626"},
27
+ "button": {
28
+ "text": "Learn more",
29
+ "url": "https://example.com"
30
+ }
31
+ }
32
+ ```
33
+
34
+ ## Properties
35
+
36
+ | Property | Type | Default | Description |
37
+ | ------------------- | ------------------------- | ------- | ------------------------------------------------------ |
38
+ | `title` _required_ | `string` | — | Banner heading text. |
39
+ | `button` _required_ | `ButtonBlock` | — | Single call-to-action button. Requires `text` + `url`. |
40
+ | `subtitle` | `string` | — | YFM body text rendered under the title. |
41
+ | `image` | `string \| {light, dark}` | — | Background image URL (or themed pair). |
42
+ | `mediaView` | `'fit' \| 'full'` | — | How the background image fits the card. |
43
+ | `disableCompress` | `boolean` | — | Disables image compression for the background. |
44
+ | `color` | `string \| {light, dark}` | — | Background color of the card. |
45
+ | `theme` | `'light' \| 'dark'` | — | Forces a light or dark color scheme. |
46
+ | `width` | `'s' \| 'm' \| 'l'` | — | Card width preset. |
47
+ | `animated` | `boolean` | — | Enables an entrance animation. |
48
+
49
+ ### Common properties
50
+
51
+ Inherits common block properties: `anchor`, `visible`, `indent` (`{top?, bottom?}`), `qa`, `className`, `animated`, `theme` (`'light' | 'dark'`), `when`, `context`. See the root README for details.
52
+
53
+ ## Themed values
54
+
55
+ `image` and `color` each accept either a plain value or a `{light, dark}` object resolved against the active runtime theme.
56
+
57
+ ## Storybook
58
+
59
+ [Banner](https://preview.gravity-ui.com/page-constructor/?path=/docs/blocks-banner--docs)
@@ -0,0 +1,79 @@
1
+ # CardLayout
2
+
3
+ Renders a responsive grid of arbitrary cards (children) with an optional header and a decorative background image. Use it whenever you need to lay out a homogeneous set of cards — basic, image, background, price, or layout-item — in a row that adapts to the viewport.
4
+
5
+ ## Block type
6
+
7
+ `type: 'card-layout-block'`
8
+
9
+ ## When to use
10
+
11
+ - Displaying a set of cards that should reflow across desktop, tablet, and mobile.
12
+ - When you need a title/description above a card row, optionally centered.
13
+ - When the card row needs a decorative background image (with or without a border/shadow).
14
+
15
+ ## Example
16
+
17
+ ```json
18
+ {
19
+ "type": "card-layout-block",
20
+ "title": "Card layout with basic cards",
21
+ "description": "Three cards in a row on the desktop, two cards in a row on a tablet, one card in a row on a mobile phone.",
22
+ "colSizes": {"all": 12, "sm": 6, "md": 4},
23
+ "children": [
24
+ {
25
+ "type": "basic-card",
26
+ "title": "Tell a story and build a narrative",
27
+ "text": "We are all storytellers. Stories are a powerful way to communicate ideas and share information.",
28
+ "icon": "/story-assets/icon_1_light.svg"
29
+ },
30
+ {
31
+ "type": "basic-card",
32
+ "title": "Reach your audience",
33
+ "text": "The right story can lead to a better understanding of a situation, make us laugh, or even inspire us.",
34
+ "icon": "/story-assets/icon_2_light.svg"
35
+ },
36
+ {
37
+ "type": "basic-card",
38
+ "title": "Inspire action",
39
+ "text": "Use a clear narrative to drive your visitors toward the next step.",
40
+ "icon": "/story-assets/icon_3_light.svg"
41
+ }
42
+ ]
43
+ }
44
+ ```
45
+
46
+ ## Properties
47
+
48
+ | Property | Type | Default | Description |
49
+ | ------------- | ------------------------------------------------------------------------ | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
50
+ | `title` | `string \| TitleProps` | — | Block heading (string or Title options). Rendered above the cards. |
51
+ | `description` | `string` | — | YFM subtitle shown under the title. |
52
+ | `colSizes` | `{all?, sm?, md?, lg?, xl?}` (each `number` 1–12) | `{all: 12, sm: 6, md: 4}` | Column width per breakpoint. 12 = full width. |
53
+ | `background` | `ImageBaseObjectProps \| ImageDeviceProps` (each with optional `border`) | — | Decorative background media behind the card row. Supports a `{light, dark}` themed object. `border`: `'none' \| 'shadow' \| 'line'`. |
54
+ | `children` | `CardBlock[]` | — | Array of card sub-blocks to lay out (see _Children / sub-blocks_). |
55
+ | `animated` | `boolean` | — | Enables entrance animation for the block. |
56
+
57
+ ### Common properties
58
+
59
+ Inherits common block properties: `anchor`, `visible`, `indent` (`{top?, bottom?}`), `qa`, `className`, `animated`, `theme` (`'light' | 'dark'`), `when`, `context`. See the root README for details.
60
+
61
+ ## Children / sub-blocks
62
+
63
+ `children` accepts an array of any card sub-block registered under the `cards` definition. The following are commonly used:
64
+
65
+ - `basic-card` — Basic card
66
+ - `image-card` — Image card
67
+ - `background-card` — Background card
68
+ - `price-card` — Price card
69
+ - `layout-item` — Media + content card (used by the `Layout` block)
70
+
71
+ Each child is rendered inside a grid column sized by `colSizes`.
72
+
73
+ ## Themed values
74
+
75
+ `background` (and any themed value on children) accepts either a plain value or a `{light, dark}` object resolved against the active runtime theme.
76
+
77
+ ## Storybook
78
+
79
+ [CardLayout](https://preview.gravity-ui.com/page-constructor/?path=/docs/blocks-cardlayout--docs)
@@ -0,0 +1,67 @@
1
+ # Companies
2
+
3
+ Renders a heading with a logo strip — a set of responsive images (desktop / tablet / mobile) shown beneath an optional title and description. Use it for "trusted by" or "powered by" logo rows that must adapt per device and theme.
4
+
5
+ ## Block type
6
+
7
+ `type: 'companies-block'`
8
+
9
+ ## When to use
10
+
11
+ - Showcasing a row of company or partner logos with per-device artwork.
12
+ - "Trusted by" / "powered by" sections that need light and dark theme variants of the same logos.
13
+ - A compact brand strip paired with a short title and optional YFM description.
14
+
15
+ ## Example
16
+
17
+ ```json
18
+ {
19
+ "type": "companies-block",
20
+ "title": "Page constructor",
21
+ "description": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris.",
22
+ "images": {
23
+ "light": {
24
+ "desktop": "/images/logo-desktop-light.svg",
25
+ "tablet": "/images/logo-tablet-light.svg",
26
+ "mobile": "/images/logo-mobile-light.svg",
27
+ "alt": "Page constructor"
28
+ },
29
+ "dark": {
30
+ "desktop": "/images/logo-desktop-dark.svg",
31
+ "tablet": "/images/logo-tablet-dark.svg",
32
+ "mobile": "/images/logo-mobile-dark.svg",
33
+ "alt": "Page constructor"
34
+ }
35
+ }
36
+ }
37
+ ```
38
+
39
+ ## Properties
40
+
41
+ | Property | Type | Default | Description |
42
+ | ------------------- | ----------------------------------- | ------- | --------------------------------------- |
43
+ | `title` _required_ | `string` | — | Section heading (plain text). |
44
+ | `images` _required_ | `ImageDeviceProps \| {light, dark}` | — | Responsive logo set. See below. |
45
+ | `description` | `string` | — | YFM body text rendered under the title. |
46
+ | `animated` | `boolean` | — | Enables an entrance animation. |
47
+
48
+ ### `images`
49
+
50
+ | Property | Type | Default | Description |
51
+ | -------------------- | -------- | ------- | ---------------------------------------- |
52
+ | `desktop` _required_ | `string` | — | Image URL for desktop viewports. |
53
+ | `tablet` _required_ | `string` | — | Image URL for tablet viewports. |
54
+ | `mobile` _required_ | `string` | — | Image URL for mobile viewports. |
55
+ | `alt` | `string` | — | Alternative text for the rendered image. |
56
+
57
+ ### Common properties
58
+
59
+ Inherits: `when`, `animated`. See the root README for details. (This block does not expose `anchor`, `visible`, `indent`, `theme`, or `context`.)
60
+
61
+ ## Themed values
62
+
63
+ `images` accepts either a plain `ImageDeviceProps` object or a `{light, dark}` object resolved against the active runtime theme.
64
+
65
+ ## Storybook
66
+
67
+ [Companies](https://preview.gravity-ui.com/page-constructor/?path=/docs/blocks-companies--docs)
@@ -0,0 +1,54 @@
1
+ # ContentLayout
2
+
3
+ Renders a single-column content section (title, body text, optional list, links, and buttons) paired with an optional list of downloadable files and a background. Use it for documentation-style sections, terms, descriptions, or anywhere a focused block of text with file attachments is needed.
4
+
5
+ ## Block type
6
+
7
+ `type: 'content-layout-block'`
8
+
9
+ ## When to use
10
+
11
+ - Documentation, "about", legal, or descriptive sections where text is the main asset.
12
+ - When you need a list of attached files (PDF, DOC, ZIP, etc.) alongside the text.
13
+ - When you want a centered text column over a colored or image background.
14
+
15
+ ## Example
16
+
17
+ ```json
18
+ {
19
+ "type": "content-layout-block",
20
+ "size": "l",
21
+ "theme": "default",
22
+ "textWidth": "m",
23
+ "textContent": {
24
+ "title": "Lorem ipsum dolor sit amet",
25
+ "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
26
+ "buttons": [{"text": "Primary", "theme": "action", "url": "https://example.com"}]
27
+ },
28
+ "fileContent": [{"href": "https://example.com/spec.pdf", "text": "Specification (PDF)"}]
29
+ }
30
+ ```
31
+
32
+ ## Properties
33
+
34
+ | Property | Type | Default | Description |
35
+ | ------------- | -------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
36
+ | `textContent` | `ContentBlock` | — | Inner content object: `title` (string or `TitleProps`), `text` (YFM), `additionalInfo` (YFM), `links`, `buttons`, `list`, `theme`, `size`, `controlPosition`, `centered`, and `colSizes`. |
37
+ | `fileContent` | `FileLinkProps[]` | — | List of file attachments rendered as horizontal file links. Each item supports `href`, `text`, and other `FileLinkProps`. |
38
+ | `size` | `'s' \| 'm' \| 'l' \| 'xl'` | `'l'` | Overall content scale; also drives file-link text size. |
39
+ | `background` | `BackgroundImageProps` | — | Optional background image/color, hidden on mobile. |
40
+ | `centered` | `boolean` | `false` | Centers the text column and file list. |
41
+ | `theme` | `'default' \| 'light' \| 'dark'` | `'default'` | Color scheme; `default` follows the runtime theme. |
42
+ | `textWidth` | `'s' \| 'm' \| 'l'` | `'m'` | Maximum width of the text column on desktop. |
43
+
44
+ ### Common properties
45
+
46
+ Inherits common block properties: `anchor`, `visible`, `indent` (`{top?, bottom?}`), `qa`, `className`, `animated`, `theme` (`'light' | 'dark'`), `when`, `context`. See the root README for details.
47
+
48
+ ## Themed values
49
+
50
+ None of the top-level ContentLayout props accept `{light, dark}` directly; the `background` value is resolved against the runtime theme internally.
51
+
52
+ ## Storybook
53
+
54
+ [ContentLayout](https://preview.gravity-ui.com/page-constructor/?path=/docs/blocks-contentlayout--docs)
@@ -0,0 +1,74 @@
1
+ # ExtendedFeatures
2
+
3
+ Renders a responsive grid of feature cards, each with an icon, title, text, an optional label (`New` / `Preview`), and an optional link. Use it to present a list of product features, capabilities, or benefits in a compact, icon-driven layout.
4
+
5
+ ## Block type
6
+
7
+ `type: 'extended-features-block'`
8
+
9
+ ## When to use
10
+
11
+ - Showcasing a set of features or capabilities with a small icon each.
12
+ - Highlighting new or preview items via a built-in `New` / `Preview` label.
13
+ - When you need per-item links to documentation or landing pages.
14
+
15
+ ## Example
16
+
17
+ ```json
18
+ {
19
+ "type": "extended-features-block",
20
+ "title": {"text": "Lorem ipsum dolor sit amet"},
21
+ "description": "Three **cards in a row on the desktop**, two cards in a row on a tablet, one card in a row on a mobile phone.",
22
+ "items": [
23
+ {
24
+ "title": "Sed do eiusmod tempor incididunt",
25
+ "text": "Ut enim ad minim veniam [quis nostrud](https://example.com) ullamco laboris nisi ut aliquip ex ea commodo consequat.",
26
+ "icon": {"light": "/story-assets/icon_1_light.svg", "dark": "/story-assets/icon_1_dark.svg"}
27
+ },
28
+ {
29
+ "title": "Sed do eiusmod tempor",
30
+ "text": "Ut enim ad minim veniam [quis nostrud](https://example.com) ullamco laboris nisi ut aliquip ex ea commodo consequat.",
31
+ "icon": {"light": "/story-assets/icon_2_light.svg", "dark": "/story-assets/icon_2_dark.svg"},
32
+ "label": "New"
33
+ },
34
+ {
35
+ "title": "Sed do eiusmod tempor incididunt",
36
+ "text": "Ut enim ad minim veniam [quis nostrud](https://example.com) ullamco laboris nisi ut aliquip ex ea commodo consequat.",
37
+ "icon": {"light": "/story-assets/icon_3_light.svg", "dark": "/story-assets/icon_3_dark.svg"},
38
+ "link": {"text": "Go", "url": "#", "arrow": true, "theme": "normal"}
39
+ }
40
+ ]
41
+ }
42
+ ```
43
+
44
+ ## Properties
45
+
46
+ | Property | Type | Default | Description |
47
+ | ------------- | ------------------------------------------------- | ------------------------- | --------------------------------------------------------------------------------------------------- |
48
+ | `title` | `string \| TitleProps` | — | Block heading (string or Title options). |
49
+ | `description` | `string` | — | YFM subtitle shown under the title. |
50
+ | `items` | `ExtendedFeaturesItem[]` | — | Array of feature cards (see below). |
51
+ | `colSizes` | `{all?, sm?, md?, lg?, xl?}` (each `number` 1–12) | `{all: 12, sm: 6, md: 4}` | Column width per breakpoint for a single feature. |
52
+ | `animated` | `boolean` | — | Enables entrance animation for the block. |
53
+
54
+ ### `ExtendedFeaturesItem`
55
+
56
+ | Property | Type | Default | Description |
57
+ | -------- | ----------------------------- | ------- | ------------------------------------------------------------------------------- |
58
+ | `title` | `string` | — | Feature title. Rendered as `<h3>` when the block has a title, otherwise `<h2>`. |
59
+ | `text` | `string` | — | YFM body text. |
60
+ | `label` | `'New' \| 'Preview'` | — | Small badge rendered next to the title. |
61
+ | `link` | `LinkProps` | — | Single link rendered below the text. |
62
+ | `icon` | `ImageProps \| {light, dark}` | — | Icon image shown above the title. |
63
+
64
+ ### Common properties
65
+
66
+ Inherits common block properties: `anchor`, `visible`, `indent` (`{top?, bottom?}`), `qa`, `className`, `animated`, `theme` (`'light' | 'dark'`), `when`, `context`. See the root README for details.
67
+
68
+ ## Themed values
69
+
70
+ `icon` accepts either a plain value or a `{light, dark}` object resolved against the active runtime theme.
71
+
72
+ ## Storybook
73
+
74
+ [ExtendedFeatures](https://preview.gravity-ui.com/page-constructor/?path=/docs/blocks-extendedfeatures--docs)