@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
@@ -1,4 +1,5 @@
1
- import React 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 { useParams } from 'react-router-dom';
3
4
  import { Link, Spinner } from '@pushwoosh/dumb-components';
4
5
  import { Color, PlatformsIcons, PlatformsLabels, Tag } from '@pushwoosh/kit-constants';
@@ -8,10 +9,12 @@ import { Text } from '@pushwoosh/kit-typography';
8
9
  import { useSPAContext } from '@pushwoosh/spa-context';
9
10
  import { LinkRow, ClickActionSection } from './styles';
10
11
  import { getSafariUrl, isWebLink } from '../../helpers';
12
+ import { Lang, useLang } from '../../polyglot';
11
13
  export const OpenActionsSummary = ({
12
14
  openActions
13
15
  }) => {
14
16
  var _applicationData$valu;
17
+ const lang = useLang();
15
18
  const {
16
19
  platformsDeeplinkUrls = {},
17
20
  defaultDeeplinkUrl: allPlatformsDeeplinkUrl,
@@ -25,43 +28,63 @@ export const OpenActionsSummary = ({
25
28
  const {
26
29
  rpcGateway
27
30
  } = useSPAContext();
31
+ // Стабильный кэш-бастер для легаси-ссылки рич-медиа: ленивый инициализатор
32
+ // useState вычисляет Date.now() один раз на маунт (вне render-scope), чтобы
33
+ // href не менялся на каждый ререндер (react-hooks/purity).
34
+ const [richmediaCacheBuster] = useState(() => Date.now());
28
35
  const applicationData = useAsync(() => applicationCode ? rpcGateway.applications.Get({
29
36
  code: applicationCode
30
37
  }) : Promise.resolve(undefined), [rpcGateway, applicationCode]);
31
38
  const hasCustomPlatformsDeeplink = Object.keys(platformsDeeplinkUrls).length > 0;
32
39
  const safariUrl = getSafariUrl((applicationData === null || applicationData === void 0 || (_applicationData$valu = applicationData.value) === null || _applicationData$valu === void 0 ? void 0 : _applicationData$valu.application) || null, safariUrlArgs ?? '');
33
- const renderInfoBlock = (device, action, url = null, urlText) => React.createElement(Vertical, null, React.createElement("span", null, "For", ' ', React.createElement("strong", null, device), ' ', "subscribers:", ' ', React.createElement("strong", null, action)), url && React.createElement(LinkRow, null, React.createElement(Link, {
34
- as: Tag.A,
35
- rel: "noopener noreferrer",
36
- target: "_blank",
37
- href: url
38
- }, React.createElement(Horizontal, {
39
- "$alignItems": "center",
40
- "$justifyContent": "start",
41
- "$gap": 4
42
- }, urlText ?? url, React.createElement(OpenIcon, {
43
- view: "lined",
44
- size: "small"
45
- })))));
46
- const renderPlatformDeepLink = (platformKey, url, label = 'deep link') => {
40
+ const renderInfoBlock = (device, action, url = null, urlText) => _jsxs(Vertical, {
41
+ children: [_jsx("span", {
42
+ children: _jsx(Lang, {
43
+ message: "SMART.OPEN_ACTIONS.INFO_BLOCK",
44
+ device: device,
45
+ action: action
46
+ })
47
+ }), url && _jsx(LinkRow, {
48
+ children: _jsx(Link, {
49
+ as: Tag.A,
50
+ rel: "noopener noreferrer",
51
+ target: "_blank",
52
+ href: url,
53
+ children: _jsxs(Horizontal, {
54
+ "$alignItems": "center",
55
+ "$justifyContent": "start",
56
+ "$gap": 4,
57
+ children: [urlText ?? url, _jsx(OpenIcon, {
58
+ view: "lined",
59
+ size: "small"
60
+ })]
61
+ })
62
+ })
63
+ })]
64
+ });
65
+ const renderPlatformDeepLink = (platformKey, url, label) => {
47
66
  const isEnumKey = typeof platformKey === 'number';
48
67
  const icon = isEnumKey ? PlatformsIcons[platformKey] : null;
49
68
  const labelText = isEnumKey ? PlatformsLabels[platformKey] : platformKey;
50
- return React.createElement(ClickActionSection, {
51
- key: platformKey
52
- }, React.createElement(Horizontal, {
53
- "$alignItems": "start",
54
- "$justifyContent": "start",
55
- "$gap": 8
56
- }, icon && React.createElement(PlatformLogoIcon, {
57
- size: "small",
58
- type: icon,
59
- color: Color.LOCKED
60
- }), React.createElement(Text, {
61
- "$variant": "h4",
62
- "$color": Color.LOCKED,
63
- "$uppercase": true
64
- }, labelText, ' ', label)), React.createElement(LinkRow, null, url));
69
+ return _jsxs(ClickActionSection, {
70
+ children: [_jsxs(Horizontal, {
71
+ "$alignItems": "start",
72
+ "$justifyContent": "start",
73
+ "$gap": 8,
74
+ children: [icon && _jsx(PlatformLogoIcon, {
75
+ size: "small",
76
+ type: icon,
77
+ color: Color.LOCKED
78
+ }), _jsxs(Text, {
79
+ "$variant": "h4",
80
+ "$color": Color.LOCKED,
81
+ "$uppercase": true,
82
+ children: [labelText, ' ', label]
83
+ })]
84
+ }), _jsx(LinkRow, {
85
+ children: url
86
+ })]
87
+ }, platformKey);
65
88
  };
66
89
  const getRichmediaLink = ({
67
90
  url,
@@ -69,14 +92,55 @@ export const OpenActionsSummary = ({
69
92
  createdType = 'BUILDER'
70
93
  }) => {
71
94
  if (code) {
72
- return createdType === 'BUILDER' ? `/applications/${applicationCode}/rich-media/${code}/edit` : `/applications/${applicationCode}/richMedia/edit/${Date.now()}/${code}`;
95
+ return createdType === 'BUILDER' ? `/applications/${applicationCode}/rich-media/${code}/edit` : `/applications/${applicationCode}/richMedia/edit/${richmediaCacheBuster}/${code}`;
73
96
  }
74
97
  return url;
75
98
  };
76
- return React.createElement(Vertical, {
77
- "$gap": 8
78
- }, openActions ? React.createElement(React.Fragment, null, showRichmedia && renderInfoBlock('mobile', 'open in-app banner', getRichmediaLink(showRichmedia), showRichmedia.name || showRichmedia.code), !showRichmedia && hasCustomPlatformsDeeplink && renderInfoBlock('mobile', 'follow the Deep link'), !showRichmedia && Object.entries(platformsDeeplinkUrls).map(([platformKey, url]) => renderPlatformDeepLink(+platformKey, url)), !showRichmedia && allPlatformsDeeplinkUrl && hasCustomPlatformsDeeplink && renderPlatformDeepLink('Other platforms', allPlatformsDeeplinkUrl, isWebLink(allPlatformsDeeplinkUrl) ? 'open URL in browser' : 'deep link'), !showRichmedia && allPlatformsDeeplinkUrl && !hasCustomPlatformsDeeplink && renderInfoBlock('mobile', isWebLink(allPlatformsDeeplinkUrl) ? 'open URL in browser' : 'follow the Deep link', allPlatformsDeeplinkUrl), !showRichmedia && !allPlatformsDeeplinkUrl && !hasCustomPlatformsDeeplink && renderInfoBlock('mobile', 'open home page in application'), webPageUrl && renderInfoBlock('web', 'open URL in browser', webPageUrl), webPageUrl && safariUrl && renderInfoBlock('Safari', 'open URL in Safari browser', safariUrl), !webPageUrl && renderInfoBlock('web', 'open home page in browser')) : React.createElement(Spinner, {
79
- color: Color.MAIN,
80
- size: "medium"
81
- }));
99
+ return _jsx(Vertical, {
100
+ "$gap": 8,
101
+ children: openActions ? _jsxs(_Fragment, {
102
+ children: [showRichmedia && renderInfoBlock(lang({
103
+ message: 'SMART.OPEN_ACTIONS.DEVICE.MOBILE'
104
+ }), lang({
105
+ message: 'SMART.OPEN_ACTIONS.ACTION.OPEN_INAPP'
106
+ }), getRichmediaLink(showRichmedia), showRichmedia.name || showRichmedia.code), !showRichmedia && hasCustomPlatformsDeeplink && renderInfoBlock(lang({
107
+ message: 'SMART.OPEN_ACTIONS.DEVICE.MOBILE'
108
+ }), lang({
109
+ message: 'SMART.OPEN_ACTIONS.ACTION.FOLLOW_DEEPLINK'
110
+ })), !showRichmedia && Object.entries(platformsDeeplinkUrls).map(([platformKey, url]) => renderPlatformDeepLink(+platformKey, url, lang({
111
+ message: 'SMART.OPEN_ACTIONS.ACTION.DEEP_LINK'
112
+ }))), !showRichmedia && allPlatformsDeeplinkUrl && hasCustomPlatformsDeeplink && renderPlatformDeepLink(lang({
113
+ message: 'SMART.OPEN_ACTIONS.DEVICE.OTHER_PLATFORMS'
114
+ }), allPlatformsDeeplinkUrl, isWebLink(allPlatformsDeeplinkUrl) ? lang({
115
+ message: 'SMART.OPEN_ACTIONS.ACTION.OPEN_URL_BROWSER'
116
+ }) : lang({
117
+ message: 'SMART.OPEN_ACTIONS.ACTION.DEEP_LINK'
118
+ })), !showRichmedia && allPlatformsDeeplinkUrl && !hasCustomPlatformsDeeplink && renderInfoBlock(lang({
119
+ message: 'SMART.OPEN_ACTIONS.DEVICE.MOBILE'
120
+ }), isWebLink(allPlatformsDeeplinkUrl) ? lang({
121
+ message: 'SMART.OPEN_ACTIONS.ACTION.OPEN_URL_BROWSER'
122
+ }) : lang({
123
+ message: 'SMART.OPEN_ACTIONS.ACTION.FOLLOW_DEEPLINK'
124
+ }), allPlatformsDeeplinkUrl), !showRichmedia && !allPlatformsDeeplinkUrl && !hasCustomPlatformsDeeplink && renderInfoBlock(lang({
125
+ message: 'SMART.OPEN_ACTIONS.DEVICE.MOBILE'
126
+ }), lang({
127
+ message: 'SMART.OPEN_ACTIONS.ACTION.OPEN_HOME_APP'
128
+ })), webPageUrl && renderInfoBlock(lang({
129
+ message: 'SMART.OPEN_ACTIONS.DEVICE.WEB'
130
+ }), lang({
131
+ message: 'SMART.OPEN_ACTIONS.ACTION.OPEN_URL_BROWSER'
132
+ }), webPageUrl), webPageUrl && safariUrl && renderInfoBlock(lang({
133
+ message: 'SMART.OPEN_ACTIONS.DEVICE.SAFARI'
134
+ }), lang({
135
+ message: 'SMART.OPEN_ACTIONS.ACTION.OPEN_URL_SAFARI'
136
+ }), safariUrl), !webPageUrl && renderInfoBlock(lang({
137
+ message: 'SMART.OPEN_ACTIONS.DEVICE.WEB'
138
+ }), lang({
139
+ message: 'SMART.OPEN_ACTIONS.ACTION.OPEN_HOME_BROWSER'
140
+ }))]
141
+ }) : _jsx(Spinner, {
142
+ color: Color.MAIN,
143
+ size: "medium"
144
+ })
145
+ });
82
146
  };
@@ -1,7 +1,6 @@
1
- import React from 'react';
2
1
  import { type Preset } from '@pushwoosh/rpc-v2-http-api-data/presets';
3
2
  type OpenActionsByPresetProps = {
4
3
  pushPreset: Preset;
5
4
  };
6
- export declare const OpenActionsSummaryByPreset: ({ pushPreset }: OpenActionsByPresetProps) => React.JSX.Element;
5
+ export declare const OpenActionsSummaryByPreset: ({ pushPreset }: OpenActionsByPresetProps) => import("react").JSX.Element;
7
6
  export {};
@@ -1,11 +1,11 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { OpenActionsSummary } from './OpenActionsSummary';
3
3
  import { usePresetOpenActions } from '../usePresetOpenActions';
4
4
  export const OpenActionsSummaryByPreset = ({
5
5
  pushPreset
6
6
  }) => {
7
7
  const openActions = usePresetOpenActions(pushPreset);
8
- return React.createElement(OpenActionsSummary, {
8
+ return _jsx(OpenActionsSummary, {
9
9
  openActions: openActions
10
10
  });
11
11
  };
@@ -0,0 +1,2 @@
1
+ import { type OpenActionsMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("@pushwoosh/dumb-components/polyglot").LangProps<OpenActionsMessages>>, useLang: () => (props: import("@pushwoosh/dumb-components/polyglot").LangProps<OpenActionsMessages>) => 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 OpenActionsMessages } from './types';
3
+ export declare const messages: LangMessages<OpenActionsMessages>;
@@ -0,0 +1,14 @@
1
+ export const messages = {
2
+ 'SMART.OPEN_ACTIONS.INFO_BLOCK': 'For <strong>{{device}}</strong> subscribers: <strong>{{action}}</strong>',
3
+ 'SMART.OPEN_ACTIONS.DEVICE.MOBILE': 'mobile',
4
+ 'SMART.OPEN_ACTIONS.DEVICE.WEB': 'web',
5
+ 'SMART.OPEN_ACTIONS.DEVICE.SAFARI': 'Safari',
6
+ 'SMART.OPEN_ACTIONS.DEVICE.OTHER_PLATFORMS': 'Other platforms',
7
+ 'SMART.OPEN_ACTIONS.ACTION.OPEN_INAPP': 'open in-app banner',
8
+ 'SMART.OPEN_ACTIONS.ACTION.FOLLOW_DEEPLINK': 'follow the Deep link',
9
+ 'SMART.OPEN_ACTIONS.ACTION.OPEN_URL_BROWSER': 'open URL in browser',
10
+ 'SMART.OPEN_ACTIONS.ACTION.DEEP_LINK': 'deep link',
11
+ 'SMART.OPEN_ACTIONS.ACTION.OPEN_HOME_APP': 'open home page in application',
12
+ 'SMART.OPEN_ACTIONS.ACTION.OPEN_URL_SAFARI': 'open URL in Safari browser',
13
+ 'SMART.OPEN_ACTIONS.ACTION.OPEN_HOME_BROWSER': 'open home page in browser'
14
+ };
@@ -0,0 +1,3 @@
1
+ import type { LangMessages } from '@pushwoosh/dumb-components/polyglot';
2
+ import { type OpenActionsMessages } from './types';
3
+ export declare const messages: LangMessages<OpenActionsMessages>;
@@ -0,0 +1,14 @@
1
+ export const messages = {
2
+ 'SMART.OPEN_ACTIONS.INFO_BLOCK': 'Для подписчиков <strong>{{device}}</strong>: <strong>{{action}}</strong>',
3
+ 'SMART.OPEN_ACTIONS.DEVICE.MOBILE': 'мобильных приложений',
4
+ 'SMART.OPEN_ACTIONS.DEVICE.WEB': 'веба',
5
+ 'SMART.OPEN_ACTIONS.DEVICE.SAFARI': 'Safari',
6
+ 'SMART.OPEN_ACTIONS.DEVICE.OTHER_PLATFORMS': 'Другие платформы',
7
+ 'SMART.OPEN_ACTIONS.ACTION.OPEN_INAPP': 'открыть in-app баннер',
8
+ 'SMART.OPEN_ACTIONS.ACTION.FOLLOW_DEEPLINK': 'перейти по диплинку',
9
+ 'SMART.OPEN_ACTIONS.ACTION.OPEN_URL_BROWSER': 'открыть URL в браузере',
10
+ 'SMART.OPEN_ACTIONS.ACTION.DEEP_LINK': 'диплинк',
11
+ 'SMART.OPEN_ACTIONS.ACTION.OPEN_HOME_APP': 'открыть главную страницу в приложении',
12
+ 'SMART.OPEN_ACTIONS.ACTION.OPEN_URL_SAFARI': 'открыть URL в браузере Safari',
13
+ 'SMART.OPEN_ACTIONS.ACTION.OPEN_HOME_BROWSER': 'открыть главную страницу в браузере'
14
+ };
@@ -0,0 +1,18 @@
1
+ import type { NoParams } from '@pushwoosh/dumb-components/polyglot';
2
+ export type OpenActionsMessages = {
3
+ 'SMART.OPEN_ACTIONS.INFO_BLOCK': {
4
+ device: string;
5
+ action: string;
6
+ };
7
+ 'SMART.OPEN_ACTIONS.DEVICE.MOBILE': NoParams;
8
+ 'SMART.OPEN_ACTIONS.DEVICE.WEB': NoParams;
9
+ 'SMART.OPEN_ACTIONS.DEVICE.SAFARI': NoParams;
10
+ 'SMART.OPEN_ACTIONS.DEVICE.OTHER_PLATFORMS': NoParams;
11
+ 'SMART.OPEN_ACTIONS.ACTION.OPEN_INAPP': NoParams;
12
+ 'SMART.OPEN_ACTIONS.ACTION.FOLLOW_DEEPLINK': NoParams;
13
+ 'SMART.OPEN_ACTIONS.ACTION.OPEN_URL_BROWSER': NoParams;
14
+ 'SMART.OPEN_ACTIONS.ACTION.DEEP_LINK': NoParams;
15
+ 'SMART.OPEN_ACTIONS.ACTION.OPEN_HOME_APP': NoParams;
16
+ 'SMART.OPEN_ACTIONS.ACTION.OPEN_URL_SAFARI': NoParams;
17
+ 'SMART.OPEN_ACTIONS.ACTION.OPEN_HOME_BROWSER': NoParams;
18
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
- import React, { useState } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
2
3
  import { Drawer, DrawerBody } from '@pushwoosh/dumb-components';
3
4
  import { DesktopPage } from './components/DesktopPage';
4
5
  import { MainPage } from './components/MainPage';
@@ -19,22 +20,25 @@ export function PlatformsConfigurationDrawer(props) {
19
20
  setIsOpenDesktopPage(false);
20
21
  onClose();
21
22
  };
22
- return React.createElement(Drawer, {
23
+ return _jsx(Drawer, {
23
24
  size: "medium",
24
25
  isOpen: isOpen,
25
- onClose: onClose
26
- }, React.createElement(DrawerBody, null, isOpenMobilePage && React.createElement(MobilePage, {
27
- application: application,
28
- onBack: toggleMobilePage,
29
- onClose: onCloseHandler
30
- }), isOpenDesktopPage && React.createElement(DesktopPage, {
31
- application: application,
32
- onBack: toggleDesktopPage,
33
- onClose: onCloseHandler
34
- }), !isOpenDesktopPage && !isOpenMobilePage && React.createElement(MainPage, {
35
- application: application,
36
- onClickMobile: toggleMobilePage,
37
- onClickDesktop: toggleDesktopPage,
38
- onClose: onCloseHandler
39
- })));
26
+ onClose: onClose,
27
+ children: _jsxs(DrawerBody, {
28
+ children: [isOpenMobilePage && _jsx(MobilePage, {
29
+ application: application,
30
+ onBack: toggleMobilePage,
31
+ onClose: onCloseHandler
32
+ }), isOpenDesktopPage && _jsx(DesktopPage, {
33
+ application: application,
34
+ onBack: toggleDesktopPage,
35
+ onClose: onCloseHandler
36
+ }), !isOpenDesktopPage && !isOpenMobilePage && _jsx(MainPage, {
37
+ application: application,
38
+ onClickMobile: toggleMobilePage,
39
+ onClickDesktop: toggleDesktopPage,
40
+ onClose: onCloseHandler
41
+ })]
42
+ })
43
+ });
40
44
  }
@@ -1,9 +1,10 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Button } from '@pushwoosh/dumb-components';
3
3
  import { Color, AllPlatforms } from '@pushwoosh/kit-constants';
4
4
  import { Vertical, Columns } from '@pushwoosh/kit-helpers';
5
5
  import { ArrowRoundIcon, CloseIcon, PlatformLogoIcon } from '@pushwoosh/kit-icons';
6
6
  import { H2, H4, Text } from '@pushwoosh/kit-typography';
7
+ import { useLang } from '../../polyglot';
7
8
  import { ColumnsWrapper, BreadCrumbs, Header, Close, Card, CardIcon } from '../../styled';
8
9
  export function DesktopPage(props) {
9
10
  const {
@@ -11,62 +12,118 @@ export function DesktopPage(props) {
11
12
  onBack,
12
13
  onClose
13
14
  } = props;
15
+ const lang = useLang();
14
16
  const hasWindowsPlatform = Object.hasOwn((application === null || application === void 0 ? void 0 : application.platforms) || {}, AllPlatforms.Windows);
15
17
  const hasMacOSPlatform = Object.hasOwn((application === null || application === void 0 ? void 0 : application.platforms) || {}, AllPlatforms.OSX);
16
- return React.createElement(React.Fragment, null, React.createElement(Header, null, React.createElement(ColumnsWrapper, null, React.createElement(Columns, {
17
- "$sizes": "auto 1fr auto",
18
- "$alignItems": "center",
19
- "$gap": 6
20
- }, React.createElement(Button, {
21
- color: "primary",
22
- view: "ghost",
23
- onClick: onBack
24
- }, React.createElement(ArrowRoundIcon, {
25
- direction: "left",
26
- size: "medium",
27
- view: "filled"
28
- })), React.createElement(H2, null, "Platform for desktop app"), React.createElement(Close, null, React.createElement(Button, {
29
- view: "ghost",
30
- color: "secondary",
31
- icon: React.createElement(CloseIcon, {
32
- size: "medium"
33
- }),
34
- onClick: onClose
35
- }))), React.createElement(BreadCrumbs, null, React.createElement(Text, {
36
- "$color": Color.LOCKED
37
- }, "Channel"), React.createElement(Text, {
38
- "$color": Color.LOCKED
39
- }, "\u00A0\u203A\u00A0"), React.createElement(Text, {
40
- "$color": Color.LOCKED
41
- }, "Platform"), React.createElement(Text, {
42
- "$color": Color.PHANTOM
43
- }, "\u00A0\u203A\u00A0"), React.createElement(Text, {
44
- "$color": Color.PHANTOM
45
- }, "Gateway"), React.createElement(Text, {
46
- "$color": Color.PHANTOM
47
- }, "\u00A0\u203A\u00A0"), React.createElement(Text, {
48
- "$color": Color.PHANTOM
49
- }, "SDK"), React.createElement(Text, {
50
- "$color": Color.PHANTOM
51
- }, "\u00A0\u203A\u00A0"), React.createElement(Text, {
52
- "$color": Color.PHANTOM
53
- }, "Test message")))), React.createElement(Vertical, {
54
- "$padding": "12px 0 0",
55
- "$gap": 8
56
- }, React.createElement(H4, null, "Which platform will we configure first?"), React.createElement(Columns, {
57
- "$sizes": "1fr 1fr",
58
- "$gap": 6
59
- }, hasWindowsPlatform && React.createElement(Card, {
60
- as: "a",
61
- href: `/applications/${application === null || application === void 0 ? void 0 : application.code}/configure`
62
- }, React.createElement(CardIcon, null, React.createElement(PlatformLogoIcon, {
63
- type: "windows",
64
- size: "medium"
65
- })), React.createElement(H4, null, "Windows")), hasMacOSPlatform && React.createElement(Card, {
66
- as: "a",
67
- href: `/applications/${application === null || application === void 0 ? void 0 : application.code}/configure/osx`
68
- }, React.createElement(CardIcon, null, React.createElement(PlatformLogoIcon, {
69
- type: "macos",
70
- size: "medium"
71
- })), React.createElement(H4, null, "MacOS")))));
18
+ return _jsxs(_Fragment, {
19
+ children: [_jsx(Header, {
20
+ children: _jsxs(ColumnsWrapper, {
21
+ children: [_jsxs(Columns, {
22
+ "$sizes": "auto 1fr auto",
23
+ "$alignItems": "center",
24
+ "$gap": 6,
25
+ children: [_jsx(Button, {
26
+ color: "primary",
27
+ view: "ghost",
28
+ onClick: onBack,
29
+ children: _jsx(ArrowRoundIcon, {
30
+ direction: "left",
31
+ size: "medium",
32
+ view: "filled"
33
+ })
34
+ }), _jsx(H2, {
35
+ children: lang({
36
+ message: 'SMART.PLATFORMS_CONFIGURATION_DRAWER.DESKTOP.HEADING'
37
+ })
38
+ }), _jsx(Close, {
39
+ children: _jsx(Button, {
40
+ view: "ghost",
41
+ color: "secondary",
42
+ icon: _jsx(CloseIcon, {
43
+ size: "medium"
44
+ }),
45
+ onClick: onClose
46
+ })
47
+ })]
48
+ }), _jsxs(BreadCrumbs, {
49
+ children: [_jsx(Text, {
50
+ "$color": Color.LOCKED,
51
+ children: lang({
52
+ message: 'SMART.PLATFORMS_CONFIGURATION_DRAWER.BREADCRUMB.CHANNEL'
53
+ })
54
+ }), _jsx(Text, {
55
+ "$color": Color.LOCKED,
56
+ children: "\u00A0\u203A\u00A0"
57
+ }), _jsx(Text, {
58
+ "$color": Color.LOCKED,
59
+ children: lang({
60
+ message: 'SMART.PLATFORMS_CONFIGURATION_DRAWER.BREADCRUMB.PLATFORM'
61
+ })
62
+ }), _jsx(Text, {
63
+ "$color": Color.PHANTOM,
64
+ children: "\u00A0\u203A\u00A0"
65
+ }), _jsx(Text, {
66
+ "$color": Color.PHANTOM,
67
+ children: lang({
68
+ message: 'SMART.PLATFORMS_CONFIGURATION_DRAWER.BREADCRUMB.GATEWAY'
69
+ })
70
+ }), _jsx(Text, {
71
+ "$color": Color.PHANTOM,
72
+ children: "\u00A0\u203A\u00A0"
73
+ }), _jsx(Text, {
74
+ "$color": Color.PHANTOM,
75
+ children: lang({
76
+ message: 'SMART.PLATFORMS_CONFIGURATION_DRAWER.BREADCRUMB.SDK'
77
+ })
78
+ }), _jsx(Text, {
79
+ "$color": Color.PHANTOM,
80
+ children: "\u00A0\u203A\u00A0"
81
+ }), _jsx(Text, {
82
+ "$color": Color.PHANTOM,
83
+ children: lang({
84
+ message: 'SMART.PLATFORMS_CONFIGURATION_DRAWER.BREADCRUMB.TEST_MESSAGE'
85
+ })
86
+ })]
87
+ })]
88
+ })
89
+ }), _jsxs(Vertical, {
90
+ "$padding": "12px 0 0",
91
+ "$gap": 8,
92
+ children: [_jsx(H4, {
93
+ children: lang({
94
+ message: 'SMART.PLATFORMS_CONFIGURATION_DRAWER.PLATFORM_QUESTION'
95
+ })
96
+ }), _jsxs(Columns, {
97
+ "$sizes": "1fr 1fr",
98
+ "$gap": 6,
99
+ children: [hasWindowsPlatform && _jsxs(Card, {
100
+ as: "a",
101
+ href: `/applications/${application === null || application === void 0 ? void 0 : application.code}/configure`,
102
+ children: [_jsx(CardIcon, {
103
+ children: _jsx(PlatformLogoIcon, {
104
+ type: "windows",
105
+ size: "medium"
106
+ })
107
+ }), _jsx(H4, {
108
+ children: lang({
109
+ message: 'SMART.PLATFORMS_CONFIGURATION_DRAWER.CARD.WINDOWS'
110
+ })
111
+ })]
112
+ }), hasMacOSPlatform && _jsxs(Card, {
113
+ as: "a",
114
+ href: `/applications/${application === null || application === void 0 ? void 0 : application.code}/configure/osx`,
115
+ children: [_jsx(CardIcon, {
116
+ children: _jsx(PlatformLogoIcon, {
117
+ type: "macos",
118
+ size: "medium"
119
+ })
120
+ }), _jsx(H4, {
121
+ children: lang({
122
+ message: 'SMART.PLATFORMS_CONFIGURATION_DRAWER.CARD.MACOS'
123
+ })
124
+ })]
125
+ })]
126
+ })]
127
+ })]
128
+ });
72
129
  }