@pushwoosh/websdk-common 6.22.5 → 6.23.0
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/inbox/InboxCellPreview.js +8 -3
- package/inbox/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -239,6 +239,7 @@ function IOSCell(props) {
|
|
|
239
239
|
content,
|
|
240
240
|
layout,
|
|
241
241
|
isEmpty,
|
|
242
|
+
isIconPending,
|
|
242
243
|
title,
|
|
243
244
|
body,
|
|
244
245
|
dateLabel,
|
|
@@ -299,7 +300,7 @@ function IOSCell(props) {
|
|
|
299
300
|
},
|
|
300
301
|
children: [unread && _jsx(UnreadDot, {}), _jsx(Avatar, {
|
|
301
302
|
content: content,
|
|
302
|
-
isEmpty: isEmpty,
|
|
303
|
+
isEmpty: isEmpty || isIconPending,
|
|
303
304
|
platform: "ios"
|
|
304
305
|
}), texts]
|
|
305
306
|
});
|
|
@@ -359,6 +360,7 @@ function AndroidCell(props) {
|
|
|
359
360
|
content,
|
|
360
361
|
layout,
|
|
361
362
|
isEmpty,
|
|
363
|
+
isIconPending,
|
|
362
364
|
title,
|
|
363
365
|
body,
|
|
364
366
|
dateLabel,
|
|
@@ -413,7 +415,7 @@ function AndroidCell(props) {
|
|
|
413
415
|
},
|
|
414
416
|
children: [_jsx(Avatar, {
|
|
415
417
|
content: content,
|
|
416
|
-
isEmpty: isEmpty,
|
|
418
|
+
isEmpty: isEmpty || isIconPending,
|
|
417
419
|
platform: "android"
|
|
418
420
|
}), texts]
|
|
419
421
|
})
|
|
@@ -440,6 +442,7 @@ export function InboxCellPreview(props) {
|
|
|
440
442
|
emptyTitle = 'Message preview',
|
|
441
443
|
emptyDescription = 'Enter text of your inbox message to see the preview',
|
|
442
444
|
renderText = text => text,
|
|
445
|
+
iconPlaceholder = false,
|
|
443
446
|
width = '100%'
|
|
444
447
|
} = props;
|
|
445
448
|
const frame = {
|
|
@@ -462,6 +465,7 @@ export function InboxCellPreview(props) {
|
|
|
462
465
|
}
|
|
463
466
|
const picked = content || {};
|
|
464
467
|
const isEmpty = isInboxContentEmpty(picked);
|
|
468
|
+
const isIconPending = iconPlaceholder && !picked.iconUrl;
|
|
465
469
|
const requested = picked.layoutType;
|
|
466
470
|
let layout = 'classic';
|
|
467
471
|
if (INBOX_KNOWN_LAYOUTS.includes(requested)) {
|
|
@@ -490,7 +494,7 @@ export function InboxCellPreview(props) {
|
|
|
490
494
|
isActionPerformed: !unread,
|
|
491
495
|
isRead: !unread,
|
|
492
496
|
layout: layout,
|
|
493
|
-
placeholder: isEmpty || layout
|
|
497
|
+
placeholder: isEmpty || (layout === 'classic' ? isIconPending : !hasMedia(picked, layout)),
|
|
494
498
|
timeLabel: formatInboxMessageTime(sendDate || new Date().toISOString()),
|
|
495
499
|
title: isEmpty ? emptyTitle : picked.title
|
|
496
500
|
})
|
|
@@ -509,6 +513,7 @@ export function InboxCellPreview(props) {
|
|
|
509
513
|
content: picked,
|
|
510
514
|
dateLabel: dateLabel,
|
|
511
515
|
isEmpty: isEmpty,
|
|
516
|
+
isIconPending: isIconPending,
|
|
512
517
|
layout: layout,
|
|
513
518
|
title: isEmpty ? emptyTitle : renderText(texts.title),
|
|
514
519
|
unread: unread
|
package/inbox/types.d.ts
CHANGED
|
@@ -121,6 +121,8 @@ export interface InboxCellPreviewProps {
|
|
|
121
121
|
renderText?: (text: string) => ReactNode;
|
|
122
122
|
/** Appearance of the web cell. */
|
|
123
123
|
appearance?: Partial<InboxWidgetAppearance>;
|
|
124
|
+
/** Keep the icon placeholder instead of the title's initial while the cell has no icon, as an editor does (default `false`). */
|
|
125
|
+
iconPlaceholder?: boolean;
|
|
124
126
|
/** CSS width of the preview (default `100%`). */
|
|
125
127
|
width?: string | number;
|
|
126
128
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pushwoosh/websdk-common",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.23.0",
|
|
4
4
|
"description": "Code shared by the Pushwoosh WebSDK and the Control Panel, one entry point per module (web-popups: web popup model and renderer; subscription-widget: push subscription widget model and renderer; inbox: web inbox widget and inbox cell previews)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|