@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.
- package/README.md +13 -5
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +14 -20
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/icons/IconName.d.ts +2 -2
- package/bundle/model/Fallback.d.ts +0 -1
- package/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/dist/components/TabsLayout/TabsLayout.js +13 -15
- package/dist/components/TabsLayout/TabsLayout.js.map +1 -1
- package/dist/icons/IconName.d.ts +2 -2
- package/dist/icons/IconName.js +1 -1
- package/dist/icons/IconName.js.map +1 -1
- package/dist/model/Fallback.d.ts +0 -1
- package/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
- package/lib/components/ApplicationForm/ApplicationForm.fixture.mobile.d.ts +1 -0
- package/lib/components/TabsLayout/TabsLayout.js +14 -16
- package/lib/components/TabsLayout/TabsLayout.js.map +1 -1
- package/lib/icons/IconName.d.ts +2 -2
- package/lib/icons/IconName.js +1 -1
- package/lib/icons/IconName.js.map +1 -1
- package/lib/model/Fallback.d.ts +0 -1
- package/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/lib/retail/components/DraftDialog/utils.d.ts +3 -3
- package/mobile/bundle/bundle.umd.js +14 -20
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/icons/IconName.d.ts +2 -2
- package/mobile/bundle/model/Fallback.d.ts +0 -1
- package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/dist/components/TabsLayout/TabsLayout.js +13 -15
- package/mobile/dist/components/TabsLayout/TabsLayout.js.map +1 -1
- package/mobile/dist/icons/IconName.d.ts +2 -2
- package/mobile/dist/icons/IconName.js +1 -1
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/model/Fallback.d.ts +0 -1
- package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/TabsLayout/TabsLayout.js +14 -16
- package/mobile/lib/components/TabsLayout/TabsLayout.js.map +1 -1
- package/mobile/lib/icons/IconName.d.ts +2 -2
- package/mobile/lib/icons/IconName.js +1 -1
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/model/Fallback.d.ts +0 -1
- package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +30 -0
- package/mobile/src/components/TabsLayout/TabsLayout.tsx +19 -23
- package/mobile/src/icons/IconName.ts +2 -2
- package/mobile/src/icons/PercentIcon.svg +1 -1
- package/mobile/src/model/Fallback.ts +0 -1
- package/mobile/src/model/FormTypeFieldDef.ts +1 -0
- package/package.json +1 -21
- package/src/components/ApplicationForm/ApplicationForm.example.json +30 -0
- package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +23 -0
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +23 -0
- package/src/components/ContentPage/ContentPage.fixture.mobile.tsx +1 -4
- package/src/components/ContentPage/ContentPage.fixture.tsx +2 -7
- package/src/components/TabsLayout/TabsLayout.tsx +19 -23
- package/src/icons/IconName.ts +2 -2
- package/src/icons/PercentIcon.svg +1 -1
- package/src/model/Fallback.ts +0 -1
- package/src/model/FormTypeFieldDef.ts +1 -0
- package/bundle/components/ContentPage/computeAPIFallback.d.ts +0 -4
- package/bundle/components/ContentPage/loadModuleFallback.d.ts +0 -2
- package/bundle/components/ContentPage/mapSlot.d.ts +0 -2
- package/bundle/components/ContentPage/normalizeBlock.d.ts +0 -3
- package/bundle/components/ContentPage/normalizeBlock.mobile.d.ts +0 -3
- package/bundle/components/ContentPage/normalizePage.d.ts +0 -3
- package/bundle/components/ContentPage/toMobileBlock.d.ts +0 -2
- package/bundle/content-page-repository/ContentPageRepository.d.ts +0 -10
- package/bundle/content-page-repository/JSONDocContentBox.d.ts +0 -8
- package/bundle/content-page-repository/TransformationOptions.d.ts +0 -4
- package/bundle/content-page-repository/clearAttachmentHref.d.ts +0 -2
- package/bundle/content-page-repository/computeImgOutputPath.d.ts +0 -3
- package/bundle/content-page-repository/extensions.d.ts +0 -3
- package/bundle/content-page-repository/index.d.ts +0 -3
- package/bundle/content-page-repository/mapJSON.d.ts +0 -1
- package/bundle/content-page-repository/mergePages.d.ts +0 -2
- package/bundle/content-page-repository/replaceHeadingTags.d.ts +0 -1
- package/bundle/content-page-repository/resizeImg.d.ts +0 -3
- package/bundle/content-page-repository/transformAttachmentLink.d.ts +0 -3
- package/bundle/content-page-repository/transformContentPage.d.ts +0 -4
- package/bundle/content-page-repository/transformDocument.d.ts +0 -3
- package/bundle/content-page-repository/transformHTML.d.ts +0 -1
- package/bundle/content-page-repository/transformImg.d.ts +0 -12
- package/bundle/content-page-repository/transformMarkdown.d.ts +0 -1
- package/bundle/content-page-repository/transformPicture.d.ts +0 -3
- package/dist/components/ContentPage/computeAPIFallback.d.ts +0 -4
- package/dist/components/ContentPage/computeAPIFallback.js +0 -36
- package/dist/components/ContentPage/computeAPIFallback.js.map +0 -1
- package/dist/components/ContentPage/loadModuleFallback.d.ts +0 -2
- package/dist/components/ContentPage/loadModuleFallback.js +0 -36
- package/dist/components/ContentPage/loadModuleFallback.js.map +0 -1
- package/dist/components/ContentPage/mapSlot.d.ts +0 -2
- package/dist/components/ContentPage/mapSlot.js +0 -16
- package/dist/components/ContentPage/mapSlot.js.map +0 -1
- package/dist/components/ContentPage/normalizeBlock.d.ts +0 -3
- package/dist/components/ContentPage/normalizeBlock.js +0 -15
- package/dist/components/ContentPage/normalizeBlock.js.map +0 -1
- package/dist/components/ContentPage/normalizeBlock.mobile.d.ts +0 -3
- package/dist/components/ContentPage/normalizeBlock.mobile.js +0 -18
- package/dist/components/ContentPage/normalizeBlock.mobile.js.map +0 -1
- package/dist/components/ContentPage/normalizePage.d.ts +0 -3
- package/dist/components/ContentPage/normalizePage.js +0 -6
- package/dist/components/ContentPage/normalizePage.js.map +0 -1
- package/dist/components/ContentPage/toMobileBlock.d.ts +0 -2
- package/dist/components/ContentPage/toMobileBlock.js +0 -12
- package/dist/components/ContentPage/toMobileBlock.js.map +0 -1
- package/dist/content-page-repository/ContentPageRepository.d.ts +0 -10
- package/dist/content-page-repository/ContentPageRepository.js +0 -31
- package/dist/content-page-repository/ContentPageRepository.js.map +0 -1
- package/dist/content-page-repository/JSONDocContentBox.d.ts +0 -8
- package/dist/content-page-repository/JSONDocContentBox.js +0 -39
- package/dist/content-page-repository/JSONDocContentBox.js.map +0 -1
- package/dist/content-page-repository/TransformationOptions.d.ts +0 -4
- package/dist/content-page-repository/TransformationOptions.js +0 -2
- package/dist/content-page-repository/TransformationOptions.js.map +0 -1
- package/dist/content-page-repository/clearAttachmentHref.d.ts +0 -2
- package/dist/content-page-repository/clearAttachmentHref.js +0 -6
- package/dist/content-page-repository/clearAttachmentHref.js.map +0 -1
- package/dist/content-page-repository/computeImgOutputPath.d.ts +0 -3
- package/dist/content-page-repository/computeImgOutputPath.js +0 -18
- package/dist/content-page-repository/computeImgOutputPath.js.map +0 -1
- package/dist/content-page-repository/extensions.d.ts +0 -3
- package/dist/content-page-repository/extensions.js +0 -18
- package/dist/content-page-repository/extensions.js.map +0 -1
- package/dist/content-page-repository/index.d.ts +0 -3
- package/dist/content-page-repository/index.js +0 -9
- package/dist/content-page-repository/index.js.map +0 -1
- package/dist/content-page-repository/mapJSON.d.ts +0 -1
- package/dist/content-page-repository/mapJSON.js +0 -26
- package/dist/content-page-repository/mapJSON.js.map +0 -1
- package/dist/content-page-repository/mergePages.d.ts +0 -2
- package/dist/content-page-repository/mergePages.js +0 -7
- package/dist/content-page-repository/mergePages.js.map +0 -1
- package/dist/content-page-repository/replaceHeadingTags.d.ts +0 -1
- package/dist/content-page-repository/replaceHeadingTags.js +0 -5
- package/dist/content-page-repository/replaceHeadingTags.js.map +0 -1
- package/dist/content-page-repository/resizeImg.d.ts +0 -3
- package/dist/content-page-repository/resizeImg.js +0 -19
- package/dist/content-page-repository/resizeImg.js.map +0 -1
- package/dist/content-page-repository/transformAttachmentLink.d.ts +0 -3
- package/dist/content-page-repository/transformAttachmentLink.js +0 -40
- package/dist/content-page-repository/transformAttachmentLink.js.map +0 -1
- package/dist/content-page-repository/transformContentPage.d.ts +0 -4
- package/dist/content-page-repository/transformContentPage.js +0 -78
- package/dist/content-page-repository/transformContentPage.js.map +0 -1
- package/dist/content-page-repository/transformDocument.d.ts +0 -3
- package/dist/content-page-repository/transformDocument.js +0 -38
- package/dist/content-page-repository/transformDocument.js.map +0 -1
- package/dist/content-page-repository/transformHTML.d.ts +0 -1
- package/dist/content-page-repository/transformHTML.js +0 -54
- package/dist/content-page-repository/transformHTML.js.map +0 -1
- package/dist/content-page-repository/transformImg.d.ts +0 -12
- package/dist/content-page-repository/transformImg.js +0 -51
- package/dist/content-page-repository/transformImg.js.map +0 -1
- package/dist/content-page-repository/transformMarkdown.d.ts +0 -1
- package/dist/content-page-repository/transformMarkdown.js +0 -18
- package/dist/content-page-repository/transformMarkdown.js.map +0 -1
- package/dist/content-page-repository/transformPicture.d.ts +0 -3
- package/dist/content-page-repository/transformPicture.js +0 -28
- package/dist/content-page-repository/transformPicture.js.map +0 -1
- package/lib/components/ContentPage/computeAPIFallback.d.ts +0 -4
- package/lib/components/ContentPage/computeAPIFallback.js +0 -33
- package/lib/components/ContentPage/computeAPIFallback.js.map +0 -1
- package/lib/components/ContentPage/loadModuleFallback.d.ts +0 -2
- package/lib/components/ContentPage/loadModuleFallback.js +0 -10
- package/lib/components/ContentPage/loadModuleFallback.js.map +0 -1
- package/lib/components/ContentPage/mapSlot.d.ts +0 -2
- package/lib/components/ContentPage/mapSlot.js +0 -13
- package/lib/components/ContentPage/mapSlot.js.map +0 -1
- package/lib/components/ContentPage/normalizeBlock.d.ts +0 -3
- package/lib/components/ContentPage/normalizeBlock.js +0 -12
- package/lib/components/ContentPage/normalizeBlock.js.map +0 -1
- package/lib/components/ContentPage/normalizeBlock.mobile.d.ts +0 -3
- package/lib/components/ContentPage/normalizeBlock.mobile.js +0 -15
- package/lib/components/ContentPage/normalizeBlock.mobile.js.map +0 -1
- package/lib/components/ContentPage/normalizePage.d.ts +0 -3
- package/lib/components/ContentPage/normalizePage.js +0 -3
- package/lib/components/ContentPage/normalizePage.js.map +0 -1
- package/lib/components/ContentPage/toMobileBlock.d.ts +0 -2
- package/lib/components/ContentPage/toMobileBlock.js +0 -9
- package/lib/components/ContentPage/toMobileBlock.js.map +0 -1
- package/lib/content-page-repository/ContentPageRepository.d.ts +0 -10
- package/lib/content-page-repository/ContentPageRepository.js +0 -25
- package/lib/content-page-repository/ContentPageRepository.js.map +0 -1
- package/lib/content-page-repository/JSONDocContentBox.d.ts +0 -8
- package/lib/content-page-repository/JSONDocContentBox.js +0 -36
- package/lib/content-page-repository/JSONDocContentBox.js.map +0 -1
- package/lib/content-page-repository/TransformationOptions.d.ts +0 -4
- package/lib/content-page-repository/TransformationOptions.js +0 -2
- package/lib/content-page-repository/TransformationOptions.js.map +0 -1
- package/lib/content-page-repository/clearAttachmentHref.d.ts +0 -2
- package/lib/content-page-repository/clearAttachmentHref.js +0 -3
- package/lib/content-page-repository/clearAttachmentHref.js.map +0 -1
- package/lib/content-page-repository/computeImgOutputPath.d.ts +0 -3
- package/lib/content-page-repository/computeImgOutputPath.js +0 -12
- package/lib/content-page-repository/computeImgOutputPath.js.map +0 -1
- package/lib/content-page-repository/extensions.d.ts +0 -3
- package/lib/content-page-repository/extensions.js +0 -16
- package/lib/content-page-repository/extensions.js.map +0 -1
- package/lib/content-page-repository/index.d.ts +0 -3
- package/lib/content-page-repository/index.js +0 -4
- package/lib/content-page-repository/index.js.map +0 -1
- package/lib/content-page-repository/mapJSON.d.ts +0 -1
- package/lib/content-page-repository/mapJSON.js +0 -23
- package/lib/content-page-repository/mapJSON.js.map +0 -1
- package/lib/content-page-repository/mergePages.d.ts +0 -2
- package/lib/content-page-repository/mergePages.js +0 -4
- package/lib/content-page-repository/mergePages.js.map +0 -1
- package/lib/content-page-repository/replaceHeadingTags.d.ts +0 -1
- package/lib/content-page-repository/replaceHeadingTags.js +0 -2
- package/lib/content-page-repository/replaceHeadingTags.js.map +0 -1
- package/lib/content-page-repository/resizeImg.d.ts +0 -3
- package/lib/content-page-repository/resizeImg.js +0 -13
- package/lib/content-page-repository/resizeImg.js.map +0 -1
- package/lib/content-page-repository/transformAttachmentLink.d.ts +0 -3
- package/lib/content-page-repository/transformAttachmentLink.js +0 -34
- package/lib/content-page-repository/transformAttachmentLink.js.map +0 -1
- package/lib/content-page-repository/transformContentPage.d.ts +0 -4
- package/lib/content-page-repository/transformContentPage.js +0 -71
- package/lib/content-page-repository/transformContentPage.js.map +0 -1
- package/lib/content-page-repository/transformDocument.d.ts +0 -3
- package/lib/content-page-repository/transformDocument.js +0 -32
- package/lib/content-page-repository/transformDocument.js.map +0 -1
- package/lib/content-page-repository/transformHTML.d.ts +0 -1
- package/lib/content-page-repository/transformHTML.js +0 -25
- package/lib/content-page-repository/transformHTML.js.map +0 -1
- package/lib/content-page-repository/transformImg.d.ts +0 -12
- package/lib/content-page-repository/transformImg.js +0 -45
- package/lib/content-page-repository/transformImg.js.map +0 -1
- package/lib/content-page-repository/transformMarkdown.d.ts +0 -1
- package/lib/content-page-repository/transformMarkdown.js +0 -12
- package/lib/content-page-repository/transformMarkdown.js.map +0 -1
- package/lib/content-page-repository/transformPicture.d.ts +0 -3
- package/lib/content-page-repository/transformPicture.js +0 -22
- package/lib/content-page-repository/transformPicture.js.map +0 -1
- package/mobile/bundle/components/ContentPage/computeAPIFallback.d.ts +0 -4
- package/mobile/bundle/components/ContentPage/loadModuleFallback.d.ts +0 -2
- package/mobile/bundle/components/ContentPage/mapSlot.d.ts +0 -2
- package/mobile/bundle/components/ContentPage/normalizeBlock.d.ts +0 -3
- package/mobile/bundle/components/ContentPage/normalizePage.d.ts +0 -3
- package/mobile/bundle/components/ContentPage/toMobileBlock.d.ts +0 -2
- package/mobile/bundle/content-page-repository/ContentPageRepository.d.ts +0 -10
- package/mobile/bundle/content-page-repository/JSONDocContentBox.d.ts +0 -8
- package/mobile/bundle/content-page-repository/TransformationOptions.d.ts +0 -4
- package/mobile/bundle/content-page-repository/clearAttachmentHref.d.ts +0 -2
- package/mobile/bundle/content-page-repository/computeImgOutputPath.d.ts +0 -3
- package/mobile/bundle/content-page-repository/extensions.d.ts +0 -3
- package/mobile/bundle/content-page-repository/index.d.ts +0 -3
- package/mobile/bundle/content-page-repository/mapJSON.d.ts +0 -1
- package/mobile/bundle/content-page-repository/mergePages.d.ts +0 -2
- package/mobile/bundle/content-page-repository/replaceHeadingTags.d.ts +0 -1
- package/mobile/bundle/content-page-repository/resizeImg.d.ts +0 -3
- package/mobile/bundle/content-page-repository/transformAttachmentLink.d.ts +0 -3
- package/mobile/bundle/content-page-repository/transformContentPage.d.ts +0 -4
- package/mobile/bundle/content-page-repository/transformDocument.d.ts +0 -3
- package/mobile/bundle/content-page-repository/transformHTML.d.ts +0 -1
- package/mobile/bundle/content-page-repository/transformImg.d.ts +0 -12
- package/mobile/bundle/content-page-repository/transformMarkdown.d.ts +0 -1
- package/mobile/bundle/content-page-repository/transformPicture.d.ts +0 -3
- package/mobile/dist/components/ContentPage/computeAPIFallback.d.ts +0 -4
- package/mobile/dist/components/ContentPage/computeAPIFallback.js +0 -36
- package/mobile/dist/components/ContentPage/computeAPIFallback.js.map +0 -1
- package/mobile/dist/components/ContentPage/loadModuleFallback.d.ts +0 -2
- package/mobile/dist/components/ContentPage/loadModuleFallback.js +0 -36
- package/mobile/dist/components/ContentPage/loadModuleFallback.js.map +0 -1
- package/mobile/dist/components/ContentPage/mapSlot.d.ts +0 -2
- package/mobile/dist/components/ContentPage/mapSlot.js +0 -16
- package/mobile/dist/components/ContentPage/mapSlot.js.map +0 -1
- package/mobile/dist/components/ContentPage/normalizeBlock.d.ts +0 -3
- package/mobile/dist/components/ContentPage/normalizeBlock.js +0 -18
- package/mobile/dist/components/ContentPage/normalizeBlock.js.map +0 -1
- package/mobile/dist/components/ContentPage/normalizePage.d.ts +0 -3
- package/mobile/dist/components/ContentPage/normalizePage.js +0 -6
- package/mobile/dist/components/ContentPage/normalizePage.js.map +0 -1
- package/mobile/dist/components/ContentPage/toMobileBlock.d.ts +0 -2
- package/mobile/dist/components/ContentPage/toMobileBlock.js +0 -12
- package/mobile/dist/components/ContentPage/toMobileBlock.js.map +0 -1
- package/mobile/dist/content-page-repository/ContentPageRepository.d.ts +0 -10
- package/mobile/dist/content-page-repository/ContentPageRepository.js +0 -31
- package/mobile/dist/content-page-repository/ContentPageRepository.js.map +0 -1
- package/mobile/dist/content-page-repository/JSONDocContentBox.d.ts +0 -8
- package/mobile/dist/content-page-repository/JSONDocContentBox.js +0 -39
- package/mobile/dist/content-page-repository/JSONDocContentBox.js.map +0 -1
- package/mobile/dist/content-page-repository/TransformationOptions.d.ts +0 -4
- package/mobile/dist/content-page-repository/TransformationOptions.js +0 -2
- package/mobile/dist/content-page-repository/TransformationOptions.js.map +0 -1
- package/mobile/dist/content-page-repository/clearAttachmentHref.d.ts +0 -2
- package/mobile/dist/content-page-repository/clearAttachmentHref.js +0 -6
- package/mobile/dist/content-page-repository/clearAttachmentHref.js.map +0 -1
- package/mobile/dist/content-page-repository/computeImgOutputPath.d.ts +0 -3
- package/mobile/dist/content-page-repository/computeImgOutputPath.js +0 -18
- package/mobile/dist/content-page-repository/computeImgOutputPath.js.map +0 -1
- package/mobile/dist/content-page-repository/extensions.d.ts +0 -3
- package/mobile/dist/content-page-repository/extensions.js +0 -18
- package/mobile/dist/content-page-repository/extensions.js.map +0 -1
- package/mobile/dist/content-page-repository/index.d.ts +0 -3
- package/mobile/dist/content-page-repository/index.js +0 -9
- package/mobile/dist/content-page-repository/index.js.map +0 -1
- package/mobile/dist/content-page-repository/mapJSON.d.ts +0 -1
- package/mobile/dist/content-page-repository/mapJSON.js +0 -26
- package/mobile/dist/content-page-repository/mapJSON.js.map +0 -1
- package/mobile/dist/content-page-repository/mergePages.d.ts +0 -2
- package/mobile/dist/content-page-repository/mergePages.js +0 -7
- package/mobile/dist/content-page-repository/mergePages.js.map +0 -1
- package/mobile/dist/content-page-repository/replaceHeadingTags.d.ts +0 -1
- package/mobile/dist/content-page-repository/replaceHeadingTags.js +0 -5
- package/mobile/dist/content-page-repository/replaceHeadingTags.js.map +0 -1
- package/mobile/dist/content-page-repository/resizeImg.d.ts +0 -3
- package/mobile/dist/content-page-repository/resizeImg.js +0 -19
- package/mobile/dist/content-page-repository/resizeImg.js.map +0 -1
- package/mobile/dist/content-page-repository/transformAttachmentLink.d.ts +0 -3
- package/mobile/dist/content-page-repository/transformAttachmentLink.js +0 -40
- package/mobile/dist/content-page-repository/transformAttachmentLink.js.map +0 -1
- package/mobile/dist/content-page-repository/transformContentPage.d.ts +0 -4
- package/mobile/dist/content-page-repository/transformContentPage.js +0 -78
- package/mobile/dist/content-page-repository/transformContentPage.js.map +0 -1
- package/mobile/dist/content-page-repository/transformDocument.d.ts +0 -3
- package/mobile/dist/content-page-repository/transformDocument.js +0 -38
- package/mobile/dist/content-page-repository/transformDocument.js.map +0 -1
- package/mobile/dist/content-page-repository/transformHTML.d.ts +0 -1
- package/mobile/dist/content-page-repository/transformHTML.js +0 -54
- package/mobile/dist/content-page-repository/transformHTML.js.map +0 -1
- package/mobile/dist/content-page-repository/transformImg.d.ts +0 -12
- package/mobile/dist/content-page-repository/transformImg.js +0 -51
- package/mobile/dist/content-page-repository/transformImg.js.map +0 -1
- package/mobile/dist/content-page-repository/transformMarkdown.d.ts +0 -1
- package/mobile/dist/content-page-repository/transformMarkdown.js +0 -18
- package/mobile/dist/content-page-repository/transformMarkdown.js.map +0 -1
- package/mobile/dist/content-page-repository/transformPicture.d.ts +0 -3
- package/mobile/dist/content-page-repository/transformPicture.js +0 -28
- package/mobile/dist/content-page-repository/transformPicture.js.map +0 -1
- package/mobile/lib/components/ContentPage/computeAPIFallback.d.ts +0 -4
- package/mobile/lib/components/ContentPage/computeAPIFallback.js +0 -33
- package/mobile/lib/components/ContentPage/computeAPIFallback.js.map +0 -1
- package/mobile/lib/components/ContentPage/loadModuleFallback.d.ts +0 -2
- package/mobile/lib/components/ContentPage/loadModuleFallback.js +0 -10
- package/mobile/lib/components/ContentPage/loadModuleFallback.js.map +0 -1
- package/mobile/lib/components/ContentPage/mapSlot.d.ts +0 -2
- package/mobile/lib/components/ContentPage/mapSlot.js +0 -13
- package/mobile/lib/components/ContentPage/mapSlot.js.map +0 -1
- package/mobile/lib/components/ContentPage/normalizeBlock.d.ts +0 -3
- package/mobile/lib/components/ContentPage/normalizeBlock.js +0 -15
- package/mobile/lib/components/ContentPage/normalizeBlock.js.map +0 -1
- package/mobile/lib/components/ContentPage/normalizePage.d.ts +0 -3
- package/mobile/lib/components/ContentPage/normalizePage.js +0 -3
- package/mobile/lib/components/ContentPage/normalizePage.js.map +0 -1
- package/mobile/lib/components/ContentPage/toMobileBlock.d.ts +0 -2
- package/mobile/lib/components/ContentPage/toMobileBlock.js +0 -9
- package/mobile/lib/components/ContentPage/toMobileBlock.js.map +0 -1
- package/mobile/lib/content-page-repository/ContentPageRepository.d.ts +0 -10
- package/mobile/lib/content-page-repository/ContentPageRepository.js +0 -25
- package/mobile/lib/content-page-repository/ContentPageRepository.js.map +0 -1
- package/mobile/lib/content-page-repository/JSONDocContentBox.d.ts +0 -8
- package/mobile/lib/content-page-repository/JSONDocContentBox.js +0 -36
- package/mobile/lib/content-page-repository/JSONDocContentBox.js.map +0 -1
- package/mobile/lib/content-page-repository/TransformationOptions.d.ts +0 -4
- package/mobile/lib/content-page-repository/TransformationOptions.js +0 -2
- package/mobile/lib/content-page-repository/TransformationOptions.js.map +0 -1
- package/mobile/lib/content-page-repository/clearAttachmentHref.d.ts +0 -2
- package/mobile/lib/content-page-repository/clearAttachmentHref.js +0 -3
- package/mobile/lib/content-page-repository/clearAttachmentHref.js.map +0 -1
- package/mobile/lib/content-page-repository/computeImgOutputPath.d.ts +0 -3
- package/mobile/lib/content-page-repository/computeImgOutputPath.js +0 -12
- package/mobile/lib/content-page-repository/computeImgOutputPath.js.map +0 -1
- package/mobile/lib/content-page-repository/extensions.d.ts +0 -3
- package/mobile/lib/content-page-repository/extensions.js +0 -16
- package/mobile/lib/content-page-repository/extensions.js.map +0 -1
- package/mobile/lib/content-page-repository/index.d.ts +0 -3
- package/mobile/lib/content-page-repository/index.js +0 -4
- package/mobile/lib/content-page-repository/index.js.map +0 -1
- package/mobile/lib/content-page-repository/mapJSON.d.ts +0 -1
- package/mobile/lib/content-page-repository/mapJSON.js +0 -23
- package/mobile/lib/content-page-repository/mapJSON.js.map +0 -1
- package/mobile/lib/content-page-repository/mergePages.d.ts +0 -2
- package/mobile/lib/content-page-repository/mergePages.js +0 -4
- package/mobile/lib/content-page-repository/mergePages.js.map +0 -1
- package/mobile/lib/content-page-repository/replaceHeadingTags.d.ts +0 -1
- package/mobile/lib/content-page-repository/replaceHeadingTags.js +0 -2
- package/mobile/lib/content-page-repository/replaceHeadingTags.js.map +0 -1
- package/mobile/lib/content-page-repository/resizeImg.d.ts +0 -3
- package/mobile/lib/content-page-repository/resizeImg.js +0 -13
- package/mobile/lib/content-page-repository/resizeImg.js.map +0 -1
- package/mobile/lib/content-page-repository/transformAttachmentLink.d.ts +0 -3
- package/mobile/lib/content-page-repository/transformAttachmentLink.js +0 -34
- package/mobile/lib/content-page-repository/transformAttachmentLink.js.map +0 -1
- package/mobile/lib/content-page-repository/transformContentPage.d.ts +0 -4
- package/mobile/lib/content-page-repository/transformContentPage.js +0 -71
- package/mobile/lib/content-page-repository/transformContentPage.js.map +0 -1
- package/mobile/lib/content-page-repository/transformDocument.d.ts +0 -3
- package/mobile/lib/content-page-repository/transformDocument.js +0 -32
- package/mobile/lib/content-page-repository/transformDocument.js.map +0 -1
- package/mobile/lib/content-page-repository/transformHTML.d.ts +0 -1
- package/mobile/lib/content-page-repository/transformHTML.js +0 -25
- package/mobile/lib/content-page-repository/transformHTML.js.map +0 -1
- package/mobile/lib/content-page-repository/transformImg.d.ts +0 -12
- package/mobile/lib/content-page-repository/transformImg.js +0 -45
- package/mobile/lib/content-page-repository/transformImg.js.map +0 -1
- package/mobile/lib/content-page-repository/transformMarkdown.d.ts +0 -1
- package/mobile/lib/content-page-repository/transformMarkdown.js +0 -12
- package/mobile/lib/content-page-repository/transformMarkdown.js.map +0 -1
- package/mobile/lib/content-page-repository/transformPicture.d.ts +0 -3
- package/mobile/lib/content-page-repository/transformPicture.js +0 -22
- package/mobile/lib/content-page-repository/transformPicture.js.map +0 -1
- package/mobile/src/components/ContentPage/computeAPIFallback.ts +0 -67
- package/mobile/src/components/ContentPage/loadModuleFallback.ts +0 -11
- package/mobile/src/components/ContentPage/mapSlot.ts +0 -18
- package/mobile/src/components/ContentPage/normalizeBlock.ts +0 -25
- package/mobile/src/components/ContentPage/normalizePage.ts +0 -8
- package/mobile/src/components/ContentPage/toMobileBlock.ts +0 -11
- package/mobile/src/content-page-repository/ContentPageRepository.ts +0 -31
- package/mobile/src/content-page-repository/JSONDocContentBox.ts +0 -56
- package/mobile/src/content-page-repository/TransformationOptions.ts +0 -4
- package/mobile/src/content-page-repository/clearAttachmentHref.ts +0 -3
- package/mobile/src/content-page-repository/computeImgOutputPath.ts +0 -21
- package/mobile/src/content-page-repository/extensions.ts +0 -17
- package/mobile/src/content-page-repository/index.ts +0 -3
- package/mobile/src/content-page-repository/mapJSON.ts +0 -30
- package/mobile/src/content-page-repository/mergePages.ts +0 -8
- package/mobile/src/content-page-repository/replaceHeadingTags.ts +0 -2
- package/mobile/src/content-page-repository/resizeImg.ts +0 -17
- package/mobile/src/content-page-repository/transformAttachmentLink.ts +0 -46
- package/mobile/src/content-page-repository/transformContentPage.ts +0 -102
- package/mobile/src/content-page-repository/transformDocument.ts +0 -43
- package/mobile/src/content-page-repository/transformHTML.ts +0 -28
- package/mobile/src/content-page-repository/transformImg.ts +0 -81
- package/mobile/src/content-page-repository/transformMarkdown.ts +0 -14
- package/mobile/src/content-page-repository/transformPicture.ts +0 -35
- package/src/components/ContentPage/computeAPIFallback.ts +0 -67
- package/src/components/ContentPage/loadModuleFallback.ts +0 -11
- package/src/components/ContentPage/mapSlot.ts +0 -18
- package/src/components/ContentPage/normalizeBlock.mobile.ts +0 -25
- package/src/components/ContentPage/normalizeBlock.ts +0 -21
- package/src/components/ContentPage/normalizePage.ts +0 -8
- package/src/components/ContentPage/toMobileBlock.ts +0 -11
- package/src/content-page-repository/ContentPageRepository.ts +0 -31
- package/src/content-page-repository/JSONDocContentBox.ts +0 -56
- package/src/content-page-repository/TransformationOptions.ts +0 -4
- package/src/content-page-repository/clearAttachmentHref.ts +0 -3
- package/src/content-page-repository/computeImgOutputPath.ts +0 -21
- package/src/content-page-repository/extensions.ts +0 -17
- package/src/content-page-repository/index.ts +0 -3
- package/src/content-page-repository/mapJSON.ts +0 -30
- package/src/content-page-repository/mergePages.ts +0 -8
- package/src/content-page-repository/replaceHeadingTags.ts +0 -2
- package/src/content-page-repository/resizeImg.ts +0 -17
- package/src/content-page-repository/transformAttachmentLink.ts +0 -46
- package/src/content-page-repository/transformContentPage.ts +0 -102
- package/src/content-page-repository/transformDocument.ts +0 -43
- package/src/content-page-repository/transformHTML.ts +0 -28
- package/src/content-page-repository/transformImg.ts +0 -81
- package/src/content-page-repository/transformMarkdown.ts +0 -14
- 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,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,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,MAAM,CAAC,OAAO,EAAE,QAAQ;QACxD,CAAC,CAAC,IA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,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,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,IAAI,IAAA,uCAAkB,EAAC,aAA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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,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,EA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,GAAG,CAC7B,KAAK,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,EAA0B,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,OAAO,EAAE,CAAC,CACzE,CACF,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,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,8BAA8B,GAAG,KAAK,EAC1C,eAA+B,EACL,EAAE;IAC5B,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,eAA2B,CAAC,CAAC,CAAC;IAE7D,OAAO,CACL,MAAM,OAAO,CAAC,UAAU,CACtB,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;QACpB,CAAC;QACD,CAAC,MAAM,qBAAqB,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,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,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,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,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,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,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