@pushwoosh/dumb-components 1.1.172 → 1.1.173

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.
@@ -11,7 +11,6 @@ import { parseNativeRichMediaConfig } from './parseNativeRichMediaConfig';
11
11
  import { resolveLocalization } from './resolveLocalization';
12
12
  import { BackdropLayer, ContentFlow, PreviewHost, ScrollLayer, SpinnerLayer } from './styles';
13
13
  import { NativeRichMediaBannerView, NativeRichMediaCarouselView, NativeRichMediaFullscreenView, NativeRichMediaInvalidView, NativeRichMediaModalView, NativeRichMediaPipView, NativeRichMediaScratchcardView, NativeRichMediaSheetView, NativeRichMediaSpinwheelView, NativeRichMediaStoriesView, NativeRichMediaVideoView } from './views';
14
- import { GradientOverlay } from './views/shared/styles';
15
14
  function dimsScreen(config) {
16
15
  if (!config) {
17
16
  return false;
@@ -50,16 +49,12 @@ function justifyFor(config) {
50
49
  return 'center';
51
50
  }
52
51
  }
53
- function renderCoverBackdrop(url, backgroundColor, overlayTopOffset) {
54
- return _jsxs(_Fragment, {
55
- children: [_jsx(NativeRichMediaCoverImg, {
56
- url: url,
57
- position: "absolute",
58
- inset: true,
59
- backgroundColor: backgroundColor
60
- }), _jsx(GradientOverlay, {
61
- "$topOffset": overlayTopOffset
62
- })]
52
+ function renderCoverBackdrop(url, backgroundColor) {
53
+ return _jsx(NativeRichMediaCoverImg, {
54
+ url: url,
55
+ position: "absolute",
56
+ inset: true,
57
+ backgroundColor: backgroundColor
63
58
  });
64
59
  }
65
60
  function renderBackdrop(config, activeIndex) {
@@ -72,7 +67,7 @@ function renderBackdrop(config, activeIndex) {
72
67
  {
73
68
  var _items$clampIndex;
74
69
  const items = config.stories.items;
75
- return renderCoverBackdrop((_items$clampIndex = items[clampIndex(activeIndex, items.length)]) === null || _items$clampIndex === void 0 ? void 0 : _items$clampIndex.image, '#000', '55%');
70
+ return renderCoverBackdrop((_items$clampIndex = items[clampIndex(activeIndex, items.length)]) === null || _items$clampIndex === void 0 ? void 0 : _items$clampIndex.image, '#000');
76
71
  }
77
72
  default:
78
73
  return null;
@@ -0,0 +1,3 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { NativeRichMediaContentImgProps } from './types';
3
+ export declare function NativeRichMediaContentImg(props: NativeRichMediaContentImgProps): ReactElement;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Color } from '@pushwoosh/kit-constants';
3
+ import { Horizontal } from '@pushwoosh/kit-helpers';
4
+ import { Img } from './styles';
5
+ export function NativeRichMediaContentImg(props) {
6
+ const {
7
+ url,
8
+ margin,
9
+ borderRadius = 18
10
+ } = props;
11
+ return _jsx(Horizontal, {
12
+ "$margin": margin,
13
+ "$borderRadius": borderRadius,
14
+ "$bgColor": Color.FROZEN,
15
+ "$overflow": "hidden",
16
+ children: _jsx(Img, {
17
+ src: url,
18
+ alt: ""
19
+ })
20
+ });
21
+ }
@@ -0,0 +1 @@
1
+ export { NativeRichMediaContentImg } from './NativeRichMediaContentImg';
@@ -0,0 +1 @@
1
+ export { NativeRichMediaContentImg } from './NativeRichMediaContentImg';
@@ -0,0 +1 @@
1
+ export declare const Img: import("styled-components").StyledComponent<"img", any, {}, never>;
@@ -0,0 +1,5 @@
1
+ import styled from 'styled-components';
2
+ export const Img = styled.img.withConfig({
3
+ displayName: "Img",
4
+ componentId: "sc-1q27duj-0"
5
+ })(["display:block;width:100%;height:auto;"]);
@@ -0,0 +1,5 @@
1
+ export type NativeRichMediaContentImgProps = {
2
+ url?: string;
3
+ margin?: string;
4
+ borderRadius?: number;
5
+ };
@@ -1,5 +1,5 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Card, Dot, Dots, GradientOverlay, TextBlock } from './styles';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Card, Dot, Dots, TextBlock } from './styles';
3
3
  import { NativeRichMediaCloseChip } from '../../components/NativeRichMediaCloseChip';
4
4
  import { NativeRichMediaCoverImg } from '../../components/NativeRichMediaCoverImg';
5
5
  import { NativeRichMediaText } from '../../components/NativeRichMediaText';
@@ -20,15 +20,13 @@ export function NativeRichMediaCarouselView(props) {
20
20
  url: item.image,
21
21
  position: "absolute",
22
22
  inset: true
23
- }), (title.text || message.text) && _jsxs(_Fragment, {
24
- children: [_jsx(GradientOverlay, {}), _jsxs(TextBlock, {
25
- children: [title.text && _jsx(NativeRichMediaTitle, {
26
- "$color": title.color,
27
- children: title.text
28
- }), message.text && _jsx(NativeRichMediaText, {
29
- "$color": message.color,
30
- children: message.text
31
- })]
23
+ }), (title.text || message.text) && _jsxs(TextBlock, {
24
+ children: [title.text && _jsx(NativeRichMediaTitle, {
25
+ "$color": title.color,
26
+ children: title.text
27
+ }), message.text && _jsx(NativeRichMediaText, {
28
+ "$color": message.color,
29
+ children: message.text
32
30
  })]
33
31
  }), items.length > 1 && _jsx(Dots, {
34
32
  children: items.map((_, i) => _jsx(Dot
@@ -1,5 +1,4 @@
1
1
  export declare const Card: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const GradientOverlay: import("styled-components").StyledComponent<"div", any, {}, never>;
3
2
  export declare const TextBlock: import("styled-components").StyledComponent<"div", any, {}, never>;
4
3
  export declare const Dots: import("styled-components").StyledComponent<"div", any, {}, never>;
5
4
  export declare const Dot: import("styled-components").StyledComponent<"div", any, {
@@ -3,21 +3,17 @@ export const Card = styled.div.withConfig({
3
3
  displayName: "Card",
4
4
  componentId: "sc-15b2cux-0"
5
5
  })(["position:relative;margin:0 12px;height:461px;border-radius:24px;background:#000;overflow:hidden;box-shadow:0 16px 28px rgba(0,0,0,0.28);"]);
6
- export const GradientOverlay = styled.div.withConfig({
7
- displayName: "GradientOverlay",
8
- componentId: "sc-15b2cux-1"
9
- })(["position:absolute;left:0;right:0;bottom:0;height:140px;background:linear-gradient(180deg,rgba(0,0,0,0),rgba(0,0,0,0.75));"]);
10
6
  export const TextBlock = styled.div.withConfig({
11
7
  displayName: "TextBlock",
12
- componentId: "sc-15b2cux-2"
8
+ componentId: "sc-15b2cux-1"
13
9
  })(["position:absolute;left:18px;right:18px;bottom:36px;"]);
14
10
  export const Dots = styled.div.withConfig({
15
11
  displayName: "Dots",
16
- componentId: "sc-15b2cux-3"
12
+ componentId: "sc-15b2cux-2"
17
13
  })(["position:absolute;left:0;right:0;bottom:12px;text-align:center;font-size:0;"]);
18
14
  export const Dot = styled.div.withConfig({
19
15
  displayName: "Dot",
20
- componentId: "sc-15b2cux-4"
16
+ componentId: "sc-15b2cux-3"
21
17
  })(["display:inline-block;width:7px;height:7px;border-radius:50%;margin:0 4.5px;background:", ";"], ({
22
18
  $active
23
19
  }) => $active ? '#FFF' : 'rgba(255,255,255,0.4)');
@@ -3,7 +3,7 @@ import { Vertical } from '@pushwoosh/kit-helpers';
3
3
  import { Card } from './styles';
4
4
  import { NativeRichMediaButtonList } from '../../components/NativeRichMediaButtonList';
5
5
  import { NativeRichMediaCloseChip } from '../../components/NativeRichMediaCloseChip';
6
- import { NativeRichMediaCoverImg } from '../../components/NativeRichMediaCoverImg';
6
+ import { NativeRichMediaContentImg } from '../../components/NativeRichMediaContentImg';
7
7
  import { NativeRichMediaText } from '../../components/NativeRichMediaText';
8
8
  import { NativeRichMediaTitle } from '../../components/NativeRichMediaTitle';
9
9
  import { asButtonList, asTextValue } from '../../helpers';
@@ -17,10 +17,9 @@ export function NativeRichMediaModalView(props) {
17
17
  const message = asTextValue(block.message);
18
18
  return _jsxs(Card, {
19
19
  "$background": block.background,
20
- children: [block.image && _jsx(NativeRichMediaCoverImg, {
20
+ children: [block.image && _jsx(NativeRichMediaContentImg, {
21
21
  url: block.image,
22
22
  margin: "14px 14px 0",
23
- height: 179,
24
23
  borderRadius: 18
25
24
  }), (title.text || message.text) && _jsxs(Vertical, {
26
25
  "$padding": (block.image ? '20px' : '30px') + ' 24px 0',
@@ -3,7 +3,7 @@ import { Vertical } from '@pushwoosh/kit-helpers';
3
3
  import { Handle, Sheet } from './styles';
4
4
  import { NativeRichMediaButtonList } from '../../components/NativeRichMediaButtonList';
5
5
  import { NativeRichMediaCloseChip } from '../../components/NativeRichMediaCloseChip';
6
- import { NativeRichMediaCoverImg } from '../../components/NativeRichMediaCoverImg';
6
+ import { NativeRichMediaContentImg } from '../../components/NativeRichMediaContentImg';
7
7
  import { NativeRichMediaText } from '../../components/NativeRichMediaText';
8
8
  import { NativeRichMediaTitle } from '../../components/NativeRichMediaTitle';
9
9
  import { asButtonList, asTextValue } from '../../helpers';
@@ -17,10 +17,9 @@ export function NativeRichMediaSheetView(props) {
17
17
  const message = asTextValue(block.message);
18
18
  return _jsxs(Sheet, {
19
19
  "$background": block.background,
20
- children: [_jsx(Handle, {}), block.image && _jsx(NativeRichMediaCoverImg, {
20
+ children: [_jsx(Handle, {}), block.image && _jsx(NativeRichMediaContentImg, {
21
21
  url: block.image,
22
22
  margin: "26px 14px 0",
23
- height: 190,
24
23
  borderRadius: 18
25
24
  }), (title.text || message.text) && _jsxs(Vertical, {
26
25
  "$padding": (block.image ? '16px' : '20px') + ' 24px 0',
@@ -1,6 +1,3 @@
1
- export declare const GradientOverlay: import("styled-components").StyledComponent<"div", any, {
2
- $topOffset?: string;
3
- }, never>;
4
1
  export declare const TextBlock: import("styled-components").StyledComponent<"div", any, {}, never>;
5
2
  export declare const Card: import("styled-components").StyledComponent<"div", any, {
6
3
  $background: string;
@@ -1,18 +1,12 @@
1
1
  import styled from 'styled-components';
2
2
  import { EDGE_INSET } from '../../helpers';
3
- export const GradientOverlay = styled.div.withConfig({
4
- displayName: "GradientOverlay",
5
- componentId: "sc-x5bn03-0"
6
- })(["position:absolute;left:0;right:0;bottom:0;top:", ";background:linear-gradient(180deg,rgba(0,0,0,0),rgba(0,0,0,0.75));"], ({
7
- $topOffset
8
- }) => $topOffset ?? '45%');
9
3
  export const TextBlock = styled.div.withConfig({
10
4
  displayName: "TextBlock",
11
- componentId: "sc-x5bn03-1"
5
+ componentId: "sc-x5bn03-0"
12
6
  })(["margin:0 ", "px ", "px;"], EDGE_INSET, EDGE_INSET);
13
7
  export const Card = styled.div.withConfig({
14
8
  displayName: "Card",
15
- componentId: "sc-x5bn03-2"
9
+ componentId: "sc-x5bn03-1"
16
10
  })(["position:relative;margin:0 12px;border-radius:24px;box-shadow:0 16px 28px rgba(0,0,0,0.28);padding:", ";background:", ";"], ({
17
11
  $padding
18
12
  }) => $padding, ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.1.172",
3
+ "version": "1.1.173",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",