@redneckz/wildless-cms-uni-blocks 0.14.861 → 0.14.862

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 (454) hide show
  1. package/README.md +13 -5
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +14 -20
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/icons/IconName.d.ts +2 -2
  6. package/bundle/model/Fallback.d.ts +0 -1
  7. package/bundle/model/FormTypeFieldDef.d.ts +1 -1
  8. package/dist/components/TabsLayout/TabsLayout.js +13 -15
  9. package/dist/components/TabsLayout/TabsLayout.js.map +1 -1
  10. package/dist/icons/IconName.d.ts +2 -2
  11. package/dist/icons/IconName.js +1 -1
  12. package/dist/icons/IconName.js.map +1 -1
  13. package/dist/model/Fallback.d.ts +0 -1
  14. package/dist/model/FormTypeFieldDef.d.ts +1 -1
  15. package/lib/common.css +1 -1
  16. package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
  17. package/lib/components/ApplicationForm/ApplicationForm.fixture.mobile.d.ts +1 -0
  18. package/lib/components/TabsLayout/TabsLayout.js +14 -16
  19. package/lib/components/TabsLayout/TabsLayout.js.map +1 -1
  20. package/lib/icons/IconName.d.ts +2 -2
  21. package/lib/icons/IconName.js +1 -1
  22. package/lib/icons/IconName.js.map +1 -1
  23. package/lib/model/Fallback.d.ts +0 -1
  24. package/lib/model/FormTypeFieldDef.d.ts +1 -1
  25. package/lib/retail/components/DraftDialog/utils.d.ts +3 -3
  26. package/mobile/bundle/bundle.umd.js +14 -20
  27. package/mobile/bundle/bundle.umd.min.js +1 -1
  28. package/mobile/bundle/icons/IconName.d.ts +2 -2
  29. package/mobile/bundle/model/Fallback.d.ts +0 -1
  30. package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
  31. package/mobile/dist/components/TabsLayout/TabsLayout.js +13 -15
  32. package/mobile/dist/components/TabsLayout/TabsLayout.js.map +1 -1
  33. package/mobile/dist/icons/IconName.d.ts +2 -2
  34. package/mobile/dist/icons/IconName.js +1 -1
  35. package/mobile/dist/icons/IconName.js.map +1 -1
  36. package/mobile/dist/model/Fallback.d.ts +0 -1
  37. package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
  38. package/mobile/lib/common.css +1 -1
  39. package/mobile/lib/components/TabsLayout/TabsLayout.js +14 -16
  40. package/mobile/lib/components/TabsLayout/TabsLayout.js.map +1 -1
  41. package/mobile/lib/icons/IconName.d.ts +2 -2
  42. package/mobile/lib/icons/IconName.js +1 -1
  43. package/mobile/lib/icons/IconName.js.map +1 -1
  44. package/mobile/lib/model/Fallback.d.ts +0 -1
  45. package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
  46. package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +30 -0
  47. package/mobile/src/components/TabsLayout/TabsLayout.tsx +19 -23
  48. package/mobile/src/icons/IconName.ts +2 -2
  49. package/mobile/src/icons/PercentIcon.svg +1 -1
  50. package/mobile/src/model/Fallback.ts +0 -1
  51. package/mobile/src/model/FormTypeFieldDef.ts +1 -0
  52. package/package.json +1 -21
  53. package/src/components/ApplicationForm/ApplicationForm.example.json +30 -0
  54. package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +23 -0
  55. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +23 -0
  56. package/src/components/ContentPage/ContentPage.fixture.mobile.tsx +1 -4
  57. package/src/components/ContentPage/ContentPage.fixture.tsx +2 -7
  58. package/src/components/TabsLayout/TabsLayout.tsx +19 -23
  59. package/src/icons/IconName.ts +2 -2
  60. package/src/icons/PercentIcon.svg +1 -1
  61. package/src/model/Fallback.ts +0 -1
  62. package/src/model/FormTypeFieldDef.ts +1 -0
  63. package/bundle/components/ContentPage/computeAPIFallback.d.ts +0 -4
  64. package/bundle/components/ContentPage/loadModuleFallback.d.ts +0 -2
  65. package/bundle/components/ContentPage/mapSlot.d.ts +0 -2
  66. package/bundle/components/ContentPage/normalizeBlock.d.ts +0 -3
  67. package/bundle/components/ContentPage/normalizeBlock.mobile.d.ts +0 -3
  68. package/bundle/components/ContentPage/normalizePage.d.ts +0 -3
  69. package/bundle/components/ContentPage/toMobileBlock.d.ts +0 -2
  70. package/bundle/content-page-repository/ContentPageRepository.d.ts +0 -10
  71. package/bundle/content-page-repository/JSONDocContentBox.d.ts +0 -8
  72. package/bundle/content-page-repository/TransformationOptions.d.ts +0 -4
  73. package/bundle/content-page-repository/clearAttachmentHref.d.ts +0 -2
  74. package/bundle/content-page-repository/computeImgOutputPath.d.ts +0 -3
  75. package/bundle/content-page-repository/extensions.d.ts +0 -3
  76. package/bundle/content-page-repository/index.d.ts +0 -3
  77. package/bundle/content-page-repository/mapJSON.d.ts +0 -1
  78. package/bundle/content-page-repository/mergePages.d.ts +0 -2
  79. package/bundle/content-page-repository/replaceHeadingTags.d.ts +0 -1
  80. package/bundle/content-page-repository/resizeImg.d.ts +0 -3
  81. package/bundle/content-page-repository/transformAttachmentLink.d.ts +0 -3
  82. package/bundle/content-page-repository/transformContentPage.d.ts +0 -4
  83. package/bundle/content-page-repository/transformDocument.d.ts +0 -3
  84. package/bundle/content-page-repository/transformHTML.d.ts +0 -1
  85. package/bundle/content-page-repository/transformImg.d.ts +0 -12
  86. package/bundle/content-page-repository/transformMarkdown.d.ts +0 -1
  87. package/bundle/content-page-repository/transformPicture.d.ts +0 -3
  88. package/dist/components/ContentPage/computeAPIFallback.d.ts +0 -4
  89. package/dist/components/ContentPage/computeAPIFallback.js +0 -36
  90. package/dist/components/ContentPage/computeAPIFallback.js.map +0 -1
  91. package/dist/components/ContentPage/loadModuleFallback.d.ts +0 -2
  92. package/dist/components/ContentPage/loadModuleFallback.js +0 -36
  93. package/dist/components/ContentPage/loadModuleFallback.js.map +0 -1
  94. package/dist/components/ContentPage/mapSlot.d.ts +0 -2
  95. package/dist/components/ContentPage/mapSlot.js +0 -16
  96. package/dist/components/ContentPage/mapSlot.js.map +0 -1
  97. package/dist/components/ContentPage/normalizeBlock.d.ts +0 -3
  98. package/dist/components/ContentPage/normalizeBlock.js +0 -15
  99. package/dist/components/ContentPage/normalizeBlock.js.map +0 -1
  100. package/dist/components/ContentPage/normalizeBlock.mobile.d.ts +0 -3
  101. package/dist/components/ContentPage/normalizeBlock.mobile.js +0 -18
  102. package/dist/components/ContentPage/normalizeBlock.mobile.js.map +0 -1
  103. package/dist/components/ContentPage/normalizePage.d.ts +0 -3
  104. package/dist/components/ContentPage/normalizePage.js +0 -6
  105. package/dist/components/ContentPage/normalizePage.js.map +0 -1
  106. package/dist/components/ContentPage/toMobileBlock.d.ts +0 -2
  107. package/dist/components/ContentPage/toMobileBlock.js +0 -12
  108. package/dist/components/ContentPage/toMobileBlock.js.map +0 -1
  109. package/dist/content-page-repository/ContentPageRepository.d.ts +0 -10
  110. package/dist/content-page-repository/ContentPageRepository.js +0 -31
  111. package/dist/content-page-repository/ContentPageRepository.js.map +0 -1
  112. package/dist/content-page-repository/JSONDocContentBox.d.ts +0 -8
  113. package/dist/content-page-repository/JSONDocContentBox.js +0 -39
  114. package/dist/content-page-repository/JSONDocContentBox.js.map +0 -1
  115. package/dist/content-page-repository/TransformationOptions.d.ts +0 -4
  116. package/dist/content-page-repository/TransformationOptions.js +0 -2
  117. package/dist/content-page-repository/TransformationOptions.js.map +0 -1
  118. package/dist/content-page-repository/clearAttachmentHref.d.ts +0 -2
  119. package/dist/content-page-repository/clearAttachmentHref.js +0 -6
  120. package/dist/content-page-repository/clearAttachmentHref.js.map +0 -1
  121. package/dist/content-page-repository/computeImgOutputPath.d.ts +0 -3
  122. package/dist/content-page-repository/computeImgOutputPath.js +0 -18
  123. package/dist/content-page-repository/computeImgOutputPath.js.map +0 -1
  124. package/dist/content-page-repository/extensions.d.ts +0 -3
  125. package/dist/content-page-repository/extensions.js +0 -18
  126. package/dist/content-page-repository/extensions.js.map +0 -1
  127. package/dist/content-page-repository/index.d.ts +0 -3
  128. package/dist/content-page-repository/index.js +0 -9
  129. package/dist/content-page-repository/index.js.map +0 -1
  130. package/dist/content-page-repository/mapJSON.d.ts +0 -1
  131. package/dist/content-page-repository/mapJSON.js +0 -26
  132. package/dist/content-page-repository/mapJSON.js.map +0 -1
  133. package/dist/content-page-repository/mergePages.d.ts +0 -2
  134. package/dist/content-page-repository/mergePages.js +0 -7
  135. package/dist/content-page-repository/mergePages.js.map +0 -1
  136. package/dist/content-page-repository/replaceHeadingTags.d.ts +0 -1
  137. package/dist/content-page-repository/replaceHeadingTags.js +0 -5
  138. package/dist/content-page-repository/replaceHeadingTags.js.map +0 -1
  139. package/dist/content-page-repository/resizeImg.d.ts +0 -3
  140. package/dist/content-page-repository/resizeImg.js +0 -19
  141. package/dist/content-page-repository/resizeImg.js.map +0 -1
  142. package/dist/content-page-repository/transformAttachmentLink.d.ts +0 -3
  143. package/dist/content-page-repository/transformAttachmentLink.js +0 -40
  144. package/dist/content-page-repository/transformAttachmentLink.js.map +0 -1
  145. package/dist/content-page-repository/transformContentPage.d.ts +0 -4
  146. package/dist/content-page-repository/transformContentPage.js +0 -78
  147. package/dist/content-page-repository/transformContentPage.js.map +0 -1
  148. package/dist/content-page-repository/transformDocument.d.ts +0 -3
  149. package/dist/content-page-repository/transformDocument.js +0 -38
  150. package/dist/content-page-repository/transformDocument.js.map +0 -1
  151. package/dist/content-page-repository/transformHTML.d.ts +0 -1
  152. package/dist/content-page-repository/transformHTML.js +0 -54
  153. package/dist/content-page-repository/transformHTML.js.map +0 -1
  154. package/dist/content-page-repository/transformImg.d.ts +0 -12
  155. package/dist/content-page-repository/transformImg.js +0 -51
  156. package/dist/content-page-repository/transformImg.js.map +0 -1
  157. package/dist/content-page-repository/transformMarkdown.d.ts +0 -1
  158. package/dist/content-page-repository/transformMarkdown.js +0 -18
  159. package/dist/content-page-repository/transformMarkdown.js.map +0 -1
  160. package/dist/content-page-repository/transformPicture.d.ts +0 -3
  161. package/dist/content-page-repository/transformPicture.js +0 -28
  162. package/dist/content-page-repository/transformPicture.js.map +0 -1
  163. package/lib/components/ContentPage/computeAPIFallback.d.ts +0 -4
  164. package/lib/components/ContentPage/computeAPIFallback.js +0 -33
  165. package/lib/components/ContentPage/computeAPIFallback.js.map +0 -1
  166. package/lib/components/ContentPage/loadModuleFallback.d.ts +0 -2
  167. package/lib/components/ContentPage/loadModuleFallback.js +0 -10
  168. package/lib/components/ContentPage/loadModuleFallback.js.map +0 -1
  169. package/lib/components/ContentPage/mapSlot.d.ts +0 -2
  170. package/lib/components/ContentPage/mapSlot.js +0 -13
  171. package/lib/components/ContentPage/mapSlot.js.map +0 -1
  172. package/lib/components/ContentPage/normalizeBlock.d.ts +0 -3
  173. package/lib/components/ContentPage/normalizeBlock.js +0 -12
  174. package/lib/components/ContentPage/normalizeBlock.js.map +0 -1
  175. package/lib/components/ContentPage/normalizeBlock.mobile.d.ts +0 -3
  176. package/lib/components/ContentPage/normalizeBlock.mobile.js +0 -15
  177. package/lib/components/ContentPage/normalizeBlock.mobile.js.map +0 -1
  178. package/lib/components/ContentPage/normalizePage.d.ts +0 -3
  179. package/lib/components/ContentPage/normalizePage.js +0 -3
  180. package/lib/components/ContentPage/normalizePage.js.map +0 -1
  181. package/lib/components/ContentPage/toMobileBlock.d.ts +0 -2
  182. package/lib/components/ContentPage/toMobileBlock.js +0 -9
  183. package/lib/components/ContentPage/toMobileBlock.js.map +0 -1
  184. package/lib/content-page-repository/ContentPageRepository.d.ts +0 -10
  185. package/lib/content-page-repository/ContentPageRepository.js +0 -25
  186. package/lib/content-page-repository/ContentPageRepository.js.map +0 -1
  187. package/lib/content-page-repository/JSONDocContentBox.d.ts +0 -8
  188. package/lib/content-page-repository/JSONDocContentBox.js +0 -36
  189. package/lib/content-page-repository/JSONDocContentBox.js.map +0 -1
  190. package/lib/content-page-repository/TransformationOptions.d.ts +0 -4
  191. package/lib/content-page-repository/TransformationOptions.js +0 -2
  192. package/lib/content-page-repository/TransformationOptions.js.map +0 -1
  193. package/lib/content-page-repository/clearAttachmentHref.d.ts +0 -2
  194. package/lib/content-page-repository/clearAttachmentHref.js +0 -3
  195. package/lib/content-page-repository/clearAttachmentHref.js.map +0 -1
  196. package/lib/content-page-repository/computeImgOutputPath.d.ts +0 -3
  197. package/lib/content-page-repository/computeImgOutputPath.js +0 -12
  198. package/lib/content-page-repository/computeImgOutputPath.js.map +0 -1
  199. package/lib/content-page-repository/extensions.d.ts +0 -3
  200. package/lib/content-page-repository/extensions.js +0 -16
  201. package/lib/content-page-repository/extensions.js.map +0 -1
  202. package/lib/content-page-repository/index.d.ts +0 -3
  203. package/lib/content-page-repository/index.js +0 -4
  204. package/lib/content-page-repository/index.js.map +0 -1
  205. package/lib/content-page-repository/mapJSON.d.ts +0 -1
  206. package/lib/content-page-repository/mapJSON.js +0 -23
  207. package/lib/content-page-repository/mapJSON.js.map +0 -1
  208. package/lib/content-page-repository/mergePages.d.ts +0 -2
  209. package/lib/content-page-repository/mergePages.js +0 -4
  210. package/lib/content-page-repository/mergePages.js.map +0 -1
  211. package/lib/content-page-repository/replaceHeadingTags.d.ts +0 -1
  212. package/lib/content-page-repository/replaceHeadingTags.js +0 -2
  213. package/lib/content-page-repository/replaceHeadingTags.js.map +0 -1
  214. package/lib/content-page-repository/resizeImg.d.ts +0 -3
  215. package/lib/content-page-repository/resizeImg.js +0 -13
  216. package/lib/content-page-repository/resizeImg.js.map +0 -1
  217. package/lib/content-page-repository/transformAttachmentLink.d.ts +0 -3
  218. package/lib/content-page-repository/transformAttachmentLink.js +0 -34
  219. package/lib/content-page-repository/transformAttachmentLink.js.map +0 -1
  220. package/lib/content-page-repository/transformContentPage.d.ts +0 -4
  221. package/lib/content-page-repository/transformContentPage.js +0 -71
  222. package/lib/content-page-repository/transformContentPage.js.map +0 -1
  223. package/lib/content-page-repository/transformDocument.d.ts +0 -3
  224. package/lib/content-page-repository/transformDocument.js +0 -32
  225. package/lib/content-page-repository/transformDocument.js.map +0 -1
  226. package/lib/content-page-repository/transformHTML.d.ts +0 -1
  227. package/lib/content-page-repository/transformHTML.js +0 -25
  228. package/lib/content-page-repository/transformHTML.js.map +0 -1
  229. package/lib/content-page-repository/transformImg.d.ts +0 -12
  230. package/lib/content-page-repository/transformImg.js +0 -45
  231. package/lib/content-page-repository/transformImg.js.map +0 -1
  232. package/lib/content-page-repository/transformMarkdown.d.ts +0 -1
  233. package/lib/content-page-repository/transformMarkdown.js +0 -12
  234. package/lib/content-page-repository/transformMarkdown.js.map +0 -1
  235. package/lib/content-page-repository/transformPicture.d.ts +0 -3
  236. package/lib/content-page-repository/transformPicture.js +0 -22
  237. package/lib/content-page-repository/transformPicture.js.map +0 -1
  238. package/mobile/bundle/components/ContentPage/computeAPIFallback.d.ts +0 -4
  239. package/mobile/bundle/components/ContentPage/loadModuleFallback.d.ts +0 -2
  240. package/mobile/bundle/components/ContentPage/mapSlot.d.ts +0 -2
  241. package/mobile/bundle/components/ContentPage/normalizeBlock.d.ts +0 -3
  242. package/mobile/bundle/components/ContentPage/normalizePage.d.ts +0 -3
  243. package/mobile/bundle/components/ContentPage/toMobileBlock.d.ts +0 -2
  244. package/mobile/bundle/content-page-repository/ContentPageRepository.d.ts +0 -10
  245. package/mobile/bundle/content-page-repository/JSONDocContentBox.d.ts +0 -8
  246. package/mobile/bundle/content-page-repository/TransformationOptions.d.ts +0 -4
  247. package/mobile/bundle/content-page-repository/clearAttachmentHref.d.ts +0 -2
  248. package/mobile/bundle/content-page-repository/computeImgOutputPath.d.ts +0 -3
  249. package/mobile/bundle/content-page-repository/extensions.d.ts +0 -3
  250. package/mobile/bundle/content-page-repository/index.d.ts +0 -3
  251. package/mobile/bundle/content-page-repository/mapJSON.d.ts +0 -1
  252. package/mobile/bundle/content-page-repository/mergePages.d.ts +0 -2
  253. package/mobile/bundle/content-page-repository/replaceHeadingTags.d.ts +0 -1
  254. package/mobile/bundle/content-page-repository/resizeImg.d.ts +0 -3
  255. package/mobile/bundle/content-page-repository/transformAttachmentLink.d.ts +0 -3
  256. package/mobile/bundle/content-page-repository/transformContentPage.d.ts +0 -4
  257. package/mobile/bundle/content-page-repository/transformDocument.d.ts +0 -3
  258. package/mobile/bundle/content-page-repository/transformHTML.d.ts +0 -1
  259. package/mobile/bundle/content-page-repository/transformImg.d.ts +0 -12
  260. package/mobile/bundle/content-page-repository/transformMarkdown.d.ts +0 -1
  261. package/mobile/bundle/content-page-repository/transformPicture.d.ts +0 -3
  262. package/mobile/dist/components/ContentPage/computeAPIFallback.d.ts +0 -4
  263. package/mobile/dist/components/ContentPage/computeAPIFallback.js +0 -36
  264. package/mobile/dist/components/ContentPage/computeAPIFallback.js.map +0 -1
  265. package/mobile/dist/components/ContentPage/loadModuleFallback.d.ts +0 -2
  266. package/mobile/dist/components/ContentPage/loadModuleFallback.js +0 -36
  267. package/mobile/dist/components/ContentPage/loadModuleFallback.js.map +0 -1
  268. package/mobile/dist/components/ContentPage/mapSlot.d.ts +0 -2
  269. package/mobile/dist/components/ContentPage/mapSlot.js +0 -16
  270. package/mobile/dist/components/ContentPage/mapSlot.js.map +0 -1
  271. package/mobile/dist/components/ContentPage/normalizeBlock.d.ts +0 -3
  272. package/mobile/dist/components/ContentPage/normalizeBlock.js +0 -18
  273. package/mobile/dist/components/ContentPage/normalizeBlock.js.map +0 -1
  274. package/mobile/dist/components/ContentPage/normalizePage.d.ts +0 -3
  275. package/mobile/dist/components/ContentPage/normalizePage.js +0 -6
  276. package/mobile/dist/components/ContentPage/normalizePage.js.map +0 -1
  277. package/mobile/dist/components/ContentPage/toMobileBlock.d.ts +0 -2
  278. package/mobile/dist/components/ContentPage/toMobileBlock.js +0 -12
  279. package/mobile/dist/components/ContentPage/toMobileBlock.js.map +0 -1
  280. package/mobile/dist/content-page-repository/ContentPageRepository.d.ts +0 -10
  281. package/mobile/dist/content-page-repository/ContentPageRepository.js +0 -31
  282. package/mobile/dist/content-page-repository/ContentPageRepository.js.map +0 -1
  283. package/mobile/dist/content-page-repository/JSONDocContentBox.d.ts +0 -8
  284. package/mobile/dist/content-page-repository/JSONDocContentBox.js +0 -39
  285. package/mobile/dist/content-page-repository/JSONDocContentBox.js.map +0 -1
  286. package/mobile/dist/content-page-repository/TransformationOptions.d.ts +0 -4
  287. package/mobile/dist/content-page-repository/TransformationOptions.js +0 -2
  288. package/mobile/dist/content-page-repository/TransformationOptions.js.map +0 -1
  289. package/mobile/dist/content-page-repository/clearAttachmentHref.d.ts +0 -2
  290. package/mobile/dist/content-page-repository/clearAttachmentHref.js +0 -6
  291. package/mobile/dist/content-page-repository/clearAttachmentHref.js.map +0 -1
  292. package/mobile/dist/content-page-repository/computeImgOutputPath.d.ts +0 -3
  293. package/mobile/dist/content-page-repository/computeImgOutputPath.js +0 -18
  294. package/mobile/dist/content-page-repository/computeImgOutputPath.js.map +0 -1
  295. package/mobile/dist/content-page-repository/extensions.d.ts +0 -3
  296. package/mobile/dist/content-page-repository/extensions.js +0 -18
  297. package/mobile/dist/content-page-repository/extensions.js.map +0 -1
  298. package/mobile/dist/content-page-repository/index.d.ts +0 -3
  299. package/mobile/dist/content-page-repository/index.js +0 -9
  300. package/mobile/dist/content-page-repository/index.js.map +0 -1
  301. package/mobile/dist/content-page-repository/mapJSON.d.ts +0 -1
  302. package/mobile/dist/content-page-repository/mapJSON.js +0 -26
  303. package/mobile/dist/content-page-repository/mapJSON.js.map +0 -1
  304. package/mobile/dist/content-page-repository/mergePages.d.ts +0 -2
  305. package/mobile/dist/content-page-repository/mergePages.js +0 -7
  306. package/mobile/dist/content-page-repository/mergePages.js.map +0 -1
  307. package/mobile/dist/content-page-repository/replaceHeadingTags.d.ts +0 -1
  308. package/mobile/dist/content-page-repository/replaceHeadingTags.js +0 -5
  309. package/mobile/dist/content-page-repository/replaceHeadingTags.js.map +0 -1
  310. package/mobile/dist/content-page-repository/resizeImg.d.ts +0 -3
  311. package/mobile/dist/content-page-repository/resizeImg.js +0 -19
  312. package/mobile/dist/content-page-repository/resizeImg.js.map +0 -1
  313. package/mobile/dist/content-page-repository/transformAttachmentLink.d.ts +0 -3
  314. package/mobile/dist/content-page-repository/transformAttachmentLink.js +0 -40
  315. package/mobile/dist/content-page-repository/transformAttachmentLink.js.map +0 -1
  316. package/mobile/dist/content-page-repository/transformContentPage.d.ts +0 -4
  317. package/mobile/dist/content-page-repository/transformContentPage.js +0 -78
  318. package/mobile/dist/content-page-repository/transformContentPage.js.map +0 -1
  319. package/mobile/dist/content-page-repository/transformDocument.d.ts +0 -3
  320. package/mobile/dist/content-page-repository/transformDocument.js +0 -38
  321. package/mobile/dist/content-page-repository/transformDocument.js.map +0 -1
  322. package/mobile/dist/content-page-repository/transformHTML.d.ts +0 -1
  323. package/mobile/dist/content-page-repository/transformHTML.js +0 -54
  324. package/mobile/dist/content-page-repository/transformHTML.js.map +0 -1
  325. package/mobile/dist/content-page-repository/transformImg.d.ts +0 -12
  326. package/mobile/dist/content-page-repository/transformImg.js +0 -51
  327. package/mobile/dist/content-page-repository/transformImg.js.map +0 -1
  328. package/mobile/dist/content-page-repository/transformMarkdown.d.ts +0 -1
  329. package/mobile/dist/content-page-repository/transformMarkdown.js +0 -18
  330. package/mobile/dist/content-page-repository/transformMarkdown.js.map +0 -1
  331. package/mobile/dist/content-page-repository/transformPicture.d.ts +0 -3
  332. package/mobile/dist/content-page-repository/transformPicture.js +0 -28
  333. package/mobile/dist/content-page-repository/transformPicture.js.map +0 -1
  334. package/mobile/lib/components/ContentPage/computeAPIFallback.d.ts +0 -4
  335. package/mobile/lib/components/ContentPage/computeAPIFallback.js +0 -33
  336. package/mobile/lib/components/ContentPage/computeAPIFallback.js.map +0 -1
  337. package/mobile/lib/components/ContentPage/loadModuleFallback.d.ts +0 -2
  338. package/mobile/lib/components/ContentPage/loadModuleFallback.js +0 -10
  339. package/mobile/lib/components/ContentPage/loadModuleFallback.js.map +0 -1
  340. package/mobile/lib/components/ContentPage/mapSlot.d.ts +0 -2
  341. package/mobile/lib/components/ContentPage/mapSlot.js +0 -13
  342. package/mobile/lib/components/ContentPage/mapSlot.js.map +0 -1
  343. package/mobile/lib/components/ContentPage/normalizeBlock.d.ts +0 -3
  344. package/mobile/lib/components/ContentPage/normalizeBlock.js +0 -15
  345. package/mobile/lib/components/ContentPage/normalizeBlock.js.map +0 -1
  346. package/mobile/lib/components/ContentPage/normalizePage.d.ts +0 -3
  347. package/mobile/lib/components/ContentPage/normalizePage.js +0 -3
  348. package/mobile/lib/components/ContentPage/normalizePage.js.map +0 -1
  349. package/mobile/lib/components/ContentPage/toMobileBlock.d.ts +0 -2
  350. package/mobile/lib/components/ContentPage/toMobileBlock.js +0 -9
  351. package/mobile/lib/components/ContentPage/toMobileBlock.js.map +0 -1
  352. package/mobile/lib/content-page-repository/ContentPageRepository.d.ts +0 -10
  353. package/mobile/lib/content-page-repository/ContentPageRepository.js +0 -25
  354. package/mobile/lib/content-page-repository/ContentPageRepository.js.map +0 -1
  355. package/mobile/lib/content-page-repository/JSONDocContentBox.d.ts +0 -8
  356. package/mobile/lib/content-page-repository/JSONDocContentBox.js +0 -36
  357. package/mobile/lib/content-page-repository/JSONDocContentBox.js.map +0 -1
  358. package/mobile/lib/content-page-repository/TransformationOptions.d.ts +0 -4
  359. package/mobile/lib/content-page-repository/TransformationOptions.js +0 -2
  360. package/mobile/lib/content-page-repository/TransformationOptions.js.map +0 -1
  361. package/mobile/lib/content-page-repository/clearAttachmentHref.d.ts +0 -2
  362. package/mobile/lib/content-page-repository/clearAttachmentHref.js +0 -3
  363. package/mobile/lib/content-page-repository/clearAttachmentHref.js.map +0 -1
  364. package/mobile/lib/content-page-repository/computeImgOutputPath.d.ts +0 -3
  365. package/mobile/lib/content-page-repository/computeImgOutputPath.js +0 -12
  366. package/mobile/lib/content-page-repository/computeImgOutputPath.js.map +0 -1
  367. package/mobile/lib/content-page-repository/extensions.d.ts +0 -3
  368. package/mobile/lib/content-page-repository/extensions.js +0 -16
  369. package/mobile/lib/content-page-repository/extensions.js.map +0 -1
  370. package/mobile/lib/content-page-repository/index.d.ts +0 -3
  371. package/mobile/lib/content-page-repository/index.js +0 -4
  372. package/mobile/lib/content-page-repository/index.js.map +0 -1
  373. package/mobile/lib/content-page-repository/mapJSON.d.ts +0 -1
  374. package/mobile/lib/content-page-repository/mapJSON.js +0 -23
  375. package/mobile/lib/content-page-repository/mapJSON.js.map +0 -1
  376. package/mobile/lib/content-page-repository/mergePages.d.ts +0 -2
  377. package/mobile/lib/content-page-repository/mergePages.js +0 -4
  378. package/mobile/lib/content-page-repository/mergePages.js.map +0 -1
  379. package/mobile/lib/content-page-repository/replaceHeadingTags.d.ts +0 -1
  380. package/mobile/lib/content-page-repository/replaceHeadingTags.js +0 -2
  381. package/mobile/lib/content-page-repository/replaceHeadingTags.js.map +0 -1
  382. package/mobile/lib/content-page-repository/resizeImg.d.ts +0 -3
  383. package/mobile/lib/content-page-repository/resizeImg.js +0 -13
  384. package/mobile/lib/content-page-repository/resizeImg.js.map +0 -1
  385. package/mobile/lib/content-page-repository/transformAttachmentLink.d.ts +0 -3
  386. package/mobile/lib/content-page-repository/transformAttachmentLink.js +0 -34
  387. package/mobile/lib/content-page-repository/transformAttachmentLink.js.map +0 -1
  388. package/mobile/lib/content-page-repository/transformContentPage.d.ts +0 -4
  389. package/mobile/lib/content-page-repository/transformContentPage.js +0 -71
  390. package/mobile/lib/content-page-repository/transformContentPage.js.map +0 -1
  391. package/mobile/lib/content-page-repository/transformDocument.d.ts +0 -3
  392. package/mobile/lib/content-page-repository/transformDocument.js +0 -32
  393. package/mobile/lib/content-page-repository/transformDocument.js.map +0 -1
  394. package/mobile/lib/content-page-repository/transformHTML.d.ts +0 -1
  395. package/mobile/lib/content-page-repository/transformHTML.js +0 -25
  396. package/mobile/lib/content-page-repository/transformHTML.js.map +0 -1
  397. package/mobile/lib/content-page-repository/transformImg.d.ts +0 -12
  398. package/mobile/lib/content-page-repository/transformImg.js +0 -45
  399. package/mobile/lib/content-page-repository/transformImg.js.map +0 -1
  400. package/mobile/lib/content-page-repository/transformMarkdown.d.ts +0 -1
  401. package/mobile/lib/content-page-repository/transformMarkdown.js +0 -12
  402. package/mobile/lib/content-page-repository/transformMarkdown.js.map +0 -1
  403. package/mobile/lib/content-page-repository/transformPicture.d.ts +0 -3
  404. package/mobile/lib/content-page-repository/transformPicture.js +0 -22
  405. package/mobile/lib/content-page-repository/transformPicture.js.map +0 -1
  406. package/mobile/src/components/ContentPage/computeAPIFallback.ts +0 -67
  407. package/mobile/src/components/ContentPage/loadModuleFallback.ts +0 -11
  408. package/mobile/src/components/ContentPage/mapSlot.ts +0 -18
  409. package/mobile/src/components/ContentPage/normalizeBlock.ts +0 -25
  410. package/mobile/src/components/ContentPage/normalizePage.ts +0 -8
  411. package/mobile/src/components/ContentPage/toMobileBlock.ts +0 -11
  412. package/mobile/src/content-page-repository/ContentPageRepository.ts +0 -31
  413. package/mobile/src/content-page-repository/JSONDocContentBox.ts +0 -56
  414. package/mobile/src/content-page-repository/TransformationOptions.ts +0 -4
  415. package/mobile/src/content-page-repository/clearAttachmentHref.ts +0 -3
  416. package/mobile/src/content-page-repository/computeImgOutputPath.ts +0 -21
  417. package/mobile/src/content-page-repository/extensions.ts +0 -17
  418. package/mobile/src/content-page-repository/index.ts +0 -3
  419. package/mobile/src/content-page-repository/mapJSON.ts +0 -30
  420. package/mobile/src/content-page-repository/mergePages.ts +0 -8
  421. package/mobile/src/content-page-repository/replaceHeadingTags.ts +0 -2
  422. package/mobile/src/content-page-repository/resizeImg.ts +0 -17
  423. package/mobile/src/content-page-repository/transformAttachmentLink.ts +0 -46
  424. package/mobile/src/content-page-repository/transformContentPage.ts +0 -102
  425. package/mobile/src/content-page-repository/transformDocument.ts +0 -43
  426. package/mobile/src/content-page-repository/transformHTML.ts +0 -28
  427. package/mobile/src/content-page-repository/transformImg.ts +0 -81
  428. package/mobile/src/content-page-repository/transformMarkdown.ts +0 -14
  429. package/mobile/src/content-page-repository/transformPicture.ts +0 -35
  430. package/src/components/ContentPage/computeAPIFallback.ts +0 -67
  431. package/src/components/ContentPage/loadModuleFallback.ts +0 -11
  432. package/src/components/ContentPage/mapSlot.ts +0 -18
  433. package/src/components/ContentPage/normalizeBlock.mobile.ts +0 -25
  434. package/src/components/ContentPage/normalizeBlock.ts +0 -21
  435. package/src/components/ContentPage/normalizePage.ts +0 -8
  436. package/src/components/ContentPage/toMobileBlock.ts +0 -11
  437. package/src/content-page-repository/ContentPageRepository.ts +0 -31
  438. package/src/content-page-repository/JSONDocContentBox.ts +0 -56
  439. package/src/content-page-repository/TransformationOptions.ts +0 -4
  440. package/src/content-page-repository/clearAttachmentHref.ts +0 -3
  441. package/src/content-page-repository/computeImgOutputPath.ts +0 -21
  442. package/src/content-page-repository/extensions.ts +0 -17
  443. package/src/content-page-repository/index.ts +0 -3
  444. package/src/content-page-repository/mapJSON.ts +0 -30
  445. package/src/content-page-repository/mergePages.ts +0 -8
  446. package/src/content-page-repository/replaceHeadingTags.ts +0 -2
  447. package/src/content-page-repository/resizeImg.ts +0 -17
  448. package/src/content-page-repository/transformAttachmentLink.ts +0 -46
  449. package/src/content-page-repository/transformContentPage.ts +0 -102
  450. package/src/content-page-repository/transformDocument.ts +0 -43
  451. package/src/content-page-repository/transformHTML.ts +0 -28
  452. package/src/content-page-repository/transformImg.ts +0 -81
  453. package/src/content-page-repository/transformMarkdown.ts +0 -14
  454. package/src/content-page-repository/transformPicture.ts +0 -35
