@pushwoosh/smart-components-kit 1.0.89 → 1.0.90

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 (70) hide show
  1. package/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.js +50 -16
  2. package/CampaignsConfigurationDrawer/polyglot/index.d.ts +2 -0
  3. package/CampaignsConfigurationDrawer/polyglot/index.js +10 -0
  4. package/CampaignsConfigurationDrawer/polyglot/messages_en.d.ts +3 -0
  5. package/CampaignsConfigurationDrawer/polyglot/messages_en.js +18 -0
  6. package/CampaignsConfigurationDrawer/polyglot/messages_ru.d.ts +3 -0
  7. package/CampaignsConfigurationDrawer/polyglot/messages_ru.js +18 -0
  8. package/CampaignsConfigurationDrawer/polyglot/types.d.ts +19 -0
  9. package/CampaignsConfigurationDrawer/polyglot/types.js +1 -0
  10. package/DynamicContentPickerForm/DynamicContentCustomPickerForm.js +5 -1
  11. package/DynamicContentPickerForm/DynamicContentEventPickerForm.js +11 -3
  12. package/DynamicContentPickerForm/DynamicContentTagPickerForm.js +11 -3
  13. package/DynamicContentPickerForm/SimpleDynamicContentPickerFormSmart.js +8 -2
  14. package/DynamicContentPickerForm/VariedDynamicContentPickerFormSmart.js +28 -14
  15. package/DynamicContentPickerForm/polyglot/index.d.ts +2 -0
  16. package/DynamicContentPickerForm/polyglot/index.js +10 -0
  17. package/DynamicContentPickerForm/polyglot/messages_en.d.ts +3 -0
  18. package/DynamicContentPickerForm/polyglot/messages_en.js +16 -0
  19. package/DynamicContentPickerForm/polyglot/messages_ru.d.ts +3 -0
  20. package/DynamicContentPickerForm/polyglot/messages_ru.js +16 -0
  21. package/DynamicContentPickerForm/polyglot/types.d.ts +17 -0
  22. package/DynamicContentPickerForm/polyglot/types.js +1 -0
  23. package/EmailTemplatePreview/EmailTemplatePreview.js +5 -1
  24. package/EmailTemplatePreview/polyglot/index.d.ts +5 -0
  25. package/EmailTemplatePreview/polyglot/index.js +10 -0
  26. package/EmailTemplatePreview/polyglot/messages_en.d.ts +3 -0
  27. package/EmailTemplatePreview/polyglot/messages_en.js +3 -0
  28. package/EmailTemplatePreview/polyglot/messages_ru.d.ts +3 -0
  29. package/EmailTemplatePreview/polyglot/messages_ru.js +3 -0
  30. package/EmailTemplatePreview/polyglot/types.d.ts +4 -0
  31. package/EmailTemplatePreview/polyglot/types.js +1 -0
  32. package/ExportCSV/ExportCsvBanner/ExportCsvBanner.js +24 -8
  33. package/ExportCSV/polyglot/index.d.ts +2 -0
  34. package/ExportCSV/polyglot/index.js +10 -0
  35. package/ExportCSV/polyglot/messages_en.d.ts +3 -0
  36. package/ExportCSV/polyglot/messages_en.js +9 -0
  37. package/ExportCSV/polyglot/messages_ru.d.ts +3 -0
  38. package/ExportCSV/polyglot/messages_ru.js +9 -0
  39. package/ExportCSV/polyglot/types.d.ts +10 -0
  40. package/ExportCSV/polyglot/types.js +1 -0
  41. package/OpenActions/components/OpenActionsSummary/OpenActionsSummary.js +47 -3
  42. package/OpenActions/polyglot/index.d.ts +2 -0
  43. package/OpenActions/polyglot/index.js +10 -0
  44. package/OpenActions/polyglot/messages_en.d.ts +3 -0
  45. package/OpenActions/polyglot/messages_en.js +14 -0
  46. package/OpenActions/polyglot/messages_ru.d.ts +3 -0
  47. package/OpenActions/polyglot/messages_ru.js +14 -0
  48. package/OpenActions/polyglot/types.d.ts +18 -0
  49. package/OpenActions/polyglot/types.js +1 -0
  50. package/PlatformsConfigurationDrawer/components/DesktopPage/DesktopPage.js +29 -9
  51. package/PlatformsConfigurationDrawer/components/MainPage/MainPage.js +41 -13
  52. package/PlatformsConfigurationDrawer/components/MobilePage/MobilePage.js +35 -11
  53. package/PlatformsConfigurationDrawer/polyglot/index.d.ts +2 -0
  54. package/PlatformsConfigurationDrawer/polyglot/index.js +10 -0
  55. package/PlatformsConfigurationDrawer/polyglot/messages_en.d.ts +3 -0
  56. package/PlatformsConfigurationDrawer/polyglot/messages_en.js +24 -0
  57. package/PlatformsConfigurationDrawer/polyglot/messages_ru.d.ts +3 -0
  58. package/PlatformsConfigurationDrawer/polyglot/messages_ru.js +24 -0
  59. package/PlatformsConfigurationDrawer/polyglot/types.d.ts +25 -0
  60. package/PlatformsConfigurationDrawer/polyglot/types.js +1 -0
  61. package/ResendModal/ResendModal.js +23 -7
  62. package/ResendModal/polyglot/index.d.ts +2 -0
  63. package/ResendModal/polyglot/index.js +10 -0
  64. package/ResendModal/polyglot/messages_en.d.ts +3 -0
  65. package/ResendModal/polyglot/messages_en.js +9 -0
  66. package/ResendModal/polyglot/messages_ru.d.ts +3 -0
  67. package/ResendModal/polyglot/messages_ru.js +9 -0
  68. package/ResendModal/polyglot/types.d.ts +10 -0
  69. package/ResendModal/polyglot/types.js +1 -0
  70. package/package.json +1 -1
