@pushwoosh/dumb-components 1.1.181 → 1.1.183
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/components/NativeRichMediaCoverImg/NativeRichMediaCoverImg.js +2 -0
- package/NativeRichMediaPreview/components/NativeRichMediaCoverImg/styles.d.ts +1 -0
- package/NativeRichMediaPreview/components/NativeRichMediaCoverImg/styles.js +4 -1
- package/NativeRichMediaPreview/components/NativeRichMediaCoverImg/types.d.ts +1 -0
- package/NativeRichMediaPreview/components/NativeRichMediaRewardPanel/styles.d.ts +1 -0
- package/NativeRichMediaPreview/components/NativeRichMediaTitle/styles.d.ts +1 -0
- package/NativeRichMediaPreview/components/NativeRichMediaTitle/styles.js +8 -1
- package/NativeRichMediaPreview/types.js +1 -1
- package/NativeRichMediaPreview/views/NativeRichMediaBannerView/styles.js +1 -1
- package/NativeRichMediaPreview/views/NativeRichMediaCarouselView/NativeRichMediaCarouselView.js +4 -2
- package/NativeRichMediaPreview/views/NativeRichMediaCarouselView/styles.d.ts +1 -0
- package/NativeRichMediaPreview/views/NativeRichMediaCarouselView/styles.js +8 -4
- package/NativeRichMediaPreview/views/NativeRichMediaSheetView/NativeRichMediaSheetView.js +4 -3
- package/RichMessageEditor/slate/SlateEditor.styled.d.ts +1 -1
- package/package.json +3 -3
package/NativeRichMediaPreview/components/NativeRichMediaCoverImg/NativeRichMediaCoverImg.js
CHANGED
|
@@ -6,6 +6,7 @@ export function NativeRichMediaCoverImg(props) {
|
|
|
6
6
|
margin,
|
|
7
7
|
width,
|
|
8
8
|
height,
|
|
9
|
+
heightRatio,
|
|
9
10
|
borderRadius,
|
|
10
11
|
position,
|
|
11
12
|
inset,
|
|
@@ -19,6 +20,7 @@ export function NativeRichMediaCoverImg(props) {
|
|
|
19
20
|
"$margin": margin,
|
|
20
21
|
"$width": width,
|
|
21
22
|
"$height": height,
|
|
23
|
+
"$heightRatio": heightRatio,
|
|
22
24
|
"$borderRadius": borderRadius,
|
|
23
25
|
"$position": position,
|
|
24
26
|
"$inset": inset,
|
|
@@ -2,7 +2,7 @@ import styled from 'styled-components';
|
|
|
2
2
|
export const CoverBox = styled.div.withConfig({
|
|
3
3
|
displayName: "CoverBox",
|
|
4
4
|
componentId: "sc-15zx77-0"
|
|
5
|
-
})(["background-size:cover;background-position:center;background-color:", ";", " ", " ", " ", " ", " ", " ", " ", ""], ({
|
|
5
|
+
})(["background-size:cover;background-position:center;background-color:", ";", " ", " ", " ", " ", " ", " ", " ", " ", ""], ({
|
|
6
6
|
$backgroundColor
|
|
7
7
|
}) => $backgroundColor || 'rgba(116, 116, 128, 0.08)', ({
|
|
8
8
|
$backgroundImage
|
|
@@ -13,6 +13,9 @@ export const CoverBox = styled.div.withConfig({
|
|
|
13
13
|
}) => $width !== undefined ? `width: ${$width}px;` : '', ({
|
|
14
14
|
$height
|
|
15
15
|
}) => $height !== undefined ? `height: ${$height}px;` : '', ({
|
|
16
|
+
$height,
|
|
17
|
+
$heightRatio
|
|
18
|
+
}) => $height === undefined && $heightRatio !== undefined ? `aspect-ratio: 1 / ${$heightRatio};` : '', ({
|
|
16
19
|
$borderRadius
|
|
17
20
|
}) => $borderRadius !== undefined ? `border-radius: ${$borderRadius}px;` : '', ({
|
|
18
21
|
$position
|
|
@@ -7,7 +7,7 @@ export const NativeRichMediaTitle = styled(Text).attrs(({
|
|
|
7
7
|
})).withConfig({
|
|
8
8
|
displayName: "NativeRichMediaTitle",
|
|
9
9
|
componentId: "sc-1oklc22-0"
|
|
10
|
-
})(["display:block;color:", ";", " ", " ", ""], ({
|
|
10
|
+
})(["display:block;color:", ";", " ", " ", " ", ""], ({
|
|
11
11
|
$color
|
|
12
12
|
}) => $color, ({
|
|
13
13
|
$align
|
|
@@ -19,4 +19,11 @@ export const NativeRichMediaTitle = styled(Text).attrs(({
|
|
|
19
19
|
white-space: nowrap;
|
|
20
20
|
overflow: hidden;
|
|
21
21
|
text-overflow: ellipsis;
|
|
22
|
+
` : '', ({
|
|
23
|
+
$clamp
|
|
24
|
+
}) => $clamp ? `
|
|
25
|
+
display: -webkit-box;
|
|
26
|
+
-webkit-line-clamp: ${$clamp};
|
|
27
|
+
-webkit-box-orient: vertical;
|
|
28
|
+
overflow: hidden;
|
|
22
29
|
` : '');
|
|
@@ -5,4 +5,4 @@ export const NATIVE_RICH_MEDIA_DISPLAY_TYPES = ['modal', 'sheet', 'carousel', 's
|
|
|
5
5
|
* editor can author. The preview renders every display type, but only these
|
|
6
6
|
* three have an editing UI, so pickers must offer this list and not the full one.
|
|
7
7
|
*/
|
|
8
|
-
export const EDITABLE_NATIVE_RICH_MEDIA_DISPLAY_TYPES = ['modal', 'stories', 'fullscreen'];
|
|
8
|
+
export const EDITABLE_NATIVE_RICH_MEDIA_DISPLAY_TYPES = ['modal', 'stories', 'fullscreen', 'sheet', 'carousel', 'banner'];
|
|
@@ -3,7 +3,7 @@ import { FontSize, FontWeight } from '@pushwoosh/kit-constants';
|
|
|
3
3
|
export const Card = styled.div.withConfig({
|
|
4
4
|
displayName: "Card",
|
|
5
5
|
componentId: "sc-1fs78cm-0"
|
|
6
|
-
})(["margin:0 12px;border-radius:18px;
|
|
6
|
+
})(["margin:0 12px;border-radius:18px;padding:12px 14px;display:flex;align-items:center;gap:12px;background:", ";", " ", ""], ({
|
|
7
7
|
$background
|
|
8
8
|
}) => $background, ({
|
|
9
9
|
$marginTop
|
package/NativeRichMediaPreview/views/NativeRichMediaCarouselView/NativeRichMediaCarouselView.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Card, Dot, Dots, TextBlock } from './styles';
|
|
2
|
+
import { Card, Dot, Dots, Scrim, 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,12 +20,14 @@ export function NativeRichMediaCarouselView(props) {
|
|
|
20
20
|
url: item.image,
|
|
21
21
|
position: "absolute",
|
|
22
22
|
inset: true
|
|
23
|
-
}), (title.text || message.text) && _jsxs(TextBlock, {
|
|
23
|
+
}), _jsx(Scrim, {}), (title.text || message.text) && _jsxs(TextBlock, {
|
|
24
24
|
children: [title.text && _jsx(NativeRichMediaTitle, {
|
|
25
25
|
"$color": title.color,
|
|
26
|
+
"$clamp": 2,
|
|
26
27
|
children: title.text
|
|
27
28
|
}), message.text && _jsx(NativeRichMediaText, {
|
|
28
29
|
"$color": message.color,
|
|
30
|
+
"$clamp": 2,
|
|
29
31
|
children: message.text
|
|
30
32
|
})]
|
|
31
33
|
}), items.length > 1 && _jsx(Dots, {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const Card: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const Scrim: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
3
|
export declare const TextBlock: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
4
|
export declare const Dots: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
5
|
export declare const Dot: import("styled-components").StyledComponent<"div", any, {
|
|
@@ -2,18 +2,22 @@ import styled from 'styled-components';
|
|
|
2
2
|
export const Card = styled.div.withConfig({
|
|
3
3
|
displayName: "Card",
|
|
4
4
|
componentId: "sc-15b2cux-0"
|
|
5
|
-
})(["position:relative;margin:0 12px;
|
|
5
|
+
})(["position:relative;margin:0 12px;aspect-ratio:1 / 1.32;border-radius:24px;background:#000;overflow:hidden;box-shadow:0 16px 28px rgba(0,0,0,0.28);"]);
|
|
6
|
+
export const Scrim = styled.div.withConfig({
|
|
7
|
+
displayName: "Scrim",
|
|
8
|
+
componentId: "sc-15b2cux-1"
|
|
9
|
+
})(["position:absolute;inset:0;background:linear-gradient(180deg,rgba(0,0,0,0) 0%,rgba(0,0,0,0.9) 100%);"]);
|
|
6
10
|
export const TextBlock = styled.div.withConfig({
|
|
7
11
|
displayName: "TextBlock",
|
|
8
|
-
componentId: "sc-15b2cux-
|
|
12
|
+
componentId: "sc-15b2cux-2"
|
|
9
13
|
})(["position:absolute;left:18px;right:18px;bottom:36px;"]);
|
|
10
14
|
export const Dots = styled.div.withConfig({
|
|
11
15
|
displayName: "Dots",
|
|
12
|
-
componentId: "sc-15b2cux-
|
|
16
|
+
componentId: "sc-15b2cux-3"
|
|
13
17
|
})(["position:absolute;left:0;right:0;bottom:12px;text-align:center;font-size:0;"]);
|
|
14
18
|
export const Dot = styled.div.withConfig({
|
|
15
19
|
displayName: "Dot",
|
|
16
|
-
componentId: "sc-15b2cux-
|
|
20
|
+
componentId: "sc-15b2cux-4"
|
|
17
21
|
})(["display:inline-block;width:7px;height:7px;border-radius:50%;margin:0 4.5px;background:", ";"], ({
|
|
18
22
|
$active
|
|
19
23
|
}) => $active ? '#FFF' : 'rgba(255,255,255,0.4)');
|
|
@@ -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 { NativeRichMediaCoverImg } from '../../components/NativeRichMediaCoverImg';
|
|
7
7
|
import { NativeRichMediaText } from '../../components/NativeRichMediaText';
|
|
8
8
|
import { NativeRichMediaTitle } from '../../components/NativeRichMediaTitle';
|
|
9
9
|
import { asButtonList, asTextValue } from '../../helpers';
|
|
@@ -17,10 +17,11 @@ 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(NativeRichMediaCoverImg, {
|
|
21
21
|
url: block.image,
|
|
22
22
|
margin: "26px 14px 0",
|
|
23
|
-
borderRadius: 18
|
|
23
|
+
borderRadius: 18,
|
|
24
|
+
heightRatio: 0.58
|
|
24
25
|
}), (title.text || message.text) && _jsxs(Vertical, {
|
|
25
26
|
"$padding": (block.image ? '16px' : '20px') + ' 24px 0',
|
|
26
27
|
"$gap": 4,
|
|
@@ -8,7 +8,7 @@ export declare const EditableStyled: import("styled-components").StyledComponent
|
|
|
8
8
|
renderElement?: ((props: import("slate-react").RenderElementProps) => React.JSX.Element) | undefined;
|
|
9
9
|
renderChunk?: ((props: import("slate-react").RenderChunkProps) => React.JSX.Element) | undefined;
|
|
10
10
|
renderLeaf?: ((props: import("slate-react").RenderLeafProps) => React.JSX.Element) | undefined;
|
|
11
|
-
renderText?: ((props: import("slate-react
|
|
11
|
+
renderText?: ((props: import("slate-react").RenderTextProps) => React.JSX.Element) | undefined;
|
|
12
12
|
renderPlaceholder?: ((props: import("slate-react").RenderPlaceholderProps) => React.JSX.Element) | undefined;
|
|
13
13
|
scrollSelectionIntoView?: ((editor: import("slate-react").ReactEditor, domRange: Range) => void) | undefined;
|
|
14
14
|
as?: React.ElementType<any> | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pushwoosh/dumb-components",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.183",
|
|
4
4
|
"description": "React components to build Pushwoosh products",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"polished": "^4.3.1",
|
|
63
63
|
"react-select": "^5.10.0",
|
|
64
64
|
"react-transition-group": "^4.4.5",
|
|
65
|
-
"slate": "^0.
|
|
65
|
+
"slate": "^0.126.0",
|
|
66
66
|
"slate-history": "^0.113.1",
|
|
67
|
-
"slate-react": "^0.
|
|
67
|
+
"slate-react": "^0.126.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"react": "^16.14.0 || ^18.3.1",
|