@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,63 +1,74 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { FieldBox, NativeInput, Select } from '@pushwoosh/dumb-components';
3
3
  import { Vertical } from '@pushwoosh/kit-helpers';
4
+ import { useLang } from './polyglot';
4
5
  export const DynamicContentEventPickerForm = ({
5
6
  dc,
6
7
  events,
7
8
  onChange
8
9
  }) => {
10
+ const lang = useLang();
9
11
  const currentEvent = events.find(tag => tag.name === dc.eventName) || {
10
12
  name: '',
11
13
  attributes: []
12
14
  };
13
- return React.createElement(Vertical, {
14
- "$gap": 16
15
- }, React.createElement(Select, {
16
- value: {
17
- value: dc.eventName,
18
- label: dc.eventName
19
- },
20
- onChange: option => {
21
- onChange({
22
- eventName: option.value,
23
- attribute: '',
24
- defaultValue: ''
25
- });
26
- },
27
- options: events.map(event => ({
28
- value: event.name,
29
- label: event.name
30
- })),
31
- placeholder: "Select an event"
32
- }), React.createElement(FieldBox, {
33
- title: "Attribute"
34
- }, React.createElement(Select, {
35
- value: {
36
- value: dc.attribute,
37
- label: dc.attribute
38
- },
39
- onChange: option => {
40
- onChange({
41
- ...dc,
42
- attribute: option.value
43
- });
44
- },
45
- options: currentEvent.attributes.map(attr => ({
46
- value: attr.name,
47
- label: attr.name
48
- })),
49
- isDisabled: !currentEvent.name
50
- })), React.createElement(FieldBox, {
51
- title: "Fallback text",
52
- isOptional: true
53
- }, React.createElement(NativeInput, {
54
- value: dc.defaultValue,
55
- onChange: e => {
56
- onChange({
57
- ...dc,
58
- defaultValue: e.target.value
59
- });
60
- },
61
- disabled: !currentEvent.name
62
- })));
15
+ return _jsxs(Vertical, {
16
+ "$gap": 16,
17
+ children: [_jsx(Select, {
18
+ value: {
19
+ value: dc.eventName,
20
+ label: dc.eventName
21
+ },
22
+ onChange: option => {
23
+ onChange({
24
+ eventName: option.value,
25
+ attribute: '',
26
+ defaultValue: ''
27
+ });
28
+ },
29
+ options: events.map(event => ({
30
+ value: event.name,
31
+ label: event.name
32
+ })),
33
+ placeholder: lang({
34
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.EVENT.PLACEHOLDER'
35
+ })
36
+ }), _jsx(FieldBox, {
37
+ title: lang({
38
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.ATTRIBUTE'
39
+ }),
40
+ children: _jsx(Select, {
41
+ value: {
42
+ value: dc.attribute,
43
+ label: dc.attribute
44
+ },
45
+ onChange: option => {
46
+ onChange({
47
+ ...dc,
48
+ attribute: option.value
49
+ });
50
+ },
51
+ options: currentEvent.attributes.map(attr => ({
52
+ value: attr.name,
53
+ label: attr.name
54
+ })),
55
+ isDisabled: !currentEvent.name
56
+ })
57
+ }), _jsx(FieldBox, {
58
+ title: lang({
59
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FALLBACK_TEXT'
60
+ }),
61
+ isOptional: true,
62
+ children: _jsx(NativeInput, {
63
+ value: dc.defaultValue,
64
+ onChange: e => {
65
+ onChange({
66
+ ...dc,
67
+ defaultValue: e.target.value
68
+ });
69
+ },
70
+ disabled: !currentEvent.name
71
+ })
72
+ })]
73
+ });
63
74
  };
@@ -1,63 +1,74 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { FieldBox, NativeInput, Select } from '@pushwoosh/dumb-components';
3
3
  import { Vertical } from '@pushwoosh/kit-helpers';
