@pushwoosh/dumb-components 1.1.133 → 1.1.135

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 (139) hide show
  1. package/AccessForbidden/AccessForbidden.js +10 -2
  2. package/AccessForbidden/polyglot/index.d.ts +2 -0
  3. package/AccessForbidden/polyglot/index.js +10 -0
  4. package/AccessForbidden/polyglot/messages_en.d.ts +3 -0
  5. package/AccessForbidden/polyglot/messages_en.js +4 -0
  6. package/AccessForbidden/polyglot/messages_ru.d.ts +3 -0
  7. package/AccessForbidden/polyglot/messages_ru.js +4 -0
  8. package/AccessForbidden/polyglot/types.d.ts +5 -0
  9. package/AccessForbidden/polyglot/types.js +1 -0
  10. package/Calendar/CalendarDropdown/CalendarDropdown.js +15 -3
  11. package/Calendar/CalendarSuperForm/components/CalendarTimeAndTimezoneSection/CalendarTimeAndTimezoneSection.js +14 -4
  12. package/Calendar/polyglot/index.d.ts +2 -0
  13. package/Calendar/polyglot/index.js +10 -0
  14. package/Calendar/polyglot/messages_en.d.ts +3 -0
  15. package/Calendar/polyglot/messages_en.js +11 -0
  16. package/Calendar/polyglot/messages_ru.d.ts +3 -0
  17. package/Calendar/polyglot/messages_ru.js +11 -0
  18. package/Calendar/polyglot/types.d.ts +14 -0
  19. package/Calendar/polyglot/types.js +1 -0
  20. package/CrashScreen/CrashScreen.js +6 -1
  21. package/CrashScreen/polyglot/index.d.ts +2 -0
  22. package/CrashScreen/polyglot/index.js +10 -0
  23. package/CrashScreen/polyglot/messages_en.d.ts +3 -0
  24. package/CrashScreen/polyglot/messages_en.js +4 -0
  25. package/CrashScreen/polyglot/messages_ru.d.ts +3 -0
  26. package/CrashScreen/polyglot/messages_ru.js +4 -0
  27. package/CrashScreen/polyglot/types.d.ts +5 -0
  28. package/CrashScreen/polyglot/types.js +1 -0
  29. package/DateTimePicker/components/DatePickerField/DatePickerField.js +4 -1
  30. package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +4 -1
  31. package/DateTimePicker/components/Month/Month.js +16 -1
  32. package/DateTimePicker/polyglot/index.d.ts +2 -0
  33. package/DateTimePicker/polyglot/index.js +9 -0
  34. package/DateTimePicker/polyglot/messages_en.d.ts +3 -0
  35. package/DateTimePicker/polyglot/messages_en.js +11 -0
  36. package/DateTimePicker/polyglot/messages_ru.d.ts +3 -0
  37. package/DateTimePicker/polyglot/messages_ru.js +11 -0
  38. package/DateTimePicker/polyglot/types.d.ts +12 -0
  39. package/DateTimePicker/polyglot/types.js +1 -0
  40. package/Drawer/components/DrawerDocs/DrawerDocs.js +9 -3
  41. package/Drawer/polyglot/index.d.ts +2 -0
  42. package/Drawer/polyglot/index.js +10 -0
  43. package/Drawer/polyglot/messages_en.d.ts +3 -0
  44. package/Drawer/polyglot/messages_en.js +4 -0
  45. package/Drawer/polyglot/messages_ru.d.ts +3 -0
  46. package/Drawer/polyglot/messages_ru.js +4 -0
  47. package/Drawer/polyglot/types.d.ts +5 -0
  48. package/Drawer/polyglot/types.js +1 -0
  49. package/EditableField/EditableField.js +7 -2
  50. package/EditableField/polyglot/index.d.ts +2 -0
  51. package/EditableField/polyglot/index.js +9 -0
  52. package/EditableField/polyglot/messages_en.d.ts +3 -0
  53. package/EditableField/polyglot/messages_en.js +4 -0
  54. package/EditableField/polyglot/messages_ru.d.ts +3 -0
  55. package/EditableField/polyglot/messages_ru.js +4 -0
  56. package/EditableField/polyglot/types.d.ts +5 -0
  57. package/EditableField/polyglot/types.js +1 -0
  58. package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +11 -3
  59. package/EmailTemplatePreview/polyglot/index.d.ts +2 -0
  60. package/EmailTemplatePreview/polyglot/index.js +10 -0
  61. package/EmailTemplatePreview/polyglot/messages_en.d.ts +3 -0
  62. package/EmailTemplatePreview/polyglot/messages_en.js +5 -0
  63. package/EmailTemplatePreview/polyglot/messages_ru.d.ts +3 -0
  64. package/EmailTemplatePreview/polyglot/messages_ru.js +5 -0
  65. package/EmailTemplatePreview/polyglot/types.d.ts +6 -0
  66. package/EmailTemplatePreview/polyglot/types.js +1 -0
  67. package/FrequencyCapping/FrequencyCappingEdit.js +7 -2
  68. package/FrequencyCapping/FrequencyCappingInApps.js +7 -2
  69. package/FrequencyCapping/FrequencyCappingReadonly.js +5 -2
  70. package/FrequencyCapping/components/Description/index.js +3 -1
  71. package/FrequencyCapping/components/Settings/EditCappingSettings.js +10 -3
  72. package/FrequencyCapping/components/Settings/EditInAppCappingSettings.js +25 -8
  73. package/FrequencyCapping/helpers/getCappingChipText.d.ts +2 -1
  74. package/FrequencyCapping/helpers/getCappingChipText.js +13 -15
  75. package/FrequencyCapping/helpers/getDescriptionMessages.d.ts +2 -1
  76. package/FrequencyCapping/helpers/getDescriptionMessages.js +42 -22
  77. package/FrequencyCapping/helpers/getGlobalCappingLinkText.d.ts +2 -0
  78. package/FrequencyCapping/helpers/getGlobalCappingLinkText.js +7 -0
  79. package/FrequencyCapping/helpers/getReadonlyCappingHelpers.d.ts +2 -1
  80. package/FrequencyCapping/helpers/getReadonlyCappingHelpers.js +27 -15
  81. package/FrequencyCapping/polyglot/index.d.ts +4 -0
  82. package/FrequencyCapping/polyglot/index.js +10 -0
  83. package/FrequencyCapping/polyglot/messages_en.d.ts +3 -0
  84. package/FrequencyCapping/polyglot/messages_en.js +33 -0
  85. package/FrequencyCapping/polyglot/messages_ru.d.ts +3 -0
  86. package/FrequencyCapping/polyglot/messages_ru.js +33 -0
  87. package/FrequencyCapping/polyglot/types.d.ts +46 -0
  88. package/FrequencyCapping/polyglot/types.js +1 -0
  89. package/Modal/components/ModalConfirm/ModalConfirm.js +21 -8
  90. package/Modal/components/ModalConfirm/types.d.ts +1 -1
  91. package/Modal/polyglot/index.d.ts +2 -0
  92. package/Modal/polyglot/index.js +9 -0
  93. package/Modal/polyglot/messages_en.d.ts +3 -0
  94. package/Modal/polyglot/messages_en.js +6 -0
  95. package/Modal/polyglot/messages_ru.d.ts +3 -0
  96. package/Modal/polyglot/messages_ru.js +6 -0
  97. package/Modal/polyglot/types.d.ts +7 -0
  98. package/Modal/polyglot/types.js +1 -0
  99. package/NotificationInbox/NotificationBell.js +7 -1
  100. package/NotificationInbox/NotificationInbox.js +19 -5
  101. package/NotificationInbox/polyglot/index.d.ts +2 -0
  102. package/NotificationInbox/polyglot/index.js +10 -0
  103. package/NotificationInbox/polyglot/messages_en.d.ts +3 -0
  104. package/NotificationInbox/polyglot/messages_en.js +8 -0
  105. package/NotificationInbox/polyglot/messages_ru.d.ts +3 -0
  106. package/NotificationInbox/polyglot/messages_ru.js +8 -0
  107. package/NotificationInbox/polyglot/types.d.ts +11 -0
  108. package/NotificationInbox/polyglot/types.js +1 -0
  109. package/PushPreview/components/MissedContentPreview/MissedContentPreview.js +7 -2
  110. package/PushPreview/polyglot/index.d.ts +2 -0
  111. package/PushPreview/polyglot/index.js +9 -0
  112. package/PushPreview/polyglot/messages_en.d.ts +3 -0
  113. package/PushPreview/polyglot/messages_en.js +4 -0
  114. package/PushPreview/polyglot/messages_ru.d.ts +3 -0
  115. package/PushPreview/polyglot/messages_ru.js +4 -0
  116. package/PushPreview/polyglot/types.d.ts +5 -0
  117. package/PushPreview/polyglot/types.js +1 -0
  118. package/SendRate/SendRateEdit.js +7 -2
  119. package/SendRate/SendRateReadonly.js +5 -2
  120. package/SendRate/components/Condition/index.js +8 -1
  121. package/SendRate/components/Description/index.js +20 -6
  122. package/SendRate/components/Settings/index.js +7 -2
  123. package/SendRate/helpers/getGlobalSendRateLinkText.d.ts +2 -0
  124. package/SendRate/helpers/getGlobalSendRateLinkText.js +7 -0
  125. package/SendRate/helpers/getReadonlySendRateHelpers.d.ts +2 -1
  126. package/SendRate/helpers/getReadonlySendRateHelpers.js +20 -11
  127. package/SendRate/polyglot/index.d.ts +4 -0
  128. package/SendRate/polyglot/index.js +10 -0
  129. package/SendRate/polyglot/messages_en.d.ts +3 -0
  130. package/SendRate/polyglot/messages_en.js +20 -0
  131. package/SendRate/polyglot/messages_ru.d.ts +3 -0
  132. package/SendRate/polyglot/messages_ru.js +20 -0
  133. package/SendRate/polyglot/types.d.ts +23 -0
  134. package/SendRate/polyglot/types.js +1 -0
  135. package/package.json +1 -1
  136. package/polyglot/index.d.ts +1 -1
  137. package/polyglot/index.js +1 -1
  138. package/polyglot/react.d.ts +12 -2
  139. package/polyglot/react.js +80 -45
