@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
@@ -1,9 +1,17 @@
1
1
  import React from 'react';
2
2
  import accessForbiddenImage from './assets/AccessForbidden.svg?url';
3
+ import { Lang, useLang } from './polyglot';
3
4
  import { RootBox, ImageBox, TitleBox, DescriptionBox } from './styles';
4
5
  export function AccessForbidden() {
6
+ const lang = useLang();
5
7
  return React.createElement(RootBox, null, React.createElement(ImageBox, {
6
- alt: "Access forbidden",
8
+ alt: lang({
9
+ message: 'DUMB.ACCESS_FORBIDDEN.TITLE'
10
+ }),
7
11
  src: accessForbiddenImage
8
- }), React.createElement(TitleBox, null, "Access forbidden"), React.createElement(DescriptionBox, null, "You do not have permission to access this page. Please contact your administrator for assistance."));
12
+ }), React.createElement(TitleBox, null, React.createElement(Lang, {
13
+ message: "DUMB.ACCESS_FORBIDDEN.TITLE"
14
+ })), React.createElement(DescriptionBox, null, React.createElement(Lang, {
15
+ message: "DUMB.ACCESS_FORBIDDEN.DESCRIPTION"
16
+ })));
9
17
  }
@@ -0,0 +1,2 @@
1
+ import { type AccessForbiddenMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("../../polyglot").LangProps<AccessForbiddenMessages>>, useLang: () => (props: import("../../polyglot").LangProps<AccessForbiddenMessages>) => 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 AccessForbiddenMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<AccessForbiddenMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.ACCESS_FORBIDDEN.TITLE': 'Access forbidden',
3
+ 'DUMB.ACCESS_FORBIDDEN.DESCRIPTION': 'You do not have permission to access this page. Please contact your administrator for assistance.'
4
+ };
@@ -0,0 +1,3 @@
1
+ import { type AccessForbiddenMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<AccessForbiddenMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.ACCESS_FORBIDDEN.TITLE': 'Доступ запрещён',
3
+ 'DUMB.ACCESS_FORBIDDEN.DESCRIPTION': 'У вас нет прав для доступа к этой странице. Обратитесь к администратору за помощью.'
4
+ };
@@ -0,0 +1,5 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type AccessForbiddenMessages = {
3
+ 'DUMB.ACCESS_FORBIDDEN.TITLE': NoParams;
4
+ 'DUMB.ACCESS_FORBIDDEN.DESCRIPTION': NoParams;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -8,6 +8,7 @@ import { Button } from '../../Button';
8
8
  import { Chip } from '../../Chip';
9
9
  import { Popover } from '../../Popover';
10
10
  import { CalendarSuperForm } from '../CalendarSuperForm';
11
+ import { Lang, useLang } from '../polyglot';
11
12
  export const CalendarDropdown = props => {
12
13
  const {
13
14
  mode,
@@ -24,6 +25,7 @@ export const CalendarDropdown = props => {
24
25
  const popoverRef = useRef(null);
25
26
  const [isShaking, setIsShaking] = useState(false);
26
27
  const [isOpen, setIsOpen] = useState(false);
28
+ const lang = useLang();
27
29
  const [value, setValue] = useState(props.value ?? (isRangePicker ? [] : undefined));
28
30
  const initialTimezone = calendarProps.timezone || 'UTC';
29
31
  const [timezone, setTimezone] = useState(initialTimezone);
@@ -51,7 +53,11 @@ export const CalendarDropdown = props => {
51
53
  const noValue = isRangePicker ? ((value === null || value === void 0 ? void 0 : value.length) ?? 0) === 0 : !value;
52
54
  let buttonText;
53
55
  if (noValue) {
54
- buttonText = isRangePicker ? 'Select period' : 'Select date';
56
+ buttonText = isRangePicker ? lang({
57
+ message: 'DUMB.CALENDAR.SELECT_PERIOD'
58
+ }) : lang({
59
+ message: 'DUMB.CALENDAR.SELECT_DATE'
60
+ });
55
61
  } else {
56
62
  buttonText = stringifyValue(value, withTime, timezone);
57
63
  }
@@ -136,7 +142,11 @@ export const CalendarDropdown = props => {
136
142
  setTimezone(initialTimezone);
137
143
  }
138
144
  }
139
- }, noValue ? 'Cancel' : 'Reset'), React.createElement(Button, {
145
+ }, noValue ? React.createElement(Lang, {
146
+ message: "DUMB.CALENDAR.CANCEL"
147
+ }) : React.createElement(Lang, {
148
+ message: "DUMB.CALENDAR.RESET"
149
+ })), React.createElement(Button, {
140
150
  color: "primary",
141
151
  size: "compact",
142
152
  onClick: () => {
@@ -155,5 +165,7 @@ export const CalendarDropdown = props => {
155
165
  closePopover();
156
166
  }
157
167
  }
158
- }, "Apply"))))));
168
+ }, React.createElement(Lang, {
169
+ message: "DUMB.CALENDAR.APPLY"
170
+ })))))));
159
171
  };
