@pushwoosh/dumb-components 1.1.162 → 1.1.164
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/Modal/components/Modal/styles.js +3 -3
- package/NativeRichMediaPreview/NativeRichMediaPreview.d.ts +23 -4
- package/NativeRichMediaPreview/NativeRichMediaPreview.js +125 -63
- package/NativeRichMediaPreview/components/NativeRichMediaButtonList/NativeRichMediaButtonList.d.ts +3 -0
- package/NativeRichMediaPreview/components/NativeRichMediaButtonList/NativeRichMediaButtonList.js +24 -0
- package/NativeRichMediaPreview/components/NativeRichMediaButtonList/index.d.ts +1 -0
- package/NativeRichMediaPreview/components/NativeRichMediaButtonList/index.js +1 -0
- package/NativeRichMediaPreview/components/NativeRichMediaButtonList/types.d.ts +6 -0
- package/NativeRichMediaPreview/components/NativeRichMediaCloseChip/styles.js +4 -5
- package/NativeRichMediaPreview/components/NativeRichMediaRewardPanel/NativeRichMediaRewardPanel.js +26 -26
- package/NativeRichMediaPreview/components/NativeRichMediaRewardPanel/styles.d.ts +29 -2
- package/NativeRichMediaPreview/components/NativeRichMediaRewardPanel/styles.js +19 -4
- package/NativeRichMediaPreview/components/NativeRichMediaText/index.d.ts +1 -0
- package/NativeRichMediaPreview/components/NativeRichMediaText/index.js +1 -0
- package/NativeRichMediaPreview/components/NativeRichMediaText/styles.d.ts +7 -0
- package/NativeRichMediaPreview/components/NativeRichMediaText/styles.js +19 -0
- package/NativeRichMediaPreview/components/NativeRichMediaTitle/index.d.ts +1 -0
- package/NativeRichMediaPreview/components/NativeRichMediaTitle/index.js +1 -0
- package/NativeRichMediaPreview/components/NativeRichMediaTitle/styles.d.ts +12 -0
- package/NativeRichMediaPreview/components/NativeRichMediaTitle/styles.js +22 -0
- package/NativeRichMediaPreview/helpers.d.ts +22 -6
- package/NativeRichMediaPreview/helpers.js +45 -6
- package/NativeRichMediaPreview/icons/MutedIcon.svg +1 -1
- package/NativeRichMediaPreview/icons/SoundIcon.svg +1 -1
- package/NativeRichMediaPreview/index.d.ts +1 -1
- package/NativeRichMediaPreview/parseNativeRichMediaConfig.d.ts +3 -1
- package/NativeRichMediaPreview/parseNativeRichMediaConfig.js +74 -18
- package/NativeRichMediaPreview/styles.d.ts +7 -7
- package/NativeRichMediaPreview/styles.js +25 -23
- package/NativeRichMediaPreview/types.d.ts +180 -176
- package/NativeRichMediaPreview/views/NativeRichMediaBannerView/NativeRichMediaBannerView.js +31 -36
- package/NativeRichMediaPreview/views/NativeRichMediaBannerView/styles.d.ts +3 -4
- package/NativeRichMediaPreview/views/NativeRichMediaBannerView/styles.js +8 -11
- package/NativeRichMediaPreview/views/NativeRichMediaCarouselView/NativeRichMediaCarouselView.js +31 -30
- package/NativeRichMediaPreview/views/NativeRichMediaCarouselView/styles.d.ts +0 -2
- package/NativeRichMediaPreview/views/NativeRichMediaCarouselView/styles.js +4 -12
- package/NativeRichMediaPreview/views/NativeRichMediaCarouselView/types.d.ts +0 -1
- package/NativeRichMediaPreview/views/NativeRichMediaFullscreenView/NativeRichMediaFullscreenView.js +26 -35
- package/NativeRichMediaPreview/views/NativeRichMediaInvalidView/NativeRichMediaInvalidView.js +5 -3
- package/NativeRichMediaPreview/views/NativeRichMediaInvalidView/styles.d.ts +9 -0
- package/NativeRichMediaPreview/views/NativeRichMediaInvalidView/styles.js +10 -1
- package/NativeRichMediaPreview/views/NativeRichMediaModalView/NativeRichMediaModalView.js +33 -38
- package/NativeRichMediaPreview/views/NativeRichMediaPipView/NativeRichMediaPipView.js +30 -35
- package/NativeRichMediaPreview/views/NativeRichMediaPipView/styles.d.ts +7 -6
- package/NativeRichMediaPreview/views/NativeRichMediaPipView/styles.js +15 -13
- package/NativeRichMediaPreview/views/NativeRichMediaScratchcardView/NativeRichMediaScratchcardView.js +50 -52
- package/NativeRichMediaPreview/views/NativeRichMediaScratchcardView/styles.d.ts +18 -5
- package/NativeRichMediaPreview/views/NativeRichMediaScratchcardView/styles.js +15 -8
- package/NativeRichMediaPreview/views/NativeRichMediaSheetView/NativeRichMediaSheetView.js +31 -37
- package/NativeRichMediaPreview/views/NativeRichMediaSheetView/styles.js +1 -1
- package/NativeRichMediaPreview/views/NativeRichMediaSpinwheelView/NativeRichMediaSpinwheelView.js +45 -47
- package/NativeRichMediaPreview/views/NativeRichMediaSpinwheelView/styles.d.ts +11 -3
- package/NativeRichMediaPreview/views/NativeRichMediaSpinwheelView/styles.js +16 -10
- package/NativeRichMediaPreview/views/NativeRichMediaStoriesView/NativeRichMediaStoriesView.js +24 -33
- package/NativeRichMediaPreview/views/NativeRichMediaStoriesView/styles.d.ts +1 -7
- package/NativeRichMediaPreview/views/NativeRichMediaStoriesView/styles.js +7 -21
- package/NativeRichMediaPreview/views/NativeRichMediaStoriesView/types.d.ts +0 -1
- package/NativeRichMediaPreview/views/NativeRichMediaVideoView/NativeRichMediaVideoView.js +22 -42
- package/NativeRichMediaPreview/views/shared/styles.d.ts +3 -3
- package/NativeRichMediaPreview/views/shared/styles.js +6 -5
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/NativeRichMediaPreview/components/NativeRichMediaCardButtons/NativeRichMediaCardButtons.d.ts +0 -3
- package/NativeRichMediaPreview/components/NativeRichMediaCardButtons/NativeRichMediaCardButtons.js +0 -29
- package/NativeRichMediaPreview/components/NativeRichMediaCardButtons/index.d.ts +0 -1
- package/NativeRichMediaPreview/components/NativeRichMediaCardButtons/index.js +0 -1
- package/NativeRichMediaPreview/components/NativeRichMediaCardButtons/types.d.ts +0 -5
- package/NativeRichMediaPreview/components/NativeRichMediaOverlayButtons/NativeRichMediaOverlayButtons.d.ts +0 -3
- package/NativeRichMediaPreview/components/NativeRichMediaOverlayButtons/NativeRichMediaOverlayButtons.js +0 -40
- package/NativeRichMediaPreview/components/NativeRichMediaOverlayButtons/index.d.ts +0 -1
- package/NativeRichMediaPreview/components/NativeRichMediaOverlayButtons/index.js +0 -1
- package/NativeRichMediaPreview/components/NativeRichMediaOverlayButtons/types.d.ts +0 -4
- package/NativeRichMediaPreview/components/NativeRichMediaOverlayButtons/types.js +0 -1
- package/NativeRichMediaPreview/components/NativeRichMediaPreviewCanvas/NativeRichMediaPreviewCanvas.d.ts +0 -3
- package/NativeRichMediaPreview/components/NativeRichMediaPreviewCanvas/NativeRichMediaPreviewCanvas.js +0 -10
- package/NativeRichMediaPreview/components/NativeRichMediaPreviewCanvas/index.d.ts +0 -1
- package/NativeRichMediaPreview/components/NativeRichMediaPreviewCanvas/index.js +0 -1
- package/NativeRichMediaPreview/components/NativeRichMediaPreviewCanvas/styles.d.ts +0 -1
- package/NativeRichMediaPreview/components/NativeRichMediaPreviewCanvas/styles.js +0 -6
- package/NativeRichMediaPreview/components/NativeRichMediaPreviewCanvas/types.d.ts +0 -4
- package/NativeRichMediaPreview/components/NativeRichMediaPreviewCanvas/types.js +0 -1
- package/NativeRichMediaPreview/components/NativeRichMediaPtLabel/NativeRichMediaPtLabel.d.ts +0 -3
- package/NativeRichMediaPreview/components/NativeRichMediaPtLabel/NativeRichMediaPtLabel.js +0 -27
- package/NativeRichMediaPreview/components/NativeRichMediaPtLabel/index.d.ts +0 -1
- package/NativeRichMediaPreview/components/NativeRichMediaPtLabel/index.js +0 -1
- package/NativeRichMediaPreview/components/NativeRichMediaPtLabel/styles.d.ts +0 -10
- package/NativeRichMediaPreview/components/NativeRichMediaPtLabel/styles.js +0 -30
- package/NativeRichMediaPreview/components/NativeRichMediaPtLabel/types.d.ts +0 -12
- package/NativeRichMediaPreview/components/NativeRichMediaPtLabel/types.js +0 -1
- package/NativeRichMediaPreview/views/NativeRichMediaFullscreenView/styles.d.ts +0 -1
- package/NativeRichMediaPreview/views/NativeRichMediaFullscreenView/styles.js +0 -1
- package/NativeRichMediaPreview/views/NativeRichMediaVideoView/styles.d.ts +0 -1
- package/NativeRichMediaPreview/views/NativeRichMediaVideoView/styles.js +0 -1
- /package/NativeRichMediaPreview/components/{NativeRichMediaCardButtons → NativeRichMediaButtonList}/types.js +0 -0
|
@@ -1,49 +1,43 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Vertical } from '@pushwoosh/kit-helpers';
|
|
3
3
|
import { Handle, Sheet } from './styles';
|
|
4
|
-
import {
|
|
4
|
+
import { NativeRichMediaButtonList } from '../../components/NativeRichMediaButtonList';
|
|
5
5
|
import { NativeRichMediaCloseChip } from '../../components/NativeRichMediaCloseChip';
|
|
6
6
|
import { NativeRichMediaCoverImg } from '../../components/NativeRichMediaCoverImg';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { NativeRichMediaText } from '../../components/NativeRichMediaText';
|
|
8
|
+
import { NativeRichMediaTitle } from '../../components/NativeRichMediaTitle';
|
|
9
|
+
import { asButtonList, asTextValue } from '../../helpers';
|
|
10
10
|
export function NativeRichMediaSheetView(props) {
|
|
11
11
|
const {
|
|
12
12
|
block
|
|
13
13
|
} = props;
|
|
14
|
-
const
|
|
15
|
-
const hasButtons =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
size: 15,
|
|
35
|
-
weight: 400,
|
|
36
|
-
fallbackColor: SECONDARY_LABEL,
|
|
37
|
-
align: "left",
|
|
38
|
-
lineHeight: "20px"
|
|
39
|
-
})]
|
|
40
|
-
}), hasButtons && _jsx(NativeRichMediaCardButtons, {
|
|
41
|
-
buttons: block.buttons,
|
|
42
|
-
"$padding": "24px 20px 0"
|
|
43
|
-
}), block.showClose !== false && _jsx(NativeRichMediaCloseChip, {
|
|
44
|
-
top: 16,
|
|
45
|
-
right: 16
|
|
14
|
+
const buttons = asButtonList(block.buttons);
|
|
15
|
+
const hasButtons = buttons.length > 0;
|
|
16
|
+
const title = asTextValue(block.title);
|
|
17
|
+
const message = asTextValue(block.message);
|
|
18
|
+
return _jsxs(Sheet, {
|
|
19
|
+
"$background": block.background,
|
|
20
|
+
children: [_jsx(Handle, {}), block.image && _jsx(NativeRichMediaCoverImg, {
|
|
21
|
+
url: block.image,
|
|
22
|
+
margin: "26px 14px 0",
|
|
23
|
+
height: 190,
|
|
24
|
+
borderRadius: 18
|
|
25
|
+
}), (title.text || message.text) && _jsxs(Vertical, {
|
|
26
|
+
"$padding": (block.image ? '16px' : '20px') + ' 24px 0',
|
|
27
|
+
"$gap": 4,
|
|
28
|
+
children: [title.text && _jsx(NativeRichMediaTitle, {
|
|
29
|
+
"$color": title.color,
|
|
30
|
+
children: title.text
|
|
31
|
+
}), message.text && _jsx(NativeRichMediaText, {
|
|
32
|
+
"$color": message.color,
|
|
33
|
+
children: message.text
|
|
46
34
|
})]
|
|
47
|
-
})
|
|
35
|
+
}), hasButtons && _jsx(NativeRichMediaButtonList, {
|
|
36
|
+
buttons: buttons,
|
|
37
|
+
"$padding": "24px 20px 0"
|
|
38
|
+
}), block.showClose && _jsx(NativeRichMediaCloseChip, {
|
|
39
|
+
top: 16,
|
|
40
|
+
right: 16
|
|
41
|
+
})]
|
|
48
42
|
});
|
|
49
43
|
}
|
|
@@ -3,7 +3,7 @@ import { TERTIARY_LABEL } from '../../helpers';
|
|
|
3
3
|
export const Sheet = styled.div.withConfig({
|
|
4
4
|
displayName: "Sheet",
|
|
5
5
|
componentId: "sc-17o8tnc-0"
|
|
6
|
-
})(["position:
|
|
6
|
+
})(["position:relative;border-radius:28px 28px 0 0;box-shadow:0 -16px 28px rgba(0,0,0,0.28);padding-bottom:50px;background:", ";"], ({
|
|
7
7
|
$background
|
|
8
8
|
}) => $background);
|
|
9
9
|
export const Handle = styled.div.withConfig({
|
package/NativeRichMediaPreview/views/NativeRichMediaSpinwheelView/NativeRichMediaSpinwheelView.js
CHANGED
|
@@ -2,62 +2,60 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Fragment } from 'react';
|
|
3
3
|
import { Card, Hub, Pointer, Ring, SegmentLabel, Tick, Wheel } from './styles';
|
|
4
4
|
import { NativeRichMediaCloseChip } from '../../components/NativeRichMediaCloseChip';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { NativeRichMediaText } from '../../components/NativeRichMediaText';
|
|
6
|
+
import { NativeRichMediaTitle } from '../../components/NativeRichMediaTitle';
|
|
7
|
+
import { SEG_FALLBACK, asButtonValue, asTextValue, surfaceBackground } from '../../helpers';
|
|
8
8
|
export function NativeRichMediaSpinwheelView(props) {
|
|
9
9
|
const {
|
|
10
10
|
block
|
|
11
11
|
} = props;
|
|
12
|
-
const baseHex = surfaceBaseHex(block.background) || '#FFFFFF';
|
|
13
|
-
const cardText = contrastOn(baseHex);
|
|
14
12
|
const segs = block.segments;
|
|
15
13
|
const hasSegments = segs.length > 0;
|
|
16
14
|
const per = hasSegments ? 360 / segs.length : 0;
|
|
17
15
|
const fills = segs.map((s, i) => s.color || SEG_FALLBACK[i % SEG_FALLBACK.length]);
|
|
18
16
|
const stops = fills.map((c, i) => `${c} ${i * per}deg ${(i + 1) * per}deg`).join(', ');
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}), block.showClose !== false && _jsx(NativeRichMediaCloseChip, {
|
|
58
|
-
top: 16,
|
|
59
|
-
right: 16
|
|
17
|
+
const title = asTextValue(block.title);
|
|
18
|
+
const message = asTextValue(block.message);
|
|
19
|
+
const spinButton = asButtonValue(block.spinButton);
|
|
20
|
+
return _jsxs(Card, {
|
|
21
|
+
"$background": surfaceBackground(block.background, '#FFFFFF'),
|
|
22
|
+
children: [title.text && _jsx(NativeRichMediaTitle, {
|
|
23
|
+
"$color": title.color,
|
|
24
|
+
"$align": "center",
|
|
25
|
+
children: title.text
|
|
26
|
+
}), message.text && _jsx(NativeRichMediaText, {
|
|
27
|
+
"$color": message.color,
|
|
28
|
+
"$marginTop": 4,
|
|
29
|
+
"$align": "center",
|
|
30
|
+
children: message.text
|
|
31
|
+
}), hasSegments && _jsxs(Wheel, {
|
|
32
|
+
children: [_jsx(Ring, {
|
|
33
|
+
"$stops": stops,
|
|
34
|
+
children: segs.map((s, i) => {
|
|
35
|
+
const theta = -90 + (i + 0.5) * per;
|
|
36
|
+
const label = asTextValue(s.message);
|
|
37
|
+
return (
|
|
38
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
39
|
+
_jsxs(Fragment, {
|
|
40
|
+
children: [_jsx(Tick, {
|
|
41
|
+
"$rotate": i * per - 180
|
|
42
|
+
}), _jsx(SegmentLabel, {
|
|
43
|
+
"$color": label.color,
|
|
44
|
+
"$rotate": theta,
|
|
45
|
+
children: label.text
|
|
46
|
+
})]
|
|
47
|
+
}, `spin-segment-${i}`)
|
|
48
|
+
);
|
|
49
|
+
})
|
|
50
|
+
}), _jsx(Pointer, {}), _jsx(Hub, {
|
|
51
|
+
"$background": spinButton === null || spinButton === void 0 ? void 0 : spinButton.background,
|
|
52
|
+
"$color": spinButton === null || spinButton === void 0 ? void 0 : spinButton.text.color,
|
|
53
|
+
"$borderColor": spinButton === null || spinButton === void 0 ? void 0 : spinButton.border.color,
|
|
54
|
+
children: (spinButton === null || spinButton === void 0 ? void 0 : spinButton.text.text) || 'SPIN'
|
|
60
55
|
})]
|
|
61
|
-
})
|
|
56
|
+
}), block.showClose && _jsx(NativeRichMediaCloseChip, {
|
|
57
|
+
top: 16,
|
|
58
|
+
right: 16
|
|
59
|
+
})]
|
|
62
60
|
});
|
|
63
61
|
}
|
|
@@ -11,9 +11,17 @@ export declare const Ring: import("styled-components").StyledComponent<"div", an
|
|
|
11
11
|
export declare const Tick: import("styled-components").StyledComponent<"div", any, {
|
|
12
12
|
$rotate: number;
|
|
13
13
|
}, never>;
|
|
14
|
-
export declare const SegmentLabel: import("styled-components").StyledComponent<"
|
|
15
|
-
$color
|
|
14
|
+
export declare const SegmentLabel: import("styled-components").StyledComponent<typeof import("@pushwoosh/kit-typography").Footnote, any, {
|
|
15
|
+
$color?: string;
|
|
16
|
+
$align?: "center";
|
|
17
|
+
$clamp?: number;
|
|
18
|
+
$marginTop?: number;
|
|
19
|
+
} & {
|
|
16
20
|
$rotate: number;
|
|
17
21
|
}, never>;
|
|
18
22
|
export declare const Pointer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
19
|
-
export declare const Hub: import("styled-components").StyledComponent<"div", any, {
|
|
23
|
+
export declare const Hub: import("styled-components").StyledComponent<"div", any, {
|
|
24
|
+
$background?: string;
|
|
25
|
+
$color?: string;
|
|
26
|
+
$borderColor?: string;
|
|
27
|
+
}, never>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
+
import { FontWeight } from '@pushwoosh/kit-constants';
|
|
3
|
+
import { NativeRichMediaText } from '../../components/NativeRichMediaText';
|
|
2
4
|
import { Card as SharedCard } from '../shared/styles';
|
|
3
5
|
export const Card = styled(SharedCard).attrs({
|
|
4
6
|
$padding: '28px 24px 24px'
|
|
@@ -9,32 +11,36 @@ export const Card = styled(SharedCard).attrs({
|
|
|
9
11
|
export const Wheel = styled.div.withConfig({
|
|
10
12
|
displayName: "Wheel",
|
|
11
13
|
componentId: "sc-1tz3wky-1"
|
|
12
|
-
})(["position:relative;margin
|
|
14
|
+
})(["position:relative;margin:14px auto 0;width:289px;max-width:100%;aspect-ratio:1;container-type:inline-size;"]);
|
|
13
15
|
export const Ring = styled.div.withConfig({
|
|
14
16
|
displayName: "Ring",
|
|
15
17
|
componentId: "sc-1tz3wky-2"
|
|
16
|
-
})(["position:absolute;inset:
|
|
18
|
+
})(["position:absolute;inset:10.4cqw;border-radius:50%;border:1px solid rgba(255,255,255,0.35);background:", ";"], ({
|
|
17
19
|
$stops
|
|
18
20
|
}) => `conic-gradient(from 0deg, ${$stops})`);
|
|
19
21
|
export const Tick = styled.div.withConfig({
|
|
20
22
|
displayName: "Tick",
|
|
21
23
|
componentId: "sc-1tz3wky-3"
|
|
22
|
-
})(["position:absolute;left:50%;top:50%;width:1px;height:
|
|
24
|
+
})(["position:absolute;left:50%;top:50%;width:1px;height:39.6cqw;background:rgba(255,255,255,0.35);transform-origin:0 0;transform:", ";"], ({
|
|
23
25
|
$rotate
|
|
24
26
|
}) => `rotate(${$rotate}deg)`);
|
|
25
|
-
export const SegmentLabel = styled.
|
|
27
|
+
export const SegmentLabel = styled(NativeRichMediaText).withConfig({
|
|
26
28
|
displayName: "SegmentLabel",
|
|
27
29
|
componentId: "sc-1tz3wky-4"
|
|
28
|
-
})(["position:absolute;left:50%;top:50%;font-size:
|
|
29
|
-
$color
|
|
30
|
-
}) => $color, ({
|
|
30
|
+
})(["position:absolute;left:50%;top:50%;font-size:4.2cqw;line-height:1.3;font-weight:", ";white-space:nowrap;max-width:29.8cqw;overflow:hidden;text-overflow:ellipsis;transform:", ";"], FontWeight.BOLD, ({
|
|
31
31
|
$rotate
|
|
32
|
-
}) => `translate(-50%,-50%) rotate(${$rotate}deg) translateX(
|
|
32
|
+
}) => `translate(-50%,-50%) rotate(${$rotate}deg) translateX(21.8cqw)`);
|
|
33
33
|
export const Pointer = styled.div.withConfig({
|
|
34
34
|
displayName: "Pointer",
|
|
35
35
|
componentId: "sc-1tz3wky-5"
|
|
36
|
-
})(["position:absolute;top:
|
|
36
|
+
})(["position:absolute;top:1.4cqw;left:50%;transform:translateX(-50%);width:0;height:0;border-left:4.5cqw solid transparent;border-right:4.5cqw solid transparent;border-top:9cqw solid #0F0F0F;filter:drop-shadow(0 2px 3px rgba(0,0,0,0.3));z-index:3;"]);
|
|
37
37
|
export const Hub = styled.div.withConfig({
|
|
38
38
|
displayName: "Hub",
|
|
39
39
|
componentId: "sc-1tz3wky-6"
|
|
40
|
-
})(["position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:
|
|
40
|
+
})(["position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:24.9cqw;height:24.9cqw;border-radius:50%;background:", ";color:", ";", " display:flex;align-items:center;justify-content:center;font-size:4.9cqw;font-weight:", ";box-shadow:0 3px 8px rgba(0,0,0,0.25);z-index:2;white-space:nowrap;overflow:hidden;padding:0 6px;user-select:none;cursor:pointer;"], ({
|
|
41
|
+
$background
|
|
42
|
+
}) => $background || '#FFF', ({
|
|
43
|
+
$color
|
|
44
|
+
}) => $color || '#000', ({
|
|
45
|
+
$borderColor
|
|
46
|
+
}) => $borderColor ? `border: 2px solid ${$borderColor};` : '', FontWeight.BOLD);
|
package/NativeRichMediaPreview/views/NativeRichMediaStoriesView/NativeRichMediaStoriesView.js
CHANGED
|
@@ -1,50 +1,41 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ProgressFill, ProgressRow, ProgressTrack } from './styles';
|
|
3
|
+
import { NativeRichMediaButtonList } from '../../components/NativeRichMediaButtonList';
|
|
4
|
+
import { NativeRichMediaText } from '../../components/NativeRichMediaText';
|
|
5
|
+
import { NativeRichMediaTitle } from '../../components/NativeRichMediaTitle';
|
|
6
|
+
import { asButtonList, asTextValue, clampIndex } from '../../helpers';
|
|
7
|
+
import { TextBlock } from '../shared/styles';
|
|
7
8
|
export function NativeRichMediaStoriesView(props) {
|
|
8
9
|
const {
|
|
9
10
|
block,
|
|
10
|
-
activeIndex
|
|
11
|
-
onNavigate
|
|
11
|
+
activeIndex
|
|
12
12
|
} = props;
|
|
13
13
|
const items = block.items;
|
|
14
|
-
const idx =
|
|
14
|
+
const idx = clampIndex(activeIndex, items.length);
|
|
15
15
|
const item = items[idx] || {};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
backgroundColor: "#000"
|
|
22
|
-
}), _jsx(GradientOverlay, {}), _jsx(ProgressRow, {
|
|
23
|
-
"$top": PT.SAFE_TOP + 14,
|
|
16
|
+
const title = asTextValue(item.title);
|
|
17
|
+
const message = asTextValue(item.message);
|
|
18
|
+
const buttons = asButtonList(item.buttons);
|
|
19
|
+
return _jsxs(_Fragment, {
|
|
20
|
+
children: [_jsx(ProgressRow, {
|
|
24
21
|
children: items.map((_, i) => _jsxs(ProgressTrack
|
|
25
22
|
// eslint-disable-next-line react/no-array-index-key
|
|
26
23
|
, {
|
|
27
|
-
onClick: () => onNavigate(i),
|
|
28
24
|
children: [i < idx && _jsx(ProgressFill, {
|
|
29
25
|
"$full": true
|
|
30
26
|
}), i === idx && _jsx(ProgressFill, {})]
|
|
31
27
|
}, `stories-bar-${i}`))
|
|
32
|
-
}), block.showClose !== false && _jsx(NativeRichMediaCloseChip, {
|
|
33
|
-
top: PT.SAFE_TOP + 14 + 3 + 10,
|
|
34
|
-
right: 16
|
|
35
28
|
}), _jsxs(TextBlock, {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
children:
|
|
39
|
-
}),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"$
|
|
45
|
-
|
|
46
|
-
"$boxShadow": "0 6px 14px rgba(0,0,0,0.28)",
|
|
47
|
-
children: asText(item.button)
|
|
29
|
+
children: [title.text && _jsx(NativeRichMediaTitle, {
|
|
30
|
+
"$color": title.color,
|
|
31
|
+
children: title.text
|
|
32
|
+
}), message.text && _jsx(NativeRichMediaText, {
|
|
33
|
+
"$color": message.color,
|
|
34
|
+
"$marginTop": 4,
|
|
35
|
+
children: message.text
|
|
36
|
+
}), buttons.length > 0 && _jsx(NativeRichMediaButtonList, {
|
|
37
|
+
"$margin": "16px 0 0",
|
|
38
|
+
buttons: buttons
|
|
48
39
|
})]
|
|
49
40
|
})]
|
|
50
41
|
});
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare const GradientOverlay: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
-
export declare const ProgressRow: import("styled-components").StyledComponent<"div", any, {
|
|
4
|
-
$top: number;
|
|
5
|
-
}, never>;
|
|
1
|
+
export declare const ProgressRow: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
2
|
export declare const ProgressTrack: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
3
|
export declare const ProgressFill: import("styled-components").StyledComponent<"div", any, {
|
|
8
4
|
$full?: boolean;
|
|
9
5
|
}, never>;
|
|
10
|
-
export declare const TitleText: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
|
-
export declare const SubtitleText: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,30 +1,16 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
export const GradientOverlay = styled.div.withConfig({
|
|
4
|
-
displayName: "GradientOverlay",
|
|
5
|
-
componentId: "sc-qgnxqx-0"
|
|
6
|
-
})(["position:absolute;left:0;right:0;bottom:0;top:55%;background:linear-gradient(180deg,rgba(0,0,0,0),rgba(0,0,0,0.75));"]);
|
|
2
|
+
import { EDGE_INSET } from '../../helpers';
|
|
7
3
|
export const ProgressRow = styled.div.withConfig({
|
|
8
4
|
displayName: "ProgressRow",
|
|
9
|
-
componentId: "sc-qgnxqx-
|
|
10
|
-
})(["
|
|
11
|
-
$top
|
|
12
|
-
}) => $top);
|
|
5
|
+
componentId: "sc-qgnxqx-0"
|
|
6
|
+
})(["display:flex;gap:4px;margin:", "px 12px 0;"], EDGE_INSET);
|
|
13
7
|
export const ProgressTrack = styled.div.withConfig({
|
|
14
8
|
displayName: "ProgressTrack",
|
|
15
|
-
componentId: "sc-qgnxqx-
|
|
16
|
-
})(["flex:1;height:3px;border-radius:1.5px;background:rgba(255,255,255,0.3);overflow:hidden;
|
|
9
|
+
componentId: "sc-qgnxqx-1"
|
|
10
|
+
})(["flex:1;height:3px;border-radius:1.5px;background:rgba(255,255,255,0.3);overflow:hidden;"]);
|
|
17
11
|
export const ProgressFill = styled.div.withConfig({
|
|
18
12
|
displayName: "ProgressFill",
|
|
19
|
-
componentId: "sc-qgnxqx-
|
|
13
|
+
componentId: "sc-qgnxqx-2"
|
|
20
14
|
})(["height:100%;background:#FFF;width:", ";"], ({
|
|
21
15
|
$full
|
|
22
|
-
}) => $full ? '100%' : '45%');
|
|
23
|
-
export const TitleText = styled.div.withConfig({
|
|
24
|
-
displayName: "TitleText",
|
|
25
|
-
componentId: "sc-qgnxqx-4"
|
|
26
|
-
})(["font-size:23px;font-weight:700;color:#FFF;line-height:1.25;"]);
|
|
27
|
-
export const SubtitleText = styled.div.withConfig({
|
|
28
|
-
displayName: "SubtitleText",
|
|
29
|
-
componentId: "sc-qgnxqx-5"
|
|
30
|
-
})(["font-size:14px;color:rgba(255,255,255,0.85);margin-top:6px;"]);
|
|
16
|
+
}) => $full ? '100%' : '45%');
|
|
@@ -1,49 +1,29 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { PT, asText } from '../../helpers';
|
|
8
|
-
import { ButtonRow, TemplateLayer } from '../../styles';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { NativeRichMediaButtonList } from '../../components/NativeRichMediaButtonList';
|
|
3
|
+
import { NativeRichMediaText } from '../../components/NativeRichMediaText';
|
|
4
|
+
import { NativeRichMediaTitle } from '../../components/NativeRichMediaTitle';
|
|
5
|
+
import { asButtonList, asTextValue } from '../../helpers';
|
|
6
|
+
import { TextBlock } from '../shared/styles';
|
|
9
7
|
export function NativeRichMediaVideoView(props) {
|
|
10
8
|
const {
|
|
11
9
|
block
|
|
12
10
|
} = props;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
size: 16,
|
|
29
|
-
weight: 400,
|
|
30
|
-
fallbackColor: "rgba(255,255,255,0.85)",
|
|
31
|
-
align: "left",
|
|
32
|
-
marginTop: block.title ? 8 : undefined
|
|
33
|
-
}), block.button && block.action && _jsx(ButtonRow, {
|
|
34
|
-
"$marginTop": 20,
|
|
35
|
-
"$borderRadius": 14,
|
|
36
|
-
"$background": "#FFF",
|
|
37
|
-
"$color": "#0F0F0F",
|
|
38
|
-
children: asText(block.button)
|
|
11
|
+
const title = asTextValue(block.title);
|
|
12
|
+
const message = asTextValue(block.message);
|
|
13
|
+
const buttons = asButtonList(block.buttons);
|
|
14
|
+
return _jsx(_Fragment, {
|
|
15
|
+
children: _jsxs(TextBlock, {
|
|
16
|
+
children: [title.text && _jsx(NativeRichMediaTitle, {
|
|
17
|
+
"$color": title.color,
|
|
18
|
+
children: title.text
|
|
19
|
+
}), message.text && _jsx(NativeRichMediaText, {
|
|
20
|
+
"$color": message.color,
|
|
21
|
+
"$marginTop": title.text ? 4 : undefined,
|
|
22
|
+
children: message.text
|
|
23
|
+
}), buttons.length > 0 && _jsx(NativeRichMediaButtonList, {
|
|
24
|
+
"$margin": "20px 0 0",
|
|
25
|
+
buttons: buttons
|
|
39
26
|
})]
|
|
40
|
-
})
|
|
41
|
-
muted: block.muted,
|
|
42
|
-
top: PT.SAFE_TOP + 12,
|
|
43
|
-
left: 16
|
|
44
|
-
}), block.showClose !== false && _jsx(NativeRichMediaCloseChip, {
|
|
45
|
-
top: PT.SAFE_TOP + 12,
|
|
46
|
-
right: 16
|
|
47
|
-
})]
|
|
27
|
+
})
|
|
48
28
|
});
|
|
49
29
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const GradientOverlay: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
-
|
|
3
|
-
$bottom: number;
|
|
1
|
+
export declare const GradientOverlay: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
$topOffset?: string;
|
|
4
3
|
}, never>;
|
|
4
|
+
export declare const TextBlock: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
5
|
export declare const Card: import("styled-components").StyledComponent<"div", any, {
|
|
6
6
|
$background: string;
|
|
7
7
|
$padding: string;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
+
import { EDGE_INSET } from '../../helpers';
|
|
2
3
|
export const GradientOverlay = styled.div.withConfig({
|
|
3
4
|
displayName: "GradientOverlay",
|
|
4
5
|
componentId: "sc-x5bn03-0"
|
|
5
|
-
})(["position:absolute;left:0;right:0;bottom:0;top:
|
|
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%');
|
|
6
9
|
export const TextBlock = styled.div.withConfig({
|
|
7
10
|
displayName: "TextBlock",
|
|
8
11
|
componentId: "sc-x5bn03-1"
|
|
9
|
-
})(["
|
|
10
|
-
$bottom
|
|
11
|
-
}) => $bottom);
|
|
12
|
+
})(["margin:0 ", "px ", "px;"], EDGE_INSET, EDGE_INSET);
|
|
12
13
|
export const Card = styled.div.withConfig({
|
|
13
14
|
displayName: "Card",
|
|
14
15
|
componentId: "sc-x5bn03-2"
|
|
15
|
-
})(["position:
|
|
16
|
+
})(["position:relative;margin:0 12px;border-radius:24px;box-shadow:0 16px 28px rgba(0,0,0,0.28);padding:", ";background:", ";"], ({
|
|
16
17
|
$padding
|
|
17
18
|
}) => $padding, ({
|
|
18
19
|
$background
|
package/index.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export { EnhancedInput, SearchInput } from './EnhancedInput';
|
|
|
44
44
|
export { Chip, type ChipProps, type ChipVariant } from './Chip';
|
|
45
45
|
export { RichmediaPreview, useRichmediaHtml } from './RichmediaPreview';
|
|
46
46
|
export { NativeRichMediaPreview, parseNativeRichMediaConfig, NATIVE_RICH_MEDIA_DISPLAY_TYPES } from './NativeRichMediaPreview';
|
|
47
|
-
export type { NativeRichMediaConfig, NativeRichMediaDisplayType, NativeRichMediaText, NativeRichMediaAction, NativeRichMediaButton, NativeRichMediaReward, NativeRichMediaModalBlock, NativeRichMediaSheetBlock, NativeRichMediaCarouselBlock,
|
|
47
|
+
export type { NativeRichMediaConfig, NativeRichMediaDisplayType, NativeRichMediaText, NativeRichMediaBorder, NativeRichMediaCover, NativeRichMediaAction, NativeRichMediaButton, NativeRichMediaReward, NativeRichMediaModalBlock, NativeRichMediaSheetBlock, NativeRichMediaCarouselBlock, NativeRichMediaStoriesBlock, NativeRichMediaBannerBlock, NativeRichMediaFullscreenBlock, NativeRichMediaVideoBlock, NativeRichMediaPipBlock, NativeRichMediaScratchcardBlock, NativeRichMediaSpinwheelBlock, NativeRichMediaPreviewProps, } from './NativeRichMediaPreview';
|
|
48
48
|
export { RichMessageEditor, RichMessageViewer, type DynamicContent, } from './RichMessageEditor';
|
|
49
49
|
export { FrequencyCappingEdit, FrequencyCappingReadonly, FrequencyCappingInApps, type LocalCapping, type CappingInAppBase, } from './FrequencyCapping';
|
|
50
50
|
export { SendRateEdit, SendRateReadonly, type SendRateBase, type SendRateEditProps, type SendRateReadonlyProps, } from './SendRate';
|
package/package.json
CHANGED
package/NativeRichMediaPreview/components/NativeRichMediaCardButtons/NativeRichMediaCardButtons.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Color } from '@pushwoosh/kit-constants';
|
|
3
|
-
import { Vertical } from '@pushwoosh/kit-helpers';
|
|
4
|
-
import { SECONDARY_LABEL, asText, withAlpha } from '../../helpers';
|
|
5
|
-
import { ButtonRow } from '../../styles';
|
|
6
|
-
export function NativeRichMediaCardButtons(props) {
|
|
7
|
-
const {
|
|
8
|
-
buttons,
|
|
9
|
-
$padding
|
|
10
|
-
} = props;
|
|
11
|
-
return _jsx(Vertical, {
|
|
12
|
-
"$padding": $padding,
|
|
13
|
-
"$gap": 10,
|
|
14
|
-
children: (buttons || []).map((b, i) => {
|
|
15
|
-
const bg = b.background || (i === 0 ? Color.PRIMARY : 'transparent');
|
|
16
|
-
const color = b.textColor || (b.background || i === 0 ? '#FFFFFF' : SECONDARY_LABEL);
|
|
17
|
-
const boxShadow = i === 0 && bg !== 'transparent' ? '0 5px 10px ' + withAlpha(bg, 0.28) : undefined;
|
|
18
|
-
return _jsx(ButtonRow
|
|
19
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
20
|
-
, {
|
|
21
|
-
"$borderRadius": b.cornerRadius !== undefined ? b.cornerRadius : 8,
|
|
22
|
-
"$background": bg,
|
|
23
|
-
"$color": color,
|
|
24
|
-
"$boxShadow": boxShadow,
|
|
25
|
-
children: asText(b.text)
|
|
26
|
-
}, `card-btn-${i}`);
|
|
27
|
-
})
|
|
28
|
-
});
|
|
29
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { NativeRichMediaCardButtons } from './NativeRichMediaCardButtons';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { NativeRichMediaCardButtons } from './NativeRichMediaCardButtons';
|