@redneckz/wildless-cms-uni-blocks 0.14.860 → 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 (464) hide show
  1. package/README.md +13 -5
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +16 -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/ApplicationLeadForm/parseEsiaProfile.js +2 -0
  9. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  10. package/dist/components/TabsLayout/TabsLayout.js +13 -15
  11. package/dist/components/TabsLayout/TabsLayout.js.map +1 -1
  12. package/dist/icons/IconName.d.ts +2 -2
  13. package/dist/icons/IconName.js +1 -1
  14. package/dist/icons/IconName.js.map +1 -1
  15. package/dist/model/Fallback.d.ts +0 -1
  16. package/dist/model/FormTypeFieldDef.d.ts +1 -1
  17. package/lib/common.css +1 -1
  18. package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
  19. package/lib/components/ApplicationForm/ApplicationForm.fixture.mobile.d.ts +1 -0
  20. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +2 -0
  21. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  22. package/lib/components/TabsLayout/TabsLayout.js +14 -16
  23. package/lib/components/TabsLayout/TabsLayout.js.map +1 -1
  24. package/lib/icons/IconName.d.ts +2 -2
  25. package/lib/icons/IconName.js +1 -1
  26. package/lib/icons/IconName.js.map +1 -1
  27. package/lib/model/Fallback.d.ts +0 -1
  28. package/lib/model/FormTypeFieldDef.d.ts +1 -1
  29. package/lib/retail/components/DraftDialog/utils.d.ts +3 -3
  30. package/mobile/bundle/bundle.umd.js +16 -20
  31. package/mobile/bundle/bundle.umd.min.js +1 -1
  32. package/mobile/bundle/icons/IconName.d.ts +2 -2
  33. package/mobile/bundle/model/Fallback.d.ts +0 -1
  34. package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
  35. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +2 -0
  36. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  37. package/mobile/dist/components/TabsLayout/TabsLayout.js +13 -15
  38. package/mobile/dist/components/TabsLayout/TabsLayout.js.map +1 -1
  39. package/mobile/dist/icons/IconName.d.ts +2 -2
  40. package/mobile/dist/icons/IconName.js +1 -1
  41. package/mobile/dist/icons/IconName.js.map +1 -1
  42. package/mobile/dist/model/Fallback.d.ts +0 -1
  43. package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
  44. package/mobile/lib/common.css +1 -1
  45. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +2 -0
  46. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  47. package/mobile/lib/components/TabsLayout/TabsLayout.js +14 -16
  48. package/mobile/lib/components/TabsLayout/TabsLayout.js.map +1 -1
  49. package/mobile/lib/icons/IconName.d.ts +2 -2
  50. package/mobile/lib/icons/IconName.js +1 -1
  51. package/mobile/lib/icons/IconName.js.map +1 -1
  52. package/mobile/lib/model/Fallback.d.ts +0 -1
  53. package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
  54. package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +30 -0
  55. package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +2 -0
  56. package/mobile/src/components/TabsLayout/TabsLayout.tsx +19 -23
  57. package/mobile/src/icons/IconName.ts +2 -2
  58. package/mobile/src/icons/PercentIcon.svg +1 -1
  59. package/mobile/src/model/Fallback.ts +0 -1
  60. package/mobile/src/model/FormTypeFieldDef.ts +1 -0
  61. package/package.json +1 -21
  62. package/src/components/ApplicationForm/ApplicationForm.example.json +30 -0
  63. package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +23 -0
  64. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +23 -0
  65. package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +2 -0
  66. package/src/components/ContentPage/ContentPage.fixture.mobile.tsx +1 -4
  67. package/src/components/ContentPage/ContentPage.fixture.tsx +2 -7
  68. package/src/components/TabsLayout/TabsLayout.tsx +19 -23
  69. package/src/icons/IconName.ts +2 -2
  70. package/src/icons/PercentIcon.svg +1 -1
  71. package/src/model/Fallback.ts +0 -1
  72. package/src/model/FormTypeFieldDef.ts +1 -0
  73. package/bundle/components/ContentPage/computeAPIFallback.d.ts +0 -4
  74. package/bundle/components/ContentPage/loadModuleFallback.d.ts +0 -2
  75. package/bundle/components/ContentPage/mapSlot.d.ts +0 -2
  76. package/bundle/components/ContentPage/normalizeBlock.d.ts +0 -3
  77. package/bundle/components/ContentPage/normalizeBlock.mobile.d.ts +0 -3
  78. package/bundle/components/ContentPage/normalizePage.d.ts +0 -3
  79. package/bundle/components/ContentPage/toMobileBlock.d.ts +0 -2
  80. package/bundle/content-page-repository/ContentPageRepository.d.ts +0 -10
  81. package/bundle/content-page-repository/JSONDocContentBox.d.ts +0 -8
  82. package/bundle/content-page-repository/TransformationOptions.d.ts +0 -4
  83. package/bundle/content-page-repository/clearAttachmentHref.d.ts +0 -2
  84. package/bundle/content-page-repository/computeImgOutputPath.d.ts +0 -3
  85. package/bundle/content-page-repository/extensions.d.ts +0 -3
  86. package/bundle/content-page-repository/index.d.ts +0 -3
  87. package/bundle/content-page-repository/mapJSON.d.ts +0 -1
  88. package/bundle/content-page-repository/mergePages.d.ts +0 -2
  89. package/bundle/content-page-repository/replaceHeadingTags.d.ts +0 -1
  90. package/bundle/content-page-repository/resizeImg.d.ts +0 -3
  91. package/bundle/content-page-repository/transformAttachmentLink.d.ts +0 -3
  92. package/bundle/content-page-repository/transformContentPage.d.ts +0 -4
  93. package/bundle/content-page-repository/transformDocument.d.ts +0 -3
  94. package/bundle/content-page-repository/transformHTML.d.ts +0 -1
  95. package/bundle/content-page-repository/transformImg.d.ts +0 -12
  96. package/bundle/content-page-repository/transformMarkdown.d.ts +0 -1
  97. package/bundle/content-page-repository/transformPicture.d.ts +0 -3
  98. package/dist/components/ContentPage/computeAPIFallback.d.ts +0 -4
  99. package/dist/components/ContentPage/computeAPIFallback.js +0 -36
  100. package/dist/components/ContentPage/computeAPIFallback.js.map +0 -1
  101. package/dist/components/ContentPage/loadModuleFallback.d.ts +0 -2
  102. package/dist/components/ContentPage/loadModuleFallback.js +0 -36
  103. package/dist/components/ContentPage/loadModuleFallback.js.map +0 -1
  104. package/dist/components/ContentPage/mapSlot.d.ts +0 -2
  105. package/dist/components/ContentPage/mapSlot.js +0 -16
  106. package/dist/components/ContentPage/mapSlot.js.map +0 -1
  107. package/dist/components/ContentPage/normalizeBlock.d.ts +0 -3
  108. package/dist/components/ContentPage/normalizeBlock.js +0 -15
  109. package/dist/components/ContentPage/normalizeBlock.js.map +0 -1
  110. package/dist/components/ContentPage/normalizeBlock.mobile.d.ts +0 -3
  111. package/dist/components/ContentPage/normalizeBlock.mobile.js +0 -18
  112. package/dist/components/ContentPage/normalizeBlock.mobile.js.map +0 -1
  113. package/dist/components/ContentPage/normalizePage.d.ts +0 -3
  114. package/dist/components/ContentPage/normalizePage.js +0 -6
  115. package/dist/components/ContentPage/normalizePage.js.map +0 -1
  116. package/dist/components/ContentPage/toMobileBlock.d.ts +0 -2
  117. package/dist/components/ContentPage/toMobileBlock.js +0 -12
  118. package/dist/components/ContentPage/toMobileBlock.js.map +0 -1
  119. package/dist/content-page-repository/ContentPageRepository.d.ts +0 -10
  120. package/dist/content-page-repository/ContentPageRepository.js +0 -31
  121. package/dist/content-page-repository/ContentPageRepository.js.map +0 -1
  122. package/dist/content-page-repository/JSONDocContentBox.d.ts +0 -8
  123. package/dist/content-page-repository/JSONDocContentBox.js +0 -39
  124. package/dist/content-page-repository/JSONDocContentBox.js.map +0 -1
  125. package/dist/content-page-repository/TransformationOptions.d.ts +0 -4
  126. package/dist/content-page-repository/TransformationOptions.js +0 -2
  127. package/dist/content-page-repository/TransformationOptions.js.map +0 -1
  128. package/dist/content-page-repository/clearAttachmentHref.d.ts +0 -2
  129. package/dist/content-page-repository/clearAttachmentHref.js +0 -6
  130. package/dist/content-page-repository/clearAttachmentHref.js.map +0 -1
  131. package/dist/content-page-repository/computeImgOutputPath.d.ts +0 -3
  132. package/dist/content-page-repository/computeImgOutputPath.js +0 -18
  133. package/dist/content-page-repository/computeImgOutputPath.js.map +0 -1
  134. package/dist/content-page-repository/extensions.d.ts +0 -3
  135. package/dist/content-page-repository/extensions.js +0 -18
  136. package/dist/content-page-repository/extensions.js.map +0 -1
  137. package/dist/content-page-repository/index.d.ts +0 -3
  138. package/dist/content-page-repository/index.js +0 -9
  139. package/dist/content-page-repository/index.js.map +0 -1
  140. package/dist/content-page-repository/mapJSON.d.ts +0 -1
  141. package/dist/content-page-repository/mapJSON.js +0 -26
  142. package/dist/content-page-repository/mapJSON.js.map +0 -1
  143. package/dist/content-page-repository/mergePages.d.ts +0 -2
  144. package/dist/content-page-repository/mergePages.js +0 -7
  145. package/dist/content-page-repository/mergePages.js.map +0 -1
  146. package/dist/content-page-repository/replaceHeadingTags.d.ts +0 -1
  147. package/dist/content-page-repository/replaceHeadingTags.js +0 -5
  148. package/dist/content-page-repository/replaceHeadingTags.js.map +0 -1
  149. package/dist/content-page-repository/resizeImg.d.ts +0 -3
  150. package/dist/content-page-repository/resizeImg.js +0 -19
  151. package/dist/content-page-repository/resizeImg.js.map +0 -1
  152. package/dist/content-page-repository/transformAttachmentLink.d.ts +0 -3
  153. package/dist/content-page-repository/transformAttachmentLink.js +0 -40
  154. package/dist/content-page-repository/transformAttachmentLink.js.map +0 -1
  155. package/dist/content-page-repository/transformContentPage.d.ts +0 -4
  156. package/dist/content-page-repository/transformContentPage.js +0 -78
  157. package/dist/content-page-repository/transformContentPage.js.map +0 -1
  158. package/dist/content-page-repository/transformDocument.d.ts +0 -3
  159. package/dist/content-page-repository/transformDocument.js +0 -38
  160. package/dist/content-page-repository/transformDocument.js.map +0 -1
  161. package/dist/content-page-repository/transformHTML.d.ts +0 -1
  162. package/dist/content-page-repository/transformHTML.js +0 -54
  163. package/dist/content-page-repository/transformHTML.js.map +0 -1
  164. package/dist/content-page-repository/transformImg.d.ts +0 -12
  165. package/dist/content-page-repository/transformImg.js +0 -51
  166. package/dist/content-page-repository/transformImg.js.map +0 -1
  167. package/dist/content-page-repository/transformMarkdown.d.ts +0 -1
  168. package/dist/content-page-repository/transformMarkdown.js +0 -18
  169. package/dist/content-page-repository/transformMarkdown.js.map +0 -1
  170. package/dist/content-page-repository/transformPicture.d.ts +0 -3
  171. package/dist/content-page-repository/transformPicture.js +0 -28
  172. package/dist/content-page-repository/transformPicture.js.map +0 -1
  173. package/lib/components/ContentPage/computeAPIFallback.d.ts +0 -4
  174. package/lib/components/ContentPage/computeAPIFallback.js +0 -33
  175. package/lib/components/ContentPage/computeAPIFallback.js.map +0 -1
  176. package/lib/components/ContentPage/loadModuleFallback.d.ts +0 -2
  177. package/lib/components/ContentPage/loadModuleFallback.js +0 -10
  178. package/lib/components/ContentPage/loadModuleFallback.js.map +0 -1
  179. package/lib/components/ContentPage/mapSlot.d.ts +0 -2
  180. package/lib/components/ContentPage/mapSlot.js +0 -13
  181. package/lib/components/ContentPage/mapSlot.js.map +0 -1
  182. package/lib/components/ContentPage/normalizeBlock.d.ts +0 -3
  183. package/lib/components/ContentPage/normalizeBlock.js +0 -12
  184. package/lib/components/ContentPage/normalizeBlock.js.map +0 -1
  185. package/lib/components/ContentPage/normalizeBlock.mobile.d.ts +0 -3
  186. package/lib/components/ContentPage/normalizeBlock.mobile.js +0 -15
  187. package/lib/components/ContentPage/normalizeBlock.mobile.js.map +0 -1
  188. package/lib/components/ContentPage/normalizePage.d.ts +0 -3
  189. package/lib/components/ContentPage/normalizePage.js +0 -3
  190. package/lib/components/ContentPage/normalizePage.js.map +0 -1
  191. package/lib/components/ContentPage/toMobileBlock.d.ts +0 -2
  192. package/lib/components/ContentPage/toMobileBlock.js +0 -9
  193. package/lib/components/ContentPage/toMobileBlock.js.map +0 -1
  194. package/lib/content-page-repository/ContentPageRepository.d.ts +0 -10
  195. package/lib/content-page-repository/ContentPageRepository.js +0 -25
  196. package/lib/content-page-repository/ContentPageRepository.js.map +0 -1
  197. package/lib/content-page-repository/JSONDocContentBox.d.ts +0 -8
  198. package/lib/content-page-repository/JSONDocContentBox.js +0 -36
  199. package/lib/content-page-repository/JSONDocContentBox.js.map +0 -1
  200. package/lib/content-page-repository/TransformationOptions.d.ts +0 -4
  201. package/lib/content-page-repository/TransformationOptions.js +0 -2
  202. package/lib/content-page-repository/TransformationOptions.js.map +0 -1
  203. package/lib/content-page-repository/clearAttachmentHref.d.ts +0 -2
  204. package/lib/content-page-repository/clearAttachmentHref.js +0 -3
  205. package/lib/content-page-repository/clearAttachmentHref.js.map +0 -1
  206. package/lib/content-page-repository/computeImgOutputPath.d.ts +0 -3
  207. package/lib/content-page-repository/computeImgOutputPath.js +0 -12
  208. package/lib/content-page-repository/computeImgOutputPath.js.map +0 -1
  209. package/lib/content-page-repository/extensions.d.ts +0 -3
  210. package/lib/content-page-repository/extensions.js +0 -16
  211. package/lib/content-page-repository/extensions.js.map +0 -1
  212. package/lib/content-page-repository/index.d.ts +0 -3
  213. package/lib/content-page-repository/index.js +0 -4
  214. package/lib/content-page-repository/index.js.map +0 -1
  215. package/lib/content-page-repository/mapJSON.d.ts +0 -1
  216. package/lib/content-page-repository/mapJSON.js +0 -23
  217. package/lib/content-page-repository/mapJSON.js.map +0 -1
  218. package/lib/content-page-repository/mergePages.d.ts +0 -2
  219. package/lib/content-page-repository/mergePages.js +0 -4
  220. package/lib/content-page-repository/mergePages.js.map +0 -1
  221. package/lib/content-page-repository/replaceHeadingTags.d.ts +0 -1
  222. package/lib/content-page-repository/replaceHeadingTags.js +0 -2
  223. package/lib/content-page-repository/replaceHeadingTags.js.map +0 -1
  224. package/lib/content-page-repository/resizeImg.d.ts +0 -3
  225. package/lib/content-page-repository/resizeImg.js +0 -13
  226. package/lib/content-page-repository/resizeImg.js.map +0 -1
  227. package/lib/content-page-repository/transformAttachmentLink.d.ts +0 -3
  228. package/lib/content-page-repository/transformAttachmentLink.js +0 -34
  229. package/lib/content-page-repository/transformAttachmentLink.js.map +0 -1
  230. package/lib/content-page-repository/transformContentPage.d.ts +0 -4
  231. package/lib/content-page-repository/transformContentPage.js +0 -71
  232. package/lib/content-page-repository/transformContentPage.js.map +0 -1
  233. package/lib/content-page-repository/transformDocument.d.ts +0 -3
  234. package/lib/content-page-repository/transformDocument.js +0 -32
  235. package/lib/content-page-repository/transformDocument.js.map +0 -1
  236. package/lib/content-page-repository/transformHTML.d.ts +0 -1
  237. package/lib/content-page-repository/transformHTML.js +0 -25
  238. package/lib/content-page-repository/transformHTML.js.map +0 -1
  239. package/lib/content-page-repository/transformImg.d.ts +0 -12
  240. package/lib/content-page-repository/transformImg.js +0 -45
  241. package/lib/content-page-repository/transformImg.js.map +0 -1
  242. package/lib/content-page-repository/transformMarkdown.d.ts +0 -1
  243. package/lib/content-page-repository/transformMarkdown.js +0 -12
  244. package/lib/content-page-repository/transformMarkdown.js.map +0 -1
  245. package/lib/content-page-repository/transformPicture.d.ts +0 -3
  246. package/lib/content-page-repository/transformPicture.js +0 -22
  247. package/lib/content-page-repository/transformPicture.js.map +0 -1
  248. package/mobile/bundle/components/ContentPage/computeAPIFallback.d.ts +0 -4
  249. package/mobile/bundle/components/ContentPage/loadModuleFallback.d.ts +0 -2
  250. package/mobile/bundle/components/ContentPage/mapSlot.d.ts +0 -2
  251. package/mobile/bundle/components/ContentPage/normalizeBlock.d.ts +0 -3
  252. package/mobile/bundle/components/ContentPage/normalizePage.d.ts +0 -3
  253. package/mobile/bundle/components/ContentPage/toMobileBlock.d.ts +0 -2
  254. package/mobile/bundle/content-page-repository/ContentPageRepository.d.ts +0 -10
  255. package/mobile/bundle/content-page-repository/JSONDocContentBox.d.ts +0 -8
  256. package/mobile/bundle/content-page-repository/TransformationOptions.d.ts +0 -4
  257. package/mobile/bundle/content-page-repository/clearAttachmentHref.d.ts +0 -2
  258. package/mobile/bundle/content-page-repository/computeImgOutputPath.d.ts +0 -3
  259. package/mobile/bundle/content-page-repository/extensions.d.ts +0 -3
  260. package/mobile/bundle/content-page-repository/index.d.ts +0 -3
  261. package/mobile/bundle/content-page-repository/mapJSON.d.ts +0 -1
  262. package/mobile/bundle/content-page-repository/mergePages.d.ts +0 -2
  263. package/mobile/bundle/content-page-repository/replaceHeadingTags.d.ts +0 -1
  264. package/mobile/bundle/content-page-repository/resizeImg.d.ts +0 -3
  265. package/mobile/bundle/content-page-repository/transformAttachmentLink.d.ts +0 -3
  266. package/mobile/bundle/content-page-repository/transformContentPage.d.ts +0 -4
  267. package/mobile/bundle/content-page-repository/transformDocument.d.ts +0 -3
  268. package/mobile/bundle/content-page-repository/transformHTML.d.ts +0 -1
  269. package/mobile/bundle/content-page-repository/transformImg.d.ts +0 -12
  270. package/mobile/bundle/content-page-repository/transformMarkdown.d.ts +0 -1
  271. package/mobile/bundle/content-page-repository/transformPicture.d.ts +0 -3
  272. package/mobile/dist/components/ContentPage/computeAPIFallback.d.ts +0 -4
  273. package/mobile/dist/components/ContentPage/computeAPIFallback.js +0 -36
  274. package/mobile/dist/components/ContentPage/computeAPIFallback.js.map +0 -1
  275. package/mobile/dist/components/ContentPage/loadModuleFallback.d.ts +0 -2
  276. package/mobile/dist/components/ContentPage/loadModuleFallback.js +0 -36
  277. package/mobile/dist/components/ContentPage/loadModuleFallback.js.map +0 -1
  278. package/mobile/dist/components/ContentPage/mapSlot.d.ts +0 -2
  279. package/mobile/dist/components/ContentPage/mapSlot.js +0 -16
  280. package/mobile/dist/components/ContentPage/mapSlot.js.map +0 -1
  281. package/mobile/dist/components/ContentPage/normalizeBlock.d.ts +0 -3
  282. package/mobile/dist/components/ContentPage/normalizeBlock.js +0 -18
  283. package/mobile/dist/components/ContentPage/normalizeBlock.js.map +0 -1
  284. package/mobile/dist/components/ContentPage/normalizePage.d.ts +0 -3
  285. package/mobile/dist/components/ContentPage/normalizePage.js +0 -6
  286. package/mobile/dist/components/ContentPage/normalizePage.js.map +0 -1
  287. package/mobile/dist/components/ContentPage/toMobileBlock.d.ts +0 -2
  288. package/mobile/dist/components/ContentPage/toMobileBlock.js +0 -12
  289. package/mobile/dist/components/ContentPage/toMobileBlock.js.map +0 -1
  290. package/mobile/dist/content-page-repository/ContentPageRepository.d.ts +0 -10
  291. package/mobile/dist/content-page-repository/ContentPageRepository.js +0 -31
  292. package/mobile/dist/content-page-repository/ContentPageRepository.js.map +0 -1
  293. package/mobile/dist/content-page-repository/JSONDocContentBox.d.ts +0 -8
  294. package/mobile/dist/content-page-repository/JSONDocContentBox.js +0 -39
  295. package/mobile/dist/content-page-repository/JSONDocContentBox.js.map +0 -1
  296. package/mobile/dist/content-page-repository/TransformationOptions.d.ts +0 -4
  297. package/mobile/dist/content-page-repository/TransformationOptions.js +0 -2
  298. package/mobile/dist/content-page-repository/TransformationOptions.js.map +0 -1
  299. package/mobile/dist/content-page-repository/clearAttachmentHref.d.ts +0 -2
  300. package/mobile/dist/content-page-repository/clearAttachmentHref.js +0 -6
  301. package/mobile/dist/content-page-repository/clearAttachmentHref.js.map +0 -1
  302. package/mobile/dist/content-page-repository/computeImgOutputPath.d.ts +0 -3
  303. package/mobile/dist/content-page-repository/computeImgOutputPath.js +0 -18
  304. package/mobile/dist/content-page-repository/computeImgOutputPath.js.map +0 -1
  305. package/mobile/dist/content-page-repository/extensions.d.ts +0 -3
  306. package/mobile/dist/content-page-repository/extensions.js +0 -18
  307. package/mobile/dist/content-page-repository/extensions.js.map +0 -1
  308. package/mobile/dist/content-page-repository/index.d.ts +0 -3
  309. package/mobile/dist/content-page-repository/index.js +0 -9
  310. package/mobile/dist/content-page-repository/index.js.map +0 -1
  311. package/mobile/dist/content-page-repository/mapJSON.d.ts +0 -1
  312. package/mobile/dist/content-page-repository/mapJSON.js +0 -26
  313. package/mobile/dist/content-page-repository/mapJSON.js.map +0 -1
  314. package/mobile/dist/content-page-repository/mergePages.d.ts +0 -2
  315. package/mobile/dist/content-page-repository/mergePages.js +0 -7
  316. package/mobile/dist/content-page-repository/mergePages.js.map +0 -1
  317. package/mobile/dist/content-page-repository/replaceHeadingTags.d.ts +0 -1
  318. package/mobile/dist/content-page-repository/replaceHeadingTags.js +0 -5
  319. package/mobile/dist/content-page-repository/replaceHeadingTags.js.map +0 -1
  320. package/mobile/dist/content-page-repository/resizeImg.d.ts +0 -3
  321. package/mobile/dist/content-page-repository/resizeImg.js +0 -19
  322. package/mobile/dist/content-page-repository/resizeImg.js.map +0 -1
  323. package/mobile/dist/content-page-repository/transformAttachmentLink.d.ts +0 -3
  324. package/mobile/dist/content-page-repository/transformAttachmentLink.js +0 -40
  325. package/mobile/dist/content-page-repository/transformAttachmentLink.js.map +0 -1
  326. package/mobile/dist/content-page-repository/transformContentPage.d.ts +0 -4
  327. package/mobile/dist/content-page-repository/transformContentPage.js +0 -78
  328. package/mobile/dist/content-page-repository/transformContentPage.js.map +0 -1
  329. package/mobile/dist/content-page-repository/transformDocument.d.ts +0 -3
  330. package/mobile/dist/content-page-repository/transformDocument.js +0 -38
  331. package/mobile/dist/content-page-repository/transformDocument.js.map +0 -1
  332. package/mobile/dist/content-page-repository/transformHTML.d.ts +0 -1
  333. package/mobile/dist/content-page-repository/transformHTML.js +0 -54
  334. package/mobile/dist/content-page-repository/transformHTML.js.map +0 -1
  335. package/mobile/dist/content-page-repository/transformImg.d.ts +0 -12
  336. package/mobile/dist/content-page-repository/transformImg.js +0 -51
  337. package/mobile/dist/content-page-repository/transformImg.js.map +0 -1
  338. package/mobile/dist/content-page-repository/transformMarkdown.d.ts +0 -1
  339. package/mobile/dist/content-page-repository/transformMarkdown.js +0 -18
  340. package/mobile/dist/content-page-repository/transformMarkdown.js.map +0 -1
  341. package/mobile/dist/content-page-repository/transformPicture.d.ts +0 -3
  342. package/mobile/dist/content-page-repository/transformPicture.js +0 -28
  343. package/mobile/dist/content-page-repository/transformPicture.js.map +0 -1
  344. package/mobile/lib/components/ContentPage/computeAPIFallback.d.ts +0 -4
  345. package/mobile/lib/components/ContentPage/computeAPIFallback.js +0 -33
  346. package/mobile/lib/components/ContentPage/computeAPIFallback.js.map +0 -1
  347. package/mobile/lib/components/ContentPage/loadModuleFallback.d.ts +0 -2
  348. package/mobile/lib/components/ContentPage/loadModuleFallback.js +0 -10
  349. package/mobile/lib/components/ContentPage/loadModuleFallback.js.map +0 -1
  350. package/mobile/lib/components/ContentPage/mapSlot.d.ts +0 -2
  351. package/mobile/lib/components/ContentPage/mapSlot.js +0 -13
  352. package/mobile/lib/components/ContentPage/mapSlot.js.map +0 -1
  353. package/mobile/lib/components/ContentPage/normalizeBlock.d.ts +0 -3
  354. package/mobile/lib/components/ContentPage/normalizeBlock.js +0 -15
  355. package/mobile/lib/components/ContentPage/normalizeBlock.js.map +0 -1
  356. package/mobile/lib/components/ContentPage/normalizePage.d.ts +0 -3
  357. package/mobile/lib/components/ContentPage/normalizePage.js +0 -3
  358. package/mobile/lib/components/ContentPage/normalizePage.js.map +0 -1
  359. package/mobile/lib/components/ContentPage/toMobileBlock.d.ts +0 -2
  360. package/mobile/lib/components/ContentPage/toMobileBlock.js +0 -9
  361. package/mobile/lib/components/ContentPage/toMobileBlock.js.map +0 -1
  362. package/mobile/lib/content-page-repository/ContentPageRepository.d.ts +0 -10
  363. package/mobile/lib/content-page-repository/ContentPageRepository.js +0 -25
  364. package/mobile/lib/content-page-repository/ContentPageRepository.js.map +0 -1
  365. package/mobile/lib/content-page-repository/JSONDocContentBox.d.ts +0 -8
  366. package/mobile/lib/content-page-repository/JSONDocContentBox.js +0 -36
  367. package/mobile/lib/content-page-repository/JSONDocContentBox.js.map +0 -1
  368. package/mobile/lib/content-page-repository/TransformationOptions.d.ts +0 -4
  369. package/mobile/lib/content-page-repository/TransformationOptions.js +0 -2
  370. package/mobile/lib/content-page-repository/TransformationOptions.js.map +0 -1
  371. package/mobile/lib/content-page-repository/clearAttachmentHref.d.ts +0 -2
  372. package/mobile/lib/content-page-repository/clearAttachmentHref.js +0 -3
  373. package/mobile/lib/content-page-repository/clearAttachmentHref.js.map +0 -1
  374. package/mobile/lib/content-page-repository/computeImgOutputPath.d.ts +0 -3
  375. package/mobile/lib/content-page-repository/computeImgOutputPath.js +0 -12
  376. package/mobile/lib/content-page-repository/computeImgOutputPath.js.map +0 -1
  377. package/mobile/lib/content-page-repository/extensions.d.ts +0 -3
  378. package/mobile/lib/content-page-repository/extensions.js +0 -16
  379. package/mobile/lib/content-page-repository/extensions.js.map +0 -1
  380. package/mobile/lib/content-page-repository/index.d.ts +0 -3
  381. package/mobile/lib/content-page-repository/index.js +0 -4
  382. package/mobile/lib/content-page-repository/index.js.map +0 -1
  383. package/mobile/lib/content-page-repository/mapJSON.d.ts +0 -1
  384. package/mobile/lib/content-page-repository/mapJSON.js +0 -23
  385. package/mobile/lib/content-page-repository/mapJSON.js.map +0 -1
  386. package/mobile/lib/content-page-repository/mergePages.d.ts +0 -2
  387. package/mobile/lib/content-page-repository/mergePages.js +0 -4
  388. package/mobile/lib/content-page-repository/mergePages.js.map +0 -1
  389. package/mobile/lib/content-page-repository/replaceHeadingTags.d.ts +0 -1
  390. package/mobile/lib/content-page-repository/replaceHeadingTags.js +0 -2
  391. package/mobile/lib/content-page-repository/replaceHeadingTags.js.map +0 -1
  392. package/mobile/lib/content-page-repository/resizeImg.d.ts +0 -3
  393. package/mobile/lib/content-page-repository/resizeImg.js +0 -13
  394. package/mobile/lib/content-page-repository/resizeImg.js.map +0 -1
  395. package/mobile/lib/content-page-repository/transformAttachmentLink.d.ts +0 -3
  396. package/mobile/lib/content-page-repository/transformAttachmentLink.js +0 -34
  397. package/mobile/lib/content-page-repository/transformAttachmentLink.js.map +0 -1
  398. package/mobile/lib/content-page-repository/transformContentPage.d.ts +0 -4
  399. package/mobile/lib/content-page-repository/transformContentPage.js +0 -71
  400. package/mobile/lib/content-page-repository/transformContentPage.js.map +0 -1
  401. package/mobile/lib/content-page-repository/transformDocument.d.ts +0 -3
  402. package/mobile/lib/content-page-repository/transformDocument.js +0 -32
  403. package/mobile/lib/content-page-repository/transformDocument.js.map +0 -1
  404. package/mobile/lib/content-page-repository/transformHTML.d.ts +0 -1
  405. package/mobile/lib/content-page-repository/transformHTML.js +0 -25
  406. package/mobile/lib/content-page-repository/transformHTML.js.map +0 -1
  407. package/mobile/lib/content-page-repository/transformImg.d.ts +0 -12
  408. package/mobile/lib/content-page-repository/transformImg.js +0 -45
  409. package/mobile/lib/content-page-repository/transformImg.js.map +0 -1
  410. package/mobile/lib/content-page-repository/transformMarkdown.d.ts +0 -1
  411. package/mobile/lib/content-page-repository/transformMarkdown.js +0 -12
  412. package/mobile/lib/content-page-repository/transformMarkdown.js.map +0 -1
  413. package/mobile/lib/content-page-repository/transformPicture.d.ts +0 -3
  414. package/mobile/lib/content-page-repository/transformPicture.js +0 -22
  415. package/mobile/lib/content-page-repository/transformPicture.js.map +0 -1
  416. package/mobile/src/components/ContentPage/computeAPIFallback.ts +0 -67
  417. package/mobile/src/components/ContentPage/loadModuleFallback.ts +0 -11
  418. package/mobile/src/components/ContentPage/mapSlot.ts +0 -18
  419. package/mobile/src/components/ContentPage/normalizeBlock.ts +0 -25
  420. package/mobile/src/components/ContentPage/normalizePage.ts +0 -8
  421. package/mobile/src/components/ContentPage/toMobileBlock.ts +0 -11
  422. package/mobile/src/content-page-repository/ContentPageRepository.ts +0 -31
  423. package/mobile/src/content-page-repository/JSONDocContentBox.ts +0 -56
  424. package/mobile/src/content-page-repository/TransformationOptions.ts +0 -4
  425. package/mobile/src/content-page-repository/clearAttachmentHref.ts +0 -3
  426. package/mobile/src/content-page-repository/computeImgOutputPath.ts +0 -21
  427. package/mobile/src/content-page-repository/extensions.ts +0 -17
  428. package/mobile/src/content-page-repository/index.ts +0 -3
  429. package/mobile/src/content-page-repository/mapJSON.ts +0 -30
  430. package/mobile/src/content-page-repository/mergePages.ts +0 -8
  431. package/mobile/src/content-page-repository/replaceHeadingTags.ts +0 -2
  432. package/mobile/src/content-page-repository/resizeImg.ts +0 -17
  433. package/mobile/src/content-page-repository/transformAttachmentLink.ts +0 -46
  434. package/mobile/src/content-page-repository/transformContentPage.ts +0 -102
  435. package/mobile/src/content-page-repository/transformDocument.ts +0 -43
  436. package/mobile/src/content-page-repository/transformHTML.ts +0 -28
  437. package/mobile/src/content-page-repository/transformImg.ts +0 -81
  438. package/mobile/src/content-page-repository/transformMarkdown.ts +0 -14
  439. package/mobile/src/content-page-repository/transformPicture.ts +0 -35
  440. package/src/components/ContentPage/computeAPIFallback.ts +0 -67
  441. package/src/components/ContentPage/loadModuleFallback.ts +0 -11
  442. package/src/components/ContentPage/mapSlot.ts +0 -18
  443. package/src/components/ContentPage/normalizeBlock.mobile.ts +0 -25
  444. package/src/components/ContentPage/normalizeBlock.ts +0 -21
  445. package/src/components/ContentPage/normalizePage.ts +0 -8
  446. package/src/components/ContentPage/toMobileBlock.ts +0 -11
  447. package/src/content-page-repository/ContentPageRepository.ts +0 -31
  448. package/src/content-page-repository/JSONDocContentBox.ts +0 -56
  449. package/src/content-page-repository/TransformationOptions.ts +0 -4
  450. package/src/content-page-repository/clearAttachmentHref.ts +0 -3
  451. package/src/content-page-repository/computeImgOutputPath.ts +0 -21
  452. package/src/content-page-repository/extensions.ts +0 -17
  453. package/src/content-page-repository/index.ts +0 -3
  454. package/src/content-page-repository/mapJSON.ts +0 -30
  455. package/src/content-page-repository/mergePages.ts +0 -8
  456. package/src/content-page-repository/replaceHeadingTags.ts +0 -2
  457. package/src/content-page-repository/resizeImg.ts +0 -17
  458. package/src/content-page-repository/transformAttachmentLink.ts +0 -46
  459. package/src/content-page-repository/transformContentPage.ts +0 -102
  460. package/src/content-page-repository/transformDocument.ts +0 -43
  461. package/src/content-page-repository/transformHTML.ts +0 -28
  462. package/src/content-page-repository/transformImg.ts +0 -81
  463. package/src/content-page-repository/transformMarkdown.ts +0 -14
  464. package/src/content-page-repository/transformPicture.ts +0 -35
