@gravity-ui/page-constructor 5.14.4-alpha.2 → 5.14.4-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/build/cjs/blocks/Banner/index.js +1 -0
  2. package/build/cjs/blocks/CardLayout/index.js +21 -3
  3. package/build/cjs/blocks/Companies/index.js +1 -0
  4. package/build/cjs/blocks/ContentLayout/index.d.ts +31 -1
  5. package/build/cjs/blocks/ContentLayout/index.js +64 -1
  6. package/build/cjs/blocks/ExtendedFeatures/index.d.ts +48 -2
  7. package/build/cjs/blocks/ExtendedFeatures/index.js +60 -2
  8. package/build/cjs/blocks/FilterBlock/index.d.ts +18 -0
  9. package/build/cjs/blocks/FilterBlock/index.js +81 -1
  10. package/build/cjs/blocks/Form/index.d.ts +1 -0
  11. package/build/cjs/blocks/Form/index.js +1 -0
  12. package/build/cjs/blocks/Header/index.d.ts +11 -0
  13. package/build/cjs/blocks/Header/index.js +18 -0
  14. package/build/cjs/blocks/HeaderSlider/index.d.ts +1 -0
  15. package/build/cjs/blocks/HeaderSlider/index.js +1 -0
  16. package/build/cjs/blocks/Icons/Icons.js +2 -2
  17. package/build/cjs/blocks/Icons/index.d.ts +7 -0
  18. package/build/cjs/blocks/Icons/index.js +44 -0
  19. package/build/cjs/blocks/Info/index.d.ts +1 -0
  20. package/build/cjs/blocks/Info/index.js +1 -0
  21. package/build/cjs/blocks/Map/index.d.ts +1 -0
  22. package/build/cjs/blocks/Map/index.js +1 -0
  23. package/build/cjs/blocks/Media/index.d.ts +26 -2
  24. package/build/cjs/blocks/Media/index.js +39 -4
  25. package/build/cjs/blocks/PromoFeaturesBlock/index.d.ts +11 -1
  26. package/build/cjs/blocks/PromoFeaturesBlock/index.js +31 -1
  27. package/build/cjs/blocks/Questions/index.d.ts +1 -0
  28. package/build/cjs/blocks/Questions/index.js +1 -0
  29. package/build/cjs/blocks/Share/index.d.ts +1 -0
  30. package/build/cjs/blocks/Share/index.js +1 -0
  31. package/build/cjs/blocks/Slider/index.d.ts +19 -0
  32. package/build/cjs/blocks/Slider/index.js +31 -0
  33. package/build/cjs/blocks/Table/index.d.ts +10 -0
  34. package/build/cjs/blocks/Table/index.js +17 -0
  35. package/build/cjs/blocks/Tabs/index.d.ts +1 -0
  36. package/build/cjs/blocks/Tabs/index.js +1 -0
  37. package/build/cjs/common/types/forms.d.ts +1 -0
  38. package/build/cjs/constructor-items.d.ts +2 -6
  39. package/build/cjs/constructor-items.js +2 -2
  40. package/build/cjs/editor-v2/components/BlocksList/BlocksList.css +27 -1
  41. package/build/cjs/editor-v2/components/BlocksList/BlocksList.js +34 -2
  42. package/build/cjs/editor-v2/components/Panels/Panels.css +36 -0
  43. package/build/cjs/editor-v2/components/Panels/Panels.d.ts +8 -0
  44. package/build/cjs/editor-v2/components/Panels/Panels.js +41 -0
  45. package/build/cjs/editor-v2/components/Tree/Tree.css +11 -0
  46. package/build/cjs/editor-v2/components/Tree/Tree.js +10 -2
  47. package/build/cjs/editor-v2/containers/Editor/Editor.css +0 -10
  48. package/build/cjs/editor-v2/containers/Editor/Editor.js +2 -13
  49. package/build/cjs/editor-v2/context/contentConfig/store.d.ts +1 -0
  50. package/build/cjs/editor-v2/context/contentConfig/store.js +3 -0
  51. package/build/cjs/sub-blocks/BackgroundCard/index.js +2 -0
  52. package/build/cjs/sub-blocks/BannerCard/index.js +1 -0
  53. package/build/cjs/sub-blocks/BasicCard/index.js +1 -0
  54. package/build/cjs/sub-blocks/Content/index.js +1 -0
  55. package/build/cjs/sub-blocks/ImageCard/index.js +1 -0
  56. package/build/cjs/sub-blocks/LayoutItem/index.js +7 -2
  57. package/build/cjs/sub-blocks/MediaCard/index.js +2 -0
  58. package/build/cjs/sub-blocks/PriceCard/index.js +1 -0
  59. package/build/cjs/sub-blocks/PriceDetailed/index.js +1 -0
  60. package/build/cjs/sub-blocks/Quote/index.js +1 -0
  61. package/build/esm/blocks/Banner/index.js +1 -0
  62. package/build/esm/blocks/CardLayout/index.js +21 -3
  63. package/build/esm/blocks/Companies/index.js +1 -0
  64. package/build/esm/blocks/ContentLayout/index.d.ts +31 -1
  65. package/build/esm/blocks/ContentLayout/index.js +64 -1
  66. package/build/esm/blocks/ExtendedFeatures/index.d.ts +48 -2
  67. package/build/esm/blocks/ExtendedFeatures/index.js +60 -2
  68. package/build/esm/blocks/FilterBlock/index.d.ts +18 -0
  69. package/build/esm/blocks/FilterBlock/index.js +81 -1
  70. package/build/esm/blocks/Form/index.d.ts +1 -0
  71. package/build/esm/blocks/Form/index.js +1 -0
  72. package/build/esm/blocks/Header/index.d.ts +11 -0
  73. package/build/esm/blocks/Header/index.js +18 -0
  74. package/build/esm/blocks/HeaderSlider/index.d.ts +1 -0
  75. package/build/esm/blocks/HeaderSlider/index.js +1 -0
  76. package/build/esm/blocks/Icons/Icons.js +2 -2
  77. package/build/esm/blocks/Icons/index.d.ts +7 -0
  78. package/build/esm/blocks/Icons/index.js +44 -0
  79. package/build/esm/blocks/Info/index.d.ts +1 -0
  80. package/build/esm/blocks/Info/index.js +1 -0
  81. package/build/esm/blocks/Map/index.d.ts +1 -0
  82. package/build/esm/blocks/Map/index.js +1 -0
  83. package/build/esm/blocks/Media/index.d.ts +26 -2
  84. package/build/esm/blocks/Media/index.js +39 -4
  85. package/build/esm/blocks/PromoFeaturesBlock/index.d.ts +11 -1
  86. package/build/esm/blocks/PromoFeaturesBlock/index.js +31 -1
  87. package/build/esm/blocks/Questions/index.d.ts +1 -0
  88. package/build/esm/blocks/Questions/index.js +1 -0
  89. package/build/esm/blocks/Share/index.d.ts +1 -0
  90. package/build/esm/blocks/Share/index.js +1 -0
  91. package/build/esm/blocks/Slider/index.d.ts +19 -0
  92. package/build/esm/blocks/Slider/index.js +31 -0
  93. package/build/esm/blocks/Table/index.d.ts +10 -0
  94. package/build/esm/blocks/Table/index.js +17 -0
  95. package/build/esm/blocks/Tabs/index.d.ts +1 -0
  96. package/build/esm/blocks/Tabs/index.js +1 -0
  97. package/build/esm/common/types/forms.d.ts +1 -0
  98. package/build/esm/constructor-items.d.ts +2 -6
  99. package/build/esm/constructor-items.js +1 -1
  100. package/build/esm/editor-v2/components/BlocksList/BlocksList.css +27 -1
  101. package/build/esm/editor-v2/components/BlocksList/BlocksList.js +35 -3
  102. package/build/esm/editor-v2/components/Panels/Panels.css +36 -0
  103. package/build/esm/editor-v2/components/Panels/Panels.d.ts +9 -0
  104. package/build/esm/editor-v2/components/Panels/Panels.js +37 -0
  105. package/build/esm/editor-v2/components/Tree/Tree.css +11 -0
  106. package/build/esm/editor-v2/components/Tree/Tree.js +11 -3
  107. package/build/esm/editor-v2/containers/Editor/Editor.css +0 -10
  108. package/build/esm/editor-v2/containers/Editor/Editor.js +2 -13
  109. package/build/esm/editor-v2/context/contentConfig/store.d.ts +1 -0
  110. package/build/esm/editor-v2/context/contentConfig/store.js +3 -0
  111. package/build/esm/sub-blocks/BackgroundCard/index.js +2 -0
  112. package/build/esm/sub-blocks/BannerCard/index.js +1 -0
  113. package/build/esm/sub-blocks/BasicCard/index.js +1 -0
  114. package/build/esm/sub-blocks/Content/index.js +1 -0
  115. package/build/esm/sub-blocks/ImageCard/index.js +1 -0
  116. package/build/esm/sub-blocks/LayoutItem/index.js +7 -2
  117. package/build/esm/sub-blocks/MediaCard/index.js +2 -0
  118. package/build/esm/sub-blocks/PriceCard/index.js +1 -0
  119. package/build/esm/sub-blocks/PriceDetailed/index.js +1 -0
  120. package/build/esm/sub-blocks/Quote/index.js +1 -0
  121. package/package.json +1 -1
  122. package/widget/index.js +1 -1
  123. package/build/cjs/sub-blocks/LayoutItem/form.d.ts +0 -8
  124. package/build/cjs/sub-blocks/LayoutItem/form.js +0 -14
  125. package/build/esm/sub-blocks/LayoutItem/form.d.ts +0 -8
  126. package/build/esm/sub-blocks/LayoutItem/form.js +0 -11