@@ -6,6 +6,7 @@ import { H5, Text } from '@pushwoosh/kit-typography';
6
6
  import { Button } from '../../../../Button';
7
7
  import { extendPeriodStruct, formatTwoDigitNumber } from '../../../helpers';
8
8
  import { formatTimezoneShort } from '../../../helpers-tz';
9
+ import { Lang } from '../../../polyglot';
9
10
  import { CalendarTimeInput } from '../CalendarTimeInput';
10
11
  import { CalendarTimezoneSelect } from '../CalendarTimezoneSelect';
11
12
  export const CalendarTimeAndTimezoneSection = ({
@@ -70,16 +71,22 @@ export const CalendarTimeAndTimezoneSection = ({
70
71
  size: "compact",
71
72
  view: "ghost",
72
73
  onClick: () => setExpanded(true)
73
- }, "Expand time")) : React.createElement(React.Fragment, null, isRangePicker && React.createElement(Columns, {
74
+ }, React.createElement(Lang, {
75
+ message: "DUMB.CALENDAR.EXPAND_TIME"
76
+ }))) : React.createElement(React.Fragment, null, isRangePicker && React.createElement(Columns, {
74
77
  "$sizes": "1fr max-content",
75
78
  "$gap": 8,
76
79
  "$alignItems": "center"
77
- }, React.createElement(H5, null, "Time range:"), React.createElement(Button, {
80
+ }, React.createElement(H5, null, React.createElement(Lang, {
81
+ message: "DUMB.CALENDAR.TIME_RANGE"
82
+ })), React.createElement(Button, {
78
83
  color: "secondary",
79
84
  size: "compact",
80
85
  view: "ghost",
81
86
  onClick: () => setExpanded(false)
82
- }, "Collapse time")), !isRangePicker ? React.createElement(Horizontal, {
87
+ }, React.createElement(Lang, {
88
+ message: "DUMB.CALENDAR.COLLAPSE_TIME"
89
+ }))), !isRangePicker ? React.createElement(Horizontal, {
83
90
  "$alignItems": "center",
84
91
  "$gap": 8,
85
92
  "$justifyContent": "start"
@@ -131,5 +138,8 @@ export const CalendarTimeAndTimezoneSection = ({
131
138
  }, React.createElement(Text, {
132
139
  "$variant": "footnote",
133
140
  "$color": Color.LOCKED
134
- }, "Please select", ' ', isRangePicker ? 'date range' : 'date', ' ', "first to set time"))));
141
+ }, React.createElement(Lang, {
142
+ message: "DUMB.CALENDAR.SELECT_FIRST_HINT",
143
+ isRange: Boolean(isRangePicker)
144
+ })))));
135
145
  };
