@gravity-ui/page-constructor 8.23.5 → 8.24.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 (39) hide show
  1. package/README.md +11 -0
  2. package/build/cjs/blocks/CardLayout/CardLayout.d.ts +2 -0
  3. package/build/cjs/blocks/CardLayout/CardLayout.js +3 -2
  4. package/build/cjs/blocks/CardLayout/CardLayout.js.map +1 -1
  5. package/build/cjs/blocks/FilterBlock/FilterBlock.css +17 -0
  6. package/build/cjs/blocks/FilterBlock/FilterBlock.d.ts +1 -1
  7. package/build/cjs/blocks/FilterBlock/FilterBlock.js +43 -3
  8. package/build/cjs/blocks/FilterBlock/FilterBlock.js.map +1 -1
  9. package/build/cjs/blocks/FilterBlock/i18n/en.json +3 -1
  10. package/build/cjs/blocks/FilterBlock/i18n/index.d.ts +2 -2
  11. package/build/cjs/blocks/FilterBlock/i18n/ru.json +3 -1
  12. package/build/cjs/blocks/FilterBlock/schema.d.ts +41 -0
  13. package/build/cjs/blocks/FilterBlock/schema.js +11 -0
  14. package/build/cjs/blocks/FilterBlock/schema.js.map +1 -1
  15. package/build/cjs/constructor-items.d.ts +1 -1
  16. package/build/cjs/models/constructor-items/blocks.d.ts +4 -0
  17. package/build/cjs/models/constructor-items/blocks.js.map +1 -1
  18. package/build/docs/INDEX.md +1 -0
  19. package/build/docs/blocks/FilterBlock.md +76 -16
  20. package/build/esm/blocks/CardLayout/CardLayout.d.ts +2 -0
  21. package/build/esm/blocks/CardLayout/CardLayout.js +2 -2
  22. package/build/esm/blocks/CardLayout/CardLayout.js.map +1 -1
  23. package/build/esm/blocks/FilterBlock/FilterBlock.css +17 -0
  24. package/build/esm/blocks/FilterBlock/FilterBlock.d.ts +1 -1
  25. package/build/esm/blocks/FilterBlock/FilterBlock.js +43 -3
  26. package/build/esm/blocks/FilterBlock/FilterBlock.js.map +1 -1
  27. package/build/esm/blocks/FilterBlock/i18n/en.json +3 -1
  28. package/build/esm/blocks/FilterBlock/i18n/index.d.ts +2 -2
  29. package/build/esm/blocks/FilterBlock/i18n/ru.json +3 -1
  30. package/build/esm/blocks/FilterBlock/schema.d.ts +41 -0
  31. package/build/esm/blocks/FilterBlock/schema.js +11 -0
  32. package/build/esm/blocks/FilterBlock/schema.js.map +1 -1
  33. package/build/esm/constructor-items.d.ts +1 -1
  34. package/build/esm/models/constructor-items/blocks.d.ts +4 -0
  35. package/build/esm/models/constructor-items/blocks.js.map +1 -1
  36. package/package.json +1 -1
  37. package/schema/index.js +1 -1
  38. package/server/models/constructor-items/blocks.d.ts +4 -0
  39. package/widget/index.js +1 -1
@@ -68,25 +68,29 @@ Renders a set of cards grouped by tags, with a row of toggle buttons that lets t
68
68
 
69
69
  ## Properties
70
70
 
71
- | Property | Type | Default | Description |
72
- | ------------------ | ------------------------------------------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
73
- | `title` | `string \| TitleProps` | — | Block heading (string or Title options). |
74
- | `description` | `string` | — | YFM subtitle shown under the title. |
75
- | `tags` _required_ | `FilterTag[]` | — | Tag definitions used as filter toggles (see below). |
76
- | `items` _required_ | `FilterItem[]` | — | Cards to filter (see below). |
77
- | `allTag` | `boolean \| string \| FilterTag` | — | Adds an "All" toggle. `true` uses the default label; a string overrides the label; an object supplies `{label, analyticsEvent}`. |
78
- | `tagButtonSize` | `'s' \| 'm' \| 'l' \| 'xl'` | — | Size of the filter tag buttons. |
79
- | `centered` | `boolean` | `false` | Centers the header and the tag button row. |
80
- | `colSizes` | `{all?, sm?, md?, lg?, xl?}` (each `number` 1–12) | `{all: 12, sm: 6, md: 4}` | Column width per breakpoint for a single card. |
81
- | `animated` | `boolean` | — | Enables entrance animation for the block. |
71
+ | Property | Type | Default | Description |
72
+ | -------------------- | ------------------------------------------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
73
+ | `title` | `string \| TitleProps` | — | Block heading (string or Title options). |
74
+ | `description` | `string` | — | YFM subtitle shown under the title. |
75
+ | `tags` _required_ | `FilterTag[]` | — | Tag definitions used as filter toggles (see below). |
76
+ | `items` _required_ | `FilterItem[]` | — | Cards to filter (see below). |
77
+ | `allTag` | `boolean \| string \| FilterTag` | — | Adds an "All" toggle. `true` uses the default label; a string overrides the label; an object supplies `{label, analyticsEvent}`. |
78
+ | `tagButtonSize` | `'s' \| 'm' \| 'l' \| 'xl'` | — | Size of the filter tag buttons. |
79
+ | `centered` | `boolean` | `false` | Centers the header and the tag button row. |
80
+ | `colSizes` | `{all?, sm?, md?, lg?, xl?}` (each `number` 1–12) | `{all: 12, sm: 6, md: 4}` | Column width per breakpoint for a single card. |
81
+ | `animated` | `boolean` | — | Enables entrance animation for the block. |
82
+ | `visibleRowsCount` | `{all?, sm?, md?, lg?, xl?}` (positive integers) | Unlimited | Shared collapsed row limits for opted-in tabs; values inherit from smaller breakpoints. |
83
+ | `expandButtonText` | `string` | Localized “Show all” | Expand button label. |
84
+ | `collapseButtonText` | `string` | Localized “Show less” | Collapse button label. |
82
85
 
83
86
  ### `FilterTag`
84
87
 
85
- | Property | Type | Default | Description |
86
- | ------------------ | ---------------------- | ------- | ------------------------------------------------------------------ |
87
- | `id` _required_ | `string` | — | Tag identifier. Must match at least one value in an item's `tags`. |
88
- | `label` _required_ | `string` | — | Tag button label. |
89
- | `analyticsEvent` | `AnalyticsEventSchema` | — | Analytics event fired when the tag is selected. |
88
+ | Property | Type | Default | Description |
89
+ | ------------------ | ---------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------- |
90
+ | `id` _required_ | `string` | — | Tag identifier. Must match at least one value in an item's `tags`. |
91
+ | `label` _required_ | `string` | — | Tag button label. |
92
+ | `analyticsEvent` | `AnalyticsEventSchema` | — | Analytics event fired when the tag is selected. |
93
+ | `collapsible` | `boolean` | `false` | Enables collapsing for this tab when a matching `visibleRowsCount` limit exists. Also supported by the object form of `allTag`. |
90
94
 
91
95
  ### `FilterItem`
92
96
 
