profinansy-ui-lib 3.8.52 → 3.8.54

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.
@@ -1,14 +1,14 @@
1
1
  import { IApiSettings } from '../api';
2
2
  import { IBanner } from './banner.typed';
3
3
  export declare const getBanner: (settings: IApiSettings, code: string) => Promise<{
4
- data: IBanner | null;
4
+ data: IBanner[] | null;
5
5
  ok: boolean;
6
6
  }>;
7
7
  export declare const viewBanner: (settings: IApiSettings, payload: {
8
8
  banner_platform_id: number;
9
9
  banner_id: number;
10
10
  }) => Promise<{
11
- ok: boolean;
11
+ view_id: number;
12
12
  }>;
13
13
  export declare const clickBanner: (settings: IApiSettings, payload: {
14
14
  view_id: number;
@@ -5610,7 +5610,7 @@ Check the top-level render call using <`+q+">.")}return G}}function q2(L,G){{if(
5610
5610
  background: -webkit-linear-gradient(#9747ff, #337bf0e5, #ee2cff);
5611
5611
  -webkit-background-clip: text;
5612
5612
  -webkit-text-fill-color: transparent;
5613
- `;const ML=()=>{const{mode:t}=ne();return s.jsx(h.ThemeProvider,{theme:J[t],children:s.jsx(yL,{isPremium:!0,children:s.jsxs(kL,{children:[s.jsxs(EL,{children:["Вам доступен этот раздел, потому что вы оформили premium на profinansy.ru. ",s.jsx("span",{children:"И это потрясающе!"})]}),s.jsx(IL,{href:"https://profinansy.ru/payment",target:"_blank",children:"Подробнее о premium"})]})})})},LL=(e,t)=>it(`/banner/list?code=${t}`,"GET",{...e,baseUrl:Ms}),SL=(e,t)=>it("/banner/view","PUT",{...e,baseUrl:Ms},t),$L=(e,t)=>it("/banner/click","PUT",{...e,baseUrl:Ms},t),DL=h.styled.a`
5613
+ `;const ML=()=>{const{mode:t}=ne();return s.jsx(h.ThemeProvider,{theme:J[t],children:s.jsx(yL,{isPremium:!0,children:s.jsxs(kL,{children:[s.jsxs(EL,{children:["Вам доступен этот раздел, потому что вы оформили premium на profinansy.ru. ",s.jsx("span",{children:"И это потрясающе!"})]}),s.jsx(IL,{href:"https://profinansy.ru/payment",target:"_blank",children:"Подробнее о premium"})]})})})},LL=(e,t)=>it(`/banner/list?code=${t}`,"GET",{...e,baseUrl:Ms}),SL=(e,t)=>it(`/banner/view?banner_platform_id=${t.banner_platform_id}&banner_id=${t.banner_id}`,"PUT",{...e,baseUrl:Ms}),$L=(e,t)=>it(`/banner/click?view_id=${t.view_id}`,"PUT",{...e,baseUrl:Ms},t),DL=h.styled.a`
5614
5614
  display: block;
5615
5615
  max-width: ${e=>e.$bannerMaxWidth?`${e.$bannerMaxWidth}px`:"unset"};
5616
5616
  margin: ${e=>`${e.$mt||0}px auto ${e.$mb||0}px`};
@@ -5655,7 +5655,7 @@ Check the top-level render call using <`+q+">.")}return G}}function q2(L,G){{if(
5655
5655
  `,AL=h.styled.img`
5656
5656
  border-radius: 12px;
5657
5657
  object-fit: cover;
5658
- `,RL=typeof window<"u"&&!!window.ym,B5=(e,t)=>{RL&&window.ym(89369871,"reachGoal",e,t)},xa="your_banner_key",PL=({bannerCode:e,size:t,bannerMaxWidth:n,mb:r,mt:o,closeButtonHidden:i,yandexEvent:a,yandexEventView:l,rootStyles:c})=>{const[u,f]=m.useState(null),[p,C]=m.useState(!0),[g,v]=m.useState(null),{user:b}=Ce(),x=b.token,y=m.useRef(null),w=St(Lt.down(600)),E=St(Lt.down(960)),I=St(Lt.down(1200));m.useEffect(()=>{const R=async()=>{try{const H=await LL({token:x},e);console.log("banner",H)}catch{f(null)}};R(),x&&R()},[e,x]);const k={"688x334":w,"688x452":E,"1052x688":I,"1300x1052":!w&&!E&&!I},S=Object.keys(k).find(R=>k[R]),M=u?.photos[t||S],$=!!u&&!!M,D=u?.id,B=!$||p||b.type===2,F=()=>{a&&B5(a),g&&$L({token:x},{view_id:g})},P=async()=>{if(!u)return;l&&B5(l);const R=await SL({token:x},{banner_id:u.id,banner_platform_id:u.banner_platform_id});console.log("view",R)};m.useEffect(()=>{if(D&&!JSON.parse(localStorage.getItem(xa)??"[]").includes(D)){C(!1);return}},[D]),m.useEffect(()=>{if(B)return;const R=y.current;if(!R)return;const H=new IntersectionObserver(([A],_)=>{A.isIntersecting&&(P(),_.unobserve(A.target))},{threshold:.5});return H.observe(R),()=>{H.disconnect()}},[B]);const V=R=>{R.preventDefault(),R.stopPropagation(),C(!0);const H=JSON.parse(localStorage.getItem(xa)??"[]");if(H?.includes(D))return;const A=[D,...H];localStorage.setItem(xa,JSON.stringify(A))};return B?null:s.jsxs(DL,{ref:y,target:"_blank",href:u?.url,style:c,rel:"noreferrer",$bannerMaxWidth:n,$mt:o,$mb:r,onClick:F,children:[!i&&s.jsx(_L,{onClick:V,children:s.jsx(TL,{})}),M&&s.jsx(AL,{src:ki(M,"_"),alt:"Картинка баннера"})]})},jL=h.keyframes`
5658
+ `,RL=typeof window<"u"&&!!window.ym,B5=(e,t)=>{RL&&window.ym(89369871,"reachGoal",e,t)},xa="your_banner_key",PL=({bannerCode:e,size:t,bannerMaxWidth:n,mb:r,mt:o,closeButtonHidden:i,yandexEvent:a,yandexEventView:l,rootStyles:c})=>{const[u,f]=m.useState(null),[p,C]=m.useState(!0),[g,v]=m.useState(null),{user:b}=Ce(),x=b.token,y=m.useRef(null),w=St(Lt.down(600)),E=St(Lt.down(960)),I=St(Lt.down(1200));m.useEffect(()=>{x&&(async()=>{try{const H=await LL({token:x},e);if(!H?.data.length){f(null);return}f(H.data[0])}catch{f(null)}})()},[e,x]);const k={"688x334":w,"688x452":E,"1052x688":I,"1300x1052":!w&&!E&&!I},S=Object.keys(k).find(R=>k[R]),M=u?.photos[t||S],$=!!u&&!!M,D=u?.id,B=!$||p||b.type===2,F=async()=>{a&&B5(a),g&&await $L({token:x},{view_id:g})},P=async()=>{if(!u)return;l&&B5(l);const R=await SL({token:x},{banner_id:u.id,banner_platform_id:u.banner_platform_id});R?.view_id&&v(R.view_id)};m.useEffect(()=>{if(D&&!JSON.parse(localStorage.getItem(xa)??"[]").includes(D)){C(!1);return}},[D]),m.useEffect(()=>{if(B)return;const R=y.current;if(!R)return;const H=new IntersectionObserver(([A],_)=>{A.isIntersecting&&(P(),_.unobserve(A.target))},{threshold:.5});return H.observe(R),()=>{H.disconnect()}},[B]);const V=R=>{R.preventDefault(),R.stopPropagation(),C(!0);const H=JSON.parse(localStorage.getItem(xa)??"[]");if(H?.includes(D))return;const A=[D,...H];localStorage.setItem(xa,JSON.stringify(A))};return B?null:s.jsxs(DL,{ref:y,target:"_blank",href:u?.url,style:c,rel:"noreferrer",$bannerMaxWidth:n,$mt:o,$mb:r,onClick:F,children:[!i&&s.jsx(_L,{onClick:V,children:s.jsx(TL,{})}),M&&s.jsx(AL,{src:ki(M,"_"),alt:"Картинка баннера"})]})},jL=h.keyframes`
5659
5659
  0% {
5660
5660
  box-shadow: 0 0 0 0 rgba(51, 217, 178, 0.7);
5661
5661
  }