@@ -0,0 +1,2 @@
1
+ import { type CalendarMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("../../polyglot").LangProps<CalendarMessages>>, useLang: () => (props: import("../../polyglot").LangProps<CalendarMessages>) => 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 CalendarMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<CalendarMessages>;
@@ -0,0 +1,11 @@
1
+ export const messages = {
2
+ 'DUMB.CALENDAR.SELECT_PERIOD': 'Select period',
3
+ 'DUMB.CALENDAR.SELECT_DATE': 'Select date',
4
+ 'DUMB.CALENDAR.CANCEL': 'Cancel',
5
+ 'DUMB.CALENDAR.RESET': 'Reset',
6
+ 'DUMB.CALENDAR.APPLY': 'Apply',
7
+ 'DUMB.CALENDAR.EXPAND_TIME': 'Expand time',
8
+ 'DUMB.CALENDAR.COLLAPSE_TIME': 'Collapse time',
9
+ 'DUMB.CALENDAR.TIME_RANGE': 'Time range:',
10
+ 'DUMB.CALENDAR.SELECT_FIRST_HINT': 'Please select {% if isRange == true %}date range{% else %}date{% endif %} first to set time'
11
+ };
@@ -0,0 +1,3 @@
1
+ import { type CalendarMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<CalendarMessages>;
@@ -0,0 +1,11 @@
1
+ export const messages = {
2
+ 'DUMB.CALENDAR.SELECT_PERIOD': 'Выберите период',
3
+ 'DUMB.CALENDAR.SELECT_DATE': 'Выберите дату',
4
+ 'DUMB.CALENDAR.CANCEL': 'Отмена',
5
+ 'DUMB.CALENDAR.RESET': 'Сбросить',
6
+ 'DUMB.CALENDAR.APPLY': 'Применить',
7
+ 'DUMB.CALENDAR.EXPAND_TIME': 'Развернуть время',
8
+ 'DUMB.CALENDAR.COLLAPSE_TIME': 'Свернуть время',
9
+ 'DUMB.CALENDAR.TIME_RANGE': 'Диапазон времени:',
10
+ 'DUMB.CALENDAR.SELECT_FIRST_HINT': 'Сначала выберите {% if isRange == true %}диапазон дат{% else %}дату{% endif %}, чтобы задать время'
11
+ };
@@ -0,0 +1,14 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type CalendarMessages = {
3
+ 'DUMB.CALENDAR.SELECT_PERIOD': NoParams;
4
+ 'DUMB.CALENDAR.SELECT_DATE': NoParams;
5
+ 'DUMB.CALENDAR.CANCEL': NoParams;
6
+ 'DUMB.CALENDAR.RESET': NoParams;
7
+ 'DUMB.CALENDAR.APPLY': NoParams;
8
+ 'DUMB.CALENDAR.EXPAND_TIME': NoParams;
9
+ 'DUMB.CALENDAR.COLLAPSE_TIME': NoParams;
10
+ 'DUMB.CALENDAR.TIME_RANGE': NoParams;
11
+ 'DUMB.CALENDAR.SELECT_FIRST_HINT': {
12
+ isRange: boolean;
13
+ };
14
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,11 +1,16 @@
1
1
  import React from 'react';
2
2
  import { Color } from '@pushwoosh/kit-constants';
3
3
  import { WarningRoundIcon } from '@pushwoosh/kit-icons';
4
+ import { Lang } from './polyglot';
4
5
  import { RootBox, IconBox, TitleBox, DescriptionBox } from './styles';
5
6
  export function CrashScreen() {
6
7
  return React.createElement(RootBox, null, React.createElement(IconBox, null, React.createElement(WarningRoundIcon, {
7
8
  size: "medium",
8
9
  view: "filled",
9
10
  color: Color.WARNING
10
- })), React.createElement(TitleBox, null, "Something went wrong"), React.createElement(DescriptionBox, null, "Please refresh the page or try again later."));
11
+ })), React.createElement(TitleBox, null, React.createElement(Lang, {
12
+ message: "DUMB.CRASH_SCREEN.TITLE"
13
+ })), React.createElement(DescriptionBox, null, React.createElement(Lang, {
14
+ message: "DUMB.CRASH_SCREEN.DESCRIPTION"
15
+ })));
11
16
  }