4
+ import { useLang } from './polyglot';
4
5
  export const DynamicContentTagPickerForm = ({
5
6
  dc,
6
7
  tags,
7
8
  onChange
8
9
  }) => {
10
+ const lang = useLang();
9
11
  const currentTag = tags.find(tag => tag.name === dc.tagName) || {
10
12
  name: '',
11
13
  modifiers: ['regular']
12
14
  };
13
- return React.createElement(Vertical, {
14
- "$gap": 16
15
- }, React.createElement(Select, {
16
- value: {
17
- value: dc.tagName,
18
- label: dc.tagName
19
- },
20
- onChange: option => {
21
- onChange({
22
- tagName: option.value,
23
- modifier: currentTag.modifiers[0],
24
- defaultValue: ''
25
- });
26
- },
27
- options: tags.map(tag => ({
28
- value: tag.name,
29
- label: tag.name
30
- })),
31
- placeholder: "Select a tag"
32
- }), React.createElement(FieldBox, {
33
- title: "Modifier"
34
- }, React.createElement(Select, {
35
- value: {
36
- value: dc.modifier,
37
- label: dc.modifier
38
- },
39
- onChange: option => {
40
- onChange({
41
- ...dc,
42
- modifier: option.value
43
- });
44
- },
45
- options: currentTag.modifiers.map(modifier => ({
46
- value: modifier,
47
- label: modifier
48
- })),
49
- isDisabled: !currentTag.name
50
- })), React.createElement(FieldBox, {
51
- title: "Fallback text",
52
- isOptional: true
53
- }, React.createElement(NativeInput, {
54
- value: dc.defaultValue,
55
- onChange: e => {
56
- onChange({
57
- ...dc,
58
- defaultValue: e.target.value
59
- });
60
- },
61
- disabled: !currentTag.name
62
- })));
15
+ return _jsxs(Vertical, {
16
+ "$gap": 16,
17
+ children: [_jsx(Select, {
18
+ value: {
19
+ value: dc.tagName,
20
+ label: dc.tagName
21
+ },
22
+ onChange: option => {
23
+ onChange({
24
+ tagName: option.value,
25
+ modifier: currentTag.modifiers[0],
26
+ defaultValue: ''
27
+ });
28
+ },
29
+ options: tags.map(tag => ({
30
+ value: tag.name,
31
+ label: tag.name
32
+ })),
33
+ placeholder: lang({
34
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TAG.PLACEHOLDER'
35
+ })
36
+ }), _jsx(FieldBox, {
37
+ title: lang({
38
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.MODIFIER'
39
+ }),
40
+ children: _jsx(Select, {
41
+ value: {
42
+ value: dc.modifier,
43
+ label: dc.modifier
44
+ },
45
+ onChange: option => {
46
+ onChange({
47
+ ...dc,
48
+ modifier: option.value
49
+ });
50
+ },
51
+ options: currentTag.modifiers.map(modifier => ({
52
+ value: modifier,
53
+ label: modifier
54
+ })),
55
+ isDisabled: !currentTag.name
56
+ })
57
+ }), _jsx(FieldBox, {
58
+ title: lang({
59
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FALLBACK_TEXT'
60
+ }),
61
+ isOptional: true,
62
+ children: _jsx(NativeInput, {
63
+ value: dc.defaultValue,
64
+ onChange: e => {
65
+ onChange({
66
+ ...dc,
67
+ defaultValue: e.target.value
68
+ });
69
+ },
70
+ disabled: !currentTag.name
71
+ })
72
+ })]
73
+ });
63
74
  };
@@ -1,7 +1,9 @@
1
- import React, { useEffect } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect } from 'react';
2
3
  import { FieldBox, NativeInput, Select, Spinner } from '@pushwoosh/dumb-components';
3
4
  import { Horizontal, Vertical } from '@pushwoosh/kit-helpers';
4
5
  import { useDynamicContentTags } from './hooks';
6
+ import { useLang } from './polyglot';
5
7
  import { SimpleTagPickerDiv } from './styled';
