@pushwoosh/dumb-components 1.0.73 → 1.0.75
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/PushPreview/PushPreview.js +7 -10
- package/PushPreview/components/MissedContentPreview/MissedContentPreview.d.ts +2 -0
- package/PushPreview/components/{NoPushPreview/NoPushPreview.js → MissedContentPreview/MissedContentPreview.js} +6 -2
- package/PushPreview/components/MissedContentPreview/index.d.ts +1 -0
- package/PushPreview/components/MissedContentPreview/index.js +1 -0
- package/PushPreview/types.d.ts +1 -1
- package/RichMessageEditor/RichMessageEditor.js +2 -2
- package/RichMessageEditor/RichMessageEditor.styled.d.ts +1 -0
- package/RichMessageEditor/RichMessageEditor.styled.js +5 -1
- package/package.json +1 -1
- package/PushPreview/components/NoPushPreview/NoPushPreview.d.ts +0 -2
- package/PushPreview/components/NoPushPreview/index.d.ts +0 -1
- package/PushPreview/components/NoPushPreview/index.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Vertical } from '@pushwoosh/kit-helpers';
|
|
3
|
-
import {
|
|
3
|
+
import { MissedContentPreview } from './components/MissedContentPreview';
|
|
4
4
|
import { SilentPushPreview } from './components/SilentPushPreview';
|
|
5
5
|
import { PREVIEW_ICON_URL } from './constants';
|
|
6
6
|
import { getLocalizedContent } from './helpers';
|
|
@@ -18,7 +18,6 @@ export function PushPreview({
|
|
|
18
18
|
const title = getLocalizedContent((pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.title) || (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.localizedTitle), language) || appTitle;
|
|
19
19
|
const content = getLocalizedContent((pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.content) || (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.localizedContent), language);
|
|
20
20
|
const icon = (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.icon) || appIcon || PREVIEW_ICON_URL;
|
|
21
|
-
const isLocked = !pushPreset || !content || view === 'silent';
|
|
22
21
|
if (isLoading) {
|
|
23
22
|
return React.createElement(PushBox, {
|
|
24
23
|
view: view,
|
|
@@ -28,8 +27,8 @@ export function PushPreview({
|
|
|
28
27
|
if (view === 'silent') {
|
|
29
28
|
return React.createElement(SilentPushPreview, null);
|
|
30
29
|
}
|
|
31
|
-
if (
|
|
32
|
-
return React.createElement(
|
|
30
|
+
if (view === 'missed-content') {
|
|
31
|
+
return React.createElement(MissedContentPreview, null);
|
|
33
32
|
}
|
|
34
33
|
return React.createElement(PushBox, {
|
|
35
34
|
view: view,
|
|
@@ -38,16 +37,14 @@ export function PushPreview({
|
|
|
38
37
|
}, React.createElement(PushIcon, {
|
|
39
38
|
alt: title,
|
|
40
39
|
src: icon
|
|
41
|
-
}), React.createElement(Vertical, null, React.createElement(PushTitle, {
|
|
42
|
-
locked: isLocked
|
|
43
|
-
}, React.createElement(RichMessageViewer, {
|
|
40
|
+
}), React.createElement(Vertical, null, React.createElement(PushTitle, null, React.createElement(RichMessageViewer, {
|
|
44
41
|
value: title,
|
|
45
42
|
flat: true
|
|
46
43
|
})), React.createElement(PushDescription, {
|
|
47
44
|
view: view,
|
|
48
|
-
locked: !content
|
|
49
|
-
},
|
|
45
|
+
locked: !pushPreset || !content
|
|
46
|
+
}, content && React.createElement(RichMessageViewer, {
|
|
50
47
|
flat: view === 'compact',
|
|
51
48
|
value: content
|
|
52
|
-
}))));
|
|
49
|
+
}), !content && view === 'empty' && 'Select existing or create a new content…', !content && view !== 'empty' && 'Message is empty…')));
|
|
53
50
|
}
|
|
@@ -3,11 +3,15 @@ import { Color } from '@pushwoosh/kit-constants';
|
|
|
3
3
|
import { Vertical } from '@pushwoosh/kit-helpers';
|
|
4
4
|
import { CloseIcon } from '@pushwoosh/kit-icons';
|
|
5
5
|
import { PushBox, IconContainer, PushTitle, PushDescription } from '../../styles';
|
|
6
|
-
export function
|
|
6
|
+
export function MissedContentPreview() {
|
|
7
7
|
return React.createElement(PushBox, {
|
|
8
8
|
view: "compact"
|
|
9
9
|
}, React.createElement(IconContainer, null, React.createElement(CloseIcon, {
|
|
10
10
|
size: "small",
|
|
11
11
|
color: Color.CLEAR
|
|
12
|
-
})), React.createElement(Vertical, null, React.createElement(PushTitle,
|
|
12
|
+
})), React.createElement(Vertical, null, React.createElement(PushTitle, {
|
|
13
|
+
locked: true
|
|
14
|
+
}, "Content missed"), React.createElement(PushDescription, {
|
|
15
|
+
locked: true
|
|
16
|
+
}, "Might be old data or deleted presets")));
|
|
13
17
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MissedContentPreview } from './MissedContentPreview';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MissedContentPreview } from './MissedContentPreview';
|
package/PushPreview/types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { FieldBox } from '../FieldBox';
|
|
|
7
7
|
import EmojiIcon from './assets/EmojiIcon.svg';
|
|
8
8
|
import PersonalizationIcon from './assets/PersonalizationIcon.svg';
|
|
9
9
|
import { EmojiPicker } from './EmojiPicker';
|
|
10
|
-
import { ImSpan } from './RichMessageEditor.styled';
|
|
10
|
+
import { DropArea, ImSpan } from './RichMessageEditor.styled';
|
|
11
11
|
import { getDcByPath } from './slate/helpers';
|
|
12
12
|
import { SlateEditable, SlateEditor } from './slate/SlateEditor';
|
|
13
13
|
export const RichMessageEditor = ({
|
|
@@ -114,7 +114,7 @@ export const RichMessageEditor = ({
|
|
|
114
114
|
onDelete: () => {
|
|
115
115
|
setShowDrop(undefined);
|
|
116
116
|
}
|
|
117
|
-
}), showDrop && React.createElement(
|
|
117
|
+
}), showDrop && React.createElement(DropArea, {
|
|
118
118
|
style: floatingStyles,
|
|
119
119
|
ref: refs.setFloating,
|
|
120
120
|
key: showDrop.type
|
|
@@ -3,4 +3,8 @@ import { Color } from '@pushwoosh/kit-constants';
|
|
|
3
3
|
export const ImSpan = styled.span.withConfig({
|
|
4
4
|
displayName: "ImSpan",
|
|
5
5
|
componentId: "sc-kdvgj9-0"
|
|
6
|
-
})(["color:", ";position:relative;padding-left:20px;font-size:12px;font-style:normal;font-weight:500;line-height:130%;text-transform:uppercase;cursor:pointer;> svg{position:absolute;left:0;top:-1px;}"], Color.SOFT);
|
|
6
|
+
})(["color:", ";position:relative;padding-left:20px;font-size:12px;font-style:normal;font-weight:500;line-height:130%;text-transform:uppercase;cursor:pointer;> svg{position:absolute;left:0;top:-1px;}"], Color.SOFT);
|
|
7
|
+
export const DropArea = styled.div.withConfig({
|
|
8
|
+
displayName: "DropArea",
|
|
9
|
+
componentId: "sc-kdvgj9-1"
|
|
10
|
+
})(["z-index:1000;"]);
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { NoPushPreview } from './NoPushPreview';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { NoPushPreview } from './NoPushPreview';
|