@pushwoosh/dumb-components 1.1.221 → 1.1.223

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.
Files changed (87) hide show
  1. package/EmailTemplatePreview/__tests__/clickMap.test.js +33 -2
  2. package/EmailTemplatePreview/clickMap.d.ts +3 -1
  3. package/EmailTemplatePreview/clickMap.js +14 -3
  4. package/EmailTemplatePreview/types.d.ts +2 -0
  5. package/InboxPreview/InboxPreview.d.ts +13 -0
  6. package/InboxPreview/InboxPreview.js +82 -0
  7. package/InboxPreview/__tests__/helpers.test.d.ts +1 -0
  8. package/InboxPreview/__tests__/helpers.test.js +201 -0
  9. package/InboxPreview/components/InboxAndroidCell/InboxAndroidCell.d.ts +4 -0
  10. package/InboxPreview/components/InboxAndroidCell/InboxAndroidCell.js +70 -0
  11. package/InboxPreview/components/InboxAndroidCell/index.d.ts +1 -0
  12. package/InboxPreview/components/InboxAndroidCell/index.js +1 -0
  13. package/InboxPreview/components/InboxCellAvatar/InboxCellAvatar.d.ts +4 -0
  14. package/InboxPreview/components/InboxCellAvatar/InboxCellAvatar.js +48 -0
  15. package/InboxPreview/components/InboxCellAvatar/index.d.ts +1 -0
  16. package/InboxPreview/components/InboxCellAvatar/index.js +1 -0
  17. package/InboxPreview/components/InboxCellAvatar/styles.d.ts +1 -0
  18. package/InboxPreview/components/InboxCellAvatar/styles.js +5 -0
  19. package/InboxPreview/components/InboxCellAvatar/types.d.ts +10 -0
  20. package/InboxPreview/components/InboxCellAvatar/types.js +1 -0
  21. package/InboxPreview/components/InboxCellCarousel/InboxCellCarousel.d.ts +4 -0
  22. package/InboxPreview/components/InboxCellCarousel/InboxCellCarousel.js +53 -0
  23. package/InboxPreview/components/InboxCellCarousel/index.d.ts +1 -0
  24. package/InboxPreview/components/InboxCellCarousel/index.js +1 -0
  25. package/InboxPreview/components/InboxCellCarousel/styles.d.ts +29 -0
  26. package/InboxPreview/components/InboxCellCarousel/styles.js +24 -0
  27. package/InboxPreview/components/InboxCellCarousel/types.d.ts +8 -0
  28. package/InboxPreview/components/InboxCellCarousel/types.js +1 -0
  29. package/InboxPreview/components/InboxCellMedia/InboxCellMedia.d.ts +4 -0
  30. package/InboxPreview/components/InboxCellMedia/InboxCellMedia.js +26 -0
  31. package/InboxPreview/components/InboxCellMedia/index.d.ts +1 -0
  32. package/InboxPreview/components/InboxCellMedia/index.js +1 -0
  33. package/InboxPreview/components/InboxCellMedia/types.d.ts +12 -0
  34. package/InboxPreview/components/InboxCellMedia/types.js +1 -0
  35. package/InboxPreview/components/InboxIOSCell/InboxIOSCell.d.ts +4 -0
  36. package/InboxPreview/components/InboxIOSCell/InboxIOSCell.js +125 -0
  37. package/InboxPreview/components/InboxIOSCell/index.d.ts +1 -0
  38. package/InboxPreview/components/InboxIOSCell/index.js +1 -0
  39. package/InboxPreview/components/InboxWebCell/InboxWebCell.d.ts +4 -0
  40. package/InboxPreview/components/InboxWebCell/InboxWebCell.js +83 -0
  41. package/InboxPreview/components/InboxWebCell/index.d.ts +1 -0
  42. package/InboxPreview/components/InboxWebCell/index.js +1 -0
  43. package/InboxPreview/constants.d.ts +14 -0
  44. package/InboxPreview/constants.js +30 -0
  45. package/InboxPreview/helpers.d.ts +29 -0
  46. package/InboxPreview/helpers.js +75 -0
  47. package/InboxPreview/index.d.ts +4 -0
  48. package/InboxPreview/index.js +3 -0
  49. package/InboxPreview/polyglot/index.d.ts +2 -0
  50. package/InboxPreview/polyglot/index.js +34 -0
  51. package/InboxPreview/polyglot/messages_ar.d.ts +3 -0
  52. package/InboxPreview/polyglot/messages_ar.js +4 -0
  53. package/InboxPreview/polyglot/messages_bn.d.ts +3 -0
  54. package/InboxPreview/polyglot/messages_bn.js +4 -0
  55. package/InboxPreview/polyglot/messages_de.d.ts +3 -0
  56. package/InboxPreview/polyglot/messages_de.js +4 -0
  57. package/InboxPreview/polyglot/messages_en.d.ts +3 -0
  58. package/InboxPreview/polyglot/messages_en.js +4 -0
  59. package/InboxPreview/polyglot/messages_es.d.ts +3 -0
  60. package/InboxPreview/polyglot/messages_es.js +4 -0
  61. package/InboxPreview/polyglot/messages_fr.d.ts +3 -0
  62. package/InboxPreview/polyglot/messages_fr.js +4 -0
  63. package/InboxPreview/polyglot/messages_he.d.ts +3 -0
  64. package/InboxPreview/polyglot/messages_he.js +4 -0
  65. package/InboxPreview/polyglot/messages_hi.d.ts +3 -0
  66. package/InboxPreview/polyglot/messages_hi.js +4 -0
  67. package/InboxPreview/polyglot/messages_ja.d.ts +3 -0
  68. package/InboxPreview/polyglot/messages_ja.js +4 -0
  69. package/InboxPreview/polyglot/messages_ko.d.ts +3 -0
  70. package/InboxPreview/polyglot/messages_ko.js +4 -0
  71. package/InboxPreview/polyglot/messages_pt.d.ts +3 -0
  72. package/InboxPreview/polyglot/messages_pt.js +4 -0
  73. package/InboxPreview/polyglot/messages_ru.d.ts +3 -0
  74. package/InboxPreview/polyglot/messages_ru.js +4 -0
  75. package/InboxPreview/polyglot/messages_th.d.ts +3 -0
  76. package/InboxPreview/polyglot/messages_th.js +4 -0
  77. package/InboxPreview/polyglot/messages_zh.d.ts +3 -0
  78. package/InboxPreview/polyglot/messages_zh.js +4 -0
  79. package/InboxPreview/polyglot/types.d.ts +5 -0
  80. package/InboxPreview/polyglot/types.js +1 -0
  81. package/InboxPreview/styles.d.ts +25 -0
  82. package/InboxPreview/styles.js +21 -0
  83. package/InboxPreview/types.d.ts +74 -0
  84. package/InboxPreview/types.js +1 -0
  85. package/index.d.ts +1 -0
  86. package/index.js +1 -0
  87. package/package.json +1 -1
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.INBOX_PREVIEW.EMPTY_TITLE': 'संदेश का पूर्वावलोकन',
3
+ 'DUMB.INBOX_PREVIEW.EMPTY_DESCRIPTION': 'पूर्वावलोकन देखने के लिए अपने इनबॉक्स संदेश का टेक्स्ट दर्ज करें'
4
+ };
@@ -0,0 +1,3 @@
1
+ import { type InboxPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<InboxPreviewMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.INBOX_PREVIEW.EMPTY_TITLE': 'メッセージのプレビュー',
3
+ 'DUMB.INBOX_PREVIEW.EMPTY_DESCRIPTION': 'インボックスメッセージのテキストを入力するとプレビューが表示されます'
4
+ };
@@ -0,0 +1,3 @@
1
+ import { type InboxPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<InboxPreviewMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.INBOX_PREVIEW.EMPTY_TITLE': '메시지 미리보기',
3
+ 'DUMB.INBOX_PREVIEW.EMPTY_DESCRIPTION': '인박스 메시지의 텍스트를 입력하면 미리보기가 표시됩니다'
4
+ };
@@ -0,0 +1,3 @@
1
+ import { type InboxPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<InboxPreviewMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.INBOX_PREVIEW.EMPTY_TITLE': 'Pré-visualização da mensagem',
3
+ 'DUMB.INBOX_PREVIEW.EMPTY_DESCRIPTION': 'Digite o texto da sua mensagem da Inbox para ver a pré-visualização'
4
+ };
@@ -0,0 +1,3 @@
1
+ import { type InboxPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<InboxPreviewMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.INBOX_PREVIEW.EMPTY_TITLE': 'Превью сообщения',
3
+ 'DUMB.INBOX_PREVIEW.EMPTY_DESCRIPTION': 'Введите текст Inbox-сообщения, чтобы увидеть превью'
4
+ };
@@ -0,0 +1,3 @@
1
+ import { type InboxPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<InboxPreviewMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.INBOX_PREVIEW.EMPTY_TITLE': 'ตัวอย่างข้อความ',
3
+ 'DUMB.INBOX_PREVIEW.EMPTY_DESCRIPTION': 'กรอกข้อความของข้อความ Inbox เพื่อดูตัวอย่าง'
4
+ };
@@ -0,0 +1,3 @@
1
+ import { type InboxPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<InboxPreviewMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.INBOX_PREVIEW.EMPTY_TITLE': '消息预览',
3
+ 'DUMB.INBOX_PREVIEW.EMPTY_DESCRIPTION': '输入收件箱消息的文本以查看预览'
4
+ };
@@ -0,0 +1,5 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type InboxPreviewMessages = {
3
+ 'DUMB.INBOX_PREVIEW.EMPTY_TITLE': NoParams;
4
+ 'DUMB.INBOX_PREVIEW.EMPTY_DESCRIPTION': NoParams;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ import { ShapeRadius } from '@pushwoosh/kit-constants';
2
+ export declare const HeroImage: import("styled-components").StyledComponent<"img", any, {}, never>;
3
+ export declare const EmptyHero: import("styled-components").StyledComponent<"div", any, import("@pushwoosh/kit-helpers/styled-helpers").CommonBoxProps & {
4
+ $alignContent?: import("@pushwoosh/kit-helpers/styled-helpers").AlignContentValue | undefined;
5
+ $alignItems?: import("@pushwoosh/kit-helpers/styled-helpers").ItemAlignmentValue | undefined;
6
+ $gap?: import("@pushwoosh/kit-helpers/styled-helpers").StrNum | undefined;
7
+ $justifyContent?: import("@pushwoosh/kit-helpers/styled-helpers").JustifyContentValue | undefined;
8
+ } & {
9
+ $gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
10
+ $justifyItems?: import("@pushwoosh/kit-helpers/styled-helpers").ItemAlignmentValue | undefined;
11
+ $placeItems?: import("@pushwoosh/kit-helpers/styled-helpers").ItemAlignmentValue | undefined;
12
+ } & {
13
+ $gridAutoFlow: string;
14
+ } & {
15
+ $borderRadius: ShapeRadius;
16
+ $shrink: number;
17
+ }, "$gridAutoFlow" | "$borderRadius" | "$shrink">;
18
+ export declare const ClampText: import("styled-components").StyledComponent<"span", any, {
19
+ $color?: string | undefined;
20
+ $uppercase?: boolean | undefined;
21
+ $ellipsis?: boolean | undefined;
22
+ $variant?: import("@pushwoosh/kit-typography").TypographyVariant | undefined;
23
+ } & {
24
+ $clamp?: number;
25
+ }, never>;
@@ -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
@@ -34,6 +34,7 @@ export { Link, type LinkPropsWithoutAs, type LinkPropsWithAsTag, type LinkPropsW
34
34
  export { StatisticCard } from './StatisticCard';
35
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
@@ -34,6 +34,7 @@ export { Link } from './Link';
34
34
  export { StatisticCard } from './StatisticCard';
35
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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.1.221",
3
+ "version": "1.1.223",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",