@@ -0,0 +1,3 @@
1
+ import { type FrequencyCappingMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<FrequencyCappingMessages>;
@@ -0,0 +1,33 @@
1
+ export const messages = {
2
+ 'DUMB.FREQUENCY_CAPPING.FIELD_TITLE': 'Ограничение частоты',
3
+ 'DUMB.FREQUENCY_CAPPING.LINK.SET_UP': 'Настроить',
4
+ 'DUMB.FREQUENCY_CAPPING.LINK.SETTINGS': 'Настройки',
5
+ 'DUMB.FREQUENCY_CAPPING.SETTINGS.LIMIT_TO_MAX': 'Не&nbsp;более',
6
+ 'DUMB.FREQUENCY_CAPPING.SETTINGS.MESSAGES_PER': 'сообщений за',
7
+ 'DUMB.FREQUENCY_CAPPING.SETTINGS.DAYS': 'дн.',
8
+ 'DUMB.FREQUENCY_CAPPING.INAPP.LIMIT_DESC': 'Ограничьте частоту показа этого In-App конкретному пользователю',
9
+ 'DUMB.FREQUENCY_CAPPING.INAPP.LIMITED_TO': 'Не более',
10
+ 'DUMB.FREQUENCY_CAPPING.INAPP.TOTAL_IMPRESSIONS': 'показов всего',
11
+ 'DUMB.FREQUENCY_CAPPING.INAPP.IMPRESSIONS_IN': 'показов за',
12
+ 'DUMB.FREQUENCY_CAPPING.INAPP.DAYS': 'дн.',
13
+ 'DUMB.FREQUENCY_CAPPING.INAPP.ENABLE': 'Включить',
14
+ 'DUMB.FREQUENCY_CAPPING.INAPP.DAYS_INTERVAL': 'дн. интервал между показами',
15
+ 'DUMB.FREQUENCY_CAPPING.CHIP.UNLIMITED': 'без ограничений',
16
+ 'DUMB.FREQUENCY_CAPPING.CHIP.MESSAGE': '{{count}} {{count | pluralize: "сообщение", "сообщения", "сообщений"}} за {{days}} {{days | pluralize: "день", "дня", "дней"}}',
17
+ 'DUMB.FREQUENCY_CAPPING.CHIP.INAPP': '{{count}} in-app за {{days}} {{days | pluralize: "день", "дня", "дней"}}',
18
+ 'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_INAPP_UNSET': 'Этот in-app будет использовать глобальное ограничение частоты, так как лимит не задан.',
19
+ 'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_PREFIX': 'При текущих настройках, если пользователь получит более',
20
+ 'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_INAPP_SUFFIX': 'этот in-app не будет доставлен.',
21
+ 'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_MSG_UNSET_PREFIX': 'Это сообщение будет использовать',
22
+ 'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_MSG_UNSET_SUFFIX': 'глобальное ограничение частоты, так как лимит не задан.',
23
+ 'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_MSG_SUFFIX': ', это сообщение не будет доставлено{% if isInJourney == true %}, а пользователь перейдёт к следующему шагу{% endif %}.',
24
+ 'DUMB.FREQUENCY_CAPPING.DESC.CUSTOM_INAPP': 'Вместо глобального ограничения частоты будет использован заданный вами лимит показов in-app. Если подписчик превысит лимит полученных in-app, он больше не увидит этот in-app.',
25
+ 'DUMB.FREQUENCY_CAPPING.DESC.CUSTOM_MSG': 'Вместо глобального ограничения частоты будет использован заданный вами лимит отправленных сообщений. Если подписчик превысит лимит полученных сообщений, он не получит это сообщение{% if isInJourney == true %} и перейдёт к следующему шагу{% endif %}.',
26
+ 'DUMB.FREQUENCY_CAPPING.DESC.IGNORE': 'Пользователь получит это сообщение в любом случае, даже если он превысил установленные лимиты сообщений для канала. Используйте с осторожностью, чтобы не отправлять слишком много сообщений.',
27
+ 'DUMB.FREQUENCY_CAPPING.RO.CUSTOM_LABEL': 'Пользовательское ограничение частоты для этого сообщения:',
28
+ 'DUMB.FREQUENCY_CAPPING.RO.IGNORE_LABEL': 'Отправлять сообщения без глобального ограничения частоты',
29
+ 'DUMB.FREQUENCY_CAPPING.RO.GLOBAL_LABEL': 'Глобальное ограничение частоты:',
30
+ 'DUMB.FREQUENCY_CAPPING.RO.BECAUSE_UNSET': 'так как лимит не задан',
31
+ 'DUMB.FREQUENCY_CAPPING.RO.TOOLTIP_LIMIT': 'Если подписчик превысит лимит полученных сообщений, он не получит это сообщение{% if isInJourney == true %} и перейдёт к следующему шагу{% endif %}',
32
+ 'DUMB.FREQUENCY_CAPPING.RO.TOOLTIP_IGNORE': 'Пользователь получит это сообщение в любом случае, даже если он превысил установленные лимиты для канала'
33
+ };
@@ -0,0 +1,46 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type FrequencyCappingMessages = {
3
+ 'DUMB.FREQUENCY_CAPPING.FIELD_TITLE': NoParams;
4
+ 'DUMB.FREQUENCY_CAPPING.LINK.SET_UP': NoParams;
5
+ 'DUMB.FREQUENCY_CAPPING.LINK.SETTINGS': NoParams;
6
+ 'DUMB.FREQUENCY_CAPPING.SETTINGS.LIMIT_TO_MAX': NoParams;
7
+ 'DUMB.FREQUENCY_CAPPING.SETTINGS.MESSAGES_PER': NoParams;
8
+ 'DUMB.FREQUENCY_CAPPING.SETTINGS.DAYS': NoParams;
9
+ 'DUMB.FREQUENCY_CAPPING.INAPP.LIMIT_DESC': NoParams;
10
+ 'DUMB.FREQUENCY_CAPPING.INAPP.LIMITED_TO': NoParams;
11
+ 'DUMB.FREQUENCY_CAPPING.INAPP.TOTAL_IMPRESSIONS': NoParams;
12
+ 'DUMB.FREQUENCY_CAPPING.INAPP.IMPRESSIONS_IN': NoParams;
13
+ 'DUMB.FREQUENCY_CAPPING.INAPP.DAYS': NoParams;
14
+ 'DUMB.FREQUENCY_CAPPING.INAPP.ENABLE': NoParams;
15
+ 'DUMB.FREQUENCY_CAPPING.INAPP.DAYS_INTERVAL': NoParams;
16
+ 'DUMB.FREQUENCY_CAPPING.CHIP.UNLIMITED': NoParams;
17
+ 'DUMB.FREQUENCY_CAPPING.CHIP.MESSAGE': {
18
+ count: number;
19
+ days: number;
20
+ };
21
+ 'DUMB.FREQUENCY_CAPPING.CHIP.INAPP': {
22
+ count: number;
23
+ days: number;
24
+ };
25
+ 'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_INAPP_UNSET': NoParams;
26
+ 'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_PREFIX': NoParams;
27
+ 'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_INAPP_SUFFIX': NoParams;
28
+ 'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_MSG_UNSET_PREFIX': NoParams;
29
+ 'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_MSG_UNSET_SUFFIX': NoParams;
30
+ 'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_MSG_SUFFIX': {
31
+ isInJourney: boolean;
32
+ };
33
+ 'DUMB.FREQUENCY_CAPPING.DESC.CUSTOM_INAPP': NoParams;
34
+ 'DUMB.FREQUENCY_CAPPING.DESC.CUSTOM_MSG': {
35
+ isInJourney: boolean;
36
+ };
37
+ 'DUMB.FREQUENCY_CAPPING.DESC.IGNORE': NoParams;
38
+ 'DUMB.FREQUENCY_CAPPING.RO.CUSTOM_LABEL': NoParams;
39
+ 'DUMB.FREQUENCY_CAPPING.RO.IGNORE_LABEL': NoParams;
40
+ 'DUMB.FREQUENCY_CAPPING.RO.GLOBAL_LABEL': NoParams;
41
+ 'DUMB.FREQUENCY_CAPPING.RO.BECAUSE_UNSET': NoParams;
42
+ 'DUMB.FREQUENCY_CAPPING.RO.TOOLTIP_LIMIT': {
43
+ isInJourney: boolean;
44
+ };
45
+ 'DUMB.FREQUENCY_CAPPING.RO.TOOLTIP_IGNORE': NoParams;
46
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -2,22 +2,33 @@ import React, { useState, useCallback } from 'react';
2
2
  import { Vertical, Horizontal } from '@pushwoosh/kit-helpers';
3
3
  import { Banner } from '../../../Banner';
4
4
  import { Button } from '../../../Button';
5
+ import { useLang } from '../../polyglot';
5
6
  import { Modal } from '../Modal';
6
7
  import { ModalHeader, ModalBody, ModalFooter } from '../ModalContent';
7
8
  import { ModalTitle } from '../ModalTitle';
8
9
  export function ModalConfirm(props) {
10
+ const lang = useLang();
9
11
  const {
10
12
  isOpen,
11
- title = 'Confirm action',
13
+ title,
12
14
  size = 'small',
13
15
  description = '',
14
- confirmButtonText = 'Confirm',
15
- cancelButtonText = 'Cancel',
16
+ confirmButtonText,
17
+ cancelButtonText,
16
18
  confirmButtonColor = 'primary',
17
19
  callback,
18
20
  onAccept,
19
21
  onCancel
20
22
  } = props;
23
+ const resolvedTitle = title ?? lang({
24
+ message: 'DUMB.MODAL.CONFIRM_TITLE'
25
+ });
26
+ const resolvedConfirmText = confirmButtonText ?? lang({
27
+ message: 'DUMB.MODAL.CONFIRM'
28
+ });
29
+ const resolvedCancelText = cancelButtonText ?? lang({
30
+ message: 'DUMB.MODAL.CANCEL'
31
+ });
21
32
  const [isLoading, setIsLoading] = useState(false);
22
33
  const [errorMessage, setErrorMessage] = useState('');
23
34
  const handleConfirm = useCallback(async () => {
@@ -27,18 +38,20 @@ export function ModalConfirm(props) {
27
38
  await (callback === null || callback === void 0 ? void 0 : callback());
28
39
  await onAccept();
29
40
  } catch (error) {
30
- setErrorMessage((error === null || error === void 0 ? void 0 : error.message) || 'Unexpected error occurred');
41
+ setErrorMessage((error === null || error === void 0 ? void 0 : error.message) || lang({
42
+ message: 'DUMB.MODAL.UNEXPECTED_ERROR'
43
+ }));
31
44
  } finally {
32
45
  setIsLoading(false);
33
46
  }
34
- }, [callback, onAccept]);
47
+ }, [callback, onAccept, lang]);
35
48
  return React.createElement(Modal, {
36
49
  size: size,
37
50
  isOpen: isOpen,
38
51
  onClose: onCancel
39
52
  }, React.createElement(ModalHeader, null, React.createElement(Vertical, {
40
53
  "$gap": 8
41
- }, React.createElement(ModalTitle, null, title), errorMessage && React.createElement(Banner, {
54
+ }, React.createElement(ModalTitle, null, resolvedTitle), errorMessage && React.createElement(Banner, {
42
55
  type: "error",
43
56
  title: errorMessage
44
57
  }))), description && React.createElement(ModalBody, null, description), React.createElement(ModalFooter, null, React.createElement(Horizontal, {
@@ -47,9 +60,9 @@ export function ModalConfirm(props) {
47
60
  }, React.createElement(Button, {
48
61
  color: "secondary",
49
62
  onClick: onCancel
50
- }, cancelButtonText), React.createElement(Button, {
63
+ }, resolvedCancelText), React.createElement(Button, {
51
64
  color: confirmButtonColor,
52
65
  isLoading: isLoading,
53
66
  onClick: handleConfirm
54
- }, confirmButtonText))));
67
+ }, resolvedConfirmText))));
55
68
  }
