@pushwoosh/smart-components-kit 1.0.14 → 1.0.16
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/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.js +4 -4
- package/DynamicContentPicker/DynamicContentPicker.d.ts +1 -0
- package/DynamicContentPicker/DynamicContentPicker.js +37 -21
- package/RichMessageEditorSmart/NewDynamicContentForm.d.ts +5 -2
- package/RichMessageEditorSmart/NewDynamicContentForm.js +3 -1
- package/RichMessageEditorSmart/RichMessageEditorSmart.js +5 -2
- package/package.json +4 -4
|
@@ -49,22 +49,22 @@ export function CampaignsConfigurationDrawer(props) {
|
|
|
49
49
|
icon: PushIcon,
|
|
50
50
|
href: `/journeys/${applicationCode}/create?channel=push&segment=${segmentCode}`
|
|
51
51
|
}), React.createElement(Card, {
|
|
52
|
-
title: "Email
|
|
52
|
+
title: "Email campaign",
|
|
53
53
|
description: "Create tailored communication strategies with follow-ups based on user actions.",
|
|
54
54
|
icon: EmailIcon,
|
|
55
55
|
href: `/journeys/${applicationCode}/create?channel=email&segment=${segmentCode}`
|
|
56
56
|
}), React.createElement(Card, {
|
|
57
|
-
title: "In-app
|
|
57
|
+
title: "In-app campaign",
|
|
58
58
|
description: "Display the banner to the intended users and monitor their subsequent actions.",
|
|
59
59
|
icon: MobileIcon,
|
|
60
60
|
href: `/journeys/${applicationCode}/create?channel=inapp&segment=${segmentCode}`
|
|
61
61
|
}), React.createElement(Card, {
|
|
62
|
-
title: "SMS
|
|
62
|
+
title: "SMS campaign",
|
|
63
63
|
description: "Automate SMS delivery for quick, reliable messaging.",
|
|
64
64
|
icon: SmsIcon,
|
|
65
65
|
href: `/journeys/${applicationCode}/create?channel=sms&segment=${segmentCode}`
|
|
66
66
|
}), React.createElement(Card, {
|
|
67
|
-
title: "WhatsApp
|
|
67
|
+
title: "WhatsApp campaign",
|
|
68
68
|
description: "Engage your audience on WhatsApp with rich, personalized messages.",
|
|
69
69
|
icon: WhatsappIcon,
|
|
70
70
|
href: `/journeys/${applicationCode}/create?channel=whatsapp&segment=${segmentCode}`
|
|
@@ -3,6 +3,7 @@ import { type DynamicContent } from '@pushwoosh/dumb-components/RichMessageEdito
|
|
|
3
3
|
type DynamicContentFormProps = {
|
|
4
4
|
dc?: DynamicContent;
|
|
5
5
|
onChange: (dc: DynamicContent) => void;
|
|
6
|
+
update?: () => void;
|
|
6
7
|
};
|
|
7
8
|
export declare const DynamicContentPicker: FC<PropsWithChildren<DynamicContentFormProps>>;
|
|
8
9
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FieldBox, NativeInput,
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { FieldBox, NativeInput, Select, Spinner } from '@pushwoosh/dumb-components';
|
|
3
3
|
import { Horizontal, Vertical } from '@pushwoosh/kit-helpers';
|
|
4
4
|
import { useDynamicContentTags } from './hooks';
|
|
5
5
|
import { TagPickerDiv } from './styled';
|
|
@@ -11,9 +11,15 @@ const defaultDynamicContent = {
|
|
|
11
11
|
export const DynamicContentPicker = ({
|
|
12
12
|
dc = defaultDynamicContent,
|
|
13
13
|
onChange,
|
|
14
|
+
update,
|
|
14
15
|
children
|
|
15
16
|
}) => {
|
|
16
17
|
const asyncResult = useDynamicContentTags();
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (!asyncResult.loading) {
|
|
20
|
+
update === null || update === void 0 || update();
|
|
21
|
+
}
|
|
22
|
+
}, [asyncResult.loading, update]);
|
|
17
23
|
if (asyncResult.loading) {
|
|
18
24
|
return React.createElement(TagPickerDiv, null, React.createElement(Horizontal, {
|
|
19
25
|
"$placeItems": "center",
|
|
@@ -31,33 +37,43 @@ export const DynamicContentPicker = ({
|
|
|
31
37
|
title: "Tag"
|
|
32
38
|
}, React.createElement(Vertical, {
|
|
33
39
|
"$gap": 8
|
|
34
|
-
}, React.createElement(
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
}, React.createElement(Select, {
|
|
41
|
+
width: "auto",
|
|
42
|
+
menuPlacement: "auto",
|
|
43
|
+
value: {
|
|
44
|
+
value: dc.tagName,
|
|
45
|
+
label: dc.tagName
|
|
46
|
+
},
|
|
47
|
+
onChange: option => {
|
|
37
48
|
onChange({
|
|
38
|
-
tagName:
|
|
49
|
+
tagName: option.value,
|
|
39
50
|
modifier: currentTag.modifiers[0],
|
|
40
51
|
defaultValue: ''
|
|
41
52
|
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
},
|
|
54
|
+
options: tags.map(tag => ({
|
|
55
|
+
value: tag.name,
|
|
56
|
+
label: tag.name
|
|
57
|
+
}))
|
|
58
|
+
}), React.createElement(Select, {
|
|
59
|
+
width: "auto",
|
|
60
|
+
menuPlacement: "auto",
|
|
61
|
+
value: {
|
|
62
|
+
value: dc.modifier,
|
|
63
|
+
label: dc.modifier
|
|
64
|
+
},
|
|
65
|
+
onChange: option => {
|
|
51
66
|
onChange({
|
|
52
67
|
...dc,
|
|
53
|
-
modifier:
|
|
68
|
+
modifier: option.value
|
|
54
69
|
});
|
|
55
70
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
71
|
+
options: currentTag.modifiers.map(modifier => ({
|
|
72
|
+
value: modifier,
|
|
73
|
+
label: modifier
|
|
74
|
+
})),
|
|
75
|
+
isDisabled: !currentTag.name
|
|
76
|
+
}))), React.createElement(FieldBox, {
|
|
61
77
|
title: "Default Tag Value"
|
|
62
78
|
}, React.createElement(NativeInput, {
|
|
63
79
|
value: dc.defaultValue,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
2
|
import { type DynamicContent } from '@pushwoosh/dumb-components/RichMessageEditor/slate/types';
|
|
3
|
-
|
|
3
|
+
type NewDynamicContentFormProps = {
|
|
4
|
+
update?: () => void;
|
|
4
5
|
onSubmit: (dc: DynamicContent) => void;
|
|
5
|
-
}
|
|
6
|
+
};
|
|
7
|
+
export declare const NewDynamicContentForm: FC<NewDynamicContentFormProps>;
|
|
8
|
+
export {};
|
|
@@ -3,12 +3,14 @@ import { Button } from '@pushwoosh/dumb-components';
|
|
|
3
3
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
4
4
|
import { DynamicContentPicker } from '../DynamicContentPicker';
|
|
5
5
|
export const NewDynamicContentForm = ({
|
|
6
|
+
update,
|
|
6
7
|
onSubmit
|
|
7
8
|
}) => {
|
|
8
9
|
const [dc, setDc] = useState();
|
|
9
10
|
return React.createElement(DynamicContentPicker, {
|
|
10
11
|
dc: dc,
|
|
11
|
-
onChange: setDc
|
|
12
|
+
onChange: setDc,
|
|
13
|
+
update: update
|
|
12
14
|
}, React.createElement(Horizontal, {
|
|
13
15
|
"$justifyContent": "end"
|
|
14
16
|
}, React.createElement(Button, {
|
|
@@ -7,11 +7,14 @@ export const RichMessageEditorSmart = props => {
|
|
|
7
7
|
...props,
|
|
8
8
|
renderDynamicContent: ({
|
|
9
9
|
dc,
|
|
10
|
-
onChange
|
|
10
|
+
onChange,
|
|
11
|
+
update
|
|
11
12
|
}) => dc ? React.createElement(DynamicContentPicker, {
|
|
12
13
|
dc: dc,
|
|
13
|
-
onChange: onChange
|
|
14
|
+
onChange: onChange,
|
|
15
|
+
update: update
|
|
14
16
|
}) : React.createElement(NewDynamicContentForm, {
|
|
17
|
+
update: update,
|
|
15
18
|
onSubmit: onChange
|
|
16
19
|
})
|
|
17
20
|
});
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"pre-commit": "check",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@emoji-mart/react": "^1.1.1",
|
|
20
|
-
"@pushwoosh/dumb-components": "^1.0.
|
|
20
|
+
"@pushwoosh/dumb-components": "^1.0.64",
|
|
21
21
|
"@pushwoosh/kit-constants": "^1.6.9",
|
|
22
22
|
"@pushwoosh/kit-helpers": "^4.8.1",
|
|
23
23
|
"@pushwoosh/kit-icons": "^2.1.2",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@pushwoosh/frontend-builder-engine": "^1.0.17",
|
|
28
28
|
"@pushwoosh/grpc-bridge": "^1.5.36",
|
|
29
|
-
"@pushwoosh/http-client": "^2.
|
|
29
|
+
"@pushwoosh/http-client": "^2.5.0",
|
|
30
30
|
"@pushwoosh/session-store": "^2.5.0",
|
|
31
31
|
"@types/react": "^18.3.5",
|
|
32
32
|
"@types/react-dom": "^18.3.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@pushwoosh/grpc-bridge": "^1.5.36",
|
|
43
|
-
"@pushwoosh/http-client": "^2.
|
|
43
|
+
"@pushwoosh/http-client": "^2.5.0",
|
|
44
44
|
"@pushwoosh/rpc-v2-http-api-data": "^0.1.466",
|
|
45
45
|
"@pushwoosh/session-store": "^2.5.0",
|
|
46
46
|
"react": "^16.14.0 || ^18.0.0",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"engines": {
|
|
50
50
|
"node": ">= 18"
|
|
51
51
|
},
|
|
52
|
-
"version": "1.0.
|
|
52
|
+
"version": "1.0.16"
|
|
53
53
|
}
|