@pushwoosh/smart-components-kit 1.0.89 → 1.1.0

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 (114) hide show
  1. package/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.d.ts +1 -2
  2. package/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.js +105 -56
  3. package/CampaignsConfigurationDrawer/components/Card/Card.d.ts +1 -2
  4. package/CampaignsConfigurationDrawer/components/Card/Card.js +19 -13
  5. package/CampaignsConfigurationDrawer/polyglot/index.d.ts +2 -0
  6. package/CampaignsConfigurationDrawer/polyglot/index.js +10 -0
  7. package/CampaignsConfigurationDrawer/polyglot/messages_en.d.ts +3 -0
  8. package/CampaignsConfigurationDrawer/polyglot/messages_en.js +18 -0
  9. package/CampaignsConfigurationDrawer/polyglot/messages_ru.d.ts +3 -0
  10. package/CampaignsConfigurationDrawer/polyglot/messages_ru.js +18 -0
  11. package/CampaignsConfigurationDrawer/polyglot/types.d.ts +19 -0
  12. package/CampaignsConfigurationDrawer/polyglot/types.js +1 -0
  13. package/DocsButton/DocsButton.d.ts +1 -2
  14. package/DocsButton/DocsButton.js +21 -18
  15. package/DynamicContentPicker/DynamicContentPicker.js +76 -63
  16. package/DynamicContentPicker/Line.js +24 -22
  17. package/DynamicContentPickerForm/DynamicContentCustomPickerForm.js +20 -15
  18. package/DynamicContentPickerForm/DynamicContentEventPickerForm.js +62 -51
  19. package/DynamicContentPickerForm/DynamicContentTagPickerForm.js +62 -51
  20. package/DynamicContentPickerForm/SimpleDynamicContentPickerFormSmart.js +74 -59
  21. package/DynamicContentPickerForm/VariedDynamicContentPickerFormSmart.js +104 -78
  22. package/DynamicContentPickerForm/polyglot/index.d.ts +2 -0
  23. package/DynamicContentPickerForm/polyglot/index.js +10 -0
  24. package/DynamicContentPickerForm/polyglot/messages_en.d.ts +3 -0
  25. package/DynamicContentPickerForm/polyglot/messages_en.js +16 -0
  26. package/DynamicContentPickerForm/polyglot/messages_ru.d.ts +3 -0
  27. package/DynamicContentPickerForm/polyglot/messages_ru.js +16 -0
  28. package/DynamicContentPickerForm/polyglot/types.d.ts +17 -0
  29. package/DynamicContentPickerForm/polyglot/types.js +1 -0
  30. package/EmailTemplatePreview/EmailTemplatePreview.js +10 -4
  31. package/EmailTemplatePreview/polyglot/index.d.ts +5 -0
  32. package/EmailTemplatePreview/polyglot/index.js +10 -0
  33. package/EmailTemplatePreview/polyglot/messages_en.d.ts +3 -0
  34. package/EmailTemplatePreview/polyglot/messages_en.js +3 -0
  35. package/EmailTemplatePreview/polyglot/messages_ru.d.ts +3 -0
  36. package/EmailTemplatePreview/polyglot/messages_ru.js +3 -0
  37. package/EmailTemplatePreview/polyglot/types.d.ts +4 -0
  38. package/EmailTemplatePreview/polyglot/types.js +1 -0
  39. package/ExportCSV/ExportCsvBanner/ExportCsvBanner.d.ts +1 -2
  40. package/ExportCSV/ExportCsvBanner/ExportCsvBanner.js +63 -42
  41. package/ExportCSV/polyglot/index.d.ts +2 -0
  42. package/ExportCSV/polyglot/index.js +10 -0
  43. package/ExportCSV/polyglot/messages_en.d.ts +3 -0
  44. package/ExportCSV/polyglot/messages_en.js +9 -0
  45. package/ExportCSV/polyglot/messages_ru.d.ts +3 -0
  46. package/ExportCSV/polyglot/messages_ru.js +9 -0
  47. package/ExportCSV/polyglot/types.d.ts +10 -0
  48. package/ExportCSV/polyglot/types.js +1 -0
  49. package/ExportCSV/useExportService/useExportService.js +1 -0
  50. package/LanguagesSelector/LanguagesModal.js +38 -24
  51. package/LanguagesSelector/LanguagesSelectForm.js +73 -62
  52. package/LanguagesSelector/LanguagesSelectFormLoader.js +8 -7
  53. package/LanguagesSelector/LanguagesSelector.js +92 -78
  54. package/MediaStore/CreateVariantDrawer.js +134 -85
  55. package/MediaStore/MediaStore.js +137 -112
  56. package/ModalCloningJourney/ModalCloningJourney.d.ts +1 -2
  57. package/ModalCloningJourney/ModalCloningJourney.js +113 -91
  58. package/OpenActions/components/OpenActionsSummary/OpenActionsSummary.d.ts +1 -2
  59. package/OpenActions/components/OpenActionsSummary/OpenActionsSummary.js +101 -37
  60. package/OpenActions/components/OpenActionsSummaryByPreset.d.ts +1 -2
  61. package/OpenActions/components/OpenActionsSummaryByPreset.js +2 -2
  62. package/OpenActions/polyglot/index.d.ts +2 -0
  63. package/OpenActions/polyglot/index.js +10 -0
  64. package/OpenActions/polyglot/messages_en.d.ts +3 -0
  65. package/OpenActions/polyglot/messages_en.js +14 -0
  66. package/OpenActions/polyglot/messages_ru.d.ts +3 -0
  67. package/OpenActions/polyglot/messages_ru.js +14 -0
  68. package/OpenActions/polyglot/types.d.ts +18 -0
  69. package/OpenActions/polyglot/types.js +1 -0
  70. package/PlatformsConfigurationDrawer/PlatformsConfigurationDrawer.js +21 -17
  71. package/PlatformsConfigurationDrawer/components/DesktopPage/DesktopPage.js +114 -57
  72. package/PlatformsConfigurationDrawer/components/MainPage/MainPage.js +157 -75
  73. package/PlatformsConfigurationDrawer/components/MobilePage/MobilePage.js +140 -69
  74. package/PlatformsConfigurationDrawer/polyglot/index.d.ts +2 -0
  75. package/PlatformsConfigurationDrawer/polyglot/index.js +10 -0
  76. package/PlatformsConfigurationDrawer/polyglot/messages_en.d.ts +3 -0
  77. package/PlatformsConfigurationDrawer/polyglot/messages_en.js +24 -0
  78. package/PlatformsConfigurationDrawer/polyglot/messages_ru.d.ts +3 -0
  79. package/PlatformsConfigurationDrawer/polyglot/messages_ru.js +24 -0
  80. package/PlatformsConfigurationDrawer/polyglot/types.d.ts +25 -0
  81. package/PlatformsConfigurationDrawer/polyglot/types.js +1 -0
  82. package/ResendModal/ResendModal.d.ts +1 -2
  83. package/ResendModal/ResendModal.js +95 -59
  84. package/ResendModal/polyglot/index.d.ts +2 -0
  85. package/ResendModal/polyglot/index.js +10 -0
  86. package/ResendModal/polyglot/messages_en.d.ts +3 -0
  87. package/ResendModal/polyglot/messages_en.js +9 -0
  88. package/ResendModal/polyglot/messages_ru.d.ts +3 -0
  89. package/ResendModal/polyglot/messages_ru.js +9 -0
  90. package/ResendModal/polyglot/types.d.ts +10 -0
  91. package/ResendModal/polyglot/types.js +1 -0
  92. package/RichMessageEditorSmart/NewDynamicContentForm.js +16 -12
  93. package/RichMessageEditorSmart/RichMessageEditorSmart.js +4 -4
  94. package/SystemParcel/SystemParcel.d.ts +3 -3
  95. package/SystemParcel/SystemParcel.js +3 -2
  96. package/Table/components/DataTable/DataTable.js +80 -61
  97. package/Table/components/DataTableGetContext/DataTableGetContext.d.ts +1 -2
  98. package/Table/components/DataTableGetContext/DataTableGetContext.js +5 -2
  99. package/Table/components/DataTableList/DataTableList.d.ts +1 -2
  100. package/Table/components/DataTableList/DataTableList.js +86 -68
  101. package/Table/components/DataTablePagination/DataTablePagination.js +6 -4
  102. package/Table/components/DataTableSearchInput/DataTableSearchInput.js +3 -2
  103. package/Table/components/DataTableSortableCell/DataTableSortableCell.js +6 -4
  104. package/Table/components/Loading/Loading.d.ts +1 -2
  105. package/Table/components/Loading/Loading.js +16 -14
  106. package/Table/components/TablePagination/TablePagination.js +31 -25
  107. package/_devel/index.js +36 -24
  108. package/_devel/lib/dynamic-content-picker.d.ts +1 -2
  109. package/_devel/lib/dynamic-content-picker.js +16 -10
  110. package/_devel/lib/index.d.ts +2 -2
  111. package/_devel/lib/index.js +38 -19
  112. package/_devel/test-place.d.ts +1 -2
  113. package/_devel/test-place.js +4 -2
  114. package/package.json +2 -2
