@redneckz/wildless-cms-uni-blocks 0.8.8 → 0.8.10
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/migration-scripts/0.8.10.js +31 -0
- package/bundle/EventBus/EventBus.d.ts +1 -4
- package/bundle/EventBus/defaultEventBus.d.ts +7 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +112 -113
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/bundle/components/Calculator/rangeHelpers.d.ts +4 -0
- package/bundle/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/bundle/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/{dist/components/StepsBlock/renderStepContent.d.ts → bundle/components/StepsBlock/renderStep.d.ts} +5 -5
- package/bundle/components/Tile/TileContent.d.ts +2 -2
- package/bundle/hooks/useRouter.d.ts +6 -2
- package/bundle/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/bundle/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/bundle/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/bundle/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/dist/EventBus/EventBus.d.ts +1 -4
- package/dist/EventBus/EventBus.js +0 -1
- package/dist/EventBus/EventBus.js.map +1 -1
- package/dist/EventBus/defaultEventBus.d.ts +7 -0
- package/dist/EventBus/defaultEventBus.js +5 -0
- package/dist/EventBus/defaultEventBus.js.map +1 -0
- package/dist/components/ButtonBlock/ButtonBlock.js +2 -1
- package/dist/components/ButtonBlock/ButtonBlock.js.map +1 -1
- package/dist/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/dist/components/Calculator/Rate.js +1 -1
- package/dist/components/Calculator/Rate.js.map +1 -1
- package/dist/components/Calculator/constants.js +2 -2
- package/dist/components/Calculator/constants.js.map +1 -1
- package/dist/components/Calculator/rangeHelpers.d.ts +4 -0
- package/dist/components/Calculator/rangeHelpers.js +12 -0
- package/dist/components/Calculator/rangeHelpers.js.map +1 -0
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useCreditCalculatorParams.js +8 -2
- package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useDepositCalculatorParams.js +14 -4
- package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/dist/components/Carousel/Carousel.js +6 -4
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/PictureText/renderBenefit.js +1 -0
- package/dist/components/PictureText/renderBenefit.js.map +1 -1
- package/dist/components/ProductTile/renderBenefit.js +1 -0
- package/dist/components/ProductTile/renderBenefit.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.js +7 -13
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js +24 -4
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/dist/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/dist/components/StepsBlock/checkCanRenderIcon.js +5 -0
- package/dist/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
- package/{bundle/components/StepsBlock/renderStepContent.d.ts → dist/components/StepsBlock/renderStep.d.ts} +5 -5
- package/dist/components/StepsBlock/renderStep.js +34 -0
- package/dist/components/StepsBlock/renderStep.js.map +1 -0
- package/dist/components/Tabs/Tabs.js +4 -4
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tile/Tile.js +3 -3
- package/dist/components/Tile/Tile.js.map +1 -1
- package/dist/components/Tile/TileContent.d.ts +2 -2
- package/dist/hooks/useLink.js +2 -3
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/hooks/useRouter.d.ts +6 -2
- package/dist/hooks/useRouter.js.map +1 -1
- package/dist/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/dist/services/BlockRouter/BlockRouter.js +11 -30
- package/dist/services/BlockRouter/BlockRouter.js.map +1 -1
- package/dist/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/dist/services/BlockRouter/blockRouterEventBus.js +5 -0
- package/dist/services/BlockRouter/blockRouterEventBus.js.map +1 -0
- package/dist/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/dist/services/BlockRouter/useBlockIntersectionObserver.js +5 -16
- package/dist/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
- package/dist/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/dist/services/BlockRouter/useBlockRouterProvider.js +11 -12
- package/dist/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/dist/ui-kit/BlockWrapper.js +2 -2
- package/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/lib/EventBus/EventBus.d.ts +1 -4
- package/lib/EventBus/EventBus.js +0 -1
- package/lib/EventBus/EventBus.js.map +1 -1
- package/lib/EventBus/defaultEventBus.d.ts +7 -0
- package/lib/EventBus/defaultEventBus.js +3 -0
- package/lib/EventBus/defaultEventBus.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/ButtonBlock/ButtonBlock.js +2 -1
- package/lib/components/ButtonBlock/ButtonBlock.js.map +1 -1
- package/lib/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/lib/components/Calculator/Rate.js +1 -1
- package/lib/components/Calculator/Rate.js.map +1 -1
- package/lib/components/Calculator/constants.js +2 -2
- package/lib/components/Calculator/constants.js.map +1 -1
- package/lib/components/Calculator/rangeHelpers.d.ts +4 -0
- package/lib/components/Calculator/rangeHelpers.js +8 -0
- package/lib/components/Calculator/rangeHelpers.js.map +1 -0
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useCreditCalculatorParams.js +8 -2
- package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useDepositCalculatorParams.js +14 -4
- package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/lib/components/Carousel/Carousel.js +6 -4
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/PictureText/renderBenefit.js +1 -0
- package/lib/components/PictureText/renderBenefit.js.map +1 -1
- package/lib/components/ProductTile/renderBenefit.js +1 -0
- package/lib/components/ProductTile/renderBenefit.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.js +7 -13
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.mobile.js +24 -4
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/lib/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/lib/components/StepsBlock/checkCanRenderIcon.js +2 -0
- package/lib/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
- package/{mobile/bundle/components/StepsBlock/renderStepContent.d.ts → lib/components/StepsBlock/renderStep.d.ts} +5 -5
- package/lib/components/StepsBlock/renderStep.js +31 -0
- package/lib/components/StepsBlock/renderStep.js.map +1 -0
- package/lib/components/Tabs/Tabs.js +4 -4
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Tile/Tile.js +3 -3
- package/lib/components/Tile/Tile.js.map +1 -1
- package/lib/components/Tile/TileContent.d.ts +2 -2
- package/lib/hooks/useLink.js +2 -3
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/hooks/useRouter.d.ts +6 -2
- package/lib/hooks/useRouter.js.map +1 -1
- package/lib/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/lib/services/BlockRouter/BlockRouter.js +8 -28
- package/lib/services/BlockRouter/BlockRouter.js.map +1 -1
- package/lib/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/lib/services/BlockRouter/blockRouterEventBus.js +3 -0
- package/lib/services/BlockRouter/blockRouterEventBus.js.map +1 -0
- package/lib/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/lib/services/BlockRouter/useBlockIntersectionObserver.js +6 -17
- package/lib/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
- package/lib/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/lib/services/BlockRouter/useBlockRouterProvider.js +12 -13
- package/lib/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/lib/ui-kit/BlockWrapper.js +2 -2
- package/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/bundle/EventBus/EventBus.d.ts +1 -4
- package/mobile/bundle/EventBus/defaultEventBus.d.ts +7 -0
- package/mobile/bundle/bundle.umd.js +58 -66
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/mobile/bundle/components/Calculator/rangeHelpers.d.ts +4 -0
- package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/mobile/bundle/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/{lib/components/StepsBlock/renderStepContent.d.ts → mobile/bundle/components/StepsBlock/renderStep.d.ts} +5 -5
- package/mobile/bundle/components/Tile/TileContent.d.ts +2 -2
- package/mobile/bundle/hooks/useRouter.d.ts +6 -2
- package/mobile/bundle/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/mobile/bundle/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/mobile/bundle/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/mobile/bundle/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/mobile/dist/EventBus/EventBus.d.ts +1 -4
- package/mobile/dist/EventBus/EventBus.js +0 -1
- package/mobile/dist/EventBus/EventBus.js.map +1 -1
- package/mobile/dist/EventBus/defaultEventBus.d.ts +7 -0
- package/mobile/dist/EventBus/defaultEventBus.js +5 -0
- package/mobile/dist/EventBus/defaultEventBus.js.map +1 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlock.js +2 -1
- package/mobile/dist/components/ButtonBlock/ButtonBlock.js.map +1 -1
- package/mobile/dist/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/mobile/dist/components/Calculator/Rate.js +1 -1
- package/mobile/dist/components/Calculator/Rate.js.map +1 -1
- package/mobile/dist/components/Calculator/constants.js +2 -2
- package/mobile/dist/components/Calculator/constants.js.map +1 -1
- package/mobile/dist/components/Calculator/rangeHelpers.d.ts +4 -0
- package/mobile/dist/components/Calculator/rangeHelpers.js +12 -0
- package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -0
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +8 -2
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +14 -4
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Carousel/Carousel.js +6 -4
- package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
- package/mobile/dist/components/PictureText/renderBenefit.js +1 -0
- package/mobile/dist/components/PictureText/renderBenefit.js.map +1 -1
- package/mobile/dist/components/ProductTile/renderBenefit.js +1 -0
- package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlock.js +24 -4
- package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/mobile/dist/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/mobile/dist/components/StepsBlock/checkCanRenderIcon.js +5 -0
- package/mobile/dist/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
- package/mobile/dist/components/StepsBlock/renderStep.d.ts +11 -0
- package/mobile/dist/components/StepsBlock/renderStep.js +34 -0
- package/mobile/dist/components/StepsBlock/renderStep.js.map +1 -0
- package/mobile/dist/components/Tabs/Tabs.js +4 -4
- package/mobile/dist/components/Tabs/Tabs.js.map +1 -1
- package/mobile/dist/components/Tile/Tile.js +3 -3
- package/mobile/dist/components/Tile/Tile.js.map +1 -1
- package/mobile/dist/components/Tile/TileContent.d.ts +2 -2
- package/mobile/dist/hooks/useLink.js +2 -3
- package/mobile/dist/hooks/useLink.js.map +1 -1
- package/mobile/dist/hooks/useRouter.d.ts +6 -2
- package/mobile/dist/hooks/useRouter.js.map +1 -1
- package/mobile/dist/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/mobile/dist/services/BlockRouter/BlockRouter.js +11 -30
- package/mobile/dist/services/BlockRouter/BlockRouter.js.map +1 -1
- package/mobile/dist/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/mobile/dist/services/BlockRouter/blockRouterEventBus.js +5 -0
- package/mobile/dist/services/BlockRouter/blockRouterEventBus.js.map +1 -0
- package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.js +5 -16
- package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
- package/mobile/dist/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js +11 -12
- package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/mobile/dist/ui-kit/BlockWrapper.js +2 -2
- package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/lib/EventBus/EventBus.d.ts +1 -4
- package/mobile/lib/EventBus/EventBus.js +0 -1
- package/mobile/lib/EventBus/EventBus.js.map +1 -1
- package/mobile/lib/EventBus/defaultEventBus.d.ts +7 -0
- package/mobile/lib/EventBus/defaultEventBus.js +3 -0
- package/mobile/lib/EventBus/defaultEventBus.js.map +1 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlock.js +2 -1
- package/mobile/lib/components/ButtonBlock/ButtonBlock.js.map +1 -1
- package/mobile/lib/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/mobile/lib/components/Calculator/Rate.js +1 -1
- package/mobile/lib/components/Calculator/Rate.js.map +1 -1
- package/mobile/lib/components/Calculator/constants.js +2 -2
- package/mobile/lib/components/Calculator/constants.js.map +1 -1
- package/mobile/lib/components/Calculator/rangeHelpers.d.ts +4 -0
- package/mobile/lib/components/Calculator/rangeHelpers.js +8 -0
- package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -0
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +8 -2
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +14 -4
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Carousel/Carousel.js +6 -4
- package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
- package/mobile/lib/components/PictureText/renderBenefit.js +1 -0
- package/mobile/lib/components/PictureText/renderBenefit.js.map +1 -1
- package/mobile/lib/components/ProductTile/renderBenefit.js +1 -0
- package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlock.js +24 -4
- package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/mobile/lib/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/mobile/lib/components/StepsBlock/checkCanRenderIcon.js +2 -0
- package/mobile/lib/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
- package/mobile/lib/components/StepsBlock/renderStep.d.ts +11 -0
- package/mobile/lib/components/StepsBlock/renderStep.js +31 -0
- package/mobile/lib/components/StepsBlock/renderStep.js.map +1 -0
- package/mobile/lib/components/Tabs/Tabs.js +4 -4
- package/mobile/lib/components/Tabs/Tabs.js.map +1 -1
- package/mobile/lib/components/Tile/Tile.js +3 -3
- package/mobile/lib/components/Tile/Tile.js.map +1 -1
- package/mobile/lib/components/Tile/TileContent.d.ts +2 -2
- package/mobile/lib/hooks/useLink.js +2 -3
- package/mobile/lib/hooks/useLink.js.map +1 -1
- package/mobile/lib/hooks/useRouter.d.ts +6 -2
- package/mobile/lib/hooks/useRouter.js.map +1 -1
- package/mobile/lib/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/mobile/lib/services/BlockRouter/BlockRouter.js +8 -28
- package/mobile/lib/services/BlockRouter/BlockRouter.js.map +1 -1
- package/mobile/lib/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/mobile/lib/services/BlockRouter/blockRouterEventBus.js +3 -0
- package/mobile/lib/services/BlockRouter/blockRouterEventBus.js.map +1 -0
- package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.js +6 -17
- package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
- package/mobile/lib/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js +12 -13
- package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/mobile/lib/ui-kit/BlockWrapper.js +2 -2
- package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/src/EventBus/EventBus.ts +1 -7
- package/mobile/src/EventBus/defaultEventBus.ts +8 -0
- package/mobile/src/components/ButtonBlock/ButtonBlock.example.json +2 -2
- package/mobile/src/components/ButtonBlock/ButtonBlock.tsx +5 -2
- package/mobile/src/components/ButtonBlock/ButtonBlockContent.ts +5 -1
- package/mobile/src/components/Calculator/Rate.tsx +1 -1
- package/mobile/src/components/Calculator/constants.ts +2 -2
- package/mobile/src/components/Calculator/rangeHelpers.ts +24 -0
- package/mobile/src/components/Calculator/useBusinessDepositCalculatorParams.ts +15 -3
- package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +8 -2
- package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +18 -4
- package/mobile/src/components/Carousel/Carousel.tsx +6 -4
- package/mobile/src/components/PictureText/renderBenefit.tsx +1 -0
- package/mobile/src/components/ProductTile/renderBenefit.tsx +1 -0
- package/mobile/src/components/StepsBlock/StepsBlock.tsx +29 -5
- package/mobile/src/components/StepsBlock/StepsBlock.ui.json +6 -0
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +13 -1
- package/mobile/src/components/StepsBlock/checkCanRenderIcon.ts +3 -0
- package/mobile/src/components/StepsBlock/renderStep.tsx +83 -0
- package/mobile/src/components/Tabs/Tabs.tsx +4 -4
- package/mobile/src/components/Tile/Tile.example.json +1 -1
- package/mobile/src/components/Tile/Tile.tsx +4 -4
- package/mobile/src/components/Tile/Tile.ui.json +7 -1
- package/mobile/src/components/Tile/TileContent.ts +2 -2
- package/mobile/src/hooks/useLink.ts +2 -3
- package/mobile/src/hooks/useRouter.ts +6 -2
- package/mobile/src/services/BlockRouter/BlockRouter.ts +8 -47
- package/mobile/src/services/BlockRouter/blockRouterEventBus.ts +13 -0
- package/mobile/src/services/BlockRouter/useBlockIntersectionObserver.ts +6 -23
- package/mobile/src/services/BlockRouter/useBlockRouterProvider.ts +13 -19
- package/mobile/src/ui-kit/BlockWrapper.tsx +2 -2
- package/package.json +1 -1
- package/src/EventBus/EventBus.ts +1 -7
- package/src/EventBus/defaultEventBus.ts +8 -0
- package/src/components/ButtonBlock/ButtonBlock.example.json +2 -2
- package/src/components/ButtonBlock/ButtonBlock.tsx +5 -2
- package/src/components/ButtonBlock/ButtonBlockContent.ts +5 -1
- package/src/components/Calculator/Rate.tsx +1 -1
- package/src/components/Calculator/constants.ts +2 -2
- package/src/components/Calculator/rangeHelpers.ts +24 -0
- package/src/components/Calculator/useBusinessDepositCalculatorParams.ts +15 -3
- package/src/components/Calculator/useCreditCalculatorParams.ts +8 -2
- package/src/components/Calculator/useDepositCalculatorParams.ts +18 -4
- package/src/components/Carousel/Carousel.tsx +6 -4
- package/src/components/PictureText/renderBenefit.tsx +1 -0
- package/src/components/ProductTile/renderBenefit.tsx +1 -0
- package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +19 -1
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +10 -3
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +29 -5
- package/src/components/StepsBlock/StepsBlock.tsx +28 -16
- package/src/components/StepsBlock/StepsBlock.ui.json +6 -0
- package/src/components/StepsBlock/StepsBlockContent.ts +13 -1
- package/src/components/StepsBlock/checkCanRenderIcon.ts +3 -0
- package/src/components/StepsBlock/renderStep.tsx +83 -0
- package/src/components/Tabs/Tabs.tsx +4 -4
- package/src/components/Tile/Tile.example.json +1 -1
- package/src/components/Tile/Tile.fixture.tsx +2 -2
- package/src/components/Tile/Tile.tsx +4 -4
- package/src/components/Tile/Tile.ui.json +7 -1
- package/src/components/Tile/TileContent.ts +2 -2
- package/src/hooks/useLink.ts +2 -3
- package/src/hooks/useRouter.ts +6 -2
- package/src/services/BlockRouter/BlockRouter.ts +8 -47
- package/src/services/BlockRouter/blockRouterEventBus.ts +13 -0
- package/src/services/BlockRouter/useBlockIntersectionObserver.ts +6 -23
- package/src/services/BlockRouter/useBlockRouterProvider.ts +13 -19
- package/src/ui-kit/BlockWrapper.tsx +2 -2
- package/bundle/EventBus/EventMap.d.ts +0 -4
- package/bundle/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/bundle/utils/checkIsIconRenderable.d.ts +0 -2
- package/dist/EventBus/EventMap.d.ts +0 -4
- package/dist/EventBus/EventMap.js +0 -2
- package/dist/EventBus/EventMap.js.map +0 -1
- package/dist/components/StepsBlock/renderStepContent.js +0 -19
- package/dist/components/StepsBlock/renderStepContent.js.map +0 -1
- package/dist/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/dist/services/BlockRouter/useBlockRouter.js +0 -8
- package/dist/services/BlockRouter/useBlockRouter.js.map +0 -1
- package/dist/utils/checkIsIconRenderable.d.ts +0 -2
- package/dist/utils/checkIsIconRenderable.js +0 -5
- package/dist/utils/checkIsIconRenderable.js.map +0 -1
- package/lib/EventBus/EventMap.d.ts +0 -4
- package/lib/EventBus/EventMap.js +0 -2
- package/lib/EventBus/EventMap.js.map +0 -1
- package/lib/components/StepsBlock/renderStepContent.js +0 -16
- package/lib/components/StepsBlock/renderStepContent.js.map +0 -1
- package/lib/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/lib/services/BlockRouter/useBlockRouter.js +0 -5
- package/lib/services/BlockRouter/useBlockRouter.js.map +0 -1
- package/lib/utils/checkIsIconRenderable.d.ts +0 -2
- package/lib/utils/checkIsIconRenderable.js +0 -2
- package/lib/utils/checkIsIconRenderable.js.map +0 -1
- package/mobile/bundle/EventBus/EventMap.d.ts +0 -4
- package/mobile/bundle/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/mobile/bundle/utils/checkIsIconRenderable.d.ts +0 -2
- package/mobile/dist/EventBus/EventMap.d.ts +0 -4
- package/mobile/dist/EventBus/EventMap.js +0 -2
- package/mobile/dist/EventBus/EventMap.js.map +0 -1
- package/mobile/dist/components/StepsBlock/renderStepContent.d.ts +0 -11
- package/mobile/dist/components/StepsBlock/renderStepContent.js +0 -19
- package/mobile/dist/components/StepsBlock/renderStepContent.js.map +0 -1
- package/mobile/dist/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/mobile/dist/services/BlockRouter/useBlockRouter.js +0 -8
- package/mobile/dist/services/BlockRouter/useBlockRouter.js.map +0 -1
- package/mobile/dist/utils/checkIsIconRenderable.d.ts +0 -2
- package/mobile/dist/utils/checkIsIconRenderable.js +0 -5
- package/mobile/dist/utils/checkIsIconRenderable.js.map +0 -1
- package/mobile/lib/EventBus/EventMap.d.ts +0 -4
- package/mobile/lib/EventBus/EventMap.js +0 -2
- package/mobile/lib/EventBus/EventMap.js.map +0 -1
- package/mobile/lib/components/StepsBlock/renderStepContent.d.ts +0 -11
- package/mobile/lib/components/StepsBlock/renderStepContent.js +0 -16
- package/mobile/lib/components/StepsBlock/renderStepContent.js.map +0 -1
- package/mobile/lib/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/mobile/lib/services/BlockRouter/useBlockRouter.js +0 -5
- package/mobile/lib/services/BlockRouter/useBlockRouter.js.map +0 -1
- package/mobile/lib/utils/checkIsIconRenderable.d.ts +0 -2
- package/mobile/lib/utils/checkIsIconRenderable.js +0 -2
- package/mobile/lib/utils/checkIsIconRenderable.js.map +0 -1
- package/mobile/src/EventBus/EventMap.ts +0 -5
- package/mobile/src/components/StepsBlock/renderStepContent.tsx +0 -83
- package/mobile/src/services/BlockRouter/useBlockRouter.ts +0 -5
- package/mobile/src/utils/checkIsIconRenderable.tsx +0 -3
- package/src/EventBus/EventMap.ts +0 -5
- package/src/components/StepsBlock/renderStepContent.tsx +0 -83
- package/src/services/BlockRouter/useBlockRouter.ts +0 -5
- package/src/utils/checkIsIconRenderable.tsx +0 -3
|
@@ -5,8 +5,10 @@ const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
|
5
5
|
const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
|
|
6
6
|
const Heading_1 = require("../../ui-kit/Heading/Heading");
|
|
7
7
|
const Img_1 = require("../../ui-kit/Img/Img");
|
|
8
|
-
const
|
|
8
|
+
const RichText_1 = require("../../ui-kit/RichText/RichText");
|
|
9
|
+
const assertUnreachable_1 = require("../../utils/assertUnreachable");
|
|
9
10
|
const getIconWithVersion_1 = require("../../utils/getIconWithVersion");
|
|
11
|
+
const checkCanRenderIcon_1 = require("./checkCanRenderIcon");
|
|
10
12
|
const StepsBlockStyleMaps_1 = require("./StepsBlockStyleMaps");
|
|
11
13
|
const STEPS_SIZE_MAP = {
|
|
12
14
|
normal: 'h-[70px] w-[70px] min-w-[70px] min-h-[70px]',
|
|
@@ -18,9 +20,27 @@ const STEPS_TILE_DESCRIPTION_HEIGHT_MAP = {
|
|
|
18
20
|
};
|
|
19
21
|
exports.StepsBlock = (0, uni_jsx_1.JSX)(({ className = '', title, description, showLines = true, steps, size = 'normal', version = 'primary', ...rest }) => {
|
|
20
22
|
const styleMap = StepsBlockStyleMaps_1.STEPS_BLOCK_STYLE_MAPS[version];
|
|
21
|
-
return ((0, jsx_runtime_1.jsxs)(BlockWrapper_1.BlockWrapper, { className: `box-border px-4 py-6 flex flex-col ${className}`, version: version, ...rest, children: [title ? (0, jsx_runtime_1.jsx)(Heading_1.Heading, { headingType: "h3", className: "text-center", title: title }) : null, description ? ((0, jsx_runtime_1.jsx)("p", { className: `text-m-light text-center ${styleMap.description} ${title ? 'mt-2' : ''}`, children: description })) : null, steps?.length ? ((0, jsx_runtime_1.jsx)("div", { className: `box-border py-0.5 mb-0.5 mt-5`, children: (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col justify-between gap-x-[101px]", children: steps.map(
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(BlockWrapper_1.BlockWrapper, { className: `box-border px-4 py-6 flex flex-col ${className}`, version: version, ...rest, children: [title ? (0, jsx_runtime_1.jsx)(Heading_1.Heading, { headingType: "h3", className: "text-center", title: title }) : null, description ? ((0, jsx_runtime_1.jsx)("p", { className: `text-m-light text-center ${styleMap.description} ${title ? 'mt-2' : ''}`, children: description })) : null, steps?.length ? ((0, jsx_runtime_1.jsx)("div", { className: `box-border py-0.5 mb-0.5 mt-5`, children: (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col justify-between gap-x-[101px]", children: steps.map(renderStep(size, version, showLines)) }) })) : null] }));
|
|
22
24
|
});
|
|
23
|
-
|
|
25
|
+
// TODO: Create universal function for this case
|
|
26
|
+
const renderStep = (size, version, showLines) =>
|
|
27
|
+
// Linter doesn't understand that switch processes all cases
|
|
28
|
+
// eslint-disable-next-line consistent-return
|
|
29
|
+
(step, i, steps) => {
|
|
30
|
+
const { type } = step;
|
|
31
|
+
if (!(type === 'default' || type === 'rte')) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
switch (type) {
|
|
35
|
+
case 'default':
|
|
36
|
+
return renderDefaultStep(size, version, showLines)(step, i, steps);
|
|
37
|
+
case 'rte':
|
|
38
|
+
return (0, jsx_runtime_1.jsx)(RichText_1.RichText, { __html: step.__html });
|
|
39
|
+
default:
|
|
40
|
+
(0, assertUnreachable_1.assertUnreachable)(step);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const renderDefaultStep = (size, version, showLines) => (step, i, steps) => {
|
|
24
44
|
const isLastStep = steps.length - 1 === i;
|
|
25
45
|
const margin = size === 'normal' ? 'ml-[34px]' : 'ml-6';
|
|
26
46
|
const styleMap = StepsBlockStyleMaps_1.STEPS_BLOCK_STYLE_MAPS[version];
|
|
@@ -31,6 +51,6 @@ const renderIconArea = (size, version) => (step, i) => {
|
|
|
31
51
|
const iconAreaSize = STEPS_SIZE_MAP[size];
|
|
32
52
|
const iconSize = size === 'normal' ? '38' : '27';
|
|
33
53
|
const iconTextSize = size === 'normal' ? 'text-m-title' : 'text-m-title-xs';
|
|
34
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: `${iconAreaSize} ${styleMap.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`, children: (0, jsx_runtime_1.jsx)("span", { className: `font-medium flex self-center ${iconTextSize}`, children: (0,
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: `${iconAreaSize} ${styleMap.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`, children: (0, jsx_runtime_1.jsx)("span", { className: `font-medium flex self-center ${iconTextSize}`, children: (0, checkCanRenderIcon_1.checkCanRenderIcon)(step?.icon) ? ((0, jsx_runtime_1.jsx)(Img_1.Img, { image: (0, getIconWithVersion_1.getIconWithVersion)({ ...step.icon }, version), width: iconSize, height: iconSize, asSVG: true })) : ((0, jsx_runtime_1.jsx)("span", { children: i + 1 })) }) }));
|
|
35
55
|
};
|
|
36
56
|
//# sourceMappingURL=StepsBlock.mobile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepsBlock.mobile.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/StepsBlock.mobile.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAIxC,4DAAyD;AACzD,0DAAuD;AACvD,8CAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"StepsBlock.mobile.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/StepsBlock.mobile.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAIxC,4DAAyD;AACzD,0DAAuD;AACvD,8CAA2C;AAC3C,6DAA0D;AAC1D,qEAAkE;AAClE,uEAAoE;AACpE,6DAA0D;AAE1D,+DAA+D;AAI/D,MAAM,cAAc,GAAgC;IAClD,MAAM,EAAE,6CAA6C;IACrD,KAAK,EAAE,6BAA6B;CACrC,CAAC;AAEF,MAAM,iCAAiC,GAAgC;IACrE,MAAM,EAAE,cAAc;IACtB,KAAK,EAAE,UAAU;CAClB,CAAC;AAEW,QAAA,UAAU,GAAG,IAAA,aAAG,EAC3B,CAAC,EACC,SAAS,GAAG,EAAE,EACd,KAAK,EACL,WAAW,EACX,SAAS,GAAG,IAAI,EAChB,KAAK,EACL,IAAI,GAAG,QAAQ,EACf,OAAO,GAAG,SAAS,EACnB,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,4CAAsB,CAAC,OAAO,CAAC,CAAC;IAEjD,OAAO,CACL,wBAAC,2BAAY,IACX,SAAS,EAAE,sCAAsC,SAAS,EAAE,EAC5D,OAAO,EAAE,OAAO,KACZ,IAAI,aAEP,KAAK,CAAC,CAAC,CAAC,uBAAC,iBAAO,IAAC,WAAW,EAAC,IAAI,EAAC,SAAS,EAAC,aAAa,EAAC,KAAK,EAAE,KAAK,GAAI,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,YAAY,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IAE1C,MAAM,QAAQ,GAAG,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACjD,MAAM,YAAY,GAAG,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAE5E,OAAO,CACL,gCACE,SAAS,EAAE,GAAG,YAAY,IAAI,QAAQ,CAAC,cAAc,4DAA4D,YAEjH,iCAAM,SAAS,EAAE,gCAAgC,YAAY,EAAE,YAC5D,IAAA,uCAAkB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAChC,uBAAC,SAAG,IACF,KAAK,EAAE,IAAA,uCAAkB,EAAC,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,EACpD,KAAK,EAAE,QAAQ,EACf,MAAM,EAAE,QAAQ,EAChB,KAAK,SACL,CACH,CAAC,CAAC,CAAC,CACF,2CAAO,CAAC,GAAG,CAAC,GAAQ,CACrB,GACI,GACH,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { DefaultListItemType } from '../../model/DefaultListItemType';
|
|
2
3
|
import type { DescriptionProps, HeadlineCommonProps, LabelProps } from '../../model/HeadlineType';
|
|
3
4
|
import type { IconProps } from '../../model/Picture';
|
|
5
|
+
import type { RichTextItem } from '../../model/RichTextItem';
|
|
4
6
|
import type { SizeVersion } from '../../model/SizeVersion';
|
|
5
7
|
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
6
8
|
declare type StepCommonProps = IconProps & {
|
|
@@ -14,10 +16,18 @@ declare type StepCommonProps = IconProps & {
|
|
|
14
16
|
/** @title Список */
|
|
15
17
|
items?: string[];
|
|
16
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* @title Стандартный
|
|
21
|
+
*/
|
|
22
|
+
export declare type DefaultStep = DescriptionProps & LabelProps & StepCommonProps & DefaultListItemType;
|
|
23
|
+
/**
|
|
24
|
+
* @title Форматированный текст
|
|
25
|
+
*/
|
|
26
|
+
declare type RichTextStep = RichTextItem & IconProps;
|
|
17
27
|
/**
|
|
18
28
|
* @title Шаг
|
|
19
29
|
*/
|
|
20
|
-
export declare type Step =
|
|
30
|
+
export declare type Step = DefaultStep | RichTextStep;
|
|
21
31
|
/**
|
|
22
32
|
* @title Блок шаги
|
|
23
33
|
*/
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.checkCanRenderIcon = void 0;
|
|
3
|
+
const checkCanRenderIcon = (icon) => Boolean(icon?.icon || icon?.src);
|
|
4
|
+
exports.checkCanRenderIcon = checkCanRenderIcon;
|
|
5
|
+
//# sourceMappingURL=checkCanRenderIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkCanRenderIcon.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/checkCanRenderIcon.ts"],"names":[],"mappings":";;AAEO,MAAM,kBAAkB,GAAG,CAAC,IAAc,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,GAAG,CAAC,CAAC;AAA1E,QAAA,kBAAkB,sBAAwD"}
|
|
@@ -2,10 +2,10 @@ import type { BlockVersion } from '../../model/BlockVersion';
|
|
|
2
2
|
import type { VNode } from '../../model/VNode';
|
|
3
3
|
import type { Step } from './StepsBlockContent';
|
|
4
4
|
import type { StyleType } from './StepsBlockStyleMaps';
|
|
5
|
-
|
|
5
|
+
interface RenderStepProps {
|
|
6
6
|
styleMap: StyleType;
|
|
7
7
|
isMainButton: boolean;
|
|
8
|
-
version?: BlockVersion
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
}
|
|
8
|
+
version?: BlockVersion;
|
|
9
|
+
}
|
|
10
|
+
export declare const renderStep: (props: RenderStepProps) => (step: Step, i: number, arr: Step[]) => VNode;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.renderStep = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const Button_1 = require("../../ui-kit/Button/Button");
|
|
5
|
+
const List_1 = require("../../ui-kit/List/List");
|
|
6
|
+
const RichText_1 = require("../../ui-kit/RichText/RichText");
|
|
7
|
+
const Text_1 = require("../../ui-kit/Text/Text");
|
|
8
|
+
const assertUnreachable_1 = require("../../utils/assertUnreachable");
|
|
9
|
+
const style_1 = require("../../utils/style");
|
|
10
|
+
// TODO: Create universal function for this case
|
|
11
|
+
const renderStep = (props) =>
|
|
12
|
+
// Linter doesn't understand that switch processes all cases
|
|
13
|
+
// eslint-disable-next-line consistent-return
|
|
14
|
+
(step, i, arr) => {
|
|
15
|
+
const { type } = step;
|
|
16
|
+
if (!(type === 'default' || type === 'rte')) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
switch (type) {
|
|
20
|
+
case 'default':
|
|
21
|
+
return renderDefaultStep(props)(step, i, arr);
|
|
22
|
+
case 'rte':
|
|
23
|
+
return (0, jsx_runtime_1.jsx)(RichText_1.RichText, { __html: step.__html });
|
|
24
|
+
default:
|
|
25
|
+
(0, assertUnreachable_1.assertUnreachable)(step);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.renderStep = renderStep;
|
|
29
|
+
const renderDefaultStep = ({ styleMap, isMainButton, version }) => (step, i, arr) => {
|
|
30
|
+
const { label, description, button, items, isDotted } = step;
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)('relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden', getContainerWidth(arr.length)), children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)(button?.text ? 'mb-8' : '', 'text-center'), children: [label ? ((0, jsx_runtime_1.jsx)("div", { className: "mb-2", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { size: "text-h6", children: label }) })) : null, (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center", children: [description ? (0, jsx_runtime_1.jsx)("div", { className: styleMap.description, children: description }) : null, (0, jsx_runtime_1.jsx)(List_1.List, { className: (0, style_1.style)(description ? `${styleMap.description} mt-0.5` : 'text-h6'), items: items, listItemSize: "M", isDotted: isDotted })] })] }), button?.text && !isMainButton ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { className: "box-border py-3 h-12 w-full max-w-[240px] mt-auto", version: version, ...button, children: button?.text })) : null] }, String(i)));
|
|
32
|
+
};
|
|
33
|
+
const getContainerWidth = (length) => (length < 5 ? 'w-[276px]' : 'w-[210px]');
|
|
34
|
+
//# sourceMappingURL=renderStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderStep.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/renderStep.tsx"],"names":[],"mappings":";;;AAGA,uDAAoD;AACpD,iDAA8C;AAC9C,6DAA0D;AAC1D,iDAA8C;AAC9C,qEAAkE;AAClE,6CAA0C;AAU1C,gDAAgD;AACzC,MAAM,UAAU,GACrB,CAAC,KAAsB,EAAE,EAAE;AAC3B,4DAA4D;AAC5D,6CAA6C;AAC7C,CAAC,IAAU,EAAE,CAAS,EAAE,GAAW,EAAS,EAAE;IAC5C,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAEtB,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,KAAK,CAAC,EAAE;QAC3C,OAAO,IAAI,CAAC;KACb;IAED,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QAChD,K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AAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAC/B,uBAAC,eAAM,IACL,SAAS,EAAC,mDAAmD,EAC7D,OAAO,EAAE,OAAwB,KAC7B,MAAM,YAET,MAAM,EAAE,IAAI,GACN,CACV,CAAC,CAAC,CAAC,IAAI,KA9BH,MAAM,CAAC,CAAC,CAAC,CA+BV,CACP,CAAC;AACJ,CAAC,CAAC;AAEJ,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -3,14 +3,14 @@ exports.Tabs = void 0;
|
|
|
3
3
|
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
|
-
const
|
|
6
|
+
const defaultEventBus_1 = require("../../EventBus/defaultEventBus");
|
|
7
7
|
const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
|
|
8
8
|
const renderTab_1 = require("./renderTab");
|
|
9
9
|
const ScrollableTabs_1 = require("./ScrollableTabs");
|
|
10
10
|
exports.Tabs = (0, uni_jsx_1.JSX)((props) => {
|
|
11
11
|
const { className = '', tabs, showCounter, isSticky, tabsMode, ...rest } = props;
|
|
12
12
|
const [currentTab, setCurrentTab] = (0, hooks_1.useState)(tabs ? tabs[0] : undefined);
|
|
13
|
-
(0, hooks_1.useEffect)(() =>
|
|
13
|
+
(0, hooks_1.useEffect)(() => defaultEventBus_1.defaultEventBus.subscribe('tab', (event) => {
|
|
14
14
|
const tab = tabs?.find(checkTab(event));
|
|
15
15
|
if (event.type === 'link' && tab) {
|
|
16
16
|
setCurrentTab(tab);
|
|
@@ -18,11 +18,11 @@ exports.Tabs = (0, uni_jsx_1.JSX)((props) => {
|
|
|
18
18
|
return [];
|
|
19
19
|
}), [tabs]);
|
|
20
20
|
(0, hooks_1.useEffect)(() => currentTab?.type === 'group'
|
|
21
|
-
?
|
|
21
|
+
? defaultEventBus_1.defaultEventBus.subject('tab', { type: currentTab.type, label: currentTab.ref })
|
|
22
22
|
: undefined, [currentTab]);
|
|
23
23
|
const handleClick = (0, hooks_1.useCallback)((selectedTab) => {
|
|
24
24
|
if (selectedTab?.type === 'group') {
|
|
25
|
-
|
|
25
|
+
defaultEventBus_1.defaultEventBus.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
|
|
26
26
|
}
|
|
27
27
|
setCurrentTab(selectedTab);
|
|
28
28
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAA+E;AAC/E,
|
|
1
|
+
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAA+E;AAC/E,oEAAiE;AAEjE,4DAAyD;AACzD,2CAAwC;AACxC,qDAAkD;AAUrC,QAAA,IAAI,GAAG,IAAA,aAAG,EAAiB,CAAC,KAAK,EAAE,EAAE;IAChD,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAEjF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAEzE,IAAA,iBAAS,EACP,GAAG,EAAE,CACH,iCAAe,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;QACzC,MAAM,GAAG,GAAG,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC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;YACpB,UAAU;YACV,WAAW;YACX,GAAG,IAAI;SACR,CAAC,CACH,CACF,GACY,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,CAAC,KAAyB,EAAE,EAAE,CAAC,CAAC,CAAU,EAAE,EAAE,CAC7D,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -7,13 +7,13 @@ const renderButtonsSection_1 = require("../../ui-kit/Button/renderButtonsSection
|
|
|
7
7
|
const Heading_1 = require("../../ui-kit/Heading/Heading");
|
|
8
8
|
const Img_1 = require("../../ui-kit/Img/Img");
|
|
9
9
|
const List_1 = require("../../ui-kit/List/List");
|
|
10
|
-
const
|
|
10
|
+
const RichText_1 = require("../../ui-kit/RichText/RichText");
|
|
11
11
|
const Tags_1 = require("../../ui-kit/Tags/Tags");
|
|
12
12
|
const BaseTile_1 = require("../BaseTile/BaseTile");
|
|
13
13
|
const getTileMinHeight_1 = require("../BaseTile/getTileMinHeight");
|
|
14
14
|
const getTileRightPadding_1 = require("../BaseTile/getTileRightPadding");
|
|
15
|
-
exports.Tile = (0, uni_jsx_1.JSX)(({ title, headingType = 'h3',
|
|
15
|
+
exports.Tile = (0, uni_jsx_1.JSX)(({ title, headingType = 'h3', __html, items, buttons, image, isDotted = true, listItemSize = 'M', className = '', tags, children, ...rest }) => ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: `overflow-hidden p-9 pr-3 box-border ${(0, getTileRightPadding_1.getTileRightPadding)(className)} ${(0, getTileMinHeight_1.getTileMinHeight)(className)} ${className}`, ...rest, children: (0, jsx_runtime_1.jsxs)(BaseTile_1.BaseTile, { title: title ? ((0, jsx_runtime_1.jsx)(Heading_1.Heading, { headingType: headingType, as: "h2", title: title, className: `whitespace-pre-wrap max-w-[600px]` })) : null, buttons: (0, renderButtonsSection_1.renderButtonsSection)(buttons, {
|
|
16
16
|
className: 'mt-8',
|
|
17
17
|
buttonClassName: 'min-w-[158px]',
|
|
18
|
-
}), image: image?.src ? (0, jsx_runtime_1.jsx)(Img_1.Img, { className: "mt-auto ml-7", image: image }) : null, children: [
|
|
18
|
+
}), image: image?.src ? (0, jsx_runtime_1.jsx)(Img_1.Img, { className: "mt-auto ml-7", image: image }) : null, children: [__html ? ((0, jsx_runtime_1.jsx)("div", { className: "max-w-[600px] mt-2.5", children: (0, jsx_runtime_1.jsx)(RichText_1.RichText, { __html: __html }) })) : null, children, (0, jsx_runtime_1.jsx)(List_1.List, { className: "mt-2.5", itemClassName: "mb-1.5", items: items, isDotted: isDotted, listItemSize: listItemSize }), tags?.length ? (0, jsx_runtime_1.jsx)(Tags_1.Tags, { tags: tags, className: "mt-5" }) : null] }) })));
|
|
19
19
|
//# sourceMappingURL=Tile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tile.js","sourceRoot":"","sources":["../../../src/components/Tile/Tile.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,4DAAyD;AACzD,mFAAgF;AAChF,0DAAuD;AACvD,8CAA2C;AAC3C,iDAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"Tile.js","sourceRoot":"","sources":["../../../src/components/Tile/Tile.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,4DAAyD;AACzD,mFAAgF;AAChF,0DAAuD;AACvD,8CAA2C;AAC3C,iDAA8C;AAC9C,6DAA0D;AAC1D,iDAA8C;AAC9C,mDAAgD;AAChD,mEAAgE;AAChE,yEAAsE;AAKzD,QAAA,IAAI,GAAG,IAAA,aAAG,EACrB,CAAC,EACC,KAAK,EACL,WAAW,GAAG,IAAI,EAClB,MAAM,EACN,KAAK,EACL,OAAO,EACP,KAAK,EACL,QAAQ,GAAG,IAAI,EACf,YAAY,GAAG,GAAG,EAClB,SAAS,GAAG,EAAE,EACd,IAAI,EACJ,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,EAAE,CAAC,CACJ,uBAAC,2BAAY,IACX,SAAS,EAAE,uCAAuC,IAAA,yCAAmB,EACnE,SAAS,CACV,IAAI,IAAA,mCAAgB,EAAC,SAAS,CAAC,IAAI,SAAS,EAAE,KAC3C,IAAI,YAER,wBAAC,mBAAQ,IACP,KAAK,EACH,KAAK,CAAC,CAAC,CAAC,CACN,uBAAC,iBAAO,IACN,WAAW,EAAE,WAAW,EACxB,EAAE,EAAC,IAAI,EACP,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,mCAAmC,GAC9C,CACH,CAAC,CAAC,CAAC,IAAI,EAEV,OAAO,EAAE,IAAA,2CAAoB,EAAC,OAAO,EAAE;YACrC,SAAS,EAAE,MAAM;YACjB,eAAe,EAAE,eAAe;SACjC,CAAC,EACF,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,uBAAC,SAAG,IAAC,SAAS,EAAC,cAAc,EAAC,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,IAAI,aAExE,MAAM,CAAC,CAAC,CAAC,CACR,gCAAK,SAAS,EAAC,sBAAsB,YACnC,uBAAC,mBAAQ,IAAC,MAAM,EAAE,MAAM,GAAI,GACxB,CACP,CAAC,CAAC,CAAC,IAAI,EACP,QAAQ,EACT,uBAAC,WAAI,IACH,SAAS,EAAC,QAAQ,EAClB,aAAa,EAAC,QAAQ,EACtB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,GAC1B,EACD,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,uBAAC,WAAI,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,IACnD,GACE,CAChB,CACF,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
-
import type { DescriptionProps } from '../../model/HeadlineType';
|
|
3
2
|
import type { Picture } from '../../model/Picture';
|
|
4
3
|
import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
|
|
5
4
|
import type { HeadingCommonProps } from '../../ui-kit/Heading/HeadingProps';
|
|
6
5
|
import type { ListContent } from '../../ui-kit/List/ListContent';
|
|
7
6
|
import type { ListItemSize } from '../../ui-kit/List/ListProps';
|
|
7
|
+
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
8
8
|
import type { TagsContent } from '../../ui-kit/Tags/TagsContent';
|
|
9
9
|
/**
|
|
10
10
|
* @title Плитка
|
|
11
11
|
*/
|
|
12
|
-
export declare type TileContent = HeadingCommonProps &
|
|
12
|
+
export declare type TileContent = HeadingCommonProps & RichTextProps & ListContent & ButtonContent & TagsContent & {
|
|
13
13
|
/**
|
|
14
14
|
* @default {
|
|
15
15
|
* "format": "webp",
|
package/dist/hooks/useLink.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
2
|
exports.useLink = void 0;
|
|
3
3
|
const ProjectSettings_1 = require("../ProjectSettings");
|
|
4
|
-
const
|
|
4
|
+
const BlockRouter_1 = require("../services/BlockRouter/BlockRouter");
|
|
5
5
|
const url_1 = require("../utils/url");
|
|
6
6
|
const handlerDecorator_1 = require("./handlerDecorator");
|
|
7
7
|
const useRouter_1 = require("./useRouter");
|
|
8
8
|
function useLink(isRemote) {
|
|
9
9
|
const router = (0, useRouter_1.useRouter)();
|
|
10
|
-
const blockRouter = (0, useBlockRouter_1.useBlockRouter)();
|
|
11
10
|
return (props) => ({
|
|
12
11
|
...props,
|
|
13
12
|
href: adjustHref(props.href),
|
|
@@ -30,7 +29,7 @@ function useLink(isRemote) {
|
|
|
30
29
|
// Client routing
|
|
31
30
|
ev?.preventDefault();
|
|
32
31
|
if ((0, url_1.isHash)(href)) {
|
|
33
|
-
|
|
32
|
+
(0, BlockRouter_1.gotoBlock)(router, href);
|
|
34
33
|
}
|
|
35
34
|
else if (href) {
|
|
36
35
|
router.push(href);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLink.js","sourceRoot":"","sources":["../../src/hooks/useLink.ts"],"names":[],"mappings":";;AACA,wDAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"useLink.js","sourceRoot":"","sources":["../../src/hooks/useLink.ts"],"names":[],"mappings":";;AACA,wDAAqD;AACrD,qEAAgE;AAChE,sCAA4D;AAC5D,yDAAsD;AACtD,2CAAwC;AAUxC,SAAgB,OAAO,CAAC,QAAkB;IACxC,MAAM,MAAM,GAAG,IAAA,qBAAS,GAAE,CAAC;IAE3B,OAAO,CAA2C,KAAQ,EAAiB,EAAE,CAAC,CAAC;QAC7E,GAAG,KAAK;QACR,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC;QAC5B,YAAY,EAAE,KAAK,CAAC,IAAI;QACxB,OAAO,EAAE,IAAA,mCAAgB,EAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;KACpD,CAAC,CAAC;IAEH,SAAS,UAAU,CAAC,IAAwB;QAC1C,MAAM,gBAAgB,GAAG,CAAC,QAAQ,IAAI,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;QAE5D,OAAO,iCAAe,CAAC,SAAS,IAAI,IAAI,IAAI,gBAAgB;YAC1D,CAAC,CAAC,IAAA,cAAQ,EAAC,iCAAe,CAAC,SAAS,EAAE,IAAI,CAAC;YAC3C,CAAC,CAAC,IAAI,CAAC;IACX,CAAC;IAED,SAAS,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAkC;QAC3E,OAAO,CAAC,EAAqB,EAAE,EAAE;YAC/B,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC;YAEvB,IAAI,QAAQ,IAAI,CAAC,IAAA,gBAAU,EAAC,IAAI,EAAE,MAAM,CAAC,EAAE;gBACzC,kBAAkB;gBAClB,OAAO;aACR;YAED,iBAAiB;YACjB,EAAE,EAAE,cAAc,EAAE,CAAC;YACrB,IAAI,IAAA,YAAM,EAAC,IAAI,CAAC,EAAE;gBAChB,IAAA,uBAAS,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC;aACzB;iBAAM,IAAI,IAAI,EAAE;gBACf,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACnB;QACH,CAAC,CAAC;IACJ,CAAC;AACH,CAAC;AApCD,0BAoCC"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
interface RouterOptions {
|
|
2
|
+
scroll?: boolean;
|
|
3
|
+
}
|
|
1
4
|
export interface Router {
|
|
2
5
|
pathname: string;
|
|
3
6
|
query: Record<string, string | string[] | undefined>;
|
|
4
7
|
href?: string;
|
|
5
8
|
basePath?: string;
|
|
6
|
-
push: (url: string) => void;
|
|
7
|
-
replace: (url: string) => void;
|
|
9
|
+
push: (url: string, as?: string, options?: RouterOptions) => void;
|
|
10
|
+
replace: (url: string, as?: string, options?: RouterOptions) => void;
|
|
8
11
|
}
|
|
9
12
|
export declare function useRouter(): Router;
|
|
10
13
|
export declare namespace useRouter {
|
|
11
14
|
var _impl: () => Router;
|
|
12
15
|
var setup: (impl: () => Router) => void;
|
|
13
16
|
}
|
|
17
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRouter.js","sourceRoot":"","sources":["../../src/hooks/useRouter.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"useRouter.js","sourceRoot":"","sources":["../../src/hooks/useRouter.ts"],"names":[],"mappings":";;AAaA,SAAgB,SAAS;IACvB,OAAO,SAAS,CAAC,KAAK,EAAE,CAAC;AAC3B,CAAC;AAFD,8BAEC;AAED,SAAS,CAAC,KAAK,GAAG,GAAW,EAAE,CAAC,CAAC;IAC/B,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE,IAAI,IAAI,GAAG;IACtC,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG;IAC9C,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,GAAG,EAAE;QACT,aAAa;IACf,CAAC;IACD,OAAO,EAAE,GAAG,EAAE;QACZ,aAAa;IACf,CAAC;CACF,CAAC,CAAC;AAEH,SAAS,CAAC,KAAK,GAAG,CAAC,IAAkB,EAAE,EAAE;IACvC,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC;AACzB,CAAC,CAAC"}
|
|
@@ -1,23 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Router } from '../../hooks/useRouter';
|
|
2
2
|
import type { BlockDef } from '../../model/ContentPageDef';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export interface BlockIntersectionEvent {
|
|
7
|
-
block: BlockDef;
|
|
8
|
-
intersection: IntersectionObserverEntry;
|
|
9
|
-
}
|
|
10
|
-
interface EventMap {
|
|
11
|
-
goto: GotoAnchorEvent;
|
|
12
|
-
intersection: BlockIntersectionEvent;
|
|
13
|
-
}
|
|
14
|
-
export declare class BlockRouter {
|
|
15
|
-
static readonly inst: BlockRouter;
|
|
16
|
-
readonly eventBus: EventBus<EventMap>;
|
|
17
|
-
constructor();
|
|
18
|
-
goto(rawAnchor?: string): void;
|
|
19
|
-
push(rawAnchor: string): void;
|
|
20
|
-
replace(rawAnchor: string): void;
|
|
21
|
-
reset(): void;
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
3
|
+
export declare function gotoBlock(router: Router, anchor?: string): void;
|
|
4
|
+
export declare function trackBlock(router: Router, block?: BlockDef): void;
|
|
@@ -1,33 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class BlockRouter {
|
|
7
|
-
static inst = new BlockRouter();
|
|
8
|
-
eventBus = new EventBus_1.EventBus();
|
|
9
|
-
constructor() {
|
|
10
|
-
const anchor = normalizeAnchor(globalThis.location?.hash);
|
|
11
|
-
if (anchor) {
|
|
12
|
-
this.eventBus.subject('goto', { anchor });
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
goto(rawAnchor) {
|
|
16
|
-
const anchor = normalizeAnchor(rawAnchor);
|
|
17
|
-
if (anchor) {
|
|
18
|
-
this.push(anchor);
|
|
19
|
-
this.eventBus.fire('goto', { anchor });
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
push(rawAnchor) {
|
|
23
|
-
globalThis.history?.pushState(null, '', getURLWithAnchor(rawAnchor));
|
|
24
|
-
}
|
|
25
|
-
replace(rawAnchor) {
|
|
26
|
-
globalThis.history?.replaceState(null, '', getURLWithAnchor(rawAnchor));
|
|
27
|
-
}
|
|
28
|
-
reset() {
|
|
29
|
-
globalThis.history?.replaceState(null, '', getURLWithAnchor());
|
|
30
|
-
}
|
|
2
|
+
exports.trackBlock = exports.gotoBlock = void 0;
|
|
3
|
+
const normalizeAnchor = (anchor) => anchor?.replace('#', '') || '';
|
|
4
|
+
function gotoBlock(router, anchor) {
|
|
5
|
+
router.replace(`#${normalizeAnchor(anchor)}`);
|
|
31
6
|
}
|
|
32
|
-
exports.
|
|
7
|
+
exports.gotoBlock = gotoBlock;
|
|
8
|
+
function trackBlock(router, block) {
|
|
9
|
+
router.replace(`#${normalizeAnchor(block?.anchor)}`, undefined, {
|
|
10
|
+
scroll: false,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
exports.trackBlock = trackBlock;
|
|
33
14
|
//# sourceMappingURL=BlockRouter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockRouter.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/BlockRouter.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"BlockRouter.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/BlockRouter.ts"],"names":[],"mappings":";;AAGA,MAAM,eAAe,GAAG,CAAC,MAAe,EAAE,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AAE5E,SAAgB,SAAS,CAAC,MAAc,EAAE,MAAe;IACvD,MAAM,CAAC,OAAO,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAChD,CAAC;AAFD,8BAEC;AAED,SAAgB,UAAU,CAAC,MAAc,EAAE,KAAgB;IACzD,MAAM,CAAC,OAAO,CAAC,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE;QAC9D,MAAM,EAAE,KAAK;KACd,CAAC,CAAC;AACL,CAAC;AAJD,gCAIC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EventBus } from '../../EventBus/EventBus';
|
|
2
|
+
import type { BlockDef } from '../../model/ContentPageDef';
|
|
3
|
+
export interface BlockIntersectionEvent {
|
|
4
|
+
block: BlockDef;
|
|
5
|
+
intersection: IntersectionObserverEntry;
|
|
6
|
+
}
|
|
7
|
+
interface EventMap {
|
|
8
|
+
intersection: BlockIntersectionEvent;
|
|
9
|
+
}
|
|
10
|
+
export declare const blockRouterEventBus: EventBus<EventMap>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blockRouterEventBus.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/blockRouterEventBus.ts"],"names":[],"mappings":";;AAAA,sDAAmD;AAYtC,QAAA,mBAAmB,GAAG,IAAI,mBAAQ,EAAY,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { BlockDef } from '../../model/ContentPageDef';
|
|
2
|
-
|
|
3
|
-
export declare function useBlockIntersectionObserver(block?: BlockDef, router?: BlockRouter): {
|
|
2
|
+
export declare function useBlockIntersectionObserver(block?: BlockDef): {
|
|
4
3
|
current: Element | null;
|
|
5
4
|
};
|
|
@@ -2,27 +2,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
2
2
|
exports.useBlockIntersectionObserver = void 0;
|
|
3
3
|
const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
4
4
|
const useIntersectionObserver_1 = require("../../hooks/useIntersectionObserver");
|
|
5
|
-
const
|
|
6
|
-
function useBlockIntersectionObserver(block
|
|
5
|
+
const blockRouterEventBus_1 = require("./blockRouterEventBus");
|
|
6
|
+
function useBlockIntersectionObserver(block) {
|
|
7
7
|
const observerCallback = (0, hooks_1.useCallback)((entries) => {
|
|
8
8
|
if (!block || !entries?.length) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
const intersection = entries[entries.length - 1];
|
|
12
|
-
|
|
13
|
-
}, [block
|
|
14
|
-
|
|
15
|
-
(0, hooks_1.useEffect)(() => {
|
|
16
|
-
if (!ref.current) {
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
return router.eventBus.subscribe('goto', ({ anchor }) => {
|
|
20
|
-
if (ref.current && block?.anchor === anchor) {
|
|
21
|
-
ref.current.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}, [block, router]);
|
|
25
|
-
return ref;
|
|
12
|
+
blockRouterEventBus_1.blockRouterEventBus.fire('intersection', { block, intersection });
|
|
13
|
+
}, [block]);
|
|
14
|
+
return (0, useIntersectionObserver_1.useIntersectionObserver)(observerCallback, { sensitivity: 1 });
|
|
26
15
|
}
|
|
27
16
|
exports.useBlockIntersectionObserver = useBlockIntersectionObserver;
|
|
28
17
|
//# sourceMappingURL=useBlockIntersectionObserver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBlockIntersectionObserver.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockIntersectionObserver.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"useBlockIntersectionObserver.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockIntersectionObserver.ts"],"names":[],"mappings":";;AAAA,uDAA0D;AAC1D,iFAA8E;AAE9E,+DAA4D;AAE5D,SAAgB,4BAA4B,CAAC,KAAgB;IAC3D,MAAM,gBAAgB,GAAG,IAAA,mBAAW,EAClC,CAAC,OAAoC,EAAE,EAAE;QACvC,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE;YAC9B,OAAO;SACR;QAED,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjD,yCAAmB,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;IACpE,CAAC,EACD,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,IAAA,iDAAuB,EAAC,gBAAgB,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC;AACvE,CAAC;AAdD,oEAcC"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function useBlockRouterProvider(router?: BlockRouter, scrollTarget?: EventTarget): void;
|
|
1
|
+
export declare function useBlockRouterProvider(scrollTarget?: EventTarget): void;
|
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
2
|
exports.useBlockRouterProvider = void 0;
|
|
3
3
|
const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
4
|
+
const useRouter_1 = require("../../hooks/useRouter");
|
|
4
5
|
const debounce_1 = require("../../utils/debounce");
|
|
5
6
|
const BlockRouter_1 = require("./BlockRouter");
|
|
7
|
+
const blockRouterEventBus_1 = require("./blockRouterEventBus");
|
|
6
8
|
const findActiveBlock_1 = require("./findActiveBlock");
|
|
7
9
|
const isScrolledEnough = () => globalThis.scrollY > (globalThis.innerHeight * 3) / 4;
|
|
8
|
-
function useBlockRouterProvider(
|
|
10
|
+
function useBlockRouterProvider(scrollTarget = globalThis) {
|
|
11
|
+
const router = (0, useRouter_1.useRouter)();
|
|
9
12
|
const intersectionsMapRef = (0, hooks_1.useRef)(new Map());
|
|
10
|
-
(0, hooks_1.useEffect)(() =>
|
|
13
|
+
(0, hooks_1.useEffect)(() => blockRouterEventBus_1.blockRouterEventBus.subscribe('intersection', ({ block, intersection }) => {
|
|
11
14
|
if (intersectionsMapRef.current) {
|
|
12
15
|
intersectionsMapRef.current.set(block, intersection);
|
|
13
16
|
}
|
|
14
|
-
}), [
|
|
17
|
+
}), []);
|
|
15
18
|
(0, hooks_1.useEffect)(() => {
|
|
16
19
|
const handleScroll = (0, debounce_1.debounce)(() => {
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
if (isScrolledEnough()) {
|
|
21
|
+
const activeBlock = (0, findActiveBlock_1.findActiveBlock)([...(intersectionsMapRef.current || [])]);
|
|
22
|
+
(0, BlockRouter_1.trackBlock)(router, activeBlock);
|
|
20
23
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
router.replace(activeBlock.anchor);
|
|
24
|
-
}
|
|
25
|
-
else if (!activeBlock) {
|
|
26
|
-
router.reset();
|
|
24
|
+
else {
|
|
25
|
+
(0, BlockRouter_1.trackBlock)(router);
|
|
27
26
|
}
|
|
28
27
|
}, 100);
|
|
29
28
|
scrollTarget.addEventListener('scroll', handleScroll);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBlockRouterProvider.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockRouterProvider.ts"],"names":[],"mappings":";;AAAA,uDAAgE;
|
|
1
|
+
{"version":3,"file":"useBlockRouterProvider.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockRouterProvider.ts"],"names":[],"mappings":";;AAAA,uDAAgE;AAChE,qDAAkD;AAElD,mDAAgD;AAChD,+CAA2C;AAC3C,+DAA4D;AAC5D,uDAAoD;AAEpD,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,UAAU,CAAC,WAAW,GAA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= void 0;
|
|
|
3
3
|
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
|
-
const
|
|
6
|
+
const defaultEventBus_1 = require("../EventBus/defaultEventBus");
|
|
7
7
|
const useBlockIntersectionObserver_1 = require("../services/BlockRouter/useBlockIntersectionObserver");
|
|
8
8
|
const style_1 = require("../utils/style");
|
|
9
9
|
exports.blockStyles = {
|
|
@@ -17,7 +17,7 @@ exports.BlockWrapper = (0, uni_jsx_1.JSX)(({ className = '', version = 'primary'
|
|
|
17
17
|
const Tag = tag;
|
|
18
18
|
const ref = (0, useBlockIntersectionObserver_1.useBlockIntersectionObserver)(block);
|
|
19
19
|
const [isVisible, setVisible] = (0, hooks_1.useState)(true);
|
|
20
|
-
(0, hooks_1.useEffect)(() =>
|
|
20
|
+
(0, hooks_1.useEffect)(() => defaultEventBus_1.defaultEventBus.subscribe('tab', (event) => {
|
|
21
21
|
if (event.type === 'group') {
|
|
22
22
|
const hasSettings = block?.labels?.length || block?.anchor;
|
|
23
23
|
setVisible(event.label ? !hasSettings || Boolean(block?.labels?.includes(event.label)) : true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockWrapper.js","sourceRoot":"","sources":["../../src/ui-kit/BlockWrapper.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAAkE;AAClE,
|
|
1
|
+
{"version":3,"file":"BlockWrapper.js","sourceRoot":"","sources":["../../src/ui-kit/BlockWrapper.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAAkE;AAClE,iEAA8D;AAG9D,uGAAoG;AACpG,0CAAuC;AAO1B,QAAA,WAAW,GAAiC;IACvD,OAAO,EAAE,4BAA4B;IACrC,SAAS,EAAE,4BAA4B;IACvC,IAAI,EAAE,mCAAmC;IACzC,WAAW,EAAE,kCAAkC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EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EACpD,IAAI,EAAE,IAAI,YAET,QAAQ,GACL,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CACF,CAAC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare type BaseEventMap = Record<string, any>;
|
|
3
|
-
export declare class EventBus<EM extends BaseEventMap> {
|
|
4
|
-
static readonly inst: EventBus<EventMap>;
|
|
1
|
+
export declare class EventBus<EM extends Record<string, any>> {
|
|
5
2
|
private subscribers;
|
|
6
3
|
private subjectsStateMap;
|
|
7
4
|
subscribe<K extends keyof EM>(type: K, listener: (event: EM[K]) => void): () => void;
|