@pushwoosh/dumb-components 1.1.220 → 1.1.222
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/EmailTemplatePreview/EmailTemplatePreview.d.ts +3 -1
- package/EmailTemplatePreview/EmailTemplatePreview.js +30 -7
- package/EmailTemplatePreview/__tests__/clickMap.test.d.ts +1 -0
- package/EmailTemplatePreview/__tests__/clickMap.test.js +107 -0
- package/EmailTemplatePreview/clickMap.d.ts +25 -0
- package/EmailTemplatePreview/clickMap.js +128 -0
- package/EmailTemplatePreview/index.d.ts +2 -0
- package/EmailTemplatePreview/index.js +2 -1
- package/EmailTemplatePreview/types.d.ts +33 -0
- package/InboxPreview/InboxPreview.d.ts +13 -0
- package/InboxPreview/InboxPreview.js +82 -0
- package/InboxPreview/__tests__/helpers.test.d.ts +1 -0
- package/InboxPreview/__tests__/helpers.test.js +201 -0
- package/InboxPreview/components/InboxAndroidCell/InboxAndroidCell.d.ts +4 -0
- package/InboxPreview/components/InboxAndroidCell/InboxAndroidCell.js +70 -0
- package/InboxPreview/components/InboxAndroidCell/index.d.ts +1 -0
- package/InboxPreview/components/InboxAndroidCell/index.js +1 -0
- package/InboxPreview/components/InboxCellAvatar/InboxCellAvatar.d.ts +4 -0
- package/InboxPreview/components/InboxCellAvatar/InboxCellAvatar.js +48 -0
- package/InboxPreview/components/InboxCellAvatar/index.d.ts +1 -0
- package/InboxPreview/components/InboxCellAvatar/index.js +1 -0
- package/InboxPreview/components/InboxCellAvatar/styles.d.ts +1 -0
- package/InboxPreview/components/InboxCellAvatar/styles.js +5 -0
- package/InboxPreview/components/InboxCellAvatar/types.d.ts +10 -0
- package/InboxPreview/components/InboxCellAvatar/types.js +1 -0
- package/InboxPreview/components/InboxCellCarousel/InboxCellCarousel.d.ts +4 -0
- package/InboxPreview/components/InboxCellCarousel/InboxCellCarousel.js +53 -0
- package/InboxPreview/components/InboxCellCarousel/index.d.ts +1 -0
- package/InboxPreview/components/InboxCellCarousel/index.js +1 -0
- package/InboxPreview/components/InboxCellCarousel/styles.d.ts +29 -0
- package/InboxPreview/components/InboxCellCarousel/styles.js +24 -0
- package/InboxPreview/components/InboxCellCarousel/types.d.ts +8 -0
- package/InboxPreview/components/InboxCellCarousel/types.js +1 -0
- package/InboxPreview/components/InboxCellMedia/InboxCellMedia.d.ts +4 -0
- package/InboxPreview/components/InboxCellMedia/InboxCellMedia.js +26 -0
- package/InboxPreview/components/InboxCellMedia/index.d.ts +1 -0
- package/InboxPreview/components/InboxCellMedia/index.js +1 -0
- package/InboxPreview/components/InboxCellMedia/types.d.ts +12 -0
- package/InboxPreview/components/InboxCellMedia/types.js +1 -0
- package/InboxPreview/components/InboxIOSCell/InboxIOSCell.d.ts +4 -0
- package/InboxPreview/components/InboxIOSCell/InboxIOSCell.js +125 -0
- package/InboxPreview/components/InboxIOSCell/index.d.ts +1 -0
- package/InboxPreview/components/InboxIOSCell/index.js +1 -0
- package/InboxPreview/components/InboxWebCell/InboxWebCell.d.ts +4 -0
- package/InboxPreview/components/InboxWebCell/InboxWebCell.js +83 -0
- package/InboxPreview/components/InboxWebCell/index.d.ts +1 -0
- package/InboxPreview/components/InboxWebCell/index.js +1 -0
- package/InboxPreview/constants.d.ts +14 -0
- package/InboxPreview/constants.js +30 -0
- package/InboxPreview/helpers.d.ts +29 -0
- package/InboxPreview/helpers.js +75 -0
- package/InboxPreview/index.d.ts +4 -0
- package/InboxPreview/index.js +3 -0
- package/InboxPreview/polyglot/index.d.ts +2 -0
- package/InboxPreview/polyglot/index.js +34 -0
- package/InboxPreview/polyglot/messages_ar.d.ts +3 -0
- package/InboxPreview/polyglot/messages_ar.js +4 -0
- package/InboxPreview/polyglot/messages_bn.d.ts +3 -0
- package/InboxPreview/polyglot/messages_bn.js +4 -0
- package/InboxPreview/polyglot/messages_de.d.ts +3 -0
- package/InboxPreview/polyglot/messages_de.js +4 -0
- package/InboxPreview/polyglot/messages_en.d.ts +3 -0
- package/InboxPreview/polyglot/messages_en.js +4 -0
- package/InboxPreview/polyglot/messages_es.d.ts +3 -0
- package/InboxPreview/polyglot/messages_es.js +4 -0
- package/InboxPreview/polyglot/messages_fr.d.ts +3 -0
- package/InboxPreview/polyglot/messages_fr.js +4 -0
- package/InboxPreview/polyglot/messages_he.d.ts +3 -0
- package/InboxPreview/polyglot/messages_he.js +4 -0
- package/InboxPreview/polyglot/messages_hi.d.ts +3 -0
- package/InboxPreview/polyglot/messages_hi.js +4 -0
- package/InboxPreview/polyglot/messages_ja.d.ts +3 -0
- package/InboxPreview/polyglot/messages_ja.js +4 -0
- package/InboxPreview/polyglot/messages_ko.d.ts +3 -0
- package/InboxPreview/polyglot/messages_ko.js +4 -0
- package/InboxPreview/polyglot/messages_pt.d.ts +3 -0
- package/InboxPreview/polyglot/messages_pt.js +4 -0
- package/InboxPreview/polyglot/messages_ru.d.ts +3 -0
- package/InboxPreview/polyglot/messages_ru.js +4 -0
- package/InboxPreview/polyglot/messages_th.d.ts +3 -0
- package/InboxPreview/polyglot/messages_th.js +4 -0
- package/InboxPreview/polyglot/messages_zh.d.ts +3 -0
- package/InboxPreview/polyglot/messages_zh.js +4 -0
- package/InboxPreview/polyglot/types.d.ts +5 -0
- package/InboxPreview/polyglot/types.js +1 -0
- package/InboxPreview/styles.d.ts +25 -0
- package/InboxPreview/styles.js +21 -0
- package/InboxPreview/types.d.ts +74 -0
- package/InboxPreview/types.js +1 -0
- package/index.d.ts +2 -1
- package/index.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Color, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
3
|
+
import { Vertical } from '@pushwoosh/kit-helpers';
|
|
4
|
+
import { Text } from '@pushwoosh/kit-typography';
|
|
5
|
+
export const HeroImage = styled.img.withConfig({
|
|
6
|
+
displayName: "HeroImage",
|
|
7
|
+
componentId: "sc-1rsolhm-0"
|
|
8
|
+
})(["display:block;width:100%;aspect-ratio:9 / 4;object-fit:cover;border-radius:", ";"], ShapeRadius.SECTION);
|
|
9
|
+
export const EmptyHero = styled(Vertical).attrs({
|
|
10
|
+
$borderRadius: ShapeRadius.SECTION,
|
|
11
|
+
$shrink: 0
|
|
12
|
+
}).withConfig({
|
|
13
|
+
displayName: "EmptyHero",
|
|
14
|
+
componentId: "sc-1rsolhm-1"
|
|
15
|
+
})(["aspect-ratio:9 / 4;border:1px dashed ", ";background:", ";"], Color.BRIGHT, Color.BRIGHT_LIGHT_HOVER);
|
|
16
|
+
export const ClampText = styled(Text).withConfig({
|
|
17
|
+
displayName: "ClampText",
|
|
18
|
+
componentId: "sc-1rsolhm-2"
|
|
19
|
+
})(["display:-webkit-box;-webkit-line-clamp:", ";-webkit-box-orient:vertical;overflow:hidden;"], ({
|
|
20
|
+
$clamp = 2
|
|
21
|
+
}) => $clamp);
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { TypographyVariant } from '@pushwoosh/kit-typography';
|
|
3
|
+
/** Cell layout of an Inbox message. */
|
|
4
|
+
export type InboxLayoutType = 'classic' | 'captioned' | 'banner' | 'carousel';
|
|
5
|
+
/** One carousel slide of an Inbox message. */
|
|
6
|
+
export interface InboxPreviewSlide {
|
|
7
|
+
/** Slide image URL; a slide without it is dropped, like in the SDK. */
|
|
8
|
+
imageUrl?: string;
|
|
9
|
+
/** Caption overlaid at the bottom of the slide. */
|
|
10
|
+
caption?: string;
|
|
11
|
+
}
|
|
12
|
+
/** One localized Inbox content (mirrors the rpc-v2 `AppInboxPresetLocale` shape). */
|
|
13
|
+
export interface InboxPreviewContent {
|
|
14
|
+
/** Cell title. */
|
|
15
|
+
title?: string;
|
|
16
|
+
/** Cell text. */
|
|
17
|
+
body?: string;
|
|
18
|
+
/** Small round avatar icon URL; without it classic renders a colored initial. */
|
|
19
|
+
iconUrl?: string;
|
|
20
|
+
/** Hero image URL for the banner/captioned layouts. */
|
|
21
|
+
bannerUrl?: string;
|
|
22
|
+
/** Requested layout; unknown or absent values fall back to the SDK heuristic. */
|
|
23
|
+
layoutType?: string;
|
|
24
|
+
/** Carousel slides; only the first five valid ones are rendered. */
|
|
25
|
+
carousel?: InboxPreviewSlide[];
|
|
26
|
+
}
|
|
27
|
+
/** Platform skin of {@link InboxPreview}: each OS draws the inbox cell differently. */
|
|
28
|
+
export type InboxPreviewPlatform = 'ios' | 'android' | 'web';
|
|
29
|
+
/** Inbox icon geometry of one platform. */
|
|
30
|
+
export interface InboxAvatarShape {
|
|
31
|
+
size: number;
|
|
32
|
+
radius: string;
|
|
33
|
+
initialVariant: TypographyVariant;
|
|
34
|
+
}
|
|
35
|
+
/** Props every platform cell of {@link InboxPreview} renders from. */
|
|
36
|
+
export interface InboxCellProps {
|
|
37
|
+
/** Content to draw, already picked by locale. */
|
|
38
|
+
content: InboxPreviewContent;
|
|
39
|
+
/** Layout the SDK would draw for this content. */
|
|
40
|
+
layout: InboxLayoutType;
|
|
41
|
+
/** Draw the dashed placeholders instead of the icon and the media. */
|
|
42
|
+
isEmpty: boolean;
|
|
43
|
+
/** Rendered title of the cell. */
|
|
44
|
+
title: ReactNode;
|
|
45
|
+
/** Rendered text of the cell; falsy hides the text line. */
|
|
46
|
+
body: ReactNode;
|
|
47
|
+
/** Date label of the cell. */
|
|
48
|
+
dateLabel: string;
|
|
49
|
+
/** Draw the unread dot. */
|
|
50
|
+
unread: boolean;
|
|
51
|
+
}
|
|
52
|
+
/** Props of {@link InboxPreview}. */
|
|
53
|
+
export interface InboxPreviewProps {
|
|
54
|
+
/** Platform skin to render (default `ios`); the editor switches it with platform chips. */
|
|
55
|
+
platform?: InboxPreviewPlatform;
|
|
56
|
+
/** Already-picked locale to render; takes priority over {@link InboxPreviewProps.localizedContent}. */
|
|
57
|
+
content?: InboxPreviewContent | null;
|
|
58
|
+
/** Per-language content map to pick from by {@link InboxPreviewProps.language}. */
|
|
59
|
+
localizedContent?: Record<string, InboxPreviewContent>;
|
|
60
|
+
/** Language key used to pick from `localizedContent`. */
|
|
61
|
+
language?: string;
|
|
62
|
+
/** Date label at the right of the cell (default `12:12`, as in the design mock). */
|
|
63
|
+
dateLabel?: string;
|
|
64
|
+
/** Render the unread dot (default `true`). */
|
|
65
|
+
unread?: boolean;
|
|
66
|
+
/** Show the loading placeholder. */
|
|
67
|
+
isLoading?: boolean;
|
|
68
|
+
/** Title of the dashed empty-state placeholder; defaults to the localized "Message preview". */
|
|
69
|
+
emptyTitle?: ReactNode;
|
|
70
|
+
/** Description of the dashed empty-state placeholder; defaults to the localized hint. */
|
|
71
|
+
emptyDescription?: ReactNode;
|
|
72
|
+
/** CSS width of the preview. */
|
|
73
|
+
width?: string | number;
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/index.d.ts
CHANGED
|
@@ -32,8 +32,9 @@ export { Tooltip, type TooltipPosition, TooltipTrigger } from './Tooltip';
|
|
|
32
32
|
export { Tab, TabBar, TabPanel, Tabs, type TabCode } from './Tabs';
|
|
33
33
|
export { Link, type LinkPropsWithoutAs, type LinkPropsWithAsTag, type LinkPropsWithAsComponent, } from './Link';
|
|
34
34
|
export { StatisticCard } from './StatisticCard';
|
|
35
|
-
export { EmailTemplatePreview, NoEmailTemplatePreview, replaceLocalization, replacePlaceholders } from './EmailTemplatePreview';
|
|
35
|
+
export { EmailTemplatePreview, NoEmailTemplatePreview, replaceLocalization, replacePlaceholders, matchClickMapItems, decorateClickMap, CLICK_MAP_BADGE_ATTRIBUTE, type EmailClickMapItem, type EmailClickMapPlacement, type EmailClickMapProps, type PreviewIframeProps, } from './EmailTemplatePreview';
|
|
36
36
|
export { PushPreview } from './PushPreview';
|
|
37
|
+
export { InboxPreview, resolveInboxLayout, MAX_CAROUSEL_SLIDES, type InboxLayoutType, type InboxPreviewPlatform, type InboxPreviewContent, type InboxPreviewProps, type InboxPreviewSlide, } from './InboxPreview';
|
|
37
38
|
export { WhatsAppPreview } from './WhatsAppPreview';
|
|
38
39
|
export type { WhatsAppAttachment, WhatsAppAttachmentKind, WhatsAppMessage, WhatsAppMessageDirection, WhatsAppMessageStatus, WhatsAppPreviewProps, } from './WhatsAppPreview';
|
|
39
40
|
export { Toast, ToastProvider, useToast } from './Toast';
|
package/index.js
CHANGED
|
@@ -32,8 +32,9 @@ export { Tooltip, TooltipTrigger } from './Tooltip';
|
|
|
32
32
|
export { Tab, TabBar, TabPanel, Tabs } from './Tabs';
|
|
33
33
|
export { Link } from './Link';
|
|
34
34
|
export { StatisticCard } from './StatisticCard';
|
|
35
|
-
export { EmailTemplatePreview, NoEmailTemplatePreview, replaceLocalization, replacePlaceholders } from './EmailTemplatePreview';
|
|
35
|
+
export { EmailTemplatePreview, NoEmailTemplatePreview, replaceLocalization, replacePlaceholders, matchClickMapItems, decorateClickMap, CLICK_MAP_BADGE_ATTRIBUTE } from './EmailTemplatePreview';
|
|
36
36
|
export { PushPreview } from './PushPreview';
|
|
37
|
+
export { InboxPreview, resolveInboxLayout, MAX_CAROUSEL_SLIDES } from './InboxPreview';
|
|
37
38
|
export { WhatsAppPreview } from './WhatsAppPreview';
|
|
38
39
|
export { Toast, ToastProvider, useToast } from './Toast';
|
|
39
40
|
export { AutosizeInput, PageHeader, PageHeaderEditable } from './PageHeader';
|