@@ -4,6 +4,7 @@ import { Columns, Horizontal, Vertical } from '@pushwoosh/kit-helpers';
4
4
  import { CloseIcon, EmailIcon, MobileIcon, PushIcon, SmsIcon, WhatsappIcon } from '@pushwoosh/kit-icons';
5
5
  import { H1, H3 } from '@pushwoosh/kit-typography';
6
6
  import { Card } from './components/Card';
7
+ import { useLang } from './polyglot';
7
8
  import { CloseButtonWrap } from './styled';
8
9
  export function CampaignsConfigurationDrawer(props) {
9
10
  const {
@@ -13,6 +14,7 @@ export function CampaignsConfigurationDrawer(props) {
13
14
  segmentTitle = '',
14
15
  onClose
15
16
  } = props;
17
+ const lang = useLang();
16
18
  return React.createElement(Drawer, {
17
19
  size: "medium",
18
20
  isOpen: isOpen,
@@ -21,7 +23,9 @@ export function CampaignsConfigurationDrawer(props) {
21
23
  "$justifyContent": "space-between",
22
24
  "$alignItems": "center",
23
25
  "$margin": "0 0 4px"
24
- }, React.createElement(H1, null, "Create campaign"), React.createElement(CloseButtonWrap, {
26
+ }, React.createElement(H1, null, lang({
27
+ message: 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.HEADING'
28
+ })), React.createElement(CloseButtonWrap, {
25
29
  onClick: onClose
26
30
  }, React.createElement(CloseIcon, {
27
31
  size: "medium"
@@ -30,43 +34,73 @@ export function CampaignsConfigurationDrawer(props) {
30
34
  }, React.createElement(Horizontal, {
31
35
  "$gap": "6px"
32
36
  }, React.createElement(Card, {
33
- title: "One-time push notification",
34
- description: "Select or create content, adjust notifications, and choose the best time to send.",
37
+ title: lang({
38
+ message: 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.ONE_TIME_PUSH.TITLE'
39
+ }),
40
+ description: lang({
41
+ message: 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.ONE_TIME_PUSH.DESC'
42
+ }),
35
43
  icon: PushIcon,
36
44
  href: `/applications/${applicationCode}/one-time-messages/send?type=push&segment=${segmentCode}`
37
45
  }), React.createElement(Card, {
38
- title: "One-time email",
39
- description: "Select content, set a subject, personalize sender info, and choose a send time.",
46
+ title: lang({
47
+ message: 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.ONE_TIME_EMAIL.TITLE'
48
+ }),
49
+ description: lang({
50
+ message: 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.ONE_TIME_EMAIL.DESC'
51
+ }),
40
52
  icon: EmailIcon,
41
53
  href: `/applications/${applicationCode}/one-time-messages/send?type=email&segment=${segmentCode}`
42
54
  })), React.createElement(Vertical, {
43
55
  "$gap": "8px"
44
- }, React.createElement(H3, null, "Advanced campaign based by channel"), React.createElement(Columns, {
56
+ }, React.createElement(H3, null, lang({
57
+ message: 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.ADVANCED_HEADING'
58
+ })), React.createElement(Columns, {
45
59
  "$sizes": "1fr 1fr",
46
60
  "$gap": "6px"
47
61
  }, React.createElement(Card, {
48
- title: "Push notification based",
49
- description: "Create a targeted campaign for users and plan follow-up for unopened messages.",
62
+ title: lang({
63
+ message: 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.PUSH.TITLE'
64
+ }),
65
+ description: lang({
66
+ message: 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.PUSH.DESC'
67
+ }),
50
68
  icon: PushIcon,
51
69
  href: `/journeys/${applicationCode}/create?channel=push&segment=${segmentCode}&segment_title=${segmentTitle}`
52
70
  }), React.createElement(Card, {
53
- title: "Email campaign",
54
- description: "Create tailored communication strategies with follow-ups based on user actions.",
71
+ title: lang({
72
+ message: 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.EMAIL.TITLE'
73
+ }),
74
+ description: lang({
75
+ message: 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.EMAIL.DESC'
76
+ }),
55
77
  icon: EmailIcon,
56
78
  href: `/journeys/${applicationCode}/create?channel=email&segment=${segmentCode}&segment_title=${segmentTitle}`
57
79
  }), React.createElement(Card, {
58
- title: "In-app campaign",
59
- description: "Display the banner to the intended users and monitor their subsequent actions.",
80
+ title: lang({
81
+ message: 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.INAPP.TITLE'
82
+ }),
83
+ description: lang({
84
+ message: 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.INAPP.DESC'
85
+ }),
60
86
  icon: MobileIcon,
61
87
  href: `/journeys/${applicationCode}/create?channel=inapp&segment=${segmentCode}&segment_title=${segmentTitle}`
62
88
  }), React.createElement(Card, {
63
- title: "SMS campaign",
64
- description: "Automate SMS delivery for quick, reliable messaging.",
89
+ title: lang({
90
+ message: 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.SMS.TITLE'
91
+ }),
92
+ description: lang({
93
+ message: 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.SMS.DESC'
94
+ }),
65
95
  icon: SmsIcon,
66
96
  href: `/journeys/${applicationCode}/create?channel=sms&segment=${segmentCode}&segment_title=${segmentTitle}`
67
97
  }), React.createElement(Card, {
68
- title: "WhatsApp campaign",
69
- description: "Engage your audience on WhatsApp with rich, personalized messages.",
98
+ title: lang({
99
+ message: 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.WHATSAPP.TITLE'
100
+ }),
101
+ description: lang({
102
+ message: 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.WHATSAPP.DESC'
103
+ }),
70
104
  icon: WhatsappIcon,
71
105
  href: `/journeys/${applicationCode}/create?channel=whatsapp&segment=${segmentCode}&segment_title=${segmentTitle}`
72
106
  }))))));
@@ -0,0 +1,2 @@
1
+ import { type CampaignsConfigurationDrawerMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("@pushwoosh/dumb-components/polyglot").LangProps<CampaignsConfigurationDrawerMessages>>, useLang: () => (props: import("@pushwoosh/dumb-components/polyglot").LangProps<CampaignsConfigurationDrawerMessages>) => string;
@@ -0,0 +1,10 @@
1
+ import { createLang } from '@pushwoosh/dumb-components/polyglot';
2
+ import { messages as en } from './messages_en';
3
+ import { messages as ru } from './messages_ru';
4
+ export const {
5
+ Lang,
6
+ useLang
7
+ } = createLang({
8
+ en,
9
+ ru
10
+ });
@@ -0,0 +1,3 @@
1
+ import type { LangMessages } from '@pushwoosh/dumb-components/polyglot';
2
+ import { type CampaignsConfigurationDrawerMessages } from './types';
3
+ export declare const messages: LangMessages<CampaignsConfigurationDrawerMessages>;
@@ -0,0 +1,18 @@
1
+ export const messages = {
2
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.HEADING': 'Create campaign',
3
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.ADVANCED_HEADING': 'Advanced campaign based by channel',
4
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.ONE_TIME_PUSH.TITLE': 'One-time push notification',
5
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.ONE_TIME_PUSH.DESC': 'Select or create content, adjust notifications, and choose the best time to send.',
6
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.ONE_TIME_EMAIL.TITLE': 'One-time email',
7
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.ONE_TIME_EMAIL.DESC': 'Select content, set a subject, personalize sender info, and choose a send time.',
8
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.PUSH.TITLE': 'Push notification based',
9
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.PUSH.DESC': 'Create a targeted campaign for users and plan follow-up for unopened messages.',
10
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.EMAIL.TITLE': 'Email campaign',
11
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.EMAIL.DESC': 'Create tailored communication strategies with follow-ups based on user actions.',
12
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.INAPP.TITLE': 'In-app campaign',
13
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.INAPP.DESC': 'Display the banner to the intended users and monitor their subsequent actions.',
14
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.SMS.TITLE': 'SMS campaign',
15
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.SMS.DESC': 'Automate SMS delivery for quick, reliable messaging.',
16
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.WHATSAPP.TITLE': 'WhatsApp campaign',
17
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.WHATSAPP.DESC': 'Engage your audience on WhatsApp with rich, personalized messages.'
18
+ };
@@ -0,0 +1,3 @@
1
+ import type { LangMessages } from '@pushwoosh/dumb-components/polyglot';
2
+ import { type CampaignsConfigurationDrawerMessages } from './types';
3
+ export declare const messages: LangMessages<CampaignsConfigurationDrawerMessages>;
@@ -0,0 +1,18 @@
1
+ export const messages = {
2
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.HEADING': 'Создать кампанию',
3
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.ADVANCED_HEADING': 'Расширенная кампания по каналу',
4
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.ONE_TIME_PUSH.TITLE': 'Разовое push-уведомление',
5
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.ONE_TIME_PUSH.DESC': 'Выберите или создайте контент, настройте уведомления и выберите лучшее время отправки.',
6
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.ONE_TIME_EMAIL.TITLE': 'Разовое письмо',
7
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.ONE_TIME_EMAIL.DESC': 'Выберите контент, задайте тему, настройте данные отправителя и выберите время отправки.',
8
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.PUSH.TITLE': 'На основе push-уведомлений',
9
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.PUSH.DESC': 'Создайте таргетированную кампанию и спланируйте дополнительные сообщения для тех, кто не открыл.',
10
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.EMAIL.TITLE': 'Email-кампания',
11
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.EMAIL.DESC': 'Создавайте индивидуальные коммуникационные стратегии с дополнительными сообщениями на основе действий пользователей.',
12
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.INAPP.TITLE': 'In-app кампания',
13
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.INAPP.DESC': 'Показывайте баннер нужным пользователям и отслеживайте их дальнейшие действия.',
14
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.SMS.TITLE': 'SMS-кампания',
15
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.SMS.DESC': 'Автоматизируйте отправку SMS для быстрых и надёжных сообщений.',
16
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.WHATSAPP.TITLE': 'WhatsApp-кампания',
17
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.WHATSAPP.DESC': 'Взаимодействуйте с аудиторией в WhatsApp с помощью насыщенных персонализированных сообщений.'
18
+ };
@@ -0,0 +1,19 @@
1
+ import type { NoParams } from '@pushwoosh/dumb-components/polyglot';
2
+ export type CampaignsConfigurationDrawerMessages = {
3
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.HEADING': NoParams;
4
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.ADVANCED_HEADING': NoParams;
5
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.ONE_TIME_PUSH.TITLE': NoParams;
6
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.ONE_TIME_PUSH.DESC': NoParams;
7
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.ONE_TIME_EMAIL.TITLE': NoParams;
8
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.ONE_TIME_EMAIL.DESC': NoParams;
9
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.PUSH.TITLE': NoParams;
10
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.PUSH.DESC': NoParams;
11
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.EMAIL.TITLE': NoParams;
12
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.EMAIL.DESC': NoParams;
13
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.INAPP.TITLE': NoParams;
14
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.INAPP.DESC': NoParams;
15
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.SMS.TITLE': NoParams;
16
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.SMS.DESC': NoParams;
17
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.WHATSAPP.TITLE': NoParams;
18
+ 'SMART.CAMPAIGNS_CONFIGURATION_DRAWER.CARD.WHATSAPP.DESC': NoParams;
19
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
2
  import { NativeTextarea } from '@pushwoosh/dumb-components';
3
3
  import { Vertical } from '@pushwoosh/kit-helpers';
4
+ import { useLang } from './polyglot';
4
5
  export const DynamicContentCustomPickerForm = ({
5
6
  dc,
6
7
  onChange
7
8
  }) => {
9
+ const lang = useLang();
8
10
  return React.createElement(Vertical, {
9
11
  "$gap": 16
10
12
  }, React.createElement(NativeTextarea, {
@@ -14,7 +16,9 @@ export const DynamicContentCustomPickerForm = ({
14
16
  text: e.target.value
15
17
  });
16
18
  },
17
- placeholder: "Enter custom text",
19
+ placeholder: lang({
20
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CUSTOM.PLACEHOLDER'
21
+ }),
18
22
  style: {
19
23
  minHeight: 200
20
24
  }
@@ -1,11 +1,13 @@
1
1
  import React from 'react';
2
2
  import { FieldBox, NativeInput, Select } from '@pushwoosh/dumb-components';
3
3
  import { Vertical } from '@pushwoosh/kit-helpers';
4
+ import { useLang } from './polyglot';
4
5
  export const DynamicContentEventPickerForm = ({
5
6
  dc,
6
7
  events,
7
8
  onChange
8
9
  }) => {
10
+ const lang = useLang();
9
11
  const currentEvent = events.find(tag => tag.name === dc.eventName) || {
10
12
  name: '',
11
13
  attributes: []
@@ -28,9 +30,13 @@ export const DynamicContentEventPickerForm = ({
28
30
  value: event.name,
29
31
  label: event.name
30
32
  })),
31
- placeholder: "Select an event"
33
+ placeholder: lang({
34
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.EVENT.PLACEHOLDER'
35
+ })
32
36
  }), React.createElement(FieldBox, {
33
- title: "Attribute"
37
+ title: lang({
38
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.ATTRIBUTE'
39
+ })
34
40
  }, React.createElement(Select, {
35
41
  value: {
36
42
  value: dc.attribute,
@@ -48,7 +54,9 @@ export const DynamicContentEventPickerForm = ({
48
54
  })),
49
55
  isDisabled: !currentEvent.name
50
56
  })), React.createElement(FieldBox, {
51
- title: "Fallback text",
57
+ title: lang({
58
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FALLBACK_TEXT'
59
+ }),
52
60
  isOptional: true
53
61
  }, React.createElement(NativeInput, {
54
62
  value: dc.defaultValue,
@@ -1,11 +1,13 @@
1
1
  import React from 'react';
2
2
  import { FieldBox, NativeInput, Select } from '@pushwoosh/dumb-components';
3
3
  import { Vertical } from '@pushwoosh/kit-helpers';
4
+ import { useLang } from './polyglot';
4
5
  export const DynamicContentTagPickerForm = ({
5
6
  dc,
6
7
  tags,
7
8
  onChange
8
9
  }) => {
10
+ const lang = useLang();
9
11
  const currentTag = tags.find(tag => tag.name === dc.tagName) || {
10
12
  name: '',
11
13
  modifiers: ['regular']
@@ -28,9 +30,13 @@ export const DynamicContentTagPickerForm = ({
28
30
  value: tag.name,
29
31
  label: tag.name
30
32
  })),
31
- placeholder: "Select a tag"
33
+ placeholder: lang({
34
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TAG.PLACEHOLDER'
35
+ })
32
36
  }), React.createElement(FieldBox, {
33
- title: "Modifier"
37
+ title: lang({
38
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.MODIFIER'
39
+ })
34
40
  }, React.createElement(Select, {
35
41
  value: {
36
42
  value: dc.modifier,
@@ -48,7 +54,9 @@ export const DynamicContentTagPickerForm = ({
48
54
  })),
49
55
  isDisabled: !currentTag.name
50
56
  })), React.createElement(FieldBox, {
51
- title: "Fallback text",
57
+ title: lang({
58
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FALLBACK_TEXT'
59
+ }),
52
60
  isOptional: true
53
61
  }, React.createElement(NativeInput, {
54
62
  value: dc.defaultValue,
@@ -2,6 +2,7 @@ import React, { useEffect } from 'react';
2
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
+ import { useLang } from './polyglot';
5
6
  import { SimpleTagPickerDiv } from './styled';
6
7
  const defaultDynamicContent = {
7
8
  tagName: '',
@@ -14,6 +15,7 @@ export const SimpleDynamicContentPickerFormSmart = ({
14
15
  update,
15
16
  children
16
17
  }) => {
18
+ const lang = useLang();
17
19
  const asyncResult = useDynamicContentTags();
18
20
  useEffect(() => {
19
21
  if (!asyncResult.loading) {
@@ -34,7 +36,9 @@ export const SimpleDynamicContentPickerFormSmart = ({
34
36
  modifiers: ['regular']
35
37
  };
36
38
  return React.createElement(SimpleTagPickerDiv, null, React.createElement(FieldBox, {
37
- title: "Tag"
39
+ title: lang({
40
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TAG'
41
+ })
38
42
  }, React.createElement(Vertical, {
39
43
  "$gap": 8
40
44
  }, React.createElement(Select, {
@@ -74,7 +78,9 @@ export const SimpleDynamicContentPickerFormSmart = ({
74
78
  })),
75
79
  isDisabled: !currentTag.name
76
80
  }))), React.createElement(FieldBox, {
77
- title: "Default Tag Value"
81
+ title: lang({
82
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.DEFAULT_TAG_VALUE'
83
+ })
78
84
  }, React.createElement(NativeInput, {
79
85
  value: dc.defaultValue,
80
86
  onChange: e => {
@@ -1,10 +1,11 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import React, { useEffect, useMemo, useState } from 'react';
2
2
  import { Button, FieldBox, Select, Spinner } from '@pushwoosh/dumb-components';
3
3
  import { Horizontal, Vertical } from '@pushwoosh/kit-helpers';
4
4
  import { DynamicContentCustomPickerForm } from './DynamicContentCustomPickerForm';
5
5
  import { DynamicContentEventPickerForm } from './DynamicContentEventPickerForm';
6
6
  import { DynamicContentTagPickerForm } from './DynamicContentTagPickerForm';
7
7
  import { useVariedDynamicContentTags } from './hooks';
8
+ import { useLang } from './polyglot';
8
9
  import { VariedTagPickerDiv } from './styled';
9
10
  import { createDefaultDynamicContent } from './utils';
10
11
  const defaultVariedDynamicContent = {
@@ -15,16 +16,6 @@ const defaultVariedDynamicContent = {
15
16
  defaultValue: ''
16
17
  }
17
18
  };
18
- const kindsOptions = [{
19
- value: 'tag',
20
- label: 'Tag'
21
- }, {
22
- value: 'event',
23
- label: 'Event'
24
- }, {
25
- value: 'customText',
26
- label: 'Custom Text'
27
- }];
28
19
  export const VariedDynamicContentPickerFormSmart = ({
29
20
  applicationCode,
30
21
  initialDc = defaultVariedDynamicContent,
@@ -33,8 +24,25 @@ export const VariedDynamicContentPickerFormSmart = ({
33
24
  update
34
25
  }) => {
35
26
  var _kindsOptions$find;
27
+ const lang = useLang();
36
28
  const [vdc, setVdc] = useState(initialDc);
37
29
  const asyncResult = useVariedDynamicContentTags(applicationCode);
30
+ const kindsOptions = useMemo(() => [{
31
+ value: 'tag',
32
+ label: lang({
33
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.TAG'
34
+ })
35
+ }, {
36
+ value: 'event',
37
+ label: lang({
38
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT'
39
+ })
40
+ }, {
41
+ value: 'customText',
42
+ label: lang({
43
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT'
44
+ })
45
+ }], [lang]);
38
46
  useEffect(() => {
39
47
  update();
40
48
  }, [asyncResult.loading, update]);
@@ -50,7 +58,9 @@ export const VariedDynamicContentPickerFormSmart = ({
50
58
  return React.createElement(VariedTagPickerDiv, null, React.createElement(Vertical, {
51
59
  "$gap": 8
52
60
  }, React.createElement(FieldBox, {
53
- title: "Variable Type"
61
+ title: lang({
62
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VARIABLE_TYPE'
63
+ })
54
64
  }, React.createElement(Vertical, {
55
65
  "$gap": 8
56
66
  }, React.createElement(Select, {
@@ -99,7 +109,9 @@ export const VariedDynamicContentPickerFormSmart = ({
99
109
  color: "secondary",
100
110
  size: "compact",
101
111
  onClick: onClose
102
- }, "Cancel"), React.createElement(Button, {
112
+ }, lang({
113
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL'
114
+ })), React.createElement(Button, {
103
115
  color: "primary",
104
116
  size: "compact",
105
117
  onClick: () => {
@@ -107,5 +119,7 @@ export const VariedDynamicContentPickerFormSmart = ({
107
119
  onClose();
108
120
  },
109
121
  isDisabled: !isValidDc
110
- }, "Apply")));
122
+ }, lang({
123
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY'
124
+ }))));
111
125
  };
@@ -0,0 +1,2 @@
1
+ import { type DynamicContentPickerFormMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("@pushwoosh/dumb-components/polyglot").LangProps<DynamicContentPickerFormMessages>>, useLang: () => (props: import("@pushwoosh/dumb-components/polyglot").LangProps<DynamicContentPickerFormMessages>) => string;
@@ -0,0 +1,10 @@
1
+ import { createLang } from '@pushwoosh/dumb-components/polyglot';
2
+ import { messages as en } from './messages_en';
3
+ import { messages as ru } from './messages_ru';
4
+ export const {
5
+ Lang,
6
+ useLang
7
+ } = createLang({
8
+ en,
9
+ ru
10
+ });
@@ -0,0 +1,3 @@
1
+ import type { LangMessages } from '@pushwoosh/dumb-components/polyglot';
2
+ import { type DynamicContentPickerFormMessages } from './types';
3
+ export declare const messages: LangMessages<DynamicContentPickerFormMessages>;
@@ -0,0 +1,16 @@
1
+ export const messages = {
2
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CUSTOM.PLACEHOLDER': 'Enter custom text',
3
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.EVENT.PLACEHOLDER': 'Select an event',
4
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TAG.PLACEHOLDER': 'Select a tag',
5
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TAG': 'Tag',
6
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.ATTRIBUTE': 'Attribute',
7
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.MODIFIER': 'Modifier',
8
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FALLBACK_TEXT': 'Fallback text',
9
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.DEFAULT_TAG_VALUE': 'Default Tag Value',
10
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VARIABLE_TYPE': 'Variable Type',
11
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.TAG': 'Tag',
12
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': 'Event',
13
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': 'Custom Text',
14
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': 'Cancel',
15
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'Apply'
16
+ };
@@ -0,0 +1,3 @@
1
+ import type { LangMessages } from '@pushwoosh/dumb-components/polyglot';
2
+ import { type DynamicContentPickerFormMessages } from './types';
3
+ export declare const messages: LangMessages<DynamicContentPickerFormMessages>;
@@ -0,0 +1,16 @@
1
+ export const messages = {
2
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CUSTOM.PLACEHOLDER': 'Введите произвольный текст',
3
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.EVENT.PLACEHOLDER': 'Выберите событие',
4
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TAG.PLACEHOLDER': 'Выберите тег',
5
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TAG': 'Тег',
6
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.ATTRIBUTE': 'Атрибут',
7
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.MODIFIER': 'Модификатор',
8
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FALLBACK_TEXT': 'Запасной текст',
9
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.DEFAULT_TAG_VALUE': 'Значение тега по умолчанию',
10
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VARIABLE_TYPE': 'Тип переменной',
11
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.TAG': 'Тег',
12
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': 'Событие',
13
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': 'Произвольный текст',
14
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': 'Отмена',
15
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'Применить'
16
+ };
@@ -0,0 +1,17 @@
1
+ import type { NoParams } from '@pushwoosh/dumb-components/polyglot';
2
+ export type DynamicContentPickerFormMessages = {
3
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CUSTOM.PLACEHOLDER': NoParams;
4
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.EVENT.PLACEHOLDER': NoParams;
5
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TAG.PLACEHOLDER': NoParams;
6
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TAG': NoParams;
7
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.ATTRIBUTE': NoParams;
8
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.MODIFIER': NoParams;
9
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FALLBACK_TEXT': NoParams;
10
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.DEFAULT_TAG_VALUE': NoParams;
11
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VARIABLE_TYPE': NoParams;
12
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.TAG': NoParams;
13
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': NoParams;
14
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': NoParams;
15
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': NoParams;
16
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': NoParams;
17
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -2,12 +2,14 @@ import React from 'react';
2
2
  import { EmailTemplatePreview as DumbPreview, RectangularSkeleton } from '@pushwoosh/dumb-components';
3
3
  import { useAsync } from '@pushwoosh/kit-helpers';
4
4
  import { useSPAContext } from '@pushwoosh/spa-context';
5
+ import { useLang } from './polyglot';
5
6
  export const EmailTemplatePreview = ({
6
7
  code,
7
8
  width,
8
9
  height,
9
10
  scale
10
11
  }) => {
12
+ const lang = useLang();
11
13
  const {
12
14
  rpcGateway
13
15
  } = useSPAContext();
@@ -37,7 +39,9 @@ export const EmailTemplatePreview = ({
37
39
  });
38
40
  }
39
41
  if (res.error) {
40
- return React.createElement("div", null, "No preview");
42
+ return React.createElement("div", null, lang({
43
+ message: 'SMART.EMAIL_TEMPLATE_PREVIEW.NO_PREVIEW'
44
+ }));
41
45
  }
42
46
  return React.createElement(DumbPreview, {
43
47
  template: res.value.template,
@@ -0,0 +1,5 @@
1
+ export declare const Lang: import("react").FC<{
2
+ message: "SMART.EMAIL_TEMPLATE_PREVIEW.NO_PREVIEW";
3
+ } & import("@pushwoosh/dumb-components/polyglot").NoParams>, useLang: () => (props: {
4
+ message: "SMART.EMAIL_TEMPLATE_PREVIEW.NO_PREVIEW";
5
+ } & import("@pushwoosh/dumb-components/polyglot").NoParams) => string;
@@ -0,0 +1,10 @@
1
+ import { createLang } from '@pushwoosh/dumb-components/polyglot';
2
+ import { messages as en } from './messages_en';
3
+ import { messages as ru } from './messages_ru';
4
+ export const {
5
+ Lang,
6
+ useLang
7
+ } = createLang({
8
+ en,
9
+ ru
10
+ });
@@ -0,0 +1,3 @@
1
+ import type { LangMessages } from '@pushwoosh/dumb-components/polyglot';
2
+ import { type EmailTemplatePreviewMessages } from './types';
3
+ export declare const messages: LangMessages<EmailTemplatePreviewMessages>;
@@ -0,0 +1,3 @@
1
+ export const messages = {
2
+ 'SMART.EMAIL_TEMPLATE_PREVIEW.NO_PREVIEW': 'No preview'
3
+ };
@@ -0,0 +1,3 @@
1
+ import type { LangMessages } from '@pushwoosh/dumb-components/polyglot';
2
+ import { type EmailTemplatePreviewMessages } from './types';
3
+ export declare const messages: LangMessages<EmailTemplatePreviewMessages>;
@@ -0,0 +1,3 @@
1
+ export const messages = {
2
+ 'SMART.EMAIL_TEMPLATE_PREVIEW.NO_PREVIEW': 'Нет превью'
3
+ };
@@ -0,0 +1,4 @@
1
+ import type { NoParams } from '@pushwoosh/dumb-components/polyglot';
2
+ export type EmailTemplatePreviewMessages = {
3
+ 'SMART.EMAIL_TEMPLATE_PREVIEW.NO_PREVIEW': NoParams;
4
+ };
@@ -0,0 +1 @@
1
+ export {};