@@ -2,6 +2,7 @@ declare const HeaderSliderBlockConfig: {
2
2
  component: ({ items, arrows, ...props }: import("../..").HeaderSliderBlockProps) => JSX.Element;
3
3
  schema: {
4
4
  name: string;
5
+ group: string;
5
6
  inputs: import("../../editor-v2").ConfigInput[];
6
7
  default: {
7
8
  type: string;
@@ -5,6 +5,7 @@ const HeaderSliderBlockConfig = {
5
5
  component: HeaderSliderBlock,
6
6
  schema: {
7
7
  name: 'Header Slider Block',
8
+ group: 'card-containers',
8
9
  inputs: generateFromAJV(HeaderSliderBlockSchema['header-slider-block']),
9
10
  default: {
10
11
  type: 'header-slider-block',
@@ -15,8 +15,8 @@ const Icons = ({ title, description, size = 's', colSizes = { all: 12 }, items }
15
15
  const onClick = useCallback(({ analyticsEvents, url }) => {
16
16
  handleAnalytics(analyticsEvents, { url });
17
17
  }, [handleAnalytics]);
18
- return (React.createElement("div", { className: b({ size }) },
19
- React.createElement(Grid, null,
18
+ return (React.createElement(Grid, null,
19
+ React.createElement("div", { className: b({ size }) },
20
20
  (title || description) && (React.createElement(Title, { className: b('header'), title: title, subtitle: description, colSizes: colSizes })),
21
21
  items &&
22
22
  items.map((item) => {
@@ -2,11 +2,18 @@ declare const IconsBlockConfig: {
2
2
  component: ({ title, description, size, colSizes, items }: import("../..").IconsBlockProps) => JSX.Element;
3
3
  schema: {
4
4
  name: string;
5
+ group: string;
5
6
  inputs: import("../../editor-v2").ConfigInput[];
6
7
  default: {
7
8
  type: string;
8
9
  title: string;
9
10
  description: string;
11
+ size: string;
12
+ items: {
13
+ url: string;
14
+ text: string;
15
+ src: string;
16
+ }[];
10
17
  };
11
18
  };
12
19
  };
@@ -5,11 +5,55 @@ const IconsBlockConfig = {
5
5
  component: IconsBlock,
6
6
  schema: {
7
7
  name: 'Icons Block',
8
+ group: 'block',
8
9
  inputs: generateFromAJV(IconsProps),
9
10
  default: {
10
11
  type: 'icons-block',
11
12
  title: 'Icons Block',
12
13
  description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
14
+ size: 'm',
15
+ items: [
16
+ {
17
+ url: '/security/standards/software-registry',
18
+ text: 'Государственные реестры РФ',
19
+ src: 'https://storage.yandexcloud.net/cloud-www-assets/security-new/main-shield/security-software-registry.svg',
20
+ },
21
+ {
22
+ url: '/security/standards/gdpr',
23
+ text: 'Общий регламент защиты данных (GDPR)',
24
+ src: 'https://storage.yandexcloud.net/cloud-www-assets/security-new/main-shield/security-gdpr.svg',
25
+ },
26
+ {
27
+ url: '/security/standards/cloud-security-alliance',
28
+ text: 'Cloud Security Alliance',
29
+ src: 'https://storage.yandexcloud.net/cloud-www-assets/security-new/main-shield/security-csa.svg',
30
+ },
31
+ {
32
+ url: '/security/standards/iso-standards',
33
+ text: 'Международная организация по стандартизации (ISO)',
34
+ src: 'https://storage.yandexcloud.net/cloud-www-assets/security-new/main-shield/security-iso.svg',
35
+ },
36
+ {
37
+ url: '/security/standards/152-fz',
38
+ text: '№152-ФЗ «О персональных данных»',
39
+ src: 'https://storage.yandexcloud.net/cloud-www-assets/security-new/main-shield/security-152-fz.svg',
40
+ },
41
+ {
42
+ url: '/security/standards/gost-p-57580',
43
+ text: 'ГОСТ Р 57580',
44
+ src: 'https://storage.yandexcloud.net/cloud-www-assets/security-new/main-shield/security-gost.svg',
45
+ },
46
+ {
47
+ url: '/security/standards/pci',
48
+ text: 'Payment Card Industry Data Security Standard',
49
+ src: 'https://storage.yandexcloud.net/cloud-www-assets/security-new/main-shield/security-pci.svg',
50
+ },
51
+ {
52
+ url: '/docs/security/standard/all',
53
+ text: 'Стандарт по защите облачной инфраструктуры',
54
+ src: 'https://storage.yandexcloud.net/cloud-www-assets/security-new/icons/security_yc.svg',
55
+ },
56
+ ],
13
57
  },
14
58
  },
15
59
  };
@@ -2,6 +2,7 @@ declare const InfoBlockConfig: {
2
2
  component: (props: import("../..").InfoBlockProps) => JSX.Element;
3
3
  schema: {
4
4
  name: string;
5
+ group: string;
5
6
  inputs: import("../../editor-v2").ConfigInput[];
6
7
  default: {
7
8
  type: string;
@@ -5,6 +5,7 @@ const InfoBlockConfig = {
5
5
  component: InfoBlock,
6
6
  schema: {
7
7
  name: 'Info Block',
8
+ group: 'block',
8
9
  inputs: generateFromAJV(InfoBlockSchema['info-block']),
9
10
  default: {
10
11
  type: 'info-block',
@@ -2,6 +2,7 @@ declare const MapBlockConfig: {
2
2
  component: ({ map, border, disableShadow, ...props }: import("../..").MapBlockProps) => JSX.Element;
3
3
  schema: {
4
4
  name: string;
5
+ group: string;
5
6
  inputs: import("../../editor-v2").ConfigInput[];
6
7
  default: {
7
8
  title: string;
@@ -5,6 +5,7 @@ const MapBlockConfig = {
5
5
  component: MapBlock,
6
6
  schema: {
7
7
  name: 'Map Block',
8
+ group: 'block',
8
9
  inputs: generateFromAJV(MapBlockSchema['map-block']),
9
10
  default: {
10
11
  title: 'Map Block',
@@ -2,12 +2,36 @@ declare const MediaBlockConfig: {
2
2
  component: (props: import("../..").MediaBlockProps) => JSX.Element;
3
3
  schema: {
4
4
  name: string;
5
+ group: string;
5
6
  inputs: import("../../editor-v2").ConfigInput[];
6
7
  default: {
7
- type: string;
8
8
  title: string;
9
- additionalInfo: string;
10
9
  description: string;
10
+ additionalInfo: string;
11
+ links: {
12
+ url: string;
13
+ text: string;
14
+ theme: string;
15
+ arrow: boolean;
16
+ }[];
17
+ buttons: {
18
+ text: string;
19
+ theme: string;
20
+ url: string;
21
+ }[];
22
+ list: ({
23
+ title: string;
24
+ text: string;
25
+ } | {
26
+ text: string;
27
+ title?: undefined;
28
+ } | {
29
+ title: string;
30
+ text?: undefined;
31
+ })[];
32
+ media: {
33
+ image: string;
34
+ };
11
35
  };
12
36
  };
13
37
  };
@@ -5,12 +5,47 @@ const MediaBlockConfig = {
5
5
  component: MediaBlock,
6
6
  schema: {
7
7
  name: 'Media Block',
8
+ group: 'block',
8
9
  inputs: generateFromAJV(MediaBlockSchema['media-block']),
9
10
  default: {
10
- type: 'media-block',
11
- title: 'Media Block',
12
- additionalInfo: 'Additional info',
13
- description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
11
+ title: 'Lorem ipsum dolor sit',
12
+ description: 'Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.',
13
+ additionalInfo: 'Duis aute irure dolor in reprehenderit n voluptate velit esse cillum dolore eu fugiat nulla pariatur.',
14
+ links: [
15
+ {
16
+ url: '#',
17
+ text: 'Learn more',
18
+ theme: 'normal',
19
+ arrow: true,
20
+ },
21
+ ],
22
+ buttons: [
23
+ {
24
+ text: 'Button',
25
+ theme: 'action',
26
+ url: 'https://example.com',
27
+ },
28
+ {
29
+ text: 'Button',
30
+ theme: 'outlined',
31
+ url: '#',
32
+ },
33
+ ],
34
+ list: [
35
+ {
36
+ title: 'Lorem ipsum',
37
+ text: 'Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
38
+ },
39
+ {
40
+ text: 'Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
41
+ },
42
+ {
43
+ title: 'Lorem ipsum ipsum',
44
+ },
45
+ ],
46
+ media: {
47
+ image: 'https://storage.yandexcloud.net/cloud-www-assets/constructor/main/new/media-01-01.jpg',
48
+ },
14
49
  },
15
50
  },
16
51
  };
@@ -2,10 +2,20 @@ declare const PromoFeaturesBlockConfig: {
2
2
  component: (props: import("../..").PromoFeaturesProps) => JSX.Element;
3
3
  schema: {
4
4
  name: string;
5
+ group: string;
5
6
  inputs: import("../../editor-v2").ConfigInput[];
6
7
  default: {
7
8
  title: string;
8
- items: {}[];
9
+ theme: string;
10
+ items: ({
11
+ title: string;
12
+ text: string;
13
+ theme?: undefined;
14
+ } | {
15
+ title: string;
16
+ text: string;
17
+ theme: string;
18
+ })[];
9
19
  };
10
20
  };
11
21
  };
@@ -5,10 +5,40 @@ const PromoFeaturesBlockConfig = {
5
5
  component: PromoFeaturesBlock,
6
6
  schema: {
7
7
  name: 'Promo Features Block',
8
+ group: 'block',
8
9
  inputs: generateFromAJV(PromoFeaturesBlockSchema['promo-features-block']),
9
10
  default: {
10
11
  title: 'Promo Features Block',
11
- items: [{}],
12
+ theme: 'default',
13
+ items: [
14
+ {
15
+ title: 'Lorem ipsum dolor sit amet',
16
+ text: 'Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
17
+ },
18
+ {
19
+ title: 'Lorem ipsum dolor sit amet',
20
+ text: 'Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
21
+ },
22
+ {
23
+ title: 'Lorem ipsum dolor sit amet',
24
+ text: 'Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
25
+ },
26
+ {
27
+ title: 'Lorem ipsum dolor sit amet',
28
+ text: 'Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
29
+ theme: 'accent',
30
+ },
31
+ {
32
+ title: 'Lorem ipsum dolor sit amet',
33
+ text: 'Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
34
+ theme: 'accent-light',
35
+ },
36
+ {
37
+ title: 'Lorem ipsum dolor sit amet',
38
+ text: 'Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
39
+ theme: 'primary',
40
+ },
41
+ ],
12
42
  },
13
43
  },
14
44
  };
@@ -2,6 +2,7 @@ declare const QuestionsBlockConfig: {
2
2
  component: (props: import("../..").QuestionsProps) => JSX.Element;
3
3
  schema: {
4
4
  name: string;
5
+ group: string;
5
6
  inputs: import("../../editor-v2").ConfigInput[];
6
7
  default: {
7
8
  type: string;
@@ -5,6 +5,7 @@ const QuestionsBlockConfig = {
5
5
  component: QuestionsBlock,
6
6
  schema: {
7
7
  name: 'Questions Block',
8
+ group: 'block',
8
9
  inputs: generateFromAJV(QuestionsBlockSchema['questions-block']),
9
10
  default: {
10
11
  type: 'questions-block',
@@ -2,6 +2,7 @@ declare const ShareBlockConfig: {
2
2
  component: ({ items, title }: import("../..").ShareBlockProps) => JSX.Element;
3
3
  schema: {
4
4
  name: string;
5
+ group: string;
5
6
  inputs: import("../../editor-v2").ConfigInput[];
6
7
  default: {
7
8
  items: string[];
@@ -5,6 +5,7 @@ const ShareBlockConfig = {
5
5
  component: ShareBlock,
6
6
  schema: {
7
7
  name: 'Share Block',
8
+ group: 'block',
8
9
  inputs: generateFromAJV(ShareBlockSchema['share-block']),
9
10
  default: {
10
11
  items: ['vk', 'telegram', 'facebook'],
@@ -2,7 +2,26 @@ declare const SliderBlockConfig: {
2
2
  component: (props: import("../..").WithChildren<import("./Slider").SliderProps>) => JSX.Element;
3
3
  schema: {
4
4
  name: string;
5
+ group: string;
5
6
  inputs: import("../../editor-v2").ConfigInput[];
7
+ default: {
8
+ dots: boolean;
9
+ type: string;
10
+ title: string;
11
+ description: string;
12
+ slidesToShow: number;
13
+ arrows: boolean;
14
+ children: {
15
+ type: string;
16
+ text: string;
17
+ url: string;
18
+ author: {
19
+ firstName: string;
20
+ secondName: string;
21
+ description: string;
22
+ };
23
+ }[];
24
+ };
6
25
  };
7
26
  };
8
27
  export default SliderBlockConfig;
@@ -5,7 +5,38 @@ const SliderBlockConfig = {
5
5
  component: SliderBlock,
6
6
  schema: {
7
7
  name: 'Slider Block',
8
+ group: 'card-containers',
8
9
  inputs: generateFromAJV(SliderBlockSchema['slider-block']),
10
+ default: {
11
+ dots: true,
12
+ type: 'slider-block',
13
+ title: 'Slider Block with Quote Cards',
14
+ description: 'You can insert any card inside block',
15
+ slidesToShow: 1,
16
+ arrows: true,
17
+ children: [
18
+ {
19
+ type: 'quote',
20
+ text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
21
+ url: 'https://example.com',
22
+ author: {
23
+ firstName: 'Lorem',
24
+ secondName: 'ipsum',
25
+ description: 'Lorem ipsum',
26
+ },
27
+ },
28
+ {
29
+ type: 'quote',
30
+ text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
31
+ url: 'https://example.com',
32
+ author: {
33
+ firstName: 'Lorem',
34
+ secondName: 'ipsum',
35
+ description: 'Lorem ipsum',
36
+ },
37
+ },
38
+ ],
39
+ },
9
40
  },
10
41
  };
11
42
  export default SliderBlockConfig;
@@ -2,7 +2,17 @@ declare const TableBlockConfig: {
2
2
  component: (props: import("../..").TableBlockProps) => JSX.Element;
3
3
  schema: {
4
4
  name: string;
5
+ group: string;
5
6
  inputs: import("../../editor-v2").ConfigInput[];
7
+ default: {
8
+ type: string;
9
+ title: string;
10
+ table: {
11
+ content: string[][];
12
+ legend: string[];
13
+ justify: string[];
14
+ };
15
+ };
6
16
  };
7
17
  };
8
18
  export default TableBlockConfig;
@@ -5,7 +5,24 @@ const TableBlockConfig = {
5
5
  component: TableBlock,
6
6
  schema: {
7
7
  name: 'Table Block',
8
+ group: 'block',
8
9
  inputs: generateFromAJV(TableBlockSchema['table-block']),
10
+ default: {
11
+ type: 'table-block',
12
+ title: 'Lorem ipsum dolor sit amet',
13
+ table: {
14
+ content: [
15
+ ['Lorem', 'ipsum 1', 'dolor 2', 'sit 3'],
16
+ ['Lorem 1', '0', '0', '0'],
17
+ ['Lorem 2', '0', '0', '1'],
18
+ ['Lorem 3', '0', '0', '1'],
19
+ ['Lorem 4', '0', '1', '1'],
20
+ ['Lorem 5', '1', '1', '1'],
21
+ ],
22
+ legend: ['ipsum 1', 'ipsum 2'],
23
+ justify: ['start', 'center', 'center', 'center'],
24
+ },
25
+ },
9
26
  },
10
27
  };
11
28
  export default TableBlockConfig;
@@ -2,6 +2,7 @@ declare const TabsBlockConfig: {
2
2
  component: ({ items, title, description, animated, tabsColSizes, centered, direction, contentSize, }: import("../..").TabsBlockProps) => JSX.Element;
3
3
  schema: {
4
4
  name: string;
5
+ group: string;
5
6
  inputs: import("../../editor-v2").ConfigInput[];
6
7
  default: {
7
8
  title: string;
@@ -5,6 +5,7 @@ const TabsBlockConfig = {
5
5
  component: TabsBlock,
6
6
  schema: {
7
7
  name: 'Tabs Block',
8
+ group: 'block',
8
9
  inputs: generateFromAJV(TabsBlockSchema['tabs-block']),
9
10
  default: {
10
11
  title: 'Tabs Block',
@@ -1,6 +1,7 @@
1
1
  export interface BlockConfig {
2
2
  name: string;
3
3
  inputs: Array<ConfigInput>;
4
+ group?: string;
4
5
  default?: object;
5
6
  }
6
7
  export interface TextInput {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ConfigInput } from './common/types';
2
+ import { BlockConfig } from './common/types';
3
3
  /**
4
4
  * @deprecated use blockDataMap
5
5
  **/
@@ -50,10 +50,6 @@ export declare const navItemMap: {
50
50
  };
51
51
  export interface BlockData {
52
52
  component: React.ComponentType<any>;
53
- schema: {
54
- name: string;
55
- inputs: ConfigInput[];
56
- default?: object;
57
- };
53
+ schema: BlockConfig;
58
54
  }
59
55
  export declare const blockDataMap: Record<string, BlockData>;
@@ -30,7 +30,7 @@ import BasicCardConfig from './sub-blocks/BasicCard';
30
30
  import ContentConfig from './sub-blocks/Content';
31
31
  import DividerConfig from './sub-blocks/Divider';
32
32
  import ImageCardConfig from './sub-blocks/ImageCard';
33
- import LayoutItemConfig from './sub-blocks/LayoutItem/form';
33
+ import LayoutItemConfig from './sub-blocks/LayoutItem';
34
34
  import MediaCardConfig from './sub-blocks/MediaCard';
35
35
  import PriceCardConfig from './sub-blocks/PriceCard';
36
36
  import PriceDetailedConfig from './sub-blocks/PriceDetailed';
@@ -18,21 +18,47 @@ body {
18
18
  }
19
19
  .pc-blocks-list__card {
20
20
  padding: 8px;
21
- cursor: pointer;
21
+ cursor: grab;
22
22
  user-select: none;
23
23
  margin-bottom: 8px;
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: space-between;
27
+ gap: 4px;
24
28
  }
25
29
  .pc-blocks-list__card:last-child {
26
30
  margin-bottom: 0;
27
31
  }
28
32
  .pc-blocks-list__card:active {
29
33
  background-color: var(--g-color-base-generic-hover);
34
+ cursor: grabbing;
35
+ }
36
+ .pc-blocks-list__name {
37
+ flex: 1;
30
38
  }
31
39
  .pc-blocks-list__title {
32
40
  font-size: var(--g-text-subheader-3-font-size);
33
41
  line-height: var(--g-text-subheader-3-line-height);
34
42
  font-weight: var(--g-text-subheader-font-weight);
35
43
  margin-bottom: 10px;
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: flex-start;
47
+ }
48
+ .pc-blocks-list__subtitle {
49
+ font-size: var(--g-text-subheader-2-font-size);
50
+ line-height: var(--g-text-subheader-2-line-height);
51
+ font-weight: var(--g-text-subheader-font-weight);
52
+ margin-bottom: 10px;
53
+ display: flex;
54
+ align-items: center;
55
+ justify-content: flex-start;
56
+ }
57
+ .pc-blocks-list__group {
58
+ margin-bottom: 16px;
59
+ }
60
+ .pc-blocks-list__group:last-child {
61
+ margin-bottom: 0;
36
62
  }
37
63
  .pc-blocks-list__section {
38
64
  margin-bottom: 20px;
@@ -1,20 +1,52 @@
1
1
  import React, { useCallback } from 'react';
2
- import { Card } from '@gravity-ui/uikit';
2
+ import { Grip, Plus } from '@gravity-ui/icons';
3
+ import { Button, Card, Icon } from '@gravity-ui/uikit';
4
+ import _ from 'lodash';
3
5
  import { ActionTypes } from '../../../common/types';
4
6
  import { block } from '../../../utils';
5
7
  import { useContentConfigStore } from '../../context/contentConfig';
8
+ import { useEditorStore } from '../../context/editorContext';
6
9
  import { useMessageSender } from '../../context/messagesContext';
7
10
  import './BlocksList.css';
8
11
  const b = block('blocks-list');
9
12
  const BlocksList = (_p) => {
10
- const { blocks } = useContentConfigStore();
13
+ const { blocks, insertBlock } = useContentConfigStore();
14
+ const { selectedBlock } = useEditorStore();
11
15
  const sendMessage = useMessageSender();
12
16
  const onMouseDown = useCallback((blockType) => {
13
17
  sendMessage({ type: ActionTypes.InsertModeEnable, payload: { blockType } });
14
18
  }, [sendMessage]);
19
+ const onAddClick = useCallback((type) => {
20
+ const path = selectedBlock ? selectedBlock.path : [0];
21
+ return insertBlock(path, type);
22
+ }, [insertBlock, selectedBlock]);
23
+ const groups = blocks.reduce((acc, currentBlock) => {
24
+ const group = currentBlock.schema.group;
25
+ if (group) {
26
+ if (!acc[group]) {
27
+ /* eslint-disable no-param-reassign */
28
+ acc[group] = [];
29
+ }
30
+ acc[group].push(currentBlock);
31
+ }
32
+ else {
33
+ if (!acc['other']) {
34
+ /* eslint-disable no-param-reassign */
35
+ acc['other'] = [];
36
+ }
37
+ acc['other'].push(currentBlock);
38
+ }
39
+ return acc;
40
+ }, {});
15
41
  return (React.createElement("div", { className: b() },
16
42
  React.createElement("div", { className: b('section') },
17
43
  React.createElement("div", { className: b('title') }, "Blocks"),
18
- blocks.map(({ type, schema: { name } }) => (React.createElement(Card, { key: type, className: b('card'), onMouseDown: () => onMouseDown(type) }, name))))));
44
+ Object.entries(groups).map(([key, groupBlocks]) => (React.createElement("div", { className: b('group'), key: key },
45
+ React.createElement("div", { className: b('subtitle') }, _.capitalize(key)),
46
+ React.createElement("div", null, groupBlocks.map(({ type, schema: { name } }) => (React.createElement(Card, { key: type, className: b('card'), onMouseDown: () => onMouseDown(type) },
47
+ React.createElement(Icon, { data: Grip }),
48
+ React.createElement("div", { className: b('name') }, name),
49
+ React.createElement(Button, { onClick: () => onAddClick(type) },
50
+ React.createElement(Icon, { data: Plus }))))))))))));
19
51
  };
20
52
  export default BlocksList;
@@ -0,0 +1,36 @@
1
+ /* use this for style redefinitions to awoid problems with
2
+ unpredictable css rules order in build */
3
+ body {
4
+ --pc-editor-header-height: 48px;
5
+ --pc-editor-code-header-height: 36px;
6
+ --pc-editor-divider-width: 12px;
7
+ --pc-editor-left-column-width: calc(400px + var(--pc-editor-divider-width));
8
+ --pc-editor-base-color: var(--g-color-base-brand);
9
+ --pc-editor-control-color: var(--g-color-base-brand);
10
+ --pc-editor-control-icon-color: var(--g-color-text-dark-primary);
11
+ }
12
+
13
+ .pc-panels__button-wrap {
14
+ --pc-editor-panels-button-gap: 8px;
15
+ position: absolute;
16
+ z-index: 1000;
17
+ }
18
+ .pc-panels__button-wrap_left {
19
+ bottom: var(--pc-editor-panels-button-gap);
20
+ left: calc(100% + var(--pc-editor-panels-button-gap));
21
+ }
22
+ .pc-panels__button-wrap_right {
23
+ bottom: var(--pc-editor-panels-button-gap);
24
+ right: calc(100% + var(--pc-editor-panels-button-gap));
25
+ }
26
+ .pc-panels__draggable {
27
+ position: relative;
28
+ width: 12px;
29
+ height: 100%;
30
+ cursor: col-resize;
31
+ background-color: var(--g-color-line-generic);
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ color: var(--g-color-base-background);
36
+ }