@@ -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 {};
@@ -1,13 +1,15 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
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();
@@ -31,15 +33,19 @@ export const EmailTemplatePreview = ({
31
33
  };
32
34
  }, [code]);
33
35
  if (res.loading) {
34
- return React.createElement(RectangularSkeleton, {
36
+ return _jsx(RectangularSkeleton, {
35
37
  width: width || '100%',
36
38
  height: height || '100%'
37
39
  });
38
40
  }
39
41
  if (res.error) {
40
- return React.createElement("div", null, "No preview");
42
+ return _jsx("div", {
43
+ children: lang({
44
+ message: 'SMART.EMAIL_TEMPLATE_PREVIEW.NO_PREVIEW'
45
+ })
46
+ });
41
47
  }
42
- return React.createElement(DumbPreview, {
48
+ return _jsx(DumbPreview, {
43
49
  template: res.value.template,
44
50
  localization: res.value.localization,
45
51
  values: res.value.values,
@@ -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 {};
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { type TaskInfo_args, type GetLastTasksRequest, type Status } from '@pushwoosh/rpc-v2-http-api-data/pushwoosh_export_messages_v2';
3
2
  export type ExportTask = {
4
3
  id: number;
@@ -16,5 +15,5 @@ type ExportCsvBannerProps = {
16
15
  isKeepPageOpenWarning?: boolean;
17
16
  onClose?: () => void;
18
17
  };
19
- export declare const ExportCsvBanner: ({ exportTask, updateExportTask, showLastExportLocalStorageKey, lastTasksParams, isKeepPageOpenWarning, onClose, }: ExportCsvBannerProps) => React.JSX.Element | null;
18
+ export declare const ExportCsvBanner: ({ exportTask, updateExportTask, showLastExportLocalStorageKey, lastTasksParams, isKeepPageOpenWarning, onClose, }: ExportCsvBannerProps) => import("react").JSX.Element | null;
20
19
  export {};
@@ -1,9 +1,11 @@
1
- import React, { useCallback, useEffect } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useEffect } from 'react';
2
3
  import { ExportResult, ProgressBar, Button } from '@pushwoosh/dumb-components';
3
4
  import { Color, ShapeRadius } from '@pushwoosh/kit-constants';
4
5
  import { Horizontal } from '@pushwoosh/kit-helpers';
5
6
  import { DangerTriangleIcon, DownloadIcon } from '@pushwoosh/kit-icons';
6
7
  import { Text } from '@pushwoosh/kit-typography';
8
+ import { useLang } from '../polyglot';
7
9
  import { useExportService } from '../useExportService';
8
10
  import { useExportVisibility } from './hooks/useExportVisibility';
9
11
  export const ExportCsvBanner = ({
@@ -14,6 +16,7 @@ export const ExportCsvBanner = ({
14
16
  isKeepPageOpenWarning,
15
17
  onClose
16
18
  }) => {
19
+ const lang = useLang();
17
20
  const {
18
21
  getLastTasks,
19
22
  getStatus,
@@ -72,13 +75,17 @@ export const ExportCsvBanner = ({
72
75
  status,
73
76
  filename: data.file,
74
77
  args,
75
- progressTitle: 'Exporting list:',
76
- resultSubTitle: 'Result:'
78
+ progressTitle: lang({
79
+ message: 'SMART.EXPORT_CSV.PROGRESS_TITLE'
80
+ }),
81
+ resultSubTitle: lang({
82
+ message: 'SMART.EXPORT_CSV.RESULT_SUBTITLE'
83
+ })
77
84
  });
78
85
  }
79
86
  });
80
87
  }
81
- }, [getLastTasks, isHidden, lastTasksParams, updateExportTask]);
88
+ }, [getLastTasks, isHidden, lastTasksParams, updateExportTask, lang]);
82
89
  const handleClose = useCallback(() => {
83
90
  hide();
84
91
  onClose === null || onClose === void 0 || onClose();
@@ -91,47 +98,61 @@ export const ExportCsvBanner = ({
91
98
  resultSubTitle,
92
99
  progressTitle
93
100
  } = exportTask;
94
- return React.createElement(Horizontal, {
101
+ return _jsxs(Horizontal, {
95
102
  "$padding": 8,
96
103
  "$alignItems": "center",
97
104
  "$border": `1px solid ${Color.DIVIDER}`,
98
105
  "$borderRadius": ShapeRadius.SECTION,
99
- "$bgColor": Color.CLEAR
100
- }, status === 'STATUS_SUCCESS' && React.createElement(ExportResult, {
101
- type: "success",
102
- title: "Exporting complete",
103
- subtitle: `${resultSubTitle} ${filename}`,
104
- handleClose: handleClose,
105
- rightSlot: React.createElement("a", {
106
- href: `/api/v2/statistics/exportMessagesStatistics/download/${filename}`,
107
- download: filename
108
- }, React.createElement(Button, {
109
- color: "secondary",
110
- size: "compact",
111
- icon: React.createElement(DownloadIcon, {
112
- size: "small",
113
- view: "filled"
106
+ "$bgColor": Color.CLEAR,
107
+ children: [status === 'STATUS_SUCCESS' && _jsx(ExportResult, {
108
+ type: "success",
109
+ title: lang({
110
+ message: 'SMART.EXPORT_CSV.SUCCESS_TITLE'
111
+ }),
112
+ subtitle: `${resultSubTitle} ${filename}`,
113
+ handleClose: handleClose,
114
+ rightSlot: _jsx("a", {
115
+ href: `/api/v2/statistics/exportMessagesStatistics/download/${filename}`,
116
+ download: filename,
117
+ children: _jsx(Button, {
118
+ color: "secondary",
119
+ size: "compact",
120
+ icon: _jsx(DownloadIcon, {
121
+ size: "small",
122
+ view: "filled"
123
+ }),
124
+ children: lang({
125
+ message: 'SMART.EXPORT_CSV.DOWNLOAD'
126
+ })
127
+ })
128
+ })
129
+ }), status === 'STATUS_PENDING' && (isKeepPageOpenWarning ? _jsx(ProgressBar, {
130
+ title: progressTitle,
131
+ percentValue: progress,
132
+ rightSlot: _jsx(Text, {
133
+ "$color": Color.WARNING,
134
+ "$variant": "h5",
135
+ "$uppercase": true,
136
+ children: lang({
137
+ message: 'SMART.EXPORT_CSV.KEEP_PAGE_OPEN'
138
+ })
114
139
  })
115
- }, "Download CSV"))
116
- }), status === 'STATUS_PENDING' && (isKeepPageOpenWarning ? React.createElement(ProgressBar, {
117
- title: progressTitle,
118
- percentValue: progress,
119
- rightSlot: React.createElement(Text, {
120
- "$color": Color.WARNING,
121
- "$variant": "h5",
122
- "$uppercase": true
123
- }, "Keep page open during export")
124
- }) : React.createElement(ProgressBar, {
125
- title: progressTitle,
126
- percentValue: progress
127
- })), status === 'STATUS_FAILED' && React.createElement(ExportResult, {
128
- type: "error",
129
- title: "Export failed",
130
- subtitle: "Please try again",
131
- leftSlotIcon: React.createElement(DangerTriangleIcon, {
132
- size: "medium",
133
- view: "filled"
134
- }),
135
- handleClose: handleClose
136
- }));
140
+ }) : _jsx(ProgressBar, {
141
+ title: progressTitle,
142
+ percentValue: progress
143
+ })), status === 'STATUS_FAILED' && _jsx(ExportResult, {
144
+ type: "error",
145
+ title: lang({
146
+ message: 'SMART.EXPORT_CSV.FAILED_TITLE'
147
+ }),
148
+ subtitle: lang({
149
+ message: 'SMART.EXPORT_CSV.FAILED_SUBTITLE'
150
+ }),
151
+ leftSlotIcon: _jsx(DangerTriangleIcon, {
152
+ size: "medium",
153
+ view: "filled"
154
+ }),
155
+ handleClose: handleClose
156
+ })]
157
+ });
137
158
  };
@@ -0,0 +1,2 @@
1
+ import { type ExportCsvMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("@pushwoosh/dumb-components/polyglot").LangProps<ExportCsvMessages>>, useLang: () => (props: import("@pushwoosh/dumb-components/polyglot").LangProps<ExportCsvMessages>) => 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 ExportCsvMessages } from './types';
3
+ export declare const messages: LangMessages<ExportCsvMessages>;
@@ -0,0 +1,9 @@
1
+ export const messages = {
2
+ 'SMART.EXPORT_CSV.PROGRESS_TITLE': 'Exporting list:',
3
+ 'SMART.EXPORT_CSV.RESULT_SUBTITLE': 'Result:',
4
+ 'SMART.EXPORT_CSV.SUCCESS_TITLE': 'Exporting complete',
5
+ 'SMART.EXPORT_CSV.DOWNLOAD': 'Download CSV',
6
+ 'SMART.EXPORT_CSV.KEEP_PAGE_OPEN': 'Keep page open during export',
7
+ 'SMART.EXPORT_CSV.FAILED_TITLE': 'Export failed',
8
+ 'SMART.EXPORT_CSV.FAILED_SUBTITLE': 'Please try again'
9
+ };
@@ -0,0 +1,3 @@
1
+ import type { LangMessages } from '@pushwoosh/dumb-components/polyglot';
2
+ import { type ExportCsvMessages } from './types';
3
+ export declare const messages: LangMessages<ExportCsvMessages>;
@@ -0,0 +1,9 @@
1
+ export const messages = {
2
+ 'SMART.EXPORT_CSV.PROGRESS_TITLE': 'Экспорт списка:',
3
+ 'SMART.EXPORT_CSV.RESULT_SUBTITLE': 'Результат:',
4
+ 'SMART.EXPORT_CSV.SUCCESS_TITLE': 'Экспорт завершён',
5
+ 'SMART.EXPORT_CSV.DOWNLOAD': 'Скачать CSV',
6
+ 'SMART.EXPORT_CSV.KEEP_PAGE_OPEN': 'Не закрывайте страницу во время экспорта',
7
+ 'SMART.EXPORT_CSV.FAILED_TITLE': 'Ошибка экспорта',
8
+ 'SMART.EXPORT_CSV.FAILED_SUBTITLE': 'Попробуйте ещё раз'
9
+ };
@@ -0,0 +1,10 @@
1
+ import type { NoParams } from '@pushwoosh/dumb-components/polyglot';
2
+ export type ExportCsvMessages = {
3
+ 'SMART.EXPORT_CSV.PROGRESS_TITLE': NoParams;
4
+ 'SMART.EXPORT_CSV.RESULT_SUBTITLE': NoParams;
5
+ 'SMART.EXPORT_CSV.SUCCESS_TITLE': NoParams;
6
+ 'SMART.EXPORT_CSV.DOWNLOAD': NoParams;
7
+ 'SMART.EXPORT_CSV.KEEP_PAGE_OPEN': NoParams;
8
+ 'SMART.EXPORT_CSV.FAILED_TITLE': NoParams;
9
+ 'SMART.EXPORT_CSV.FAILED_SUBTITLE': NoParams;
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -60,6 +60,7 @@ export const useExportService = () => {
60
60
  if (retriesRef.current < MAX_RETRIES) {
61
61
  retriesRef.current += 1;
62
62
  timeoutStatusRef.current = setTimeout(() => {
63
+ // eslint-disable-next-line react-hooks/immutability
63
64
  getStatus(params);
64
65
  clearStatusTimeout();
65
66
  }, API_CHECK_INTERVAL);
@@ -1,4 +1,5 @@
1
- import React, { useState } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from 'react';
2
3
  import { Button, ModalHeader, ModalBody, ModalFooter, ModalTitle } from '@pushwoosh/dumb-components';
3
4
  import { Horizontal } from '@pushwoosh/kit-helpers';
4
5
  import { LanguagesSelectFormLoader } from './LanguagesSelectFormLoader';
@@ -12,27 +13,40 @@ export const LanguagesModal = ({
12
13
  }) => {
13
14
  const lang = useLang();
14
15
  const [selectedLanguages, setSelectedLanguages] = useState(initialLanguages);
15
- return React.createElement(React.Fragment, null, React.createElement(ModalHeader, null, React.createElement(ModalTitle, null, lang({
16
- message: 'SMART.LANGUAGES_SELECTOR.MODAL.TITLE'
17
- }))), React.createElement(ModalBody, null, React.createElement(LanguagesSelectFormLoader, {
18
- application: applicationCode,
19
- onChange: setSelectedLanguages,
20
- value: selectedLanguages
21
- })), React.createElement(ModalFooter, null, React.createElement(Horizontal, {
22
- "$justifyContent": "end",
23
- "$gap": 8
24
- }, React.createElement(Button, {
25
- color: "secondary",
26
- onClick: onClose
27
- }, lang({
28
- message: 'SMART.LANGUAGES_SELECTOR.BUTTON.CANCEL'
29
- })), React.createElement(Button, {
30
- color: "primary",
31
- onClick: () => {
32
- saveLastSelection(selectedLanguages);
33
- onSubmit(selectedLanguages);
34
- }
35
- }, lang({
36
- message: 'SMART.LANGUAGES_SELECTOR.BUTTON.APPLY'
37
- })))));
16
+ return _jsxs(_Fragment, {
17
+ children: [_jsx(ModalHeader, {
18
+ children: _jsx(ModalTitle, {
19
+ children: lang({
20
+ message: 'SMART.LANGUAGES_SELECTOR.MODAL.TITLE'
21
+ })
22
+ })
23
+ }), _jsx(ModalBody, {
24
+ children: _jsx(LanguagesSelectFormLoader, {
25
+ application: applicationCode,
26
+ onChange: setSelectedLanguages,
27
+ value: selectedLanguages
28
+ })
29
+ }), _jsx(ModalFooter, {
30
+ children: _jsxs(Horizontal, {
31
+ "$justifyContent": "end",
32
+ "$gap": 8,
33
+ children: [_jsx(Button, {
34
+ color: "secondary",
35
+ onClick: onClose,
36
+ children: lang({
37
+ message: 'SMART.LANGUAGES_SELECTOR.BUTTON.CANCEL'
38
+ })
39
+ }), _jsx(Button, {
40
+ color: "primary",
41
+ onClick: () => {
42
+ saveLastSelection(selectedLanguages);
43
+ onSubmit(selectedLanguages);
44
+ },
45
+ children: lang({
46
+ message: 'SMART.LANGUAGES_SELECTOR.BUTTON.APPLY'
47
+ })
48
+ })]
49
+ })
50
+ })]
51
+ });
38
52
  };
@@ -1,4 +1,5 @@
1
- import React, { useMemo, useState } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo, useState } from 'react';
2
3
  import { Checkbox, SearchInput } from '@pushwoosh/dumb-components';
3
4
  import { Columns, Horizontal, Vertical } from '@pushwoosh/kit-helpers';
4
5
  import { useLang } from './polyglot';
@@ -24,65 +25,75 @@ export const LanguagesSelectForm = ({
24
25
  return item.name.toLowerCase().includes(search.toLowerCase());
25
26
  });
26
27
  }, [allLanguageItems, search, showAllLanguages, langs]);
27
- return React.createElement(Vertical, {
28
- "$gap": 8
29
- }, React.createElement(SearchInput, {
30
- value: search,
31
- onChange: e => setSearch(e.target.value),
32
- "$onClear": () => setSearch(''),
33
- placeholder: lang({
34
- message: 'SMART.LANGUAGES_SELECTOR.SEARCH_PLACEHOLDER'
35
- })
36
- }), React.createElement(Horizontal, {
37
- "$justifyContent": "space-between"
38
- }, React.createElement(Horizontal, {
39
- "$gap": 16,
40
- "$justifyContent": "start"
41
- }, React.createElement(ActionButton, {
42
- onClick: () => {
43
- onChange(filteredLanguages.map(item => item.code));
44
- }
45
- }, lang({
46
- message: 'SMART.LANGUAGES_SELECTOR.ACTION.SELECT_ALL'
47
- })), React.createElement(ActionButton, {
48
- onClick: () => {
49
- onChange([]);
50
- }
51
- }, lang({
52
- message: 'SMART.LANGUAGES_SELECTOR.ACTION.DESELECT_ALL'
53
- }))), lastSelection.length > 0 && React.createElement(ActionButton, {
54
- onClick: () => {
55
- onChange(lastSelection);
56
- }
57
- }, lang({
58
- message: 'SMART.LANGUAGES_SELECTOR.ACTION.REUSE_LAST'
59
- }))), React.createElement(Vertical, {
60
- "$gap": 24
61
- }, React.createElement(Columns, {
62
- "$sizes": 3,
63
- "$gap": 8
64
- }, filteredLanguages.map(item => React.createElement(Checkbox, {
65
- name: "languages",
66
- value: item.code,
67
- isChecked: langs.includes(item.code),
68
- onChange: isChecked => {
69
- if (isChecked) {
70
- onChange([...langs, item.code]);
71
- } else {
72
- onChange(langs.filter(code => code !== item.code));
73
- }
74
- },
75
- label: lang({
76
- message: 'SMART.LANGUAGES_SELECTOR.CHECKBOX_LABEL',
77
- name: getLangName(item.code),
78
- subscribers: item.subscribers
79
- }),
80
- key: item.code
81
- }))), React.createElement("div", null, React.createElement(ActionButton, {
82
- onClick: () => setShowAllLanguages(x => !x)
83
- }, showAllLanguages ? lang({
84
- message: 'SMART.LANGUAGES_SELECTOR.ACTION.SHOW_WITH_SUBSCRIBERS'
85
- }) : lang({
86
- message: 'SMART.LANGUAGES_SELECTOR.ACTION.SHOW_ALL'
87
- })))));
28
+ return _jsxs(Vertical, {
29
+ "$gap": 8,
30
+ children: [_jsx(SearchInput, {
31
+ value: search,
32
+ onChange: e => setSearch(e.target.value),
33
+ "$onClear": () => setSearch(''),
34
+ placeholder: lang({
35
+ message: 'SMART.LANGUAGES_SELECTOR.SEARCH_PLACEHOLDER'
36
+ })
37
+ }), _jsxs(Horizontal, {
38
+ "$justifyContent": "space-between",
39
+ children: [_jsxs(Horizontal, {
40
+ "$gap": 16,
41
+ "$justifyContent": "start",
42
+ children: [_jsx(ActionButton, {
43
+ onClick: () => {
44
+ onChange(filteredLanguages.map(item => item.code));
45
+ },
46
+ children: lang({
47
+ message: 'SMART.LANGUAGES_SELECTOR.ACTION.SELECT_ALL'
48
+ })
49
+ }), _jsx(ActionButton, {
50
+ onClick: () => {
51
+ onChange([]);
52
+ },
53
+ children: lang({
54
+ message: 'SMART.LANGUAGES_SELECTOR.ACTION.DESELECT_ALL'
55
+ })
56
+ })]
57
+ }), lastSelection.length > 0 && _jsx(ActionButton, {
58
+ onClick: () => {
59
+ onChange(lastSelection);
60
+ },
61
+ children: lang({
62
+ message: 'SMART.LANGUAGES_SELECTOR.ACTION.REUSE_LAST'
63
+ })
64
+ })]
65
+ }), _jsxs(Vertical, {
66
+ "$gap": 24,
67
+ children: [_jsx(Columns, {
68
+ "$sizes": 3,
69
+ "$gap": 8,
70
+ children: filteredLanguages.map(item => _jsx(Checkbox, {
71
+ name: "languages",
72
+ value: item.code,
73
+ isChecked: langs.includes(item.code),
74
+ onChange: isChecked => {
75
+ if (isChecked) {
76
+ onChange([...langs, item.code]);
77
+ } else {
78
+ onChange(langs.filter(code => code !== item.code));
79
+ }
80
+ },
81
+ label: lang({
82
+ message: 'SMART.LANGUAGES_SELECTOR.CHECKBOX_LABEL',
83
+ name: getLangName(item.code),
84
+ subscribers: item.subscribers
85
+ })
86
+ }, item.code))
87
+ }), _jsx("div", {
88
+ children: _jsx(ActionButton, {
89
+ onClick: () => setShowAllLanguages(x => !x),
90
+ children: showAllLanguages ? lang({
91
+ message: 'SMART.LANGUAGES_SELECTOR.ACTION.SHOW_WITH_SUBSCRIBERS'
92
+ }) : lang({
93
+ message: 'SMART.LANGUAGES_SELECTOR.ACTION.SHOW_ALL'
94
+ })
95
+ })
96
+ })]
97
+ })]
98
+ });
88
99
  };
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Spinner } from '@pushwoosh/dumb-components';
3
3
  import { Horizontal, useAsync } from '@pushwoosh/kit-helpers';
4
4
  import { useSPAContext } from '@pushwoosh/spa-context';
@@ -38,14 +38,15 @@ export const LanguagesSelectFormLoader = ({
38
38
  });
39
39
  }, [application, getLangName, systemLanguage]);
40
40
  if (langAsync.loading) {
41
- return React.createElement(Horizontal, {
41
+ return _jsx(Horizontal, {
42
42
  "$placeItems": "center",
43
- "$padding": 36
44
- }, React.createElement(Spinner, {
45
- size: "medium"
46
- }));
43
+ "$padding": 36,
44
+ children: _jsx(Spinner, {
45
+ size: "medium"
46
+ })
47
+ });
47
48
  }
48
- return React.createElement(LanguagesSelectForm, {
49
+ return _jsx(LanguagesSelectForm, {
49
50
  allLanguageItems: langAsync.value,
50
51
  langs: value,
51
52
  onChange: onChange,