@redneckz/wildless-cms-uni-blocks 0.9.11 → 0.9.13
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/bin/migrateContentUnit.js +1 -1
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +131 -56
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/CalculatorContent.d.ts +18 -17
- package/bundle/components/Calculator/DepositCalculatorForm.d.ts +2 -2
- package/bundle/components/Calculator/rangeHelpers.d.ts +1 -0
- package/bundle/components/Calculator/renderMonthsInput.d.ts +1 -0
- package/bundle/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
- package/bundle/components/Footer/MediaButton.d.ts +3 -4
- package/bundle/content-page-repository/ContentPageRepository.d.ts +1 -5
- package/bundle/content-page-repository/alignImg.d.ts +9 -0
- package/bundle/content-page-repository/computeImgOutputPath.d.ts +3 -0
- package/bundle/content-page-repository/resizeImg.d.ts +3 -0
- package/bundle/content-page-repository/transformContentPage.d.ts +1 -0
- package/bundle/content-page-repository/transformImg.d.ts +6 -5
- package/bundle/content-page-repository/transformPicture.d.ts +1 -1
- package/bundle/ui-kit/InputListRange/InputListRange.d.ts +2 -0
- package/bundle/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
- package/bundle/utils/arrayByRange.d.ts +1 -0
- package/bundle/utils/isPictureSizeEmpty.d.ts +2 -2
- package/bundle/utils/mergeIntervals.d.ts +1 -0
- package/dist/components/Calculator/CalculatorContent.d.ts +18 -17
- package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/DepositCalculatorForm.d.ts +2 -2
- package/dist/components/Calculator/DepositCalculatorForm.js +21 -11
- package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/constants.js +1 -1
- package/dist/components/Calculator/constants.js.map +1 -1
- package/dist/components/Calculator/rangeHelpers.d.ts +1 -0
- package/dist/components/Calculator/rangeHelpers.js +4 -1
- package/dist/components/Calculator/rangeHelpers.js.map +1 -1
- package/dist/components/Calculator/renderMonthsInput.d.ts +1 -0
- package/dist/components/Calculator/renderMonthsInput.js +3 -2
- package/dist/components/Calculator/renderMonthsInput.js.map +1 -1
- package/dist/components/Calculator/useCreditCalculatorParams.js +27 -29
- package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
- package/dist/components/Calculator/useDepositCalculatorParams.js +22 -6
- package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
- package/dist/components/Footer/MediaButton.d.ts +3 -4
- package/dist/components/Footer/MediaButton.js.map +1 -1
- package/dist/content-page-repository/ContentPageRepository.d.ts +1 -5
- package/dist/content-page-repository/ContentPageRepository.js +7 -25
- package/dist/content-page-repository/ContentPageRepository.js.map +1 -1
- package/dist/content-page-repository/alignImg.d.ts +9 -0
- package/dist/content-page-repository/alignImg.js +23 -0
- package/dist/content-page-repository/alignImg.js.map +1 -0
- package/dist/content-page-repository/computeImgOutputPath.d.ts +3 -0
- package/dist/content-page-repository/computeImgOutputPath.js +18 -0
- package/dist/content-page-repository/computeImgOutputPath.js.map +1 -0
- package/dist/content-page-repository/resizeImg.d.ts +3 -0
- package/dist/content-page-repository/resizeImg.js +19 -0
- package/dist/content-page-repository/resizeImg.js.map +1 -0
- package/dist/content-page-repository/transformContentPage.d.ts +1 -0
- package/dist/content-page-repository/transformContentPage.js +25 -19
- package/dist/content-page-repository/transformContentPage.js.map +1 -1
- package/dist/content-page-repository/transformImg.d.ts +6 -5
- package/dist/content-page-repository/transformImg.js +26 -76
- package/dist/content-page-repository/transformImg.js.map +1 -1
- package/dist/content-page-repository/transformPicture.d.ts +1 -1
- package/dist/content-page-repository/transformPicture.js +8 -16
- package/dist/content-page-repository/transformPicture.js.map +1 -1
- package/dist/ui-kit/InputListRange/InputListRange.d.ts +2 -0
- package/dist/ui-kit/InputListRange/InputListRange.js +41 -0
- package/dist/ui-kit/InputListRange/InputListRange.js.map +1 -0
- package/dist/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
- package/dist/ui-kit/InputListRange/InputListRangeProps.js +2 -0
- package/dist/ui-kit/InputListRange/InputListRangeProps.js.map +1 -0
- package/dist/ui-kit/Select/Select.js +2 -1
- package/dist/ui-kit/Select/Select.js.map +1 -1
- package/dist/utils/arrayByRange.d.ts +1 -0
- package/dist/utils/arrayByRange.js +5 -0
- package/dist/utils/arrayByRange.js.map +1 -0
- package/dist/utils/isPictureSizeEmpty.d.ts +2 -2
- package/dist/utils/isPictureSizeEmpty.js +1 -1
- package/dist/utils/isPictureSizeEmpty.js.map +1 -1
- package/dist/utils/mergeIntervals.d.ts +1 -0
- package/dist/utils/mergeIntervals.js +20 -0
- package/dist/utils/mergeIntervals.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Calculator/CalculatorContent.d.ts +18 -17
- package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/DepositCalculatorForm.d.ts +2 -2
- package/lib/components/Calculator/DepositCalculatorForm.js +22 -12
- package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/constants.js +1 -1
- package/lib/components/Calculator/constants.js.map +1 -1
- package/lib/components/Calculator/rangeHelpers.d.ts +1 -0
- package/lib/components/Calculator/rangeHelpers.js +2 -0
- package/lib/components/Calculator/rangeHelpers.js.map +1 -1
- package/lib/components/Calculator/renderMonthsInput.d.ts +1 -0
- package/lib/components/Calculator/renderMonthsInput.js +3 -2
- package/lib/components/Calculator/renderMonthsInput.js.map +1 -1
- package/lib/components/Calculator/useCreditCalculatorParams.js +27 -29
- package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
- package/lib/components/Calculator/useDepositCalculatorParams.js +22 -6
- package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
- package/lib/components/Footer/MediaButton.d.ts +3 -4
- package/lib/components/Footer/MediaButton.js.map +1 -1
- package/lib/content-page-repository/ContentPageRepository.d.ts +1 -5
- package/lib/content-page-repository/ContentPageRepository.js +8 -26
- package/lib/content-page-repository/ContentPageRepository.js.map +1 -1
- package/lib/content-page-repository/alignImg.d.ts +9 -0
- package/lib/content-page-repository/alignImg.js +17 -0
- package/lib/content-page-repository/alignImg.js.map +1 -0
- package/lib/content-page-repository/computeImgOutputPath.d.ts +3 -0
- package/lib/content-page-repository/computeImgOutputPath.js +12 -0
- package/lib/content-page-repository/computeImgOutputPath.js.map +1 -0
- package/lib/content-page-repository/resizeImg.d.ts +3 -0
- package/lib/content-page-repository/resizeImg.js +13 -0
- package/lib/content-page-repository/resizeImg.js.map +1 -0
- package/lib/content-page-repository/transformContentPage.d.ts +1 -0
- package/lib/content-page-repository/transformContentPage.js +23 -18
- package/lib/content-page-repository/transformContentPage.js.map +1 -1
- package/lib/content-page-repository/transformImg.d.ts +6 -5
- package/lib/content-page-repository/transformImg.js +26 -76
- package/lib/content-page-repository/transformImg.js.map +1 -1
- package/lib/content-page-repository/transformPicture.d.ts +1 -1
- package/lib/content-page-repository/transformPicture.js +8 -16
- package/lib/content-page-repository/transformPicture.js.map +1 -1
- package/lib/ui-kit/InputListRange/InputListRange.d.ts +2 -0
- package/lib/ui-kit/InputListRange/InputListRange.js +39 -0
- package/lib/ui-kit/InputListRange/InputListRange.js.map +1 -0
- package/lib/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
- package/lib/ui-kit/InputListRange/InputListRangeProps.js +2 -0
- package/lib/ui-kit/InputListRange/InputListRangeProps.js.map +1 -0
- package/lib/ui-kit/Select/Select.js +2 -1
- package/lib/ui-kit/Select/Select.js.map +1 -1
- package/lib/utils/arrayByRange.d.ts +1 -0
- package/lib/utils/arrayByRange.js +2 -0
- package/lib/utils/arrayByRange.js.map +1 -0
- package/lib/utils/isPictureSizeEmpty.d.ts +2 -2
- package/lib/utils/isPictureSizeEmpty.js +1 -1
- package/lib/utils/isPictureSizeEmpty.js.map +1 -1
- package/lib/utils/mergeIntervals.d.ts +1 -0
- package/lib/utils/mergeIntervals.js +17 -0
- package/lib/utils/mergeIntervals.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +1 -1
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/CalculatorContent.d.ts +18 -17
- package/mobile/bundle/components/Calculator/DepositCalculatorForm.d.ts +2 -2
- package/mobile/bundle/components/Calculator/rangeHelpers.d.ts +1 -0
- package/mobile/bundle/components/Calculator/renderMonthsInput.d.ts +1 -0
- package/mobile/bundle/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
- package/mobile/bundle/components/Footer/MediaButton.d.ts +3 -4
- package/mobile/bundle/content-page-repository/ContentPageRepository.d.ts +1 -5
- package/mobile/bundle/content-page-repository/alignImg.d.ts +9 -0
- package/mobile/bundle/content-page-repository/computeImgOutputPath.d.ts +3 -0
- package/mobile/bundle/content-page-repository/resizeImg.d.ts +3 -0
- package/mobile/bundle/content-page-repository/transformContentPage.d.ts +1 -0
- package/mobile/bundle/content-page-repository/transformImg.d.ts +6 -5
- package/mobile/bundle/content-page-repository/transformPicture.d.ts +1 -1
- package/mobile/bundle/ui-kit/InputListRange/InputListRange.d.ts +2 -0
- package/mobile/bundle/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
- package/mobile/bundle/utils/arrayByRange.d.ts +1 -0
- package/mobile/bundle/utils/isPictureSizeEmpty.d.ts +2 -2
- package/mobile/bundle/utils/mergeIntervals.d.ts +1 -0
- package/mobile/dist/components/Calculator/CalculatorContent.d.ts +18 -17
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/DepositCalculatorForm.d.ts +2 -2
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js +21 -11
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/constants.js +1 -1
- package/mobile/dist/components/Calculator/constants.js.map +1 -1
- package/mobile/dist/components/Calculator/rangeHelpers.d.ts +1 -0
- package/mobile/dist/components/Calculator/rangeHelpers.js +4 -1
- package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -1
- package/mobile/dist/components/Calculator/renderMonthsInput.d.ts +1 -0
- package/mobile/dist/components/Calculator/renderMonthsInput.js +3 -2
- package/mobile/dist/components/Calculator/renderMonthsInput.js.map +1 -1
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +27 -29
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +22 -6
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
- package/mobile/dist/components/Footer/MediaButton.d.ts +3 -4
- package/mobile/dist/components/Footer/MediaButton.js.map +1 -1
- package/mobile/dist/content-page-repository/ContentPageRepository.d.ts +1 -5
- package/mobile/dist/content-page-repository/ContentPageRepository.js +7 -25
- package/mobile/dist/content-page-repository/ContentPageRepository.js.map +1 -1
- package/mobile/dist/content-page-repository/alignImg.d.ts +9 -0
- package/mobile/dist/content-page-repository/alignImg.js +23 -0
- package/mobile/dist/content-page-repository/alignImg.js.map +1 -0
- package/mobile/dist/content-page-repository/computeImgOutputPath.d.ts +3 -0
- package/mobile/dist/content-page-repository/computeImgOutputPath.js +18 -0
- package/mobile/dist/content-page-repository/computeImgOutputPath.js.map +1 -0
- package/mobile/dist/content-page-repository/resizeImg.d.ts +3 -0
- package/mobile/dist/content-page-repository/resizeImg.js +19 -0
- package/mobile/dist/content-page-repository/resizeImg.js.map +1 -0
- package/mobile/dist/content-page-repository/transformContentPage.d.ts +1 -0
- package/mobile/dist/content-page-repository/transformContentPage.js +25 -19
- package/mobile/dist/content-page-repository/transformContentPage.js.map +1 -1
- package/mobile/dist/content-page-repository/transformImg.d.ts +6 -5
- package/mobile/dist/content-page-repository/transformImg.js +26 -76
- package/mobile/dist/content-page-repository/transformImg.js.map +1 -1
- package/mobile/dist/content-page-repository/transformPicture.d.ts +1 -1
- package/mobile/dist/content-page-repository/transformPicture.js +8 -16
- package/mobile/dist/content-page-repository/transformPicture.js.map +1 -1
- package/mobile/dist/ui-kit/InputListRange/InputListRange.d.ts +2 -0
- package/mobile/dist/ui-kit/InputListRange/InputListRange.js +41 -0
- package/mobile/dist/ui-kit/InputListRange/InputListRange.js.map +1 -0
- package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
- package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.js +2 -0
- package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.js.map +1 -0
- package/mobile/dist/ui-kit/Select/Select.js +2 -1
- package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
- package/mobile/dist/utils/arrayByRange.d.ts +1 -0
- package/mobile/dist/utils/arrayByRange.js +5 -0
- package/mobile/dist/utils/arrayByRange.js.map +1 -0
- package/mobile/dist/utils/isPictureSizeEmpty.d.ts +2 -2
- package/mobile/dist/utils/isPictureSizeEmpty.js +1 -1
- package/mobile/dist/utils/isPictureSizeEmpty.js.map +1 -1
- package/mobile/dist/utils/mergeIntervals.d.ts +1 -0
- package/mobile/dist/utils/mergeIntervals.js +20 -0
- package/mobile/dist/utils/mergeIntervals.js.map +1 -0
- package/mobile/lib/components/Calculator/CalculatorContent.d.ts +18 -17
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/DepositCalculatorForm.d.ts +2 -2
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js +22 -12
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/constants.js +1 -1
- package/mobile/lib/components/Calculator/constants.js.map +1 -1
- package/mobile/lib/components/Calculator/rangeHelpers.d.ts +1 -0
- package/mobile/lib/components/Calculator/rangeHelpers.js +2 -0
- package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -1
- package/mobile/lib/components/Calculator/renderMonthsInput.d.ts +1 -0
- package/mobile/lib/components/Calculator/renderMonthsInput.js +3 -2
- package/mobile/lib/components/Calculator/renderMonthsInput.js.map +1 -1
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +27 -29
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +22 -6
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
- package/mobile/lib/components/Footer/MediaButton.d.ts +3 -4
- package/mobile/lib/components/Footer/MediaButton.js.map +1 -1
- package/mobile/lib/content-page-repository/ContentPageRepository.d.ts +1 -5
- package/mobile/lib/content-page-repository/ContentPageRepository.js +8 -26
- package/mobile/lib/content-page-repository/ContentPageRepository.js.map +1 -1
- package/mobile/lib/content-page-repository/alignImg.d.ts +9 -0
- package/mobile/lib/content-page-repository/alignImg.js +17 -0
- package/mobile/lib/content-page-repository/alignImg.js.map +1 -0
- package/mobile/lib/content-page-repository/computeImgOutputPath.d.ts +3 -0
- package/mobile/lib/content-page-repository/computeImgOutputPath.js +12 -0
- package/mobile/lib/content-page-repository/computeImgOutputPath.js.map +1 -0
- package/mobile/lib/content-page-repository/resizeImg.d.ts +3 -0
- package/mobile/lib/content-page-repository/resizeImg.js +13 -0
- package/mobile/lib/content-page-repository/resizeImg.js.map +1 -0
- package/mobile/lib/content-page-repository/transformContentPage.d.ts +1 -0
- package/mobile/lib/content-page-repository/transformContentPage.js +23 -18
- package/mobile/lib/content-page-repository/transformContentPage.js.map +1 -1
- package/mobile/lib/content-page-repository/transformImg.d.ts +6 -5
- package/mobile/lib/content-page-repository/transformImg.js +26 -76
- package/mobile/lib/content-page-repository/transformImg.js.map +1 -1
- package/mobile/lib/content-page-repository/transformPicture.d.ts +1 -1
- package/mobile/lib/content-page-repository/transformPicture.js +8 -16
- package/mobile/lib/content-page-repository/transformPicture.js.map +1 -1
- package/mobile/lib/ui-kit/InputListRange/InputListRange.d.ts +2 -0
- package/mobile/lib/ui-kit/InputListRange/InputListRange.js +39 -0
- package/mobile/lib/ui-kit/InputListRange/InputListRange.js.map +1 -0
- package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
- package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.js +2 -0
- package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.js.map +1 -0
- package/mobile/lib/ui-kit/Select/Select.js +2 -1
- package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/lib/utils/arrayByRange.d.ts +1 -0
- package/mobile/lib/utils/arrayByRange.js +2 -0
- package/mobile/lib/utils/arrayByRange.js.map +1 -0
- package/mobile/lib/utils/isPictureSizeEmpty.d.ts +2 -2
- package/mobile/lib/utils/isPictureSizeEmpty.js +1 -1
- package/mobile/lib/utils/isPictureSizeEmpty.js.map +1 -1
- package/mobile/lib/utils/mergeIntervals.d.ts +1 -0
- package/mobile/lib/utils/mergeIntervals.js +17 -0
- package/mobile/lib/utils/mergeIntervals.js.map +1 -0
- package/mobile/src/components/Calculator/Calculator.example.json +3 -1
- package/mobile/src/components/Calculator/CalculatorContent.ts +20 -19
- package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +6 -7
- package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +48 -15
- package/mobile/src/components/Calculator/constants.ts +1 -1
- package/mobile/src/components/Calculator/rangeHelpers.ts +10 -0
- package/mobile/src/components/Calculator/renderMonthsInput.tsx +13 -2
- package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +8 -10
- package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +36 -9
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +1 -2
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +2 -8
- package/mobile/src/components/Footer/MediaButton.tsx +3 -5
- package/mobile/src/content-page-repository/ContentPageRepository.ts +8 -40
- package/mobile/src/content-page-repository/alignImg.ts +32 -0
- package/mobile/src/content-page-repository/computeImgOutputPath.ts +20 -0
- package/mobile/src/content-page-repository/resizeImg.ts +18 -0
- package/mobile/src/content-page-repository/transformContentPage.ts +25 -18
- package/mobile/src/content-page-repository/transformImg.ts +49 -121
- package/mobile/src/content-page-repository/transformPicture.ts +9 -21
- package/mobile/src/ui-kit/InputListRange/InputListRange.tsx +99 -0
- package/mobile/src/ui-kit/InputListRange/InputListRangeProps.ts +11 -0
- package/mobile/src/ui-kit/Select/Select.tsx +8 -1
- package/mobile/src/utils/arrayByRange.ts +4 -0
- package/mobile/src/utils/isPictureSizeEmpty.ts +3 -3
- package/mobile/src/utils/mergeIntervals.ts +19 -0
- package/package.json +1 -1
- package/src/components/Calculator/Calculator.example.json +3 -1
- package/src/components/Calculator/Calculator.fixture.tsx +4 -0
- package/src/components/Calculator/CalculatorContent.ts +20 -19
- package/src/components/Calculator/CreditCalculatorForm.tsx +6 -7
- package/src/components/Calculator/DepositCalculatorForm.tsx +48 -15
- package/src/components/Calculator/constants.ts +1 -1
- package/src/components/Calculator/rangeHelpers.ts +10 -0
- package/src/components/Calculator/renderMonthsInput.tsx +13 -2
- package/src/components/Calculator/useCreditCalculatorParams.ts +8 -10
- package/src/components/Calculator/useDepositCalculatorParams.ts +36 -9
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +1 -2
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +0 -9
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +2 -8
- package/src/components/Footer/MediaButton.tsx +3 -5
- package/src/content-page-repository/ContentPageRepository.ts +8 -40
- package/src/content-page-repository/alignImg.ts +32 -0
- package/src/content-page-repository/computeImgOutputPath.ts +20 -0
- package/src/content-page-repository/resizeImg.ts +18 -0
- package/src/content-page-repository/transformContentPage.ts +25 -18
- package/src/content-page-repository/transformImg.ts +49 -121
- package/src/content-page-repository/transformPicture.ts +9 -21
- package/src/ui-kit/InputListRange/InputListRange.tsx +99 -0
- package/src/ui-kit/InputListRange/InputListRangeProps.ts +11 -0
- package/src/ui-kit/Select/Select.tsx +8 -1
- package/src/utils/arrayByRange.ts +4 -0
- package/src/utils/isPictureSizeEmpty.ts +3 -3
- package/src/utils/mergeIntervals.ts +19 -0
- package/bundle/content-page-repository/transformImgPath.d.ts +0 -8
- package/dist/content-page-repository/transformImgPath.d.ts +0 -8
- package/dist/content-page-repository/transformImgPath.js +0 -22
- package/dist/content-page-repository/transformImgPath.js.map +0 -1
- package/lib/content-page-repository/transformImgPath.d.ts +0 -8
- package/lib/content-page-repository/transformImgPath.js +0 -16
- package/lib/content-page-repository/transformImgPath.js.map +0 -1
- package/mobile/bundle/content-page-repository/transformImgPath.d.ts +0 -8
- package/mobile/dist/content-page-repository/transformImgPath.d.ts +0 -8
- package/mobile/dist/content-page-repository/transformImgPath.js +0 -22
- package/mobile/dist/content-page-repository/transformImgPath.js.map +0 -1
- package/mobile/lib/content-page-repository/transformImgPath.d.ts +0 -8
- package/mobile/lib/content-page-repository/transformImgPath.js +0 -16
- package/mobile/lib/content-page-repository/transformImgPath.js.map +0 -1
- package/mobile/src/content-page-repository/transformImgPath.ts +0 -30
- package/src/content-page-repository/transformImgPath.ts +0 -30
|
@@ -0,0 +1,18 @@
|
|
|
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.computeImgOutputPath = void 0;
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
function computeImgOutputPath(imgInputPath, { contentDir, publicDir, format, size, alignment }) {
|
|
8
|
+
const imgRelativePath = path_1.default.relative(contentDir, imgInputPath);
|
|
9
|
+
const imgDir = path_1.default.dirname(imgRelativePath);
|
|
10
|
+
const inputExt = path_1.default.extname(imgRelativePath);
|
|
11
|
+
const fileName = path_1.default.basename(imgRelativePath, inputExt);
|
|
12
|
+
const suffixParts = [size?.width, size?.height, alignment].filter(Boolean);
|
|
13
|
+
const suffix = suffixParts.length ? `-${suffixParts.join('-')}` : '';
|
|
14
|
+
const ext = format ? `.${format}` : inputExt;
|
|
15
|
+
return path_1.default.join(publicDir, imgDir, `${fileName}${suffix}${ext}`);
|
|
16
|
+
}
|
|
17
|
+
exports.computeImgOutputPath = computeImgOutputPath;
|
|
18
|
+
//# sourceMappingURL=computeImgOutputPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeImgOutputPath.js","sourceRoot":"","sources":["../../src/content-page-repository/computeImgOutputPath.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAIxB,SAAgB,oBAAoB,CAClC,YAAoB,EACpB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAqC;IAErF,MAAM,eAAe,GAAG,cAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAEhE,MAAM,MAAM,GAAG,cAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAE7C,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,cAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;IAC1D,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3E,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACrE,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;IAE7C,OAAO,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,QAAQ,GAAG,MAAM,GAAG,GAAG,EAAE,CAAC,CAAC;AACpE,CAAC;AAfD,oDAeC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizeImg.js","sourceRoot":"","sources":["../../src/content-page-repository/resizeImg.ts"],"names":[],"mappings":";;;;;AACA,kDAA0B;AAGnB,MAAM,SAAS,GACpB,CAAC,IAAyB,EAAE,OAAuB,EAAE,EAAE,CACvD,CAAC,KAAY,EAAS,EAAE,CACtB,IAAI;IACF,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE;QACpD;;;WAGG;QACH,GAAG,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,eAAK,CAAC,GAAG,CAAC,OAAO;QACnE,UAAU,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;QAC1C,GAAG,OAAO;KACX,CAAC;IACJ,CAAC,CAAC,KAAK,CAAC;AAbD,QAAA,SAAS,aAaR"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { ContentPageDef } from '../model/ContentPageDef';
|
|
2
2
|
import type { TransformationOptions } from './TransformationOptions';
|
|
3
3
|
export declare function transformContentPage(pagePath: string, options: TransformationOptions): Promise<ContentPageDef>;
|
|
4
|
+
export declare const generatedPagePath: (pagePath: string) => string;
|
|
@@ -2,7 +2,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
2
2
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
3
3
|
};
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.transformContentPage = void 0;
|
|
5
|
+
exports.generatedPagePath = exports.transformContentPage = void 0;
|
|
6
6
|
const fs_1 = __importDefault(require("fs"));
|
|
7
7
|
const util_1 = __importDefault(require("util"));
|
|
8
8
|
const mapJSON_1 = require("./mapJSON");
|
|
@@ -10,33 +10,39 @@ const transformHTML_1 = require("./transformHTML");
|
|
|
10
10
|
const transformMarkdown_1 = require("./transformMarkdown");
|
|
11
11
|
const transformPicture_1 = require("./transformPicture");
|
|
12
12
|
const readFile = util_1.default.promisify(fs_1.default.readFile);
|
|
13
|
+
const writeFile = util_1.default.promisify(fs_1.default.writeFile);
|
|
14
|
+
const OUTPUT_SUFFIX = '.static';
|
|
13
15
|
async function transformContentPage(pagePath, options) {
|
|
14
16
|
const content = await readFile(pagePath, 'utf8');
|
|
15
17
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
16
|
-
|
|
17
|
-
const isMarkdown =
|
|
18
|
-
const isHTML =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
else if (isHTML) {
|
|
23
|
-
return await (0, transformHTML_1.transformHTML)(value);
|
|
24
|
-
}
|
|
25
|
-
else if (isPicture(value)) {
|
|
26
|
-
try {
|
|
27
|
-
return await (0, transformPicture_1.transformPicture)(pagePath, value, options);
|
|
18
|
+
const result = await (0, mapJSON_1.mapJSON)(JSON.parse(content), async (value, [key]) => {
|
|
19
|
+
const isMarkdown = isString(value) && key?.endsWith('__md');
|
|
20
|
+
const isHTML = isString(value) && key?.endsWith('__html');
|
|
21
|
+
try {
|
|
22
|
+
if (isMarkdown) {
|
|
23
|
+
return await (0, transformMarkdown_1.transformMarkdown)(value);
|
|
28
24
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
console.error(ex);
|
|
25
|
+
else if (isHTML) {
|
|
26
|
+
return await (0, transformHTML_1.transformHTML)(value);
|
|
32
27
|
}
|
|
28
|
+
else if (isPicture(value)) {
|
|
29
|
+
return await (0, transformPicture_1.transformPicture)(value, pagePath, options);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch (ex) {
|
|
33
|
+
console.warn(`Error while transforming field "${key}" on page: ${pagePath}`);
|
|
34
|
+
console.error(ex);
|
|
33
35
|
}
|
|
34
36
|
return value;
|
|
35
37
|
});
|
|
38
|
+
await writeFile((0, exports.generatedPagePath)(pagePath), JSON.stringify(result), 'utf-8');
|
|
39
|
+
return result;
|
|
36
40
|
}
|
|
37
41
|
exports.transformContentPage = transformContentPage;
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const isURL = (src) => ['data:', 'https:', 'http:'].some((proto) => src.startsWith(proto));
|
|
42
|
+
const generatedPagePath = (pagePath) => `${pagePath}${OUTPUT_SUFFIX}`;
|
|
43
|
+
exports.generatedPagePath = generatedPagePath;
|
|
41
44
|
const isPicture = (_) => Boolean(_ && isLocalPath(_?.src));
|
|
45
|
+
const isLocalPath = (_) => isString(_) && _.length < 1024 && !isURL(_);
|
|
46
|
+
const isURL = (src) => ['data:', 'https:', 'http:'].some((proto) => src.startsWith(proto));
|
|
47
|
+
const isString = (_) => Boolean(_ && typeof _ === 'string');
|
|
42
48
|
//# sourceMappingURL=transformContentPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformContentPage.js","sourceRoot":"","sources":["../../src/content-page-repository/transformContentPage.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAGxB,uCAAoC;AAEpC,mDAAgD;AAChD,2DAAwD;AACxD,yDAAsD;AAEtD,MAAM,QAAQ,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"transformContentPage.js","sourceRoot":"","sources":["../../src/content-page-repository/transformContentPage.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAGxB,uCAAoC;AAEpC,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,aAAa,GAAG,SAAS,CAAC;AAEzB,KAAK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E,CAAC,GAAG,QAAQ,GAAG,aAAa,EAAE,CAAC;AAAxE,QAAA,iBAAiB,qBAAuD;AAErF,MAAM,SAAS,GAAG,CAAC,CAAM,EAAgB,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AAC9E,MAAM,WAAW,GAAG,CAAC,CAAM,EAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACrF,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"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { ImageSize } from '../model/ImageSize';
|
|
2
2
|
import type { ImgSource } from '../model/Picture';
|
|
3
3
|
import type { TransformationOptions } from './TransformationOptions';
|
|
4
|
-
declare type
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
declare type ImgOutputPath = string;
|
|
5
|
+
declare type TransformationTaskKey = ImgOutputPath;
|
|
6
|
+
declare type TransformationTasksCache = Map<TransformationTaskKey, Promise<ImgOutputPath>>;
|
|
7
|
+
declare type TransformImgOptions = TransformationOptions & ImgSource & {
|
|
7
8
|
containerSize?: ImageSize;
|
|
8
|
-
|
|
9
|
+
cache?: TransformationTasksCache;
|
|
9
10
|
};
|
|
10
|
-
export declare function transformImg(
|
|
11
|
+
export declare function transformImg(src: string, pagePath: string, options: TransformImgOptions): ImgOutputPath | Promise<ImgOutputPath>;
|
|
11
12
|
export {};
|
|
@@ -8,87 +8,37 @@ const path_1 = __importDefault(require("path"));
|
|
|
8
8
|
const sharp_1 = __importDefault(require("sharp"));
|
|
9
9
|
const util_1 = __importDefault(require("util"));
|
|
10
10
|
const isPictureSizeEmpty_1 = require("../utils/isPictureSizeEmpty");
|
|
11
|
-
const
|
|
11
|
+
const alignImg_1 = require("./alignImg");
|
|
12
|
+
const computeImgOutputPath_1 = require("./computeImgOutputPath");
|
|
13
|
+
const resizeImg_1 = require("./resizeImg");
|
|
12
14
|
const mkdir = util_1.default.promisify(fs_1.default.mkdir);
|
|
13
|
-
|
|
15
|
+
const defaultTransformationCache = new Map();
|
|
16
|
+
function transformImg(src, pagePath, options) {
|
|
14
17
|
if (!src) {
|
|
15
18
|
return '';
|
|
16
19
|
}
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
chain = resizeImg(chain, targetSize, getResizeFit(targetSize));
|
|
20
|
+
const input = path_1.default.join(path_1.default.dirname(pagePath), src);
|
|
21
|
+
const output = (0, computeImgOutputPath_1.computeImgOutputPath)(input, options);
|
|
22
|
+
const { cache = defaultTransformationCache } = options;
|
|
23
|
+
const cachedResult = cache.get(output);
|
|
24
|
+
if (cachedResult) {
|
|
25
|
+
return cachedResult;
|
|
24
26
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
try {
|
|
39
|
-
await chain.toFile(imgPublicPath);
|
|
40
|
-
}
|
|
41
|
-
catch (e) {
|
|
42
|
-
console.error(e);
|
|
43
|
-
}
|
|
44
|
-
return transformedImgPath;
|
|
27
|
+
const result = (async () => {
|
|
28
|
+
try {
|
|
29
|
+
await mkdir(path_1.default.dirname(output), { recursive: true });
|
|
30
|
+
const chain = await computeTransformationChain(options)((0, sharp_1.default)(input));
|
|
31
|
+
await chain.toFile(output);
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
console.error(e);
|
|
35
|
+
}
|
|
36
|
+
return output;
|
|
37
|
+
})();
|
|
38
|
+
cache.set(output, result);
|
|
39
|
+
return result;
|
|
45
40
|
}
|
|
46
41
|
exports.transformImg = transformImg;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const rgbaColor = 0x00000000;
|
|
50
|
-
const canvas = Buffer.alloc(width * height * channels, rgbaColor);
|
|
51
|
-
return (0, sharp_1.default)(canvas, { raw: { width, height, channels } });
|
|
52
|
-
}
|
|
53
|
-
function resizeImg(chain, size, options) {
|
|
54
|
-
return chain.resize(size?.width || null, size?.height || null, {
|
|
55
|
-
fit: sharp_1.default.fit.fill,
|
|
56
|
-
background: { r: 0, g: 0, b: 0, alpha: 0 },
|
|
57
|
-
...options,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
async function compositeImg({ chain, containerSize, alignment, }) {
|
|
61
|
-
const { data } = await chain.toBuffer({ resolveWithObject: true });
|
|
62
|
-
return createBackgroundImageChain(containerSize).composite([
|
|
63
|
-
{
|
|
64
|
-
input: data,
|
|
65
|
-
gravity: alignment,
|
|
66
|
-
},
|
|
67
|
-
]);
|
|
68
|
-
}
|
|
69
|
-
function getPictureSize(size, containerSize) {
|
|
70
|
-
// If containerSize is undefined intrinsic dimensions of image will be used then.
|
|
71
|
-
return (0, isPictureSizeEmpty_1.isPictureSizeEmpty)(size) ? containerSize : size;
|
|
72
|
-
}
|
|
73
|
-
function getCompositionResizeSize(containerSize, size = {}) {
|
|
74
|
-
const { width, height } = size;
|
|
75
|
-
const { width: containerWidth, height: containerHeight } = containerSize;
|
|
76
|
-
if (!(width || height)) {
|
|
77
|
-
return undefined;
|
|
78
|
-
}
|
|
79
|
-
const widthRatio = width ? containerWidth / width : 0;
|
|
80
|
-
const heightRatio = height ? containerHeight / height : 0;
|
|
81
|
-
return widthRatio > heightRatio
|
|
82
|
-
? { width: Math.min(Number(width), containerWidth) }
|
|
83
|
-
: { height: Math.min(Number(height), containerHeight) };
|
|
84
|
-
}
|
|
85
|
-
function getResizeFit(size) {
|
|
86
|
-
/*
|
|
87
|
-
Editor behaviour with one dimension present: resize by given dimension maintaining aspect ratio. (fit: contain)
|
|
88
|
-
With two dimensions present: resize trying to fill given dimensions (fit: fill)
|
|
89
|
-
*/
|
|
90
|
-
return {
|
|
91
|
-
fit: size?.width && size?.height ? sharp_1.default.fit.fill : sharp_1.default.fit.contain,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
42
|
+
const computeTransformationChain = ({ size, containerSize, alignment, format, options, }) => pipe((0, resizeImg_1.resizeImg)((0, isPictureSizeEmpty_1.isPictureSizeEmpty)(size) ? containerSize : size), (0, alignImg_1.alignImg)({ containerSize, alignment }), (_) => (format ? _.toFormat(format, options) : _));
|
|
43
|
+
const pipe = (...operations) => operations.reduce((a, b) => async (chain) => b(await a(chain)));
|
|
94
44
|
//# sourceMappingURL=transformImg.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformImg.js","sourceRoot":"","sources":["../../src/content-page-repository/transformImg.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;
|
|
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,yCAAsC;AACtC,iEAA8D;AAC9D,2CAAwC;AAGxC,MAAM,KAAK,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,KAAK,CAAC,CAAC;AASvC,MAAM,0BAA0B,GAA6B,IAAI,GAAG,EAAE,CAAC;AAEvE,SAAgB,YAAY,CAC1B,GAAW,EACX,QAAgB,EAChB,OAA4B;IAE5B,IAAI,CAAC,GAAG,E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AAE,aAAa,EAAE,SAAS,EAAE,CAAC,EACtC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAClD,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,3 +1,3 @@
|
|
|
1
1
|
import type { Picture } from '../model/Picture';
|
|
2
2
|
import type { TransformationOptions } from './TransformationOptions';
|
|
3
|
-
export declare function transformPicture(
|
|
3
|
+
export declare function transformPicture(picture: Picture, pagePath: string, options: TransformationOptions): Promise<Picture>;
|
|
@@ -6,28 +6,20 @@ exports.transformPicture = void 0;
|
|
|
6
6
|
const path_1 = __importDefault(require("path"));
|
|
7
7
|
const sharp_1 = __importDefault(require("sharp"));
|
|
8
8
|
const transformImg_1 = require("./transformImg");
|
|
9
|
-
async function transformPicture(
|
|
10
|
-
const sources = picture.sources || [];
|
|
9
|
+
async function transformPicture(picture, pagePath, options) {
|
|
11
10
|
const src = picture?.src || '';
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
src,
|
|
15
|
-
transformationOptions: { ...options, ...picture },
|
|
16
|
-
});
|
|
17
|
-
const { width, height } = await (0, sharp_1.default)(path_1.default.resolve(options.publicDir, transformedPicture)).metadata();
|
|
11
|
+
const transformedImgPath = await (0, transformImg_1.transformImg)(src, pagePath, { ...options, ...picture });
|
|
12
|
+
const { width, height } = await (0, sharp_1.default)(transformedImgPath).metadata();
|
|
18
13
|
const containerSize = width && height ? { width, height } : undefined;
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
containerSize,
|
|
23
|
-
transformationOptions: { ...options, ..._ },
|
|
24
|
-
})));
|
|
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, _));
|
|
25
17
|
return {
|
|
26
18
|
...picture,
|
|
27
|
-
src:
|
|
19
|
+
src: imgPathToSrc(transformedImgPath),
|
|
28
20
|
sources: transformedSources.map((_, i) => ({
|
|
29
21
|
...sources[i],
|
|
30
|
-
src:
|
|
22
|
+
src: imgPathToSrc(_),
|
|
31
23
|
size: { width, height },
|
|
32
24
|
})),
|
|
33
25
|
};
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.InputListRange = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
+
const addSpacesBetweenNumbers_1 = require("../../utils/addSpacesBetweenNumbers");
|
|
6
|
+
const clamp_1 = require("../../utils/clamp");
|
|
7
|
+
const getSanitizedValue_1 = require("../../utils/getSanitizedValue");
|
|
8
|
+
const DISABLED_INPUT_CLASSES = 'disabled:border-gray disabled:bg-main-divider';
|
|
9
|
+
exports.InputListRange = (0, uni_jsx_1.JSX)(({ className, title, items = [], list = [], value = list[0], disabled = false, onChange }) => {
|
|
10
|
+
const min = 0;
|
|
11
|
+
const max = list.length - 1;
|
|
12
|
+
const step = 1;
|
|
13
|
+
const handleTextChange = (e) => {
|
|
14
|
+
if (!onChange) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const newValue = parseInt(e.target.value);
|
|
18
|
+
const closetValue = list.reduce(function (prev, curr) {
|
|
19
|
+
return Math.abs(curr - newValue) < Math.abs(prev - newValue) ? curr : prev;
|
|
20
|
+
});
|
|
21
|
+
onChange(Number((0, getSanitizedValue_1.getSanitizedValue)(closetValue.toString())));
|
|
22
|
+
};
|
|
23
|
+
const handleRangeChange = (e) => {
|
|
24
|
+
if (!onChange) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const val = list.at((0, clamp_1.clamp)(parseInt(e.target.value), min, max)) || 0;
|
|
28
|
+
onChange(Number((0, getSanitizedValue_1.getSanitizedValue)(val.toString())));
|
|
29
|
+
};
|
|
30
|
+
const valueIndex = list.findIndex((item) => item === value) || 0;
|
|
31
|
+
const inputStyle = {
|
|
32
|
+
backgroundSize: `${(((valueIndex - min) * 100) / (max - min)).toFixed(2)}% 100%`,
|
|
33
|
+
};
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: className, children: [(0, jsx_runtime_1.jsxs)("label", { className: "block relative", children: [title ? (0, jsx_runtime_1.jsx)("span", { className: "text-m-light text-primary-text", children: title }) : null, (0, jsx_runtime_1.jsx)("input", { className: `m-0 mt-2 font-sans text-h3 w-full h-14 border border-solid border-gray rounded-md
|
|
35
|
+
outline-none p-0 pl-4 box-border text-primary-text hover:border-primary-hover focus:border-primary-text ${DISABLED_INPUT_CLASSES}`, value: (0, addSpacesBetweenNumbers_1.addSpacesBetweenNumbers)(value), disabled: disabled, onChange: handleTextChange, onBlur: handleTextChange }), list.length ? ((0, jsx_runtime_1.jsx)("div", { className: "absolute w-full flex justify-between -bottom-[3px] px-4", children: list.map(renderTick(valueIndex, disabled)) })) : null, (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-x-0 -bottom-1 px-4 leading-[18px]", children: (0, jsx_runtime_1.jsx)("input", { className: "box-border w-full m-0 cursor-pointer slider relative z-10", type: "range", min: min, max: max, step: step, value: valueIndex, disabled: disabled, onChange: handleRangeChange, style: inputStyle }) })] }), renderRangeCaption(items)] }));
|
|
36
|
+
});
|
|
37
|
+
const renderTick = (valueIndex, disabled) => (value, i) => ((0, jsx_runtime_1.jsx)("span", { className: `w-2 h-2 rounded-full ${valueIndex <= i || disabled ? 'bg-gray' : 'bg-primary-main'}` }, String(i)));
|
|
38
|
+
function renderRangeCaption(items) {
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "flex justify-between my-2", children: items.map((item, i) => ((0, jsx_runtime_1.jsx)("span", { className: "text-s-light text-secondary-text", children: item }, String(i)))) }));
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=InputListRange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputListRange.js","sourceRoot":"","sources":["../../../src/ui-kit/InputListRange/InputListRange.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,iFAA8E;AAC9E,6CAA0C;AAC1C,qEAAkE;AAGlE,MAAM,sBAAsB,GAAG,+CAA+C,CAAC;AAElE,QAAA,cAAc,GAAG,IAAA,aAAG,EAC/B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3F,MAAM,GAAG,GAAG,CAAC,CAAC;IACd,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CA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CAAC,CAAC,CAId,CACH,CAAC;AAEJ,SAAS,kBAAkB,CAAC,KAAe;IACzC,OAAO,CACL,gCAAK,SAAS,EAAC,2BAA2B,YACvC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,iCAAsB,SAAS,EAAC,kCAAkC,YAC/D,IAAI,IADI,MAAM,CAAC,CAAC,CAAC,CAEb,CACR,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ListContent } from '../List/ListContent';
|
|
2
|
+
export interface InputListRangeProps extends ListContent {
|
|
3
|
+
className?: string;
|
|
4
|
+
items?: string[];
|
|
5
|
+
list?: number[];
|
|
6
|
+
value?: number;
|
|
7
|
+
title?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
onChange?: (value: number) => void;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputListRangeProps.js","sourceRoot":"","sources":["../../../src/ui-kit/InputListRange/InputListRangeProps.ts"],"names":[],"mappings":""}
|
|
@@ -4,6 +4,7 @@ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
5
|
const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
6
6
|
const useOutsideClick_1 = require("../../hooks/useOutsideClick");
|
|
7
|
+
const Text_1 = require("../../ui-kit/Text/Text");
|
|
7
8
|
const Icon_1 = require("../Icon/Icon");
|
|
8
9
|
exports.Select = (0, uni_jsx_1.JSX)(({ className = '', isBorder = true, label, options = [], value, onChange, placeholder = '' }) => {
|
|
9
10
|
const [selectedItem, setSelectedItem] = (0, hooks_1.useState)(options[0] || { key: '', text: '' });
|
|
@@ -19,7 +20,7 @@ exports.Select = (0, uni_jsx_1.JSX)(({ className = '', isBorder = true, label, o
|
|
|
19
20
|
(0, hooks_1.useEffect)(() => {
|
|
20
21
|
setSelectedItem(value || { key: '', text: '' });
|
|
21
22
|
}, [value]);
|
|
22
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: `${className}`, ref: wrapperRef, children: [label ? (0, jsx_runtime_1.jsx)("
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: `${className}`, ref: wrapperRef, children: [label ? ((0, jsx_runtime_1.jsx)("div", { className: "mb-2", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { size: "text-m", color: "text-primary-text", font: "font-light", children: label }) })) : null, (0, jsx_runtime_1.jsxs)("div", { className: `relative ${isOpen ? 'z-20' : 'z-10'}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: `text-l flex justify-between items-center mb-0.5 text-primary-text cursor-pointer
|
|
23
24
|
${getBorderStyle(isBorder)}`, onClick: () => setIsOpen(!isOpen), children: [(0, jsx_runtime_1.jsx)("p", { className: "p-4 pr-8 h-14 overflow-hidden text-ellipsis whitespace-nowrap", children: selectedItem?.text || placeholder }), (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: "ArrowUpIcon", width: "16", height: "16", className: `absolute right-3 ${isOpen ? '' : 'rotate-180'}` })] }), options?.length ? ((0, jsx_runtime_1.jsx)("div", { className: `h-0 ${renderOptionsStyle(isOpen)}`, children: (0, jsx_runtime_1.jsx)("div", { className: `bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]`, children: options.map(renderOption(choiceOption, isOpen, isSelected)) }) })) : null] })] }));
|
|
24
25
|
});
|
|
25
26
|
const renderOptionsStyle = (isOpen) => (isOpen ? '' : 'overflow-hidden');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/ui-kit/Select/Select.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAA+E;AAC/E,iEAA8D;AAE9D,uCAAoC;AAgBvB,QAAA,MAAM,GAAG,IAAA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AY,GAChB,CACE,YAA2C,EAC3C,MAAe,EACf,UAA4C,EAC5C,EAAE,CACJ,CAAC,MAAmB,EAAE,CAAS,EAAE,EAAE;IACjC,OAAO,CACL,iCAEE,OAAO,EAAE,GAAG,EAAE;YACZ,YAAY,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC,EACD,SAAS,EAAC,oEAAoE,aAE9E,iCAAM,SAAS,EAAC,SAAS,YAAE,MAAM,CAAC,IAAI,GAAQ,EAC9C,uBAAC,WAAI,IACH,IAAI,EAAC,gBAAgB,EACrB,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,SAAS,EAAE,CAAC,yBAAyB,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CACvF,GAAG,CACJ,GACD,KAdG,MAAM,CAAC,CAAC,CAAC,CAeV,CACP,CAAC;AACJ,CAAC,CAAC;AAEJ,MAAM,cAAc,GAAG,CAAC,QAAiB,EAAE,EAAE,CAC3C,QAAQ,CAAC,CAAC,CAAC,0DAA0D,CAAC,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const arrayByRange: (start: number, stop: number, step?: number) => number[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.arrayByRange = void 0;
|
|
3
|
+
const arrayByRange = (start, stop, step = 1) => Array.from({ length: Math.abs(stop - start) / step + 1 }, (value, index) => stop >= start ? start + index * step : start - index * step);
|
|
4
|
+
exports.arrayByRange = arrayByRange;
|
|
5
|
+
//# sourceMappingURL=arrayByRange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrayByRange.js","sourceRoot":"","sources":["../../src/utils/arrayByRange.ts"],"names":[],"mappings":";;AAAO,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,IAAI,GAAG,CAAC,EAAE,EAAE,CACpE,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CACzE,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,KAAK,GAAG,IAAI,CAC5D,CAAC;AAHS,QAAA,YAAY,gBAGrB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function isPictureSizeEmpty(size:
|
|
1
|
+
import type { ImageSize } from '../model/ImageSize';
|
|
2
|
+
export declare function isPictureSizeEmpty(size: Partial<ImageSize> | undefined): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
2
|
exports.isPictureSizeEmpty = void 0;
|
|
3
3
|
function isPictureSizeEmpty(size) {
|
|
4
|
-
return !
|
|
4
|
+
return !size?.width && !size?.height;
|
|
5
5
|
}
|
|
6
6
|
exports.isPictureSizeEmpty = isPictureSizeEmpty;
|
|
7
7
|
//# sourceMappingURL=isPictureSizeEmpty.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isPictureSizeEmpty.js","sourceRoot":"","sources":["../../src/utils/isPictureSizeEmpty.ts"],"names":[],"mappings":";;AAEA,SAAgB,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"isPictureSizeEmpty.js","sourceRoot":"","sources":["../../src/utils/isPictureSizeEmpty.ts"],"names":[],"mappings":";;AAEA,SAAgB,kBAAkB,CAAC,IAAoC;IACrE,OAAO,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC;AACvC,CAAC;AAFD,gDAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const mergeIntervals: (intervals: number[][]) => number[][];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.mergeIntervals = void 0;
|
|
3
|
+
const mergeIntervals = (intervals) => {
|
|
4
|
+
const result = [...intervals];
|
|
5
|
+
result.sort(([a], [c]) => a - c);
|
|
6
|
+
let i = 1;
|
|
7
|
+
while (i < result.length) {
|
|
8
|
+
const [a, b] = result[i - 1];
|
|
9
|
+
const [c, d] = result[i];
|
|
10
|
+
if (b >= c) {
|
|
11
|
+
result.splice(i - 1, 2, [a, Math.max(b, d)]);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
i++;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return result;
|
|
18
|
+
};
|
|
19
|
+
exports.mergeIntervals = mergeIntervals;
|
|
20
|
+
//# sourceMappingURL=mergeIntervals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeIntervals.js","sourceRoot":"","sources":["../../src/utils/mergeIntervals.ts"],"names":[],"mappings":";;AAAO,MAAM,cAAc,GAAG,CAAC,SAAqB,EAAc,EAAE;IAClE,MAAM,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC;IAC9B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAEjC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEV,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE;QACxB,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7B,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAEzB,IAAI,CAAC,IAAI,CAAC,EAAE;YACV,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;SAC9C;aAAM;YACL,CAAC,EAAE,CAAC;SACL;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAlBW,QAAA,cAAc,kBAkBzB"}
|
|
@@ -17,31 +17,32 @@ export interface CreditCalculatorParamsViewSettings {
|
|
|
17
17
|
/** @title Комплексная страховая защита */
|
|
18
18
|
isShowInsurance?: boolean;
|
|
19
19
|
}
|
|
20
|
+
export interface DepositCalculatorParamsViewSettings {
|
|
21
|
+
/**
|
|
22
|
+
* @title Выплата процентов
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
isShowMonthlyInterestPayment?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* @title Оформление
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
isShowRemoteRegistration?: boolean;
|
|
31
|
+
}
|
|
20
32
|
export interface CreditCalculatorProps extends CommonCalculatorProps {
|
|
21
33
|
/** @title Настройка отображения чекбоксов */
|
|
22
34
|
paramsViewSettings?: CreditCalculatorParamsViewSettings;
|
|
23
35
|
}
|
|
36
|
+
export interface DepositCalculatorProps extends CommonCalculatorProps {
|
|
37
|
+
/** @title Настройка отображения радио */
|
|
38
|
+
paramsViewSettings?: DepositCalculatorParamsViewSettings;
|
|
39
|
+
}
|
|
24
40
|
export interface BusinessDepositCalculatorProps extends CommonCalculatorProps {
|
|
25
41
|
/** @title Сноска снизу блока */
|
|
26
42
|
bottomFootnote?: string;
|
|
27
43
|
/** @title Показывать название депозита */
|
|
28
44
|
isShowDepositeName?: boolean;
|
|
29
45
|
}
|
|
30
|
-
/**
|
|
31
|
-
* TODO: данные из справочника
|
|
32
|
-
**/
|
|
33
|
-
export interface DepositCalculatorParams {
|
|
34
|
-
/** @hidden */
|
|
35
|
-
minSum?: number;
|
|
36
|
-
/** @hidden */
|
|
37
|
-
maxSum?: number;
|
|
38
|
-
/** @hidden */
|
|
39
|
-
minMonths?: number;
|
|
40
|
-
/** @hidden */
|
|
41
|
-
maxMonths?: number;
|
|
42
|
-
/** @hidden */
|
|
43
|
-
rate?: number;
|
|
44
|
-
}
|
|
45
46
|
/**
|
|
46
47
|
* ? Общий интерфейс для всех типов калькуляторов?
|
|
47
48
|
* ? Используется во вложенных функциях. Может быть как то разбить это и вынести отсюда?
|
|
@@ -67,14 +68,14 @@ export declare type CreditCalculatorParamsDef = TitleProps & CreditCalculatorPro
|
|
|
67
68
|
* @title Калькулятор вкладов
|
|
68
69
|
* @default {"calcType": "DepositCalculatorForm"}
|
|
69
70
|
*/
|
|
70
|
-
export declare type DepositCalculatorParamsDef = TitleProps &
|
|
71
|
+
export declare type DepositCalculatorParamsDef = TitleProps & DepositCalculatorProps & {
|
|
71
72
|
calcType: 'DepositCalculatorForm';
|
|
72
73
|
};
|
|
73
74
|
/**
|
|
74
75
|
* @title Калькулятор вкладов - бизнес
|
|
75
76
|
* @default {"calcType": "BusinessDepositCalculatorForm"}
|
|
76
77
|
*/
|
|
77
|
-
export declare type BusinessDepositCalculatorParamsDef = TitleProps &
|
|
78
|
+
export declare type BusinessDepositCalculatorParamsDef = TitleProps & BusinessDepositCalculatorProps & {
|
|
78
79
|
calcType: 'BusinessDepositCalculatorForm';
|
|
79
80
|
};
|
|
80
81
|
/**
|