6
8
  const defaultDynamicContent = {
7
9
  tagName: '',
@@ -14,6 +16,7 @@ export const SimpleDynamicContentPickerFormSmart = ({
14
16
  update,
15
17
  children
16
18
  }) => {
19
+ const lang = useLang();
17
20
  const asyncResult = useDynamicContentTags();
18
21
  useEffect(() => {
19
22
  if (!asyncResult.loading) {
@@ -21,68 +24,80 @@ export const SimpleDynamicContentPickerFormSmart = ({
21
24
  }
22
25
  }, [asyncResult.loading, update]);
23
26
  if (asyncResult.loading) {
24
- return React.createElement(SimpleTagPickerDiv, null, React.createElement(Horizontal, {
25
- "$placeItems": "center",
26
- "$padding": 36
27
- }, React.createElement(Spinner, {
28
- size: "medium"
29
- })));
27
+ return _jsx(SimpleTagPickerDiv, {
28
+ children: _jsx(Horizontal, {
29
+ "$placeItems": "center",
30
+ "$padding": 36,
31
+ children: _jsx(Spinner, {
32
+ size: "medium"
33
+ })
34
+ })
35
+ });
30
36
  }
31
37
  const tags = asyncResult.value || [];
32
38
  const currentTag = tags.find(tag => tag.name === dc.tagName) || {
33
39
  name: '',
34
40
  modifiers: ['regular']
35
41
  };
36
- return React.createElement(SimpleTagPickerDiv, null, React.createElement(FieldBox, {
37
- title: "Tag"
38
- }, React.createElement(Vertical, {
39
- "$gap": 8
40
- }, React.createElement(Select, {
41
- width: "auto",
42
- menuPlacement: "auto",
43
- value: {
44
- value: dc.tagName,
45
- label: dc.tagName
46
- },
47
- onChange: option => {
48
- onChange({
49
- tagName: option.value,
50
- modifier: currentTag.modifiers[0],
51
- defaultValue: ''
52
- });
53
- },
54
- options: tags.map(tag => ({
55
- value: tag.name,
56
- label: tag.name
57
- }))
58
- }), React.createElement(Select, {
59
- width: "auto",
60
- menuPlacement: "auto",
61
- value: {
62
- value: dc.modifier,
63
- label: dc.modifier
64
- },
65
- onChange: option => {
66
- onChange({
67
- ...dc,
68
- modifier: option.value
69
- });
70
- },
71
- options: currentTag.modifiers.map(modifier => ({
72
- value: modifier,
73
- label: modifier
74
- })),
75
- isDisabled: !currentTag.name
76
- }))), React.createElement(FieldBox, {
77
- title: "Default Tag Value"
78
- }, React.createElement(NativeInput, {
79
- value: dc.defaultValue,
80
- onChange: e => {
81
- onChange({
82
- ...dc,
83
- defaultValue: e.target.value
84
- });
85
- },
86
- disabled: !currentTag.name
87
- })), children);
42
+ return _jsxs(SimpleTagPickerDiv, {
43
+ children: [_jsx(FieldBox, {
44
+ title: lang({
45
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TAG'
46
+ }),
47
+ children: _jsxs(Vertical, {
48
+ "$gap": 8,
49
+ children: [_jsx(Select, {
50
+ width: "auto",
51
+ menuPlacement: "auto",
52
+ value: {
53
+ value: dc.tagName,
54
+ label: dc.tagName
55
+ },
56
+ onChange: option => {
57
+ onChange({
58
+ tagName: option.value,
59
+ modifier: currentTag.modifiers[0],
60
+ defaultValue: ''
61
+ });
62
+ },
63
+ options: tags.map(tag => ({
64
+ value: tag.name,
65
+ label: tag.name
66
+ }))
67
+ }), _jsx(Select, {
68
+ width: "auto",
69
+ menuPlacement: "auto",
70
+ value: {
71
+ value: dc.modifier,
72
+ label: dc.modifier
73
+ },
74
+ onChange: option => {
75
+ onChange({
76
+ ...dc,
77
+ modifier: option.value
78
+ });
79
+ },
80
+ options: currentTag.modifiers.map(modifier => ({
81
+ value: modifier,
82
+ label: modifier
83
+ })),
84
+ isDisabled: !currentTag.name
85
+ })]
86
+ })
87
+ }), _jsx(FieldBox, {
88
+ title: lang({
89
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.DEFAULT_TAG_VALUE'
90
+ }),
91
+ children: _jsx(NativeInput, {
92
+ value: dc.defaultValue,
93
+ onChange: e => {
94
+ onChange({
95
+ ...dc,
96
+ defaultValue: e.target.value
97
+ });
98
+ },
99
+ disabled: !currentTag.name
100
+ })
101
+ }), children]
102
+ });
88
103
  };
@@ -1,10 +1,12 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useState } from 'react';
2
3
  import { Button, FieldBox, Select, Spinner } from '@pushwoosh/dumb-components';
3
4
  import { Horizontal, Vertical } from '@pushwoosh/kit-helpers';
4
5
  import { DynamicContentCustomPickerForm } from './DynamicContentCustomPickerForm';
5
6
  import { DynamicContentEventPickerForm } from './DynamicContentEventPickerForm';
6
7
  import { DynamicContentTagPickerForm } from './DynamicContentTagPickerForm';
7
8
  import { useVariedDynamicContentTags } from './hooks';
9
+ import { useLang } from './polyglot';
8
10
  import { VariedTagPickerDiv } from './styled';
9
11
  import { createDefaultDynamicContent } from './utils';
10
12
  const defaultVariedDynamicContent = {
@@ -15,16 +17,6 @@ const defaultVariedDynamicContent = {
15
17
  defaultValue: ''
16
18
  }
17
19
  };
18
- const kindsOptions = [{
19
- value: 'tag',
20
- label: 'Tag'
21
- }, {
22
- value: 'event',
23
- label: 'Event'
24
- }, {
25
- value: 'customText',
26
- label: 'Custom Text'
27
- }];
28
20
  export const VariedDynamicContentPickerFormSmart = ({
29
21
  applicationCode,
30
22
  initialDc = defaultVariedDynamicContent,
@@ -33,79 +25,113 @@ export const VariedDynamicContentPickerFormSmart = ({
33
25
  update
34
26
  }) => {
35
27
  var _kindsOptions$find;
28
+ const lang = useLang();
36
29
  const [vdc, setVdc] = useState(initialDc);
37
30
  const asyncResult = useVariedDynamicContentTags(applicationCode);
31
+ const kindsOptions = useMemo(() => [{
32
+ value: 'tag',
33
+ label: lang({
34
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.TAG'
35
+ })
36
+ }, {
37
+ value: 'event',
38
+ label: lang({
39
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT'
40
+ })
41
+ }, {
42
+ value: 'customText',
43
+ label: lang({
44
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT'
45
+ })
46
+ }], [lang]);
38
47
  useEffect(() => {
39
48
  update();
40
49
  }, [asyncResult.loading, update]);
41
50
  if (asyncResult.loading) {
42
- return React.createElement(VariedTagPickerDiv, null, React.createElement(Horizontal, {
43
- "$placeItems": "center",
44
- "$padding": 36
45
- }, React.createElement(Spinner, {
46
- size: "medium"
47
- })));
51
+ return _jsx(VariedTagPickerDiv, {
52
+ children: _jsx(Horizontal, {
53
+ "$placeItems": "center",
54
+ "$padding": 36,
55
+ children: _jsx(Spinner, {
56
+ size: "medium"
57
+ })
58
+ })
59
+ });
48
60
  }
49
61
  const isValidDc = vdc.kind === 'tag' && vdc.dc.tagName !== '' && vdc.dc.modifier !== '' || vdc.kind === 'event' && vdc.dc.eventName !== '' && vdc.dc.attribute !== '' || vdc.kind === 'customText' && vdc.dc.text !== '';
50
- return React.createElement(VariedTagPickerDiv, null, React.createElement(Vertical, {
51
- "$gap": 8
52
- }, React.createElement(FieldBox, {
53
- title: "Variable Type"
54
- }, React.createElement(Vertical, {
55
- "$gap": 8
56
- }, React.createElement(Select, {
57
- width: "auto",
58
- menuPlacement: "auto",
59
- value: {
60
- value: vdc.kind,
61
- label: (_kindsOptions$find = kindsOptions.find(o => o.value === vdc.kind)) === null || _kindsOptions$find === void 0 ? void 0 : _kindsOptions$find.label
62
- },
63
- onChange: option => {
64
- const newDc = createDefaultDynamicContent(option.value);
65
- setVdc(newDc);
66
- update();
67
- },
68
- options: kindsOptions
69
- }))), vdc.kind === 'tag' && React.createElement(DynamicContentTagPickerForm, {
70
- dc: vdc.dc,
71
- tags: asyncResult.value[0],
72
- onChange: newDc => {
73
- setVdc({
74
- ...vdc,
75
- dc: newDc
76
- });
77
- }
78
- }), vdc.kind === 'event' && React.createElement(DynamicContentEventPickerForm, {
79
- dc: vdc.dc,
80
- events: asyncResult.value[1],
81
- onChange: newDc => {
82
- setVdc({
83
- ...vdc,
84
- dc: newDc
85
- });
86
- }
87
- }), vdc.kind === 'customText' && React.createElement(DynamicContentCustomPickerForm, {
88
- dc: vdc.dc,
89
- onChange: newDc => {
90
- setVdc({
91
- ...vdc,
92
- dc: newDc
93
- });
94
- }
95
- })), React.createElement(Horizontal, {
96
- "$justifyContent": "end",
97
- "$gap": 8
98
- }, React.createElement(Button, {
99
- color: "secondary",
100
- size: "compact",
101
- onClick: onClose
102
- }, "Cancel"), React.createElement(Button, {
103
- color: "primary",
104
- size: "compact",
105
- onClick: () => {
106
- onChange(vdc);
107
- onClose();
108
- },
109
- isDisabled: !isValidDc
110
- }, "Apply")));
62
+ return _jsxs(VariedTagPickerDiv, {
63
+ children: [_jsxs(Vertical, {
64
+ "$gap": 8,
65
+ children: [_jsx(FieldBox, {
66
+ title: lang({
67
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VARIABLE_TYPE'
68
+ }),
69
+ children: _jsx(Vertical, {
70
+ "$gap": 8,
71
+ children: _jsx(Select, {
72
+ width: "auto",
73
+ menuPlacement: "auto",
74
+ value: {
75
+ value: vdc.kind,
76
+ label: (_kindsOptions$find = kindsOptions.find(o => o.value === vdc.kind)) === null || _kindsOptions$find === void 0 ? void 0 : _kindsOptions$find.label
77
+ },
78
+ onChange: option => {
79
+ const newDc = createDefaultDynamicContent(option.value);
80
+ setVdc(newDc);
81
+ update();
82
+ },
83
+ options: kindsOptions
84
+ })
85
+ })
86
+ }), vdc.kind === 'tag' && _jsx(DynamicContentTagPickerForm, {
87
+ dc: vdc.dc,
88
+ tags: asyncResult.value[0],
89
+ onChange: newDc => {
90
+ setVdc({
91
+ ...vdc,
92
+ dc: newDc
93
+ });
94
+ }
95
+ }), vdc.kind === 'event' && _jsx(DynamicContentEventPickerForm, {
96
+ dc: vdc.dc,
97
+ events: asyncResult.value[1],
98
+ onChange: newDc => {
99
+ setVdc({
100
+ ...vdc,
101
+ dc: newDc
102
+ });
103
+ }
104
+ }), vdc.kind === 'customText' && _jsx(DynamicContentCustomPickerForm, {
105
+ dc: vdc.dc,
106
+ onChange: newDc => {
107
+ setVdc({
108
+ ...vdc,
109
+ dc: newDc
110
+ });
111
+ }
112
+ })]
113
+ }), _jsxs(Horizontal, {
114
+ "$justifyContent": "end",
115
+ "$gap": 8,
116
+ children: [_jsx(Button, {
117
+ color: "secondary",
118
+ size: "compact",
119
+ onClick: onClose,
120
+ children: lang({
121
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL'
122
+ })
123
+ }), _jsx(Button, {
124
+ color: "primary",
125
+ size: "compact",
126
+ onClick: () => {
127
+ onChange(vdc);
128
+ onClose();
129
+ },
130
+ isDisabled: !isValidDc,
131
+ children: lang({
132
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY'
133
+ })
134
+ })]
135
+ })]
136
+ });
111
137
  };
@@ -0,0 +1,2 @@
1
+ import { type DynamicContentPickerFormMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("@pushwoosh/dumb-components/polyglot").LangProps<DynamicContentPickerFormMessages>>, useLang: () => (props: import("@pushwoosh/dumb-components/polyglot").LangProps<DynamicContentPickerFormMessages>) => string;
@@ -0,0 +1,10 @@
1
+ import { createLang } from '@pushwoosh/dumb-components/polyglot';
2
+ import { messages as en } from './messages_en';
3
+ import { messages as ru } from './messages_ru';
4
+ export const {
5
+ Lang,
6
+ useLang
7
+ } = createLang({
8
+ en,
9
+ ru
10
+ });
@@ -0,0 +1,3 @@
1
+ import type { LangMessages } from '@pushwoosh/dumb-components/polyglot';
2
+ import { type DynamicContentPickerFormMessages } from './types';
3
+ export declare const messages: LangMessages<DynamicContentPickerFormMessages>;
@@ -0,0 +1,16 @@
1
+ export const messages = {
2
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CUSTOM.PLACEHOLDER': 'Enter custom text',
3
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.EVENT.PLACEHOLDER': 'Select an event',
4
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TAG.PLACEHOLDER': 'Select a tag',
5
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TAG': 'Tag',
6
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.ATTRIBUTE': 'Attribute',
7
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.MODIFIER': 'Modifier',
8
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FALLBACK_TEXT': 'Fallback text',
9
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.DEFAULT_TAG_VALUE': 'Default Tag Value',
10
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VARIABLE_TYPE': 'Variable Type',
11
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.TAG': 'Tag',
12
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': 'Event',
13
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': 'Custom Text',
14
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': 'Cancel',
15
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'Apply'
16
+ };