@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.
- package/NativeRichMediaPreview/NativeRichMediaPreview.js +7 -12
- package/NativeRichMediaPreview/components/NativeRichMediaContentImg/NativeRichMediaContentImg.d.ts +3 -0
- package/NativeRichMediaPreview/components/NativeRichMediaContentImg/NativeRichMediaContentImg.js +21 -0
- package/NativeRichMediaPreview/components/NativeRichMediaContentImg/index.d.ts +1 -0
- package/NativeRichMediaPreview/components/NativeRichMediaContentImg/index.js +1 -0
- package/NativeRichMediaPreview/components/NativeRichMediaContentImg/styles.d.ts +1 -0
- package/NativeRichMediaPreview/components/NativeRichMediaContentImg/styles.js +5 -0
- package/NativeRichMediaPreview/components/NativeRichMediaContentImg/types.d.ts +5 -0
- package/NativeRichMediaPreview/components/NativeRichMediaContentImg/types.js +1 -0
- package/NativeRichMediaPreview/views/NativeRichMediaCarouselView/NativeRichMediaCarouselView.js +9 -11
- package/NativeRichMediaPreview/views/NativeRichMediaCarouselView/styles.d.ts +0 -1
- package/NativeRichMediaPreview/views/NativeRichMediaCarouselView/styles.js +3 -7
- package/NativeRichMediaPreview/views/NativeRichMediaModalView/NativeRichMediaModalView.js +2 -3
- package/NativeRichMediaPreview/views/NativeRichMediaSheetView/NativeRichMediaSheetView.js +2 -3
- package/NativeRichMediaPreview/views/shared/styles.d.ts +0 -3
- package/NativeRichMediaPreview/views/shared/styles.js +2 -8
- package/package.json +1 -1
|
@@ -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
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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'
|
|
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;
|
package/NativeRichMediaPreview/components/NativeRichMediaContentImg/NativeRichMediaContentImg.js
ADDED
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
package/NativeRichMediaPreview/views/NativeRichMediaCarouselView/NativeRichMediaCarouselView.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
-
import { Card, Dot, Dots,
|
|
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(
|
|
24
|
-
children: [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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 {
|
|
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(
|
|
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 {
|
|
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(
|
|
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-
|
|
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-
|
|
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, ({
|