profinansy-ui-lib 4.1.66 → 4.1.67
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/dist/api/banner/groupModal.d.ts +5 -0
- package/dist/api/banner/groupModal.typed.d.ts +78 -0
- package/dist/components/banners/Banner/Banner.const.d.ts +22 -0
- package/dist/components/banners/Banner/Banner.d.ts +3 -2
- package/dist/components/banners/Banner/Banner.typed.d.ts +37 -0
- package/dist/components/banners/Banner/Banner.utils.d.ts +5 -0
- package/dist/components/banners/Banner/bannerStoryPreview.d.ts +16 -0
- package/dist/components/banners/Banner/components/BannerModal/BannerModal.d.ts +3 -0
- package/dist/components/banners/Banner/components/BannerModal/BannerModal.styled.d.ts +21 -0
- package/dist/components/banners/Banner/components/BannerModal/BannerModal.typed.d.ts +8 -0
- package/dist/components/banners/Banner/components/BannerModal/index.d.ts +1 -0
- package/dist/components/banners/Banner/hooks/useBannerModalAnalytics.d.ts +11 -0
- package/dist/components/banners/Banner/hooks/useBannerModalNavigation.d.ts +18 -0
- package/dist/components/banners/Banner/hooks/useBannerModalOpen.d.ts +18 -0
- package/dist/components/banners/Banner/hooks/useGetBanner.d.ts +2 -1
- package/dist/components/banners/Banner/hooks/useGetGroupModal.d.ts +10 -0
- package/dist/components/banners/Banner/hooks/useGroupModalSlides.d.ts +8 -0
- package/dist/components/banners/Banner/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/profinansy-ui-lib.cjs +1700 -1556
- package/dist/profinansy-ui-lib.cjs.map +1 -1
- package/dist/profinansy-ui-lib.es.js +13775 -12506
- package/dist/profinansy-ui-lib.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IApiSettings } from '../api';
|
|
2
|
+
import { IClickGroupModalPayload, IGroupModalClick, IGroupModalListResponse, IViewGroupModalPayload } from './groupModal.typed';
|
|
3
|
+
export declare const getGroupModal: (settings: IApiSettings, code: string, language?: string) => Promise<IGroupModalListResponse>;
|
|
4
|
+
export declare const viewGroupModal: (settings: IApiSettings, payload: IViewGroupModalPayload) => Promise<IGroupModalClick>;
|
|
5
|
+
export declare const clickGroupModal: (settings: IApiSettings, payload: IClickGroupModalPayload) => Promise<IGroupModalClick>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export interface IStoriesText {
|
|
2
|
+
text?: string | null;
|
|
3
|
+
font?: string | null;
|
|
4
|
+
font_size?: number;
|
|
5
|
+
font_color?: string | null;
|
|
6
|
+
font_weight?: string | null;
|
|
7
|
+
positioning_text?: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface IStoriesButton {
|
|
10
|
+
type_button?: string | null;
|
|
11
|
+
background_color?: string | null;
|
|
12
|
+
width?: number | null;
|
|
13
|
+
height?: number | null;
|
|
14
|
+
border_radius?: number | null;
|
|
15
|
+
positioning_button?: string | null;
|
|
16
|
+
href?: string | null;
|
|
17
|
+
text_button?: IStoriesText | null;
|
|
18
|
+
}
|
|
19
|
+
export interface IStoriesImg {
|
|
20
|
+
survey_id?: number | null;
|
|
21
|
+
fileId?: number | null;
|
|
22
|
+
fileType?: string | null;
|
|
23
|
+
fileUrl?: string | null;
|
|
24
|
+
videoUrl?: string | null;
|
|
25
|
+
title?: IStoriesText | null;
|
|
26
|
+
desc?: IStoriesText | null;
|
|
27
|
+
list_btn?: IStoriesButton[] | null;
|
|
28
|
+
}
|
|
29
|
+
export interface IStoriesOther {
|
|
30
|
+
title?: string | null;
|
|
31
|
+
btn_txt?: string | null;
|
|
32
|
+
description?: string | null;
|
|
33
|
+
img?: string | null;
|
|
34
|
+
}
|
|
35
|
+
export interface IStoriesUse {
|
|
36
|
+
id: number;
|
|
37
|
+
title: string;
|
|
38
|
+
is_primary?: boolean;
|
|
39
|
+
language?: string;
|
|
40
|
+
main_img?: number | null;
|
|
41
|
+
main_img_url?: string | null;
|
|
42
|
+
list_img?: IStoriesImg[] | string[] | null;
|
|
43
|
+
banner: boolean;
|
|
44
|
+
banner_modal?: boolean;
|
|
45
|
+
other?: IStoriesOther | null;
|
|
46
|
+
platform?: string[] | null;
|
|
47
|
+
count_like?: number;
|
|
48
|
+
count_view?: number;
|
|
49
|
+
ab_test?: boolean | null;
|
|
50
|
+
group_id?: number | null;
|
|
51
|
+
is_viewed?: boolean | null;
|
|
52
|
+
is_liked?: boolean | null;
|
|
53
|
+
is_clicked?: boolean | null;
|
|
54
|
+
}
|
|
55
|
+
export interface IGroupModalUse {
|
|
56
|
+
id: number;
|
|
57
|
+
name: string;
|
|
58
|
+
platform?: string[] | null;
|
|
59
|
+
rules?: unknown;
|
|
60
|
+
priority: number;
|
|
61
|
+
group_id?: number | null;
|
|
62
|
+
list_banner?: IStoriesUse[];
|
|
63
|
+
}
|
|
64
|
+
export interface IGroupModalListResponse {
|
|
65
|
+
data: IGroupModalUse[] | null;
|
|
66
|
+
}
|
|
67
|
+
export interface IGroupModalClick {
|
|
68
|
+
view_id?: number | null;
|
|
69
|
+
status?: boolean | null;
|
|
70
|
+
}
|
|
71
|
+
export interface IViewGroupModalPayload {
|
|
72
|
+
group_id: number;
|
|
73
|
+
group_modal_id: number;
|
|
74
|
+
stories_id?: number | null;
|
|
75
|
+
}
|
|
76
|
+
export interface IClickGroupModalPayload {
|
|
77
|
+
view_id: number;
|
|
78
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const BANNER_MODAL_DELAY_MS = 10000;
|
|
2
|
+
export declare const BANNER_MODAL_DRAG_THRESHOLD_PX = 8;
|
|
3
|
+
export declare const BANNER_MODAL_SWIPE_PX = 48;
|
|
4
|
+
/** max-width: 599px === viewport < 600 — mobile-модалка */
|
|
5
|
+
export declare const BANNER_MODAL_MOBILE_MAX = 599;
|
|
6
|
+
/** max-width: 959px === viewport < 960 — tablet-модалка; иначе desktop */
|
|
7
|
+
export declare const BANNER_MODAL_TABLET_MAX = 959;
|
|
8
|
+
export declare const BANNER_MODAL_DESKTOP_WIDTH = 1128;
|
|
9
|
+
export declare const BANNER_MODAL_DESKTOP_HEIGHT = 352;
|
|
10
|
+
export declare const BANNER_MODAL_TABLET_WIDTH = 600;
|
|
11
|
+
export declare const BANNER_MODAL_TABLET_HEIGHT = 188;
|
|
12
|
+
export declare const BANNER_MODAL_MOBILE_WIDTH = 328;
|
|
13
|
+
export declare const BANNER_MODAL_MOBILE_HEIGHT = 474;
|
|
14
|
+
export declare const BANNER_MODAL_DESKTOP_RADIUS = 20;
|
|
15
|
+
export declare const BANNER_MODAL_DESKTOP_BORDER = "0.729px";
|
|
16
|
+
export declare const BANNER_MODAL_TABLET_RADIUS = 10.594;
|
|
17
|
+
export declare const BANNER_MODAL_TABLET_BORDER = "0.386px";
|
|
18
|
+
export declare const BANNER_MODAL_MOBILE_RADIUS = 20;
|
|
19
|
+
export declare const BANNER_MODAL_MOBILE_BORDER = "0.386px";
|
|
20
|
+
export declare const BANNER_MODAL_DOTS_GAP = 18;
|
|
21
|
+
export declare const BANNER_MODAL_DOTS_GAP_MOBILE = 16;
|
|
22
|
+
export declare const BANNER_MODAL_PORTAL_ID = "banner-group-modal";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IBannerProps, IBannerRef } from './Banner.typed';
|
|
3
|
+
declare const Banner: React.ForwardRefExoticComponent<IBannerProps & React.RefAttributes<IBannerRef>>;
|
|
3
4
|
export { Banner };
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
|
+
import { IBanner } from '../../../api/banner/banner.typed';
|
|
3
|
+
import { IGroupModalUse } from '../../../api/banner/groupModal.typed';
|
|
4
|
+
export type TBannerModalTrigger = 'auto' | 'manual';
|
|
5
|
+
export interface IBannerRef {
|
|
6
|
+
/** Запускает таймер и открывает модалку, если бэкенд отдал group_modal */
|
|
7
|
+
openModal: (options?: {
|
|
8
|
+
delayMs?: number;
|
|
9
|
+
}) => void;
|
|
10
|
+
/** Отменяет ожидающий таймер открытия */
|
|
11
|
+
cancelModalOpen: () => void;
|
|
12
|
+
}
|
|
2
13
|
type BannerSize = '236x340' | '324x140' | '328x134' | '452x172' | '688x334' | '688x452' | '912x128' | '1052x688' | '1160x128' | '1300x1052';
|
|
3
14
|
export interface IBannerProps {
|
|
4
15
|
/** Код баннера */
|
|
@@ -23,5 +34,31 @@ export interface IBannerProps {
|
|
|
23
34
|
target?: string;
|
|
24
35
|
/** Не скруглять границу у баннера */
|
|
25
36
|
withOutBorderRadius?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Запрашивать и показывать модальный баннер (group_modal).
|
|
39
|
+
* @default true
|
|
40
|
+
*/
|
|
41
|
+
modalEnabled?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* auto — открыть модалку самим, если бэкенд отдал набор.
|
|
44
|
+
* manual — только после openModal() на ref.
|
|
45
|
+
* @default 'auto'
|
|
46
|
+
*/
|
|
47
|
+
modalTrigger?: TBannerModalTrigger;
|
|
48
|
+
/**
|
|
49
|
+
* Задержка перед открытием в manual-режиме, мс.
|
|
50
|
+
* @default 10000
|
|
51
|
+
*/
|
|
52
|
+
modalDelayMs?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Мок in-flow баннера для Storybook. Если задан (в том числе `null`) —
|
|
55
|
+
* `GET /modal/list` не вызывается.
|
|
56
|
+
*/
|
|
57
|
+
previewBanner?: IBanner | null;
|
|
58
|
+
/**
|
|
59
|
+
* Мок набора модалки для Storybook. Если задан (в том числе `null`) —
|
|
60
|
+
* `GET /modal/group_modal/list` не вызывается.
|
|
61
|
+
*/
|
|
62
|
+
previewGroupModal?: IGroupModalUse | null;
|
|
26
63
|
}
|
|
27
64
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IStoriesUse } from '../../../api/banner/groupModal.typed';
|
|
2
|
+
export declare const getGroupModalSlideImageUrl: (slide?: IStoriesUse | null) => string;
|
|
3
|
+
export declare const getGroupModalSlideHref: (slide?: IStoriesUse | null) => string;
|
|
4
|
+
export declare const formatBannerImageUrl: (raw?: string) => string;
|
|
5
|
+
export declare const getGroupModalDisplayImageUrl: (slide?: IStoriesUse | null) => string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IGroupModalUse, IStoriesUse } from '../../../api/banner/groupModal.typed';
|
|
2
|
+
export declare const makeBannerPreviewPlaceholder: (width: number, height: number) => string;
|
|
3
|
+
export declare const makeBannerPreviewSlides: (width: number, height: number) => IStoriesUse[];
|
|
4
|
+
export declare const makeBannerPreviewGroup: (width: number, height: number) => IGroupModalUse;
|
|
5
|
+
export declare const useBannerPreviewFrame: () => {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const useBannerPreviewGroup: () => {
|
|
10
|
+
frame: {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
};
|
|
14
|
+
slides: IStoriesUse[];
|
|
15
|
+
group: IGroupModalUse;
|
|
16
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Overlay: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export declare const Stage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
export declare const Frame: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
5
|
+
export declare const ArtworkTrack: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
6
|
+
$dragging: boolean;
|
|
7
|
+
$offset: number;
|
|
8
|
+
}>> & string;
|
|
9
|
+
export declare const ArtworkLink: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, {
|
|
10
|
+
$clickable: boolean;
|
|
11
|
+
$dragging: boolean;
|
|
12
|
+
}>> & string;
|
|
13
|
+
export declare const Artwork: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
|
|
14
|
+
export declare const CloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
15
|
+
export declare const ArrowSlot: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
16
|
+
$side: 'left' | 'right';
|
|
17
|
+
}>> & string;
|
|
18
|
+
export declare const Dots: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
19
|
+
export declare const Dot: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
20
|
+
$active: boolean;
|
|
21
|
+
}>> & string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IGroupModalUse, IStoriesUse } from '../../../../../api/banner/groupModal.typed';
|
|
2
|
+
export interface IBannerModalProps {
|
|
3
|
+
groupModal: IGroupModalUse;
|
|
4
|
+
slides: IStoriesUse[];
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
/** Выключает PUT view/click. Нужен Storybook, чтобы не ходить в боевой API */
|
|
7
|
+
analyticsEnabled?: boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BannerModal } from './BannerModal';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IGroupModalUse, IStoriesUse } from '../../../../api/banner/groupModal.typed';
|
|
2
|
+
interface IProps {
|
|
3
|
+
groupModal: IGroupModalUse;
|
|
4
|
+
slides: IStoriesUse[];
|
|
5
|
+
index: number;
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const useBannerModalAnalytics: ({ groupModal, slides, index, enabled }: IProps) => {
|
|
9
|
+
trackClick: (slideId: number) => Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IStoriesUse } from '../../../../api/banner/groupModal.typed';
|
|
2
|
+
interface IProps {
|
|
3
|
+
slides: IStoriesUse[];
|
|
4
|
+
}
|
|
5
|
+
export declare const useBannerModalNavigation: ({ slides }: IProps) => {
|
|
6
|
+
index: number;
|
|
7
|
+
dragX: number;
|
|
8
|
+
isDragging: boolean;
|
|
9
|
+
canNavigate: boolean;
|
|
10
|
+
goTo: (next: number) => void;
|
|
11
|
+
goNext: () => void;
|
|
12
|
+
goPrev: () => void;
|
|
13
|
+
onPointerDown: (clientX: number) => void;
|
|
14
|
+
onPointerMove: (clientX: number) => void;
|
|
15
|
+
onPointerUp: () => void;
|
|
16
|
+
consumeClick: () => boolean;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TBannerModalTrigger } from '../Banner.typed';
|
|
2
|
+
interface IProps {
|
|
3
|
+
hasGroupModal: boolean;
|
|
4
|
+
firstImageUrl: string;
|
|
5
|
+
modalEnabled: boolean;
|
|
6
|
+
modalTrigger: TBannerModalTrigger;
|
|
7
|
+
modalDelayMs: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const useBannerModalOpen: ({ hasGroupModal, firstImageUrl, modalEnabled, modalTrigger, modalDelayMs }: IProps) => {
|
|
10
|
+
isModalOpen: boolean;
|
|
11
|
+
isFirstImageReady: boolean;
|
|
12
|
+
openModal: (options?: {
|
|
13
|
+
delayMs?: number;
|
|
14
|
+
}) => void;
|
|
15
|
+
cancelModalOpen: () => void;
|
|
16
|
+
closeModal: () => void;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { IBanner } from '../../../../api/banner/banner.typed';
|
|
2
2
|
interface IProps {
|
|
3
3
|
bannerCode: string;
|
|
4
|
+
enabled?: boolean;
|
|
4
5
|
}
|
|
5
|
-
export declare const useGetBanner: ({ bannerCode }: IProps) => {
|
|
6
|
+
export declare const useGetBanner: ({ bannerCode, enabled }: IProps) => {
|
|
6
7
|
bannerData: IBanner;
|
|
7
8
|
};
|
|
8
9
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IGroupModalUse } from '../../../../api/banner/groupModal.typed';
|
|
2
|
+
interface IProps {
|
|
3
|
+
bannerCode: string;
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const useGetGroupModal: ({ bannerCode, enabled }: IProps) => {
|
|
7
|
+
groupModal: IGroupModalUse;
|
|
8
|
+
hasGroupModal: boolean;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export { useMediaQuery, breakpoint } from './hooks/useMediaQuery';
|
|
|
31
31
|
export { PremiumBanner } from './components/banners/HeaderBanners/PremiumBanner';
|
|
32
32
|
export { CommonBanner } from './components/banners/HeaderBanners/CommonBanner';
|
|
33
33
|
export { Banner } from './components/banners/Banner';
|
|
34
|
+
export type { IBannerProps, IBannerRef, TBannerModalTrigger } from './components/banners/Banner';
|
|
34
35
|
export { SuccessModal } from './components/modals/SuccessModal';
|
|
35
36
|
export { Alert } from './components/uikit/Alert';
|
|
36
37
|
export { AvatarCompany } from './components/uikit/AvatarCompany';
|