@redneckz/wildless-cms-uni-blocks 0.6.19 → 0.6.21

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 (218) hide show
  1. package/bin/migration-scripts/0.6.19.js +21 -0
  2. package/bin/migration-scripts/0.6.21.js +15 -0
  3. package/bundle/bundle.umd.js +49 -22
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/Blocks.d.ts +2 -41
  6. package/bundle/components/Blocks.mobile.d.ts +2 -18
  7. package/bundle/components/ContentPage/ContentPage.d.ts +2 -2
  8. package/bundle/components/ContentPage/mapSlot.d.ts +2 -0
  9. package/bundle/components/ContentPage/normalizeBlock.d.ts +3 -11
  10. package/bundle/components/ContentPage/normalizeBlock.mobile.d.ts +3 -2
  11. package/bundle/components/ContentPage/renderBlock.d.ts +7 -3
  12. package/bundle/components/ContentPage/renderBlockList.d.ts +14 -0
  13. package/bundle/components/ContentPage/renderSlots.d.ts +12 -0
  14. package/bundle/model/BlockDecorator.d.ts +4 -3
  15. package/bundle/model/BlocksRegistry.d.ts +1 -1
  16. package/bundle/model/ContentPageDef.d.ts +1 -4
  17. package/bundle/model/JSXBlock.d.ts +3 -1
  18. package/dist/components/Blocks.d.ts +2 -41
  19. package/dist/components/Blocks.js.map +1 -1
  20. package/dist/components/Blocks.mobile.d.ts +2 -18
  21. package/dist/components/Blocks.mobile.js.map +1 -1
  22. package/dist/components/ContentPage/ContentPage.d.ts +2 -2
  23. package/dist/components/ContentPage/ContentPage.js +12 -11
  24. package/dist/components/ContentPage/ContentPage.js.map +1 -1
  25. package/dist/components/ContentPage/mapSlot.d.ts +2 -0
  26. package/dist/components/ContentPage/mapSlot.js +14 -0
  27. package/dist/components/ContentPage/mapSlot.js.map +1 -0
  28. package/dist/components/ContentPage/normalizeBlock.d.ts +3 -11
  29. package/dist/components/ContentPage/normalizeBlock.js +13 -3
  30. package/dist/components/ContentPage/normalizeBlock.js.map +1 -1
  31. package/dist/components/ContentPage/normalizeBlock.mobile.d.ts +3 -2
  32. package/dist/components/ContentPage/normalizeBlock.mobile.js +18 -3
  33. package/dist/components/ContentPage/normalizeBlock.mobile.js.map +1 -1
  34. package/dist/components/ContentPage/normalizePage.js +2 -14
  35. package/dist/components/ContentPage/normalizePage.js.map +1 -1
  36. package/dist/components/ContentPage/renderBlock.d.ts +7 -3
  37. package/dist/components/ContentPage/renderBlock.js +9 -9
  38. package/dist/components/ContentPage/renderBlock.js.map +1 -1
  39. package/dist/components/ContentPage/renderBlockList.d.ts +14 -0
  40. package/dist/components/ContentPage/renderBlockList.js +18 -0
  41. package/dist/components/ContentPage/renderBlockList.js.map +1 -0
  42. package/dist/components/ContentPage/renderSlots.d.ts +12 -0
  43. package/dist/components/ContentPage/renderSlots.js +17 -0
  44. package/dist/components/ContentPage/renderSlots.js.map +1 -0
  45. package/dist/model/BlockDecorator.d.ts +4 -3
  46. package/dist/model/BlockDecorator.js +1 -2
  47. package/dist/model/BlockDecorator.js.map +1 -1
  48. package/dist/model/BlocksRegistry.d.ts +1 -1
  49. package/dist/model/ContentPageDef.d.ts +1 -4
  50. package/dist/model/JSXBlock.d.ts +3 -1
  51. package/dist/model/getParentBlockDef.js +5 -2
  52. package/dist/model/getParentBlockDef.js.map +1 -1
  53. package/lib/components/Blocks.d.ts +2 -41
  54. package/lib/components/Blocks.js.map +1 -1
  55. package/lib/components/Blocks.mobile.d.ts +2 -18
  56. package/lib/components/Blocks.mobile.js.map +1 -1
  57. package/lib/components/ContentPage/ContentPage.d.ts +2 -2
  58. package/lib/components/ContentPage/ContentPage.js +12 -11
  59. package/lib/components/ContentPage/ContentPage.js.map +1 -1
  60. package/lib/components/ContentPage/mapSlot.d.ts +2 -0
  61. package/lib/components/ContentPage/mapSlot.js +11 -0
  62. package/lib/components/ContentPage/mapSlot.js.map +1 -0
  63. package/lib/components/ContentPage/normalizeBlock.d.ts +3 -11
  64. package/lib/components/ContentPage/normalizeBlock.js +13 -3
  65. package/lib/components/ContentPage/normalizeBlock.js.map +1 -1
  66. package/lib/components/ContentPage/normalizeBlock.mobile.d.ts +3 -2
  67. package/lib/components/ContentPage/normalizeBlock.mobile.js +18 -3
  68. package/lib/components/ContentPage/normalizeBlock.mobile.js.map +1 -1
  69. package/lib/components/ContentPage/normalizePage.js +2 -14
  70. package/lib/components/ContentPage/normalizePage.js.map +1 -1
  71. package/lib/components/ContentPage/renderBlock.d.ts +7 -3
  72. package/lib/components/ContentPage/renderBlock.js +9 -9
  73. package/lib/components/ContentPage/renderBlock.js.map +1 -1
  74. package/lib/components/ContentPage/renderBlockList.d.ts +14 -0
  75. package/lib/components/ContentPage/renderBlockList.js +15 -0
  76. package/lib/components/ContentPage/renderBlockList.js.map +1 -0
  77. package/lib/components/ContentPage/renderSlots.d.ts +12 -0
  78. package/lib/components/ContentPage/renderSlots.js +14 -0
  79. package/lib/components/ContentPage/renderSlots.js.map +1 -0
  80. package/lib/model/BlockDecorator.d.ts +4 -3
  81. package/lib/model/BlockDecorator.js +0 -1
  82. package/lib/model/BlockDecorator.js.map +1 -1
  83. package/lib/model/BlocksRegistry.d.ts +1 -1
  84. package/lib/model/ContentPageDef.d.ts +1 -4
  85. package/lib/model/JSXBlock.d.ts +3 -1
  86. package/lib/model/getParentBlockDef.js +5 -2
  87. package/lib/model/getParentBlockDef.js.map +1 -1
  88. package/mobile/bundle/bundle.umd.js +49 -22
  89. package/mobile/bundle/bundle.umd.min.js +1 -1
  90. package/mobile/bundle/components/Blocks.d.ts +2 -18
  91. package/mobile/bundle/components/ContentPage/ContentPage.d.ts +2 -2
  92. package/mobile/bundle/components/ContentPage/mapSlot.d.ts +2 -0
  93. package/mobile/bundle/components/ContentPage/normalizeBlock.d.ts +3 -2
  94. package/mobile/bundle/components/ContentPage/renderBlock.d.ts +7 -3
  95. package/mobile/bundle/components/ContentPage/renderBlockList.d.ts +14 -0
  96. package/mobile/bundle/components/ContentPage/renderSlots.d.ts +12 -0
  97. package/mobile/bundle/model/BlockDecorator.d.ts +4 -3
  98. package/mobile/bundle/model/BlocksRegistry.d.ts +1 -1
  99. package/mobile/bundle/model/ContentPageDef.d.ts +1 -4
  100. package/mobile/bundle/model/JSXBlock.d.ts +3 -1
  101. package/mobile/dist/components/Blocks.d.ts +2 -18
  102. package/mobile/dist/components/Blocks.js.map +1 -1
  103. package/mobile/dist/components/ContentPage/ContentPage.d.ts +2 -2
  104. package/mobile/dist/components/ContentPage/ContentPage.js +12 -11
  105. package/mobile/dist/components/ContentPage/ContentPage.js.map +1 -1
  106. package/mobile/dist/components/ContentPage/mapSlot.d.ts +2 -0
  107. package/mobile/dist/components/ContentPage/mapSlot.js +14 -0
  108. package/mobile/dist/components/ContentPage/mapSlot.js.map +1 -0
  109. package/mobile/dist/components/ContentPage/normalizeBlock.d.ts +3 -2
  110. package/mobile/dist/components/ContentPage/normalizeBlock.js +18 -3
  111. package/mobile/dist/components/ContentPage/normalizeBlock.js.map +1 -1
  112. package/mobile/dist/components/ContentPage/normalizePage.js +2 -14
  113. package/mobile/dist/components/ContentPage/normalizePage.js.map +1 -1
  114. package/mobile/dist/components/ContentPage/renderBlock.d.ts +7 -3
  115. package/mobile/dist/components/ContentPage/renderBlock.js +9 -9
  116. package/mobile/dist/components/ContentPage/renderBlock.js.map +1 -1
  117. package/mobile/dist/components/ContentPage/renderBlockList.d.ts +14 -0
  118. package/mobile/dist/components/ContentPage/renderBlockList.js +18 -0
  119. package/mobile/dist/components/ContentPage/renderBlockList.js.map +1 -0
  120. package/mobile/dist/components/ContentPage/renderSlots.d.ts +12 -0
  121. package/mobile/dist/components/ContentPage/renderSlots.js +17 -0
  122. package/mobile/dist/components/ContentPage/renderSlots.js.map +1 -0
  123. package/mobile/dist/model/BlockDecorator.d.ts +4 -3
  124. package/mobile/dist/model/BlockDecorator.js +1 -2
  125. package/mobile/dist/model/BlockDecorator.js.map +1 -1
  126. package/mobile/dist/model/BlocksRegistry.d.ts +1 -1
  127. package/mobile/dist/model/ContentPageDef.d.ts +1 -4
  128. package/mobile/dist/model/JSXBlock.d.ts +3 -1
  129. package/mobile/dist/model/getParentBlockDef.js +5 -2
  130. package/mobile/dist/model/getParentBlockDef.js.map +1 -1
  131. package/mobile/lib/components/Blocks.d.ts +2 -18
  132. package/mobile/lib/components/Blocks.js.map +1 -1
  133. package/mobile/lib/components/ContentPage/ContentPage.d.ts +2 -2
  134. package/mobile/lib/components/ContentPage/ContentPage.js +12 -11
  135. package/mobile/lib/components/ContentPage/ContentPage.js.map +1 -1
  136. package/mobile/lib/components/ContentPage/mapSlot.d.ts +2 -0
  137. package/mobile/lib/components/ContentPage/mapSlot.js +11 -0
  138. package/mobile/lib/components/ContentPage/mapSlot.js.map +1 -0
  139. package/mobile/lib/components/ContentPage/normalizeBlock.d.ts +3 -2
  140. package/mobile/lib/components/ContentPage/normalizeBlock.js +18 -3
  141. package/mobile/lib/components/ContentPage/normalizeBlock.js.map +1 -1
  142. package/mobile/lib/components/ContentPage/normalizePage.js +2 -14
  143. package/mobile/lib/components/ContentPage/normalizePage.js.map +1 -1
  144. package/mobile/lib/components/ContentPage/renderBlock.d.ts +7 -3
  145. package/mobile/lib/components/ContentPage/renderBlock.js +9 -9
  146. package/mobile/lib/components/ContentPage/renderBlock.js.map +1 -1
  147. package/mobile/lib/components/ContentPage/renderBlockList.d.ts +14 -0
  148. package/mobile/lib/components/ContentPage/renderBlockList.js +15 -0
  149. package/mobile/lib/components/ContentPage/renderBlockList.js.map +1 -0
  150. package/mobile/lib/components/ContentPage/renderSlots.d.ts +12 -0
  151. package/mobile/lib/components/ContentPage/renderSlots.js +14 -0
  152. package/mobile/lib/components/ContentPage/renderSlots.js.map +1 -0
  153. package/mobile/lib/model/BlockDecorator.d.ts +4 -3
  154. package/mobile/lib/model/BlockDecorator.js +0 -1
  155. package/mobile/lib/model/BlockDecorator.js.map +1 -1
  156. package/mobile/lib/model/BlocksRegistry.d.ts +1 -1
  157. package/mobile/lib/model/ContentPageDef.d.ts +1 -4
  158. package/mobile/lib/model/JSXBlock.d.ts +3 -1
  159. package/mobile/lib/model/getParentBlockDef.js +5 -2
  160. package/mobile/lib/model/getParentBlockDef.js.map +1 -1
  161. package/mobile/src/components/Blocks.ts +2 -1
  162. package/mobile/src/components/ContentPage/ContentPage.page.json +131 -133
  163. package/mobile/src/components/ContentPage/ContentPage.tsx +25 -28
  164. package/mobile/src/components/ContentPage/mapSlot.ts +17 -0
  165. package/mobile/src/components/ContentPage/normalizeBlock.ts +26 -4
  166. package/mobile/src/components/ContentPage/normalizePage.ts +3 -20
  167. package/mobile/src/components/ContentPage/renderBlock.tsx +16 -18
  168. package/mobile/src/components/ContentPage/renderBlockList.tsx +39 -0
  169. package/mobile/src/components/ContentPage/renderSlots.tsx +33 -0
  170. package/mobile/src/model/BlockDecorator.ts +4 -4
  171. package/mobile/src/model/BlocksRegistry.ts +1 -1
  172. package/mobile/src/model/ContentPageDef.ts +1 -5
  173. package/mobile/src/model/JSXBlock.ts +3 -1
  174. package/mobile/src/model/getParentBlockDef.ts +6 -2
  175. package/package.json +1 -1
  176. package/src/components/Accordion/Accordion.fixture.mobile.tsx +16 -4
  177. package/src/components/Blocks.mobile.ts +2 -1
  178. package/src/components/Blocks.ts +2 -1
  179. package/src/components/ContentPage/ContentPage.page.json +131 -133
  180. package/src/components/ContentPage/ContentPage.tsx +25 -28
  181. package/src/components/ContentPage/mapSlot.ts +17 -0
  182. package/src/components/ContentPage/normalizeBlock.mobile.ts +26 -4
  183. package/src/components/ContentPage/normalizeBlock.ts +17 -4
  184. package/src/components/ContentPage/normalizePage.ts +3 -20
  185. package/src/components/ContentPage/renderBlock.tsx +16 -18
  186. package/src/components/ContentPage/renderBlockList.tsx +39 -0
  187. package/src/components/ContentPage/renderSlots.tsx +33 -0
  188. package/src/model/BlockDecorator.ts +4 -4
  189. package/src/model/BlocksRegistry.ts +1 -1
  190. package/src/model/ContentPageDef.ts +1 -5
  191. package/src/model/JSXBlock.ts +3 -1
  192. package/src/model/getParentBlockDef.ts +6 -2
  193. package/bin/migration-scripts/0.4.0.js +0 -3
  194. package/bin/migration-scripts/0.4.1.js +0 -3
  195. package/bundle/components/ContentPage/filterBlocks.d.ts +0 -12
  196. package/bundle/components/ContentPage/filterBlocks.mobile.d.ts +0 -12
  197. package/dist/components/ContentPage/filterBlocks.d.ts +0 -12
  198. package/dist/components/ContentPage/filterBlocks.js +0 -6
  199. package/dist/components/ContentPage/filterBlocks.js.map +0 -1
  200. package/dist/components/ContentPage/filterBlocks.mobile.d.ts +0 -12
  201. package/dist/components/ContentPage/filterBlocks.mobile.js +0 -8
  202. package/dist/components/ContentPage/filterBlocks.mobile.js.map +0 -1
  203. package/lib/components/ContentPage/filterBlocks.d.ts +0 -12
  204. package/lib/components/ContentPage/filterBlocks.js +0 -3
  205. package/lib/components/ContentPage/filterBlocks.js.map +0 -1
  206. package/lib/components/ContentPage/filterBlocks.mobile.d.ts +0 -12
  207. package/lib/components/ContentPage/filterBlocks.mobile.js +0 -5
  208. package/lib/components/ContentPage/filterBlocks.mobile.js.map +0 -1
  209. package/mobile/bundle/components/ContentPage/filterBlocks.d.ts +0 -3
  210. package/mobile/dist/components/ContentPage/filterBlocks.d.ts +0 -3
  211. package/mobile/dist/components/ContentPage/filterBlocks.js +0 -8
  212. package/mobile/dist/components/ContentPage/filterBlocks.js.map +0 -1
  213. package/mobile/lib/components/ContentPage/filterBlocks.d.ts +0 -3
  214. package/mobile/lib/components/ContentPage/filterBlocks.js +0 -5
  215. package/mobile/lib/components/ContentPage/filterBlocks.js.map +0 -1
  216. package/mobile/src/components/ContentPage/filterBlocks.ts +0 -11
  217. package/src/components/ContentPage/filterBlocks.mobile.ts +0 -11
  218. package/src/components/ContentPage/filterBlocks.ts +0 -6