@@ -0,0 +1,2 @@
1
+ import { type CrashScreenMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("../../polyglot").LangProps<CrashScreenMessages>>, useLang: () => (props: import("../../polyglot").LangProps<CrashScreenMessages>) => 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 CrashScreenMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<CrashScreenMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.CRASH_SCREEN.TITLE': 'Something went wrong',
3
+ 'DUMB.CRASH_SCREEN.DESCRIPTION': 'Please refresh the page or try again later.'
4
+ };
@@ -0,0 +1,3 @@
1
+ import { type CrashScreenMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<CrashScreenMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.CRASH_SCREEN.TITLE': 'Что-то пошло не так',
3
+ 'DUMB.CRASH_SCREEN.DESCRIPTION': 'Обновите страницу или попробуйте позже.'
4
+ };
@@ -0,0 +1,5 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type CrashScreenMessages = {
3
+ 'DUMB.CRASH_SCREEN.TITLE': NoParams;
4
+ 'DUMB.CRASH_SCREEN.DESCRIPTION': NoParams;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -2,6 +2,7 @@ import { useFloating, offset, autoPlacement } from '@floating-ui/react-dom';
2
2
  import React, { useState, useEffect } from 'react';
3
3
  import { CalendarIcon } from '@pushwoosh/kit-icons';
4
4
  import { format, monthName, get } from '../../helpers';
5
+ import { Lang } from '../../polyglot';
5
6
  import { InputFrame } from '../../styles';
6
7
  import { DatePicker } from '../DatePicker';
7
8
  export function DatePickerField(props) {
@@ -56,7 +57,9 @@ export function DatePickerField(props) {
56
57
  }, React.createElement(CalendarIcon, {
57
58
  size: "medium",
58
59
  view: "lined"
59
- }), value ? React.createElement(React.Fragment, null, format(value, 'day '), monthName(get(value, 'month'), 'long'), format(value, ' year')) : 'Select date'), showPicker && React.createElement("div", {
60
+ }), value ? React.createElement(React.Fragment, null, format(value, 'day '), monthName(get(value, 'month'), 'long'), format(value, ' year')) : React.createElement(Lang, {
61
+ message: "DUMB.DATE_TIME_PICKER.SELECT_DATE"
62
+ })), showPicker && React.createElement("div", {
60
63
  ref: refs.setFloating,
61
64
  style: {
62
65
  ...floatingStyles,
@@ -2,6 +2,7 @@ import { useFloating, offset, autoPlacement } from '@floating-ui/react-dom';
2
2
  import React, { useState, useEffect } from 'react';
3
3
  import { CalendarIcon } from '@pushwoosh/kit-icons';
4
4
  import { useUTCDate } from './helpers';
5
+ import { Lang } from '../../polyglot';
5
6
  import { InputFrame } from '../../styles';
6
7
  import { DateTimePicker } from '../DateTimePicker';
7
8
  export function DateTimePickerField(props) {
@@ -63,7 +64,9 @@ export function DateTimePickerField(props) {
63
64
  }, React.createElement(CalendarIcon, {
64
65
  size: "medium",
65
66
  view: "lined"
66
- }), value ? `${day} ${month} ${year} ${hours}:${minutes}` : 'Select date and time'), showPicker && React.createElement("div", {
67
+ }), value ? `${day} ${month} ${year} ${hours}:${minutes}` : React.createElement(Lang, {
68
+ message: "DUMB.DATE_TIME_PICKER.SELECT_DATE_TIME"
69
+ })), showPicker && React.createElement("div", {
67
70
  ref: refs.setFloating,
68
71
  style: {
69
72
  ...floatingStyles,
@@ -1,6 +1,7 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import { Columns } from '@pushwoosh/kit-helpers';
3
3
  import { format, firstDayOfWeek, parseStringToDate, differenceInDays, isSamePeriod, isInRange } from '../../helpers';
4
+ import { Lang } from '../../polyglot';
4
5
  import { CellBox, DayHeader } from '../../styles';
5
6
  export function Month(props) {
6
7
  const {
@@ -26,7 +27,21 @@ export function Month(props) {
26
27
  return React.createElement(Columns, {
27
28
  "$sizes": 7,
28
29
  "$gap": 4
29
- }, React.createElement(DayHeader, null, "Sun"), React.createElement(DayHeader, null, "Mon"), React.createElement(DayHeader, null, "Tue"), React.createElement(DayHeader, null, "Wed"), React.createElement(DayHeader, null, "Thu"), React.createElement(DayHeader, null, "Fri"), React.createElement(DayHeader, null, "Sat"), Array.from({
30
+ }, React.createElement(DayHeader, null, React.createElement(Lang, {
31
+ message: "DUMB.DATE_TIME_PICKER.WEEKDAY_SUN"
32
+ })), React.createElement(DayHeader, null, React.createElement(Lang, {
33
+ message: "DUMB.DATE_TIME_PICKER.WEEKDAY_MON"
34
+ })), React.createElement(DayHeader, null, React.createElement(Lang, {
35
+ message: "DUMB.DATE_TIME_PICKER.WEEKDAY_TUE"
36
+ })), React.createElement(DayHeader, null, React.createElement(Lang, {
37
+ message: "DUMB.DATE_TIME_PICKER.WEEKDAY_WED"
38
+ })), React.createElement(DayHeader, null, React.createElement(Lang, {
39
+ message: "DUMB.DATE_TIME_PICKER.WEEKDAY_THU"
40
+ })), React.createElement(DayHeader, null, React.createElement(Lang, {
41
+ message: "DUMB.DATE_TIME_PICKER.WEEKDAY_FRI"
42
+ })), React.createElement(DayHeader, null, React.createElement(Lang, {
43
+ message: "DUMB.DATE_TIME_PICKER.WEEKDAY_SAT"
44
+ })), Array.from({
30
45
  length: days
31
46
  }).map((_, i) => {
32
47
  const curDay = new Date(Date.UTC(firstDayDate.getUTCFullYear(), firstDayDate.getUTCMonth(), firstDayDate.getUTCDate() + i));
@@ -0,0 +1,2 @@
1
+ import { type DateTimePickerMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("../../polyglot").LangProps<DateTimePickerMessages>>;
@@ -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 DateTimePickerMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<DateTimePickerMessages>;
@@ -0,0 +1,11 @@
1
+ export const messages = {
2
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_SUN': 'Sun',
3
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_MON': 'Mon',
4
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_TUE': 'Tue',
5
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_WED': 'Wed',
6
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_THU': 'Thu',
7
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_FRI': 'Fri',
8
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_SAT': 'Sat',
9
+ 'DUMB.DATE_TIME_PICKER.SELECT_DATE': 'Select date',
10
+ 'DUMB.DATE_TIME_PICKER.SELECT_DATE_TIME': 'Select date and time'
11
+ };
@@ -0,0 +1,3 @@
1
+ import { type DateTimePickerMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<DateTimePickerMessages>;
@@ -0,0 +1,11 @@
1
+ export const messages = {
2
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_SUN': 'Вс',
3
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_MON': 'Пн',
4
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_TUE': 'Вт',
5
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_WED': 'Ср',
6
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_THU': 'Чт',
7
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_FRI': 'Пт',
8
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_SAT': 'Сб',
9
+ 'DUMB.DATE_TIME_PICKER.SELECT_DATE': 'Выберите дату',
10
+ 'DUMB.DATE_TIME_PICKER.SELECT_DATE_TIME': 'Выберите дату и время'
11
+ };
@@ -0,0 +1,12 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type DateTimePickerMessages = {
3
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_SUN': NoParams;
4
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_MON': NoParams;
5
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_TUE': NoParams;
6
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_WED': NoParams;
7
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_THU': NoParams;
8
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_FRI': NoParams;
9
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_SAT': NoParams;
10
+ 'DUMB.DATE_TIME_PICKER.SELECT_DATE': NoParams;
11
+ 'DUMB.DATE_TIME_PICKER.SELECT_DATE_TIME': NoParams;
12
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,13 +1,15 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
+ import { DrawerBodyIframe, IframeElement, LoadingBox } from './styles';
2
3
  import { Spinner } from '../../../Spinner';
4
+ import { Lang, useLang } from '../../polyglot';
3
5
  import { Drawer } from '../Drawer';
4
- import { DrawerBodyIframe, IframeElement, LoadingBox } from './styles';
5
6
  export function DrawerDocs(props) {
6
7
  const {
7
8
  isOpen,
8
9
  url,
9
10
  onClose
10
11
  } = props;
12
+ const lang = useLang();
11
13
  const [drawerWidth, setDrawerWidth] = useState(0);
12
14
  const [iframeLoaded, setIframeLoaded] = useState(false);
13
15
  const drawerDocsRef = useRef(null);
@@ -33,10 +35,14 @@ export function DrawerDocs(props) {
33
35
  ref: drawerDocsRef
34
36
  }, !iframeLoaded && React.createElement(LoadingBox, null, React.createElement(Spinner, {
35
37
  size: "medium"
36
- }), ' ', "Loading..."), React.createElement(IframeElement, {
38
+ }), ' ', React.createElement(Lang, {
39
+ message: "DUMB.DRAWER.DOCS_LOADING"
40
+ })), React.createElement(IframeElement, {
37
41
  src: url,
38
42
  ref: iframeRef,
39
- title: "Pushwoosh docs",
43
+ title: lang({
44
+ message: 'DUMB.DRAWER.DOCS_TITLE'
45
+ }),
40
46
  width: drawerWidth,
41
47
  height: "95%",
42
48
  "$isLoaded": iframeLoaded,
@@ -0,0 +1,2 @@
1
+ import { type DrawerMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("../../polyglot").LangProps<DrawerMessages>>, useLang: () => (props: import("../../polyglot").LangProps<DrawerMessages>) => 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 DrawerMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<DrawerMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.DRAWER.DOCS_LOADING': 'Loading...',
3
+ 'DUMB.DRAWER.DOCS_TITLE': 'Pushwoosh docs'
4
+ };
@@ -0,0 +1,3 @@
1
+ import { type DrawerMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<DrawerMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.DRAWER.DOCS_LOADING': 'Загрузка...',
3
+ 'DUMB.DRAWER.DOCS_TITLE': 'Документация Pushwoosh'
4
+ };
@@ -0,0 +1,5 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type DrawerMessages = {
3
+ 'DUMB.DRAWER.DOCS_LOADING': NoParams;
4
+ 'DUMB.DRAWER.DOCS_TITLE': NoParams;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -5,6 +5,7 @@ import { DropdownIcon, EditIcon } from '@pushwoosh/kit-icons';
5
5
  import { Button } from '../Button';
6
6
  import { useOnClickOutside } from '../hooks';
7
7
  import { Popover, PopoverContainer } from '../Popover';
8
+ import { Lang } from './polyglot';
8
9
  import { FieldBox, TitleBox, ButtonsGroup } from './styles';
9
10
  export function EditableField({
10
11
  value,
@@ -53,11 +54,15 @@ export function EditableField({
53
54
  size: "compact",
54
55
  isLoading: loading,
55
56
  onClick: onSubmit
56
- }, "Submit"), React.createElement(Button, {
57
+ }, React.createElement(Lang, {
58
+ message: "DUMB.EDITABLE_FIELD.SUBMIT"
59
+ })), React.createElement(Button, {
57
60
  view: "shape",
58
61
  color: "secondary",
59
62
  size: "compact",
60
63
  isDisabled: loading,
61
64
  onClick: onCancel
62
- }, "Cancel")))));
65
+ }, React.createElement(Lang, {
66
+ message: "DUMB.EDITABLE_FIELD.CANCEL"
67
+ }))))));
63
68
  }
@@ -0,0 +1,2 @@
1
+ import { type EditableFieldMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("../../polyglot").LangProps<EditableFieldMessages>>;
@@ -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 EditableFieldMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<EditableFieldMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.EDITABLE_FIELD.SUBMIT': 'Submit',
3
+ 'DUMB.EDITABLE_FIELD.CANCEL': 'Cancel'
4
+ };
@@ -0,0 +1,3 @@
1
+ import { type EditableFieldMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<EditableFieldMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.EDITABLE_FIELD.SUBMIT': 'Сохранить',
3
+ 'DUMB.EDITABLE_FIELD.CANCEL': 'Отмена'
4
+ };
@@ -0,0 +1,5 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type EditableFieldMessages = {
3
+ 'DUMB.EDITABLE_FIELD.SUBMIT': NoParams;
4
+ 'DUMB.EDITABLE_FIELD.CANCEL': NoParams;
5
+ };
@@ -0,0 +1 @@
1
+ export {};