@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
@@ -1 +1 @@
1
- {"version":3,"file":"renderBlock.js","sourceRoot":"","sources":["../../../src/components/ContentPage/renderBlock.tsx"],"names":[],"mappings":";;;AAAA,+DAA+F;AAI/F,iEAA8D;AAW9D,MAAM,oBAAoB,GAAG,CAAC,CAAQ,EA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KAAK,CAAC,CAAC,CAAC,IAAA,yBAAW,EAAC,EAAE,GAAG,mBAAmB,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAE/E,OAAO,cAAc,CACnB;QACE,cAAc,EAAE,gBAAgB,IAAA,iCAAe,EAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QAC9D,KAAK;QACL,SAAS;QACT,iDAAiD;QACjD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,sBAAsB,EAAE,EAAE,EAAE;YAC3E,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,aAAa,CAAC;YAE3D,OAAO,cAAc,CAAC,CAAC,CAAC,CACtB,uBAAC,cAAc,IAEb,SAAS,EAAE,sBAAsB,EACjC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,KACb,OAAO,YAEV,QAAQ,IAXJ,GAAG,CAYO,CAClB,CAAC,CAAC,CAAC,IAAI,CAAC;QACX,CAAC;KACF,EACD,GAAG,CACJ,CAAC;AACJ,CAAC;AA3CD,kCA2CC"}
@@ -0,0 +1,14 @@
1
+ import type { SlotName } from '../../model/BlockDecorator';
2
+ import { BlockAncestors } from '../../model/BlockDecorator';
3
+ import type { BlockDef, Slot } from '../../model/ContentPageDef';
4
+ import type { VNode } from '../../model/VNode';
5
+ import { RenderBlockOptions } from './renderBlock';
6
+ interface RenderBlockListProps {
7
+ blocks?: BlockDef[];
8
+ parent: Slot;
9
+ slotName?: SlotName;
10
+ options: RenderBlockOptions;
11
+ ancestors?: BlockAncestors;
12
+ }
13
+ export declare function renderBlocksList({ blocks, parent, slotName, options, ancestors, }: RenderBlockListProps): Record<string, VNode>;
14
+ export {};
@@ -0,0 +1,18 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.renderBlocksList = void 0;
3
+ const BlockDecorator_1 = require("../../model/BlockDecorator");
4
+ const renderBlock_1 = require("./renderBlock");
5
+ const defaultChildRenderer = (_) => _;
6
+ function renderBlocksList({ blocks = [], parent, slotName = BlockDecorator_1.DEFAULT_SLOT_NAME, options, ancestors = [], }) {
7
+ const { blocksRegistry = {} } = options;
8
+ const { type } = parent;
9
+ const BlockComponent = type && blocksRegistry[type];
10
+ const { renderChild = defaultChildRenderer } = BlockComponent || {};
11
+ return blocks.map((_, j) => renderChild((0, renderBlock_1.renderBlock)({
12
+ block: _,
13
+ options: { ...options, key: `${options.key ? options.key : _.type}-${j}` },
14
+ ancestors: [...ancestors, [parent, slotName]],
15
+ }), j));
16
+ }
17
+ exports.renderBlocksList = renderBlocksList;
18
+ //# sourceMappingURL=renderBlockList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderBlockList.js","sourceRoot":"","sources":["../../../src/components/ContentPage/renderBlockList.tsx"],"names":[],"mappings":";;AACA,+DAA+E;AAG/E,+CAAgE;AAUhE,MAAM,oBAAoB,GAAG,CAAC,CAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAE7C,SAAgB,gBAAgB,CAAC,EAC/B,MAAM,GAAG,EAAE,EACX,MAAM,EACN,QAAQ,GAAG,kCAAiB,EAC5B,OAAO,EACP,SAAS,GAAG,EAAE,GACO;IACrB,MAAM,EAAE,cAAc,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;IACxC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAkB,CAAC;IACpC,MAAM,cAAc,GAAG,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IACpD,MAAM,EAAE,WAAW,GAAG,oBAAoB,EAAE,GAAG,cAAc,IAAI,EAAE,CAAC;IAEpE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAW,EAAE,CAAS,EAAE,EAAE,CAC3C,WAAW,CACT,IAAA,yBAAW,EAAC;QACV,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE;QAC1E,SAAS,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KAC9C,CAAC,EACF,CAAC,CACF,CACF,CAAC;AACJ,CAAC;AAtBD,4CAsBC"}
@@ -0,0 +1,12 @@
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
+ interface RenderSlotsProps {
6
+ slots?: Record<string, BlockDef[]>;
7
+ parent: Slot;
8
+ options: RenderBlockOptions;
9
+ ancestors?: BlockAncestors;
10
+ }
11
+ export declare function renderSlots({ slots, parent, options, ancestors, }: RenderSlotsProps): Record<string, VNode>;
12
+ export {};
@@ -0,0 +1,17 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.renderSlots = void 0;
3
+ const renderBlockList_1 = require("./renderBlockList");
4
+ function renderSlots({ slots = {}, parent, options, ancestors = [], }) {
5
+ return Object.entries(slots).reduce((res, [slotName, slotBlocks]) => ({
6
+ ...res,
7
+ [slotName]: (0, renderBlockList_1.renderBlocksList)({
8
+ blocks: slotBlocks,
9
+ parent,
10
+ slotName,
11
+ options,
12
+ ancestors,
13
+ }),
14
+ }), {});
15
+ }
16
+ exports.renderSlots = renderSlots;
17
+ //# sourceMappingURL=renderSlots.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderSlots.js","sourceRoot":"","sources":["../../../src/components/ContentPage/renderSlots.tsx"],"names":[],"mappings":";;AAIA,uDAAqD;AASrD,SAAgB,WAAW,CAAC,EAC1B,KAAK,GAAG,EAAE,EACV,MAAM,EACN,OAAO,EACP,SAAS,GAAG,EAAE,GACG;IACjB,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CACjC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC;QAChC,GAAG,GAAG;QACN,CAAC,QAAQ,CAAC,EAAE,IAAA,kCAAgB,EAAC;YAC3B,MAAM,EAAE,UAAU;YAClB,MAAM;YACN,QAAQ;YACR,OAAO;YACP,SAAS;SACV,CAAC;KACH,CAAC,EACF,EAAE,CACH,CAAC;AACJ,CAAC;AAnBD,kCAmBC"}
@@ -1,7 +1,8 @@
1
- import type { BlockDef, Slot, SlotsMap } from './ContentPageDef';
1
+ import type { BlockDef, Slot } from './ContentPageDef';
2
2
  export declare const DEFAULT_SLOT_NAME: null;
