@gravity-ui/page-constructor 3.1.2 → 3.3.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 (241) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +2 -0
  3. package/build/cjs/blocks/Banner/schema.d.ts +63 -21
  4. package/build/cjs/blocks/CardLayout/schema.d.ts +10 -4
  5. package/build/cjs/blocks/Companies/schema.d.ts +5 -2
  6. package/build/cjs/blocks/ContentLayout/ContentLayout.js +3 -2
  7. package/build/cjs/blocks/ContentLayout/schema.d.ts +107 -61
  8. package/build/cjs/blocks/ContentLayout/schema.js +23 -18
  9. package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +31 -4
  10. package/build/cjs/blocks/ExtendedFeatures/schema.js +2 -3
  11. package/build/cjs/blocks/FilterBlock/schema.d.ts +13 -5
  12. package/build/cjs/blocks/FilterBlock/schema.js +13 -2
  13. package/build/cjs/blocks/Header/Header.css +6 -7
  14. package/build/cjs/blocks/Header/schema.d.ts +92 -36
  15. package/build/cjs/blocks/Header/schema.js +1 -0
  16. package/build/cjs/blocks/HeaderSlider/schema.d.ts +48 -53
  17. package/build/cjs/blocks/HeaderSlider/schema.js +3 -1
  18. package/build/cjs/blocks/Icons/schema.d.ts +3 -1
  19. package/build/cjs/blocks/Icons/schema.js +2 -1
  20. package/build/cjs/blocks/Info/schema.d.ts +19 -8
  21. package/build/cjs/blocks/Map/schema.d.ts +17 -6
  22. package/build/cjs/blocks/Media/schema.d.ts +204 -152
  23. package/build/cjs/blocks/Media/schema.js +1 -1
  24. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +22 -8
  25. package/build/cjs/blocks/PromoFeaturesBlock/schema.js +1 -0
  26. package/build/cjs/blocks/Questions/schema.d.ts +7 -3
  27. package/build/cjs/blocks/Slider/schema.d.ts +13 -18
  28. package/build/cjs/blocks/Slider/schema.js +4 -5
  29. package/build/cjs/blocks/Table/schema.d.ts +5 -2
  30. package/build/cjs/blocks/Table/schema.js +12 -2
  31. package/build/cjs/blocks/Tabs/schema.d.ts +43 -16
  32. package/build/cjs/components/BlockBase/BlockBase.js +2 -2
  33. package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +1 -1
  34. package/build/cjs/components/Image/schema.d.ts +1 -0
  35. package/build/cjs/components/Image/schema.js +3 -2
  36. package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +1 -1
  37. package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +1 -1
  38. package/build/cjs/customization/BlockDecoration.d.ts +1 -1
  39. package/build/cjs/customization/BlockDecoration.js +5 -6
  40. package/build/cjs/editor/{Components → components}/AddBlock/AddBlock.css +0 -7
  41. package/build/cjs/editor/components/AddBlock/AddBlock.d.ts +7 -0
  42. package/build/cjs/editor/{Components → components}/AddBlock/AddBlock.js +2 -2
  43. package/build/cjs/editor/components/BlockForm/BlockForm.d.ts +12 -0
  44. package/build/cjs/editor/components/BlockForm/BlockForm.js +26 -0
  45. package/build/cjs/editor/components/EditBlock/EditBlock.d.ts +13 -0
  46. package/build/cjs/editor/components/EditBlock/EditBlock.js +44 -0
  47. package/build/cjs/editor/components/ErrorBoundary/ErrorBoundary.css +27 -0
  48. package/build/cjs/editor/components/ErrorBoundary/ErrorBoundary.d.ts +13 -0
  49. package/build/cjs/editor/components/ErrorBoundary/ErrorBoundary.js +35 -0
  50. package/build/cjs/editor/components/ErrorBoundary/i18n/en.json +4 -0
  51. package/build/cjs/editor/components/ErrorBoundary/i18n/index.d.ts +2 -0
  52. package/build/cjs/editor/components/ErrorBoundary/i18n/index.js +8 -0
  53. package/build/cjs/editor/components/ErrorBoundary/i18n/ru.json +4 -0
  54. package/build/cjs/editor/components/PagePropsForm/PagePropsForm.d.ts +10 -0
  55. package/build/cjs/editor/components/PagePropsForm/PagePropsForm.js +17 -0
  56. package/build/cjs/editor/containers/Editor/Editor.css +28 -0
  57. package/build/cjs/editor/containers/Editor/Editor.d.ts +2 -0
  58. package/build/cjs/editor/containers/Editor/Editor.js +37 -0
  59. package/build/cjs/editor/containers/Form/Form.css +94 -0
  60. package/build/cjs/editor/containers/Form/Form.d.ts +11 -0
  61. package/build/cjs/editor/containers/Form/Form.js +47 -0
  62. package/build/cjs/editor/containers/Form/dynamic-form-custom.css +0 -0
  63. package/build/cjs/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.css +27 -0
  64. package/build/cjs/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.d.ts +19 -0
  65. package/build/cjs/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.js +72 -0
  66. package/build/cjs/editor/dynamic-forms-custom/config.d.ts +2 -0
  67. package/build/cjs/editor/dynamic-forms-custom/config.js +13 -0
  68. package/build/cjs/editor/dynamic-forms-custom/hooks/useOneOf.d.ts +12 -0
  69. package/build/cjs/editor/dynamic-forms-custom/hooks/useOneOf.js +75 -0
  70. package/build/cjs/editor/dynamic-forms-custom/parser/detect.d.ts +9 -0
  71. package/build/cjs/editor/dynamic-forms-custom/parser/detect.js +36 -0
  72. package/build/cjs/editor/dynamic-forms-custom/parser/index.d.ts +28 -0
  73. package/build/cjs/editor/dynamic-forms-custom/parser/index.js +188 -0
  74. package/build/cjs/editor/dynamic-forms-custom/parser/types.d.ts +29 -0
  75. package/build/cjs/editor/dynamic-forms-custom/parser/types.js +2 -0
  76. package/build/cjs/editor/dynamic-forms-custom/parser/views.d.ts +37 -0
  77. package/build/cjs/editor/dynamic-forms-custom/parser/views.js +46 -0
  78. package/build/cjs/editor/hooks/useFormSpec.d.ts +2 -0
  79. package/build/cjs/editor/hooks/useFormSpec.js +13 -0
  80. package/build/cjs/editor/index.d.ts +1 -1
  81. package/build/cjs/editor/index.js +1 -1
  82. package/build/cjs/editor/store/index.d.ts +8 -11
  83. package/build/cjs/editor/store/index.js +61 -15
  84. package/build/cjs/editor/store/reducer.d.ts +17 -9
  85. package/build/cjs/editor/store/reducer.js +14 -31
  86. package/build/cjs/editor/store/utils.d.ts +1 -0
  87. package/build/cjs/editor/store/utils.js +3 -1
  88. package/build/cjs/editor/types/index.d.ts +11 -9
  89. package/build/cjs/editor/utils/index.d.ts +4 -3
  90. package/build/cjs/editor/utils/index.js +6 -4
  91. package/build/cjs/grid/Col/Col.d.ts +1 -1
  92. package/build/cjs/models/constructor-items/blocks.d.ts +13 -8
  93. package/build/cjs/models/constructor.d.ts +2 -2
  94. package/build/cjs/models/customization.d.ts +3 -8
  95. package/build/cjs/models/navigation.d.ts +1 -0
  96. package/build/cjs/navigation/components/Header/Header.css +2 -0
  97. package/build/cjs/navigation/components/Header/Header.js +15 -4
  98. package/build/cjs/navigation/schema.d.ts +1 -0
  99. package/build/cjs/schema/constants.d.ts +908 -0
  100. package/build/cjs/schema/constants.js +42 -0
  101. package/build/cjs/schema/index.d.ts +9 -228
  102. package/build/cjs/schema/index.js +8 -46
  103. package/build/cjs/schema/validators/common.d.ts +71 -27
  104. package/build/cjs/schema/validators/common.js +50 -17
  105. package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +12 -5
  106. package/build/cjs/sub-blocks/BasicCard/schema.d.ts +8 -3
  107. package/build/cjs/sub-blocks/Content/schema.d.ts +14 -6
  108. package/build/cjs/sub-blocks/Content/schema.js +9 -1
  109. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +23 -9
  110. package/build/cjs/sub-blocks/MediaCard/schema.d.ts +16 -6
  111. package/build/cjs/sub-blocks/PriceDetailed/schema.d.ts +1 -0
  112. package/build/cjs/sub-blocks/PriceDetailed/schema.js +5 -1
  113. package/build/cjs/sub-blocks/Quote/schema.d.ts +6 -2
  114. package/build/esm/blocks/Banner/schema.d.ts +63 -21
  115. package/build/esm/blocks/CardLayout/schema.d.ts +10 -4
  116. package/build/esm/blocks/Companies/schema.d.ts +5 -2
  117. package/build/esm/blocks/ContentLayout/ContentLayout.js +3 -2
  118. package/build/esm/blocks/ContentLayout/schema.d.ts +107 -61
  119. package/build/esm/blocks/ContentLayout/schema.js +23 -18
  120. package/build/esm/blocks/ExtendedFeatures/schema.d.ts +31 -4
  121. package/build/esm/blocks/ExtendedFeatures/schema.js +3 -4
  122. package/build/esm/blocks/FilterBlock/schema.d.ts +13 -5
  123. package/build/esm/blocks/FilterBlock/schema.js +13 -2
  124. package/build/esm/blocks/Header/Header.css +6 -7
  125. package/build/esm/blocks/Header/schema.d.ts +92 -36
  126. package/build/esm/blocks/Header/schema.js +1 -0
  127. package/build/esm/blocks/HeaderSlider/schema.d.ts +48 -53
  128. package/build/esm/blocks/HeaderSlider/schema.js +2 -1
  129. package/build/esm/blocks/Icons/schema.d.ts +3 -1
  130. package/build/esm/blocks/Icons/schema.js +2 -1
  131. package/build/esm/blocks/Info/schema.d.ts +19 -8
  132. package/build/esm/blocks/Map/schema.d.ts +17 -6
  133. package/build/esm/blocks/Media/schema.d.ts +204 -152
  134. package/build/esm/blocks/Media/schema.js +2 -2
  135. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +22 -8
  136. package/build/esm/blocks/PromoFeaturesBlock/schema.js +1 -0
  137. package/build/esm/blocks/Questions/schema.d.ts +7 -3
  138. package/build/esm/blocks/Slider/schema.d.ts +13 -18
  139. package/build/esm/blocks/Slider/schema.js +4 -5
  140. package/build/esm/blocks/Table/schema.d.ts +5 -2
  141. package/build/esm/blocks/Table/schema.js +12 -2
  142. package/build/esm/blocks/Tabs/schema.d.ts +43 -16
  143. package/build/esm/components/BlockBase/BlockBase.js +2 -2
  144. package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +1 -1
  145. package/build/esm/components/Image/schema.d.ts +1 -0
  146. package/build/esm/components/Image/schema.js +3 -2
  147. package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +1 -1
  148. package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +1 -1
  149. package/build/esm/customization/BlockDecoration.d.ts +1 -1
  150. package/build/esm/customization/BlockDecoration.js +6 -6
  151. package/build/esm/editor/{Components → components}/AddBlock/AddBlock.css +0 -7
  152. package/build/esm/editor/components/AddBlock/AddBlock.d.ts +8 -0
  153. package/build/esm/editor/{Components → components}/AddBlock/AddBlock.js +2 -2
  154. package/build/esm/editor/components/BlockForm/BlockForm.d.ts +12 -0
  155. package/build/esm/editor/components/BlockForm/BlockForm.js +23 -0
  156. package/build/esm/editor/components/EditBlock/EditBlock.d.ts +14 -0
  157. package/build/esm/editor/components/EditBlock/EditBlock.js +41 -0
  158. package/build/esm/editor/components/ErrorBoundary/ErrorBoundary.css +27 -0
  159. package/build/esm/editor/components/ErrorBoundary/ErrorBoundary.d.ts +14 -0
  160. package/build/esm/editor/components/ErrorBoundary/ErrorBoundary.js +31 -0
  161. package/build/esm/editor/components/ErrorBoundary/i18n/en.json +4 -0
  162. package/build/esm/editor/components/ErrorBoundary/i18n/index.d.ts +2 -0
  163. package/build/esm/editor/components/ErrorBoundary/i18n/index.js +5 -0
  164. package/build/esm/editor/components/ErrorBoundary/i18n/ru.json +4 -0
  165. package/build/esm/editor/components/PagePropsForm/PagePropsForm.d.ts +10 -0
  166. package/build/esm/editor/components/PagePropsForm/PagePropsForm.js +13 -0
  167. package/build/esm/editor/containers/Editor/Editor.css +28 -0
  168. package/build/esm/editor/containers/Editor/Editor.d.ts +3 -0
  169. package/build/esm/editor/containers/Editor/Editor.js +34 -0
  170. package/build/esm/editor/containers/Form/Form.css +94 -0
  171. package/build/esm/editor/containers/Form/Form.d.ts +12 -0
  172. package/build/esm/editor/containers/Form/Form.js +45 -0
  173. package/build/esm/editor/containers/Form/dynamic-form-custom.css +0 -0
  174. package/build/esm/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.css +27 -0
  175. package/build/esm/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.d.ts +20 -0
  176. package/build/esm/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.js +68 -0
  177. package/build/esm/editor/dynamic-forms-custom/config.d.ts +2 -0
  178. package/build/esm/editor/dynamic-forms-custom/config.js +9 -0
  179. package/build/esm/editor/dynamic-forms-custom/hooks/useOneOf.d.ts +12 -0
  180. package/build/esm/editor/dynamic-forms-custom/hooks/useOneOf.js +69 -0
  181. package/build/esm/editor/dynamic-forms-custom/parser/detect.d.ts +9 -0
  182. package/build/esm/editor/dynamic-forms-custom/parser/detect.js +32 -0
  183. package/build/esm/editor/dynamic-forms-custom/parser/index.d.ts +28 -0
  184. package/build/esm/editor/dynamic-forms-custom/parser/index.js +186 -0
  185. package/build/esm/editor/dynamic-forms-custom/parser/types.d.ts +29 -0
  186. package/build/esm/editor/dynamic-forms-custom/parser/types.js +1 -0
  187. package/build/esm/editor/dynamic-forms-custom/parser/views.d.ts +37 -0
  188. package/build/esm/editor/dynamic-forms-custom/parser/views.js +39 -0
  189. package/build/esm/editor/hooks/useFormSpec.d.ts +2 -0
  190. package/build/esm/editor/hooks/useFormSpec.js +9 -0
  191. package/build/esm/editor/index.d.ts +1 -1
  192. package/build/esm/editor/index.js +1 -1
  193. package/build/esm/editor/store/index.d.ts +8 -11
  194. package/build/esm/editor/store/index.js +63 -17
  195. package/build/esm/editor/store/reducer.d.ts +17 -9
  196. package/build/esm/editor/store/reducer.js +12 -29
  197. package/build/esm/editor/store/utils.d.ts +1 -0
  198. package/build/esm/editor/store/utils.js +1 -0
  199. package/build/esm/editor/types/index.d.ts +11 -9
  200. package/build/esm/editor/utils/index.d.ts +4 -3
  201. package/build/esm/editor/utils/index.js +4 -3
  202. package/build/esm/grid/Col/Col.d.ts +1 -1
  203. package/build/esm/models/constructor-items/blocks.d.ts +13 -8
  204. package/build/esm/models/constructor.d.ts +2 -2
  205. package/build/esm/models/customization.d.ts +3 -8
  206. package/build/esm/models/navigation.d.ts +1 -0
  207. package/build/esm/navigation/components/Header/Header.css +2 -0
  208. package/build/esm/navigation/components/Header/Header.js +16 -5
  209. package/build/esm/navigation/schema.d.ts +1 -0
  210. package/build/esm/schema/constants.d.ts +908 -0
  211. package/build/esm/schema/constants.js +39 -0
  212. package/build/esm/schema/index.d.ts +9 -228
  213. package/build/esm/schema/index.js +4 -42
  214. package/build/esm/schema/validators/common.d.ts +71 -27
  215. package/build/esm/schema/validators/common.js +49 -16
  216. package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +12 -5
  217. package/build/esm/sub-blocks/BasicCard/schema.d.ts +8 -3
  218. package/build/esm/sub-blocks/Content/schema.d.ts +14 -6
  219. package/build/esm/sub-blocks/Content/schema.js +9 -1
  220. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +23 -9
  221. package/build/esm/sub-blocks/MediaCard/schema.d.ts +16 -6
  222. package/build/esm/sub-blocks/PriceDetailed/schema.d.ts +1 -0
  223. package/build/esm/sub-blocks/PriceDetailed/schema.js +5 -1
  224. package/build/esm/sub-blocks/Quote/schema.d.ts +6 -2
  225. package/package.json +5 -1
  226. package/server/models/constructor-items/blocks.d.ts +13 -8
  227. package/server/models/constructor.d.ts +2 -2
  228. package/server/models/customization.d.ts +3 -8
  229. package/server/models/navigation.d.ts +1 -0
  230. package/build/cjs/editor/Components/AddBlock/AddBlock.d.ts +0 -7
  231. package/build/cjs/editor/Components/EditBlock/EditBlock.d.ts +0 -4
  232. package/build/cjs/editor/Components/EditBlock/EditBlock.js +0 -32
  233. package/build/cjs/editor/Containers/Editor.d.ts +0 -2
  234. package/build/cjs/editor/Containers/Editor.js +0 -24
  235. package/build/esm/editor/Components/AddBlock/AddBlock.d.ts +0 -8
  236. package/build/esm/editor/Components/EditBlock/EditBlock.d.ts +0 -5
  237. package/build/esm/editor/Components/EditBlock/EditBlock.js +0 -30
  238. package/build/esm/editor/Containers/Editor.d.ts +0 -2
  239. package/build/esm/editor/Containers/Editor.js +0 -20
  240. /package/build/cjs/editor/{Components → components}/EditBlock/EditBlock.css +0 -0
  241. /package/build/esm/editor/{Components → components}/EditBlock/EditBlock.css +0 -0