@@ -19,17 +19,138 @@
19
19
  "style": ["bg-main-divider"],
20
20
  "likeControl": true,
21
21
  "slots": {
22
- "header": {
23
- "style": ["mb-5", "shadow-[0_8px_32px_0px_#00000014]"],
24
- "blocks": [
25
- {
26
- "type": "Header",
27
- "content": {
28
- "defaultLocation": "Москва"
29
- }
22
+ "header": [
23
+ {
24
+ "type": "Header",
25
+ "content": {
26
+ "defaultLocation": "Москва"
30
27
  }
31
- ]
32
- }
28
+ }
29
+ ],
30
+ "footer": [
31
+ {
32
+ "type": "Footer",
33
+ "style": ["col-span-12"],
34
+ "content": {
35
+ "topItems": [
36
+ {
37
+ "href": "https://rshb.ru/",
38
+ "text": "О банке",
39
+ "target": "_blank",
40
+ "items": [
41
+ {
42
+ "href": "https://rshb.ru/",
43
+ "text": "О банке"
44
+ },
45
+ {
46
+ "href": "https://rshb.ru/",
47
+ "text": "Новости"
48
+ },
49
+ {
50
+ "href": "https://rshb.ru/",
51
+ "text": "Офисы и отделения"
52
+ },
53
+ {
54
+ "href": "https://rshb.ru/",
55
+ "text": "Карьера в банке"
56
+ },
57
+ {
58
+ "href": "https://rshb.ru/",
59
+ "text": "Пресс-центр"
60
+ },
61
+ {
62
+ "href": "https://rshb.ru/",
63
+ "text": "Кредитным организациям"
64
+ },
65
+ {
66
+ "href": "https://rshb.ru/",
67
+ "text": "Закупки"
68
+ },
69
+ {
70
+ "href": "https://rshb.ru/",
71
+ "text": "Премиальным клиентам"
72
+ },
73
+ {
74
+ "href": "https://rshb.ru/",
75
+ "text": "Непрофильные/Профильные нецелевые активы"
76
+ },
77
+ {
78
+ "href": "https://rshb.ru/",
79
+ "text": "Инсайдерам"
80
+ },
81
+ {
82
+ "href": "https://rshb.ru/",
83
+ "text": "Противодействие коррупции"
84
+ },
85
+ {
86
+ "href": "https://rshb.ru/",
87
+ "text": "Меры безопасности"
88
+ },
89
+ {
90
+ "href": "https://rshb.ru/",
91
+ "text": "Залоговое имущество"
92
+ }
93
+ ]
94
+ }
95
+ ],
96
+ "contacts": [
97
+ {
98
+ "text": "+7 (495) 787-7-787",
99
+ "description": "Для звонков из-за границы",
100
+ "type": "tel"
101
+ },
102
+ {
103
+ "text": "8 (800) 100-01-00",
104
+ "description": "По России",
105
+ "type": "tel"
106
+ },
107
+ {
108
+ "text": "7787",
109
+ "description": "Абонентам МТС, Мегафон, Билайн и Tele21",
110
+ "type": "tel"
111
+ }
112
+ ],
113
+ "documents": [
114
+ {
115
+ "text": "Информация о процентных ставках по договорам банковского вклада с физическими лицами",
116
+ "href": "https://rshb.ru/",
117
+ "target": "_blank"
118
+ },
119
+ {
120
+ "text": "Раскрытие информации профессиональным участником рынка ценных бумаг",
121
+ "href": "https://rshb.ru/",
122
+ "target": "_blank"
123
+ },
124
+ {
125
+ "text": "Раскрытие информации",
126
+ "href": "https://rshb.ru/",
127
+ "target": "_blank"
128
+ },
129
+ {
130
+ "text": "Удостоверяющий центр",
131
+ "href": "https://rshb.ru/",
132
+ "target": "_blank"
133
+ },
134
+ {
135
+ "text": "Финансовая культура",
136
+ "href": "https://rshb.ru/",
137
+ "target": "_blank"
138
+ }
139
+ ],
140
+ "socialMedia": [
141
+ {
142
+ "href": "https://vk.com"
143
+ },
144
+ {
145
+ "href": "https://ok.ru"
146
+ },
147
+ {
148
+ "href": "https://t.me"
149
+ }
150
+ ]
151
+ }
152
+ }
153
+ ]
33
154
  },
34
155
  "blocks": [
35
156
  {
@@ -2224,129 +2345,6 @@
2224
2345
  {
2225
2346
  "type": "SafeDepositRental",
2226
2347
  "style": ["col-span-12"]
2227
- },
2228
-
2229
- {
2230
- "type": "Footer",
2231
- "style": ["col-span-12"],
2232
- "content": {
2233
- "topItems": [
2234
- {
2235
- "href": "https://rshb.ru/",
2236
- "text": "О банке",
2237
- "target": "_blank",
2238
- "items": [
2239
- {
2240
- "href": "https://rshb.ru/",
2241
- "text": "О банке"
2242
- },
2243
- {
2244
- "href": "https://rshb.ru/",
2245
- "text": "Новости"
2246
- },
2247
- {
2248
- "href": "https://rshb.ru/",
2249
- "text": "Офисы и отделения"
2250
- },
2251
- {
2252
- "href": "https://rshb.ru/",
2253
- "text": "Карьера в банке"
2254
- },
2255
- {
2256
- "href": "https://rshb.ru/",
2257
- "text": "Пресс-центр"
2258
- },
2259
- {
2260
- "href": "https://rshb.ru/",
2261
- "text": "Кредитным организациям"
2262
- },
2263
- {
2264
- "href": "https://rshb.ru/",
2265
- "text": "Закупки"
2266
- },
2267
- {
2268
- "href": "https://rshb.ru/",
2269
- "text": "Премиальным клиентам"
2270
- },
2271
- {
2272
- "href": "https://rshb.ru/",
2273
- "text": "Непрофильные/Профильные нецелевые активы"
2274
- },
2275
- {
2276
- "href": "https://rshb.ru/",
2277
- "text": "Инсайдерам"
2278
- },
2279
- {
2280
- "href": "https://rshb.ru/",
2281
- "text": "Противодействие коррупции"
2282
- },
2283
- {
2284
- "href": "https://rshb.ru/",
2285
- "text": "Меры безопасности"
2286
- },
2287
- {
2288
- "href": "https://rshb.ru/",
2289
- "text": "Залоговое имущество"
2290
- }
2291
- ]
2292
- }
2293
- ],
2294
- "contacts": [
2295
- {
2296
- "text": "+7 (495) 787-7-787",
2297
- "description": "Для звонков из-за границы",
2298
- "type": "tel"
2299
- },
2300
- {
2301
- "text": "8 (800) 100-01-00",
2302
- "description": "По России",
2303
- "type": "tel"
2304
- },
2305
- {
2306
- "text": "7787",
2307
- "description": "Абонентам МТС, Мегафон, Билайн и Tele21",
2308
- "type": "tel"
2309
- }
2310
- ],
2311
- "documents": [
2312
- {
2313
- "text": "Информация о процентных ставках по договорам банковского вклада с физическими лицами",
2314
- "href": "https://rshb.ru/",
2315
- "target": "_blank"
2316
- },
2317
- {
2318
- "text": "Раскрытие информации профессиональным участником рынка ценных бумаг",
2319
- "href": "https://rshb.ru/",
2320
- "target": "_blank"
2321
- },
2322
- {
2323
- "text": "Раскрытие информации",
2324
- "href": "https://rshb.ru/",
2325
- "target": "_blank"
2326
- },
2327
- {
2328
- "text": "Удостоверяющий центр",
2329
- "href": "https://rshb.ru/",
2330
- "target": "_blank"
2331
- },
2332
- {
2333
- "text": "Финансовая культура",
2334
- "href": "https://rshb.ru/",
2335
- "target": "_blank"
2336
- }
2337
- ],
2338
- "socialMedia": [
2339
- {
2340
- "href": "https://vk.com"
2341
- },
2342
- {
2343
- "href": "https://ok.ru"
2344
- },
2345
- {
2346
- "href": "https://t.me"
2347
- }
2348
- ]
2349
- }
2350
2348
  }
2351
2349
  ]
2352
2350
  }
@@ -1,12 +1,14 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import type { BlockAncestors, BlockDecorator } from '../../model/BlockDecorator';
2
+ import type { BlockDecorator } from '../../model/BlockDecorator';
3
3
  import type { BlocksRegistry } from '../../model/BlocksRegistry';
4
- import type { BlockDef, ContentPageDef } from '../../model/ContentPageDef';
5
- import type { UniBlockProps } from '../../model/JSXBlock';
4
+ import type { ContentPageDef } from '../../model/ContentPageDef';
5
+ import type { JSXBlock, UniBlockProps } from '../../model/JSXBlock';
6
6
  import { style2className } from '../../utils/style2className';
7
7
  import { LikeControl } from '../LikeControl/LikeControl';
8
8
  import type { ContentPageContext } from './ContentPageContext';
9
- import { renderBlock } from './renderBlock';
9
+ import { RenderBlockOptions } from './renderBlock';
10
+ import { renderBlocksList } from './renderBlockList';
11
+ import { renderSlots } from './renderSlots';
10
12
 
11
13
  interface ContentPageProps extends UniBlockProps {
12
14
  blocksRegistry: BlocksRegistry;
@@ -17,26 +19,35 @@ interface ContentPageProps extends UniBlockProps {
17
19
  const defaultBlockDecorator: BlockDecorator = ({ blockClassName, block, render }) =>
18
20
  render({ blockClassName, block });
19
21
 
20
- export const ContentPage = JSX<ContentPageProps>((props) => {
21
- const { className = '', context, data = {} } = props;
22
+ export const ContentPage: JSXBlock<ContentPageProps> = JSX<ContentPageProps>((props) => {
23
+ const { className = '', blocksRegistry, blockDecorator, context, data = {} } = props;
22
24
 
23
25
  const { style: pageStyle, blocks, slots, likeControl, colorPalette = 'pc' } = data;
24
26
 
25
- const blocksListRenderer = renderBlocksList(props);
27
+ const options: RenderBlockOptions = {
28
+ key: '',
29
+ blocksRegistry,
30
+ page: data,
31
+ blockDecorator: blockDecorator || defaultBlockDecorator,
32
+ context,
33
+ };
34
+
35
+ const pageSlots = renderSlots({ slots, parent: data, options });
26
36
 
27
37
  return (
28
38
  <section
29
39
  className={`relative ${style2className(pageStyle)} ${className}`}
30
40
  data-theme={colorPalette}
31
41
  >
32
- {slots?.header?.blocks?.length ? (
33
- <div className={`${style2className(slots.header.style)}`}>
34
- {blocksListRenderer(slots.header.blocks, ['header'])}
35
- </div>
42
+ {pageSlots?.header ? (
43
+ <div className="mb-5 shadow-[0_8px_32px_0px_#00000014]">{pageSlots.header}</div>
36
44
  ) : null}
37
45
 
38
46
  {blocks?.length ? (
39
- <div className="container grid grid-cols-12 gap-1">{blocksListRenderer(blocks)}</div>
47
+ <div className="container grid grid-cols-12 gap-1">
48
+ {renderBlocksList({ blocks, parent: data, options })}
49
+ {pageSlots?.footer ? pageSlots.footer : null}
50
+ </div>
40
51
  ) : null}
41
52
 
42
53
  {likeControl ? renderLikeControl(context) : null}
@@ -44,22 +55,8 @@ export const ContentPage = JSX<ContentPageProps>((props) => {
44
55
  );
45
56
  });
46
57
 
47
- function renderBlocksList({ blocksRegistry, data, blockDecorator, context }: ContentPageProps) {
48
- return (blocks: BlockDef[], ancestors?: BlockAncestors) =>
49
- blocks.map((block, i) =>
50
- renderBlock(
51
- block,
52
- {
53
- key: `${block.type || '#'}-${i}`,
54
- blocksRegistry,
55
- page: data || {},
56
- blockDecorator: blockDecorator || defaultBlockDecorator,
57
- context,
58
- },
59
- ancestors,
60
- ),
61
- );
62
- }
58
+ ContentPage.childrenTypes = [];
59
+ ContentPage.slots = () => ['header', 'footer'];
63
60
 
64
61
  function renderLikeControl(context: ContentPageContext) {
65
62
  return (
@@ -0,0 +1,17 @@
1
+ import type { BlockDef, Slot } from '../../model/ContentPageDef';
2
+
3
+ export const mapSlot =
4
+ (mapper: (blocks?: BlockDef[]) => BlockDef[]) =>
5
+ <S extends Slot>(slot: S): S => ({
6
+ ...slot,
7
+ blocks: mapper(slot.blocks),
8
+ slots: slot.slots
9
+ ? Object.entries(slot.slots).reduce(
10
+ (res, [slotKey, slotBlocks]) => ({
11
+ ...res,
12
+ [slotKey]: mapper(slotBlocks),
13
+ }),
14
+ {},
15
+ )
16
+ : {},
17
+ });
@@ -1,7 +1,29 @@
1
- import { BlockDef } from '../../model/ContentPageDef';
1
+ import type { BlocksRegistry } from '../../model/BlocksRegistry';
2
+ import type { BlockDef, Slot } from '../../model/ContentPageDef';
3
+ import { mapSlot } from './mapSlot';
2
4
 
3
- export function normalizeBlock(block: BlockDef) {
4
- const { mobile, ...rest } = block;
5
+ export function normalizeBlock<S extends Slot>(block?: S, blocksRegistry?: BlocksRegistry): S {
6
+ const { mobile, ...rest } = (block || {}) as BlockDef;
5
7
 
6
- return mobile ? { ...rest, ...mobile, content: { ...rest.content, ...mobile.content } } : block;
8
+ const normalizedBlock = mobile
9
+ ? { ...rest, ...mobile, content: { ...rest.content, ...mobile.content } }
10
+ : block;
11
+
12
+ return {
13
+ ...mapSlot((blocks) => filterBlocks(blocks, blocksRegistry))(normalizedBlock || {}),
14
+ } as S;
7
15
  }
16
+
17
+ const filterBlocks = (blocks?: BlockDef[], blocksRegistry?: BlocksRegistry) =>
18
+ blocks
19
+ ? blocks
20
+ ?.filter(
21
+ (block) =>
22
+ blocksRegistry &&
23
+ (block?.type || block?.mobile?.type || '') in blocksRegistry &&
24
+ !block.mobile?.hidden,
25
+ )
26
+ .map((block) => ({
27
+ ...normalizeBlock(block, blocksRegistry),
28
+ }))
29
+ : [];
@@ -1,8 +1,21 @@
1
- import { BlockDef } from '../../model/ContentPageDef';
1
+ import type { BlocksRegistry } from '../../model/BlocksRegistry';
2
+ import type { BlockDef, Slot } from '../../model/ContentPageDef';
3
+ import { mapSlot } from './mapSlot';
2
4
 
3
- export function normalizeBlock(block: BlockDef) {
5
+ export function normalizeBlock<S extends Slot>(block?: S, blocksRegistry?: BlocksRegistry): S {
4
6
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
- const { mobile, ...rest } = block;
7
+ const { mobile, ...rest } = (block || {}) as BlockDef;
6
8
 
7
- return rest;
9
+ return {
10
+ ...mapSlot((blocks) => filterBlocks(blocks, blocksRegistry))({ ...rest }),
11
+ } as S;
8
12
  }
13
+
14
+ const filterBlocks = (blocks?: BlockDef[], blocksRegistry?: BlocksRegistry) =>
15
+ blocks
16
+ ? blocks
17
+ .filter((block) => blocksRegistry && (block?.type || '') in blocksRegistry)
18
+ .map((block) => ({
19
+ ...normalizeBlock(block, blocksRegistry),
20
+ }))
21
+ : [];
@@ -1,6 +1,6 @@
1
1
  import type { BlocksRegistry } from '../../model/BlocksRegistry';
2
- import type { ContentPageDef, Slot } from '../../model/ContentPageDef';
3
- import { filterBlocks } from './filterBlocks';
2
+ import type { ContentPageDef } from '../../model/ContentPageDef';
3
+ import { normalizeBlock } from './normalizeBlock';
4
4
 
5
5
  export const normalizePage =
6
6
  (blocksRegistry: BlocksRegistry) =>
@@ -9,22 +9,5 @@ export const normalizePage =
9
9
  return undefined;
10
10
  }
11
11
 
12
- const { blocks = [], slots } = contentPage;
13
-
14
- return {
15
- ...contentPage,
16
- blocks: filterBlocks(blocks, blocksRegistry),
17
- slots:
18
- slots &&
19
- Object.keys(slots).reduce(
20
- (res, key) => ({
21
- ...res,
22
- [key]: {
23
- ...slots[key],
24
- blocks: filterBlocks((slots[key] as Slot).blocks || [], blocksRegistry),
25
- },
26
- }),
27
- {},
28
- ),
29
- };
12
+ return normalizeBlock(contentPage, blocksRegistry);
30
13
  };
@@ -1,11 +1,12 @@
1
- import { BlockAncestors, BlockDecorator, DEFAULT_ANCESTORS } from '../../model/BlockDecorator';
1
+ import { BlockAncestors, BlockDecorator } from '../../model/BlockDecorator';
2
2
  import type { BlocksRegistry } from '../../model/BlocksRegistry';
3
3
  import type { BlockDef, ContentPageDef } from '../../model/ContentPageDef';
4
- import type { VNode } from '../../model/VNode';
5
4
  import { style2className } from '../../utils/style2className';
6
5
  import type { ContentPageContext } from './ContentPageContext';
6
+ import { renderBlocksList } from './renderBlockList';
7
+ import { renderSlots } from './renderSlots';
7
8
 
8
- interface RenderBlockOptions {
9
+ export interface RenderBlockOptions {
9
10
  key: string;
10
11
  page: ContentPageDef;
11
12
  blockDecorator: BlockDecorator;
@@ -13,15 +14,15 @@ interface RenderBlockOptions {
13
14
  context: ContentPageContext;
14
15
  }
15
16
 
16
- const defaultChildRenderer = (_: VNode) => _;
17
+ export interface RenderBlockProps {
18
+ block?: BlockDef;
19
+ options: RenderBlockOptions;
20
+ ancestors?: BlockAncestors; // Recursion context
21
+ }
17
22
 
18
- export function renderBlock(
19
- block: BlockDef,
20
- options: RenderBlockOptions,
21
- ancestors: BlockAncestors = DEFAULT_ANCESTORS, // Recursion context
22
- ) {
23
- const { key, page, blockDecorator, blocksRegistry, context } = options;
24
- const { type, blocks: childBlocks } = block;
23
+ export function renderBlock({ block = {}, options, ancestors = [] }: RenderBlockProps) {
24
+ const { key, page, blockDecorator, blocksRegistry = {}, context } = options;
25
+ const { type, slots, blocks: childBlocks } = block;
25
26
 
26
27
  if (!(type && type in blocksRegistry)) {
27
28
  console.warn(`No block with "${type}" is registered`);
@@ -29,13 +30,9 @@ export function renderBlock(
29
30
 
30
31
  const BlockComponent = type && blocksRegistry[type];
31
32
 
32
- const { renderChild = defaultChildRenderer } = BlockComponent || {};
33
- const renderChildBlock = (_: BlockDef, j: number) =>
34
- renderChild(
35
- renderBlock(_, { ...options, key: `${options.key}-${j}` }, [...ancestors, block]),
36
- j,
37
- );
38
- const children = childBlocks?.length ? childBlocks.map(renderChildBlock) : null;
33
+ const subBlockRenderProps = { parent: block, options, ancestors };
34
+ const children = renderBlocksList({ ...subBlockRenderProps, blocks: childBlocks });
35
+ const blockSlots = slots ? renderSlots({ ...subBlockRenderProps, slots }) : {};
39
36
 
40
37
  return blockDecorator(
41
38
  {
@@ -56,6 +53,7 @@ export function renderBlock(
56
53
  version={version}
57
54
  anchor={anchor}
58
55
  labels={labels}
56
+ slots={blockSlots}
59
57
  {...content}
60
58
  >
61
59
  {children}
@@ -0,0 +1,39 @@
1
+ import type { SlotName } from '../../model/BlockDecorator';
2
+ import { BlockAncestors, DEFAULT_SLOT_NAME } from '../../model/BlockDecorator';
3
+ import type { BlockDef, Slot } from '../../model/ContentPageDef';
4
+ import type { VNode } from '../../model/VNode';
5
+ import { renderBlock, RenderBlockOptions } from './renderBlock';
6
+
7
+ interface RenderBlockListProps {
8
+ blocks?: BlockDef[];
9
+ parent: Slot;
10
+ slotName?: SlotName;
11
+ options: RenderBlockOptions;
12
+ ancestors?: BlockAncestors; // Recursion context
13
+ }
14
+
15
+ const defaultChildRenderer = (_: VNode) => _;
16
+
17
+ export function renderBlocksList({
18
+ blocks = [],
19
+ parent,
20
+ slotName = DEFAULT_SLOT_NAME,
21
+ options,
22
+ ancestors = [],
23
+ }: RenderBlockListProps): Record<string, VNode> {
24
+ const { blocksRegistry = {} } = options;
25
+ const { type } = parent as BlockDef;
26
+ const BlockComponent = type && blocksRegistry[type];
27
+ const { renderChild = defaultChildRenderer } = BlockComponent || {};
28
+
29
+ return blocks.map((_: BlockDef, j: number) =>
30
+ renderChild(
31
+ renderBlock({
32
+ block: _,
33
+ options: { ...options, key: `${options.key ? options.key : _.type}-${j}` },
34
+ ancestors: [...ancestors, [parent, slotName]],
35
+ }),
36
+ j,
37
+ ),
38
+ );
39
+ }
@@ -0,0 +1,33 @@
1
+ import { BlockAncestors } from '../../model/BlockDecorator';
2
+ import type { BlockDef, Slot } from '../../model/ContentPageDef';
3
+ import type { VNode } from '../../model/VNode';
4
+ import type { RenderBlockOptions } from './renderBlock';
5
+ import { renderBlocksList } from './renderBlockList';
6
+
7
+ interface RenderSlotsProps {
8
+ slots?: Record<string, BlockDef[]>;
9
+ parent: Slot;
10
+ options: RenderBlockOptions;
11
+ ancestors?: BlockAncestors;
12
+ }
13
+
14
+ export function renderSlots({
15
+ slots = {},
16
+ parent,
17
+ options,
18
+ ancestors = [],
19
+ }: RenderSlotsProps): Record<string, VNode> {
20
+ return Object.entries(slots).reduce(
21
+ (res, [slotName, slotBlocks]) => ({
22
+ ...res,
23
+ [slotName]: renderBlocksList({
24
+ blocks: slotBlocks,
25
+ parent,
26
+ slotName,
27
+ options,
28
+ ancestors,
29
+ }),
30
+ }),
31
+ {},
32
+ );
33
+ }
@@ -1,10 +1,10 @@
1
- import type { BlockDef, Slot, SlotsMap } from './ContentPageDef';
1
+ import type { BlockDef, Slot } from './ContentPageDef';
2
2
 
3
3
  export const DEFAULT_SLOT_NAME = null;
4
4
 
5
- export type BlockAncestors = [keyof SlotsMap | typeof DEFAULT_SLOT_NAME, ...Slot[]];
6
-
7
- export const DEFAULT_ANCESTORS: BlockAncestors = [DEFAULT_SLOT_NAME];
5
+ export type SlotName = string | typeof DEFAULT_SLOT_NAME;
6
+ export type BlockAncestorItem = [Slot, SlotName];
7
+ export type BlockAncestors = BlockAncestorItem[];
8
8
 
9
9
  interface BlockDecoratorProps<VNode> {
10
10
  blockClassName: string;
@@ -1,3 +1,3 @@
1
1
  import type { JSXBlock } from './JSXBlock';
2
2
 
3
- export type BlocksRegistry<BlockProps = Record<string, any>> = Record<string, JSXBlock<BlockProps>>;
3
+ export type BlocksRegistry = Record<string, JSXBlock<any>>;
@@ -22,10 +22,7 @@ export interface BlockDef extends BaseBlockDef {
22
22
  export interface Slot {
23
23
  style?: string[];
24
24
  blocks?: BlockDef[];
25
- }
26
-
27
- export interface SlotsMap {
28
- header?: Slot;
25
+ slots?: Record<string, BlockDef[]>;
29
26
  }
30
27
 
31
28
  export interface ContentPageMeta {
@@ -44,7 +41,6 @@ export interface ContentPageMeta {
44
41
 
45
42
  export interface ContentPageDef extends ContentPageMeta, Slot {
46
43
  _customPageType?: string;
47
- slots?: SlotsMap;
48
44
  fallback?: Record<string, unknown>;
49
45
  likeControl?: boolean;
50
46
  colorPalette?: ColorPalette;