@@ -1 +0,0 @@
1
- {"version":3,"file":"mergePages.js","sourceRoot":"","sources":["../../src/content-page-repository/mergePages.ts"],"names":[],"mappings":";;AAAA,+CAAkE;AAClE,2DAAwD;AAEjD,MAAM,UAAU,GAAG,CAAC,IAAgB,EAAE,KAAiB,EAAc,EAAE,CAC5E,IAAA,eAAK,EACH,IAAI,qCAAiB,CAAC,IAAkB,CAAC,EACzC,IAAA,eAAK,EAAC,IAAI,qCAAiB,CAAC,KAAmB,CAAC,CAAC,CACpC,CAAC;AAJL,QAAA,UAAU,cAIL"}
@@ -1 +0,0 @@
1
- export declare const replaceHeadingTags: (html: string) => string;
@@ -1,5 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.replaceHeadingTags = void 0;
3
- const replaceHeadingTags = (html) => html.replaceAll(/<h(\d)>(.*?)<\/h\d>/g, '<p class="h$1">$2</p>');
4
- exports.replaceHeadingTags = replaceHeadingTags;
5
- //# sourceMappingURL=replaceHeadingTags.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replaceHeadingTags.js","sourceRoot":"","sources":["../../src/content-page-repository/replaceHeadingTags.ts"],"names":[],"mappings":";;AAAO,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAE,EAAE,CACjD,IAAI,CAAC,UAAU,CAAC,sBAAsB,EAAE,uBAAuB,CAAC,CAAC;AADtD,QAAA,kBAAkB,sBACoC"}
@@ -1,3 +0,0 @@
1
- import { type ResizeOptions, type Sharp } from 'sharp';
2
- import { type ImageSize } from '../model/ImageSize';
3
- export declare const resizeImg: (size?: Partial<ImageSize>, options?: ResizeOptions) => (chain: Sharp) => Sharp;
@@ -1,19 +0,0 @@
1
- var __importDefault = (this && this.__importDefault) || function (mod) {
2
- return (mod && mod.__esModule) ? mod : { "default": mod };
3
- };
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.resizeImg = void 0;
6
- const sharp_1 = __importDefault(require("sharp"));
7
- const resizeImg = (size, options) => (chain) => size
8
- ? chain.resize(size.width || null, size.height || null, {
9
- /*
10
- * Editor behaviour with one dimension present: resize by given dimension maintaining aspect ratio. (fit: contain)
11
- * With two dimensions present: resize trying to fill given dimensions (fit: fill)
12
- */
13
- fit: size.width && size.height ? sharp_1.default.fit.fill : sharp_1.default.fit.contain,
14
- background: { r: 0, g: 0, b: 0, alpha: 0 },
15
- ...options,
16
- })
17
- : chain;
18
- exports.resizeImg = resizeImg;
19
- //# sourceMappingURL=resizeImg.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resizeImg.js","sourceRoot":"","sources":["../../src/content-page-repository/resizeImg.ts"],"names":[],"mappings":";;;;;AAAA,kDAA8D;AAGvD,MAAM,SAAS,GACpB,CAAC,IAAyB,EAAE,OAAuB,EAAE,EAAE,CACvD,CAAC,KAAY,EAAS,EAAE,CACtB,IAAI;IACF,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE;QACpD;;;WAGG;QACH,GAAG,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,eAAK,CAAC,GAAG,CAAC,OAAO;QACnE,UAAU,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;QAC1C,GAAG,OAAO;KACX,CAAC;IACJ,CAAC,CAAC,KAAK,CAAC;AAbD,QAAA,SAAS,aAaR"}
@@ -1,3 +0,0 @@
1
- import { type LinkProps } from '../model/LinkProps';
2
- import { type TransformationOptions } from './TransformationOptions';
3
- export declare function transformAttachmentLink(link: LinkProps, pagePath: string, options: TransformationOptions): Promise<LinkProps>;
@@ -1,40 +0,0 @@
1
- var __importDefault = (this && this.__importDefault) || function (mod) {
2
- return (mod && mod.__esModule) ? mod : { "default": mod };
3
- };
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.transformAttachmentLink = void 0;
6
- const fs_1 = __importDefault(require("fs"));
7
- const path_1 = __importDefault(require("path"));
8
- const util_1 = __importDefault(require("util"));
9
- const isUUID_1 = require("../utils/isUUID");
10
- const clearAttachmentHref_1 = require("./clearAttachmentHref");
11
- const mkdir = util_1.default.promisify(fs_1.default.mkdir);
12
- const copyFile = util_1.default.promisify(fs_1.default.copyFile);
13
- async function transformAttachmentLink(link, pagePath, options) {
14
- if (!link?.href) {
15
- return link;
16
- }
17
- try {
18
- return {
19
- ...link,
20
- href: await transformHref((0, clearAttachmentHref_1.clearAttachmentHref)(link.href), options),
21
- };
22
- }
23
- catch (e) {
24
- console.info(`No "${link.href}" attachment found on page: "${pagePath}"`);
25
- return link;
26
- }
27
- }
28
- exports.transformAttachmentLink = transformAttachmentLink;
29
- async function transformHref(input, options) {
30
- if ((0, isUUID_1.isUUID)(input)) {
31
- return input;
32
- }
33
- const { contentDir, publicDir } = options;
34
- const docRelativePath = path_1.default.relative(contentDir, input);
35
- const output = path_1.default.join(publicDir, docRelativePath);
36
- await mkdir(path_1.default.dirname(output), { recursive: true });
37
- await copyFile(input, output);
38
- return path_1.default.join('/', docRelativePath);
39
- }
40
- //# sourceMappingURL=transformAttachmentLink.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformAttachmentLink.js","sourceRoot":"","sources":["../../src/content-page-repository/transformAttachmentLink.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AAExB,4CAAyC;AACzC,+DAA4D;AAG5D,MAAM,KAAK,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,KAAK,CAAC,CAAC;AACvC,MAAM,QAAQ,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,QAAQ,CAAC,CAAC;AAEtC,KAAK,UAAU,uBAAuB,CAC3C,IAAe,EACf,QAAgB,EAChB,OAA8B;IAE9B,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE;QACf,OAAO,IAAI,CAAC;KACb;IAED,IAAI;QACF,OAAO;YACL,GAAG,IAAI;YACP,IAAI,EAAE,MAAM,aAAa,CAAC,IAAA,yCAAmB,EAAC,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;SACnE,CAAC;KACH;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,gCAAgC,QAAQ,GAAG,CAAC,CAAC;QAE1E,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AAnBD,0DAmBC;AAED,KAAK,UAAU,aAAa,CAAC,KAAa,EAAE,OAA8B;IACxE,IAAI,IAAA,eAAM,EAAC,KAAK,CAAC,EAAE;QACjB,OAAO,KAAK,CAAC;KACd;IAED,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAC1C,MAAM,eAAe,GAAG,cAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;IAErD,MAAM,KAAK,CAAC,cAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,MAAM,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAE9B,OAAO,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;AACzC,CAAC"}
@@ -1,4 +0,0 @@
1
- import { type ContentPageDef } from '../model/ContentPageDef';
2
- import { type TransformationOptions } from './TransformationOptions';
3
- export declare function transformContentPage(pagePath: string, options: TransformationOptions): Promise<ContentPageDef>;
4
- export declare const generatedPagePath: (pagePath: string) => string;
@@ -1,78 +0,0 @@
1
- var __importDefault = (this && this.__importDefault) || function (mod) {
2
- return (mod && mod.__esModule) ? mod : { "default": mod };
3
- };
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.generatedPagePath = exports.transformContentPage = void 0;
6
- const fs_1 = __importDefault(require("fs"));
7
- const util_1 = __importDefault(require("util"));
8
- const isUUID_1 = require("../utils/isUUID");
9
- const tableFunc_1 = require("../utils/tableFunc");
10
- const clearAttachmentHref_1 = require("./clearAttachmentHref");
11
- const extensions_1 = require("./extensions");
12
- const mapJSON_1 = require("./mapJSON");
13
- const mergePages_1 = require("./mergePages");
14
- const transformAttachmentLink_1 = require("./transformAttachmentLink");
15
- const transformDocument_1 = require("./transformDocument");
16
- const transformHTML_1 = require("./transformHTML");
17
- const transformMarkdown_1 = require("./transformMarkdown");
18
- const transformPicture_1 = require("./transformPicture");
19
- const readFile = util_1.default.promisify(fs_1.default.readFile);
20
- const writeFile = util_1.default.promisify(fs_1.default.writeFile);
21
- const DEFAULT_PARENT_CONTENT = {};
22
- async function transformContentPage(pagePath, options) {
23
- const content = JSON.parse(await readFile(pagePath, 'utf8'));
24
- const parentContent = await (content?._extends
25
- ? JSON.parse(await readFile(content._extends, 'utf-8'))
26
- : DEFAULT_PARENT_CONTENT);
27
- const mergedContent = (0, mergePages_1.mergePages)(parentContent, content);
28
- const result = await (0, mapJSON_1.mapJSON)(mergedContent, async (value, [key]) => {
29
- try {
30
- return await transform([value, key])(value, pagePath, options);
31
- }
32
- catch (ex) {
33
- console.warn(`Error while transforming field "${key}" on page: ${pagePath}`);
34
- console.error(ex);
35
- }
36
- return value;
37
- });
38
- await writeFile((0, exports.generatedPagePath)(pagePath), JSON.stringify(result), 'utf-8');
39
- return result;
40
- }
41
- exports.transformContentPage = transformContentPage;
42
- const transform = (0, tableFunc_1.tableFunc)([
43
- [([value, key]) => isMarkdown(key, value), async (value) => (0, transformMarkdown_1.transformMarkdown)(value)],
44
- [([value, key]) => isHTML(key, value), async (value) => (0, transformHTML_1.transformHTML)(value)],
45
- [([value]) => (0, isUUID_1.isUUID)(value?.src), async (value) => ({ src: value?.src })],
46
- [
47
- ([value]) => isAttachmentLink(value),
48
- async (value, pagePath, options) => (0, transformAttachmentLink_1.transformAttachmentLink)(value, pagePath, options),
49
- ],
50
- [
51
- ([value]) => isAttachmentFile(value, extensions_1.DOCUMENT_EXT_LIST),
52
- async (value, pagePath, options) => (0, transformDocument_1.transformDocument)(value, pagePath, options),
53
- ],
54
- [
55
- ([value]) => isAttachmentFile(value, extensions_1.IMAGE_EXT_LIST),
56
- async (value, pagePath, options) => (0, transformPicture_1.transformPicture)(value, pagePath, options),
57
- ],
58
- [() => true, async (value) => value],
59
- ]);
60
- const generatedPagePath = (pagePath) => `${pagePath}${extensions_1.OUTPUT_SUFFIX}`;
61
- exports.generatedPagePath = generatedPagePath;
62
- const isMarkdown = (key, value) => isString(value) && key?.endsWith('__md');
63
- const isHTML = (key, value) => isString(value) && key?.endsWith('__html');
64
- const isAttachmentLink = (_) => isLocalPath(_?.href) && (_.href.startsWith(clearAttachmentHref_1.ATTACHMENT_PREFIX) || isLocalFile(_.href));
65
- const isAttachmentFile = (_, exts) => Boolean(_ && isLocalPath(_?.src)) && exts.some((ext) => _.src.toLowerCase().endsWith(ext));
66
- const isLocalPath = (_) => isString(_) && _.length < 1024 && !isURL(_);
67
- const isURL = (src) => ['data:', 'https:', 'http:'].some((proto) => src.startsWith(proto));
68
- const isString = (_) => Boolean(_ && typeof _ === 'string');
69
- const isLocalFile = (_) => isString(_) && isFileExists(_);
70
- const isFileExists = (_) => {
71
- try {
72
- return fs_1.default.statSync(_).isFile();
73
- }
74
- catch (ex) {
75
- return false;
76
- }
77
- };
78
- //# sourceMappingURL=transformContentPage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformContentPage.js","sourceRoot":"","sources":["../../src/content-page-repository/transformContentPage.ts"],"names":[],"mappings":";;;;;AACA,4CAAoB;AACpB,gDAAwB;AAKxB,4CAAyC;AACzC,kDAA+C;AAC/C,+DAA0D;AAC1D,6CAAgF;AAChF,uCAAoC;AACpC,6CAA0C;AAE1C,uEAAoE;AACpE,2DAAwD;AACxD,mDAAgD;AAChD,2DAAwD;AACxD,yDAAsD;AAEtD,MAAM,QAAQ,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,QAAQ,CAAC,CAAC;AAC7C,MAAM,SAAS,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,SAAS,CAAC,CAAC;AAE/C,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAE3B,KAAK,UAAU,oBAAoB,CACxC,QAAgB,EAChB,OAA8B;IAE9B,MAAM,OAAO,GAAe,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IACzE,MAAM,aAAa,GAAe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AAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;AAE5E,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE;IACjC,IAAI;QACF,OAAO,YAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KAChC;IAAC,OAAO,EAAE,EAAE;QACX,OAAO,KAAK,CAAC;KACd;AACH,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { type Attachment } from '../model/Attachment';
2
- import { type TransformationOptions } from './TransformationOptions';
3
- export declare function transformDocument(attachment: Attachment, pagePath: string, options: TransformationOptions): Promise<Attachment>;
@@ -1,38 +0,0 @@
1
- var __importDefault = (this && this.__importDefault) || function (mod) {
2
- return (mod && mod.__esModule) ? mod : { "default": mod };
3
- };
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.transformDocument = void 0;
6
- const fs_1 = __importDefault(require("fs"));
7
- const path_1 = __importDefault(require("path"));
8
- const util_1 = __importDefault(require("util"));
9
- const isUUID_1 = require("../utils/isUUID");
10
- const mkdir = util_1.default.promisify(fs_1.default.mkdir);
11
- const copyFile = util_1.default.promisify(fs_1.default.copyFile);
12
- const stat = util_1.default.promisify(fs_1.default.stat);
13
- async function transformDocument(attachment, pagePath, options) {
14
- if (!attachment?.src || (0, isUUID_1.isUUID)(attachment.src)) {
15
- return attachment;
16
- }
17
- const { contentDir, publicDir } = options;
18
- const input = attachment.src;
19
- const docRelativePath = path_1.default.relative(contentDir, input);
20
- const output = path_1.default.join(publicDir, docRelativePath);
21
- const inputFileSize = (await stat(input)).size;
22
- try {
23
- await mkdir(path_1.default.dirname(output), { recursive: true });
24
- await copyFile(input, output);
25
- }
26
- catch (e) {
27
- console.info(`No "${input}" attachment found on page: "${pagePath}"`);
28
- return attachment;
29
- }
30
- const src = path_1.default.join('/', docRelativePath);
31
- return {
32
- ...attachment,
33
- src,
34
- fileSize: inputFileSize,
35
- };
36
- }
37
- exports.transformDocument = transformDocument;
38
- //# sourceMappingURL=transformDocument.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformDocument.js","sourceRoot":"","sources":["../../src/content-page-repository/transformDocument.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AAExB,4CAAyC;AAGzC,MAAM,KAAK,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,KAAK,CAAC,CAAC;AACvC,MAAM,QAAQ,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,QAAQ,CAAC,CAAC;AAC7C,MAAM,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,IAAI,CAAC,CAAC;AAE9B,KAAK,UAAU,iBAAiB,CACrC,UAAsB,EACtB,QAAgB,EAChB,OAA8B;IAE9B,IAAI,CAAC,UAAU,EAAE,GAAG,IAAI,IAAA,eAAM,EAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAC9C,OAAO,UAAU,CAAC;KACnB;IAED,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAC1C,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC;IAC7B,MAAM,eAAe,GAAG,cAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;IACrD,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAE/C,IAAI;QACF,MAAM,KAAK,CAAC,cAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,MAAM,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;KAC/B;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,IAAI,CAAC,OAAO,KAAK,gCAAgC,QAAQ,GAAG,CAAC,CAAC;QAEtE,OAAO,UAAU,CAAC;KACnB;IAED,MAAM,GAAG,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAE5C,OAAO;QACL,GAAG,UAAU;QACb,GAAG;QACH,QAAQ,EAAE,aAAa;KACxB,CAAC;AACJ,CAAC;AA/BD,8CA+BC"}
@@ -1 +0,0 @@
1
- export declare function transformHTML(html: string | null | undefined): Promise<string>;
@@ -1,54 +0,0 @@
1
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2
- if (k2 === undefined) k2 = k;
3
- var desc = Object.getOwnPropertyDescriptor(m, k);
4
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
5
- desc = { enumerable: true, get: function() { return m[k]; } };
6
- }
7
- Object.defineProperty(o, k2, desc);
8
- }) : (function(o, m, k, k2) {
9
- if (k2 === undefined) k2 = k;
10
- o[k2] = m[k];
11
- }));
12
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
13
- Object.defineProperty(o, "default", { enumerable: true, value: v });
14
- }) : function(o, v) {
15
- o["default"] = v;
16
- });
17
- var __importStar = (this && this.__importStar) || function (mod) {
18
- if (mod && mod.__esModule) return mod;
19
- var result = {};
20
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
21
- __setModuleDefault(result, mod);
22
- return result;
23
- };
24
- var __importDefault = (this && this.__importDefault) || function (mod) {
25
- return (mod && mod.__esModule) ? mod : { "default": mod };
26
- };
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.transformHTML = void 0;
29
- const rehype_parse_1 = __importDefault(require("rehype-parse"));
30
- const rehype_sanitize_1 = __importStar(require("rehype-sanitize"));
31
- const rehype_stringify_1 = __importDefault(require("rehype-stringify"));
32
- const unified_1 = require("unified");
33
- const replaceHeadingTags_1 = require("./replaceHeadingTags");
34
- async function transformHTML(html) {
35
- if (!html) {
36
- return '';
37
- }
38
- const extendedSchema = {
39
- ...rehype_sanitize_1.defaultSchema,
40
- protocols: {
41
- ...rehype_sanitize_1.defaultSchema.protocols,
42
- href: [...(rehype_sanitize_1.defaultSchema?.protocols?.href || []), 'tel'],
43
- src: [...(rehype_sanitize_1.defaultSchema.protocols?.src ?? []), 'data'],
44
- },
45
- };
46
- const result = await (0, unified_1.unified)()
47
- .use(rehype_parse_1.default)
48
- .use(rehype_sanitize_1.default, extendedSchema)
49
- .use(rehype_stringify_1.default)
50
- .process(html);
51
- return (0, replaceHeadingTags_1.replaceHeadingTags)(result.toString('utf-8'));
52
- }
53
- exports.transformHTML = transformHTML;
54
- //# sourceMappingURL=transformHTML.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformHTML.js","sourceRoot":"","sources":["../../src/content-page-repository/transformHTML.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAuC;AACvC,mEAAgE;AAChE,wEAA+C;AAC/C,qCAAkC;AAClC,6DAA0D;AAEnD,KAAK,UAAU,aAAa,CAAC,IAA+B;IACjE,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,EAAE,CAAC;KACX;IAED,MAAM,cAAc,GAAG;QACrB,GAAG,+BAAa;QAChB,SAAS,EAAE;YACT,GAAG,+BAAa,CAAC,SAAS;YAC1B,IAAI,EAAE,CAAC,GAAG,CAAC,+BAAa,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC;YACxD,GAAG,EAAE,CAAC,GAAG,CAAC,+BAAa,CAAC,SAAS,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC;SACvD;KACF,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,IAAA,iBAAO,GAAE;SAC3B,GAAG,CAAC,sBAAW,CAAC;SAChB,GAAG,CAAC,yBAAc,EAAE,cAAc,CAAC;SACnC,GAAG,CAAC,0BAAe,CAAC;SACpB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB,OAAO,IAAA,uCAAkB,EAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AACtD,CAAC;AArBD,sCAqBC"}
@@ -1,12 +0,0 @@
1
- import { type ImageSize } from '../model/ImageSize';
2
- import { type ImgSource } from '../model/Picture';
3
- import { type TransformationOptions } from './TransformationOptions';
4
- declare type ImgOutputPath = string;
5
- declare type TransformationTaskKey = ImgOutputPath;
6
- declare type TransformationTasksCache = Map<TransformationTaskKey, Promise<ImgOutputPath>>;
7
- declare type TransformImgOptions = TransformationOptions & ImgSource & {
8
- containerSize?: ImageSize;
9
- cache?: TransformationTasksCache;
10
- };
11
- export declare function transformImg(src: string, pagePath: string, options: TransformImgOptions): ImgOutputPath | Promise<ImgOutputPath>;
12
- export {};
@@ -1,51 +0,0 @@
1
- var __importDefault = (this && this.__importDefault) || function (mod) {
2
- return (mod && mod.__esModule) ? mod : { "default": mod };
3
- };
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.transformImg = void 0;
6
- const fs_1 = __importDefault(require("fs"));
7
- const path_1 = __importDefault(require("path"));
8
- const sharp_1 = __importDefault(require("sharp"));
9
- const util_1 = __importDefault(require("util"));
10
- const isPictureSizeEmpty_1 = require("../utils/isPictureSizeEmpty");
11
- const computeImgOutputPath_1 = require("./computeImgOutputPath");
12
- const resizeImg_1 = require("./resizeImg");
13
- const mkdir = util_1.default.promisify(fs_1.default.mkdir);
14
- const copyFile = util_1.default.promisify(fs_1.default.copyFile);
15
- const defaultTransformationCache = new Map();
16
- const isNilTransform = ({ size, containerSize, format }) => (0, isPictureSizeEmpty_1.isPictureSizeEmpty)(size) && (0, isPictureSizeEmpty_1.isPictureSizeEmpty)(containerSize) && !format;
17
- const isVectorInput = (input) => ['.svg', '.eps', '.epsf', '.epsi', '.pdf'].some((ext) => input.toLowerCase().endsWith(ext));
18
- function transformImg(src, pagePath, options) {
19
- if (!src) {
20
- return src;
21
- }
22
- const withoutTransform = isNilTransform(options) || isVectorInput(src);
23
- const output = (0, computeImgOutputPath_1.computeImgOutputPath)(src, options, withoutTransform);
24
- const { cache = defaultTransformationCache } = options;
25
- const cachedResult = cache.get(output);
26
- if (cachedResult) {
27
- return cachedResult;
28
- }
29
- const result = (async () => {
30
- try {
31
- await mkdir(path_1.default.dirname(output), { recursive: true });
32
- if (withoutTransform) {
33
- await copyFile(src, output);
34
- }
35
- else {
36
- const chain = await computeTransformationChain(options)((0, sharp_1.default)(src));
37
- await chain.toFile(output);
38
- }
39
- }
40
- catch (e) {
41
- console.info(`No "${src}" attachment found on page: "${pagePath}"`);
42
- }
43
- return output;
44
- })();
45
- cache.set(output, result);
46
- return result;
47
- }
48
- exports.transformImg = transformImg;
49
- const computeTransformationChain = ({ size, containerSize, format, options, }) => pipe((0, resizeImg_1.resizeImg)((0, isPictureSizeEmpty_1.isPictureSizeEmpty)(size) ? containerSize : size), (_) => format ? _.toFormat(format, { ...options, lossless: true }) : _);
50
- const pipe = (...operations) => operations.reduce((a, b) => async (chain) => b(await a(chain)));
51
- //# sourceMappingURL=transformImg.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformImg.js","sourceRoot":"","sources":["../../src/content-page-repository/transformImg.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,kDAA0C;AAC1C,gDAAwB;AAGxB,oEAAiE;AACjE,iEAA8D;AAC9D,2CAAwC;AAGxC,MAAM,KAAK,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,KAAK,CAAC,CAAC;AACvC,MAAM,QAAQ,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,QAAQ,CAAC,CAAC;AAS7C,MAAM,0BAA0B,GAA6B,IAAI,GAAG,EAAE,CAAC;AAEvE,MAAM,cAAc,GAAG,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAuB,EAAE,EAAE,CAC9E,IAAA,uCAAkB,EAAC,IAAI,CAAC,IA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AAE;YACV,OAAO,CAAC,IAAI,CAAC,OAAO,GAAG,gCAAgC,QAAQ,GAAG,CAAC,CAAC;SACrE;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,EAAE,CAAC;IACL,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE1B,OAAO,MAAM,CAAC;AAChB,CAAC;AAtCD,oCAsCC;AAED,MAAM,0BAA0B,GAAG,CAAC,EAClC,IAAI,EACJ,aAAa,EACb,MAAM,EACN,OAAO,GACa,EAAE,EAAE,CACxB,IAAI,CAAC,IAAA,qBAAS,EAAC,IAAA,uCAAkB,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CACrE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAChE,CAAC;AAEJ,MAAM,IAAI,GAAG,CAAC,GAAG,UAA2D,EAAE,EAAE,CAC9E,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,KAAY,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export declare function transformMarkdown(markdown: string | null | undefined): Promise<string>;
@@ -1,18 +0,0 @@
1
- var __importDefault = (this && this.__importDefault) || function (mod) {
2
- return (mod && mod.__esModule) ? mod : { "default": mod };
3
- };
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.transformMarkdown = void 0;
6
- const remark_html_1 = __importDefault(require("remark-html"));
7
- const remark_parse_1 = __importDefault(require("remark-parse"));
8
- const unified_1 = require("unified");
9
- const replaceHeadingTags_1 = require("./replaceHeadingTags");
10
- async function transformMarkdown(markdown) {
11
- if (!markdown) {
12
- return '';
13
- }
14
- const result = await (0, unified_1.unified)().use(remark_parse_1.default).use(remark_html_1.default).process(markdown);
15
- return (0, replaceHeadingTags_1.replaceHeadingTags)(result.toString('utf-8'));
16
- }
17
- exports.transformMarkdown = transformMarkdown;
18
- //# sourceMappingURL=transformMarkdown.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformMarkdown.js","sourceRoot":"","sources":["../../src/content-page-repository/transformMarkdown.ts"],"names":[],"mappings":";;;;;AAAA,8DAAqC;AACrC,gEAAuC;AACvC,qCAAkC;AAClC,6DAA0D;AAEnD,KAAK,UAAU,iBAAiB,CAAC,QAAmC;IACzE,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,EAAE,CAAC;KACX;IAED,MAAM,MAAM,GAAG,MAAM,IAAA,iBAAO,GAAE,CAAC,GAAG,CAAC,sBAAW,CAAC,CAAC,GAAG,CAAC,qBAAU,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAElF,OAAO,IAAA,uCAAkB,EAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AACtD,CAAC;AARD,8CAQC"}
@@ -1,3 +0,0 @@
1
- import { type Picture } from '../model/Picture';
2
- import { type TransformationOptions } from './TransformationOptions';
3
- export declare function transformPicture(picture: Picture, pagePath: string, options: TransformationOptions): Promise<Picture>;
@@ -1,28 +0,0 @@
1
- var __importDefault = (this && this.__importDefault) || function (mod) {
2
- return (mod && mod.__esModule) ? mod : { "default": mod };
3
- };
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.transformPicture = void 0;
6
- const path_1 = __importDefault(require("path"));
7
- const sharp_1 = __importDefault(require("sharp"));
8
- const transformImg_1 = require("./transformImg");
9
- async function transformPicture(picture, pagePath, options) {
10
- const src = picture?.src || '';
11
- const transformedImgPath = await (0, transformImg_1.transformImg)(src, pagePath, { ...options, ...picture });
12
- const { width, height } = await (0, sharp_1.default)(transformedImgPath).metadata();
13
- const containerSize = width && height ? { width, height } : undefined;
14
- const sources = picture.sources || [];
15
- const transformedSources = await Promise.all(sources.map((_) => (0, transformImg_1.transformImg)(src, pagePath, { ...options, ..._, containerSize })));
16
- const imgPathToSrc = (_) => path_1.default.join('/', path_1.default.relative(options.publicDir, _));
17
- return {
18
- ...picture,
19
- src: imgPathToSrc(transformedImgPath),
20
- sources: transformedSources.map((_, i) => ({
21
- ...sources[i],
22
- src: imgPathToSrc(_),
23
- size: { width, height },
24
- })),
25
- };
26
- }
27
- exports.transformPicture = transformPicture;
28
- //# sourceMappingURL=transformPicture.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformPicture.js","sourceRoot":"","sources":["../../src/content-page-repository/transformPicture.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,kDAA0B;AAG1B,iDAA8C;AAEvC,KAAK,UAAU,gBAAgB,CACpC,OAAgB,EAChB,QAAgB,EAChB,OAA8B;IAE9B,MAAM,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC;IAE/B,MAAM,kBAAkB,GAAG,MAAM,IAAA,2BAAY,EAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,GAAG,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAEzF,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,IAAA,eAAK,EAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE,CAAC;IACrE,MAAM,aAAa,GAAG,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAEtE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;IACtC,MAAM,kBAAkB,GAAG,MAAM,OAAO,CAAC,GAAG,CAC1C,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,2BAAY,EAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,GAAG,OAAO,EAAE,GAAG,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CACrF,CAAC;IAEF,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;IAExF,OAAO;QACL,GAAG,OAAO;QACV,GAAG,EAAE,YAAY,CAAC,kBAAkB,CAAC;QACrC,OAAO,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YACzC,GAAG,OAAO,CAAC,CAAC,CAAC;YACb,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC;YACpB,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;SACxB,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC;AA5BD,4CA4BC"}
@@ -1,4 +0,0 @@
1
- import { type BlocksRegistry } from '../../model/BlocksRegistry';
2
- import { type ContentPageDef } from '../../model/ContentPageDef';
3
- import { type Fallback } from '../../model/Fallback';
4
- export declare const computeAPIFallback: (blocksRegistry: BlocksRegistry, contentPageData: ContentPageDef) => Promise<Fallback>;
@@ -1,33 +0,0 @@
1
- import { collectRef, resolveJPointer } from '@redneckz/json-ref';
2
- import { ContentPageRepository } from '../../content-page-repository/ContentPageRepository.js';
3
- import { unique } from '../../utils/unique.js';
4
- import { joinPath } from '../../utils/url.js';
5
- import { loadModuleFallback } from './loadModuleFallback.js';
6
- const BASE_DIR = 'content';
7
- export const computeAPIFallback = async (blocksRegistry, contentPageData) => {
8
- return Object.fromEntries((await Promise.all([
9
- computeFallbackFromModules(blocksRegistry),
10
- computeFallbackFromContentRefs(contentPageData),
11
- ]))
12
- .flatMap((_) => _)
13
- .filter(([key, data]) => key && data));
14
- };
15
- const computeFallbackFromModules = async (blocksRegistry) => {
16
- const fallbackMap = (await Promise.all(Object.keys(blocksRegistry).map(loadModuleFallback)))
17
- .filter((_) => Boolean(_))
18
- .reduce((acc, _) => ({ ...acc, ..._ }), {});
19
- return (await Promise.allSettled(Object.entries(fallbackMap).map(async ([key, fetcher]) => [key, await fetcher()])))
20
- .filter((_) => _.status === 'fulfilled')
21
- .map(({ value }) => value);
22
- };
23
- const computeFallbackFromContentRefs = async (contentPageData) => {
24
- const refs = unique(collectRef(contentPageData));
25
- return (await Promise.allSettled(refs.map(async (_) => [
26
- _,
27
- (await ContentPageRepository.inst.generatePage(joinPath(BASE_DIR, _))),
28
- ])))
29
- .filter((_) => _.status === 'fulfilled')
30
- .map(({ value }) => value)
31
- .map(([ref, data]) => [ref, resolveJPointer(data, ref)]);
32
- };
33
- //# sourceMappingURL=computeAPIFallback.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"computeAPIFallback.js","sourceRoot":"","sources":["../../../src/components/ContentPage/computeAPIFallback.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAI5F,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAI1D,MAAM,QAAQ,GAAG,SAAS,CAAC;AAE3B,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACrC,cAA8B,EAC9B,eAA+B,EACZ,EAAE;IACrB,OAAO,MAAM,CAAC,WAAW,CACvB,CACE,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,0BAA0B,CAAC,cAAc,CAAC;QAC1C,8BAA8B,CAAC,eAAe,CAAC;KAChD,CAAC,CACH;SACE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;SACjB,MAAM,CAAC,CAAC,CAAC,G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,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAa;KACnF,CAAC,CACH,CACF;SACE,MAAM,CAAC,CAAC,CAAC,EAA8C,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC;SACnF,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC;SACzB,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type FallbackMap } from '../../model/Fallback';
2
- export declare const loadModuleFallback: (blockName: string) => Promise<FallbackMap | undefined>;
@@ -1,10 +0,0 @@
1
- export const loadModuleFallback = async (blockName) => {
2
- try {
3
- const blockFallback = await import(`../${blockName}/${blockName}.fallback.js`);
4
- return blockFallback?.fallback ? await blockFallback.fallback() : undefined;
5
- }
6
- catch (error) {
7
- return undefined;
8
- }
9
- };
10
- //# sourceMappingURL=loadModuleFallback.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loadModuleFallback.js","sourceRoot":"","sources":["../../../src/components/ContentPage/loadModuleFallback.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EAAE,SAAiB,EAAoC,EAAE;IAC9F,IAAI;QACF,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,MAAM,SAAS,IAAI,SAAS,WAAW,CAAC,CAAC;QAE5E,OAAO,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;KAC7E;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,SAAS,CAAC;KAClB;AACH,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type BlockDef, type Slot } from '../../model/ContentPageDef';
2
- export declare const mapSlot: (mapper: (blocks?: BlockDef[]) => BlockDef[]) => <S extends Slot>(slot: S) => S;
@@ -1,13 +0,0 @@
1
- export const mapSlot = (mapper) => (slot) => ({
2
- ...slot,
3
- ...(slot.blocks ? { blocks: mapper(slot.blocks) } : {}),
4
- ...(slot.slots
5
- ? {
6
- slots: Object.fromEntries(Object.entries(slot.slots).map(([slotKey, slotBlocks]) => [
7
- slotKey,
8
- mapper(slotBlocks),
9
- ])),
10
- }
11
- : {}),
12
- });
13
- //# sourceMappingURL=mapSlot.js.map
@@ -1 +0,0 @@
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,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACvD,GAAG,CAAC,IAAI,CAAC,KAAK;QACZ,CAAC,CAAC;YACE,KAAK,EAAE,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC;gBACxD,OAAO;gBACP,MAAM,CAAC,UAAU,CAAC;aACnB,CAAC,CACH;SACF;QACH,CAAC,CAAC,EAAE,CAAC;CACR,CAAC,CAAC"}
@@ -1,3 +0,0 @@
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,12 +0,0 @@
1
- import { mapSlot } from './mapSlot.js';
2
- export function normalizeBlock(block, blocksRegistry) {
3
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
4
- const { mobile, ...result } = (block || {});
5
- return mapSlot(filterBlocks(blocksRegistry))({ ...result });
6
- }
7
- const filterBlocks = (blocksRegistry) => (blocks) => blocks
8
- ? blocks
9
- ?.filter((block) => blocksRegistry && (block?.type || '') in blocksRegistry && !block?.hidden)
10
- .map((block) => normalizeBlock(block, blocksRegistry))
11
- : [];
12
- //# sourceMappingURL=normalizeBlock.js.map
@@ -1 +0,0 @@
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,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,EAAE,CAAa,CAAC;IAExD,OAAO,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAM,CAAC;AACnE,CAAC;AAED,MAAM,YAAY,GAChB,CAAC,cAA+B,EAAE,EAAE,CACpC,CAAC,MAAmB,EAAc,EAAE,CAClC,MAAM;IACJ,CAAC,CAAC,MAAM;QACJ,EAAE,MAAM,CACN,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,IAAI,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,IAAI,cAAc,IAAI,CAAC,KAAK,EAAE,MAAM,CACrF;SACA,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;IAC1D,CAAC,CAAC,EAAE,CAAC"}
@@ -1,3 +0,0 @@
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,15 +0,0 @@
1
- import { mapSlot } from './mapSlot.js';
2
- import { toMobileBlock } from './toMobileBlock.js';
3
- export function normalizeBlock(block, blocksRegistry) {
4
- const { mobile } = (block || {});
5
- return mapSlot(filterBlocks(blocksRegistry))((mobile ? toMobileBlock(block) : block) || {});
6
- }
7
- const filterBlocks = (blocksRegistry) => (blocks) => blocks
8
- ? blocks
9
- ?.filter((block) => blocksRegistry &&
10
- (block?.type || block?.mobile?.type || '') in blocksRegistry &&
11
- !block.mobile?.hidden &&
12
- !block?.hidden)
13
- .map((block) => normalizeBlock(block, blocksRegistry))
14
- : [];
15
- //# sourceMappingURL=normalizeBlock.mobile.js.map
@@ -1 +0,0 @@
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;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,UAAU,cAAc,CAAiB,KAAS,EAAE,cAA+B;IACvF,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,EAAE,CAAa,CAAC;IAE7C,OAAO,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAM,CAAC;AACnG,CAAC;AAED,MAAM,YAAY,GAChB,CAAC,cAA+B,EAAE,EAAE,CACpC,CAAC,MAAmB,EAAc,EAAE,CAClC,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;QACrB,CAAC,KAAK,EAAE,MAAM,CACjB;SACA,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;IAC1D,CAAC,CAAC,EAAE,CAAC"}
@@ -1,3 +0,0 @@
1
- import { type BlocksRegistry } from '../../model/BlocksRegistry';
2
- import { type ContentPageDef } from '../../model/ContentPageDef';
3
- export declare const normalizePage: (blocksRegistry: BlocksRegistry) => (contentPage: ContentPageDef | undefined | null) => ContentPageDef;
@@ -1,3 +0,0 @@
1
- import { normalizeBlock } from './normalizeBlock.js';
2
- export const normalizePage = (blocksRegistry) => (contentPage) => contentPage ? normalizeBlock(contentPage, blocksRegistry) : {};
3
- //# sourceMappingURL=normalizePage.js.map
@@ -1 +0,0 @@
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,EAAkB,EAAE,CACjE,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- export declare function toMobileBlock(block?: BlockDef): BlockDef;