@@ -1,6 +1,11 @@
1
1
  export declare const ContentBase: {
2
2
  title: {
3
3
  oneOf: ({
4
+ type: string;
5
+ contentType: string;
6
+ optionName: string;
7
+ } | {
8
+ optionName: string;
4
9
  type: string;
5
10
  additionalProperties: boolean;
6
11
  required: string[];
@@ -20,14 +25,13 @@ export declare const ContentBase: {
20
25
  type: string;
21
26
  };
22
27
  };
23
- } | {
24
- type: string;
25
- contentType: string;
28
+ contentType?: undefined;
26
29
  })[];
27
30
  };
28
31
  text: {
29
32
  type: string;
30
33
  contentType: string;
34
+ inputType: string;
31
35
  };
32
36
  additionalInfo: {
33
37
  type: string;
@@ -74,6 +78,11 @@ export declare const ContentBlock: {
74
78
  };
75
79
  title: {
76
80
  oneOf: ({
81
+ type: string;
82
+ contentType: string;
83
+ optionName: string;
84
+ } | {
85
+ optionName: string;
77
86
  type: string;
78
87
  additionalProperties: boolean;
79
88
  required: string[];
@@ -93,14 +102,13 @@ export declare const ContentBlock: {
93
102
  type: string;
94
103
  };
95
104
  };
96
- } | {
97
- type: string;
98
- contentType: string;
105
+ contentType?: undefined;
99
106
  })[];
100
107
  };