@@ -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;
@@ -1,9 +0,0 @@
1
- export function toMobileBlock(block = {}) {
2
- const { mobile, ...desktop } = block;
3
- return {
4
- ...desktop,
5
- ...(mobile?.style ? { style: mobile.style } : {}),
6
- ...(mobile?.content ? { content: mobile.content } : {}),
7
- };
8
- }
9
- //# sourceMappingURL=toMobileBlock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toMobileBlock.js","sourceRoot":"","sources":["../../../src/components/ContentPage/toMobileBlock.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,aAAa,CAAC,QAAkB,EAAE;IAChD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC;IAErC,OAAO;QACL,GAAG,OAAO;QACV,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACxD,CAAC;AACJ,CAAC"}
@@ -1,10 +0,0 @@
1
- import { type ContentPageDef } from '../model/ContentPageDef';
2
- import { type TransformationOptions } from './TransformationOptions';
3
- export declare class ContentPageRepository {
4
- private readonly options;
5
- static readonly inst: ContentPageRepository;
6
- constructor(options?: TransformationOptions);
7
- listAllContentPages(): Promise<string[]>;
8
- readPage(filePath: string): Promise<ContentPageDef>;
9
- generatePage(filePath: string): Promise<ContentPageDef>;
10
- }
@@ -1,25 +0,0 @@
1
- import fs from 'fs';
2
- import { glob } from 'glob';
3
- import util from 'util';
4
- import { generatedPagePath, transformContentPage } from './transformContentPage.js';
5
- const readFile = util.promisify(fs.readFile);
6
- export class ContentPageRepository {
7
- options;
8
- static inst = new ContentPageRepository();
9
- constructor(options = {
10
- contentDir: 'content',
11
- publicDir: 'public',
12
- }) {
13
- this.options = options;
14
- }
15
- listAllContentPages() {
16
- return glob(`${this.options.contentDir}/**/*.page.json`, { posix: true });
17
- }
18
- async readPage(filePath) {
19
- return JSON.parse(await readFile(generatedPagePath(filePath), 'utf-8'));
20
- }
21
- generatePage(filePath) {
22
- return transformContentPage(filePath, this.options);
23
- }
24
- }
25
- //# sourceMappingURL=ContentPageRepository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContentPageRepository.js","sourceRoot":"","sources":["../../src/content-page-repository/ContentPageRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEjF,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;AAE7C,MAAM,OAAO,qBAAqB;IAIb;IAHZ,MAAM,CAAU,IAAI,GAAG,IAAI,qBAAqB,EAAE,CAAC;IAE1D,YACmB,UAAiC;QAChD,UAAU,EAAE,SAAS;QACrB,SAAS,EAAE,QAAQ;KACpB;QAHgB,YAAO,GAAP,OAAO,CAGvB;IACA,CAAC;IAEJ,mBAAmB;QACjB,OAAO,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,iBAAiB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAgB;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,YAAY,CAAC,QAAgB;QAC3B,OAAO,oBAAoB,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC"}
@@ -1,8 +0,0 @@
1
- import { JSONBoxDefault, type JSONBox, type JSONNode } from '@redneckz/json-op';
2
- import { type JSONPathElement } from '@redneckz/json-op/lib/JSONPath';
3
- export declare class JSONDocContentBox extends JSONBoxDefault {
4
- size(): number;
5
- entries(): Array<[p: JSONPathElement, child: JSONBox]>;
6
- get(p?: JSONPathElement): JSONBox;
7
- set(p: JSONPathElement | undefined, child: JSONNode): JSONBox;
8
- }
@@ -1,36 +0,0 @@
1
- import { isJSONArray, isJSONRecord, JSONBoxDefault, } from '@redneckz/json-op';
2
- const isAtomicArray = (node) => isJSONArray(node) && !node.some(nodeId);
3
- const ID_PREFIX = 'id:';
4
- const nodeId = (node) => isJSONRecord(node) && '__id' in node ? node.__id : undefined;
5
- const keyToId = (p) => typeof p === 'string' && p.startsWith(ID_PREFIX) ? p.substring(ID_PREFIX.length) : undefined;
6
- const findIndexById = (_, id) => id && isJSONArray(_) ? _.findIndex((node) => id === nodeId(node)) : -1;
7
- export class JSONDocContentBox extends JSONBoxDefault {
8
- size() {
9
- return isAtomicArray(this._) ? 0 : super.size();
10
- }
11
- entries() {
12
- if (isAtomicArray(this._)) {
13
- return [];
14
- }
15
- else if (isJSONArray(this._)) {
16
- return this._.map((node, i) => [
17
- nodeId(node) ? `${ID_PREFIX}${nodeId(node)}` : i,
18
- new JSONDocContentBox(node),
19
- ]);
20
- }
21
- else {
22
- return super.entries();
23
- }
24
- }
25
- get(p) {
26
- const id = keyToId(p);
27
- return super.get(id ? findIndexById(this._, id) : p);
28
- }
29
- set(p, child) {
30
- const id = keyToId(p);
31
- const index = findIndexById(this._, id);
32
- const adjustedIndex = index >= 0 ? index : this.size();
33
- return super.set(id ? adjustedIndex : p, id ? { ...child, __id: id } : child);
34
- }
35
- }
36
- //# sourceMappingURL=JSONDocContentBox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"JSONDocContentBox.js","sourceRoot":"","sources":["../../src/content-page-repository/JSONDocContentBox.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,cAAc,GAIf,MAAM,mBAAmB,CAAC;AAG3B,MAAM,aAAa,GAAG,CAAC,IAA0B,EAAW,EAAE,CAC5D,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAE1C,MAAM,SAAS,GAAG,KAAK,CAAC;AAExB,MAAM,MAAM,GAAG,CAAC,IAA0B,EAAsB,EAAE,CAChE,YAAY,CAAC,IAAI,CAAC,IAAI,MAAM,IAAI,IAAI,CAAC,CAAC,CAAE,IAAI,CAAC,IAAe,CAAC,CAAC,CAAC,SAAS,CAAC;AAE3E,MAAM,OAAO,GAAG,CAAC,CAA8B,EAAsB,EAAE,CACrE,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAE/F,MAAM,aAAa,GA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C;QACtB,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACxC,MAAM,aAAa,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAEvD,OAAO,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,GAAI,KAAoB,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAChG,CAAC;CACF"}
@@ -1,4 +0,0 @@
1
- export interface TransformationOptions {
2
- contentDir: string;
3
- publicDir: string;
4
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=TransformationOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TransformationOptions.js","sourceRoot":"","sources":["../../src/content-page-repository/TransformationOptions.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export declare const ATTACHMENT_PREFIX = "file://";
2
- export declare const clearAttachmentHref: (href: string) => string;
@@ -1,3 +0,0 @@
1
- export const ATTACHMENT_PREFIX = 'file://';
2
- export const clearAttachmentHref = (href) => href.replace(ATTACHMENT_PREFIX, '');
3
- //# sourceMappingURL=clearAttachmentHref.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clearAttachmentHref.js","sourceRoot":"","sources":["../../src/content-page-repository/clearAttachmentHref.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAE3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { type ImgSource } from '../model/Picture';
2
- import { type TransformationOptions } from './TransformationOptions';
3
- export declare function computeImgOutputPath(imgInputPath: string, { contentDir, publicDir, format, size }: TransformationOptions & ImgSource, withoutTransform?: boolean): string;
@@ -1,12 +0,0 @@
1
- import path from 'path';
2
- export function computeImgOutputPath(imgInputPath, { contentDir, publicDir, format, size }, withoutTransform = false) {
3
- const imgRelativePath = path.relative(contentDir, imgInputPath);
4
- const imgDir = path.dirname(imgRelativePath);
5
- const inputExt = path.extname(imgRelativePath);
6
- const fileName = path.basename(imgRelativePath, inputExt);
7
- const suffixParts = [size?.width, size?.height].filter(Boolean);
8
- const suffix = suffixParts.length && !withoutTransform ? `-${suffixParts.join('-')}` : '';
9
- const ext = format && !withoutTransform ? `.${format}` : inputExt;
10
- return path.join(publicDir, imgDir, `${fileName}${suffix}${ext}`);
11
- }
12
- //# sourceMappingURL=computeImgOutputPath.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"computeImgOutputPath.js","sourceRoot":"","sources":["../../src/content-page-repository/computeImgOutputPath.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB,MAAM,UAAU,oBAAoB,CAClC,YAAoB,EACpB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAqC,EAC1E,gBAAgB,GAAG,KAAK;IAExB,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAEhE,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAE7C,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;IAC1D,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1F,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;IAElE,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,QAAQ,GAAG,MAAM,GAAG,GAAG,EAAE,CAAC,CAAC;AACpE,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare const OUTPUT_SUFFIX = ".static";
2
- export declare const DOCUMENT_EXT_LIST: string[];
3
- export declare const IMAGE_EXT_LIST: string[];
@@ -1,16 +0,0 @@
1
- export const OUTPUT_SUFFIX = '.static';
2
- export const DOCUMENT_EXT_LIST = [
3
- '.txt',
4
- '.doc',
5
- '.docx',
6
- '.xls',
7
- '.xlsx',
8
- '.xlsb',
9
- '.ppt',
10
- '.pptx',
11
- '.pdf',
12
- '.zip',
13
- '.7z',
14
- ];
15
- export const IMAGE_EXT_LIST = ['.jpeg', '.jpg', '.png', '.gif', '.webp', '.heif', '.avif', '.svg'];
16
- //# sourceMappingURL=extensions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extensions.js","sourceRoot":"","sources":["../../src/content-page-repository/extensions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AAEvC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,KAAK;CACN,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- export { clearAttachmentHref } from './clearAttachmentHref';
2
- export { ContentPageRepository } from './ContentPageRepository';
3
- export { transformContentPage } from './transformContentPage';
@@ -1,4 +0,0 @@
1
- export { clearAttachmentHref } from './clearAttachmentHref.js';
2
- export { ContentPageRepository } from './ContentPageRepository.js';
3
- export { transformContentPage } from './transformContentPage.js';
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/content-page-repository/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1 +0,0 @@
1
- export declare function mapJSON<T>(data: T, mapper: <In, Out = In>(value: In, key: string[]) => Promise<Out>, keyParts?: string[]): Promise<T>;
@@ -1,23 +0,0 @@
1
- export async function mapJSON(data, mapper, keyParts = []) {
2
- if (data === null || data === undefined) {
3
- return data;
4
- }
5
- const mappedData = await mapper(data, keyParts);
6
- if (mappedData !== data) {
7
- return mappedData;
8
- }
9
- if (Array.isArray(data)) {
10
- const values = data.map((_, i) => mapJSON(_, mapper, [String(i)].concat(keyParts)));
11
- return Promise.all(values);
12
- }
13
- else if (typeof data === 'object' && data.toString() === '[object Object]') {
14
- const subKeys = Object.keys(data);
15
- const values = subKeys.map((k) => mapJSON(data[k], mapper, [k].concat(keyParts)));
16
- const pairs = (await Promise.all(values)).map((_, i) => ({
17
- [subKeys[i]]: _,
18
- }));
19
- return Object.assign({}, ...pairs);
20
- }
21
- return mapper(data, keyParts);
22
- }
23
- //# sourceMappingURL=mapJSON.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mapJSON.js","sourceRoot":"","sources":["../../src/content-page-repository/mapJSON.ts"],"names":[],"mappings":"AAAA,MA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AAM,CAAC,EAAE,EAAE,GAAG,KAAK,CAAC,CAAC;KACpC;IAED,OAAO,MAAM,CAAI,IAAI,EAAE,QAAQ,CAAC,CAAC;AACnC,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type JSONRecord } from '@redneckz/json-op';
2
- export declare const mergePages: (page: JSONRecord, diffs: JSONRecord) => JSONRecord;
@@ -1,4 +0,0 @@
1
- import { leafs, merge } from '@redneckz/json-op';
2
- import { JSONDocContentBox } from './JSONDocContentBox.js';
3
- export const mergePages = (page, diffs) => merge(new JSONDocContentBox(page), leafs(new JSONDocContentBox(diffs)));
4
- //# sourceMappingURL=mergePages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mergePages.js","sourceRoot":"","sources":["../../src/content-page-repository/mergePages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAmB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAgB,EAAE,KAAiB,EAAc,EAAE,CAC5E,KAAK,CACH,IAAI,iBAAiB,CAAC,IAAkB,CAAC,EACzC,KAAK,CAAC,IAAI,iBAAiB,CAAC,KAAmB,CAAC,CAAC,CACpC,CAAC"}
@@ -1 +0,0 @@
1
- export declare const replaceHeadingTags: (html: string) => string;
@@ -1,2 +0,0 @@
1
- export const replaceHeadingTags = (html) => html.replaceAll(/<h(\d)>(.*?)<\/h\d>/g, '<p class="h$1">$2</p>');
2
- //# sourceMappingURL=replaceHeadingTags.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replaceHeadingTags.js","sourceRoot":"","sources":["../../src/content-page-repository/replaceHeadingTags.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAE,EAAE,CACjD,IAAI,CAAC,UAAU,CAAC,sBAAsB,EAAE,uBAAuB,CAAC,CAAC"}
@@ -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,13 +0,0 @@
1
- import sharp from 'sharp';
2
- export const resizeImg = (size, options) => (chain) => size
3
- ? chain.resize(size.width || null, size.height || null, {
4
- /*
5
- * Editor behaviour with one dimension present: resize by given dimension maintaining aspect ratio. (fit: contain)
6
- * With two dimensions present: resize trying to fill given dimensions (fit: fill)
7
- */
8
- fit: size.width && size.height ? sharp.fit.fill : sharp.fit.contain,
9
- background: { r: 0, g: 0, b: 0, alpha: 0 },
10
- ...options,
11
- })
12
- : chain;
13
- //# sourceMappingURL=resizeImg.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resizeImg.js","sourceRoot":"","sources":["../../src/content-page-repository/resizeImg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAG9D,MAAM,CAAC,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,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,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"}
@@ -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,34 +0,0 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- import util from 'util';
4
- import { isUUID } from '../utils/isUUID.js';
5
- import { clearAttachmentHref } from './clearAttachmentHref.js';
6
- const mkdir = util.promisify(fs.mkdir);
7
- const copyFile = util.promisify(fs.copyFile);
8
- export async function transformAttachmentLink(link, pagePath, options) {
9
- if (!link?.href) {
10
- return link;
11
- }
12
- try {
13
- return {
14
- ...link,
15
- href: await transformHref(clearAttachmentHref(link.href), options),
16
- };
17
- }
18
- catch (e) {
19
- console.info(`No "${link.href}" attachment found on page: "${pagePath}"`);
20
- return link;
21
- }
22
- }
23
- async function transformHref(input, options) {
24
- if (isUUID(input)) {
25
- return input;
26
- }
27
- const { contentDir, publicDir } = options;
28
- const docRelativePath = path.relative(contentDir, input);
29
- const output = path.join(publicDir, docRelativePath);
30
- await mkdir(path.dirname(output), { recursive: true });
31
- await copyFile(input, output);
32
- return path.join('/', docRelativePath);
33
- }
34
- //# sourceMappingURL=transformAttachmentLink.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformAttachmentLink.js","sourceRoot":"","sources":["../../src/content-page-repository/transformAttachmentLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;AAE7C,MAAM,CAAC,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,mBAAmB,CAAC,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;AAED,KAAK,UAAU,aAAa,CAAC,KAAa,EAAE,OAA8B;IACxE,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE;QACjB,OAAO,KAAK,CAAC;KACd;IAED,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAC1C,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;IAErD,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,MAAM,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAE9B,OAAO,IAAI,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,71 +0,0 @@
1
- import fs from 'fs';
2
- import util from 'util';
3
- import { isUUID } from '../utils/isUUID.js';
4
- import { tableFunc } from '../utils/tableFunc.js';
5
- import { ATTACHMENT_PREFIX } from './clearAttachmentHref.js';
6
- import { DOCUMENT_EXT_LIST, IMAGE_EXT_LIST, OUTPUT_SUFFIX } from './extensions.js';
7
- import { mapJSON } from './mapJSON.js';
8
- import { mergePages } from './mergePages.js';
9
- import { transformAttachmentLink } from './transformAttachmentLink.js';
10
- import { transformDocument } from './transformDocument.js';
11
- import { transformHTML } from './transformHTML.js';
12
- import { transformMarkdown } from './transformMarkdown.js';
13
- import { transformPicture } from './transformPicture.js';
14
- const readFile = util.promisify(fs.readFile);
15
- const writeFile = util.promisify(fs.writeFile);
16
- const DEFAULT_PARENT_CONTENT = {};
17
- export async function transformContentPage(pagePath, options) {
18
- const content = JSON.parse(await readFile(pagePath, 'utf8'));
19
- const parentContent = await (content?._extends
20
- ? JSON.parse(await readFile(content._extends, 'utf-8'))
21
- : DEFAULT_PARENT_CONTENT);
22
- const mergedContent = mergePages(parentContent, content);
23
- const result = await mapJSON(mergedContent, async (value, [key]) => {
24
- try {
25
- return await transform([value, key])(value, pagePath, options);
26
- }
27
- catch (ex) {
28
- console.warn(`Error while transforming field "${key}" on page: ${pagePath}`);
29
- console.error(ex);
30
- }
31
- return value;
32
- });
33
- await writeFile(generatedPagePath(pagePath), JSON.stringify(result), 'utf-8');
34
- return result;
35
- }
36
- const transform = tableFunc([
37
- [([value, key]) => isMarkdown(key, value), async (value) => transformMarkdown(value)],
38
- [([value, key]) => isHTML(key, value), async (value) => transformHTML(value)],
39
- [([value]) => isUUID(value?.src), async (value) => ({ src: value?.src })],
40
- [
41
- ([value]) => isAttachmentLink(value),
42
- async (value, pagePath, options) => transformAttachmentLink(value, pagePath, options),
43
- ],
44
- [
45
- ([value]) => isAttachmentFile(value, DOCUMENT_EXT_LIST),
46
- async (value, pagePath, options) => transformDocument(value, pagePath, options),
47
- ],
48
- [
49
- ([value]) => isAttachmentFile(value, IMAGE_EXT_LIST),
50
- async (value, pagePath, options) => transformPicture(value, pagePath, options),
51
- ],
52
- [() => true, async (value) => value],
53
- ]);
54
- export const generatedPagePath = (pagePath) => `${pagePath}${OUTPUT_SUFFIX}`;
55
- const isMarkdown = (key, value) => isString(value) && key?.endsWith('__md');
56
- const isHTML = (key, value) => isString(value) && key?.endsWith('__html');
57
- const isAttachmentLink = (_) => isLocalPath(_?.href) && (_.href.startsWith(ATTACHMENT_PREFIX) || isLocalFile(_.href));
58
- const isAttachmentFile = (_, exts) => Boolean(_ && isLocalPath(_?.src)) && exts.some((ext) => _.src.toLowerCase().endsWith(ext));
59
- const isLocalPath = (_) => isString(_) && _.length < 1024 && !isURL(_);
60
- const isURL = (src) => ['data:', 'https:', 'http:'].some((proto) => src.startsWith(proto));
61
- const isString = (_) => Boolean(_ && typeof _ === 'string');
62
- const isLocalFile = (_) => isString(_) && isFileExists(_);
63
- const isFileExists = (_) => {
64
- try {
65
- return fs.statSync(_).isFile();
66
- }
67
- catch (ex) {
68
- return false;
69
- }
70
- };
71
- //# sourceMappingURL=transformContentPage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformContentPage.js","sourceRoot":"","sources":["../../src/content-page-repository/transformContentPage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAKxB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE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,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACzF,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;AAEnG,MAAM,QAAQ,GAAG,CAAC,CAAM,EAAe,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;AAE9E,MAAM,WAAW,GAAG,CAAC,CAAM,EAAe,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;AAE5E,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE;IACjC,IAAI;QACF,OAAO,EAAE,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,32 +0,0 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- import util from 'util';
4
- import { isUUID } from '../utils/isUUID.js';
5
- const mkdir = util.promisify(fs.mkdir);
6
- const copyFile = util.promisify(fs.copyFile);
7
- const stat = util.promisify(fs.stat);
8
- export async function transformDocument(attachment, pagePath, options) {
9
- if (!attachment?.src || isUUID(attachment.src)) {
10
- return attachment;
11
- }
12
- const { contentDir, publicDir } = options;
13
- const input = attachment.src;
14
- const docRelativePath = path.relative(contentDir, input);
15
- const output = path.join(publicDir, docRelativePath);
16
- const inputFileSize = (await stat(input)).size;
17
- try {
18
- await mkdir(path.dirname(output), { recursive: true });
19
- await copyFile(input, output);
20
- }
21
- catch (e) {
22
- console.info(`No "${input}" attachment found on page: "${pagePath}"`);
23
- return attachment;
24
- }
25
- const src = path.join('/', docRelativePath);
26
- return {
27
- ...attachment,
28
- src,
29
- fileSize: inputFileSize,
30
- };
31
- }
32
- //# sourceMappingURL=transformDocument.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformDocument.js","sourceRoot":"","sources":["../../src/content-page-repository/transformDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;AAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAErC,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,UAAsB,EACtB,QAAgB,EAChB,OAA8B;IAE9B,IAAI,CAAC,UAAU,EAAE,GAAG,IAAI,MAAM,CAAC,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,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,IAAI,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,IAAI,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,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAE5C,OAAO;QACL,GAAG,UAAU;QACb,GAAG;QACH,QAAQ,EAAE,aAAa;KACxB,CAAC;AACJ,CAAC"}
@@ -1 +0,0 @@
1
- export declare function transformHTML(html: string | null | undefined): Promise<string>;
@@ -1,25 +0,0 @@
1
- import rehypeParse from 'rehype-parse';
2
- import rehypeSanitize, { defaultSchema } from 'rehype-sanitize';
3
- import rehypeStringify from 'rehype-stringify';
4
- import { unified } from 'unified';
5
- import { replaceHeadingTags } from './replaceHeadingTags.js';
6
- export async function transformHTML(html) {
7
- if (!html) {
8
- return '';
9
- }
10
- const extendedSchema = {
11
- ...defaultSchema,
12
- protocols: {
13
- ...defaultSchema.protocols,
14
- href: [...(defaultSchema?.protocols?.href || []), 'tel'],
15
- src: [...(defaultSchema.protocols?.src ?? []), 'data'],
16
- },
17
- };
18
- const result = await unified()
19
- .use(rehypeParse)
20
- .use(rehypeSanitize, extendedSchema)
21
- .use(rehypeStringify)
22
- .process(html);
23
- return replaceHeadingTags(result.toString('utf-8'));
24
- }
25
- //# sourceMappingURL=transformHTML.js.map