@gravity-ui/page-constructor 8.15.0 → 8.17.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.
- package/README.md +31 -9
- package/build/cjs/constructor-items.d.ts +1 -1
- package/build/cjs/demo/ComponentMap/ComponentMap.css +55 -0
- package/build/cjs/demo/ComponentMap/ComponentMap.d.ts +6 -0
- package/build/cjs/demo/ComponentMap/ComponentMap.js +286 -0
- package/build/cjs/demo/ComponentMap/ComponentMap.js.map +1 -0
- package/build/cjs/demo/ComponentMap/draw.d.ts +23 -0
- package/build/cjs/demo/ComponentMap/draw.js +134 -0
- package/build/cjs/demo/ComponentMap/draw.js.map +1 -0
- package/build/cjs/demo/ComponentMap/edgeGeometry.d.ts +20 -0
- package/build/cjs/demo/ComponentMap/edgeGeometry.js +146 -0
- package/build/cjs/demo/ComponentMap/edgeGeometry.js.map +1 -0
- package/build/cjs/demo/ComponentMap/graph.d.ts +9 -0
- package/build/cjs/demo/ComponentMap/graph.js +68 -0
- package/build/cjs/demo/ComponentMap/graph.js.map +1 -0
- package/build/cjs/demo/ComponentMap/layout.d.ts +12 -0
- package/build/cjs/demo/ComponentMap/layout.js +149 -0
- package/build/cjs/demo/ComponentMap/layout.js.map +1 -0
- package/build/cjs/demo/ComponentMap/model.d.ts +55 -0
- package/build/cjs/demo/ComponentMap/model.js +3 -0
- package/build/cjs/demo/ComponentMap/model.js.map +1 -0
- package/build/cjs/demo/ComponentMap/viewport.d.ts +7 -0
- package/build/cjs/demo/ComponentMap/viewport.js +41 -0
- package/build/cjs/demo/ComponentMap/viewport.js.map +1 -0
- package/build/cjs/demo/HeroAndMedia.stories.js +12 -23
- package/build/cjs/demo/HeroAndMedia.stories.js.map +1 -1
- package/build/cjs/demo/TokenizationHeader.stories.d.ts +13 -0
- package/build/cjs/demo/TokenizationHeader.stories.js +47 -0
- package/build/cjs/demo/TokenizationHeader.stories.js.map +1 -0
- package/build/cjs/demo/TokenizationHero.stories.d.ts +9 -0
- package/build/cjs/demo/TokenizationHero.stories.js +20 -0
- package/build/cjs/demo/TokenizationHero.stories.js.map +1 -0
- package/build/cjs/demo/tokenizationLanding.d.ts +2 -0
- package/build/cjs/demo/tokenizationLanding.js +21 -0
- package/build/cjs/demo/tokenizationLanding.js.map +1 -0
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +3 -0
- package/build/cjs/models/constructor-items/sub-blocks.js.map +1 -1
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.css +15 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +12 -2
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js.map +1 -1
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +10 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.js +10 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.js.map +1 -1
- package/build/docs/INDEX.md +191 -0
- package/build/docs/blocks/Banner.md +59 -0
- package/build/docs/blocks/CardLayout.md +79 -0
- package/build/docs/blocks/Companies.md +67 -0
- package/build/docs/blocks/ContentLayout.md +54 -0
- package/build/docs/blocks/ExtendedFeatures.md +74 -0
- package/build/docs/blocks/FilterBlock.md +112 -0
- package/build/docs/blocks/FoldableList.md +78 -0
- package/build/docs/blocks/Footer.md +110 -0
- package/build/docs/blocks/Form.md +89 -0
- package/build/docs/blocks/Header.md +70 -0
- package/build/docs/blocks/HeaderSlider.md +70 -0
- package/build/docs/blocks/Hero.md +67 -0
- package/build/docs/blocks/Icons.md +61 -0
- package/build/docs/blocks/Info.md +73 -0
- package/build/docs/blocks/Map.md +81 -0
- package/build/docs/blocks/Media.md +63 -0
- package/build/docs/blocks/PromoFeaturesBlock.md +74 -0
- package/build/docs/blocks/Questions.md +78 -0
- package/build/docs/blocks/Share.md +45 -0
- package/build/docs/blocks/Slider.md +89 -0
- package/build/docs/blocks/SliderOld.md +63 -0
- package/build/docs/blocks/Table.md +64 -0
- package/build/docs/blocks/Tabs.md +92 -0
- package/build/docs/guides/data-preparation-ru.md +257 -0
- package/build/docs/guides/data-preparation.md +259 -0
- package/build/docs/sub-blocks/BackgroundCard.md +63 -0
- package/build/docs/sub-blocks/BannerCard.md +57 -0
- package/build/docs/sub-blocks/BasicCard.md +60 -0
- package/build/docs/sub-blocks/Content.md +58 -0
- package/build/docs/sub-blocks/Divider.md +47 -0
- package/build/docs/sub-blocks/HubspotForm.md +47 -0
- package/build/docs/sub-blocks/ImageCard.md +59 -0
- package/build/docs/sub-blocks/LayoutItem.md +75 -0
- package/build/docs/sub-blocks/MediaCard.md +66 -0
- package/build/docs/sub-blocks/PriceCard.md +60 -0
- package/build/docs/sub-blocks/PriceDetailed.md +74 -0
- package/build/docs/sub-blocks/Quote.md +74 -0
- package/build/esm/constructor-items.d.ts +1 -1
- package/build/esm/demo/ComponentMap/ComponentMap.css +55 -0
- package/build/esm/demo/ComponentMap/ComponentMap.d.ts +7 -0
- package/build/esm/demo/ComponentMap/ComponentMap.js +283 -0
- package/build/esm/demo/ComponentMap/ComponentMap.js.map +1 -0
- package/build/esm/demo/ComponentMap/draw.d.ts +23 -0
- package/build/esm/demo/ComponentMap/draw.js +130 -0
- package/build/esm/demo/ComponentMap/draw.js.map +1 -0
- package/build/esm/demo/ComponentMap/edgeGeometry.d.ts +20 -0
- package/build/esm/demo/ComponentMap/edgeGeometry.js +136 -0
- package/build/esm/demo/ComponentMap/edgeGeometry.js.map +1 -0
- package/build/esm/demo/ComponentMap/graph.d.ts +9 -0
- package/build/esm/demo/ComponentMap/graph.js +62 -0
- package/build/esm/demo/ComponentMap/graph.js.map +1 -0
- package/build/esm/demo/ComponentMap/layout.d.ts +12 -0
- package/build/esm/demo/ComponentMap/layout.js +144 -0
- package/build/esm/demo/ComponentMap/layout.js.map +1 -0
- package/build/esm/demo/ComponentMap/model.d.ts +55 -0
- package/build/esm/demo/ComponentMap/model.js +2 -0
- package/build/esm/demo/ComponentMap/model.js.map +1 -0
- package/build/esm/demo/ComponentMap/viewport.d.ts +7 -0
- package/build/esm/demo/ComponentMap/viewport.js +34 -0
- package/build/esm/demo/ComponentMap/viewport.js.map +1 -0
- package/build/esm/demo/HeroAndMedia.stories.js +1 -12
- package/build/esm/demo/HeroAndMedia.stories.js.map +1 -1
- package/build/esm/demo/TokenizationHeader.stories.d.ts +13 -0
- package/build/esm/demo/TokenizationHeader.stories.js +43 -0
- package/build/esm/demo/TokenizationHeader.stories.js.map +1 -0
- package/build/esm/demo/TokenizationHero.stories.d.ts +9 -0
- package/build/esm/demo/TokenizationHero.stories.js +16 -0
- package/build/esm/demo/TokenizationHero.stories.js.map +1 -0
- package/build/esm/demo/tokenizationLanding.d.ts +2 -0
- package/build/esm/demo/tokenizationLanding.js +16 -0
- package/build/esm/demo/tokenizationLanding.js.map +1 -0
- package/build/esm/models/constructor-items/sub-blocks.d.ts +3 -0
- package/build/esm/models/constructor-items/sub-blocks.js.map +1 -1
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.css +15 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +14 -4
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js.map +1 -1
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +10 -0
- package/build/esm/sub-blocks/LayoutItem/schema.js +10 -0
- package/build/esm/sub-blocks/LayoutItem/schema.js.map +1 -1
- package/package.json +4 -2
- package/schema/index.js +1 -1
- package/server/models/constructor-items/sub-blocks.d.ts +3 -0
- package/widget/index.js +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Map
|
|
2
|
+
|
|
3
|
+
A media-and-content block that embeds an interactive Yandex Map inside a card, paired with an optional title, description, links, and buttons.
|
|
4
|
+
|
|
5
|
+
## Block type
|
|
6
|
+
|
|
7
|
+
`type: 'map-block'`
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- You need to show one or more geographic points with an interactive map.
|
|
12
|
+
- You want a titled, bordered map card next to marketing copy and CTAs.
|
|
13
|
+
- You want a responsive `media-content` / `content-media` layout.
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"type": "map-block",
|
|
20
|
+
"title": "Our office",
|
|
21
|
+
"description": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris.",
|
|
22
|
+
"direction": "content-media",
|
|
23
|
+
"map": {
|
|
24
|
+
"zoom": 9,
|
|
25
|
+
"id": "common-places",
|
|
26
|
+
"markers": [
|
|
27
|
+
{
|
|
28
|
+
"address": "Moscow Arbat",
|
|
29
|
+
"coordinate": [55.753994, 37.622093]
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Properties
|
|
37
|
+
|
|
38
|
+
| Property | Type | Default | Description |
|
|
39
|
+
| ------------------- | ------------------------------------ | ------- | -------------------------------------------------------------------------- |
|
|
40
|
+
| `title` _required_ | `string \| TitleProps` | — | Block title (plain string or options object with `textSize`, `url`, etc.). |
|
|
41
|
+
| `map` _required_ | `MapProps` | — | Map configuration. See below. |
|
|
42
|
+
| `description` | `string` (YFM) | — | Block description. |
|
|
43
|
+
| `direction` | `'media-content' \| 'content-media'` | — | Relative position of map and content. |
|
|
44
|
+
| `mobileDirection` | `'media-content' \| 'content-media'` | — | Direction on touch devices. |
|
|
45
|
+
| `largeMedia` | `boolean` | — | When `true`, the map takes 8 of 12 columns. |
|
|
46
|
+
| `border` | `'shadow' \| 'line' \| 'none'` | — | Map card border. |
|
|
47
|
+
| `disableShadow` | `boolean` (deprecated) | — | Use `border: 'none'` instead. |
|
|
48
|
+
| `mediaOnly` | `boolean` | — | Renders only the map, without content. |
|
|
49
|
+
| `mediaOnlyColSizes` | `{sm?, md?, lg?, xl?, all?}` | — | Column sizes when `mediaOnly` is `true`. |
|
|
50
|
+
| `additionalInfo` | `string` (YFM) | — | Gray supplementary text. |
|
|
51
|
+
| `links` | `LinkProps[]` | — | Array of link objects. |
|
|
52
|
+
| `buttons` | `ButtonProps[]` | — | Array of button objects. |
|
|
53
|
+
| `theme` | `'default' \| 'dark' \| 'light'` | — | Content theme. |
|
|
54
|
+
| `controlPosition` | `'default' \| 'bottom'` | — | Vertical position of links/buttons. |
|
|
55
|
+
|
|
56
|
+
### `map` (MapProps)
|
|
57
|
+
|
|
58
|
+
| Property | Type | Default | Description |
|
|
59
|
+
| ----------------- | --------------------------------------- | ------- | ---------------------------------------------------------- |
|
|
60
|
+
| `zoom` | `number` | — | Initial map zoom level. |
|
|
61
|
+
| `address` | `string` | — | Address string used for geocoding / balloons. |
|
|
62
|
+
| `id` | `string` | — | Map instance id. |
|
|
63
|
+
| `markers` | `Array<{coordinate, address?, label?}>` | — | Markers to place on the map. `coordinate` is `[lat, lng]`. |
|
|
64
|
+
| `disableControls` | `boolean` | — | Hides map controls. |
|
|
65
|
+
| `disableBalloons` | `boolean` | — | Disables marker balloons. |
|
|
66
|
+
|
|
67
|
+
### Common properties
|
|
68
|
+
|
|
69
|
+
Inherits: `anchor`, `visible`, `indent`, `qa`, `className`, `animated`, `theme`, `when`, `context`. See root README.
|
|
70
|
+
|
|
71
|
+
## Setup notes
|
|
72
|
+
|
|
73
|
+
The Map block requires the maps provider. Pass `mapsContext` (with `apikey`, map `type`, and `scriptSrc`) to `PageConstructorProvider`, otherwise the map cannot be loaded.
|
|
74
|
+
|
|
75
|
+
## Themed values
|
|
76
|
+
|
|
77
|
+
`map` is not themed itself, but the surrounding media block supports themed media; pass `{light, dark}` where a themed media value is expected.
|
|
78
|
+
|
|
79
|
+
## Storybook
|
|
80
|
+
|
|
81
|
+
[Map](https://preview.gravity-ui.com/page-constructor/?path=/docs/blocks-map--docs)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Media
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## Block type
|
|
6
|
+
|
|
7
|
+
`type: 'media-block'`
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- Feature or "how it works" sections with text on one side and media on the other.
|
|
12
|
+
- When you need an image gallery (array of images becomes a slider), video player, YouTube embed, iframe, or DataLens visualization in the same block.
|
|
13
|
+
- When you want to control media-vs-content order, sizing, or border treatment.
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"type": "media-block",
|
|
20
|
+
"title": "Lorem ipsum dolor sit",
|
|
21
|
+
"description": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
|
22
|
+
"size": "l",
|
|
23
|
+
"direction": "media-content",
|
|
24
|
+
"media": {
|
|
25
|
+
"light": {"image": "/images/media-light.png"},
|
|
26
|
+
"dark": {"image": "/images/media-dark.png"}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Properties
|
|
32
|
+
|
|
33
|
+
| Property | Type | Default | Description |
|
|
34
|
+
| -------------------- | ------------------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
35
|
+
| `title` _required_ | `string \| TitleProps` | — | Section heading. String or `TitleProps` (`text`, `textSize`, `url`, `urlTitle`, `analyticsEvents`). |
|
|
36
|
+
| `media` _required_ | `MediaProps \| {light, dark}` | — | Media column: `image` (single or array → slider), `video`, `youtube`, `videoIframe`, `iframe`, `dataLens`, plus `previewImg`, `autoplay`, `parallax`, `height`, `ratio`, `fullscreen`, `margins`, etc. |
|
|
37
|
+
| `description` | `string` | — | YFM body text rendered under the title. |
|
|
38
|
+
| `additionalInfo` | `string` | — | YFM supplementary text below the body. |
|
|
39
|
+
| `size` | `'s' \| 'm' \| 'l' \| 'xl'` | — | Overall content/media scale. |
|
|
40
|
+
| `links` | `LinkProps[]` | — | Inline text links rendered under the content. |
|
|
41
|
+
| `buttons` / `button` | `ButtonBlock[]` / `ButtonBlock` | — | CTA button(s) attached to the content column. |
|
|
42
|
+
| `list` | `ContentItem[]` | — | Bullet-style list with optional icons per item. |
|
|
43
|
+
| `controlPosition` | `'default' \| 'bottom'` | — | Vertical placement of the buttons/links. |
|
|
44
|
+
| `direction` | `'media-content' \| 'content-media'` | — | Column order on desktop. |
|
|
45
|
+
| `mobileDirection` | `'media-content' \| 'content-media'` | — | Column order on mobile. |
|
|
46
|
+
| `largeMedia` | `boolean` | — | Gives the media column a wider share of the grid. |
|
|
47
|
+
| `mediaOnly` | `boolean` | — | Renders only the media column, hiding the content. |
|
|
48
|
+
| `mediaOnlyColSizes` | `{sm?, md?, lg?, xl?, all?}` | — | Column sizes used when `mediaOnly` is `true`. |
|
|
49
|
+
| `border` | `'shadow' \| 'line' \| 'none'` | — | Border/shadow treatment around the media. |
|
|
50
|
+
| `disableShadow` | `boolean` (deprecated) | — | Legacy flag; use `border: 'none'` instead. |
|
|
51
|
+
| `animated` | `boolean` | — | Enables an entrance animation. |
|
|
52
|
+
|
|
53
|
+
### Common properties
|
|
54
|
+
|
|
55
|
+
Inherits common block properties: `anchor`, `visible`, `indent` (`{top?, bottom?}`), `qa`, `className`, `animated`, `theme` (`'light' | 'dark'`), `when`, `context`. See the root README for details.
|
|
56
|
+
|
|
57
|
+
## Themed values
|
|
58
|
+
|
|
59
|
+
`media` accepts either a plain value or a `{light, dark}` object resolved against the active runtime theme.
|
|
60
|
+
|
|
61
|
+
## Storybook
|
|
62
|
+
|
|
63
|
+
[Media](https://preview.gravity-ui.com/page-constructor/?path=/docs/blocks-media--docs)
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# PromoFeaturesBlock
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## Block type
|
|
6
|
+
|
|
7
|
+
`type: 'promo-features-block'`
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- Marketing sections that mix feature cards with media (image/video) of varying heights.
|
|
12
|
+
- When you want an accent/primary card theme to draw attention to specific items.
|
|
13
|
+
- Promo landing sections where a full-width background tone (default or grey) is desired.
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"type": "promo-features-block",
|
|
20
|
+
"title": "Lorem ipsum dolor sit amet",
|
|
21
|
+
"description": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
|
22
|
+
"theme": "grey",
|
|
23
|
+
"items": [
|
|
24
|
+
{
|
|
25
|
+
"title": "Lorem ipsum dolor sit amet",
|
|
26
|
+
"text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
|
27
|
+
"media": {"image": "/story-assets/img-mini_4-12_dark.png"}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"title": "Lorem ipsum dolor sit amet",
|
|
31
|
+
"text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
|
32
|
+
"theme": "accent",
|
|
33
|
+
"media": {"image": "/story-assets/img-mini_4-12_dark.png"}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"title": "Lorem ipsum dolor sit amet",
|
|
37
|
+
"text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
|
38
|
+
"theme": "primary",
|
|
39
|
+
"media": {"image": "/story-assets/img-mini_4-12_white.png"}
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Properties
|
|
46
|
+
|
|
47
|
+
| Property | Type | Default | Description |
|
|
48
|
+
| ------------------ | ---------------------- | ----------- | --------------------------------------------------------------------------------------------------- |
|
|
49
|
+
| `title` | `string \| TitleProps` | — | Block heading (string or Title options). |
|
|
50
|
+
| `description` | `string` | — | YFM subtitle shown under the title. |
|
|
51
|
+
| `theme` | `'grey' \| 'default'` | `'default'` | Full-width background tone for the block. |
|
|
52
|
+
| `items` _required_ | `PromoFeaturesItem[]` | — | Array of promo feature cards (see below). |
|
|
53
|
+
| `animated` | `boolean` | `true` | Enables entrance animation for the block. |
|
|
54
|
+
|
|
55
|
+
### `PromoFeaturesItem`
|
|
56
|
+
|
|
57
|
+
| Property | Type | Default | Description |
|
|
58
|
+
| ------------------ | ----------------------------------------- | ------------------------ | ---------------------------------------------------------------------------------------------- |
|
|
59
|
+
| `title` _required_ | `string` | — | Card title (rendered as `<h3>`). |
|
|
60
|
+
| `text` _required_ | `string` | — | YFM card body text. |
|
|
61
|
+
| `theme` | `'accent' \| 'accent-light' \| 'primary'` | derived from block theme | Card color treatment. |
|
|
62
|
+
| `media` | `MediaProps \| {light, dark}` | — | Media (image/video) attached to the card. When omitted, the card renders without a media area. |
|
|
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
|
+
`media` accepts either a plain value or a `{light, dark}` object resolved against the active runtime theme.
|
|
71
|
+
|
|
72
|
+
## Storybook
|
|
73
|
+
|
|
74
|
+
[PromoFeaturesBlock](https://preview.gravity-ui.com/page-constructor/?path=/docs/blocks-promofeaturesblock--docs)
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Questions
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## Block type
|
|
6
|
+
|
|
7
|
+
`type: 'questions-block'`
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- FAQ sections that benefit from search-engine rich results (JSON-LD `FAQPage`).
|
|
12
|
+
- Q&A lists where each answer should expand/collapse.
|
|
13
|
+
- When you need an intro panel (title, description, CTA) next to the questions.
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"type": "questions-block",
|
|
20
|
+
"title": "Lorem ipsum",
|
|
21
|
+
"text": "Dolor sit amet, consectetur adipiscing elit [sed do eiusmod](https://example.com) tempor incididunt ut labore et dolore magna aliqua.",
|
|
22
|
+
"additionalInfo": "Dolor sit amet [consectetur adipiscing](https://example.com) Duis aute irure dolor in reprehenderit.",
|
|
23
|
+
"links": [{"url": "/security", "text": "Learn more", "theme": "normal", "arrow": true}],
|
|
24
|
+
"buttons": [{"text": "Button", "theme": "action", "url": "https://example.com"}],
|
|
25
|
+
"items": [
|
|
26
|
+
{
|
|
27
|
+
"title": "Lorem ipsum dolor sit amet 0",
|
|
28
|
+
"text": "Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
|
29
|
+
"link": {"url": "#", "text": "Documentation", "theme": "normal", "arrow": true}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"title": "Ut enim ad minim veniam, quis nostrud exercitation ullamco? 1",
|
|
33
|
+
"text": "laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
|
|
34
|
+
"link": {"url": "#", "text": "Documentation", "theme": "normal", "arrow": true}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"title": "1. Lorem ipsum",
|
|
38
|
+
"text": "Lorem ipsum dolor sit amet:\n- Lorem ipsum\n- Lorem ipsum\n- Lorem ipsum",
|
|
39
|
+
"link": {"url": "#", "text": "Documentation", "theme": "normal", "arrow": true},
|
|
40
|
+
"listStyle": "disk"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Properties
|
|
47
|
+
|
|
48
|
+
| Property | Type | Default | Description |
|
|
49
|
+
| ------------------ | ----------------------- | ------- | -------------------------------------------------------------------------------------------------------- |
|
|
50
|
+
| `title` _required_ | `string \| TitleProps` | — | Left-panel heading (string or Title options). |
|
|
51
|
+
| `text` | `string` | — | YFM body text in the left panel. |
|
|
52
|
+
| `additionalInfo` | `string` | — | YFM supplementary text in the left panel. |
|
|
53
|
+
| `links` | `LinkProps[]` | — | Array of links rendered in the left panel. |
|
|
54
|
+
| `buttons` | `ButtonBlock[]` | — | Array of buttons rendered in the left panel. |
|
|
55
|
+
| `list` | `ContentItem[]` | — | Icon + title + text list rendered in the left panel. Each item requires an `icon` or `gravityIcon`. |
|
|
56
|
+
| `controlPosition` | `'default' \| 'bottom'` | — | Position of the link/button controls in the left panel. |
|
|
57
|
+
| `items` _required_ | `QuestionItem[]` | — | Collapsible question rows on the right (see below). |
|
|
58
|
+
|
|
59
|
+
### `QuestionItem`
|
|
60
|
+
|
|
61
|
+
| Property | Type | Default | Description |
|
|
62
|
+
| ------------------ | ------------------ | -------- | --------------------------------------------------------------------------------------- |
|
|
63
|
+
| `title` _required_ | `string` | — | Question text (always visible). Also used as the JSON-LD `Question.name`. |
|
|
64
|
+
| `text` _required_ | `string` | — | YFM answer text revealed when expanded. Also used as the JSON-LD `acceptedAnswer.text`. |
|
|
65
|
+
| `link` | `LinkProps` | — | Link rendered below the answer. |
|
|
66
|
+
| `listStyle` | `'dash' \| 'disk'` | `'dash'` | Marker style for lists inside the answer. |
|
|
67
|
+
|
|
68
|
+
### Common properties
|
|
69
|
+
|
|
70
|
+
Inherits common block properties: `anchor`, `visible`, `indent` (`{top?, bottom?}`), `qa`, `className`, `animated`, `theme` (`'light' | 'dark'`), `when`, `context`. See the root README for details.
|
|
71
|
+
|
|
72
|
+
## Themed values
|
|
73
|
+
|
|
74
|
+
No dedicated themed props; the block follows the runtime `theme` for text/background coloring.
|
|
75
|
+
|
|
76
|
+
## Storybook
|
|
77
|
+
|
|
78
|
+
[Questions](https://preview.gravity-ui.com/page-constructor/?path=/docs/blocks-questions--docs)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Share
|
|
2
|
+
|
|
3
|
+
Renders a row of social-network share buttons that share the current page URL.
|
|
4
|
+
|
|
5
|
+
## Block type
|
|
6
|
+
|
|
7
|
+
`type: 'share-block'`
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- You want to let visitors share the current page on social networks.
|
|
12
|
+
- You need a compact, localized share strip with analytics events on click.
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"type": "share-block",
|
|
19
|
+
"title": "Share on social networks",
|
|
20
|
+
"items": ["facebook", "vk", "telegram", "twitter", "linkedin"]
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Properties
|
|
25
|
+
|
|
26
|
+
| Property | Type | Default | Description |
|
|
27
|
+
| ------------------ | -------------------------------------------------------------------- | ------------------------ | ---------------------------------------------------------------------------- |
|
|
28
|
+
| `items` _required_ | `Array<'telegram' \| 'facebook' \| 'twitter' \| 'vk' \| 'linkedin'>` | — | Social networks to render, in order. |
|
|
29
|
+
| `title` | `string` (YFM) | localized "Share" string | Heading above the buttons. When omitted, a localized default title is shown. |
|
|
30
|
+
|
|
31
|
+
### Common properties
|
|
32
|
+
|
|
33
|
+
Inherits: `anchor`, `visible`, `indent`, `qa`, `className`, `animated`, `theme`, `when`, `context`. See root README.
|
|
34
|
+
|
|
35
|
+
## Notes
|
|
36
|
+
|
|
37
|
+
The shared URL is derived from the `LocationContext` (hostname + pathname) provided by `PageConstructorProvider`. Click events are reported through the analytics handler under the `shareButton` event name.
|
|
38
|
+
|
|
39
|
+
## Themed values
|
|
40
|
+
|
|
41
|
+
This block has no themed-value properties.
|
|
42
|
+
|
|
43
|
+
## Storybook
|
|
44
|
+
|
|
45
|
+
[Share](https://preview.gravity-ui.com/page-constructor/?path=/docs/blocks-share--docs)
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Slider
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## Block type
|
|
6
|
+
|
|
7
|
+
`type: 'slider-block'`
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- You need to display a sequence of cards (basic cards, quote cards, image cards, etc.) in a carousel.
|
|
12
|
+
- You need responsive control over how many slides are visible at each breakpoint.
|
|
13
|
+
- You want autoplay, pagination dots, and navigation arrows.
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"type": "slider-block",
|
|
20
|
+
"title": {"text": "QuoteCards", "url": "https://example.com"},
|
|
21
|
+
"description": "Lorem ipsum dolor sit amet",
|
|
22
|
+
"dots": true,
|
|
23
|
+
"arrows": true,
|
|
24
|
+
"slidesToShow": 1,
|
|
25
|
+
"children": [
|
|
26
|
+
{
|
|
27
|
+
"type": "quote",
|
|
28
|
+
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
|
29
|
+
"image": {
|
|
30
|
+
"light": "/images/quote-light.png",
|
|
31
|
+
"dark": "/images/quote-dark.png"
|
|
32
|
+
},
|
|
33
|
+
"logo": "/images/company-logo.svg",
|
|
34
|
+
"author": {
|
|
35
|
+
"firstName": "Lorem",
|
|
36
|
+
"secondName": "ipsum",
|
|
37
|
+
"description": "Lorem ipsum",
|
|
38
|
+
"avatar": "/story-assets/img_6-12_light.png"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"type": "basic-card",
|
|
43
|
+
"title": "Basic card",
|
|
44
|
+
"text": "Ut enim ad minim veniam.",
|
|
45
|
+
"icon": "/story-assets/icon_1_light.svg"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Responsive `slidesToShow`:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
"slidesToShow": {"sm": 1, "md": 2, "lg": 3, "xl": 4}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Properties
|
|
58
|
+
|
|
59
|
+
| Property | Type | Default | Description |
|
|
60
|
+
| -------------- | ------------------------------------------------------ | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
61
|
+
| `title` | `string \| TitleProps` | — | Block title (plain string or options object). |
|
|
62
|
+
| `description` | `string` (YFM) | — | Block description under the title. |
|
|
63
|
+
| `children` | `Card[]` | — | Array of child card blocks rendered as slides. Any registered card type is allowed. |
|
|
64
|
+
| `slidesToShow` | `number \| {sm?, md?, lg?, xl?}` | — | Number of slides to show. A number applies to all breakpoints; an object sets per-breakpoint counts (`sm`, `md`, `lg`, `xl`). |
|
|
65
|
+
| `dots` | `boolean` | `true` | Show pagination dots. |
|
|
66
|
+
| `arrows` | `boolean` | `true` | Show prev/next navigation arrows. |
|
|
67
|
+
| `arrowSize` | `number` | — | Size of the navigation arrows in pixels. |
|
|
68
|
+
| `autoplay` | `number` | — | Autoplay interval in milliseconds. When set and positive, dots are hidden from the accessibility tab order. |
|
|
69
|
+
| `adaptive` | `boolean` | — | Adaptive slide height. |
|
|
70
|
+
| `randomOrder` | `boolean` | — | Shuffle slides on render. |
|
|
71
|
+
| `type` | `string` | — | Logical slider type, used for grouping / loadable sources. |
|
|
72
|
+
| `disclaimer` | `{text *required*, size?}` | — | Disclaimer text under the slider. `size` is one of `'xs' \| 's' \| 'sm' \| 'm' \| 'l'`. |
|
|
73
|
+
| `loadable` | `{source *required*, params?, minCount? (deprecated)}` | — | Disabled in the default schema. Used by projects that wire up a custom loadable source for slides. |
|
|
74
|
+
|
|
75
|
+
### Common properties
|
|
76
|
+
|
|
77
|
+
Inherits: `anchor`, `visible`, `indent`, `qa`, `className`, `animated`, `theme`, `when`, `context`. See root README.
|
|
78
|
+
|
|
79
|
+
## Notes
|
|
80
|
+
|
|
81
|
+
`children` accepts any block registered as a "card" in the schema. Common examples include `basic-card`, `quote`, image cards, and other content cards. A slider with a single child automatically renders without dots and arrows.
|
|
82
|
+
|
|
83
|
+
## Themed values
|
|
84
|
+
|
|
85
|
+
Child cards may individually use themed values (e.g. `{light, dark}` images); the block itself does not theme its scalar properties.
|
|
86
|
+
|
|
87
|
+
## Storybook
|
|
88
|
+
|
|
89
|
+
[Slider](https://preview.gravity-ui.com/page-constructor/?path=/docs/blocks-slider--docs)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# SliderOld
|
|
2
|
+
|
|
3
|
+
> ⚠️ **Deprecated.** `slider-old-block` is deprecated and will be removed in a future major release. Use [`slider-block`](./Slider.md) (the `Slider` block, built on Swiper) for new and existing pages.
|
|
4
|
+
|
|
5
|
+
The legacy carousel block, built on top of `react-slick`. Renders child cards as slides with optional title, description, dots, arrows, autoplay, and per-breakpoint slide counts.
|
|
6
|
+
|
|
7
|
+
## Block type
|
|
8
|
+
|
|
9
|
+
`type: 'slider-old-block'`
|
|
10
|
+
|
|
11
|
+
## When to use
|
|
12
|
+
|
|
13
|
+
- Only for backward compatibility with existing JSON that already uses `slider-old-block`.
|
|
14
|
+
- For anything new, use `slider-block`.
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"type": "slider-old-block",
|
|
21
|
+
"title": {"text": "Slider", "url": "https://example.com"},
|
|
22
|
+
"description": "Lorem ipsum dolor sit amet",
|
|
23
|
+
"dots": true,
|
|
24
|
+
"arrows": true,
|
|
25
|
+
"animated": true,
|
|
26
|
+
"children": [
|
|
27
|
+
{
|
|
28
|
+
"type": "basic-card",
|
|
29
|
+
"url": "https://example.com",
|
|
30
|
+
"title": "Lorem ipsum dolor sit amet",
|
|
31
|
+
"text": "Ut enim ad minim veniam.",
|
|
32
|
+
"icon": "/story-assets/icon_1_light.svg"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Properties
|
|
39
|
+
|
|
40
|
+
| Property | Type | Default | Description |
|
|
41
|
+
| -------------- | ------------------------------------------------------ | ------- | --------------------------------------------------------------------------------------- |
|
|
42
|
+
| `title` | `string \| TitleProps` | — | Block title (plain string or options object). |
|
|
43
|
+
| `description` | `string` (YFM) | — | Block description under the title. |
|
|
44
|
+
| `children` | `Card[]` | — | Array of child card blocks rendered as slides. |
|
|
45
|
+
| `slidesToShow` | `number \| {sm?, md?, lg?, xl?}` | — | Number of slides to show, constant or per-breakpoint. |
|
|
46
|
+
| `dots` | `boolean` | `true` | Show pagination dots. |
|
|
47
|
+
| `arrows` | `boolean` | `true` | Show prev/next navigation arrows. |
|
|
48
|
+
| `autoplay` | `number` | — | Autoplay speed in milliseconds. |
|
|
49
|
+
| `randomOrder` | `boolean` | — | Shuffle slides on render. |
|
|
50
|
+
| `disclaimer` | `{text *required*, size?}` | — | Disclaimer text under the slider. `size` is one of `'xs' \| 's' \| 'sm' \| 'm' \| 'l'`. |
|
|
51
|
+
| `loadable` | `{source *required*, params?, minCount? (deprecated)}` | — | Disabled in the default schema; used by projects that wire up a custom loadable source. |
|
|
52
|
+
|
|
53
|
+
### Common properties
|
|
54
|
+
|
|
55
|
+
Inherits: `anchor`, `visible`, `indent`, `qa`, `className`, `animated`, `theme`, `when`, `context`. See root README.
|
|
56
|
+
|
|
57
|
+
## Themed values
|
|
58
|
+
|
|
59
|
+
Child cards may individually use themed values; the block itself does not theme its scalar properties.
|
|
60
|
+
|
|
61
|
+
## Storybook
|
|
62
|
+
|
|
63
|
+
[SliderOld](https://preview.gravity-ui.com/page-constructor/?path=/docs/blocks-sliderold-deprecated--docs)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Table
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## Block type
|
|
6
|
+
|
|
7
|
+
`type: 'table-block'`
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- Side-by-side feature/plan comparison tables.
|
|
12
|
+
- Dense matrices of boolean-style checks ("0"/"1") with a legend.
|
|
13
|
+
- Tabular reference data that needs per-column text alignment control.
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"type": "table-block",
|
|
20
|
+
"title": "Lorem ipsum dolor sit amet",
|
|
21
|
+
"table": {
|
|
22
|
+
"content": [
|
|
23
|
+
["Lorem", "ipsum 1", "dolor 2", "sit 3"],
|
|
24
|
+
["Lorem 1", "0", "0", "0"],
|
|
25
|
+
["Lorem 2", "0", "0", "1"],
|
|
26
|
+
["Lorem 3", "1", "1", "1"]
|
|
27
|
+
],
|
|
28
|
+
"legend": ["ipsum 1", "ipsum 2"],
|
|
29
|
+
"marker": "tick",
|
|
30
|
+
"justify": ["start", "center", "center", "center"],
|
|
31
|
+
"caption": "Comparison of features"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Properties
|
|
37
|
+
|
|
38
|
+
| Property | Type | Default | Description |
|
|
39
|
+
| ------------------ | ------------ | ------- | ----------------------------- |
|
|
40
|
+
| `title` _required_ | `string` | — | Section heading (plain text). |
|
|
41
|
+
| `table` _required_ | `TableProps` | — | Table definition. See below. |
|
|
42
|
+
|
|
43
|
+
### `table`
|
|
44
|
+
|
|
45
|
+
| Property | Type | Default | Description |
|
|
46
|
+
| -------------------- | ---------------------------------- | ------- | --------------------------------------------------------------------------------------------- |
|
|
47
|
+
| `content` _required_ | `(string \| number)[][]` | — | Rows of cells. The first row is treated as the header row. Each cell is a string or a number. |
|
|
48
|
+
| `legend` | `string[]` | — | YFM captions describing the marked columns; rendered as a legend list. |
|
|
49
|
+
| `hideLegend` | `boolean` | — | Hides the rendered legend list while keeping markers in the table. |
|
|
50
|
+
| `marker` | `'disk' \| 'tick'` | — | Marker style applied to legend cells. When omitted, no marker is rendered. |
|
|
51
|
+
| `justify` | `('start' \| 'center' \| 'end')[]` | — | Per-column horizontal alignment. Values map to columns by index. |
|
|
52
|
+
| `caption` | `string` | — | Accessible name for the table (not displayed visually). |
|
|
53
|
+
|
|
54
|
+
### Common properties
|
|
55
|
+
|
|
56
|
+
Inherits: `anchor`, `visible`, `indent` (`{top?, bottom?}`), `qa`, `className`, `when`, `context`. See the root README for details.
|
|
57
|
+
|
|
58
|
+
## Themed values
|
|
59
|
+
|
|
60
|
+
This block does not introduce theme-aware properties of its own.
|
|
61
|
+
|
|
62
|
+
## Storybook
|
|
63
|
+
|
|
64
|
+
[Table](https://preview.gravity-ui.com/page-constructor/?path=/docs/blocks-table--docs)
|