101
108
  text: {
102
109
  type: string;
103
110
  contentType: string;
111
+ inputType: string;
104
112
  };
105
113
  additionalInfo: {
106
114
  type: string;
@@ -2,11 +2,19 @@ import { ButtonBlock, LinkProps, TitleProps, containerSizesArray, contentSizes,
2
2
  import { filteredArray } from '../../schema/validators/utils';
3
3
  export const ContentBase = {
4
4
  title: {
5
- oneOf: [{ type: 'string', contentType: 'text' }, TitleProps],
5
+ oneOf: [
6
+ {
7
+ type: 'string',
8
+ contentType: 'text',
9
+ optionName: 'text',
10
+ },
11
+ Object.assign(Object.assign({}, TitleProps), { optionName: 'options' }),
12
+ ],
6
13
  },
7
14
  text: {
8
15
  type: 'string',
9
16
  contentType: 'yfm',
17
+ inputType: 'textarea',
10
18
  },
11
19
  additionalInfo: {
12
20
  type: 'string',
@@ -8,7 +8,8 @@ export declare const LayoutItem: {
8
8
  type: string;
9
9
  };
10
10
  image: {
11
- anyOf: ({
11
+ oneOf: ({
12
+ optionName: string;
12
13
  oneOf: ({
13
14
  type: string;
14
15
  properties: {
@@ -19,7 +20,10 @@ export declare const LayoutItem: {
19
20
  } | {
20
21
  type: string;
21
22
  pattern: string;
23
+ optionName: string;
22
24
  })[];
25
+ type?: undefined;
26
+ items?: undefined;
23
27
  } | {
24
28
  type: string;
25
29
  items: {
@@ -33,8 +37,10 @@ export declare const LayoutItem: {
33
37
  } | {
34
38
  type: string;
35
39
  pattern: string;
40
+ optionName: string;
36
41
  })[];
37
42
  };
43
+ optionName: string;
38
44
  })[];
39
45
  };
40
46
  video: {
@@ -49,7 +55,8 @@ export declare const LayoutItem: {
49
55
  };
50
56
  };
51
57
  loop: {
52
- anyOf: ({
58
+ oneOf: ({
59
+ optionName: string;
53
60
  type: string;
54
61
  additionalProperties: boolean;
55
62
  required: string[];
@@ -63,6 +70,7 @@ export declare const LayoutItem: {
63
70
  };
64
71
  } | {
65
72
  type: string;
73
+ optionName: string;
66
74
  })[];
67
75
  };
68
76
  type: {
@@ -72,13 +80,13 @@ export declare const LayoutItem: {
72
80
  muted: {
73
81
  type: string;
74
82
  };
75
- playing: {
83
+ autoplay: {
76
84
  type: string;
77
85
  };
78
86
  elapsedTime: {
79
87
  type: string;
80
88
  };
81
- playIcon: {
89
+ playButton: {
82
90
  type: string;
83
91
  additionalProperties: boolean;
84
92
  properties: {
@@ -116,6 +124,10 @@ export declare const LayoutItem: {
116
124
  };
117
125
  dataLens: {
118
126
  oneOf: ({
127
+ type: string;
128
+ optionName: string;
129
+ } | {
130
+ optionName: string;
119
131
  type: string;
120
132
  additionalProperties: boolean;
121
133
  required: string[];
@@ -128,8 +140,6 @@ export declare const LayoutItem: {
128
140
  enum: string[];
129
141
  };
130
142
  };
131
- } | {
132
- type: string;
133
143
  })[];
134
144
  };
135
145
  fullscreen: {
@@ -217,6 +227,11 @@ export declare const LayoutItem: {
217
227
  content: Partial<{
218
228
  title: {
219
229
  oneOf: ({
230
+ type: string;
231
+ contentType: string;
232
+ optionName: string;
233
+ } | {
234
+ optionName: string;
220
235
  type: string;
221
236
  additionalProperties: boolean;
222
237
  required: string[];
@@ -236,14 +251,13 @@ export declare const LayoutItem: {
236
251
  type: string;
237
252
  };
238
253
  };
239
- } | {
240
- type: string;
241
- contentType: string;
254
+ contentType?: undefined;
242
255
  })[];
243
256
  };
244
257
  text: {
245
258
  type: string;
246
259
  contentType: string;
260
+ inputType: string;
247
261
  };
248
262
  additionalInfo: {
249
263
  type: string;
@@ -10,7 +10,8 @@ export declare const MediaCardBlock: {
10
10
  type: string;
11
11
  };
12
12
  image: {
13
- anyOf: ({
13
+ oneOf: ({
14
+ optionName: string;
14
15
  oneOf: ({
15
16
  type: string;
16
17
  properties: {
@@ -21,7 +22,10 @@ export declare const MediaCardBlock: {
21
22
  } | {
22
23
  type: string;
23
24
  pattern: string;
25
+ optionName: string;
24
26
  })[];
27
+ type?: undefined;
28
+ items?: undefined;
25
29
  } | {
26
30
  type: string;
27
31
  items: {
@@ -35,8 +39,10 @@ export declare const MediaCardBlock: {
35
39
  } | {
36
40
  type: string;
37
41
  pattern: string;
42
+ optionName: string;
38
43
  })[];
39
44
  };
45
+ optionName: string;
40
46
  })[];
41
47
  };
42
48
  video: {
@@ -51,7 +57,8 @@ export declare const MediaCardBlock: {
51
57
  };
52
58
  };
53
59
  loop: {
54
- anyOf: ({
60
+ oneOf: ({
61
+ optionName: string;
55
62
  type: string;
56
63
  additionalProperties: boolean;
57
64
  required: string[];
@@ -65,6 +72,7 @@ export declare const MediaCardBlock: {
65
72
  };
66
73
  } | {
67
74
  type: string;
75
+ optionName: string;
68
76
  })[];
69
77
  };
70
78
  type: {
@@ -74,13 +82,13 @@ export declare const MediaCardBlock: {
74
82
  muted: {
75
83
  type: string;
76
84
  };
77
- playing: {
85
+ autoplay: {
78
86
  type: string;
79
87
  };
80
88
  elapsedTime: {
81
89
  type: string;
82
90
  };
83
- playIcon: {
91
+ playButton: {
84
92
  type: string;
85
93
  additionalProperties: boolean;
86
94
  properties: {
@@ -118,6 +126,10 @@ export declare const MediaCardBlock: {
118
126
  };
119
127
  dataLens: {
120
128
  oneOf: ({
129
+ type: string;
130
+ optionName: string;
131
+ } | {
132
+ optionName: string;
121
133
  type: string;
122
134
  additionalProperties: boolean;
123
135
  required: string[];
@@ -130,8 +142,6 @@ export declare const MediaCardBlock: {
130
142
  enum: string[];
131
143
  };
132
144
  };
133
- } | {
134
- type: string;
135
145
  })[];
136
146
  };
137
147
  fullscreen: {
@@ -49,6 +49,7 @@ export declare const PriceDetailedBlock: {
49
49
  priceType: {
50
50
  type: string;
51
51
  enum: string[];
52
+ default: string;
52
53
  };
53
54
  numberGroupItems: {
54
55
  type: string;
@@ -124,7 +124,10 @@ const PriceDetailsListProps = {
124
124
  };
125
125
  const PriceDetailsProps = {
126
126
  items: {
127
- anyOf: [filteredArray(PriceDetailsListProps), filteredArray(PriceDetailsSettingsProps)],
127
+ oneOf: [
128
+ Object.assign(Object.assign({}, filteredArray(Object.assign({}, PriceDetailsListProps))), { optionName: 'marked-list' }),
129
+ Object.assign(Object.assign({}, filteredArray(Object.assign({}, PriceDetailsSettingsProps))), { optionName: 'settings' }),
130
+ ],
128
131
  },
129
132
  };
130
133
  const PriceItem = {
@@ -140,6 +143,7 @@ export const PriceDetailedBlock = {
140
143
  properties: Object.assign(Object.assign(Object.assign({}, BaseProps), AnimatableProps), { items: filteredArray(PriceItem), description: PriceDetailedDescriptionProps, details: PriceDetailedDetailsProps, priceType: {
141
144
  type: 'string',
142
145
  enum: PriceDetailedDetailsType,
146
+ default: 'settings',
143
147
  }, numberGroupItems: {
144
148
  type: 'number',
145
149
  enum: [3, 4, 5],
@@ -8,7 +8,7 @@ export declare const Quote: {
8
8
  contentType: string;
9
9
  };
10
10
  image: {
11
- oneOf: ({
11
+ oneOf: (({
12
12
  oneOf: ({
13
13
  type: string;
14
14
  properties: {
@@ -19,12 +19,16 @@ export declare const Quote: {
19
19
  } | {
20
20
  type: string;
21
21
  pattern: string;
22
+ optionName: string;
22
23
  })[];
23
- } | {
24
+ } & {
25
+ optionName: string;
26
+ }) | {
24
27
  type: string;
25
28
  additionalProperties: boolean;
26
29
  required: import("../..").Theme[];
27
30
  properties: {};
31
+ optionName: string;
28
32
  })[];
29
33
  };
30
34
  logo: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "3.1.2",
3
+ "version": "3.3.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -48,8 +48,10 @@
48
48
  "dependencies": {
49
49
  "@gravity-ui/i18n": "^1.0.0",
50
50
  "bem-cn-lite": "^4.0.0",
51
+ "final-form": "^4.20.9",
51
52
  "github-buttons": "2.23.0",
52
53
  "lodash": "^4.17.21",
54
+ "react-final-form": "^6.5.9",
53
55
  "react-player": "^2.9.0",
54
56
  "react-slick": "^0.28.1",
55
57
  "react-spring": "^9.3.0",
@@ -69,6 +71,7 @@
69
71
  "@commitlint/cli": "^17.1.2",
70
72
  "@commitlint/config-conventional": "^17.1.0",
71
73
  "@doc-tools/transform": "2.12.0",
74
+ "@gravity-ui/dynamic-forms": "^1.7.1",
72
75
  "@gravity-ui/eslint-config": "^2.0.0",
73
76
  "@gravity-ui/icons": "^2.1.0",
74
77
  "@gravity-ui/prettier-config": "^1.0.1",
@@ -85,6 +88,7 @@
85
88
  "@testing-library/react": "^13.4.0",
86
89
  "@testing-library/user-event": "^14.4.3",
87
90
  "@types/jest": "^29.2.4",
91
+ "@types/json-schema": "^7.0.12",
88
92
  "@types/lodash": "^4.14.176",
89
93
  "@types/react": "^18.0.27",
90
94
  "@types/react-dom": "^18.0.10",
@@ -30,6 +30,7 @@ export interface Childable {
30
30
  children?: SubBlock[];
31
31
  }
32
32
  export interface BlockBaseProps {
33
+ type: BlockType;
33
34
  index?: number;
34
35
  anchor?: AnchorProps;
35
36
  visible?: GridColumnSize;
@@ -244,14 +245,18 @@ export interface IconsBlockProps {
244
245
  src: string;
245
246
  }[];
246
247
  }
247
- export interface ContentLayoutBlockProps {
248
- properties?: {
249
- size?: ContentSize;
250
- background?: BackgroundImageProps;
251
- centered?: boolean;
252
- theme?: ContentTheme;
253
- textWidth?: ContentTextSize;
254
- };
248
+ interface ContentLayoutBlockParams {
249
+ size?: ContentSize;
250
+ background?: BackgroundImageProps;
251
+ centered?: boolean;
252
+ theme?: ContentTheme;
253
+ textWidth?: ContentTextSize;
254
+ }
255
+ export interface ContentLayoutBlockProps extends ContentLayoutBlockParams {
256
+ /**
257
+ * @deprecated Use params on top level instead
258
+ */
259
+ properties?: ContentLayoutBlockParams;
255
260
  textContent: ContentBlockProps;
256
261
  fileContent?: FileLinkProps[];
257
262
  }
@@ -1,5 +1,5 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
- import { Animatable, Block, BlockDecoratorProps, ConstructorItem, ThemedMediaProps, WithChildren } from './';
2
+ import { Animatable, Block, BlockDecorationProps, ConstructorItem, ThemedMediaProps, WithChildren } from './';
3
3
  export interface PageData {
4
4
  content: PageContent;
5
5
  }
@@ -41,7 +41,7 @@ export interface CustomConfig {
41
41
  headers?: CustomItems;
42
42
  loadable?: LoadableConfig;
43
43
  decorators?: {
44
- block?: ((props: BlockDecoratorProps) => React.ReactElement)[];
44
+ block?: ((props: BlockDecorationProps) => React.ReactElement)[];
45
45
  };
46
46
  }
47
47
  export {};
@@ -1,9 +1,4 @@
1
1
  import { PropsWithChildren } from 'react';
2
- export interface BlockDecorationProps extends PropsWithChildren {
3
- id: string | number;
4
- }
5
- export interface BlockDecoratorProps extends PropsWithChildren {
6
- id: string | number;
7
- isHeader?: boolean;
8
- }
9
- export type BlockDecorator = (props: BlockDecoratorProps) => React.ReactElement;
2
+ import { BlockBaseProps } from './constructor-items';
3
+ export type BlockDecorationProps = Pick<BlockBaseProps, 'index' | 'type'> & PropsWithChildren;
4
+ export type BlockDecorator = (props: BlockDecorationProps) => React.ReactElement;
@@ -63,6 +63,7 @@ export interface HeaderData {
63
63
  leftItems: NavigationItemModel[];
64
64
  rightItems?: NavigationItemModel[];
65
65
  iconSize?: number;
66
+ withBorder?: boolean;
66
67
  }
67
68
  export interface FooterColumn {
68
69
  title: string;
@@ -1,7 +0,0 @@
1
- import { PropsWithChildren } from 'react';
2
- import { Block } from '../../../models';
3
- export interface AddBlockProps {
4
- onAdd: (data: Block) => void;
5
- }
6
- declare const AddBlock: ({ onAdd }: PropsWithChildren<AddBlockProps>) => JSX.Element;
7
- export default AddBlock;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { EditBlockProps } from '../../../editor/types';
3
- declare const _default: React.MemoExoticComponent<({ id, isHeader, activeBlockId, onDelete, onSelect, onCopy, onOrderChange, children, orderedBlocksCount, }: EditBlockProps) => JSX.Element>;
4
- export default _default;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const react_1 = tslib_1.__importStar(require("react"));
5
- const icons_1 = require("@gravity-ui/icons");
6
- const utils_1 = require("../../../utils");
7
- const b = (0, utils_1.block)('edit-block');
8
- const EditBlock = ({ id, isHeader, activeBlockId, onDelete, onSelect, onCopy, onOrderChange, children, orderedBlocksCount, }) => {
9
- const ref = (0, react_1.useRef)(null);
10
- const controlsActive = activeBlockId === id;
11
- (0, react_1.useEffect)(() => {
12
- var _a;
13
- if (controlsActive && ref.current) {
14
- (_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: 'smooth', block: 'center' });
15
- }
16
- }, [controlsActive]);
17
- return (react_1.default.createElement("div", { className: b(), onClick: () => {
18
- onSelect(id);
19
- }, ref: ref },
20
- react_1.default.createElement("div", { className: b('controls', { active: controlsActive, isHeader }) }, controlsActive && (react_1.default.createElement("div", { className: b('controls-content'), onClick: (e) => e.stopPropagation() },
21
- typeof id === 'number' && (react_1.default.createElement(react_1.Fragment, null,
22
- id > 0 && (react_1.default.createElement("div", { className: b('control'), onClick: () => onOrderChange(id, id - 1) },
23
- react_1.default.createElement(icons_1.ChevronUp, null))),
24
- id < orderedBlocksCount - 1 && (react_1.default.createElement("div", { className: b('control'), onClick: () => onOrderChange(id, id + 1) },
25
- react_1.default.createElement(icons_1.ChevronDown, null))),
26
- react_1.default.createElement("div", { className: b('control'), onClick: () => onCopy(id) },
27
- react_1.default.createElement(icons_1.Copy, null)))),
28
- react_1.default.createElement("div", { className: b('control'), onClick: () => onDelete(id) },
29
- react_1.default.createElement(icons_1.TrashBin, null))))),
30
- children));
31
- };
32
- exports.default = react_1.default.memo(EditBlock);
@@ -1,2 +0,0 @@
1
- import { EditorProps } from '../types';
2
- export declare const Editor: ({ children, ...rest }: EditorProps) => JSX.Element;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Editor = void 0;
4
- const tslib_1 = require("tslib");
5
- const react_1 = tslib_1.__importStar(require("react"));
6
- const AddBlock_1 = tslib_1.__importDefault(require("../Components/AddBlock/AddBlock"));
7
- const EditBlock_1 = tslib_1.__importDefault(require("../Components/EditBlock/EditBlock"));
8
- const store_1 = require("../store");
9
- const utils_1 = require("../utils");
10
- const Editor = (_a) => {
11
- var { children } = _a, rest = tslib_1.__rest(_a, ["children"]);
12
- const { content, onAdd, editControlsProps } = (0, store_1.useEditorState)(rest);
13
- const constructorProps = (0, react_1.useMemo)(() => {
14
- const editControlsDecorator = (props) => (react_1.default.createElement(EditBlock_1.default, Object.assign({}, props, editControlsProps)));
15
- return {
16
- content,
17
- custom: (0, utils_1.addCustomDecorator)(editControlsDecorator, rest.custom),
18
- };
19
- }, [editControlsProps, content, rest.custom]);
20
- return (react_1.default.createElement("div", null,
21
- children(constructorProps),
22
- react_1.default.createElement(AddBlock_1.default, { onAdd: onAdd })));
23
- };
24
- exports.Editor = Editor;
@@ -1,8 +0,0 @@
1
- import { PropsWithChildren } from 'react';
2
- import { Block } from '../../../models';
3
- import './AddBlock.css';
4
- export interface AddBlockProps {
5
- onAdd: (data: Block) => void;
6
- }
7
- declare const AddBlock: ({ onAdd }: PropsWithChildren<AddBlockProps>) => JSX.Element;
8
- export default AddBlock;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { EditBlockProps } from '../../../editor/types';
3
- import './EditBlock.css';
4
- declare const _default: React.MemoExoticComponent<({ id, isHeader, activeBlockId, onDelete, onSelect, onCopy, onOrderChange, children, orderedBlocksCount, }: EditBlockProps) => JSX.Element>;
5
- export default _default;
@@ -1,30 +0,0 @@
1
- import React, { Fragment, useEffect, useRef } from 'react';
2
- import { ChevronDown, ChevronUp, Copy, TrashBin } from '@gravity-ui/icons';
3
- import { block } from '../../../utils';
4
- import './EditBlock.css';
5
- const b = block('edit-block');
6
- const EditBlock = ({ id, isHeader, activeBlockId, onDelete, onSelect, onCopy, onOrderChange, children, orderedBlocksCount, }) => {
7
- const ref = useRef(null);
8
- const controlsActive = activeBlockId === id;
9
- useEffect(() => {
10
- var _a;
11
- if (controlsActive && ref.current) {
12
- (_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: 'smooth', block: 'center' });
13
- }
14
- }, [controlsActive]);
15
- return (React.createElement("div", { className: b(), onClick: () => {
16
- onSelect(id);
17
- }, ref: ref },
18
- React.createElement("div", { className: b('controls', { active: controlsActive, isHeader }) }, controlsActive && (React.createElement("div", { className: b('controls-content'), onClick: (e) => e.stopPropagation() },
19
- typeof id === 'number' && (React.createElement(Fragment, null,
20
- id > 0 && (React.createElement("div", { className: b('control'), onClick: () => onOrderChange(id, id - 1) },
21
- React.createElement(ChevronUp, null))),
22
- id < orderedBlocksCount - 1 && (React.createElement("div", { className: b('control'), onClick: () => onOrderChange(id, id + 1) },
23
- React.createElement(ChevronDown, null))),
24
- React.createElement("div", { className: b('control'), onClick: () => onCopy(id) },
25
- React.createElement(Copy, null)))),
26
- React.createElement("div", { className: b('control'), onClick: () => onDelete(id) },
27
- React.createElement(TrashBin, null))))),
28
- children));
29
- };
30
- export default React.memo(EditBlock);
@@ -1,2 +0,0 @@
1
- import { EditorProps } from '../types';
2
- export declare const Editor: ({ children, ...rest }: EditorProps) => JSX.Element;
@@ -1,20 +0,0 @@
1
- import { __rest } from "tslib";
2
- import React, { useMemo } from 'react';
3
- import AddBlock from '../Components/AddBlock/AddBlock';
4
- import EditBlock from '../Components/EditBlock/EditBlock';
5
- import { useEditorState } from '../store';
6
- import { addCustomDecorator } from '../utils';
7
- export const Editor = (_a) => {
8
- var { children } = _a, rest = __rest(_a, ["children"]);
9
- const { content, onAdd, editControlsProps } = useEditorState(rest);
10
- const constructorProps = useMemo(() => {
11
- const editControlsDecorator = (props) => (React.createElement(EditBlock, Object.assign({}, props, editControlsProps)));
12
- return {
13
- content,
14
- custom: addCustomDecorator(editControlsDecorator, rest.custom),
15
- };
16
- }, [editControlsProps, content, rest.custom]);
17
- return (React.createElement("div", null,
18
- children(constructorProps),
19
- React.createElement(AddBlock, { onAdd: onAdd })));
20
- };