@@ -3,7 +3,7 @@ import { type modalSizes } from '../Modal/maps';
3
3
  export type ConfirmButtonColor = 'primary' | 'secondary' | 'danger';
4
4
  export interface ModalConfirmProps {
5
5
  isOpen: boolean;
6
- title: string;
6
+ title?: string;
7
7
  size?: keyof typeof modalSizes;
8
8
  description?: ReactNode;
9
9
  confirmButtonText?: string;
@@ -0,0 +1,2 @@
1
+ import { type ModalMessages } from './types';
2
+ export declare const useLang: () => (props: import("../../polyglot").LangProps<ModalMessages>) => string;
@@ -0,0 +1,9 @@
1
+ import { messages as en } from './messages_en';
2
+ import { messages as ru } from './messages_ru';
3
+ import { createLang } from '../../polyglot';
4
+ export const {
5
+ useLang
6
+ } = createLang({
7
+ en,
8
+ ru
9
+ });
@@ -0,0 +1,3 @@
1
+ import { type ModalMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<ModalMessages>;
@@ -0,0 +1,6 @@
1
+ export const messages = {
2
+ 'DUMB.MODAL.UNEXPECTED_ERROR': 'Unexpected error occurred',
3
+ 'DUMB.MODAL.CONFIRM_TITLE': 'Confirm action',
4
+ 'DUMB.MODAL.CONFIRM': 'Confirm',
5
+ 'DUMB.MODAL.CANCEL': 'Cancel'
6
+ };
@@ -0,0 +1,3 @@
1
+ import { type ModalMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<ModalMessages>;
@@ -0,0 +1,6 @@
1
+ export const messages = {
2
+ 'DUMB.MODAL.UNEXPECTED_ERROR': 'Произошла непредвиденная ошибка',
3
+ 'DUMB.MODAL.CONFIRM_TITLE': 'Подтвердите действие',
4
+ 'DUMB.MODAL.CONFIRM': 'Подтвердить',
5
+ 'DUMB.MODAL.CANCEL': 'Отмена'
6
+ };
@@ -0,0 +1,7 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type ModalMessages = {
3
+ 'DUMB.MODAL.UNEXPECTED_ERROR': NoParams;
4
+ 'DUMB.MODAL.CONFIRM_TITLE': NoParams;
5
+ 'DUMB.MODAL.CONFIRM': NoParams;
6
+ 'DUMB.MODAL.CANCEL': NoParams;
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Color } from '@pushwoosh/kit-constants';
3
3
  import { NotificationIcon } from '@pushwoosh/kit-icons';
4
+ import { useLang } from './polyglot';
4
5
  import { NotificationBellButton, NotificationBellBadge, NotificationBellBadgeDot } from './styles';
5
6
  export function NotificationBell({
6
7
  count = 0,
@@ -8,6 +9,7 @@ export function NotificationBell({
8
9
  isOpened = false,
9
10
  onClick
10
11
  }) {
12
+ const lang = useLang();
11
13
  const hasNotifications = count > 0;
12
14
  const showBadge = hasNotifications || severity;
13
15
  const getBadgeColor = () => {
@@ -20,7 +22,11 @@ export function NotificationBell({
20
22
  "$isOpened": isOpened,
21
23
  onClick: onClick,
22
24
  type: "button",
23
- "aria-label": hasNotifications ? 'You have unread notifications' : 'Notifications'
25
+ "aria-label": hasNotifications ? lang({
26
+ message: 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD'
27
+ }) : lang({
28
+ message: 'DUMB.NOTIFICATION_INBOX.TITLE'
29
+ })
24
30
  }, React.createElement(NotificationIcon, {
25
31
  size: "medium",
26
32
  type: "enabled",
@@ -8,6 +8,7 @@ import { useInfiniteScroll } from './useInfiniteScroll';
8
8
  import { Badge } from '../Badge';
9
9
  import { Spinner } from '../Spinner';
10
10
  import emptyNotificationsIcon from './assets/EmptyNotifications.svg?url';
11
+ import { Lang } from './polyglot';
11
12
  import { NotificationInboxContainer, NotificationInboxHeader, NotificationInboxTitle, NotificationInboxList, NotificationItem, NotificationIndicator, NotificationHeader, NotificationDescription, NotificationActionLink, NotificationInboxEmptyIcon, NotificationInboxEmptyText } from './styles';
12
13
  export function NotificationInbox({
13
14
  notifications,
@@ -51,7 +52,9 @@ export function NotificationInbox({
51
52
  return React.createElement(NotificationInboxContainer, null, React.createElement(NotificationInboxHeader, null, React.createElement(NotificationInboxTitle, {
52
53
  "$variant": "h4",
53
54
  "$color": Color.MAIN
54
- }, "Notifications")), React.createElement(Vertical, {
55
+ }, React.createElement(Lang, {
56
+ message: "DUMB.NOTIFICATION_INBOX.TITLE"
57
+ }))), React.createElement(Vertical, {
55
58
  "$alignItems": "center",
56
59
  "$gap": 24,
57
60
  "$padding": "24px"
@@ -76,10 +79,15 @@ export function NotificationInbox({
76
79
  return React.createElement(NotificationInboxContainer, null, React.createElement(NotificationInboxHeader, null, React.createElement(NotificationInboxTitle, {
77
80
  "$variant": "h4",
78
81
  "$color": Color.MAIN
79
- }, React.createElement("span", null, "Notifications"), unreadCount > 0 && React.createElement(React.Fragment, null, ' ', React.createElement(Text, {
82
+ }, React.createElement("span", null, React.createElement(Lang, {
83
+ message: "DUMB.NOTIFICATION_INBOX.TITLE"
84
+ })), unreadCount > 0 && React.createElement(React.Fragment, null, ' ', React.createElement(Text, {
80
85
  "$variant": "h4",
81
86
  "$color": Color.LOCKED
82
- }, unreadCount, ' ', "unread")))), React.createElement(NotificationInboxList, {
87
+ }, React.createElement(Lang, {
88
+ message: "DUMB.NOTIFICATION_INBOX.UNREAD",
89
+ count: unreadCount
90
+ }))))), React.createElement(NotificationInboxList, {
83
91
  "data-notification-list": true
84
92
  }, notifications.map(notification => {
85
93
  const isRead = notification.isRead ?? false;
@@ -132,7 +140,11 @@ export function NotificationInbox({
132
140
  e.stopPropagation();
133
141
  setExpandedId(prev => prev === notification.id ? null : notification.id);
134
142
  }
135
- }, expandedId === notification.id ? 'Collapse' : 'Expand'))));
143
+ }, expandedId === notification.id ? React.createElement(Lang, {
144
+ message: "DUMB.NOTIFICATION_INBOX.COLLAPSE"
145
+ }) : React.createElement(Lang, {
146
+ message: "DUMB.NOTIFICATION_INBOX.EXPAND"
147
+ })))));
136
148
  }), hasMore && isLoading && React.createElement(Horizontal, {
137
149
  ref: loadMoreRef,
138
150
  "$alignItems": "center",
@@ -145,7 +157,9 @@ export function NotificationInbox({
145
157
  }), React.createElement(Text, {
146
158
  "$variant": "footnote",
147
159
  "$color": Color.LOCKED
148
- }, "Loading more\u2026")), isLoading && notifications.length === 0 && !hasMore && React.createElement(Horizontal, {
160
+ }, React.createElement(Lang, {
161
+ message: "DUMB.NOTIFICATION_INBOX.LOADING_MORE"
162
+ }))), isLoading && notifications.length === 0 && !hasMore && React.createElement(Horizontal, {
149
163
  "$justifyContent": "center",
150
164
  "$alignItems": "center",
151
165
  "$padding": "16px 0"
@@ -0,0 +1,2 @@
1
+ import { type NotificationInboxMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("../../polyglot").LangProps<NotificationInboxMessages>>, useLang: () => (props: import("../../polyglot").LangProps<NotificationInboxMessages>) => string;
@@ -0,0 +1,10 @@
1
+ import { messages as en } from './messages_en';
2
+ import { messages as ru } from './messages_ru';
3
+ import { createLang } from '../../polyglot';
4
+ export const {
5
+ Lang,
6
+ useLang
7
+ } = createLang({
8
+ en,
9
+ ru
10
+ });
@@ -0,0 +1,3 @@
1
+ import { type NotificationInboxMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<NotificationInboxMessages>;
@@ -0,0 +1,8 @@
1
+ export const messages = {
2
+ 'DUMB.NOTIFICATION_INBOX.TITLE': 'Notifications',
3
+ 'DUMB.NOTIFICATION_INBOX.UNREAD': '{{count}} unread',
4
+ 'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Collapse',
5
+ 'DUMB.NOTIFICATION_INBOX.EXPAND': 'Expand',
6
+ 'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Loading more…',
7
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'You have unread notifications'
8
+ };
@@ -0,0 +1,3 @@
1
+ import { type NotificationInboxMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<NotificationInboxMessages>;
@@ -0,0 +1,8 @@
1
+ export const messages = {
2
+ 'DUMB.NOTIFICATION_INBOX.TITLE': 'Уведомления',
3
+ 'DUMB.NOTIFICATION_INBOX.UNREAD': '{{count}} {{count | pluralize: "непрочитанное", "непрочитанных", "непрочитанных"}}',
4
+ 'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Свернуть',
5
+ 'DUMB.NOTIFICATION_INBOX.EXPAND': 'Развернуть',
6
+ 'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Загрузка…',
7
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Есть непрочитанные уведомления'
8
+ };
@@ -0,0 +1,11 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type NotificationInboxMessages = {
3
+ 'DUMB.NOTIFICATION_INBOX.TITLE': NoParams;
4
+ 'DUMB.NOTIFICATION_INBOX.UNREAD': {
5
+ count: number;
6
+ };
7
+ 'DUMB.NOTIFICATION_INBOX.COLLAPSE': NoParams;
8
+ 'DUMB.NOTIFICATION_INBOX.EXPAND': NoParams;
9
+ 'DUMB.NOTIFICATION_INBOX.LOADING_MORE': NoParams;
10
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': NoParams;
11
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { Color } from '@pushwoosh/kit-constants';
3
3
  import { Vertical } from '@pushwoosh/kit-helpers';
4
4
  import { CloseIcon } from '@pushwoosh/kit-icons';
5
+ import { Lang } from '../../polyglot';
5
6
  import { PushBox, IconContainer, PushTitle, PushDescription } from '../../styles';
6
7
  export function MissedContentPreview() {
7
8
  return React.createElement(PushBox, {
@@ -11,7 +12,11 @@ export function MissedContentPreview() {
11
12
  color: Color.CLEAR
12
13
  })), React.createElement(Vertical, null, React.createElement(PushTitle, {
13
14
  locked: true
14
- }, "Content missed"), React.createElement(PushDescription, {
15
+ }, React.createElement(Lang, {
16
+ message: "DUMB.PUSH_PREVIEW.CONTENT_MISSED"
17
+ })), React.createElement(PushDescription, {
15
18
  locked: true
16
- }, "Might be old data or deleted presets")));
19
+ }, React.createElement(Lang, {
20
+ message: "DUMB.PUSH_PREVIEW.HINT"
21
+ }))));
17
22
  }
@@ -0,0 +1,2 @@
1
+ import { type PushPreviewMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("../../polyglot").LangProps<PushPreviewMessages>>;
@@ -0,0 +1,9 @@
1
+ import { messages as en } from './messages_en';
2
+ import { messages as ru } from './messages_ru';
3
+ import { createLang } from '../../polyglot';
4
+ export const {
5
+ Lang
6
+ } = createLang({
7
+ en,
8
+ ru
9
+ });
@@ -0,0 +1,3 @@
1
+ import { type PushPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<PushPreviewMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.PUSH_PREVIEW.CONTENT_MISSED': 'Content missed',
3
+ 'DUMB.PUSH_PREVIEW.HINT': 'Might be old data or deleted presets'
4
+ };
@@ -0,0 +1,3 @@
1
+ import { type PushPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<PushPreviewMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.PUSH_PREVIEW.CONTENT_MISSED': 'Контент отсутствует',
3
+ 'DUMB.PUSH_PREVIEW.HINT': 'Возможно, устаревшие данные или удалённые пресеты'
4
+ };
@@ -0,0 +1,5 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type PushPreviewMessages = {
3
+ 'DUMB.PUSH_PREVIEW.CONTENT_MISSED': NoParams;
4
+ 'DUMB.PUSH_PREVIEW.HINT': NoParams;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -4,10 +4,12 @@ import { Vertical } from '@pushwoosh/kit-helpers';
4
4
  import { OpenIcon } from '@pushwoosh/kit-icons';
5
5
  import { Description } from './components/Description';
6
6
  import { EditSendRateSettings } from './components/Settings';
7
+ import { getGlobalSendRateLinkText } from './helpers/getGlobalSendRateLinkText';
7
8
  import { FieldBox } from '../FieldBox';
8
9
  import { Link } from '../Link';
9
10
  import { Select } from '../Select';
10
11
  import { sendRateOptions } from './constants';
12
+ import { useLang } from './polyglot';
11
13
  import { Container, LinkWrapper } from './styles';
12
14
  export function SendRateEdit({
13
15
  sendRate,
@@ -18,12 +20,13 @@ export function SendRateEdit({
18
20
  maxValue,
19
21
  editGlobalClicked
20
22
  }) {
23
+ const lang = useLang();
21
24
  const {
22
25
  sendRate: count,
23
26
  policy
24
27
  } = sendRate;
25
28
  const isGlobalSendRateDisabled = globalSendRate.count === 0 && globalSendRate.count === 0;
26
- const globalSendRateLinkText = isGlobalSendRateDisabled ? 'Set up' : 'Settings';
29
+ const globalSendRateLinkText = getGlobalSendRateLinkText(lang, isGlobalSendRateDisabled);
27
30
  const onChangeSendRate = React.useCallback(value => {
28
31
  if (value === 'CUSTOM') {
29
32
  onChange({
@@ -51,7 +54,9 @@ export function SendRateEdit({
51
54
  }, React.createElement(Vertical, {
52
55
  "$gap": 12
53
56
  }, React.createElement(FieldBox, {
54
- title: "Send rate"
57
+ title: lang({
58
+ message: 'DUMB.SEND_RATE.FIELD_TITLE'
59
+ })
55
60
  }, React.createElement(Select, {
56
61
  name: "sendRateOption",
57
62
  options: sendRateOptions,
@@ -2,19 +2,22 @@ import React from 'react';
2
2
  import { Horizontal, Vertical } from '@pushwoosh/kit-helpers';
3
3
  import { OpenIcon } from '@pushwoosh/kit-icons';
4
4
  import { Link } from '../Link';
5
+ import { getGlobalSendRateLinkText } from './helpers/getGlobalSendRateLinkText';
5
6
  import { getReadonlySendRateLabel } from './helpers/getReadonlySendRateHelpers';
7
+ import { useLang } from './polyglot';
6
8
  export function SendRateReadonly({
7
9
  sendRate,
8
10
  globalSendRate,
9
11
  applicationCode,
10
12
  editGlobalClicked
11
13
  }) {
14
+ const lang = useLang();
12
15
  const {
13
16
  policy
14
17
  } = sendRate;
15
18
  const isGlobalSendRateDisabled = globalSendRate.count === 0 && globalSendRate.seconds === 0;
16
- const globalSendRateLinkText = isGlobalSendRateDisabled ? 'Set up' : 'Settings';
17
- const label = getReadonlySendRateLabel(sendRate, isGlobalSendRateDisabled, globalSendRate);
19
+ const globalSendRateLinkText = getGlobalSendRateLinkText(lang, isGlobalSendRateDisabled);
20
+ const label = getReadonlySendRateLabel(sendRate, isGlobalSendRateDisabled, globalSendRate, lang);
18
21
  return React.createElement(Vertical, {
19
22
  "$gap": 24
20
23
  }, React.createElement(Horizontal, {
@@ -1,15 +1,22 @@
1
1
  import React from 'react';
2
2
  import { ChipWithinTextContainer } from './styles';
3
3
  import { Chip } from '../../../Chip';
4
+ import { useLang } from '../../polyglot';
4
5
  export function ChipSendRate({
5
6
  messages,
6
7
  $inText = false
7
8
  }) {
9
+ const lang = useLang();
8
10
  return React.createElement(ChipWithinTextContainer, {
9
11
  "$inText": $inText
10
12
  }, React.createElement(Chip, {
11
13
  "$variant": "primary",
12
14
  "$readOnly": true,
13
15
  as: "span"
14
- }, messages === 0 ? 'unlimited' : `${messages} messages per 1 sec`));
16
+ }, messages === 0 ? lang({
17
+ message: 'DUMB.SEND_RATE.CHIP.UNLIMITED'
18
+ }) : lang({
19
+ message: 'DUMB.SEND_RATE.CHIP.RATE',
20
+ messages
21
+ })));
15
22
  }
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Paragraph } from '@pushwoosh/kit-typography';
3
+ import { useLang } from '../../polyglot';
3
4
  import { ChipSendRate } from '../Condition';
4
5
  export function Description(props) {
5
6
  const {
@@ -8,22 +9,35 @@ export function Description(props) {
8
9
  seconds,
9
10
  children
10
11
  } = props;
12
+ const lang = useLang();
11
13
  if (sendRateOption === 'GLOBAL') {
12
14
  if (messages === 0 && seconds === 0) {
13
- return React.createElement(Paragraph, null, "This message will use an", React.createElement(ChipSendRate, {
15
+ return React.createElement(Paragraph, null, lang({
16
+ message: 'DUMB.SEND_RATE.DESC.GLOBAL_UNSET_PREFIX'
17
+ }), React.createElement(ChipSendRate, {
14
18
  messages: 0,
15
19
  "$inText": true
16
- }), "global send rate because limit isn\u2019t set.", ' ', children);
20
+ }), lang({
21
+ message: 'DUMB.SEND_RATE.DESC.GLOBAL_UNSET_SUFFIX'
22
+ }), ' ', children);
17
23
  }
18
- return React.createElement(Paragraph, null, "This message will use the Global send rate limit of", React.createElement(ChipSendRate, {
24
+ return React.createElement(Paragraph, null, lang({
25
+ message: 'DUMB.SEND_RATE.DESC.GLOBAL_SET_PREFIX'
26
+ }), React.createElement(ChipSendRate, {
19
27
  messages: messages,
20
28
  "$inText": true
21
- }), "to help reduce backend load.", ' ', children);
29
+ }), lang({
30
+ message: 'DUMB.SEND_RATE.DESC.GLOBAL_SET_SUFFIX'
31
+ }), ' ', children);
22
32
  }
23
33
  if (sendRateOption === 'CUSTOM') {
24
- return React.createElement(Paragraph, null, "Instead of using the Global send rate, a custom delivery speed will be applied. Messages will be sent at the rate defined below.", ' ', children);
34
+ return React.createElement(Paragraph, null, lang({
35
+ message: 'DUMB.SEND_RATE.DESC.CUSTOM'
36
+ }), ' ', children);
25
37
  }
26
38
  if (sendRateOption === 'IGNORE') {
27
- return React.createElement(Paragraph, null, "This message will be sent as fast as possible, regardless of any Global send rate limits. Use with caution to avoid overloading your backend or creating delivery spikes.", ' ', children);
39
+ return React.createElement(Paragraph, null, lang({
40
+ message: 'DUMB.SEND_RATE.DESC.IGNORE'
41
+ }), ' ', children);
28
42
  }
29
43
  }
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { Horizontal } from '@pushwoosh/kit-helpers';
3
3
  import { Paragraph } from '@pushwoosh/kit-typography';
4
4
  import { NumberPicker } from '../../../NumberPicker';
5
+ import { Lang } from '../../polyglot';
5
6
  export function EditSendRateSettings(props) {
6
7
  const {
7
8
  messages,
@@ -18,10 +19,14 @@ export function EditSendRateSettings(props) {
18
19
  style: {
19
20
  gridTemplateColumns: '145px 70px 150px'
20
21
  }
21
- }, React.createElement(Paragraph, null, "Limit to a maximum of"), React.createElement(NumberPicker, {
22
+ }, React.createElement(Paragraph, null, React.createElement(Lang, {
23
+ message: "DUMB.SEND_RATE.SETTINGS.LIMIT_TO_MAX"
24
+ })), React.createElement(NumberPicker, {
22
25
  onChange: value => onMessagesChange(value),
23
26
  value: messages,
24
27
  minValue: minValue,
25
28
  maxValue: maxValue
26
- }), React.createElement(Paragraph, null, "messages per 1 sec"));
29
+ }), React.createElement(Paragraph, null, React.createElement(Lang, {
30
+ message: "DUMB.SEND_RATE.SETTINGS.MESSAGES_PER_SEC"
31
+ })));
27
32
  }
@@ -0,0 +1,2 @@
1
+ import { type SendRateLang } from '../polyglot';
2
+ export declare function getGlobalSendRateLinkText(lang: SendRateLang, isGlobalSendRateDisabled: boolean): string;
@@ -0,0 +1,7 @@
1
+ export function getGlobalSendRateLinkText(lang, isGlobalSendRateDisabled) {
2
+ return isGlobalSendRateDisabled ? lang({
3
+ message: 'DUMB.SEND_RATE.LINK.SET_UP'
4
+ }) : lang({
5
+ message: 'DUMB.SEND_RATE.LINK.SETTINGS'
6
+ });
7
+ }