@pushwoosh/dumb-components 1.1.163 → 1.1.165
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,9 +1,4 @@
|
|
|
1
|
-
export const
|
|
2
|
-
W: 393,
|
|
3
|
-
H: 852,
|
|
4
|
-
SAFE_TOP: 59,
|
|
5
|
-
SAFE_BOTTOM: 34
|
|
6
|
-
};
|
|
1
|
+
export const EDGE_INSET = 24;
|
|
7
2
|
export const SEG_FALLBACK = ['#5856D6', '#FF2D55', '#30B0C7', '#FF9500', '#AF52DE', '#34C759'];
|
|
8
3
|
export const SECONDARY_LABEL = 'rgba(60,60,67,0.6)';
|
|
9
4
|
export const TERTIARY_LABEL = 'rgba(60,60,67,0.3)';
|
|
@@ -73,9 +68,53 @@ export function surfaceBackground(background, fallbackHex) {
|
|
|
73
68
|
export function asText(value) {
|
|
74
69
|
return typeof value === 'string' ? value : '';
|
|
75
70
|
}
|
|
71
|
+
export function asTextValue(value) {
|
|
72
|
+
if (value && typeof value === 'object' && 'text' in value) {
|
|
73
|
+
const {
|
|
74
|
+
text,
|
|
75
|
+
color
|
|
76
|
+
} = value;
|
|
77
|
+
return {
|
|
78
|
+
text: asText(text),
|
|
79
|
+
color: typeof color === 'string' ? color : undefined
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
text: ''
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export function asButtonValue(value) {
|
|
87
|
+
if (!value || typeof value !== 'object') {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
const raw = value;
|
|
91
|
+
const text = asTextValue(raw.text);
|
|
92
|
+
const border = raw.border;
|
|
93
|
+
if (!text.text || !text.color || typeof raw.background !== 'string' || !border || typeof border.color !== 'string' || typeof border.radius !== 'number') {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
text: {
|
|
98
|
+
text: text.text,
|
|
99
|
+
color: text.color
|
|
100
|
+
},
|
|
101
|
+
background: raw.background,
|
|
102
|
+
border: {
|
|
103
|
+
color: border.color,
|
|
104
|
+
radius: border.radius
|
|
105
|
+
},
|
|
106
|
+
action: raw.action
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export function asButtonList(value) {
|
|
110
|
+
return Array.isArray(value) ? value.map(asButtonValue).filter(button => button !== null) : [];
|
|
111
|
+
}
|
|
76
112
|
export function surfaceBaseHex(background) {
|
|
77
113
|
if (Array.isArray(background)) {
|
|
78
114
|
return background[0];
|
|
79
115
|
}
|
|
80
116
|
return background || null;
|
|
117
|
+
}
|
|
118
|
+
export function clampIndex(index, length) {
|
|
119
|
+
return Math.max(0, Math.min(index, length - 1));
|
|
81
120
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none">
|
|
2
2
|
<path d="M4 9v6h4l5 4V5L8 9H4z" fill="#fff"/>
|
|
3
3
|
<path d="M16.5 8.5a5 5 0 010 7M19 6a8.5 8.5 0 010 12" stroke="#fff" stroke-width="2" stroke-linecap="round"/>
|
|
4
|
-
</svg>
|
|
4
|
+
</svg>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { NativeRichMediaConfig, NativeRichMediaDisplayType, NativeRichMediaText, NativeRichMediaAction, NativeRichMediaButton, NativeRichMediaReward, NativeRichMediaModalBlock, NativeRichMediaSheetBlock, NativeRichMediaCarouselBlock,
|
|
1
|
+
export type { NativeRichMediaConfig, NativeRichMediaDisplayType, NativeRichMediaText, NativeRichMediaBorder, NativeRichMediaCover, NativeRichMediaAction, NativeRichMediaButton, NativeRichMediaReward, NativeRichMediaModalBlock, NativeRichMediaSheetBlock, NativeRichMediaCarouselBlock, NativeRichMediaStoriesBlock, NativeRichMediaBannerBlock, NativeRichMediaFullscreenBlock, NativeRichMediaVideoBlock, NativeRichMediaPipBlock, NativeRichMediaScratchcardBlock, NativeRichMediaSpinwheelBlock, NativeRichMediaPreviewProps, } from './types';
|
|
2
2
|
export { NATIVE_RICH_MEDIA_DISPLAY_TYPES } from './types';
|
|
3
3
|
export { parseNativeRichMediaConfig } from './parseNativeRichMediaConfig';
|
|
4
4
|
export { NativeRichMediaPreview } from './NativeRichMediaPreview';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type NativeRichMediaConfig } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Parses and validates a native rich media config from an object or a JSON
|
|
4
|
-
* string; returns `null` when the input is not a well-formed config
|
|
4
|
+
* string; returns `null` when the input is not a well-formed config — unknown
|
|
5
|
+
* `displayType`, missing block, empty `items`/`segments`, or any required
|
|
6
|
+
* field of the block contract absent or malformed.
|
|
5
7
|
*/
|
|
6
8
|
export declare function parseNativeRichMediaConfig(content: string | NativeRichMediaConfig): NativeRichMediaConfig | null;
|
|
@@ -1,10 +1,76 @@
|
|
|
1
1
|
import { NATIVE_RICH_MEDIA_DISPLAY_TYPES } from './types';
|
|
2
|
-
function
|
|
3
|
-
return
|
|
2
|
+
function isObject(value) {
|
|
3
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
4
4
|
}
|
|
5
|
+
function isNonEmptyString(value) {
|
|
6
|
+
return typeof value === 'string' && value.length > 0;
|
|
7
|
+
}
|
|
8
|
+
function isFiniteNumber(value) {
|
|
9
|
+
return typeof value === 'number' && Number.isFinite(value);
|
|
10
|
+
}
|
|
11
|
+
function isText(value) {
|
|
12
|
+
return isObject(value) && isNonEmptyString(value.text) && isNonEmptyString(value.color);
|
|
13
|
+
}
|
|
14
|
+
function isOptionalText(value) {
|
|
15
|
+
return value === undefined || isText(value);
|
|
16
|
+
}
|
|
17
|
+
function isAction(value) {
|
|
18
|
+
if (!isObject(value)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
if (value.type === 'close') {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
return value.type === 'url' && isNonEmptyString(value.url);
|
|
25
|
+
}
|
|
26
|
+
function isOptionalAction(value) {
|
|
27
|
+
return value === undefined || isAction(value);
|
|
28
|
+
}
|
|
29
|
+
function isBorder(value) {
|
|
30
|
+
return isObject(value) && isNonEmptyString(value.color) && isFiniteNumber(value.radius);
|
|
31
|
+
}
|
|
32
|
+
function isActionlessButton(value) {
|
|
33
|
+
return isObject(value) && isText(value.text) && isNonEmptyString(value.background) && isBorder(value.border);
|
|
34
|
+
}
|
|
35
|
+
function isButton(value) {
|
|
36
|
+
return isActionlessButton(value) && isAction(value.action);
|
|
37
|
+
}
|
|
38
|
+
function isButtonArray(value) {
|
|
39
|
+
return Array.isArray(value) && value.every(isButton);
|
|
40
|
+
}
|
|
41
|
+
function isCover(value) {
|
|
42
|
+
return isObject(value) && isNonEmptyString(value.background);
|
|
43
|
+
}
|
|
44
|
+
function isReward(value) {
|
|
45
|
+
if (!isObject(value)) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
const hasIdentity = isText(value.title) || isNonEmptyString(value.code);
|
|
49
|
+
return hasIdentity && isOptionalText(value.title) && isOptionalText(value.message) && (value.button === undefined || isButton(value.button));
|
|
50
|
+
}
|
|
51
|
+
function isOptionalReward(value) {
|
|
52
|
+
return value === undefined || isReward(value);
|
|
53
|
+
}
|
|
54
|
+
function isBackground(value) {
|
|
55
|
+
return isNonEmptyString(value) || Array.isArray(value) && value.length > 0 && value.every(isNonEmptyString);
|
|
56
|
+
}
|
|
57
|
+
const BLOCK_VALIDATORS = {
|
|
58
|
+
banner: block => typeof block.showClose === 'boolean' && (block.position === 'top' || block.position === 'bottom') && isNonEmptyString(block.background) && isOptionalText(block.title) && isOptionalText(block.message) && isAction(block.action),
|
|
59
|
+
carousel: block => typeof block.showClose === 'boolean' && Array.isArray(block.items) && block.items.length > 0 && block.items.every(item => isObject(item) && isOptionalText(item.title) && isOptionalText(item.message) && isOptionalAction(item.action)),
|
|
60
|
+
fullscreen: block => typeof block.showClose === 'boolean' && isCover(block.cover) && isOptionalText(block.title) && isOptionalText(block.message) && isButtonArray(block.buttons),
|
|
61
|
+
modal: block => typeof block.showClose === 'boolean' && typeof block.dimBackground === 'boolean' && isNonEmptyString(block.background) && isOptionalText(block.title) && isOptionalText(block.message) && isButtonArray(block.buttons),
|
|
62
|
+
pip: block => typeof block.showClose === 'boolean' && ['bottom-right', 'bottom-left', 'top-right', 'top-left'].includes(block.position) && typeof block.loop === 'boolean' && typeof block.muted === 'boolean' && isNonEmptyString(block.url) && isFiniteNumber(block.width) && isFiniteNumber(block.aspectRatio) && isOptionalAction(block.action),
|
|
63
|
+
scratchcard: block => typeof block.showClose === 'boolean' && isBackground(block.background) && isFiniteNumber(block.revealThreshold) && isCover(block.cover) && (block.revealButton === undefined || isActionlessButton(block.revealButton)) && isOptionalText(block.title) && isOptionalText(block.message) && isReward(block.reward),
|
|
64
|
+
sheet: block => typeof block.showClose === 'boolean' && typeof block.dimBackground === 'boolean' && isNonEmptyString(block.background) && isOptionalText(block.title) && isOptionalText(block.message) && isButtonArray(block.buttons),
|
|
65
|
+
spinwheel: block => typeof block.showClose === 'boolean' && isBackground(block.background) && isFiniteNumber(block.winIndex) && isActionlessButton(block.spinButton) && isOptionalText(block.title) && isOptionalText(block.message) && isReward(block.reward) && isOptionalText(block.loseTitle) && Array.isArray(block.segments) && block.segments.length > 0 && block.segments.every(segment => isObject(segment) && isText(segment.message) && isFiniteNumber(segment.weight) && isOptionalReward(segment.reward)),
|
|
66
|
+
stories: block => typeof block.showClose === 'boolean' && typeof block.loop === 'boolean' && Array.isArray(block.items) && block.items.length > 0 && block.items.every(item => isObject(item) && isOptionalText(item.title) && isOptionalText(item.message) && isButtonArray(item.buttons) && isFiniteNumber(item.duration)),
|
|
67
|
+
video: block => typeof block.showClose === 'boolean' && typeof block.loop === 'boolean' && typeof block.muted === 'boolean' && isNonEmptyString(block.url) && isOptionalText(block.title) && isOptionalText(block.message) && isButtonArray(block.buttons)
|
|
68
|
+
};
|
|
5
69
|
/**
|
|
6
70
|
* Parses and validates a native rich media config from an object or a JSON
|
|
7
|
-
* string; returns `null` when the input is not a well-formed config
|
|
71
|
+
* string; returns `null` when the input is not a well-formed config — unknown
|
|
72
|
+
* `displayType`, missing block, empty `items`/`segments`, or any required
|
|
73
|
+
* field of the block contract absent or malformed.
|
|
8
74
|
*/
|
|
9
75
|
export function parseNativeRichMediaConfig(content) {
|
|
10
76
|
let raw = content;
|
|
@@ -15,26 +81,16 @@ export function parseNativeRichMediaConfig(content) {
|
|
|
15
81
|
return null;
|
|
16
82
|
}
|
|
17
83
|
}
|
|
18
|
-
if (
|
|
84
|
+
if (!isObject(raw)) {
|
|
19
85
|
return null;
|
|
20
86
|
}
|
|
21
|
-
const
|
|
22
|
-
const displayType = candidate.displayType;
|
|
87
|
+
const displayType = raw.displayType;
|
|
23
88
|
if (!NATIVE_RICH_MEDIA_DISPLAY_TYPES.includes(displayType)) {
|
|
24
89
|
return null;
|
|
25
90
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
const block = candidate[displayType];
|
|
30
|
-
if ((displayType === 'carousel' || displayType === 'stories') && !isObjectArray(block.items)) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
if (displayType === 'spinwheel' && !isObjectArray(block.segments)) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
if (block.buttons !== undefined && !isObjectArray(block.buttons)) {
|
|
91
|
+
const block = raw[displayType];
|
|
92
|
+
if (!isObject(block) || !BLOCK_VALIDATORS[displayType](block)) {
|
|
37
93
|
return null;
|
|
38
94
|
}
|
|
39
|
-
return
|
|
95
|
+
return raw;
|
|
40
96
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type NativeRichMediaJustify = 'flex-start' | 'flex-end' | 'center' | 'space-between';
|
|
2
2
|
export declare const ButtonRow: import("styled-components").StyledComponent<"div", any, {
|
|
3
3
|
$borderRadius: number;
|
|
4
4
|
$background?: string;
|
|
5
5
|
$color: string;
|
|
6
6
|
$marginTop?: number;
|
|
7
|
-
$boxShadow?: string;
|
|
8
7
|
$border?: string;
|
|
9
8
|
}, never>;
|
|
10
|
-
export declare const
|
|
9
|
+
export declare const PreviewHost: import("styled-components").StyledComponent<"div", any, {
|
|
11
10
|
width: string | number;
|
|
12
11
|
height: string | number;
|
|
13
12
|
$withBackground: boolean;
|
|
14
13
|
}, never>;
|
|
15
|
-
export declare const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
$
|
|
14
|
+
export declare const BackdropLayer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
|
+
export declare const ScrollLayer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
16
|
+
export declare const ContentFlow: import("styled-components").StyledComponent<"div", any, {
|
|
17
|
+
$justify: NativeRichMediaJustify;
|
|
19
18
|
}, never>;
|
|
19
|
+
export declare const SpinnerLayer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { Color, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
2
|
+
import { Color, FontFamily, FontSize, FontWeight, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { toCssValue } from '@pushwoosh/kit-helpers';
|
|
4
|
-
export const TemplateLayer = styled.div.withConfig({
|
|
5
|
-
displayName: "TemplateLayer",
|
|
6
|
-
componentId: "sc-mc9ykd-0"
|
|
7
|
-
})(["position:absolute;inset:0;z-index:10;"]);
|
|
8
4
|
export const ButtonRow = styled.div.withConfig({
|
|
9
5
|
displayName: "ButtonRow",
|
|
10
|
-
componentId: "sc-mc9ykd-
|
|
11
|
-
})(["display:flex;align-items:center;justify-content:center;height:
|
|
6
|
+
componentId: "sc-mc9ykd-0"
|
|
7
|
+
})(["display:flex;align-items:center;justify-content:center;height:44px;font-size:", ";font-weight:", ";white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 12px;user-select:none;cursor:pointer;border-radius:", "px;color:", ";", " ", " ", ""], FontSize.REGULAR, FontWeight.MEDIUM, ({
|
|
12
8
|
$borderRadius
|
|
13
9
|
}) => $borderRadius, ({
|
|
14
10
|
$color
|
|
@@ -17,14 +13,12 @@ export const ButtonRow = styled.div.withConfig({
|
|
|
17
13
|
}) => $background !== undefined ? `background: ${$background};` : '', ({
|
|
18
14
|
$marginTop
|
|
19
15
|
}) => $marginTop !== undefined ? `margin-top: ${$marginTop}px;` : '', ({
|
|
20
|
-
$boxShadow
|
|
21
|
-
}) => $boxShadow !== undefined ? `box-shadow: ${$boxShadow};` : '', ({
|
|
22
16
|
$border
|
|
23
17
|
}) => $border !== undefined ? `border: ${$border};` : '');
|
|
24
|
-
export const
|
|
25
|
-
displayName: "
|
|
26
|
-
componentId: "sc-mc9ykd-
|
|
27
|
-
})(["position:relative;border:", ";border-radius:", ";background-color:", ";width:", ";height:", ";margin:0 auto;overflow:hidden;"], ({
|
|
18
|
+
export const PreviewHost = styled.div.withConfig({
|
|
19
|
+
displayName: "PreviewHost",
|
|
20
|
+
componentId: "sc-mc9ykd-1"
|
|
21
|
+
})(["position:relative;border:", ";border-radius:", ";background-color:", ";width:", ";height:", ";margin:0 auto;overflow:hidden;font-family:", ";-webkit-font-smoothing:antialiased;*{box-sizing:border-box;}"], ({
|
|
28
22
|
$withBackground
|
|
29
23
|
}) => $withBackground ? `1px solid ${Color.DIVIDER}` : 'none', ShapeRadius.SECTION, ({
|
|
30
24
|
$withBackground
|
|
@@ -32,14 +26,22 @@ export const ScaledCanvasHost = styled.div.withConfig({
|
|
|
32
26
|
width
|
|
33
27
|
}) => toCssValue(width), ({
|
|
34
28
|
height
|
|
35
|
-
}) => toCssValue(height));
|
|
36
|
-
export const
|
|
37
|
-
displayName: "
|
|
29
|
+
}) => toCssValue(height), FontFamily.MAIN);
|
|
30
|
+
export const BackdropLayer = styled.div.withConfig({
|
|
31
|
+
displayName: "BackdropLayer",
|
|
32
|
+
componentId: "sc-mc9ykd-2"
|
|
33
|
+
})(["position:absolute;inset:0;"]);
|
|
34
|
+
export const ScrollLayer = styled.div.withConfig({
|
|
35
|
+
displayName: "ScrollLayer",
|
|
38
36
|
componentId: "sc-mc9ykd-3"
|
|
39
|
-
})(["position:absolute;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
})
|
|
44
|
-
$
|
|
45
|
-
}) => $
|
|
37
|
+
})(["position:absolute;inset:0;overflow-y:auto;overflow-x:hidden;"]);
|
|
38
|
+
export const ContentFlow = styled.div.withConfig({
|
|
39
|
+
displayName: "ContentFlow",
|
|
40
|
+
componentId: "sc-mc9ykd-4"
|
|
41
|
+
})(["position:relative;min-height:100%;width:100%;display:flex;flex-direction:column;justify-content:", ";"], ({
|
|
42
|
+
$justify
|
|
43
|
+
}) => $justify);
|
|
44
|
+
export const SpinnerLayer = styled.div.withConfig({
|
|
45
|
+
displayName: "SpinnerLayer",
|
|
46
|
+
componentId: "sc-mc9ykd-5"
|
|
47
|
+
})(["position:absolute;inset:0;display:flex;align-items:center;justify-content:center;"]);
|