@@ -110,3 +114,59 @@ No dedicated themed props on the block itself; individual card `media`/`backgrou
110
114
  ## Storybook
111
115
 
112
116
  [FilterBlock](https://preview.gravity-ui.com/page-constructor/?path=/docs/blocks-filterblock--docs)
117
+
118
+ ## Collapsible lists
119
+
120
+ Set `collapsible: true` on each tag that should initially show a limited number of
121
+ rows, including the object form of `allTag`. This is disabled by default.
122
+ `visibleRowsCount` sets the shared row limit for these tabs, using the same
123
+ breakpoints as `colSizes`. Each value applies until the next configured breakpoint.
124
+ Without a matching row limit, the list remains unlimited.
125
+
126
+ ```yaml
127
+ allTag:
128
+ id: all
129
+ label: All services
130
+ collapsible: true
131
+ tags:
132
+ - id: infrastructure
133
+ label: Infrastructure
134
+ collapsible: true
135
+ colSizes:
136
+ all: 12
137
+ md: 6
138
+ lg: 3
139
+ visibleRowsCount:
140
+ all: 3
141
+ md: 2
142
+ lg: 2
143
+ expandButtonText: Show all
144
+ collapseButtonText: Show less
145
+ ```
146
+
147
+ Row counts must be positive integers. The number of visible cards is the row count
148
+ multiplied by the number of cards that fit in the current 12-column grid. The last
149
+ row can be incomplete when there are fewer cards remaining. The full-width normal
150
+ button appears only when the selected tab has more cards than its limit. Its labels
151
+ default to localized “Show all” / “Show less”. Changing tabs resets the expanded state.
152
+
153
+ ### Showing 8 / 9 / 8 cards
154
+
155
+ Configure row counts separately to keep complete rows as the column count changes:
156
+
157
+ ```yaml
158
+ colSizes: {all: 12, md: 6, lg: 4, xl: 3}
159
+ visibleRowsCount: {all: 3, md: 4, lg: 3, xl: 2}
160
+ ```
161
+
162
+ | Viewport width | Cards per row | Visible rows | Visible cards |
163
+ | ---------------- | ------------- | ------------ | ------------- |
164
+ | 1185px and wider | 4 | 2 | 8 |
165
+ | 1081–1184px | 3 | 3 | 9 |
166
+ | 769–1080px | 2 | 4 | 8 |
167
+ | Below 769px | 1 | 3 | 3 |
168
+
169
+ These limits apply only to tags with `collapsible: true`. They configure rows,
170
+ not automatic rounding of a requested card count. Fewer matching cards are all
171
+ shown without a toggle. See the `CollapsibleResponsiveRows` and
172
+ `CollapsibleWithFewCards` Storybook examples.
@@ -1,6 +1,8 @@
1
1
  import * as React from 'react';
2
+ import { GridColumnSizesType } from "../../grid/index.js";
2
3
  import { CardLayoutBlockProps as CardLayoutBlockParams, ClassNameProps } from "../../models/index.js";
3
4
  import './CardLayout.css';
5
+ export declare const CARD_LAYOUT_DEFAULT_SIZES: GridColumnSizesType;
4
6
  export type CardLayoutBlockProps = React.PropsWithChildren<Omit<CardLayoutBlockParams, 'children'>> & ClassNameProps;
5
7
  declare const CardLayout: ({ title, description, animated, colSizes, children, className, titleClassName, background, centered, }: CardLayoutBlockProps) => import("react/jsx-runtime").JSX.Element;
6
8
  export default CardLayout;
@@ -6,13 +6,13 @@ import { useTheme } from "../../context/theme/index.js";
6
6
  import { Col, GridJustifyContent, Row } from "../../grid/index.js";
7
7
  import { block, getThemedValue } from "../../utils/index.js";
8
8
  import './CardLayout.css';
9
- const DEFAULT_SIZES = {
9
+ export const CARD_LAYOUT_DEFAULT_SIZES = {
10
10
  all: 12,
11
11
  sm: 6,
12
12
  md: 4,
13
13
  };
14
14
  const b = block('card-layout-block');
15
- const CardLayout = ({ title, description, animated, colSizes = DEFAULT_SIZES, children, className, titleClassName, background, centered = false, }) => {
15
+ const CardLayout = ({ title, description, animated, colSizes = CARD_LAYOUT_DEFAULT_SIZES, children, className, titleClassName, background, centered = false, }) => {
16
16
  const theme = useTheme();
17
17
  const { border, ...backgroundImageProps } = getThemedValue(background || {}, theme);
18
18
  return (_jsxs(AnimateBlock, { className: b(null, className), animate: animated, children: [(title || description) && (_jsx(Title, { title: title, subtitle: description, className: b('title', { centered }, titleClassName), colJustifyContent: centered ? GridJustifyContent.Center : GridJustifyContent.Start })), _jsxs("div", { className: b('content', {
@@ -1 +1 @@
1
- {"version":3,"file":"CardLayout.js","sourceRoot":"../../../../src","sources":["blocks/CardLayout/CardLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,OAAO,0BAA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O,CAAC,UAAU,CAAC;iBAC1C,CAAC,aAEF,KAAC,eAAe,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,MAAM,EAAC,CAAC,KAAM,oBAAoB,GAAI,EAC9E,KAAC,GAAG,cACC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5C,KAAC,GAAG,IAAa,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YACjD,KAAK,IADA,KAAK,CAET,CACT,CAAC,GACA,IACJ,IACK,CAClB,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import * as React from 'react';\n\nimport isEmpty from 'lodash/isEmpty';\n\nimport {AnimateBlock, BackgroundImage, Title} from '../../components';\nimport {useTheme} from '../../context/theme';\nimport {Col, GridColumnSizesType, GridJustifyContent, Row} from '../../grid';\nimport {CardLayoutBlockProps as CardLayoutBlockParams, ClassNameProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\n\nimport './CardLayout.scss';\n\nconst DEFAULT_SIZES: GridColumnSizesType = {\n all: 12,\n sm: 6,\n md: 4,\n};\n\nexport type CardLayoutBlockProps = React.PropsWithChildren<\n Omit<CardLayoutBlockParams, 'children'>\n> &\n ClassNameProps;\n\nconst b = block('card-layout-block');\n\nconst CardLayout = ({\n title,\n description,\n animated,\n colSizes = DEFAULT_SIZES,\n children,\n className,\n titleClassName,\n background,\n centered = false,\n}: CardLayoutBlockProps) => {\n const theme = useTheme();\n const {border, ...backgroundImageProps} = getThemedValue(background || {}, theme);\n return (\n <AnimateBlock className={b(null, className)} animate={animated}>\n {(title || description) && (\n <Title\n title={title}\n subtitle={description}\n className={b('title', {centered}, titleClassName)}\n colJustifyContent={\n centered ? GridJustifyContent.Center : GridJustifyContent.Start\n }\n />\n )}\n <div\n className={b('content', {\n 'with-background': !isEmpty(background),\n })}\n >\n <BackgroundImage className={b('image', {border})} {...backgroundImageProps} />\n <Row>\n {React.Children.map(children, (child, index) => (\n <Col key={index} sizes={colSizes} className={b('item')}>\n {child}\n </Col>\n ))}\n </Row>\n </div>\n </AnimateBlock>\n );\n};\n\nexport default CardLayout;\n"]}
1
+ {"version":3,"file":"CardLayout.js","sourceRoot":"../../../../src","sources":["blocks/CardLayout/CardLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,OAAO,0BAAuB;AAErC,OAAO,EAAC,YAAY,EAAE,eAAe,EAAE,KAAK,EAAC,kCAAyB;AACtE,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAC7C,OAAO,EAAC,GAAG,EAAuB,kBAAkB,EAAE,GAAG,EAAC,4BAAmB;AAE7E,OAAO,EAAC,KAAK,EAAE,cAAc,EAAC,6BAAoB;AAElD,OAAO,kBAAkB,CAAC;AAE1B,MAAM,CAAC,MAAM,yBAAyB,GAAwB;IAC1D,GAAG,EAAE,EAAE;IACP,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;CACR,CAAC;AAOF,MAAM,CAAC,GAAG,KAAK,CAAC,mBAAmB,CAAC,CAAC;AAErC,MAAM,UAAU,GAAG,CAAC,EAChB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,GAAG,yBAAyB,EACpC,QAAQ,EACR,SAAS,EACT,cAAc,EACd,UAAU,EACV,QAAQ,GAAG,KAAK,GACG,EAAE,EAAE;IACvB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,EAAC,MAAM,EAAE,GAAG,oBAAoB,EAAC,GAAG,cAAc,CAAC,UAAU,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;IAClF,OAAO,CACH,MAAC,YAAY,IAAC,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,QAAQ,aACzD,CAAC,KAAK,IAAI,WAAW,CAAC,IAAI,CACvB,KAAC,KAAK,IACF,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,WAAW,EACrB,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,QAAQ,EAAC,EAAE,cAAc,CAAC,EACjD,iBAAiB,EACb,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,GAErE,CACL,EACD,eACI,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE;oBACpB,iBAAiB,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC;iBAC1C,CAAC,aAEF,KAAC,eAAe,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,MAAM,EAAC,CAAC,KAAM,oBAAoB,GAAI,EAC9E,KAAC,GAAG,cACC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5C,KAAC,GAAG,IAAa,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YACjD,KAAK,IADA,KAAK,CAET,CACT,CAAC,GACA,IACJ,IACK,CAClB,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import * as React from 'react';\n\nimport isEmpty from 'lodash/isEmpty';\n\nimport {AnimateBlock, BackgroundImage, Title} from '../../components';\nimport {useTheme} from '../../context/theme';\nimport {Col, GridColumnSizesType, GridJustifyContent, Row} from '../../grid';\nimport {CardLayoutBlockProps as CardLayoutBlockParams, ClassNameProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\n\nimport './CardLayout.scss';\n\nexport const CARD_LAYOUT_DEFAULT_SIZES: GridColumnSizesType = {\n all: 12,\n sm: 6,\n md: 4,\n};\n\nexport type CardLayoutBlockProps = React.PropsWithChildren<\n Omit<CardLayoutBlockParams, 'children'>\n> &\n ClassNameProps;\n\nconst b = block('card-layout-block');\n\nconst CardLayout = ({\n title,\n description,\n animated,\n colSizes = CARD_LAYOUT_DEFAULT_SIZES,\n children,\n className,\n titleClassName,\n background,\n centered = false,\n}: CardLayoutBlockProps) => {\n const theme = useTheme();\n const {border, ...backgroundImageProps} = getThemedValue(background || {}, theme);\n return (\n <AnimateBlock className={b(null, className)} animate={animated}>\n {(title || description) && (\n <Title\n title={title}\n subtitle={description}\n className={b('title', {centered}, titleClassName)}\n colJustifyContent={\n centered ? GridJustifyContent.Center : GridJustifyContent.Start\n }\n />\n )}\n <div\n className={b('content', {\n 'with-background': !isEmpty(background),\n })}\n >\n <BackgroundImage className={b('image', {border})} {...backgroundImageProps} />\n <Row>\n {React.Children.map(children, (child, index) => (\n <Col key={index} sizes={colSizes} className={b('item')}>\n {child}\n </Col>\n ))}\n </Row>\n </div>\n </AnimateBlock>\n );\n};\n\nexport default CardLayout;\n"]}
@@ -46,4 +46,21 @@ unpredictable css rules order in build */
46
46
  }
47
47
  .pc-filter-block__cards-container {
48
48
  width: 100%;
49
+ }
50
+ .pc-filter-block__toggle {
51
+ margin-top: 24px;
52
+ padding-inline: 24px;
53
+ }
54
+ @media (min-width: 769px) {
55
+ .pc-filter-block.pc-AnimateBlock .pc-filter-block__toggle, .pc-AnimateBlock .pc-filter-block .pc-filter-block__toggle {
56
+ position: relative;
57
+ top: 100px;
58
+ opacity: 0;
59
+ }
60
+ .pc-filter-block.pc-AnimateBlock.animate .pc-filter-block__toggle, .pc-AnimateBlock .pc-filter-block.animate .pc-filter-block__toggle {
61
+ top: 0;
62
+ opacity: 1;
63
+ transition: top 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
64
+ transition-delay: 0s;
65
+ }
49
66
  }
@@ -1,4 +1,4 @@
1
1
  import { FilterBlockProps } from "../../models/index.js";
2
2
  import './FilterBlock.css';
3
- declare const FilterBlock: ({ title, description, tags, tagButtonSize, allTag, items, colSizes, centered, animated, }: FilterBlockProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const FilterBlock: ({ title, description, tags, tagButtonSize, allTag, items, colSizes, visibleRowsCount, expandButtonText, collapseButtonText, centered, animated, }: FilterBlockProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default FilterBlock;
@@ -1,17 +1,39 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
- import { CardLayoutBlock } from "../index.js";
3
+ import { Button } from '@gravity-ui/uikit';
4
4
  import { AnimateBlock, Title } from "../../components/index.js";
5
5
  import ButtonTabs from "../../components/ButtonTabs/ButtonTabs.js";
6
+ import { BREAKPOINTS } from "../../constants.js";
6
7
  import { ConstructorItem } from "../../containers/PageConstructor/components/ConstructorItem/index.js";
8
+ import { useWindowWidth } from "../../context/windowWidthContext/index.js";
7
9
  import { Col, Row } from "../../grid/index.js";
10
+ import { GridColumnSize } from "../../grid/types.js";
8
11
  import { useAnalytics } from "../../hooks/index.js";
9
12
  import { block, getBlockKey } from "../../utils/index.js";
13
+ import CardLayoutBlock, { CARD_LAYOUT_DEFAULT_SIZES } from "../CardLayout/CardLayout.js";
10
14
  import { i18n } from "./i18n/index.js";
11
15
  import './FilterBlock.css';
12
16
  const b = block('filter-block');
13
- const FilterBlock = ({ title, description, tags, tagButtonSize, allTag, items, colSizes, centered, animated, }) => {
17
+ const GRID_COLUMN_SIZES = [
18
+ GridColumnSize.Sm,
19
+ GridColumnSize.Md,
20
+ GridColumnSize.Lg,
21
+ GridColumnSize.Xl,
22
+ ];
23
+ function responsiveValue({ values, width, fallback }) {
24
+ let result = values.all ?? fallback;
25
+ for (const size of GRID_COLUMN_SIZES) {
26
+ const value = values[size];
27
+ if (width >= BREAKPOINTS[size] && value !== undefined) {
28
+ result = value;
29
+ }
30
+ }
31
+ return result;
32
+ }
33
+ const FilterBlock = ({ title, description, tags, tagButtonSize, allTag, items, colSizes, visibleRowsCount, expandButtonText, collapseButtonText, centered, animated, }) => {
14
34
  const handleAnalytics = useAnalytics();
35
+ const width = useWindowWidth();
36
+ const [expanded, setExpanded] = React.useState(false);
15
37
  const tabButtons = React.useMemo(() => {
16
38
  let allButton;
17
39
  if (allTag) {
@@ -49,6 +71,9 @@ const FilterBlock = ({ title, description, tags, tagButtonSize, allTag, items, c
49
71
  ? tabButtons[0].id
50
72
  : selectedTag;
51
73
  }, [tabButtons, selectedTag]);
74
+ React.useEffect(() => {
75
+ setExpanded(false);
76
+ }, [actualTag]);
52
77
  const cards = React.useMemo(() => {
53
78
  const itemsWithKeys = items.map((item, index) => ({
54
79
  ...item,
@@ -58,6 +83,19 @@ const FilterBlock = ({ title, description, tags, tagButtonSize, allTag, items, c
58
83
  ? itemsWithKeys.filter((item) => item.tags.includes(actualTag))
59
84
  : itemsWithKeys;
60
85
  }, [actualTag, items]);
86
+ // Only the active tab's configuration determines whether its cards can be collapsed.
87
+ const allTagConfig = typeof allTag === 'object' ? allTag : undefined;
88
+ const activeTag = actualTag === null ? allTagConfig : tags?.find((tag) => tag.id === actualTag);
89
+ const rows = responsiveValue({ values: visibleRowsCount ?? {}, width, fallback: Infinity });
90
+ const columns = Math.max(1, Math.floor(12 /
91
+ responsiveValue({
92
+ values: colSizes ?? CARD_LAYOUT_DEFAULT_SIZES,
93
+ width,
94
+ fallback: 12,
95
+ })));
96
+ const limit = rows > 0 ? Math.floor(rows) * columns : Infinity;
97
+ const canCollapse = Boolean(activeTag?.collapsible && cards.length > limit);
98
+ const visibleCards = canCollapse && !expanded ? cards.slice(0, limit) : cards;
61
99
  const handleSelectTab = React.useCallback((tabId) => {
62
100
  setSelectedTag(tabId);
63
101
  const tabButton = tabButtons.find((tab) => tab.id === tabId);
@@ -65,7 +103,9 @@ const FilterBlock = ({ title, description, tags, tagButtonSize, allTag, items, c
65
103
  handleAnalytics(tabButton.analyticsEvent);
66
104
  }
67
105
  }, [tabButtons, handleAnalytics]);
68
- return (_jsxs(AnimateBlock, { className: b(), animate: animated, children: [title && (_jsx(Title, { className: b('title', { centered: centered }), title: title, subtitle: description })), tabButtons.length && (_jsx(Row, { children: _jsx(Col, { children: _jsx(ButtonTabs, { className: b('tabs', { centered: centered }), items: tabButtons, activeTab: selectedTag, onSelectTab: handleSelectTab, tabSize: tagButtonSize }) }) })), _jsx(Row, { className: b('block-container'), children: _jsx(CardLayoutBlock, { title: "", colSizes: colSizes, className: b('cards-container'), children: cards.map(({ card, key }) => (_jsx(ConstructorItem, { data: card, blockKey: key }, key))) }) })] }));
106
+ return (_jsxs(AnimateBlock, { className: b(), animate: animated, children: [title && (_jsx(Title, { className: b('title', { centered: centered }), title: title, subtitle: description })), tabButtons.length && (_jsx(Row, { children: _jsx(Col, { children: _jsx(ButtonTabs, { className: b('tabs', { centered: centered }), items: tabButtons, activeTab: actualTag, onSelectTab: handleSelectTab, tabSize: tagButtonSize }) }) })), _jsx(Row, { className: b('block-container'), children: _jsx(CardLayoutBlock, { title: "", colSizes: colSizes, className: b('cards-container'), animated: animated, children: visibleCards.map(({ card, key }) => (_jsx(ConstructorItem, { data: card, blockKey: key }, key))) }) }), canCollapse && (_jsx(Button, { className: b('toggle'), style: { transitionDelay: `${Math.min(visibleCards.length, 99) * 0.1}s` }, view: "normal", size: "xl", width: "max", "aria-expanded": expanded, onClick: () => setExpanded((value) => !value), children: expanded
107
+ ? (collapseButtonText ?? i18n('label-collapse'))
108
+ : (expandButtonText ?? i18n('label-expand')) }))] }));
69
109
  };
70
110
  export default FilterBlock;
71
111
  //# sourceMappingURL=FilterBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FilterBlock.js","sourceRoot":"../../../../src","sources":["blocks/FilterBlock/FilterBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,eAAe,EAAC,oBAAW;AACnC,OAAO,EAAC,YAAY,EAAE,KAAK,EAAC,kCAAyB;AACrD,OAAO,UAAiC,kDAA+C;AACvF,OAAO,EAAC,eAAe,EAAC,6EAAo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,YACxE,KAAK,CAAC,GAAG,CAAC,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,EAAE,EAAE,CAAC,CACxB,KAAC,eAAe,IAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAO,GAAG,CAAI,CAC3D,CAAC,GACY,GAChB,IACK,CAClB,CAAC;AACN,CAAC,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {CardLayoutBlock} from '..';\nimport {AnimateBlock, Title} from '../../components';\nimport ButtonTabs, {ButtonTabsItemProps} from '../../components/ButtonTabs/ButtonTabs';\nimport {ConstructorItem} from '../../containers/PageConstructor/components/ConstructorItem';\nimport {Col, Row} from '../../grid';\nimport {useAnalytics} from '../../hooks';\nimport {FilterBlockProps} from '../../models';\nimport {block, getBlockKey} from '../../utils';\n\nimport {i18n} from './i18n';\n\nimport './FilterBlock.scss';\n\nconst b = block('filter-block');\n\nconst FilterBlock = ({\n title,\n description,\n tags,\n tagButtonSize,\n allTag,\n items,\n colSizes,\n centered,\n animated,\n}: FilterBlockProps) => {\n const handleAnalytics = useAnalytics();\n const tabButtons = React.useMemo(() => {\n let allButton: ButtonTabsItemProps | undefined;\n if (allTag) {\n if (typeof allTag === 'boolean') {\n allButton = {\n id: null,\n title: i18n('label-all-tag'),\n };\n } else if (typeof allTag === 'string') {\n allButton = {\n id: null,\n title: allTag,\n };\n } else if (typeof allTag === 'object') {\n allButton = {\n id: null,\n title: allTag.label,\n analyticsEvent: allTag.analyticsEvent,\n };\n }\n }\n const otherButtons: ButtonTabsItemProps[] | undefined =\n tags &&\n tags.map((tag) => ({\n id: tag.id,\n title: tag.label,\n analyticsEvent: tag.analyticsEvent,\n }));\n return [...(allButton ? [allButton] : []), ...(otherButtons ? otherButtons : [])];\n }, [allTag, tags]);\n\n const [selectedTag, setSelectedTag] = React.useState(\n tabButtons.length ? tabButtons[0].id : null,\n );\n\n const actualTag: string | null = React.useMemo(() => {\n return tabButtons.length && !tabButtons.find((tab) => tab.id === selectedTag)\n ? tabButtons[0].id\n : selectedTag;\n }, [tabButtons, selectedTag]);\n\n const cards = React.useMemo(() => {\n const itemsWithKeys = items.map((item, index) => ({\n ...item,\n key: getBlockKey(item.card, index),\n }));\n\n return actualTag\n ? itemsWithKeys.filter((item) => item.tags.includes(actualTag))\n : itemsWithKeys;\n }, [actualTag, items]);\n\n const handleSelectTab = React.useCallback(\n (tabId: string | null) => {\n setSelectedTag(tabId);\n\n const tabButton = tabButtons.find((tab) => tab.id === tabId);\n if (tabButton?.analyticsEvent) {\n handleAnalytics(tabButton.analyticsEvent);\n }\n },\n [tabButtons, handleAnalytics],\n );\n\n return (\n <AnimateBlock className={b()} animate={animated}>\n {title && (\n <Title\n className={b('title', {centered: centered})}\n title={title}\n subtitle={description}\n />\n )}\n {tabButtons.length && (\n <Row>\n <Col>\n <ButtonTabs\n className={b('tabs', {centered: centered})}\n items={tabButtons}\n activeTab={selectedTag}\n onSelectTab={handleSelectTab}\n tabSize={tagButtonSize}\n />\n </Col>\n </Row>\n )}\n <Row className={b('block-container')}>\n <CardLayoutBlock title=\"\" colSizes={colSizes} className={b('cards-container')}>\n {cards.map(({card, key}) => (\n <ConstructorItem data={card} blockKey={key} key={key} />\n ))}\n </CardLayoutBlock>\n </Row>\n </AnimateBlock>\n );\n};\nexport default FilterBlock;\n"]}
1
+ {"version":3,"file":"FilterBlock.js","sourceRoot":"../../../../src","sources":["blocks/FilterBlock/FilterBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAC,YAAY,EAAE,KAAK,EAAC,kCAAyB;AACrD,OAAO,UAAiC,kDAA+C;AACvF,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAC5C,OAAO,EAAC,eAAe,EAAC,6EAAoE;AAC5F,OAAO,EAAC,cAAc,EAAC,kDAAyC;AAChE,OAA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AAQ,EACvB,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,YAE5C,QAAQ;oBACL,CAAC,CAAC,CAAC,kBAAkB,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC;oBAChD,CAAC,CAAC,CAAC,gBAAgB,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,GAC3C,CACZ,IACU,CAClB,CAAC;AACN,CAAC,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {Button} from '@gravity-ui/uikit';\n\nimport {AnimateBlock, Title} from '../../components';\nimport ButtonTabs, {ButtonTabsItemProps} from '../../components/ButtonTabs/ButtonTabs';\nimport {BREAKPOINTS} from '../../constants';\nimport {ConstructorItem} from '../../containers/PageConstructor/components/ConstructorItem';\nimport {useWindowWidth} from '../../context/windowWidthContext';\nimport {Col, Row} from '../../grid';\nimport {GridColumnSize, GridColumnSizesType} from '../../grid/types';\nimport {useAnalytics} from '../../hooks';\nimport {FilterBlockProps} from '../../models';\nimport {block, getBlockKey} from '../../utils';\nimport CardLayoutBlock, {CARD_LAYOUT_DEFAULT_SIZES} from '../CardLayout/CardLayout';\n\nimport {i18n} from './i18n';\n\nimport './FilterBlock.scss';\n\nconst b = block('filter-block');\n\nconst GRID_COLUMN_SIZES = [\n GridColumnSize.Sm,\n GridColumnSize.Md,\n GridColumnSize.Lg,\n GridColumnSize.Xl,\n] as const;\n\ntype ResponsiveValueParams = {\n values: GridColumnSizesType;\n width: number;\n fallback: number;\n};\n\nfunction responsiveValue({values, width, fallback}: ResponsiveValueParams) {\n let result = values.all ?? fallback;\n\n for (const size of GRID_COLUMN_SIZES) {\n const value = values[size];\n\n if (width >= BREAKPOINTS[size] && value !== undefined) {\n result = value;\n }\n }\n\n return result;\n}\n\nconst FilterBlock = ({\n title,\n description,\n tags,\n tagButtonSize,\n allTag,\n items,\n colSizes,\n visibleRowsCount,\n expandButtonText,\n collapseButtonText,\n centered,\n animated,\n}: FilterBlockProps) => {\n const handleAnalytics = useAnalytics();\n const width = useWindowWidth();\n const [expanded, setExpanded] = React.useState(false);\n const tabButtons = React.useMemo(() => {\n let allButton: ButtonTabsItemProps | undefined;\n if (allTag) {\n if (typeof allTag === 'boolean') {\n allButton = {\n id: null,\n title: i18n('label-all-tag'),\n };\n } else if (typeof allTag === 'string') {\n allButton = {\n id: null,\n title: allTag,\n };\n } else if (typeof allTag === 'object') {\n allButton = {\n id: null,\n title: allTag.label,\n analyticsEvent: allTag.analyticsEvent,\n };\n }\n }\n const otherButtons: ButtonTabsItemProps[] | undefined =\n tags &&\n tags.map((tag) => ({\n id: tag.id,\n title: tag.label,\n analyticsEvent: tag.analyticsEvent,\n }));\n return [...(allButton ? [allButton] : []), ...(otherButtons ? otherButtons : [])];\n }, [allTag, tags]);\n\n const [selectedTag, setSelectedTag] = React.useState(\n tabButtons.length ? tabButtons[0].id : null,\n );\n\n const actualTag: string | null = React.useMemo(() => {\n return tabButtons.length && !tabButtons.find((tab) => tab.id === selectedTag)\n ? tabButtons[0].id\n : selectedTag;\n }, [tabButtons, selectedTag]);\n\n React.useEffect(() => {\n setExpanded(false);\n }, [actualTag]);\n\n const cards = React.useMemo(() => {\n const itemsWithKeys = items.map((item, index) => ({\n ...item,\n key: getBlockKey(item.card, index),\n }));\n\n return actualTag\n ? itemsWithKeys.filter((item) => item.tags.includes(actualTag))\n : itemsWithKeys;\n }, [actualTag, items]);\n\n // Only the active tab's configuration determines whether its cards can be collapsed.\n const allTagConfig = typeof allTag === 'object' ? allTag : undefined;\n const activeTag = actualTag === null ? allTagConfig : tags?.find((tag) => tag.id === actualTag);\n const rows = responsiveValue({values: visibleRowsCount ?? {}, width, fallback: Infinity});\n const columns = Math.max(\n 1,\n Math.floor(\n 12 /\n responsiveValue({\n values: colSizes ?? CARD_LAYOUT_DEFAULT_SIZES,\n width,\n fallback: 12,\n }),\n ),\n );\n const limit = rows > 0 ? Math.floor(rows) * columns : Infinity;\n const canCollapse = Boolean(activeTag?.collapsible && cards.length > limit);\n const visibleCards = canCollapse && !expanded ? cards.slice(0, limit) : cards;\n\n const handleSelectTab = React.useCallback(\n (tabId: string | null) => {\n setSelectedTag(tabId);\n\n const tabButton = tabButtons.find((tab) => tab.id === tabId);\n if (tabButton?.analyticsEvent) {\n handleAnalytics(tabButton.analyticsEvent);\n }\n },\n [tabButtons, handleAnalytics],\n );\n\n return (\n <AnimateBlock className={b()} animate={animated}>\n {title && (\n <Title\n className={b('title', {centered: centered})}\n title={title}\n subtitle={description}\n />\n )}\n {tabButtons.length && (\n <Row>\n <Col>\n <ButtonTabs\n className={b('tabs', {centered: centered})}\n items={tabButtons}\n activeTab={actualTag}\n onSelectTab={handleSelectTab}\n tabSize={tagButtonSize}\n />\n </Col>\n </Row>\n )}\n <Row className={b('block-container')}>\n <CardLayoutBlock\n title=\"\"\n colSizes={colSizes}\n className={b('cards-container')}\n animated={animated}\n >\n {visibleCards.map(({card, key}) => (\n <ConstructorItem data={card} blockKey={key} key={key} />\n ))}\n </CardLayoutBlock>\n </Row>\n {canCollapse && (\n <Button\n className={b('toggle')}\n style={{transitionDelay: `${Math.min(visibleCards.length, 99) * 0.1}s`}}\n view=\"normal\"\n size=\"xl\"\n width=\"max\"\n aria-expanded={expanded}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded\n ? (collapseButtonText ?? i18n('label-collapse'))\n : (expandButtonText ?? i18n('label-expand'))}\n </Button>\n )}\n </AnimateBlock>\n );\n};\nexport default FilterBlock;\n"]}
@@ -1,3 +1,5 @@
1
1
  {
2
- "label-all-tag": "All"
2
+ "label-all-tag": "All",
3
+ "label-expand": "Show all",
4
+ "label-collapse": "Show less"
3
5
  }
@@ -1,5 +1,5 @@
1
- export declare const i18n: ((key: "label-all-tag", params?: import("@gravity-ui/i18n").Params) => string) & {
1
+ export declare const i18n: ((key: "label-all-tag" | "label-expand" | "label-collapse", params?: import("@gravity-ui/i18n").Params) => string) & {
2
2
  keysetData: {
3
- "pc-FilterBlock": Record<"label-all-tag", import("@gravity-ui/i18n").KeyData>;
3
+ "pc-FilterBlock": Record<"label-all-tag" | "label-expand" | "label-collapse", import("@gravity-ui/i18n").KeyData>;
4
4
  };
5
5
  };
@@ -1,3 +1,5 @@
1
1
  {
2
- "label-all-tag": "Все"
2
+ "label-all-tag": "Все",
3
+ "label-expand": "Смотреть всё",
4
+ "label-collapse": "Свернуть"
3
5
  }
@@ -46,6 +46,9 @@ export declare const FilterTagProps: {
46
46
  };
47
47
  };
48
48
  };
49
+ collapsible: {
50
+ type: string;
51
+ };
49
52
  };
50
53
  };
51
54
  export declare const FilterItemProps: {
@@ -119,6 +122,9 @@ export declare const FilterProps: {
119
122
  };
120
123
  };
121
124
  };
125
+ collapsible: {
126
+ type: string;
127
+ };
122
128
  };
123
129
  optionName?: undefined;
124
130
  })[];
@@ -128,6 +134,22 @@ export declare const FilterProps: {
128
134
  additionalProperties: boolean;
129
135
  properties: {};
130
136
  };
137
+ visibleRowsCount: {
138
+ type: string;
139
+ additionalProperties: boolean;
140
+ properties: {
141
+ [k: string]: {
142
+ type: string;
143
+ minimum: number;
144
+ };
145
+ };
146
+ };
147
+ expandButtonText: {
148
+ type: string;
149
+ };
150
+ collapseButtonText: {
151
+ type: string;
152
+ };
131
153
  tags: {
132
154
  type: string;
133
155
  items: {
@@ -387,6 +409,9 @@ export declare const FilterBlock: {
387
409
  };
388
410
  };
389
411
  };
412
+ collapsible: {
413
+ type: string;
414
+ };
390
415
  };
391
416
  optionName?: undefined;
392
417
  })[];
@@ -396,6 +421,22 @@ export declare const FilterBlock: {
396
421
  additionalProperties: boolean;
397
422
  properties: {};
398
423
  };
424
+ visibleRowsCount: {
425
+ type: string;
426
+ additionalProperties: boolean;
427
+ properties: {
428
+ [k: string]: {
429
+ type: string;
430
+ minimum: number;
431
+ };
432
+ };
433
+ };
434
+ expandButtonText: {
435
+ type: string;
436
+ };
437
+ collapseButtonText: {
438
+ type: string;
439
+ };
399
440
  tags: {
400
441
  type: string;
401
442
  items: {
@@ -13,6 +13,7 @@ export const FilterTagProps = {
13
13
  type: 'string',
14
14
  },
15
15
  analyticsEvent: AnalyticsEventSchema,
16
+ collapsible: { type: 'boolean' },
16
17
  },
17
18
  };
18
19
  export const FilterItemProps = {
@@ -51,6 +52,16 @@ export const FilterProps = {
51
52
  ],
52
53
  },
53
54
  colSizes: containerSizesObject,
55
+ visibleRowsCount: {
56
+ type: 'object',
57
+ additionalProperties: false,
58
+ properties: Object.fromEntries(['all', 'sm', 'md', 'lg', 'xl'].map((size) => [
59
+ size,
60
+ { type: 'integer', minimum: 1 },
61
+ ])),
62
+ },
63
+ expandButtonText: { type: 'string' },
64
+ collapseButtonText: { type: 'string' },
54
65
  tags: filteredArray(FilterTagProps),
55
66
  items: filteredArray(FilterItemProps),
56
67
  tagButtonSize: {
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/FilterBlock/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,oBAAoB,GACvB,0CAAuC;AACxC,OAAO,EAAC,oBAAoB,EAAC,yCAAsC;AACnE,OAAO,EAAC,aAAa,EAAC,yCAAsC;AAE5D,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE;QACR,EAAE,EAAE;YACA,IAAI,EAAE,QAAQ;SACjB;QACD,KAAK,EAAE;YACH,IAAI,EAAE,QAAQ;SACjB;QACD,cAAc,EAAE,oBAAoB;KACvC;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE;QACR,IAAI,EAAE;YACF,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;aACjB;SACJ;QACD,IAAI,EAAE,EAAC,IAAI,EAAE,yBAAyB,EAAC;KAC1C;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;IACvB,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3B,UAAU,EAAE;QACR,GAAG,cAAc;QACjB,GAAG,eAAe;QAClB,GAAG,gBAAgB;QACnB,MAAM,EAAE;YACJ,KAAK,EAAE;gBACH;oBACI,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE,MAAM;iBACrB;gBACD;oBACI,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE,OAAO;iBACtB;gBACD;oBACI,GAAG,cAAc;iBACpB;aACJ;SACJ;QACD,QAAQ,EAAE,oBAAoB;QAC9B,IAAI,EAAE,aAAa,CAAC,cAAc,CAAC;QACnC,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC;QACrC,aAAa,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC;SAC9B;QACD,QAAQ,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC;KAC9B;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;IACvB,cAAc,EAAE,WAAW;CAC9B,CAAC","sourcesContent":["import {\n AnimatableProps,\n BlockBaseProps,\n BlockHeaderProps,\n containerSizesObject,\n} from '../../schema/validators/common';\nimport {AnalyticsEventSchema} from '../../schema/validators/event';\nimport {filteredArray} from '../../schema/validators/utils';\n\nexport const FilterTagProps = {\n type: 'object',\n additionalProperties: false,\n required: ['id', 'label'],\n properties: {\n id: {\n type: 'string',\n },\n label: {\n type: 'string',\n },\n analyticsEvent: AnalyticsEventSchema,\n },\n};\n\nexport const FilterItemProps = {\n additionalProperties: false,\n required: ['tags', 'card'],\n properties: {\n tags: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n card: {$ref: 'self#/definitions/cards'},\n },\n};\n\nexport const FilterProps = {\n additionalProperties: false,\n required: ['tags', 'items'],\n properties: {\n ...BlockBaseProps,\n ...AnimatableProps,\n ...BlockHeaderProps,\n allTag: {\n oneOf: [\n {\n type: 'boolean',\n optionName: 'auto',\n },\n {\n type: 'string',\n optionName: 'cutom',\n },\n {\n ...FilterTagProps,\n },\n ],\n },\n colSizes: containerSizesObject,\n tags: filteredArray(FilterTagProps),\n items: filteredArray(FilterItemProps),\n tagButtonSize: {\n type: 'string',\n enum: ['s', 'm', 'l', 'xl'],\n },\n centered: {type: 'boolean'},\n },\n};\n\nexport const FilterBlock = {\n 'filter-block': FilterProps,\n};\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/FilterBlock/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,oBAAoB,GACvB,0CAAuC;AACxC,OAAO,EAAC,oBAAoB,EAAC,yCAAsC;AACnE,OAAO,EAAC,aAAa,EAAC,yCAAsC;AAE5D,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE;QACR,EAAE,EAAE;YACA,IAAI,EAAE,QAAQ;SACjB;QACD,KAAK,EAAE;YACH,IAAI,EAAE,QAAQ;SACjB;QACD,cAAc,EAAE,oBAAoB;QACpC,WAAW,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC;KACjC;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE;QACR,IAAI,EAAE;YACF,IAAI,EA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;KAC9B;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;IACvB,cAAc,EAAE,WAAW;CAC9B,CAAC","sourcesContent":["import {\n AnimatableProps,\n BlockBaseProps,\n BlockHeaderProps,\n containerSizesObject,\n} from '../../schema/validators/common';\nimport {AnalyticsEventSchema} from '../../schema/validators/event';\nimport {filteredArray} from '../../schema/validators/utils';\n\nexport const FilterTagProps = {\n type: 'object',\n additionalProperties: false,\n required: ['id', 'label'],\n properties: {\n id: {\n type: 'string',\n },\n label: {\n type: 'string',\n },\n analyticsEvent: AnalyticsEventSchema,\n collapsible: {type: 'boolean'},\n },\n};\n\nexport const FilterItemProps = {\n additionalProperties: false,\n required: ['tags', 'card'],\n properties: {\n tags: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n card: {$ref: 'self#/definitions/cards'},\n },\n};\n\nexport const FilterProps = {\n additionalProperties: false,\n required: ['tags', 'items'],\n properties: {\n ...BlockBaseProps,\n ...AnimatableProps,\n ...BlockHeaderProps,\n allTag: {\n oneOf: [\n {\n type: 'boolean',\n optionName: 'auto',\n },\n {\n type: 'string',\n optionName: 'cutom',\n },\n {\n ...FilterTagProps,\n },\n ],\n },\n colSizes: containerSizesObject,\n visibleRowsCount: {\n type: 'object',\n additionalProperties: false,\n properties: Object.fromEntries(\n ['all', 'sm', 'md', 'lg', 'xl'].map((size) => [\n size,\n {type: 'integer', minimum: 1},\n ]),\n ),\n },\n expandButtonText: {type: 'string'},\n collapseButtonText: {type: 'string'},\n tags: filteredArray(FilterTagProps),\n items: filteredArray(FilterItemProps),\n tagButtonSize: {\n type: 'string',\n enum: ['s', 'm', 'l', 'xl'],\n },\n centered: {type: 'boolean'},\n },\n};\n\nexport const FilterBlock = {\n 'filter-block': FilterProps,\n};\n"]}
@@ -19,7 +19,7 @@ export declare const blockMap: {
19
19
  "content-layout-block": (props: import("./models/index.js").ContentLayoutBlockProps) => import("react/jsx-runtime").JSX.Element;
20
20
  "share-block": ({ items, title }: import("./models/index.js").ShareBlockProps) => import("react/jsx-runtime").JSX.Element;
21
21
  "map-block": ({ map, border, disableShadow, ...props }: import("./models/index.js").MapBlockProps) => import("react/jsx-runtime").JSX.Element;
22
- "filter-block": ({ title, description, tags, tagButtonSize, allTag, items, colSizes, centered, animated, }: import("./models/index.js").FilterBlockProps) => import("react/jsx-runtime").JSX.Element;
22
+ "filter-block": ({ title, description, tags, tagButtonSize, allTag, items, colSizes, visibleRowsCount, expandButtonText, collapseButtonText, centered, animated, }: import("./models/index.js").FilterBlockProps) => import("react/jsx-runtime").JSX.Element;
23
23
  "form-block": (props: import("./models/index.js").FormBlockProps) => import("react/jsx-runtime").JSX.Element | null;
24
24
  "slider-block": ({ animated, title, description, type, anchorId, arrows, adaptive, autoplay: autoplayMs, dots, initialSlide, className, dotsClassName, disclaimer, children, blockClassName, arrowSize, slidesToShow, onSlideChange, onSlideChangeTransitionStart, onSlideChangeTransitionEnd, onActiveIndexChange, onBreakpoint, }: React.PropsWithChildren<import("./blocks/Slider/Slider.js").SliderProps>) => import("react/jsx-runtime").JSX.Element;
25
25
  };
@@ -301,6 +301,7 @@ export interface CardLayoutBlockProps extends Childable, Animatable, LoadableChi
301
301
  }>;
302
302
  }
303
303
  export type FilterTag = {
304
+ collapsible?: boolean;
304
305
  id: string;
305
306
  label: string;
306
307
  analyticsEvent?: AnalyticsEventsProp;
@@ -310,6 +311,9 @@ export type FilterItem = {
310
311
  card: SubBlockModels;
311
312
  };
312
313
  export interface FilterBlockProps extends Animatable {
314
+ visibleRowsCount?: Partial<Record<GridColumnSize, number>>;
315
+ expandButtonText?: string;
316
+ collapseButtonText?: string;
313
317
  tags: FilterTag[];
314
318
  items: FilterItem[];
315
319
  title?: TitleItemProps | string;
@@ -1 +1 @@
1
- {"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":"AA+CA,MAAM,CAAN,IAAY,SAyBX;AAzBD,WAAY,SAAS;IACjB,wDAA2C,C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B,KAApB,oBAAoB,QAM/B;AAOD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,kDAA4B,CAAA;IAC5B,kDAA4B,CAAA;IAC5B,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B","sourcesContent":["import * as React from 'react';\n\nimport {ButtonSize} from '@gravity-ui/uikit';\n\nimport {GridColumnSize, GridColumnSizesType, IndentValue} from '../../grid/types';\nimport {ThemeSupporting} from '../../utils';\nimport {DeviceSupporting} from '../../utils/breakpoint';\nimport {AnalyticsEventsBase, AnalyticsEventsProp} from '../common';\n\nimport {\n AnchorProps,\n Animatable,\n BackgroundImageProps,\n ButtonProps,\n CardBorder,\n ContentSize,\n ContentTextSize,\n ContentTheme,\n FileLinkProps,\n GravityIconProps,\n HeaderBreadCrumbsProps,\n HeaderImageSize,\n HeaderOffset,\n HeaderWidth,\n ImageDeviceProps,\n ImageProps,\n Justify,\n LegendTableMarkerType,\n LinkProps,\n MapProps,\n MediaComponentImageProps,\n MediaComponentVideoProps,\n MediaDirection,\n MediaProps,\n MediaView,\n TextSize,\n TextTheme,\n ThemedImage,\n ThemedMediaProps,\n ThemedMediaVideoProps,\n TitleItemBaseProps,\n TitleItemProps,\n WithBorder,\n YandexFormProps,\n} from './common';\nimport {BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels} from './sub-blocks';\n\nexport enum BlockType {\n PromoFeaturesBlock = 'promo-features-block',\n ExtendedFeaturesBlock = 'extended-features-block',\n /** @deprecated */\n SliderOldBlock = 'slider-old-block',\n SliderBlock = 'slider-block',\n QuestionsBlock = 'questions-block',\n FoldableListBlock = 'foldable-list-block',\n BannerBlock = 'banner-block',\n CompaniesBlock = 'companies-block',\n MediaBlock = 'media-block',\n InfoBlock = 'info-block',\n TableBlock = 'table-block',\n TabsBlock = 'tabs-block',\n HeaderSliderBlock = 'header-slider-block',\n HeaderBlock = 'header-block',\n HeroBlock = 'hero-block',\n IconsBlock = 'icons-block',\n CardLayoutBlock = 'card-layout-block',\n ContentLayoutBlock = 'content-layout-block',\n ShareBlock = 'share-block',\n MapBlock = 'map-block',\n FilterBlock = 'filter-block',\n FormBlock = 'form-block',\n FooterBlock = 'footer-block',\n}\n\nexport const BlockTypes = Object.values(BlockType);\nexport const HeaderBlockTypes = [\n BlockType.HeaderBlock,\n BlockType.HeaderSliderBlock,\n BlockType.HeroBlock,\n];\n\nexport interface Childable {\n children?: SubBlock[];\n}\n\n//block props\nexport interface BlockBaseProps {\n anchor?: AnchorProps;\n visible?: GridColumnSize | Partial<Record<GridColumnSize, boolean>>;\n /** @deprecated */\n resetPaddings?: boolean;\n indent?: {\n top?: IndentValue;\n bottom?: IndentValue;\n };\n qa?: string;\n}\n\nexport interface LoadableProps {\n source: string;\n /**\n * @deprecated Will be moved to params\n */\n serviceId?: number;\n params?: Record<string, string | number | boolean | object>;\n}\n\nexport interface LoadableChildren {\n loadable?: LoadableProps;\n}\n\nexport enum SliderBreakpointNames {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n Xl = 'xl',\n}\n\nexport enum SliderType {\n MediaCard = 'media-card',\n HeaderCard = 'header-card',\n FullscreenCard = 'fullscreen-card',\n}\n\nexport type SliderBreakpointParams = Record<SliderBreakpointNames, number>;\nexport type SlidesToShow = Partial<SliderBreakpointParams> | number;\n\nexport interface SliderOldProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface SliderProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface HeaderSliderBlockProps extends Omit<SliderOldProps, 'title' | 'description'> {\n items: HeaderBlockProps[];\n}\n\ninterface HeaderBackgroundProps {\n /** @deprecated replaced by Media Props image */\n url?: string;\n /** @deprecated replaced by Media Props image */\n disableCompress?: boolean;\n}\n\nexport interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, Partial<MediaProps> {\n fullWidth?: boolean;\n fullWidthMedia?: boolean;\n}\n\nexport type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;\n\nexport interface HeaderBlockVideoIframe {\n src: string;\n autoplay?: boolean;\n previewImg?: string;\n height?: number;\n}\n\nexport interface HeaderBlockProps {\n title: string;\n overtitle?: string | JSX.Element;\n description?: string;\n additionalInfo?: string;\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];\n width?: HeaderWidth;\n /** @deprecated imageSize now depends on width */\n imageSize?: HeaderImageSize;\n /**\n * @deprecated used only on the main page\n * TODO: delete after the possibility to remove padding-bottom in the block\n */\n offset?: HeaderOffset;\n image?: ThemedImage;\n video?: ThemedMediaVideoProps;\n videoIframe?: HeaderBlockVideoIframe;\n mediaView?: MediaView;\n centered?: boolean;\n background?: ThemedHeaderBlockBackground;\n theme?: 'light' | 'dark';\n verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';\n breadcrumbs?: HeaderBreadCrumbsProps;\n status?: JSX.Element;\n renderTitle?: (title: string) => React.ReactNode;\n}\n\nexport interface HeroBlockBackground\n extends Partial<MediaComponentImageProps>,\n Partial<MediaComponentVideoProps> {\n color?: string;\n}\n\nexport interface HeroBlockMedia extends Partial<MediaProps> {\n roundCorners?: boolean;\n}\n\nexport interface HeroBlockContent\n extends Pick<ContentBlockProps, 'text' | 'list' | 'additionalInfo' | 'links' | 'theme'> {\n title: Required<ContentBlockProps>['title'];\n}\n\nexport interface HeroBlockProps extends HeroBlockContent {\n breadcrumbs?: HeaderBreadCrumbsProps;\n // TODO: add overtitle to ContentProps\n overtitle?: string | JSX.Element;\n /** Buttons are always rendered at size `xl` — a per-button `size` has no effect. */\n buttons?: ThemeSupporting<\n | Pick<\n ButtonProps,\n 'url' | 'text' | 'theme' | 'primary' | 'extraProps' | 'target' | 'analyticsEvents'\n >\n | React.ReactNode\n >[];\n media?: ThemeSupporting<HeroBlockMedia>;\n fullWidth?: boolean;\n verticalOffset?: 's' | 'm' | 'l' | 'xl';\n background?: ThemeSupporting<HeroBlockBackground>;\n}\n\nexport interface ExtendedFeaturesItem\n extends Omit<\n ContentBlockProps,\n 'title' | 'theme' | 'centered' | 'colSizes' | 'size' | 'title'\n > {\n title?: string;\n label?: string;\n icon?: ThemedImage;\n /** @deprecated **/\n link?: LinkProps;\n}\n\nexport interface ExtendedFeaturesProps extends Animatable {\n items: ExtendedFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n colSizes?: GridColumnSizesType;\n}\n\nexport interface PromoFeaturesItem {\n title: string;\n text: string;\n theme?: 'accent' | 'accent-light' | 'primary';\n media?: ThemeSupporting<MediaProps>;\n}\n\nexport interface PromoFeaturesProps extends Animatable {\n items: PromoFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n theme?: 'grey' | 'default';\n}\n\nexport interface QuestionItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n onClick?: (index: number, newOpenState: boolean) => void;\n}\n\nexport interface QuestionsProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: QuestionItem[];\n}\n\nexport interface QuestionBlockItemProps extends QuestionItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface FoldableListItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface FoldableListProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: FoldableListItem[];\n}\n\nexport interface FoldableListBlockItemProps extends FoldableListItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface BannerBlockProps extends BannerCardProps, Animatable {}\n\nexport interface CompaniesBlockProps extends Animatable {\n title: string;\n description?: string;\n images: ThemeSupporting<ImageDeviceProps>;\n}\n\nexport interface MediaBaseBlockProps extends Animatable, MediaContentProps {\n direction?: MediaDirection;\n mobileDirection?: MediaDirection;\n largeMedia?: boolean;\n mediaOnly?: boolean;\n mediaOnlyColSizes?: GridColumnSizesType;\n}\n\nexport interface MediaContentProps\n extends Omit<ContentBlockProps, 'colSizes' | 'text' | 'theme' | 'centered'> {\n description?: string;\n /** @deprecated Use array of buttons from ContentBlockProps instead**/\n button?: ButtonProps;\n}\n\nexport interface MediaBlockProps extends MediaBaseBlockProps, WithBorder {\n media: ThemeSupporting<MediaProps>;\n}\n\nexport interface MapBlockProps extends MediaBaseBlockProps, WithBorder {\n map: Omit<MapProps, 'forceAspectRatio' | 'areaMargin' | 'copyrightPosition'>;\n}\n\nexport interface InfoBlockProps {\n theme?: TextTheme;\n backgroundColor?: ThemeSupporting<string>;\n /** @deprecated **/\n title?: string;\n /** @deprecated **/\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme'>[];\n /** @deprecated **/\n sectionsTitle?: string;\n /** @deprecated **/\n links?: Pick<LinkProps, 'text' | 'url'>[];\n leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n}\n\nexport interface TableProps {\n content: string[][];\n legend?: string[];\n hideLegend?: boolean;\n justify?: Justify[];\n marker?: LegendTableMarkerType;\n /**\n * Only as accessible name, not displayed explicitly\n */\n caption?: string;\n}\n\nexport interface TableBlockProps {\n title: string;\n table: TableProps;\n}\n\nexport interface TabsBlockItem\n extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'>,\n WithBorder {\n tabName: string;\n /**\n * @deprecated Use array links from ContentBlockProps instead\n */\n link?: LinkProps;\n image?: ThemedImage;\n caption?: string;\n media?: ThemedMediaProps;\n}\n\nexport interface TabsBlockProps extends Animatable {\n title?: TitleItemProps | string;\n description?: string;\n tabsColSizes?: GridColumnSizesType;\n centered?: boolean;\n direction?: MediaDirection;\n items: TabsBlockItem[];\n contentSize?: ContentSize;\n}\n\nexport interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n titleClassName?: string;\n centered?: boolean;\n description?: string;\n colSizes?: GridColumnSizesType;\n background?: ThemeSupporting<\n BackgroundImageProps & {\n border?: CardBorder;\n }\n >;\n}\n\nexport type FilterTag = {\n id: string;\n label: string;\n analyticsEvent?: AnalyticsEventsProp;\n};\n\nexport type FilterItem = {\n tags: string[];\n card: SubBlockModels;\n};\n\nexport interface FilterBlockProps extends Animatable {\n tags: FilterTag[];\n items: FilterItem[];\n title?: TitleItemProps | string;\n description?: string;\n tagButtonSize?: ButtonSize;\n allTag?: boolean | string | FilterTag;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n}\n\nexport interface IconsBlockItemProps extends AnalyticsEventsBase {\n url?: string;\n text?: string;\n src: ThemeSupporting<string>;\n}\n\nexport interface IconsBlockProps {\n title?: string;\n description?: string;\n size?: 's' | 'm' | 'l';\n items: IconsBlockItemProps[];\n colSizes?: GridColumnSizesType;\n}\n\ninterface ContentLayoutBlockParams {\n size?: ContentSize;\n background?: ThemeSupporting<BackgroundImageProps>;\n centered?: boolean;\n theme?: ContentTheme;\n textWidth?: ContentTextSize;\n}\n\nexport interface ContentLayoutBlockProps extends ContentLayoutBlockParams {\n textContent: ContentBlockProps;\n fileContent?: FileLinkProps[];\n}\n\nexport type SVGIcon = (props: React.SVGProps<SVGSVGElement>) => React.ReactNode;\n\nexport interface ContentItemProps {\n title?: string;\n text?: string;\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n}\n\nexport interface ContentListProps {\n list: ContentItemProps[];\n size: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentBlockProps {\n title?: TitleItemBaseProps | string;\n titleId?: string;\n text?: string;\n textId?: string;\n additionalInfo?: string;\n links?: LinkProps[];\n buttons?: (ButtonProps | React.ReactNode)[];\n size?: ContentSize;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n theme?: ContentTheme;\n list?: ContentItemProps[];\n controlPosition?: 'default' | 'bottom';\n}\n\nexport enum PCShareSocialNetwork {\n Vk = 'vk',\n Telegram = 'telegram',\n Twitter = 'twitter',\n Facebook = 'facebook',\n LinkedIn = 'linkedin',\n}\n\nexport interface ShareBlockProps {\n items: PCShareSocialNetwork[];\n title?: string;\n}\n\nexport enum FormBlockDataTypes {\n YANDEX = 'yandex',\n HUBSPOT = 'hubspot',\n}\n\nexport enum FormBlockDirection {\n FormContent = 'form-content',\n ContentForm = 'content-form',\n Center = 'center',\n}\n\nexport interface FormBlockYandexData {\n yandex: ThemeSupporting<YandexFormProps>;\n}\n\nexport interface FormBlockHubspotData {\n hubspot: ThemeSupporting<HubspotFormProps>;\n}\n\nexport type FormBlockData = FormBlockYandexData | FormBlockHubspotData;\n\nexport interface FormBlockBackgroundProps extends Omit<BackgroundImageProps, 'style'> {\n style?: DeviceSupporting<React.CSSProperties>;\n}\n\nexport interface FormBlockProps {\n formData: FormBlockData;\n title?: string;\n textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;\n direction?: FormBlockDirection;\n background?: ThemeSupporting<FormBlockBackgroundProps>;\n customFormNode?: React.ReactNode;\n additionalContentNode?: React.ReactNode;\n}\n\nexport interface FooterLinkColumn {\n title: string;\n links: LinkProps[];\n}\n\nexport interface FooterLogoProps {\n image: ThemeSupporting<ImageProps>;\n url?: string;\n alt?: string;\n}\n\nexport interface FooterSection {\n columns: FooterLinkColumn[];\n}\n\nexport interface FooterContactItem {\n icon: ThemeSupporting<ImageProps>;\n url: string;\n urlTitle?: string;\n}\n\nexport interface FooterContacts {\n title?: string;\n iconsSize?: 'm' | 'l';\n links?: FooterContactItem[];\n linksPosition?: 'left' | 'center';\n titlePosition?: 'top' | 'near';\n}\n\nexport interface FooterDisclaimerFloor {\n text: string;\n align: 'left' | 'center';\n}\n\nexport interface FooterCopyright {\n links?: Required<Pick<LinkProps, 'text' | 'url'>>[];\n linksOverflowStrategy?: 'dropdown' | 'line-wrap';\n languageSwitcher?: {\n items: {\n text: string;\n href: string;\n }[];\n buttonText?: string;\n image?: ThemeSupporting<ImageProps>;\n };\n logo?: FooterLogoProps;\n copyrightText?: string;\n}\n\nexport interface FooterAttributionFloor {\n text: string;\n}\n\nexport interface FooterSecondFloor {\n copyright?: string;\n links?: LinkProps[];\n contacts?: FooterContactItem[];\n}\n\nexport interface FooterBlockProps {\n /** Floor 1: first row — logo (if present) + these columns */\n navigation?: {\n logo?: FooterLogoProps & {\n placement?: 'left' | 'top';\n };\n colSizes?: GridColumnSizesType;\n columnsPerRow?: number;\n columns: FooterLinkColumn[];\n };\n /** Floor 2: social row (title + social icons) */\n contacts?: FooterContacts;\n /** Floor 3: legal disclaimer (YFM) */\n disclaimer?: FooterDisclaimerFloor;\n /** Floor 4: privacy/terms links, language, copyright */\n copyright?: FooterCopyright;\n /** Floor 5: attribution (\"Created with ...\") */\n attribution?: boolean;\n backgroundColor?: ThemeSupporting<string>;\n indentTop?: IndentValue;\n}\n\n//block models\nexport type HeaderBlockModel = {\n type: BlockType.HeaderBlock;\n} & HeaderBlockProps;\n\nexport type HeroBlockModel = {\n type: BlockType.HeroBlock;\n} & HeroBlockProps;\n\nexport type SliderOldBlockModel = {\n type: BlockType.SliderOldBlock;\n} & SliderOldProps;\n\nexport type ExtendedFeaturesBlockModel = {\n type: BlockType.ExtendedFeaturesBlock;\n} & ExtendedFeaturesProps;\n\nexport type PromoFeaturesBlockModel = {\n type: BlockType.PromoFeaturesBlock;\n} & PromoFeaturesProps;\n\nexport type QuestionsBlockModel = {\n type: BlockType.QuestionsBlock;\n} & QuestionsProps;\n\nexport type FoldableListBlockModel = {\n type: BlockType.FoldableListBlock;\n} & FoldableListProps;\n\nexport type BannerBlockModel = {\n type: BlockType.BannerBlock;\n} & BannerBlockProps;\n\nexport type CompaniesBlockModel = {\n type: BlockType.CompaniesBlock;\n} & CompaniesBlockProps;\n\nexport type MediaBlockModel = {\n type: BlockType.MediaBlock;\n} & MediaBlockProps;\n\nexport type MapBlockModel = {\n type: BlockType.MapBlock;\n} & MapBlockProps;\n\nexport type InfoBlockModel = {\n type: BlockType.InfoBlock;\n} & InfoBlockProps;\n\nexport type TableBlockModel = {\n type: BlockType.TableBlock;\n} & TableBlockProps;\n\nexport type TabsBlockModel = {\n type: BlockType.TabsBlock;\n} & TabsBlockProps;\n\nexport type CardLayoutBlockModel = {\n type: BlockType.CardLayoutBlock;\n} & CardLayoutBlockProps;\n\nexport type FilterBlockModel = {\n type: BlockType.FilterBlock;\n} & FilterBlockProps;\n\nexport type IconsBlockModel = {\n type: BlockType.IconsBlock;\n} & IconsBlockProps;\n\nexport type HeaderSliderBlockModel = {\n type: BlockType.HeaderSliderBlock;\n} & HeaderSliderBlockProps;\n\nexport type ContentLayoutBlockModel = {\n type: BlockType.ContentLayoutBlock;\n} & ContentLayoutBlockProps;\n\nexport type ShareBLockModel = {\n type: BlockType.ShareBlock;\n} & ShareBlockProps;\n\nexport type FormBlockModel = {\n type: BlockType.FormBlock;\n} & FormBlockProps;\n\nexport type FooterBlockModel = {\n type: BlockType.FooterBlock;\n} & FooterBlockProps;\n\nexport type SliderBlockModel = {\n type: BlockType.SliderBlock;\n} & SliderProps;\n\ntype BlockModels =\n | SliderOldBlockModel\n | SliderBlockModel\n | ExtendedFeaturesBlockModel\n | PromoFeaturesBlockModel\n | QuestionsBlockModel\n | FoldableListBlockModel\n | BannerBlockModel\n | CompaniesBlockModel\n | MediaBlockModel\n | MapBlockModel\n | InfoBlockModel\n | TableBlockModel\n | TabsBlockModel\n | HeaderBlockModel\n | HeroBlockModel\n | IconsBlockModel\n | HeaderSliderBlockModel\n | CardLayoutBlockModel\n | ContentLayoutBlockModel\n | ShareBLockModel\n | FilterBlockModel\n | FormBlockModel\n | FooterBlockModel;\n\nexport type Block = BlockModels & BlockBaseProps;\n"]}
1
+ {"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":"AA+CA,MAAM,CAAN,IAAY,SAyBX;AAzBD,WAAY,SAAS;IACjB,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,kBAAkB;IAClB,gDAAmC,CAAA;IACnC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,qCAAwB,CAAA;IACxB,uCAA0B,CAAA;IAC1B,kDAAqC,CAAA;IACrC,wDAA2C,CAAA;IAC3C,uCAA0B,CAAA;IAC1B,mCAAsB,CAAA;IACtB,yCAA4B,CAAA;IAC5B,qCAAwB,CAAA;IACxB,yCAA4B,CAAA;AAChC,CAAC,EAzBW,SAAS,KAAT,SAAS,QAyBpB;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,SAAS,CAAC,WAAW;IACrB,SAAS,CAAC,iBAAiB;IAC3B,SAAS,CAAC,SAAS;CACtB,CAAC;AAgCF,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC7B,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;AACb,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;AAED,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,sCAAwB,CAAA;IACxB,wCAA0B,CAAA;IAC1B,gDAAkC,CAAA;AACtC,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAqXD,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,iCAAS,CAAA;IACT,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACzB,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B;AAOD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,kDAA4B,CAAA;IAC5B,kDAA4B,CAAA;IAC5B,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B","sourcesContent":["import * as React from 'react';\n\nimport {ButtonSize} from '@gravity-ui/uikit';\n\nimport {GridColumnSize, GridColumnSizesType, IndentValue} from '../../grid/types';\nimport {ThemeSupporting} from '../../utils';\nimport {DeviceSupporting} from '../../utils/breakpoint';\nimport {AnalyticsEventsBase, AnalyticsEventsProp} from '../common';\n\nimport {\n AnchorProps,\n Animatable,\n BackgroundImageProps,\n ButtonProps,\n CardBorder,\n ContentSize,\n ContentTextSize,\n ContentTheme,\n FileLinkProps,\n GravityIconProps,\n HeaderBreadCrumbsProps,\n HeaderImageSize,\n HeaderOffset,\n HeaderWidth,\n ImageDeviceProps,\n ImageProps,\n Justify,\n LegendTableMarkerType,\n LinkProps,\n MapProps,\n MediaComponentImageProps,\n MediaComponentVideoProps,\n MediaDirection,\n MediaProps,\n MediaView,\n TextSize,\n TextTheme,\n ThemedImage,\n ThemedMediaProps,\n ThemedMediaVideoProps,\n TitleItemBaseProps,\n TitleItemProps,\n WithBorder,\n YandexFormProps,\n} from './common';\nimport {BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels} from './sub-blocks';\n\nexport enum BlockType {\n PromoFeaturesBlock = 'promo-features-block',\n ExtendedFeaturesBlock = 'extended-features-block',\n /** @deprecated */\n SliderOldBlock = 'slider-old-block',\n SliderBlock = 'slider-block',\n QuestionsBlock = 'questions-block',\n FoldableListBlock = 'foldable-list-block',\n BannerBlock = 'banner-block',\n CompaniesBlock = 'companies-block',\n MediaBlock = 'media-block',\n InfoBlock = 'info-block',\n TableBlock = 'table-block',\n TabsBlock = 'tabs-block',\n HeaderSliderBlock = 'header-slider-block',\n HeaderBlock = 'header-block',\n HeroBlock = 'hero-block',\n IconsBlock = 'icons-block',\n CardLayoutBlock = 'card-layout-block',\n ContentLayoutBlock = 'content-layout-block',\n ShareBlock = 'share-block',\n MapBlock = 'map-block',\n FilterBlock = 'filter-block',\n FormBlock = 'form-block',\n FooterBlock = 'footer-block',\n}\n\nexport const BlockTypes = Object.values(BlockType);\nexport const HeaderBlockTypes = [\n BlockType.HeaderBlock,\n BlockType.HeaderSliderBlock,\n BlockType.HeroBlock,\n];\n\nexport interface Childable {\n children?: SubBlock[];\n}\n\n//block props\nexport interface BlockBaseProps {\n anchor?: AnchorProps;\n visible?: GridColumnSize | Partial<Record<GridColumnSize, boolean>>;\n /** @deprecated */\n resetPaddings?: boolean;\n indent?: {\n top?: IndentValue;\n bottom?: IndentValue;\n };\n qa?: string;\n}\n\nexport interface LoadableProps {\n source: string;\n /**\n * @deprecated Will be moved to params\n */\n serviceId?: number;\n params?: Record<string, string | number | boolean | object>;\n}\n\nexport interface LoadableChildren {\n loadable?: LoadableProps;\n}\n\nexport enum SliderBreakpointNames {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n Xl = 'xl',\n}\n\nexport enum SliderType {\n MediaCard = 'media-card',\n HeaderCard = 'header-card',\n FullscreenCard = 'fullscreen-card',\n}\n\nexport type SliderBreakpointParams = Record<SliderBreakpointNames, number>;\nexport type SlidesToShow = Partial<SliderBreakpointParams> | number;\n\nexport interface SliderOldProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface SliderProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface HeaderSliderBlockProps extends Omit<SliderOldProps, 'title' | 'description'> {\n items: HeaderBlockProps[];\n}\n\ninterface HeaderBackgroundProps {\n /** @deprecated replaced by Media Props image */\n url?: string;\n /** @deprecated replaced by Media Props image */\n disableCompress?: boolean;\n}\n\nexport interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, Partial<MediaProps> {\n fullWidth?: boolean;\n fullWidthMedia?: boolean;\n}\n\nexport type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;\n\nexport interface HeaderBlockVideoIframe {\n src: string;\n autoplay?: boolean;\n previewImg?: string;\n height?: number;\n}\n\nexport interface HeaderBlockProps {\n title: string;\n overtitle?: string | JSX.Element;\n description?: string;\n additionalInfo?: string;\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];\n width?: HeaderWidth;\n /** @deprecated imageSize now depends on width */\n imageSize?: HeaderImageSize;\n /**\n * @deprecated used only on the main page\n * TODO: delete after the possibility to remove padding-bottom in the block\n */\n offset?: HeaderOffset;\n image?: ThemedImage;\n video?: ThemedMediaVideoProps;\n videoIframe?: HeaderBlockVideoIframe;\n mediaView?: MediaView;\n centered?: boolean;\n background?: ThemedHeaderBlockBackground;\n theme?: 'light' | 'dark';\n verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';\n breadcrumbs?: HeaderBreadCrumbsProps;\n status?: JSX.Element;\n renderTitle?: (title: string) => React.ReactNode;\n}\n\nexport interface HeroBlockBackground\n extends Partial<MediaComponentImageProps>,\n Partial<MediaComponentVideoProps> {\n color?: string;\n}\n\nexport interface HeroBlockMedia extends Partial<MediaProps> {\n roundCorners?: boolean;\n}\n\nexport interface HeroBlockContent\n extends Pick<ContentBlockProps, 'text' | 'list' | 'additionalInfo' | 'links' | 'theme'> {\n title: Required<ContentBlockProps>['title'];\n}\n\nexport interface HeroBlockProps extends HeroBlockContent {\n breadcrumbs?: HeaderBreadCrumbsProps;\n // TODO: add overtitle to ContentProps\n overtitle?: string | JSX.Element;\n /** Buttons are always rendered at size `xl` — a per-button `size` has no effect. */\n buttons?: ThemeSupporting<\n | Pick<\n ButtonProps,\n 'url' | 'text' | 'theme' | 'primary' | 'extraProps' | 'target' | 'analyticsEvents'\n >\n | React.ReactNode\n >[];\n media?: ThemeSupporting<HeroBlockMedia>;\n fullWidth?: boolean;\n verticalOffset?: 's' | 'm' | 'l' | 'xl';\n background?: ThemeSupporting<HeroBlockBackground>;\n}\n\nexport interface ExtendedFeaturesItem\n extends Omit<\n ContentBlockProps,\n 'title' | 'theme' | 'centered' | 'colSizes' | 'size' | 'title'\n > {\n title?: string;\n label?: string;\n icon?: ThemedImage;\n /** @deprecated **/\n link?: LinkProps;\n}\n\nexport interface ExtendedFeaturesProps extends Animatable {\n items: ExtendedFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n colSizes?: GridColumnSizesType;\n}\n\nexport interface PromoFeaturesItem {\n title: string;\n text: string;\n theme?: 'accent' | 'accent-light' | 'primary';\n media?: ThemeSupporting<MediaProps>;\n}\n\nexport interface PromoFeaturesProps extends Animatable {\n items: PromoFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n theme?: 'grey' | 'default';\n}\n\nexport interface QuestionItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n onClick?: (index: number, newOpenState: boolean) => void;\n}\n\nexport interface QuestionsProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: QuestionItem[];\n}\n\nexport interface QuestionBlockItemProps extends QuestionItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface FoldableListItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface FoldableListProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: FoldableListItem[];\n}\n\nexport interface FoldableListBlockItemProps extends FoldableListItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface BannerBlockProps extends BannerCardProps, Animatable {}\n\nexport interface CompaniesBlockProps extends Animatable {\n title: string;\n description?: string;\n images: ThemeSupporting<ImageDeviceProps>;\n}\n\nexport interface MediaBaseBlockProps extends Animatable, MediaContentProps {\n direction?: MediaDirection;\n mobileDirection?: MediaDirection;\n largeMedia?: boolean;\n mediaOnly?: boolean;\n mediaOnlyColSizes?: GridColumnSizesType;\n}\n\nexport interface MediaContentProps\n extends Omit<ContentBlockProps, 'colSizes' | 'text' | 'theme' | 'centered'> {\n description?: string;\n /** @deprecated Use array of buttons from ContentBlockProps instead**/\n button?: ButtonProps;\n}\n\nexport interface MediaBlockProps extends MediaBaseBlockProps, WithBorder {\n media: ThemeSupporting<MediaProps>;\n}\n\nexport interface MapBlockProps extends MediaBaseBlockProps, WithBorder {\n map: Omit<MapProps, 'forceAspectRatio' | 'areaMargin' | 'copyrightPosition'>;\n}\n\nexport interface InfoBlockProps {\n theme?: TextTheme;\n backgroundColor?: ThemeSupporting<string>;\n /** @deprecated **/\n title?: string;\n /** @deprecated **/\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme'>[];\n /** @deprecated **/\n sectionsTitle?: string;\n /** @deprecated **/\n links?: Pick<LinkProps, 'text' | 'url'>[];\n leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n}\n\nexport interface TableProps {\n content: string[][];\n legend?: string[];\n hideLegend?: boolean;\n justify?: Justify[];\n marker?: LegendTableMarkerType;\n /**\n * Only as accessible name, not displayed explicitly\n */\n caption?: string;\n}\n\nexport interface TableBlockProps {\n title: string;\n table: TableProps;\n}\n\nexport interface TabsBlockItem\n extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'>,\n WithBorder {\n tabName: string;\n /**\n * @deprecated Use array links from ContentBlockProps instead\n */\n link?: LinkProps;\n image?: ThemedImage;\n caption?: string;\n media?: ThemedMediaProps;\n}\n\nexport interface TabsBlockProps extends Animatable {\n title?: TitleItemProps | string;\n description?: string;\n tabsColSizes?: GridColumnSizesType;\n centered?: boolean;\n direction?: MediaDirection;\n items: TabsBlockItem[];\n contentSize?: ContentSize;\n}\n\nexport interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n titleClassName?: string;\n centered?: boolean;\n description?: string;\n colSizes?: GridColumnSizesType;\n background?: ThemeSupporting<\n BackgroundImageProps & {\n border?: CardBorder;\n }\n >;\n}\n\nexport type FilterTag = {\n collapsible?: boolean;\n id: string;\n label: string;\n analyticsEvent?: AnalyticsEventsProp;\n};\n\nexport type FilterItem = {\n tags: string[];\n card: SubBlockModels;\n};\n\nexport interface FilterBlockProps extends Animatable {\n visibleRowsCount?: Partial<Record<GridColumnSize, number>>;\n expandButtonText?: string;\n collapseButtonText?: string;\n tags: FilterTag[];\n items: FilterItem[];\n title?: TitleItemProps | string;\n description?: string;\n tagButtonSize?: ButtonSize;\n allTag?: boolean | string | FilterTag;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n}\n\nexport interface IconsBlockItemProps extends AnalyticsEventsBase {\n url?: string;\n text?: string;\n src: ThemeSupporting<string>;\n}\n\nexport interface IconsBlockProps {\n title?: string;\n description?: string;\n size?: 's' | 'm' | 'l';\n items: IconsBlockItemProps[];\n colSizes?: GridColumnSizesType;\n}\n\ninterface ContentLayoutBlockParams {\n size?: ContentSize;\n background?: ThemeSupporting<BackgroundImageProps>;\n centered?: boolean;\n theme?: ContentTheme;\n textWidth?: ContentTextSize;\n}\n\nexport interface ContentLayoutBlockProps extends ContentLayoutBlockParams {\n textContent: ContentBlockProps;\n fileContent?: FileLinkProps[];\n}\n\nexport type SVGIcon = (props: React.SVGProps<SVGSVGElement>) => React.ReactNode;\n\nexport interface ContentItemProps {\n title?: string;\n text?: string;\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n}\n\nexport interface ContentListProps {\n list: ContentItemProps[];\n size: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentBlockProps {\n title?: TitleItemBaseProps | string;\n titleId?: string;\n text?: string;\n textId?: string;\n additionalInfo?: string;\n links?: LinkProps[];\n buttons?: (ButtonProps | React.ReactNode)[];\n size?: ContentSize;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n theme?: ContentTheme;\n list?: ContentItemProps[];\n controlPosition?: 'default' | 'bottom';\n}\n\nexport enum PCShareSocialNetwork {\n Vk = 'vk',\n Telegram = 'telegram',\n Twitter = 'twitter',\n Facebook = 'facebook',\n LinkedIn = 'linkedin',\n}\n\nexport interface ShareBlockProps {\n items: PCShareSocialNetwork[];\n title?: string;\n}\n\nexport enum FormBlockDataTypes {\n YANDEX = 'yandex',\n HUBSPOT = 'hubspot',\n}\n\nexport enum FormBlockDirection {\n FormContent = 'form-content',\n ContentForm = 'content-form',\n Center = 'center',\n}\n\nexport interface FormBlockYandexData {\n yandex: ThemeSupporting<YandexFormProps>;\n}\n\nexport interface FormBlockHubspotData {\n hubspot: ThemeSupporting<HubspotFormProps>;\n}\n\nexport type FormBlockData = FormBlockYandexData | FormBlockHubspotData;\n\nexport interface FormBlockBackgroundProps extends Omit<BackgroundImageProps, 'style'> {\n style?: DeviceSupporting<React.CSSProperties>;\n}\n\nexport interface FormBlockProps {\n formData: FormBlockData;\n title?: string;\n textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;\n direction?: FormBlockDirection;\n background?: ThemeSupporting<FormBlockBackgroundProps>;\n customFormNode?: React.ReactNode;\n additionalContentNode?: React.ReactNode;\n}\n\nexport interface FooterLinkColumn {\n title: string;\n links: LinkProps[];\n}\n\nexport interface FooterLogoProps {\n image: ThemeSupporting<ImageProps>;\n url?: string;\n alt?: string;\n}\n\nexport interface FooterSection {\n columns: FooterLinkColumn[];\n}\n\nexport interface FooterContactItem {\n icon: ThemeSupporting<ImageProps>;\n url: string;\n urlTitle?: string;\n}\n\nexport interface FooterContacts {\n title?: string;\n iconsSize?: 'm' | 'l';\n links?: FooterContactItem[];\n linksPosition?: 'left' | 'center';\n titlePosition?: 'top' | 'near';\n}\n\nexport interface FooterDisclaimerFloor {\n text: string;\n align: 'left' | 'center';\n}\n\nexport interface FooterCopyright {\n links?: Required<Pick<LinkProps, 'text' | 'url'>>[];\n linksOverflowStrategy?: 'dropdown' | 'line-wrap';\n languageSwitcher?: {\n items: {\n text: string;\n href: string;\n }[];\n buttonText?: string;\n image?: ThemeSupporting<ImageProps>;\n };\n logo?: FooterLogoProps;\n copyrightText?: string;\n}\n\nexport interface FooterAttributionFloor {\n text: string;\n}\n\nexport interface FooterSecondFloor {\n copyright?: string;\n links?: LinkProps[];\n contacts?: FooterContactItem[];\n}\n\nexport interface FooterBlockProps {\n /** Floor 1: first row — logo (if present) + these columns */\n navigation?: {\n logo?: FooterLogoProps & {\n placement?: 'left' | 'top';\n };\n colSizes?: GridColumnSizesType;\n columnsPerRow?: number;\n columns: FooterLinkColumn[];\n };\n /** Floor 2: social row (title + social icons) */\n contacts?: FooterContacts;\n /** Floor 3: legal disclaimer (YFM) */\n disclaimer?: FooterDisclaimerFloor;\n /** Floor 4: privacy/terms links, language, copyright */\n copyright?: FooterCopyright;\n /** Floor 5: attribution (\"Created with ...\") */\n attribution?: boolean;\n backgroundColor?: ThemeSupporting<string>;\n indentTop?: IndentValue;\n}\n\n//block models\nexport type HeaderBlockModel = {\n type: BlockType.HeaderBlock;\n} & HeaderBlockProps;\n\nexport type HeroBlockModel = {\n type: BlockType.HeroBlock;\n} & HeroBlockProps;\n\nexport type SliderOldBlockModel = {\n type: BlockType.SliderOldBlock;\n} & SliderOldProps;\n\nexport type ExtendedFeaturesBlockModel = {\n type: BlockType.ExtendedFeaturesBlock;\n} & ExtendedFeaturesProps;\n\nexport type PromoFeaturesBlockModel = {\n type: BlockType.PromoFeaturesBlock;\n} & PromoFeaturesProps;\n\nexport type QuestionsBlockModel = {\n type: BlockType.QuestionsBlock;\n} & QuestionsProps;\n\nexport type FoldableListBlockModel = {\n type: BlockType.FoldableListBlock;\n} & FoldableListProps;\n\nexport type BannerBlockModel = {\n type: BlockType.BannerBlock;\n} & BannerBlockProps;\n\nexport type CompaniesBlockModel = {\n type: BlockType.CompaniesBlock;\n} & CompaniesBlockProps;\n\nexport type MediaBlockModel = {\n type: BlockType.MediaBlock;\n} & MediaBlockProps;\n\nexport type MapBlockModel = {\n type: BlockType.MapBlock;\n} & MapBlockProps;\n\nexport type InfoBlockModel = {\n type: BlockType.InfoBlock;\n} & InfoBlockProps;\n\nexport type TableBlockModel = {\n type: BlockType.TableBlock;\n} & TableBlockProps;\n\nexport type TabsBlockModel = {\n type: BlockType.TabsBlock;\n} & TabsBlockProps;\n\nexport type CardLayoutBlockModel = {\n type: BlockType.CardLayoutBlock;\n} & CardLayoutBlockProps;\n\nexport type FilterBlockModel = {\n type: BlockType.FilterBlock;\n} & FilterBlockProps;\n\nexport type IconsBlockModel = {\n type: BlockType.IconsBlock;\n} & IconsBlockProps;\n\nexport type HeaderSliderBlockModel = {\n type: BlockType.HeaderSliderBlock;\n} & HeaderSliderBlockProps;\n\nexport type ContentLayoutBlockModel = {\n type: BlockType.ContentLayoutBlock;\n} & ContentLayoutBlockProps;\n\nexport type ShareBLockModel = {\n type: BlockType.ShareBlock;\n} & ShareBlockProps;\n\nexport type FormBlockModel = {\n type: BlockType.FormBlock;\n} & FormBlockProps;\n\nexport type FooterBlockModel = {\n type: BlockType.FooterBlock;\n} & FooterBlockProps;\n\nexport type SliderBlockModel = {\n type: BlockType.SliderBlock;\n} & SliderProps;\n\ntype BlockModels =\n | SliderOldBlockModel\n | SliderBlockModel\n | ExtendedFeaturesBlockModel\n | PromoFeaturesBlockModel\n | QuestionsBlockModel\n | FoldableListBlockModel\n | BannerBlockModel\n | CompaniesBlockModel\n | MediaBlockModel\n | MapBlockModel\n | InfoBlockModel\n | TableBlockModel\n | TabsBlockModel\n | HeaderBlockModel\n | HeroBlockModel\n | IconsBlockModel\n | HeaderSliderBlockModel\n | CardLayoutBlockModel\n | ContentLayoutBlockModel\n | ShareBLockModel\n | FilterBlockModel\n | FormBlockModel\n | FooterBlockModel;\n\nexport type Block = BlockModels & BlockBaseProps;\n"]}