@redneckz/wildless-cms-uni-blocks 0.8.9 → 0.8.11
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +154 -138
- package/bundle/bundle.umd.min.js +1 -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/bundle/components/StepsBlock/{renderStepContent.d.ts → renderStep.d.ts} +5 -5
- package/bundle/components/Tile/TileContent.d.ts +2 -2
- package/bundle/services/BlockRouter/BlockRouter.d.ts +1 -3
- package/bundle/ui-kit/Img/ImgAsPicture.d.ts +0 -2
- package/bundle/utils/adjustHref.d.ts +3 -0
- package/bundle/utils/dirname.d.ts +1 -0
- package/bundle/utils/url.d.ts +2 -2
- package/dist/ProjectSettings.js +3 -4
- package/dist/ProjectSettings.js.map +1 -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/{lib/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/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 +4 -16
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/services/BlockRouter/BlockRouter.d.ts +1 -3
- package/dist/services/BlockRouter/BlockRouter.js +3 -9
- package/dist/services/BlockRouter/BlockRouter.js.map +1 -1
- package/dist/services/BlockRouter/useBlockRouterProvider.js +2 -10
- package/dist/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/dist/setup-fixture.js +3 -4
- package/dist/setup-fixture.js.map +1 -1
- package/dist/ui-kit/Icon/Icon.js +5 -1
- package/dist/ui-kit/Icon/Icon.js.map +1 -1
- package/dist/ui-kit/Img/ImgAsPicture.d.ts +0 -2
- package/dist/ui-kit/Img/ImgAsPicture.js +18 -21
- package/dist/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/dist/utils/adjustHref.d.ts +3 -0
- package/dist/utils/adjustHref.js +14 -0
- package/dist/utils/adjustHref.js.map +1 -0
- package/dist/utils/dirname.d.ts +1 -0
- package/dist/utils/dirname.js +5 -0
- package/dist/utils/dirname.js.map +1 -0
- package/dist/utils/url.d.ts +2 -2
- package/dist/utils/url.js +1 -1
- package/dist/utils/url.js.map +1 -1
- package/dist/wlc.json +0 -1
- package/lib/ProjectSettings.js +3 -4
- package/lib/ProjectSettings.js.map +1 -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/{dist/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/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 +5 -17
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/services/BlockRouter/BlockRouter.d.ts +1 -3
- package/lib/services/BlockRouter/BlockRouter.js +2 -7
- package/lib/services/BlockRouter/BlockRouter.js.map +1 -1
- package/lib/services/BlockRouter/useBlockRouterProvider.js +2 -10
- package/lib/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/lib/setup-fixture.js +3 -4
- package/lib/setup-fixture.js.map +1 -1
- package/lib/ui-kit/Icon/Icon.js +5 -1
- package/lib/ui-kit/Icon/Icon.js.map +1 -1
- package/lib/ui-kit/Img/ImgAsPicture.d.ts +0 -2
- package/lib/ui-kit/Img/ImgAsPicture.js +17 -19
- package/lib/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/lib/utils/adjustHref.d.ts +3 -0
- package/lib/utils/adjustHref.js +11 -0
- package/lib/utils/adjustHref.js.map +1 -0
- package/lib/utils/dirname.d.ts +1 -0
- package/lib/utils/dirname.js +2 -0
- package/lib/utils/dirname.js.map +1 -0
- package/lib/utils/url.d.ts +2 -2
- package/lib/utils/url.js +1 -1
- package/lib/utils/url.js.map +1 -1
- package/lib/wlc.json +0 -1
- package/mobile/bundle/bundle.umd.js +104 -95
- package/mobile/bundle/bundle.umd.min.js +1 -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/mobile/bundle/components/StepsBlock/{renderStepContent.d.ts → renderStep.d.ts} +5 -5
- package/mobile/bundle/components/Tile/TileContent.d.ts +2 -2
- package/mobile/bundle/services/BlockRouter/BlockRouter.d.ts +1 -3
- package/mobile/bundle/ui-kit/Img/ImgAsPicture.d.ts +0 -2
- package/mobile/bundle/utils/adjustHref.d.ts +3 -0
- package/mobile/bundle/utils/dirname.d.ts +1 -0
- package/mobile/bundle/utils/url.d.ts +2 -2
- package/mobile/dist/ProjectSettings.js +3 -4
- package/mobile/dist/ProjectSettings.js.map +1 -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/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 +4 -16
- package/mobile/dist/hooks/useLink.js.map +1 -1
- package/mobile/dist/services/BlockRouter/BlockRouter.d.ts +1 -3
- package/mobile/dist/services/BlockRouter/BlockRouter.js +3 -9
- package/mobile/dist/services/BlockRouter/BlockRouter.js.map +1 -1
- package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js +2 -10
- package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/mobile/dist/setup-fixture.js +3 -4
- package/mobile/dist/setup-fixture.js.map +1 -1
- package/mobile/dist/ui-kit/Icon/Icon.js +5 -1
- package/mobile/dist/ui-kit/Icon/Icon.js.map +1 -1
- package/mobile/dist/ui-kit/Img/ImgAsPicture.d.ts +0 -2
- package/mobile/dist/ui-kit/Img/ImgAsPicture.js +18 -21
- package/mobile/dist/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/mobile/dist/utils/adjustHref.d.ts +3 -0
- package/mobile/dist/utils/adjustHref.js +14 -0
- package/mobile/dist/utils/adjustHref.js.map +1 -0
- package/mobile/dist/utils/dirname.d.ts +1 -0
- package/mobile/dist/utils/dirname.js +5 -0
- package/mobile/dist/utils/dirname.js.map +1 -0
- package/mobile/dist/utils/url.d.ts +2 -2
- package/mobile/dist/utils/url.js +1 -1
- package/mobile/dist/utils/url.js.map +1 -1
- package/mobile/dist/wlc.json +0 -1
- package/mobile/lib/ProjectSettings.js +3 -4
- package/mobile/lib/ProjectSettings.js.map +1 -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/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 +5 -17
- package/mobile/lib/hooks/useLink.js.map +1 -1
- package/mobile/lib/services/BlockRouter/BlockRouter.d.ts +1 -3
- package/mobile/lib/services/BlockRouter/BlockRouter.js +2 -7
- package/mobile/lib/services/BlockRouter/BlockRouter.js.map +1 -1
- package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js +2 -10
- package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/mobile/lib/setup-fixture.js +3 -4
- package/mobile/lib/setup-fixture.js.map +1 -1
- package/mobile/lib/ui-kit/Icon/Icon.js +5 -1
- package/mobile/lib/ui-kit/Icon/Icon.js.map +1 -1
- package/mobile/lib/ui-kit/Img/ImgAsPicture.d.ts +0 -2
- package/mobile/lib/ui-kit/Img/ImgAsPicture.js +17 -19
- package/mobile/lib/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/mobile/lib/utils/adjustHref.d.ts +3 -0
- package/mobile/lib/utils/adjustHref.js +11 -0
- package/mobile/lib/utils/adjustHref.js.map +1 -0
- package/mobile/lib/utils/dirname.d.ts +1 -0
- package/mobile/lib/utils/dirname.js +2 -0
- package/mobile/lib/utils/dirname.js.map +1 -0
- package/mobile/lib/utils/url.d.ts +2 -2
- package/mobile/lib/utils/url.js +1 -1
- package/mobile/lib/utils/url.js.map +1 -1
- package/mobile/lib/wlc.json +0 -1
- package/mobile/src/ProjectSettings.ts +4 -4
- 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/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 +5 -18
- package/mobile/src/services/BlockRouter/BlockRouter.ts +6 -9
- package/mobile/src/services/BlockRouter/useBlockRouterProvider.ts +4 -10
- package/mobile/src/setup-fixture.ts +5 -4
- package/mobile/src/ui-kit/Icon/Icon.tsx +5 -1
- package/mobile/src/ui-kit/Img/ImgAsPicture.tsx +23 -28
- package/mobile/src/utils/adjustHref.ts +17 -0
- package/mobile/src/utils/dirname.ts +1 -0
- package/mobile/src/utils/url.ts +2 -3
- package/mobile/src/wlc.json +0 -1
- package/package.json +1 -1
- package/src/ProjectSettings.ts +4 -4
- 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/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 +5 -18
- package/src/services/BlockRouter/BlockRouter.ts +6 -9
- package/src/services/BlockRouter/useBlockRouterProvider.ts +4 -10
- package/src/setup-fixture.ts +5 -4
- package/src/ui-kit/Icon/Icon.tsx +5 -1
- package/src/ui-kit/Img/ImgAsPicture.tsx +23 -28
- package/src/utils/adjustHref.ts +17 -0
- package/src/utils/dirname.ts +1 -0
- package/src/utils/url.ts +2 -3
- package/src/wlc.json +0 -1
- package/bundle/utils/checkIsIconRenderable.d.ts +0 -2
- package/dist/components/StepsBlock/renderStepContent.js +0 -19
- package/dist/components/StepsBlock/renderStepContent.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/components/StepsBlock/renderStepContent.js +0 -16
- package/lib/components/StepsBlock/renderStepContent.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/utils/checkIsIconRenderable.d.ts +0 -2
- 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/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/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/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/components/StepsBlock/renderStepContent.tsx +0 -83
- package/mobile/src/utils/checkIsIconRenderable.tsx +0 -3
- package/src/components/StepsBlock/renderStepContent.tsx +0 -83
- package/src/utils/checkIsIconRenderable.tsx +0 -3
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { useEffect, useRef } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
-
import { useRouter } from '../../hooks/useRouter.js';
|
|
3
2
|
import { debounce } from '../../utils/debounce.js';
|
|
4
3
|
import { trackBlock } from './BlockRouter.js';
|
|
5
4
|
import { blockRouterEventBus } from './blockRouterEventBus.js';
|
|
6
5
|
import { findActiveBlock } from './findActiveBlock.js';
|
|
7
6
|
const isScrolledEnough = () => globalThis.scrollY > (globalThis.innerHeight * 3) / 4;
|
|
8
7
|
export function useBlockRouterProvider(scrollTarget = globalThis) {
|
|
9
|
-
const router = useRouter();
|
|
10
8
|
const intersectionsMapRef = useRef(new Map());
|
|
11
9
|
useEffect(() => blockRouterEventBus.subscribe('intersection', ({ block, intersection }) => {
|
|
12
10
|
if (intersectionsMapRef.current) {
|
|
@@ -15,19 +13,13 @@ export function useBlockRouterProvider(scrollTarget = globalThis) {
|
|
|
15
13
|
}), []);
|
|
16
14
|
useEffect(() => {
|
|
17
15
|
const handleScroll = debounce(() => {
|
|
18
|
-
|
|
19
|
-
const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
|
|
20
|
-
trackBlock(router, activeBlock);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
trackBlock(router);
|
|
24
|
-
}
|
|
16
|
+
trackBlock(isScrolledEnough() ? findActiveBlock([...(intersectionsMapRef.current || [])]) : undefined);
|
|
25
17
|
}, 100);
|
|
26
18
|
scrollTarget.addEventListener('scroll', handleScroll);
|
|
27
19
|
return () => {
|
|
28
20
|
handleScroll.dispose();
|
|
29
21
|
scrollTarget.removeEventListener('scroll', handleScroll);
|
|
30
22
|
};
|
|
31
|
-
}, [
|
|
23
|
+
}, [scrollTarget]);
|
|
32
24
|
}
|
|
33
25
|
//# sourceMappingURL=useBlockRouterProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBlockRouterProvider.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockRouterProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"useBlockRouterProvider.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockRouterProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,UAAU,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAErF,MAAM,UAAU,sBAAsB,CAAC,eAA4B,UAAU;IAC3E,MAAM,mBAAmB,GAAG,MAAM,CAA2C,IAAI,GAAG,EAAE,CAAC,CAAC;IAExF,SAAS,CACP,GAAG,EAAE,CACH,mBAAmB,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE;QACxE,IAAI,mBAAmB,CAAC,OAAO,EAAE;YAC/B,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;SACtD;IACH,CAAC,CAAC,EACJ,EAAE,CACH,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,EAAE;YACjC,UAAU,CACR,gBAAgB,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAC3F,CAAC;QACJ,CAAC,EAAE,GAAG,CAAC,CAAC;QAER,YAAY,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAEtD,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,EAAE,CAAC;YACvB,YAAY,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAC3D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;AACrB,CAAC"}
|
package/lib/setup-fixture.js
CHANGED
|
@@ -3,10 +3,11 @@ import { useEffect, useState } from 'react';
|
|
|
3
3
|
import { handlerDecorator } from './hooks/handlerDecorator.js';
|
|
4
4
|
import { useRouter } from './hooks/useRouter.js';
|
|
5
5
|
import { projectSettings } from './ProjectSettings.js';
|
|
6
|
+
import { joinPath } from './utils/url.js';
|
|
6
7
|
import wlc from './wlc.json.js';
|
|
7
8
|
projectSettings.setup(wlc);
|
|
8
9
|
useRouter.setup(() => {
|
|
9
|
-
const [href, setHref] = useState(
|
|
10
|
+
const [href, setHref] = useState(joinPath(globalThis.location.origin, projectSettings.BASE_PATH, 'cards-credit'));
|
|
10
11
|
useEffect(() => {
|
|
11
12
|
const handleHistoryChange = () => {
|
|
12
13
|
setHref(globalThis.location.href);
|
|
@@ -18,9 +19,7 @@ useRouter.setup(() => {
|
|
|
18
19
|
}, []);
|
|
19
20
|
return {
|
|
20
21
|
href,
|
|
21
|
-
pathname: projectSettings.BASE_PATH
|
|
22
|
-
? new URL(href).pathname.substring(projectSettings.BASE_PATH.length - 1)
|
|
23
|
-
: '',
|
|
22
|
+
pathname: new URL(href).pathname.substring(projectSettings.BASE_PATH ? projectSettings.BASE_PATH.length - 1 : 0),
|
|
24
23
|
query: {},
|
|
25
24
|
push: (url) => {
|
|
26
25
|
globalThis.history.pushState(null, '', url);
|
package/lib/setup-fixture.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-fixture.js","sourceRoot":"","sources":["../src/setup-fixture.ts"],"names":[],"mappings":"AAAA,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAE3B,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE;IACnB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAC9B,
|
|
1
|
+
{"version":3,"file":"setup-fixture.js","sourceRoot":"","sources":["../src/setup-fixture.ts"],"names":[],"mappings":"AAAA,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,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AC,CAAC,OAAO,EAAO,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE;IAC9C,EAAE,CAAC,cAAc,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,CAAC;AACd,CAAC,CAAC,CAAC"}
|
package/lib/ui-kit/Icon/Icon.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { useRouter } from '../../hooks/useRouter.js';
|
|
3
4
|
import { projectSettings } from '../../ProjectSettings.js';
|
|
5
|
+
import { adjustHref } from '../../utils/adjustHref.js';
|
|
4
6
|
import { style } from '../../utils/style.js';
|
|
7
|
+
import { joinPath } from '../../utils/url.js';
|
|
5
8
|
const svgUseStyleMap = {
|
|
6
9
|
normal: '',
|
|
7
10
|
color: 'text-primary-main',
|
|
@@ -9,7 +12,8 @@ const svgUseStyleMap = {
|
|
|
9
12
|
white: 'text-black',
|
|
10
13
|
};
|
|
11
14
|
export const Icon = JSX(({ className = '', imageClassName = '', name = '', alt = `Иконка ${name}`, title = alt, iconVersion = 'color', asSVG, ...imgProps }) => {
|
|
12
|
-
const
|
|
15
|
+
const router = useRouter();
|
|
16
|
+
const href = adjustHref(router)(joinPath(projectSettings.CDN, '/icons', `${name}.svg`));
|
|
13
17
|
if (asSVG && iconVersion !== 'normal') {
|
|
14
18
|
return (_jsx(Background, { className: className, children: _jsxs("svg", { className: style(getSvgSize(imgProps.width), svgUseStyleMap[iconVersion], iconVersion === 'white' ? 'invert' : '', imageClassName), ...imgProps, "aria-hidden": "true", children: [title ? _jsx("title", { children: title }) : null, alt ? _jsx("desc", { children: alt }) : null, _jsx("use", { href: `${href}#icon`, xlinkHref: `${href}#icon` })] }) }));
|
|
15
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/ui-k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,cAAc,CAAC,WAAW,CAAC,EAC3B,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EACvC,cAAc,CACf,KACG,QAAQ,iBACA,MAAM,aAEjB,KAAK,CAAC,CAAC,CAAC,0BAAQ,KAAK,GAAS,CAAC,CAAC,CAAC,IAAI,EACrC,GAAG,CAAC,CAAC,CAAC,yBAAO,GAAG,GAAQ,CAAC,CAAC,CAAC,IAAI,EAChC,cAAK,IAAI,EAAE,GAAG,IAAI,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,OAAO,GAAI,IACpD,GACK,CACd,CAAC;KACH;IAED,OAAO,CACL,cACE,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,KACR,QAAQ,iBACA,MAAM,GAClB,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;AAEtE,MAAM,UAAU,GAAG,GAAG,CAAyB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,CACzE,SAAS,CAAC,CAAC,CAAC,cAAK,SAAS,EAAE,SAAS,YAAG,QAAQ,GAAO,CAAC,CAAC,CAAC,QAAQ,CACnE,CAAC"}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import type { ImgSource } from '../../model/Picture';
|
|
2
1
|
import type { ImageProps } from './ImgProps';
|
|
3
2
|
export declare const ImgAsPicture: import("@redneckz/uni-jsx").UNIComponent<ImageProps, any, any>;
|
|
4
|
-
export declare function formatToMimeType(format: ImgSource['format']): string | undefined;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return 0;
|
|
8
|
-
};
|
|
3
|
+
import { useRouter } from '../../hooks/useRouter.js';
|
|
4
|
+
import { adjustHref } from '../../utils/adjustHref.js';
|
|
5
|
+
import { isURL, joinPath } from '../../utils/url.js';
|
|
6
|
+
const sourcesComparator = (a, b) => a?.media && b?.media ? a.media - b.media : 0;
|
|
9
7
|
export const ImgAsPicture = JSX(({ className = '', image, imageClassName = '', isMobile = false, pathPrefix }) => {
|
|
10
|
-
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
8
|
+
const router = useRouter();
|
|
13
9
|
const pictureStyles = isMobile ? 'flex' : 'flex-none';
|
|
14
10
|
return (_jsxs("picture", { className: `${pictureStyles} ${className}`, children: [image?.sources?.length
|
|
15
11
|
? image.sources
|
|
12
|
+
.filter((_) => _?.src)
|
|
16
13
|
.sort(sourcesComparator)
|
|
17
|
-
.map(({ src, format, media }, index) => (_jsx("source", { srcSet:
|
|
18
|
-
: null,
|
|
14
|
+
.map(({ src, format, media }, index) => (_jsx("source", { srcSet: adjustSrcset(router, pathPrefix)(src), type: formatToMimeType(format), media: media ? `(max-width: ${media}px)` : '', ...image.size }, `${index}_${src}`)))
|
|
15
|
+
: null, image?.src
|
|
16
|
+
? renderImg({ ...image, src: adjustSrcset(router, pathPrefix)(image.src) }, imageClassName, isMobile)
|
|
17
|
+
: null] }));
|
|
19
18
|
});
|
|
20
19
|
const renderImg = (image, imageClassName = '', isMobile = false) => {
|
|
21
20
|
const style = {
|
|
@@ -27,13 +26,12 @@ const renderImg = (image, imageClassName = '', isMobile = false) => {
|
|
|
27
26
|
const imgStyle = isMobile ? 'm-auto' : 'm-0';
|
|
28
27
|
return (_jsx("img", { src: image.src, className: `${imgStyle} ${imageClassName}`, alt: alt, title: title, style: style, ...image.size }));
|
|
29
28
|
};
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
.map((src) =>
|
|
29
|
+
const adjustSrcset = (router, pathPrefix) => (srcset) => srcset
|
|
30
|
+
?.split(/\s*,\s*/)
|
|
31
|
+
.map((src) => src.trim())
|
|
32
|
+
.filter(Boolean)
|
|
33
|
+
.map((src) => (isURL(src) ? src : joinPath(pathPrefix, src)))
|
|
34
|
+
.map(adjustHref(router))
|
|
35
35
|
.join(', ');
|
|
36
|
-
|
|
37
|
-
return format ? `image/${String(format)}` : undefined;
|
|
38
|
-
}
|
|
36
|
+
const formatToMimeType = (format) => format ? `image/${String(format)}` : undefined;
|
|
39
37
|
//# sourceMappingURL=ImgAsPicture.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImgAsPicture.js","sourceRoot":"","sources":["../../../src/ui-kit/Img/ImgAsPicture.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ImgAsPicture.js","sourceRoot":"","sources":["../../../src/ui-kit/Img/ImgAsPicture.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAU,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,iBAAiB,GAAG,CAAC,CAAU,EAAE,CAAU,EAAE,EAAE,CACnD,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/C,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAC7B,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,KAAK,EAAE,cAAc,GAAG,EAAE,EAAE,QAAQ,GAAG,KA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A2B,EAAE,EAAE,CACvD,MAAM,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { projectSettings } from '../ProjectSettings.js';
|
|
2
|
+
import { dirname } from './dirname.js';
|
|
3
|
+
import { isURL, joinPath } from './url.js';
|
|
4
|
+
export const adjustHref = (router) => (href) => {
|
|
5
|
+
if (!href || isURL(href) || (projectSettings.CDN && href.startsWith(projectSettings.CDN))) {
|
|
6
|
+
return href;
|
|
7
|
+
}
|
|
8
|
+
const isRelativeToBase = href.startsWith('/');
|
|
9
|
+
return joinPath(projectSettings.BASE_PATH, isRelativeToBase ? '/' : dirname(router.pathname), href);
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=adjustHref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjustHref.js","sourceRoot":"","sources":["../../src/utils/adjustHref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAA4B,EAAE,EAAE,CAAC,CAAC,IAAwB,EAAE,EAAE;IACvF,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE;QACzF,OAAO,IAAI,CAAC;KACb;IAED,MAAM,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAE9C,OAAO,QAAQ,CACb,eAAe,CAAC,SAAS,EACzB,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,EACjD,IAAI,CACL,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const dirname: (path: string | undefined) => string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dirname.js","sourceRoot":"","sources":["../../src/utils/dirname.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAwB,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
package/lib/utils/url.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Target } from '../model/LinkProps';
|
|
2
|
-
export declare const isURL: (href?: string) => href is `${string}
|
|
2
|
+
export declare const isURL: (href?: string) => href is `${string}:${string}`;
|
|
3
3
|
export declare const isLocalURL: (href: string | undefined, target?: Target) => boolean;
|
|
4
4
|
export declare const isHash: (href?: string) => href is `#${string}`;
|
|
5
5
|
export declare const withoutQuery: (href?: string) => string;
|
|
6
|
-
export declare const joinPath: (...path: string[]) => string;
|
|
6
|
+
export declare const joinPath: (...path: (string | undefined)[]) => string;
|
package/lib/utils/url.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const isURL = (href) => Boolean(href?.includes('
|
|
1
|
+
export const isURL = (href) => Boolean(href?.includes(':'));
|
|
2
2
|
export const isLocalURL = (href, target) => Boolean(href && !isURL(href) && (!target || target === '_self'));
|
|
3
3
|
export const isHash = (href) => Boolean(href?.startsWith('#'));
|
|
4
4
|
export const withoutQuery = (href) => (href || '').replace(/\?.*/, '').replace(/\/$/, '');
|
package/lib/utils/url.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAa,
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAa,EAAiC,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AAEpG,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAwB,EAAE,MAAe,EAAE,EAAE,CACtE,OAAO,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,IAAa,EAAwB,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AAE9F,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAa,EAAU,EAAE,CACpD,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAEtD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAG,IAA4B,EAAU,EAAE,CAClE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"}
|
package/lib/wlc.json
CHANGED
|
@@ -81,12 +81,10 @@
|
|
|
81
81
|
return this._.FOOTER;
|
|
82
82
|
}
|
|
83
83
|
get CDN() {
|
|
84
|
-
return this._.CDN;
|
|
84
|
+
return appendSlash(this._.CDN);
|
|
85
85
|
}
|
|
86
86
|
get BASE_PATH() {
|
|
87
|
-
return this._.BASE_PATH
|
|
88
|
-
? `${this._.BASE_PATH}/`
|
|
89
|
-
: this._.BASE_PATH;
|
|
87
|
+
return appendSlash(this._.BASE_PATH);
|
|
90
88
|
}
|
|
91
89
|
get YANDEX_MAP_API_KEY() {
|
|
92
90
|
return this._.YANDEX_MAP_API_KEY;
|
|
@@ -95,6 +93,7 @@
|
|
|
95
93
|
return this._.YANDEX_METRIKA_ID;
|
|
96
94
|
}
|
|
97
95
|
})();
|
|
96
|
+
const appendSlash = (url) => (url && !url.endsWith('/') ? `${url}/` : url);
|
|
98
97
|
|
|
99
98
|
const AUTH_PREFIX = 'guest';
|
|
100
99
|
const STORAGE_KEY = 'likesToken';
|
|
@@ -425,6 +424,49 @@
|
|
|
425
424
|
return (jsx("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden ${containerRef.current || !isUnfolded ? 'max-h-0' : ''} ${className}`, children: children }));
|
|
426
425
|
});
|
|
427
426
|
|
|
427
|
+
function useRouter() {
|
|
428
|
+
return useRouter._impl();
|
|
429
|
+
}
|
|
430
|
+
useRouter._impl = () => ({
|
|
431
|
+
href: globalThis.location?.href || '/',
|
|
432
|
+
pathname: globalThis.location?.pathname || '/',
|
|
433
|
+
query: {},
|
|
434
|
+
push: () => {
|
|
435
|
+
// Do nothing
|
|
436
|
+
},
|
|
437
|
+
replace: () => {
|
|
438
|
+
// Do nothing
|
|
439
|
+
},
|
|
440
|
+
});
|
|
441
|
+
useRouter.setup = (impl) => {
|
|
442
|
+
useRouter._impl = impl;
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
const dirname = (path) => path?.split('/').slice(0, -1).join('/');
|
|
446
|
+
|
|
447
|
+
const isURL = (href) => Boolean(href?.includes(':'));
|
|
448
|
+
const isLocalURL = (href, target) => Boolean(href && !isURL(href) && (!target || target === '_self'));
|
|
449
|
+
const isHash = (href) => Boolean(href?.startsWith('#'));
|
|
450
|
+
const withoutQuery = (href) => (href || '').replace(/\?.*/, '').replace(/\/$/, '');
|
|
451
|
+
const joinPath = (...path) => path.filter(Boolean).join('/').replace(/\/+/g, '/');
|
|
452
|
+
|
|
453
|
+
var url = /*#__PURE__*/Object.freeze({
|
|
454
|
+
__proto__: null,
|
|
455
|
+
isURL: isURL,
|
|
456
|
+
isLocalURL: isLocalURL,
|
|
457
|
+
isHash: isHash,
|
|
458
|
+
withoutQuery: withoutQuery,
|
|
459
|
+
joinPath: joinPath
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
const adjustHref = (router) => (href) => {
|
|
463
|
+
if (!href || isURL(href) || (projectSettings.CDN && href.startsWith(projectSettings.CDN))) {
|
|
464
|
+
return href;
|
|
465
|
+
}
|
|
466
|
+
const isRelativeToBase = href.startsWith('/');
|
|
467
|
+
return joinPath(projectSettings.BASE_PATH, isRelativeToBase ? '/' : dirname(router.pathname), href);
|
|
468
|
+
};
|
|
469
|
+
|
|
428
470
|
const svgUseStyleMap = {
|
|
429
471
|
normal: '',
|
|
430
472
|
color: 'text-primary-main',
|
|
@@ -432,7 +474,8 @@
|
|
|
432
474
|
white: 'text-black',
|
|
433
475
|
};
|
|
434
476
|
const Icon = JSX(({ className = '', imageClassName = '', name = '', alt = `Иконка ${name}`, title = alt, iconVersion = 'color', asSVG, ...imgProps }) => {
|
|
435
|
-
const
|
|
477
|
+
const router = useRouter();
|
|
478
|
+
const href = adjustHref(router)(joinPath(projectSettings.CDN, '/icons', `${name}.svg`));
|
|
436
479
|
if (asSVG && iconVersion !== 'normal') {
|
|
437
480
|
return (jsx(Background, { className: className, children: jsxs("svg", { className: style(getSvgSize(imgProps.width), svgUseStyleMap[iconVersion], iconVersion === 'white' ? 'invert' : '', imageClassName), ...imgProps, "aria-hidden": "true", children: [title ? jsx("title", { children: title }) : null, alt ? jsx("desc", { children: alt }) : null, jsx("use", { href: `${href}#icon`, xlinkHref: `${href}#icon` })] }) }));
|
|
438
481
|
}
|
|
@@ -441,22 +484,18 @@
|
|
|
441
484
|
const getSvgSize = (width) => (width ? '' : 'w-full h-full');
|
|
442
485
|
const Background = JSX(({ className, children }) => className ? jsx("div", { className: className, children: children }) : children);
|
|
443
486
|
|
|
444
|
-
const sourcesComparator = (a, b) =>
|
|
445
|
-
if (a.media && b.media) {
|
|
446
|
-
return a.media - b.media;
|
|
447
|
-
}
|
|
448
|
-
return 0;
|
|
449
|
-
};
|
|
487
|
+
const sourcesComparator = (a, b) => a?.media && b?.media ? a.media - b.media : 0;
|
|
450
488
|
const ImgAsPicture = JSX(({ className = '', image, imageClassName = '', isMobile = false, pathPrefix }) => {
|
|
451
|
-
|
|
452
|
-
return null;
|
|
453
|
-
}
|
|
489
|
+
const router = useRouter();
|
|
454
490
|
const pictureStyles = isMobile ? 'flex' : 'flex-none';
|
|
455
491
|
return (jsxs("picture", { className: `${pictureStyles} ${className}`, children: [image?.sources?.length
|
|
456
492
|
? image.sources
|
|
493
|
+
.filter((_) => _?.src)
|
|
457
494
|
.sort(sourcesComparator)
|
|
458
|
-
.map(({ src, format, media }, index) => (jsx("source", { srcSet:
|
|
459
|
-
: null,
|
|
495
|
+
.map(({ src, format, media }, index) => (jsx("source", { srcSet: adjustSrcset(router, pathPrefix)(src), type: formatToMimeType(format), media: media ? `(max-width: ${media}px)` : '', ...image.size }, `${index}_${src}`)))
|
|
496
|
+
: null, image?.src
|
|
497
|
+
? renderImg({ ...image, src: adjustSrcset(router, pathPrefix)(image.src) }, imageClassName, isMobile)
|
|
498
|
+
: null] }));
|
|
460
499
|
});
|
|
461
500
|
const renderImg = (image, imageClassName = '', isMobile = false) => {
|
|
462
501
|
const style = {
|
|
@@ -468,15 +507,14 @@
|
|
|
468
507
|
const imgStyle = isMobile ? 'm-auto' : 'm-0';
|
|
469
508
|
return (jsx("img", { src: image.src, className: `${imgStyle} ${imageClassName}`, alt: alt, title: title, style: style, ...image.size }));
|
|
470
509
|
};
|
|
471
|
-
const
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
.map((src) =>
|
|
510
|
+
const adjustSrcset = (router, pathPrefix) => (srcset) => srcset
|
|
511
|
+
?.split(/\s*,\s*/)
|
|
512
|
+
.map((src) => src.trim())
|
|
513
|
+
.filter(Boolean)
|
|
514
|
+
.map((src) => (isURL(src) ? src : joinPath(pathPrefix, src)))
|
|
515
|
+
.map(adjustHref(router))
|
|
476
516
|
.join(', ');
|
|
477
|
-
|
|
478
|
-
return format ? `image/${String(format)}` : undefined;
|
|
479
|
-
}
|
|
517
|
+
const formatToMimeType = (format) => format ? `image/${String(format)}` : undefined;
|
|
480
518
|
|
|
481
519
|
const ImgInner = JSX(({ className = '', image, imageClassName = '', isMobile, pathPrefix, ...iconProps }) => {
|
|
482
520
|
if (!image?.src && !image?.icon) {
|
|
@@ -666,31 +704,6 @@
|
|
|
666
704
|
return (jsxs("div", { className: style(className, listType === 'vertical-list' ? 'relative h-full' : ''), children: [jsx(SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: 1, gap: gap, padding: padding, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, listType: listType, children: children }), showDots ? (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: activeIndex, dotCount: itemCount, listType: listType })) : null] }));
|
|
667
705
|
});
|
|
668
706
|
|
|
669
|
-
const normalizeAnchor = (anchor) => anchor?.replace('#', '') || '';
|
|
670
|
-
function gotoBlock(router, anchor) {
|
|
671
|
-
router.replace(`#${normalizeAnchor(anchor)}`);
|
|
672
|
-
}
|
|
673
|
-
function trackBlock(router, block) {
|
|
674
|
-
router.replace(`#${normalizeAnchor(block?.anchor)}`, undefined, {
|
|
675
|
-
scroll: false,
|
|
676
|
-
});
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
const isURL = (href) => Boolean(href?.includes('//'));
|
|
680
|
-
const isLocalURL = (href, target) => Boolean(href && !isURL(href) && (!target || target === '_self'));
|
|
681
|
-
const isHash = (href) => Boolean(href?.startsWith('#'));
|
|
682
|
-
const withoutQuery = (href) => (href || '').replace(/\?.*/, '').replace(/\/$/, '');
|
|
683
|
-
const joinPath = (...path) => path.filter(Boolean).join('/').replace(/\/+/g, '/');
|
|
684
|
-
|
|
685
|
-
var url = /*#__PURE__*/Object.freeze({
|
|
686
|
-
__proto__: null,
|
|
687
|
-
isURL: isURL,
|
|
688
|
-
isLocalURL: isLocalURL,
|
|
689
|
-
isHash: isHash,
|
|
690
|
-
withoutQuery: withoutQuery,
|
|
691
|
-
joinPath: joinPath
|
|
692
|
-
});
|
|
693
|
-
|
|
694
707
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
695
708
|
const handlerDecorator = (handler, targetContent) => {
|
|
696
709
|
return handlerDecorator._impl(handler, targetContent);
|
|
@@ -700,53 +713,24 @@
|
|
|
700
713
|
handlerDecorator._impl = impl;
|
|
701
714
|
};
|
|
702
715
|
|
|
703
|
-
function useRouter() {
|
|
704
|
-
return useRouter._impl();
|
|
705
|
-
}
|
|
706
|
-
useRouter._impl = () => ({
|
|
707
|
-
href: globalThis.location?.href || '/',
|
|
708
|
-
pathname: globalThis.location?.pathname || '/',
|
|
709
|
-
query: {},
|
|
710
|
-
push: () => {
|
|
711
|
-
// Do nothing
|
|
712
|
-
},
|
|
713
|
-
replace: () => {
|
|
714
|
-
// Do nothing
|
|
715
|
-
},
|
|
716
|
-
});
|
|
717
|
-
useRouter.setup = (impl) => {
|
|
718
|
-
useRouter._impl = impl;
|
|
719
|
-
};
|
|
720
|
-
|
|
721
716
|
function useLink(isRemote) {
|
|
722
717
|
const router = useRouter();
|
|
723
718
|
return (props) => ({
|
|
724
719
|
...props,
|
|
725
|
-
href: adjustHref(props.href),
|
|
720
|
+
href: isRemote ? props.href : adjustHref(router)(props.href),
|
|
726
721
|
'aria-label': props.text,
|
|
727
722
|
onClick: handlerDecorator(handleHref(props), props),
|
|
728
723
|
});
|
|
729
|
-
function adjustHref(href) {
|
|
730
|
-
const isRelativeToBase = !isRemote && href?.startsWith('/');
|
|
731
|
-
return projectSettings.BASE_PATH && href && isRelativeToBase
|
|
732
|
-
? joinPath(projectSettings.BASE_PATH, href)
|
|
733
|
-
: href;
|
|
734
|
-
}
|
|
735
724
|
function handleHref({ href, target, onClick }) {
|
|
736
725
|
return (ev) => {
|
|
737
726
|
onClick && onClick(ev);
|
|
738
|
-
if (isRemote || !isLocalURL(href, target)) {
|
|
727
|
+
if (!href || isRemote || !isLocalURL(href, target)) {
|
|
739
728
|
// Default routing
|
|
740
729
|
return;
|
|
741
730
|
}
|
|
742
731
|
// Client routing
|
|
743
732
|
ev?.preventDefault();
|
|
744
|
-
|
|
745
|
-
gotoBlock(router, href);
|
|
746
|
-
}
|
|
747
|
-
else if (href) {
|
|
748
|
-
router.push(href);
|
|
749
|
-
}
|
|
733
|
+
router.push(href);
|
|
750
734
|
};
|
|
751
735
|
}
|
|
752
736
|
}
|
|
@@ -1402,7 +1386,16 @@
|
|
|
1402
1386
|
return (jsx(BlockWrapper, { className: `px-4 py-6 ${className}`, ...rest, children: jsx(ProductBlockInner, { ...props }) }));
|
|
1403
1387
|
});
|
|
1404
1388
|
|
|
1405
|
-
const
|
|
1389
|
+
const RichText = JSX((props) => {
|
|
1390
|
+
const { __html = '' } = props;
|
|
1391
|
+
return jsx("div", { className: "md-container", dangerouslySetInnerHTML: { __html } });
|
|
1392
|
+
});
|
|
1393
|
+
|
|
1394
|
+
function assertUnreachable(x) {
|
|
1395
|
+
throw new Error(x);
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
const checkCanRenderIcon = (icon) => Boolean(icon?.icon || icon?.src);
|
|
1406
1399
|
|
|
1407
1400
|
const STEPS_BLOCK_STYLE_MAPS = {
|
|
1408
1401
|
primary: {
|
|
@@ -1454,9 +1447,27 @@
|
|
|
1454
1447
|
};
|
|
1455
1448
|
const StepsBlock = JSX(({ className = '', title, description, showLines = true, steps, size = 'normal', version = 'primary', ...rest }) => {
|
|
1456
1449
|
const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
|
|
1457
|
-
return (jsxs(BlockWrapper, { className: `box-border px-4 py-6 flex flex-col ${className}`, version: version, ...rest, children: [title ? jsx(Heading, { headingType: "h3", className: "text-center", title: title }) : null, description ? (jsx("p", { className: `text-m-light text-center ${styleMap.description} ${title ? 'mt-2' : ''}`, children: description })) : null, steps?.length ? (jsx("div", { className: `box-border py-0.5 mb-0.5 mt-5`, children: jsx("div", { className: "flex flex-col justify-between gap-x-[101px]", children: steps.map(
|
|
1450
|
+
return (jsxs(BlockWrapper, { className: `box-border px-4 py-6 flex flex-col ${className}`, version: version, ...rest, children: [title ? jsx(Heading, { headingType: "h3", className: "text-center", title: title }) : null, description ? (jsx("p", { className: `text-m-light text-center ${styleMap.description} ${title ? 'mt-2' : ''}`, children: description })) : null, steps?.length ? (jsx("div", { className: `box-border py-0.5 mb-0.5 mt-5`, children: jsx("div", { className: "flex flex-col justify-between gap-x-[101px]", children: steps.map(renderStep(size, version, showLines)) }) })) : null] }));
|
|
1458
1451
|
});
|
|
1459
|
-
|
|
1452
|
+
// TODO: Create universal function for this case
|
|
1453
|
+
const renderStep = (size, version, showLines) =>
|
|
1454
|
+
// Linter doesn't understand that switch processes all cases
|
|
1455
|
+
// eslint-disable-next-line consistent-return
|
|
1456
|
+
(step, i, steps) => {
|
|
1457
|
+
const { type } = step;
|
|
1458
|
+
if (!(type === 'default' || type === 'rte')) {
|
|
1459
|
+
return null;
|
|
1460
|
+
}
|
|
1461
|
+
switch (type) {
|
|
1462
|
+
case 'default':
|
|
1463
|
+
return renderDefaultStep(size, version, showLines)(step, i, steps);
|
|
1464
|
+
case 'rte':
|
|
1465
|
+
return jsx(RichText, { __html: step.__html });
|
|
1466
|
+
default:
|
|
1467
|
+
assertUnreachable(step);
|
|
1468
|
+
}
|
|
1469
|
+
};
|
|
1470
|
+
const renderDefaultStep = (size, version, showLines) => (step, i, steps) => {
|
|
1460
1471
|
const isLastStep = steps.length - 1 === i;
|
|
1461
1472
|
const margin = size === 'normal' ? 'ml-[34px]' : 'ml-6';
|
|
1462
1473
|
const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
|
|
@@ -1467,7 +1478,7 @@
|
|
|
1467
1478
|
const iconAreaSize = STEPS_SIZE_MAP[size];
|
|
1468
1479
|
const iconSize = size === 'normal' ? '38' : '27';
|
|
1469
1480
|
const iconTextSize = size === 'normal' ? 'text-m-title' : 'text-m-title-xs';
|
|
1470
|
-
return (jsx("div", { className: `${iconAreaSize} ${styleMap.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`, children: jsx("span", { className: `font-medium flex self-center ${iconTextSize}`, children:
|
|
1481
|
+
return (jsx("div", { className: `${iconAreaSize} ${styleMap.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`, children: jsx("span", { className: `font-medium flex self-center ${iconTextSize}`, children: checkCanRenderIcon(step?.icon) ? (jsx(Img, { image: getIconWithVersion({ ...step.icon }, version), width: iconSize, height: iconSize, asSVG: true })) : (jsx("span", { children: i + 1 })) }) }));
|
|
1471
1482
|
};
|
|
1472
1483
|
|
|
1473
1484
|
const renderButtonsCellData = ({ buttons }) => renderButtonsSection(buttons, {
|
|
@@ -1581,6 +1592,11 @@
|
|
|
1581
1592
|
return debouncedCallback;
|
|
1582
1593
|
};
|
|
1583
1594
|
|
|
1595
|
+
const normalizeAnchor = (anchor) => anchor?.replace('#', '') || '';
|
|
1596
|
+
function trackBlock(block) {
|
|
1597
|
+
globalThis.history?.replaceState(globalThis.history?.state, '', `#${normalizeAnchor(block?.anchor)}`);
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1584
1600
|
const SPECIAL_BLOCK_TYPES = ['Header', 'Footer'];
|
|
1585
1601
|
const EPS = 0.01;
|
|
1586
1602
|
const topLineDelta = ([, { target }]) => Math.abs(target.getBoundingClientRect().top);
|
|
@@ -1594,7 +1610,6 @@
|
|
|
1594
1610
|
|
|
1595
1611
|
const isScrolledEnough = () => globalThis.scrollY > (globalThis.innerHeight * 3) / 4;
|
|
1596
1612
|
function useBlockRouterProvider(scrollTarget = globalThis) {
|
|
1597
|
-
const router = useRouter();
|
|
1598
1613
|
const intersectionsMapRef = useRef(new Map());
|
|
1599
1614
|
useEffect(() => blockRouterEventBus.subscribe('intersection', ({ block, intersection }) => {
|
|
1600
1615
|
if (intersectionsMapRef.current) {
|
|
@@ -1603,20 +1618,14 @@
|
|
|
1603
1618
|
}), []);
|
|
1604
1619
|
useEffect(() => {
|
|
1605
1620
|
const handleScroll = debounce(() => {
|
|
1606
|
-
|
|
1607
|
-
const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
|
|
1608
|
-
trackBlock(router, activeBlock);
|
|
1609
|
-
}
|
|
1610
|
-
else {
|
|
1611
|
-
trackBlock(router);
|
|
1612
|
-
}
|
|
1621
|
+
trackBlock(isScrolledEnough() ? findActiveBlock([...(intersectionsMapRef.current || [])]) : undefined);
|
|
1613
1622
|
}, 100);
|
|
1614
1623
|
scrollTarget.addEventListener('scroll', handleScroll);
|
|
1615
1624
|
return () => {
|
|
1616
1625
|
handleScroll.dispose();
|
|
1617
1626
|
scrollTarget.removeEventListener('scroll', handleScroll);
|
|
1618
1627
|
};
|
|
1619
|
-
}, [
|
|
1628
|
+
}, [scrollTarget]);
|
|
1620
1629
|
}
|
|
1621
1630
|
|
|
1622
1631
|
const api = LikeAPI();
|
|
@@ -1691,7 +1700,7 @@
|
|
|
1691
1700
|
return (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: i }, el) : [el]), []);
|
|
1692
1701
|
}
|
|
1693
1702
|
|
|
1694
|
-
const packageVersion = "0.8.
|
|
1703
|
+
const packageVersion = "0.8.11";
|
|
1695
1704
|
|
|
1696
1705
|
exports.Blocks = Blocks;
|
|
1697
1706
|
exports.ContentPage = ContentPage;
|