3
- export declare type BlockAncestors = [keyof SlotsMap | typeof DEFAULT_SLOT_NAME, ...Slot[]];
4
- export declare const DEFAULT_ANCESTORS: BlockAncestors;
3
+ export declare type SlotName = string | typeof DEFAULT_SLOT_NAME;
4
+ export declare type BlockAncestorItem = [Slot, SlotName];
5
+ export declare type BlockAncestors = BlockAncestorItem[];
5
6
  interface BlockDecoratorProps<VNode> {
6
7
  blockClassName: string;
7
8
  block: BlockDef;
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.DEFAULT_ANCESTORS = exports.DEFAULT_SLOT_NAME = void 0;
2
+ exports.DEFAULT_SLOT_NAME = void 0;
3
3
  exports.DEFAULT_SLOT_NAME = null;
4
- exports.DEFAULT_ANCESTORS = [exports.DEFAULT_SLOT_NAME];
5
4
  //# sourceMappingURL=BlockDecorator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlockDecorator.js","sourceRoot":"","sources":["../../src/model/BlockDecorator.ts"],"names":[],"mappings":";;AAEa,QAAA,iBAAiB,GAAG,IAAI,CAAC;AAIzB,QAAA,iBAAiB,GAAmB,CAAC,yBAAiB,CAAC,CAAC"}
1
+ {"version":3,"file":"BlockDecorator.js","sourceRoot":"","sources":["../../src/model/BlockDecorator.ts"],"names":[],"mappings":";;AAEa,QAAA,iBAAiB,GAAG,IAAI,CAAC"}
@@ -1,2 +1,2 @@
1
1
  import type { JSXBlock } from './JSXBlock';
2
- export declare type BlocksRegistry<BlockProps = Record<string, any>> = Record<string, JSXBlock<BlockProps>>;
2
+ export declare type BlocksRegistry = Record<string, JSXBlock<any>>;
@@ -18,9 +18,7 @@ export interface BlockDef extends BaseBlockDef {
18
18
  export interface Slot {
19
19
  style?: string[];
20
20
  blocks?: BlockDef[];
21
- }
22
- export interface SlotsMap {
23
- header?: Slot;
21
+ slots?: Record<string, BlockDef[]>;
24
22
  }
25
23
  export interface ContentPageMeta {
26
24
  title?: string;
@@ -37,7 +35,6 @@ export interface ContentPageMeta {
37
35
  }
38
36
  export interface ContentPageDef extends ContentPageMeta, Slot {
39
37
  _customPageType?: string;
40
- slots?: SlotsMap;
41
38
  fallback?: Record<string, unknown>;
42
39
  likeControl?: boolean;
43
40
  colorPalette?: ColorPalette;
@@ -1,6 +1,6 @@
1
1
  import type { UNIComponent } from '@redneckz/uni-jsx';
2
2
  import type { ContentPageContext } from '../components/ContentPage/ContentPageContext';
3
- import type { BlockAncestors } from './BlockDecorator';
3
+ import type { BlockAncestors, SlotName } from './BlockDecorator';
4
4
  import type { ContentPageDef } from './ContentPageDef';
5
5
  import type { VNode } from './VNode';
6
6
  export interface UniBlockProps {
@@ -10,8 +10,10 @@ export interface UniBlockProps {
10
10
  ancestors?: BlockAncestors;
11
11
  labels?: string[];
12
12
  anchor?: string;
13
+ slots?: Record<string, VNode>;
13
14
  }
14
15
  export declare type JSXBlock<BlockProps = Record<string, any>> = UNIComponent<BlockProps & UniBlockProps, any, VNode | VNode[]> & {
15
16
  childrenTypes?: string[];
17
+ slots?: (props: BlockProps) => SlotName[];
16
18
  renderChild?: (child: VNode, i: number) => VNode;
17
19
  };
@@ -1,8 +1,11 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
2
  exports.getParentBlockDef = void 0;
3
3
  function getParentBlockDef(ancestors, type) {
4
- const [, ...blocks] = ancestors || [];
5
- return blocks.reverse().find((_) => !type || type === _?.type) || {};
4
+ const [block] = (ancestors || [])
5
+ .map((item) => item)
6
+ .reverse()
7
+ .find(([_]) => _ && 'type' in _ && (!type || type === _.type)) || [];
8
+ return block || {};
6
9
  }
7
10
  exports.getParentBlockDef = getParentBlockDef;
8
11
  //# sourceMappingURL=getParentBlockDef.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getParentBlockDef.js","sourceRoot":"","sources":["../../src/model/getParentBlockDef.ts"],"names":[],"mappings":";;AAGA,SAAgB,iBAAiB,CAAC,SAAqC,EAAE,IAAa;IACpF,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,SAAS,IAAI,EAAE,CAAC;IAEtC,OAAO,MAAM,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,KAAM,CAAc,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;AACrF,CAAC;AAJD,8CAIC"}
1
+ {"version":3,"file":"getParentBlockDef.js","sourceRoot":"","sources":["../../src/model/getParentBlockDef.ts"],"names":[],"mappings":";;AAGA,SAAgB,iBAAiB,CAAC,SAAqC,EAAE,IAAa;IACpF,MAAM,CAAC,KAAK,CAAC,GACX,CAAC,SAAS,IAAI,EAAE,CAAC;SACd,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;SACnB,OAAO,EAAE;SACT,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,KAAM,CAAc,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IAEvF,OAAO,KAAK,IAAI,EAAE,CAAC;AACrB,CAAC;AARD,8CAQC"}
@@ -1,41 +1,2 @@
1
- export declare const Blocks: {
2
- Accordion: import("../model/JSXBlock").JSXBlock<import("./Accordion/Accordion").AccordionProps>;
3
- AccordionItem: import("../model/JSXBlock").JSXBlock<import("./AccordionItem/AccordionItemProps").AccordionItemProps>;
4
- BenefitsBlock: import("@redneckz/uni-jsx").UNIComponent<import("./BenefitsBlock/BenefitsBlock").BenefitsBlockProps, any, any>;
5
- Bonus: import("@redneckz/uni-jsx").UNIComponent<import("./Bonus/Bonus").BonusProps, any, any>;
6
- CardTransfer: import("@redneckz/uni-jsx").UNIComponent<import("./CardTransfer/CardTransfer").CardTransferProps, any, any>;
7
- ComparisonTable: import("@redneckz/uni-jsx").UNIComponent<import("./ComparisonTable/ComparisonTable").ComparisonTableProps, any, any>;
8
- Calculator: import("@redneckz/uni-jsx").UNIComponent<import("./Calculator/Calculator").CalculatorProps, any, any>;
9
- Catalog: import("@redneckz/uni-jsx").UNIComponent<import("./Catalog/Catalog").CatalogProps, any, any>;
10
- ContactsBlock: import("@redneckz/uni-jsx").UNIComponent<import("./ContactsBlock/ContactsBlock").ContactsBlockProps, any, any>;
11
- ExchangeRateTile: import("@redneckz/uni-jsx").UNIComponent<import("./ExchangeRateTile/ExchangeRateTile").ExchangeRateTileProps, any, any>;
12
- Footer: import("@redneckz/uni-jsx").UNIComponent<import("./Footer/Footer").FooterProps, any, any>;
13
- Gallery: import("@redneckz/uni-jsx").UNIComponent<import("./Gallery/GalleryProps").GalleryProps, any, any>;
14
- GracePeriod: import("@redneckz/uni-jsx").UNIComponent<import("./GracePeriod/GracePeriod").GracePeriodProps, any, any>;
15
- Header: import("@redneckz/uni-jsx").UNIComponent<import("./Header/Header").HeaderProps, any, any>;
16
- Headline: import("@redneckz/uni-jsx").UNIComponent<import("./Headline/Headline").HeadlineProps, any, any>;
17
- InsuranceAmountBlock: import("@redneckz/uni-jsx").UNIComponent<import("./InsuranceAmountBlock/InsuranceAmountBlock").InsuranceAmountBlockProps, any, any>;
18
- InvestmentInfo: import("@redneckz/uni-jsx").UNIComponent<import("./InvestmentInfo/InvestmentInfo").InvestmentInfoProps, any, any>;
19
- LinkDocs: import("@redneckz/uni-jsx").UNIComponent<import("./LinkDocs/LinkDocs").LinkDocsProps, any, any>;
20
- MiniGallery: import("@redneckz/uni-jsx").UNIComponent<import("./MiniGallery/MiniGallery").MiniGalleryProps, any, any>;
21
- MobileAppTile: import("@redneckz/uni-jsx").UNIComponent<import("./MobileAppTile/MobileAppTile").MobileAppTileProps, any, any>;
22
- PictureText: import("@redneckz/uni-jsx").UNIComponent<import("./PictureText/PictureText").PictureTextProps, any, any>;
23
- ProductBlock: import("@redneckz/uni-jsx").UNIComponent<import("./ProductBlock/ProductBlock").ProductBlockProps, any, any>;
24
- ProductGallery: import("@redneckz/uni-jsx").UNIComponent<import("./ProductGallery/ProductGallery").ProductGalleryProps, any, any>;
25
- ProductTile: import("@redneckz/uni-jsx").UNIComponent<import("./ProductTile/ProductTile").ProductTileProps, any, any>;
26
- PromoTile: import("@redneckz/uni-jsx").UNIComponent<import("./PromoTile/PromoTile").PromoTileProps, any, any>;
27
- OfficeMap: import("@redneckz/uni-jsx").UNIComponent<import("../model/JSXBlock").UniBlockProps, any, any>;
28
- OfficeServicesBlock: import("@redneckz/uni-jsx").UNIComponent<import("./OfficeServicesBlock/OfficeServicesBlock").OfficeServicesBlockProps, any, any>;
29
- OtherProducts: import("../model/JSXBlock").JSXBlock<import("./OtherProducts/OtherProducts").OtherProductsProps>;
30
- OtherProductsItem: import("../model/JSXBlock").JSXBlock<import("./OtherProductsItem/OtherProductsItem").OtherProductsItemProps>;
31
- Recommendation: import("@redneckz/uni-jsx").UNIComponent<import("./Recommendation/Recommendation").RecommendationProps, any, any>;
32
- StepsBlock: import("@redneckz/uni-jsx").UNIComponent<import("./StepsBlock/StepsBlock").StepsBlockProps, any, any>;
33
- TariffsTable: import("@redneckz/uni-jsx").UNIComponent<import("./TariffsTable/TariffsTable").TariffsTableProps, any, any>;
34
- TextBlock: import("@redneckz/uni-jsx").UNIComponent<import("./TextBlock/TextBlock").TextBlockProps, any, any>;
35
- Tile: import("@redneckz/uni-jsx").UNIComponent<import("./Tile/Tile").TileProps, any, any>;
36
- Placeholder: import("@redneckz/uni-jsx").UNIComponent<import("./Placeholder/Placeholder").PlaceholderProps, any, any>;
37
- BonusBenefitsBlock: import("@redneckz/uni-jsx").UNIComponent<import("./BonusBenefitsBlock/BonusBenefitsBlock").BenefitsBlockProps, any, any>;
38
- SafeDepositRental: import("@redneckz/uni-jsx").UNIComponent<import("./SafeDepositRental/SafeDepositRental").SafeDepositRentalProps, any, any>;
39
- Tabs: import("@redneckz/uni-jsx").UNIComponent<import("./Tabs/Tabs").TabsBlockProps, any, any>;
40
- ErrorBlock: import("@redneckz/uni-jsx").UNIComponent<import("./ErrorBlock/ErrorBlock").ErrorBlockProps, any, any>;
41
- };
1
+ import type { BlocksRegistry } from '../model/BlocksRegistry';
2
+ export declare const Blocks: BlocksRegistry;
@@ -1 +1 @@
1
- {"version":3,"file":"Blocks.js","sourceRoot":"","sources":["../../src/components/Blocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B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AM,uBAAuB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,MAAM,CAAC,MAAM,MAAM,GAAmB;IACpC,SAAS;IACT,aAAa;IACb,aAAa;IACb,KAAK;IACL,YAAY;IACZ,eAAe;IACf,UAAU;IACV,OAAO;IACP,aAAa;IACb,gBAAgB;IAChB,MAAM;IACN,OAAO;IACP,WAAW;IACX,MAAM;IACN,QAAQ;IACR,oBAAoB;IACpB,cAAc;IACd,QAAQ;IACR,WAAW;IACX,aAAa;IACb,WAAW;IACX,YAAY;IACZ,cAAc;IACd,WAAW;IACX,SAAS;IACT,SAAS;IACT,mBAAmB;IACnB,aAAa;IACb,iBAAiB;IACjB,cAAc;IACd,UAAU;IACV,YAAY;IACZ,SAAS;IACT,IAAI;IACJ,WAAW;IACX,kBAAkB;IAClB,iBAAiB;IACjB,IAAI;IACJ,UAAU;CACX,CAAC"}
@@ -1,18 +1,2 @@
1
- export declare const Blocks: {
2
- Accordion: import("../model/JSXBlock").JSXBlock<import("./Accordion/Accordion").AccordionProps>;
3
- AccordionItem: import("../model/JSXBlock").JSXBlock<import("./AccordionItem/AccordionItemProps").AccordionItemProps>;
4
- ComparisonTable: import("@redneckz/uni-jsx").UNIComponent<import("./ComparisonTable/ComparisonTable").ComparisonTableProps, any, any>;
5
- Footer: import("@redneckz/uni-jsx").UNIComponent<import("./Footer/Footer").FooterProps, any, any>;
6
- Gallery: import("@redneckz/uni-jsx").UNIComponent<import("./Gallery/GalleryProps").GalleryProps, any, any>;
7
- Header: import("@redneckz/uni-jsx").UNIComponent<import("./Header/Header").HeaderProps, any, any>;
8
- Headline: import("@redneckz/uni-jsx").UNIComponent<import("./Headline/Headline").HeadlineProps, any, any>;
9
- LinkDocs: import("@redneckz/uni-jsx").UNIComponent<import("./LinkDocs/LinkDocs").LinkDocsProps, any, any>;
10
- LinkList: import("@redneckz/uni-jsx").UNIComponent<import("./LinkList/LinkList").LinkListProps, any, any>;
11
- MobileAppTile: import("@redneckz/uni-jsx").UNIComponent<import("./MobileAppTile/MobileAppTile").MobileAppTileProps, any, any>;
12
- ProductBlock: import("@redneckz/uni-jsx").UNIComponent<import("./ProductBlock/ProductBlock").ProductBlockProps, any, any>;
13
- ProductGallery: import("@redneckz/uni-jsx").UNIComponent<import("./ProductGallery/ProductGallery").ProductGalleryProps, any, any>;
14
- StepsBlock: import("@redneckz/uni-jsx").UNIComponent<import("./StepsBlock/StepsBlock").StepsBlockProps, any, any>;
15
- TariffsTable: import("@redneckz/uni-jsx").UNIComponent<import("./TariffsTable/TariffsTable").TariffsTableProps, any, any>;
16
- TextBlock: import("@redneckz/uni-jsx").UNIComponent<import("./TextBlock/TextBlock").TextBlockProps, any, any>;
17
- Placeholder: import("@redneckz/uni-jsx").UNIComponent<import("./Placeholder/Placeholder").PlaceholderProps, any, any>;
18
- };
1
+ import type { BlocksRegistry } from '../model/BlocksRegistry';
2
+ export declare const Blocks: BlocksRegistry;
@@ -1 +1 @@
1
- {"version":3,"file":"Blocks.mobile.js","sourceRoot":"","sources":["../../src/components/Blocks.mobile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,M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AE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,CAAC,MAAM,MAAM,GAAmB;IACpC,SAAS;IACT,aAAa;IACb,eAAe;IACf,MAAM;IACN,OAAO;IACP,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,cAAc;IACd,UAAU;IACV,YAAY;IACZ,SAAS;IACT,WAAW;CACZ,CAAC"}
@@ -1,11 +1,11 @@
1
1
  import type { BlockDecorator } from '../../model/BlockDecorator';
2
2
  import type { BlocksRegistry } from '../../model/BlocksRegistry';
3
3
  import type { ContentPageDef } from '../../model/ContentPageDef';
4
- import type { UniBlockProps } from '../../model/JSXBlock';
4
+ import type { JSXBlock, UniBlockProps } from '../../model/JSXBlock';
5
5
  interface ContentPageProps extends UniBlockProps {
6
6
  blocksRegistry: BlocksRegistry;
7
7
  data?: ContentPageDef;
8
8
  blockDecorator?: BlockDecorator;
9
9
  }
10
- export declare const ContentPage: import("@redneckz/uni-jsx").UNIComponent<ContentPageProps, any, any>;
10
+ export declare const ContentPage: JSXBlock<ContentPageProps>;
11
11
  export {};
@@ -2,23 +2,24 @@ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
2
  import { JSX } from '@redneckz/uni-jsx';
3
3
  import { style2className } from '../../utils/style2className.js';
4
4
  import { LikeControl } from '../LikeControl/LikeControl.js';
5
- import { renderBlock } from './renderBlock.js';
5
+ import { renderBlocksList } from './renderBlockList.js';
6
+ import { renderSlots } from './renderSlots.js';
6
7
  const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
7
8
  export const ContentPage = JSX((props) => {
8
- const { className = '', context, data = {} } = props;
9
+ const { className = '', blocksRegistry, blockDecorator, context, data = {} } = props;
9
10
  const { style: pageStyle, blocks, slots, likeControl, colorPalette = 'pc' } = data;
10
- const blocksListRenderer = renderBlocksList(props);
11
- return (_jsxs("section", { className: `relative ${style2className(pageStyle)} ${className}`, "data-theme": colorPalette, children: [slots?.header?.blocks?.length ? (_jsx("div", { className: `${style2className(slots.header.style)}`, children: blocksListRenderer(slots.header.blocks, ['header']) })) : null, blocks?.length ? (_jsx("div", { className: "container grid grid-cols-12 gap-1", children: blocksListRenderer(blocks) })) : null, likeControl ? renderLikeControl(context) : null] }));
12
- });
13
- function renderBlocksList({ blocksRegistry, data, blockDecorator, context }) {
14
- return (blocks, ancestors) => blocks.map((block, i) => renderBlock(block, {
15
- key: `${block.type || '#'}-${i}`,
11
+ const options = {
12
+ key: '',
16
13
  blocksRegistry,
17
- page: data || {},
14
+ page: data,
18
15
  blockDecorator: blockDecorator || defaultBlockDecorator,
19
16
  context,
20
- }, ancestors));
21
- }
17
+ };
18
+ const pageSlots = renderSlots({ slots, parent: data, options });
19
+ return (_jsxs("section", { className: `relative ${style2className(pageStyle)} ${className}`, "data-theme": colorPalette, children: [pageSlots?.header ? (_jsx("div", { className: "mb-5 shadow-[0_8px_32px_0px_#00000014]", children: pageSlots.header })) : null, blocks?.length ? (_jsxs("div", { className: "container grid grid-cols-12 gap-1", children: [renderBlocksList({ blocks, parent: data, options }), pageSlots?.footer ? pageSlots.footer : null] })) : null, likeControl ? renderLikeControl(context) : null] }));
20
+ });
21
+ ContentPage.childrenTypes = [];
22
+ ContentPage.slots = () => ['header', 'footer'];
22
23
  function renderLikeControl(context) {
23
24
  return (_jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: _jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto", context: context }, "LikeControl") }));
24
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ContentPage.js","sourceRoot":"","sources":["../../../src/components/ContentPage/ContentPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAKxC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQ5C,MAAM,qBAAqB,GAAmB,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAClF,MAAM,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC;AAEpC,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAmB,CAAC,KAAK,EAAE,EAAE;IACzD,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,KAAK,CAAC;IAErD,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IAEnF,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAEnD,OAAO,CACL,mBACE,SAAS,EAAE,YAAY,eAAe,CAAC,SAAS,CAAC,IAAI,SAAS,EAAE,gBACpD,YAAY,aAEvB,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAC/B,cAAK,SAAS,EAAE,GAAG,eAAe,CAAC,KAAK,CAAC,MAAM,CAA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AO,EAAE,CAAC,EACnD,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IACxC,CACP,CAAC,CAAC,CAAC,IAAI,EAEP,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,IACxC,CACX,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,aAAa,GAAG,EAAE,CAAC;AAC/B,WAAW,CAAC,KAAK,GAAG,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAE/C,SAAS,iBAAiB,CAAC,OAA2B;IACpD,OAAO,CACL,cAAK,SAAS,EAAC,qEAAqE,YAClF,KAAC,WAAW,IAEV,SAAS,EAAC,mDAAmD,EAC7D,OAAO,EAAE,OAAO,IAFZ,aAAa,CAGjB,GACE,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { BlockDef, Slot } from '../../model/ContentPageDef';
2
+ export declare const mapSlot: (mapper: (blocks?: BlockDef[]) => BlockDef[]) => <S extends Slot>(slot: S) => S;
@@ -0,0 +1,11 @@
1
+ export const mapSlot = (mapper) => (slot) => ({
2
+ ...slot,
3
+ blocks: mapper(slot.blocks),
4
+ slots: slot.slots
5
+ ? Object.entries(slot.slots).reduce((res, [slotKey, slotBlocks]) => ({
6
+ ...res,
7
+ [slotKey]: mapper(slotBlocks),
8
+ }), {})
9
+ : {},
10
+ });
11
+ //# sourceMappingURL=mapSlot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapSlot.js","sourceRoot":"","sources":["../../../src/components/ContentPage/mapSlot.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAClB,CAAC,MAA2C,EAAE,EAAE,CAChD,CAAiB,IAAO,EAAK,EAAE,CAAC,CAAC;IAC/B,GAAG,IAAI;IACP,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;IAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;QACf,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAC/B,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC;YAC/B,GAAG,GAAG;YACN,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;SAC9B,CAAC,EACF,EAAE,CACH;QACH,CAAC,CAAC,EAAE;CACP,CAAC,CAAC"}
@@ -1,11 +1,3 @@
1
- import { BlockDef } from '../../model/ContentPageDef';
2
- export declare function normalizeBlock(block: BlockDef): {
3
- type?: string | undefined;
4
- content?: Record<string, any> | undefined;
5
- version?: import("../../model/BlockVersion").BlockVersion | undefined;
6
- hidden?: boolean | undefined;
7
- anchor?: string | undefined;
8
- labels?: string[] | undefined;
9
- style?: string[] | undefined;
10
- blocks?: BlockDef[] | undefined;
11
- };
1
+ import type { BlocksRegistry } from '../../model/BlocksRegistry';
2
+ import type { Slot } from '../../model/ContentPageDef';
3
+ export declare function normalizeBlock<S extends Slot>(block?: S, blocksRegistry?: BlocksRegistry): S;
@@ -1,6 +1,16 @@
1
- export function normalizeBlock(block) {
1
+ import { mapSlot } from './mapSlot.js';
2
+ export function normalizeBlock(block, blocksRegistry) {
2
3
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3
- const { mobile, ...rest } = block;
4
- return rest;
4
+ const { mobile, ...rest } = (block || {});
5
+ return {
6
+ ...mapSlot((blocks) => filterBlocks(blocks, blocksRegistry))({ ...rest }),
7
+ };
5
8
  }
9
+ const filterBlocks = (blocks, blocksRegistry) => blocks
10
+ ? blocks
11
+ .filter((block) => blocksRegistry && (block?.type || '') in blocksRegistry)
12
+ .map((block) => ({
13
+ ...normalizeBlock(block, blocksRegistry),
14
+ }))
15
+ : [];
6
16
  //# sourceMappingURL=normalizeBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalizeBlock.js","sourceRoot":"","sources":["../../../src/components/ContentPage/normalizeBlock.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,cAAc,CAAC,KAAe;IAC5C,6DAA6D;IAC7D,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAElC,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"normalizeBlock.js","sourceRoot":"","sources":["../../../src/components/ContentPage/normalizeBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,UAAU,cAAc,CAAiB,KAAS,EAAE,cAA+B;IACvF,6DAA6D;IAC7D,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,KAAK,IAAI,EAAE,CAAa,CAAC;IAEtD,OAAO;QACL,GAAG,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC;KACrE,CAAC;AACT,CAAC;AAED,MAAM,YAAY,GAAG,CAAC,MAAmB,EAAE,cAA+B,EAAE,EAAE,CAC5E,MAAM;IACJ,CAAC,CAAC,MAAM;SACH,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,IAAI,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,IAAI,cAAc,CAAC;SAC1E,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACf,GAAG,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC;KACzC,CAAC,CAAC;IACP,CAAC,CAAC,EAAE,CAAC"}
@@ -1,2 +1,3 @@
1
- import { BlockDef } from '../../model/ContentPageDef';
2
- export declare function normalizeBlock(block: BlockDef): BlockDef;
1
+ import type { BlocksRegistry } from '../../model/BlocksRegistry';
2
+ import type { Slot } from '../../model/ContentPageDef';
3
+ export declare function normalizeBlock<S extends Slot>(block?: S, blocksRegistry?: BlocksRegistry): S;
@@ -1,5 +1,20 @@
1
- export function normalizeBlock(block) {
2
- const { mobile, ...rest } = block;
3
- return mobile ? { ...rest, ...mobile, content: { ...rest.content, ...mobile.content } } : block;
1
+ import { mapSlot } from './mapSlot.js';
2
+ export function normalizeBlock(block, blocksRegistry) {
3
+ const { mobile, ...rest } = (block || {});
4
+ const normalizedBlock = mobile
5
+ ? { ...rest, ...mobile, content: { ...rest.content, ...mobile.content } }
6
+ : block;
7
+ return {
8
+ ...mapSlot((blocks) => filterBlocks(blocks, blocksRegistry))(normalizedBlock || {}),
9
+ };
4
10
  }
11
+ const filterBlocks = (blocks, blocksRegistry) => blocks
12
+ ? blocks
13
+ ?.filter((block) => blocksRegistry &&
14
+ (block?.type || block?.mobile?.type || '') in blocksRegistry &&
15
+ !block.mobile?.hidden)
16
+ .map((block) => ({
17
+ ...normalizeBlock(block, blocksRegistry),
18
+ }))
19
+ : [];
5
20
  //# sourceMappingURL=normalizeBlock.mobile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalizeBlock.mobile.js","sourceRoot":"","sources":["../../../src/components/ContentPage/normalizeBlock.mobile.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,cAAc,CAAC,KAAe;IAC5C,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAElC,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AAClG,CAAC"}
1
+ {"version":3,"file":"normalizeBlock.mobile.js","sourceRoot":"","sources":["../../../src/components/ContentPage/normalizeBlock.mobile.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,UAAU,cAAc,CAAiB,KAAS,EAAE,cAA+B;IACvF,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,KAAK,IAAI,EAAE,CAAa,CAAC;IAEtD,MAAM,eAAe,GAAG,MAAM;QAC5B,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,EAAE;QACzE,CAAC,CAAC,KAAK,CAAC;IAEV,OAAO;QACL,GAAG,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,eAAe,IAAI,EAAE,CAAC;KAC/E,CAAC;AACT,CAAC;AAED,MAAM,YAAY,GAAG,CAAC,MAAmB,EAAE,cAA+B,EAAE,EAAE,CAC5E,MAAM;IACJ,CAAC,CAAC,MAAM;QACJ,EAAE,MAAM,CACN,CAAC,KAAK,EAAE,EAAE,CACR,cAAc;QACd,CAAC,KAAK,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC,IAAI,cAAc;QAC5D,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CACxB;SACA,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACf,GAAG,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC;KACzC,CAAC,CAAC;IACP,CAAC,CAAC,EAAE,CAAC"}
@@ -1,20 +1,8 @@
1
- import { filterBlocks } from './filterBlocks.js';
1
+ import { normalizeBlock } from './normalizeBlock.js';
2
2
  export const normalizePage = (blocksRegistry) => (contentPage) => {
3
3
  if (!contentPage) {
4
4
  return undefined;
5
5
  }
6
- const { blocks = [], slots } = contentPage;
7
- return {
8
- ...contentPage,
9
- blocks: filterBlocks(blocks, blocksRegistry),
10
- slots: slots &&
11
- Object.keys(slots).reduce((res, key) => ({
12
- ...res,
13
- [key]: {
14
- ...slots[key],
15
- blocks: filterBlocks(slots[key].blocks || [], blocksRegistry),
16
- },
17
- }), {}),
18
- };
6
+ return normalizeBlock(contentPage, blocksRegistry);
19
7
  };
20
8
  //# sourceMappingURL=normalizePage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalizePage.js","sourceRoot":"","sources":["../../../src/components/ContentPage/normalizePage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,aAAa,GACxB,CAAC,cAA8B,EAAE,EAAE,CACnC,CAAC,WAA8C,EAA8B,EAAE;IAC7E,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,WAAW,CAAC;IAE3C,OAAO;QACL,GAAG,WAAW;QACd,MAAM,EAAE,YAAY,CAAC,MAAM,EAAE,cAAc,CAAC;QAC5C,KAAK,EACH,KAAK;YACL,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CACvB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;gBACb,GAAG,GAAG;gBACN,CAAC,GAAG,CAAC,EAAE;oBACL,GAAG,KAAK,CAAC,GAAG,CAAC;oBACb,MAAM,EAAE,YAAY,CAAE,KAAK,CAAC,GAAG,CAAU,CAAC,MAAM,IAAI,EAAE,EAAE,cAAc,CAAC;iBACxE;aACF,CAAC,EACF,EAAE,CACH;KACJ,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"normalizePage.js","sourceRoot":"","sources":["../../../src/components/ContentPage/normalizePage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,CAAC,MAAM,aAAa,GACxB,CAAC,cAA8B,EAAE,EAAE,CACnC,CAAC,WAA8C,EAA8B,EAAE;IAC7E,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,cAAc,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;AACrD,CAAC,CAAC"}
@@ -2,12 +2,16 @@ import { BlockAncestors, BlockDecorator } from '../../model/BlockDecorator';
2
2
  import type { BlocksRegistry } from '../../model/BlocksRegistry';
3
3
  import type { BlockDef, ContentPageDef } from '../../model/ContentPageDef';
4
4
  import type { ContentPageContext } from './ContentPageContext';
5
- interface RenderBlockOptions {
5
+ export interface RenderBlockOptions {
6
6
  key: string;
7
7
  page: ContentPageDef;
8
8
  blockDecorator: BlockDecorator;
9
9
  blocksRegistry: BlocksRegistry;
10
10
  context: ContentPageContext;
11
11
  }
12
- export declare function renderBlock(block: BlockDef, options: RenderBlockOptions, ancestors?: BlockAncestors): any;
13
- export {};
12
+ export interface RenderBlockProps {
13
+ block?: BlockDef;
14
+ options: RenderBlockOptions;
15
+ ancestors?: BlockAncestors;
16
+ }
17
+ export declare function renderBlock({ block, options, ancestors }: RenderBlockProps): any;
@@ -1,17 +1,17 @@
1
1
  import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
2
- import { DEFAULT_ANCESTORS } from '../../model/BlockDecorator.js';
3
2
  import { style2className } from '../../utils/style2className.js';
4
- const defaultChildRenderer = (_) => _;
5
- export function renderBlock(block, options, ancestors = DEFAULT_ANCESTORS) {
6
- const { key, page, blockDecorator, blocksRegistry, context } = options;
7
- const { type, blocks: childBlocks } = block;
3
+ import { renderBlocksList } from './renderBlockList.js';
4
+ import { renderSlots } from './renderSlots.js';
5
+ export function renderBlock({ block = {}, options, ancestors = [] }) {
6
+ const { key, page, blockDecorator, blocksRegistry = {}, context } = options;
7
+ const { type, slots, blocks: childBlocks } = block;
8
8
  if (!(type && type in blocksRegistry)) {
9
9
  console.warn(`No block with "${type}" is registered`);
10
10
  }
11
11
  const BlockComponent = type && blocksRegistry[type];
12
- const { renderChild = defaultChildRenderer } = BlockComponent || {};
13
- const renderChildBlock = (_, j) => renderChild(renderBlock(_, { ...options, key: `${options.key}-${j}` }, [...ancestors, block]), j);
14
- const children = childBlocks?.length ? childBlocks.map(renderChildBlock) : null;
12
+ const subBlockRenderProps = { parent: block, options, ancestors };
13
+ const children = renderBlocksList({ ...subBlockRenderProps, blocks: childBlocks });
14
+ const blockSlots = slots ? renderSlots({ ...subBlockRenderProps, slots }) : {};
15
15
  return blockDecorator({
16
16
  blockClassName: `scroll-mt-12 ${style2className(block.style)}`,
17
17
  block,
@@ -19,7 +19,7 @@ export function renderBlock(block, options, ancestors = DEFAULT_ANCESTORS) {
19
19
  // Adjusted by decorator block and blockClassName
20
20
  render: ({ block: adjustedBlock, blockClassName: adjustedBlockClassName }) => {
21
21
  const { version, anchor, labels, content } = adjustedBlock;
22
- return BlockComponent ? (_jsx(BlockComponent, { className: adjustedBlockClassName, context: context, page: page, ancestors: ancestors, version: version, anchor: anchor, labels: labels, ...content, children: children }, key)) : null;
22
+ return BlockComponent ? (_jsx(BlockComponent, { className: adjustedBlockClassName, context: context, page: page, ancestors: ancestors, version: version, anchor: anchor, labels: labels, slots: blockSlots, ...content, children: children }, key)) : null;
23
23
  },
24
24
  }, key);
25
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"renderBlock.js","sourceRoot":"","sources":["../../../src/components/ContentPage/renderBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkC,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAI/F,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAW9D,MAAM,oBAAoB,GAAG,CAAC,CAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAE7C,MAAM,UAAU,WAAW,CACzB,KAAe,EACf,OAA2B,EAC3B,YAA4B,iBAAiB;IAE7C,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACvE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WA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AgB,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QAC9D,KAAK;QACL,SAAS;QACT,iDAAiD;QACjD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,sBAAsB,EAAE,EAAE,EAAE;YAC3E,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,aAAa,CAAC;YAE3D,OAAO,cAAc,CAAC,CAAC,CAAC,CACtB,KAAC,cAAc,IAEb,SAAS,EAAE,sBAAsB,EACjC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,KACb,OAAO,YAEV,QAAQ,IAXJ,GAAG,CAYO,CAClB,CAAC,CAAC,CAAC,IAAI,CAAC;QACX,CAAC;KACF,EACD,GAAG,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { SlotName } from '../../model/BlockDecorator';
2
+ import { BlockAncestors } from '../../model/BlockDecorator';
3
+ import type { BlockDef, Slot } from '../../model/ContentPageDef';
4
+ import type { VNode } from '../../model/VNode';
5
+ import { RenderBlockOptions } from './renderBlock';
6
+ interface RenderBlockListProps {
7
+ blocks?: BlockDef[];
8
+ parent: Slot;
9
+ slotName?: SlotName;
10
+ options: RenderBlockOptions;
11
+ ancestors?: BlockAncestors;
12
+ }
13
+ export declare function renderBlocksList({ blocks, parent, slotName, options, ancestors, }: RenderBlockListProps): Record<string, VNode>;
14
+ export {};
@@ -0,0 +1,15 @@
1
+ import { DEFAULT_SLOT_NAME } from '../../model/BlockDecorator.js';
2
+ import { renderBlock } from './renderBlock.js';
3
+ const defaultChildRenderer = (_) => _;
4
+ export function renderBlocksList({ blocks = [], parent, slotName = DEFAULT_SLOT_NAME, options, ancestors = [], }) {
5
+ const { blocksRegistry = {} } = options;
6
+ const { type } = parent;
7
+ const BlockComponent = type && blocksRegistry[type];
8
+ const { renderChild = defaultChildRenderer } = BlockComponent || {};
9
+ return blocks.map((_, j) => renderChild(renderBlock({
10
+ block: _,
11
+ options: { ...options, key: `${options.key ? options.key : _.type}-${j}` },
12
+ ancestors: [...ancestors, [parent, slotName]],
13
+ }), j));
14
+ }
15
+ //# sourceMappingURL=renderBlockList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderBlockList.js","sourceRoot":"","sources":["../../../src/components/ContentPage/renderBlockList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/E,OAAO,EAAE,WAAW,EAAsB,MAAM,eAAe,CAAC;AAUhE,MAAM,oBAAoB,GAAG,CAAC,CAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAE7C,MAAM,UAAU,gBAAgB,CAAC,EAC/B,MAAM,GAAG,EAAE,EACX,MAAM,EACN,QAAQ,GAAG,iBAAiB,EAC5B,OAAO,EACP,SAAS,GAAG,EAAE,GACO;IACrB,MAAM,EAAE,cAAc,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;IACxC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAkB,CAAC;IACpC,MAAM,cAAc,GAAG,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IACpD,MAAM,EAAE,WAAW,GAAG,oBAAoB,EAAE,GAAG,cAAc,IAAI,EAAE,CAAC;IAEpE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAW,EAAE,CAAS,EAAE,EAAE,CAC3C,WAAW,CACT,WAAW,CAAC;QACV,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE;QAC1E,SAAS,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KAC9C,CAAC,EACF,CAAC,CACF,CACF,CAAC;AACJ,CAAC"}