@pushwoosh/dumb-components 1.1.134 → 1.1.136

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 (217) hide show
  1. package/AccessForbidden/AccessForbidden.js +19 -5
  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/Alert/Alert.d.ts +1 -2
  11. package/Alert/Alert.js +31 -25
  12. package/ApplicationPreloader/ApplicationPreloader.d.ts +1 -2
  13. package/ApplicationPreloader/ApplicationPreloader.js +5 -4
  14. package/Badge/Badge.js +2 -2
  15. package/Banner/Banner.js +40 -24
  16. package/Button/Button.js +20 -9
  17. package/Button/RemoveButton.js +7 -6
  18. package/Calendar/CalendarDropdown/CalendarDropdown.js +121 -108
  19. package/Calendar/CalendarMonth/CalendarMonth.js +68 -66
  20. package/Calendar/CalendarMonthSlider/CalendarMonthSlider.d.ts +2 -2
  21. package/Calendar/CalendarMonthSlider/CalendarMonthSlider.js +68 -55
  22. package/Calendar/CalendarSuperForm/CalendarSuperForm.js +75 -70
  23. package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.d.ts +2 -2
  24. package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.js +3 -2
  25. package/Calendar/CalendarSuperForm/components/CalendarTimeAndTimezoneSection/CalendarTimeAndTimezoneSection.js +106 -88
  26. package/Calendar/CalendarSuperForm/components/CalendarTimeInput.d.ts +1 -2
  27. package/Calendar/CalendarSuperForm/components/CalendarTimeInput.js +2 -2
  28. package/Calendar/CalendarSuperForm/components/CalendarTimezoneSelect.js +3 -2
  29. package/CardMetric/CardChildren.js +9 -6
  30. package/CardMetric/CardCollapse.js +8 -6
  31. package/CardMetric/CardMetric.js +52 -33
  32. package/Checkbox/Checkbox.js +30 -24
  33. package/Chip/Chip.d.ts +6 -7
  34. package/Chip/Chip.js +22 -15
  35. package/CodeEditor/CodeEditor.d.ts +1 -2
  36. package/CodeEditor/CodeEditor.js +2 -2
  37. package/CrashScreen/CrashScreen.js +19 -6
  38. package/CrashScreen/polyglot/index.d.ts +2 -0
  39. package/CrashScreen/polyglot/index.js +10 -0
  40. package/CrashScreen/polyglot/messages_en.d.ts +3 -0
  41. package/CrashScreen/polyglot/messages_en.js +4 -0
  42. package/CrashScreen/polyglot/messages_ru.d.ts +3 -0
  43. package/CrashScreen/polyglot/messages_ru.js +4 -0
  44. package/CrashScreen/polyglot/types.d.ts +5 -0
  45. package/CrashScreen/polyglot/types.js +1 -0
  46. package/DateTimePicker/components/AutosizeInput/AutosizeInput.js +17 -13
  47. package/DateTimePicker/components/DatePicker/DatePicker.js +35 -32
  48. package/DateTimePicker/components/DatePickerField/DatePickerField.js +32 -22
  49. package/DateTimePicker/components/DateTimePicker/DateTimePicker.js +22 -20
  50. package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +30 -22
  51. package/DateTimePicker/components/DecadeView/DecadeView.js +19 -17
  52. package/DateTimePicker/components/Input/Input.js +2 -2
  53. package/DateTimePicker/components/Month/Month.js +52 -21
  54. package/DateTimePicker/components/MonthView/MonthView.js +21 -17
  55. package/DateTimePicker/components/NumberPicker/NumberPicker.js +49 -40
  56. package/DateTimePicker/components/PickerPlate/PickerPlate.js +17 -14
  57. package/DateTimePicker/components/YearView/YearView.js +22 -18
  58. package/DateTimePicker/polyglot/index.d.ts +2 -0
  59. package/DateTimePicker/polyglot/index.js +9 -0
  60. package/DateTimePicker/polyglot/messages_en.d.ts +3 -0
  61. package/DateTimePicker/polyglot/messages_en.js +11 -0
  62. package/DateTimePicker/polyglot/messages_ru.d.ts +3 -0
  63. package/DateTimePicker/polyglot/messages_ru.js +11 -0
  64. package/DateTimePicker/polyglot/types.d.ts +12 -0
  65. package/DateTimePicker/polyglot/types.js +1 -0
  66. package/Drawer/components/Drawer/Drawer.js +18 -13
  67. package/Drawer/components/Drawer/styles.d.ts +2 -2
  68. package/Drawer/components/Drawer/styles.js +5 -4
  69. package/Drawer/components/DrawerDocs/DrawerDocs.js +28 -17
  70. package/Drawer/polyglot/index.d.ts +2 -0
  71. package/Drawer/polyglot/index.js +10 -0
  72. package/Drawer/polyglot/messages_en.d.ts +3 -0
  73. package/Drawer/polyglot/messages_en.js +4 -0
  74. package/Drawer/polyglot/messages_ru.d.ts +3 -0
  75. package/Drawer/polyglot/messages_ru.js +4 -0
  76. package/Drawer/polyglot/types.d.ts +5 -0
  77. package/Drawer/polyglot/types.js +1 -0
  78. package/DropdownMenu/components/DropdownMenu/DropdownMenu.js +28 -24
  79. package/DropdownMenu/components/DropdownMenuButton/DropdownMenuButton.js +8 -6
  80. package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.js +6 -4
  81. package/DropdownMenu/components/DropdownMenuSection/DropdownMenuSection.js +13 -10
  82. package/DropdownMenu/components/DropdownMenuSubmenu/DropdownMenuSubmenu.js +40 -31
  83. package/EditableField/EditableField.js +56 -39
  84. package/EditableField/polyglot/index.d.ts +2 -0
  85. package/EditableField/polyglot/index.js +9 -0
  86. package/EditableField/polyglot/messages_en.d.ts +3 -0
  87. package/EditableField/polyglot/messages_en.js +4 -0
  88. package/EditableField/polyglot/messages_ru.d.ts +3 -0
  89. package/EditableField/polyglot/messages_ru.js +4 -0
  90. package/EditableField/polyglot/types.d.ts +5 -0
  91. package/EditableField/polyglot/types.js +1 -0
  92. package/EmailTemplatePreview/EmailTemplatePreview.js +10 -8
  93. package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +30 -16
  94. package/EmailTemplatePreview/polyglot/index.d.ts +2 -0
  95. package/EmailTemplatePreview/polyglot/index.js +10 -0
  96. package/EmailTemplatePreview/polyglot/messages_en.d.ts +3 -0
  97. package/EmailTemplatePreview/polyglot/messages_en.js +5 -0
  98. package/EmailTemplatePreview/polyglot/messages_ru.d.ts +3 -0
  99. package/EmailTemplatePreview/polyglot/messages_ru.js +5 -0
  100. package/EmailTemplatePreview/polyglot/types.d.ts +6 -0
  101. package/EmailTemplatePreview/polyglot/types.js +1 -0
  102. package/EnhancedInput/EnhancedInput.d.ts +3 -4
  103. package/EnhancedInput/EnhancedInput.js +14 -10
  104. package/EnhancedInput/SearchInput.js +3 -3
  105. package/ExportResult/ExportResult.js +33 -23
  106. package/ExternalImagePreview/ExternalImagePreview.js +24 -20
  107. package/FieldBox/FieldBox.js +50 -37
  108. package/FrequencyCapping/FrequencyCappingEdit.js +41 -33
  109. package/FrequencyCapping/FrequencyCappingInApps.js +41 -33
  110. package/FrequencyCapping/FrequencyCappingReadonly.d.ts +1 -2
  111. package/FrequencyCapping/FrequencyCappingReadonly.js +24 -20
  112. package/FrequencyCapping/components/Condition/index.d.ts +1 -2
  113. package/FrequencyCapping/components/Condition/index.js +24 -20
  114. package/FrequencyCapping/components/Description/index.d.ts +2 -2
  115. package/FrequencyCapping/components/Description/index.js +7 -5
  116. package/FrequencyCapping/components/Settings/EditCappingSettings.js +28 -20
  117. package/FrequencyCapping/components/Settings/EditInAppCappingSettings.js +86 -71
  118. package/FrequencyCapping/helpers/getReadonlyCappingHelpers.d.ts +1 -2
  119. package/FrequencyCapping/helpers/getReadonlyCappingHelpers.js +41 -32
  120. package/GetStartedPage/GetStartedPage.js +44 -25
  121. package/InputFile/InputFile.js +44 -35
  122. package/Link/Link.js +2 -2
  123. package/Modal/components/Modal/Modal.js +17 -12
  124. package/Modal/components/Modal/styles.js +5 -4
  125. package/Modal/components/ModalConfirm/ModalConfirm.js +51 -24
  126. package/Modal/components/ModalConfirm/ModalConfirmProvider.d.ts +2 -2
  127. package/Modal/components/ModalConfirm/ModalConfirmProvider.js +8 -6
  128. package/Modal/components/ModalConfirm/types.d.ts +1 -1
  129. package/Modal/components/ModalTitle/ModalTitle.js +10 -8
  130. package/Modal/polyglot/index.d.ts +2 -0
  131. package/Modal/polyglot/index.js +9 -0
  132. package/Modal/polyglot/messages_en.d.ts +3 -0
  133. package/Modal/polyglot/messages_en.js +6 -0
  134. package/Modal/polyglot/messages_ru.d.ts +3 -0
  135. package/Modal/polyglot/messages_ru.js +6 -0
  136. package/Modal/polyglot/types.d.ts +7 -0
  137. package/Modal/polyglot/types.js +1 -0
  138. package/NotificationInbox/NotificationBar.js +19 -11
  139. package/NotificationInbox/NotificationBell.js +21 -12
  140. package/NotificationInbox/NotificationInbox.js +160 -105
  141. package/NotificationInbox/polyglot/index.d.ts +2 -0
  142. package/NotificationInbox/polyglot/index.js +10 -0
  143. package/NotificationInbox/polyglot/messages_en.d.ts +3 -0
  144. package/NotificationInbox/polyglot/messages_en.js +8 -0
  145. package/NotificationInbox/polyglot/messages_ru.d.ts +3 -0
  146. package/NotificationInbox/polyglot/messages_ru.js +8 -0
  147. package/NotificationInbox/polyglot/types.d.ts +11 -0
  148. package/NotificationInbox/polyglot/types.js +1 -0
  149. package/NumberPicker/NumberPicker.js +53 -44
  150. package/NumberPicker/components/AutosizeInput/AutosizeInput.js +19 -15
  151. package/PageHeader/components/AutosizeInput/AutosizeInput.js +30 -22
  152. package/PageHeader/components/PageHeader/PageHeader.js +44 -27
  153. package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.js +51 -34
  154. package/PageHeader/components/PageHeaderError/PageHeaderError.js +17 -10
  155. package/PageHeader/components/PageHeaderSkeleton/PageHeaderSkeleton.js +20 -16
  156. package/Pagination/Pagination.js +60 -49
  157. package/Popover/Popover.js +6 -5
  158. package/ProgressBar/ProgressBar.js +25 -10
  159. package/PushPreview/PushPreview.js +30 -22
  160. package/PushPreview/components/MissedContentPreview/MissedContentPreview.js +23 -11
  161. package/PushPreview/components/SilentPushPreview/SilentPushPreview.js +20 -13
  162. package/PushPreview/polyglot/index.d.ts +2 -0
  163. package/PushPreview/polyglot/index.js +9 -0
  164. package/PushPreview/polyglot/messages_en.d.ts +3 -0
  165. package/PushPreview/polyglot/messages_en.js +4 -0
  166. package/PushPreview/polyglot/messages_ru.d.ts +3 -0
  167. package/PushPreview/polyglot/messages_ru.js +4 -0
  168. package/PushPreview/polyglot/types.d.ts +5 -0
  169. package/PushPreview/polyglot/types.js +1 -0
  170. package/Radio/Radio.js +32 -26
  171. package/RadioCard/RadioCard.js +17 -9
  172. package/ReCaptcha/ReCaptcha.js +2 -2
  173. package/RichMessageEditor/EditorEmojiPicker.js +9 -7
  174. package/RichMessageEditor/RichMessageEditor.js +77 -67
  175. package/RichMessageEditor/RichMessageViewer.js +19 -13
  176. package/RichMessageEditor/slate/DynamicContentElement.d.ts +1 -2
  177. package/RichMessageEditor/slate/DynamicContentElement.js +13 -9
  178. package/RichMessageEditor/slate/SlateEditor.js +9 -7
  179. package/RichmediaPreview/RichmediaPreview.js +13 -11
  180. package/Select/Select.js +10 -8
  181. package/SendRate/SendRateEdit.d.ts +1 -2
  182. package/SendRate/SendRateEdit.js +42 -34
  183. package/SendRate/SendRateReadonly.d.ts +1 -2
  184. package/SendRate/SendRateReadonly.js +24 -20
  185. package/SendRate/components/Condition/index.d.ts +1 -2
  186. package/SendRate/components/Condition/index.js +15 -13
  187. package/SendRate/components/Description/index.d.ts +2 -2
  188. package/SendRate/components/Description/index.js +30 -22
  189. package/SendRate/components/Settings/index.d.ts +1 -2
  190. package/SendRate/components/Settings/index.js +20 -14
  191. package/SendRate/helpers/getReadonlySendRateHelpers.d.ts +1 -2
  192. package/SendRate/helpers/getReadonlySendRateHelpers.js +39 -30
  193. package/Skeleton/TextSkeleton.js +5 -4
  194. package/SortButton/SortButton.js +11 -7
  195. package/Spinner/Spinner.js +7 -4
  196. package/StatisticCard/StatisticCard.js +44 -29
  197. package/Switch/Switch.js +16 -13
  198. package/Tabs/components/Tab/Tab.d.ts +3 -4
  199. package/Tabs/components/Tab/Tab.js +6 -4
  200. package/Tabs/components/TabBar/TabBar.d.ts +3 -4
  201. package/Tabs/components/TabBar/TabBar.js +12 -4
  202. package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.d.ts +1 -2
  203. package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.js +27 -21
  204. package/Tabs/components/TabBase/TabBase.d.ts +3 -4
  205. package/Tabs/components/TabBase/TabBase.js +11 -6
  206. package/Tabs/components/TabPanel/TabPanel.js +4 -2
  207. package/Tabs/components/Tabs/Tabs.js +8 -4
  208. package/Toast/Toast.js +31 -18
  209. package/Toast/ToastProvider.d.ts +2 -3
  210. package/Toast/ToastProvider.js +10 -8
  211. package/Tooltip/Tooltip.js +2 -2
  212. package/Tooltip/TooltipTrigger.js +13 -11
  213. package/package.json +2 -2
  214. package/polyglot/__tests__/render.test.js +46 -16
  215. package/polyglot/liquid/render.d.ts +2 -2
  216. package/polyglot/liquid/render.js +7 -6
  217. package/polyglot/react.js +7 -5
@@ -0,0 +1,5 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type PushPreviewMessages = {
3
+ 'DUMB.PUSH_PREVIEW.CONTENT_MISSED': NoParams;
4
+ 'DUMB.PUSH_PREVIEW.HINT': NoParams;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
package/Radio/Radio.js CHANGED
@@ -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 { Color } from '@pushwoosh/kit-constants';
3
4
  import { Horizontal } from '@pushwoosh/kit-helpers';
4
5
  import { InputContainer, NativeLabel, NativeRadio } from './styles';
@@ -25,36 +26,41 @@ export function Radio(props) {
25
26
  const newCounter = counter++;
26
27
  return `radio-id-${newCounter}`;
27
28
  });
28
- const radioMarkup = React.createElement(NativeLabel, {
29
+ const radioMarkup = _jsxs(NativeLabel, {
29
30
  htmlFor: localId,
30
31
  "$color": isDisabled ? Color.LOCKED : Color.MAIN,
31
- "$size": size
32
- }, React.createElement(InputContainer, {
33
32
  "$size": size,
34
- "$alignItems": "center",
35
- "$justifyContent": "center"
36
- }, React.createElement(NativeRadio, {
37
- type: "radio",
38
- id: localId,
39
- value: value,
40
- name: name,
41
- checked: isChecked,
42
- disabled: isDisabled,
43
- "$size": size,
44
- "$type": type,
45
- onChange: event => onChange === null || onChange === void 0 ? void 0 : onChange(event.currentTarget.value),
46
- onBlur: onBlur
47
- })), label && React.createElement("span", null, label));
33
+ children: [_jsx(InputContainer, {
34
+ "$size": size,
35
+ "$alignItems": "center",
36
+ "$justifyContent": "center",
37
+ children: _jsx(NativeRadio, {
38
+ type: "radio",
39
+ id: localId,
40
+ value: value,
41
+ name: name,
42
+ checked: isChecked,
43
+ disabled: isDisabled,
44
+ "$size": size,
45
+ "$type": type,
46
+ onChange: event => onChange === null || onChange === void 0 ? void 0 : onChange(event.currentTarget.value),
47
+ onBlur: onBlur
48
+ })
49
+ }), label && _jsx("span", {
50
+ children: label
51
+ })]
52
+ });
48
53
  if (tooltip) {
49
- return React.createElement(Horizontal, {
54
+ return _jsxs(Horizontal, {
50
55
  "$gap": 4,
51
- "$alignItems": "start"
52
- }, radioMarkup, React.createElement(TooltipTrigger, {
53
- content: tooltip,
54
- padding: size === 'compact' ? '0' : '4px 0',
55
- position: "top-middle",
56
- view: "question"
57
- }));
56
+ "$alignItems": "start",
57
+ children: [radioMarkup, _jsx(TooltipTrigger, {
58
+ content: tooltip,
59
+ padding: size === 'compact' ? '0' : '4px 0',
60
+ position: "top-middle",
61
+ view: "question"
62
+ })]
63
+ });
58
64
  }
59
65
  return radioMarkup;
60
66
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Horizontal, Vertical } from '@pushwoosh/kit-helpers';
3
3
  import { H4, Paragraph } from '@pushwoosh/kit-typography';
4
4
  import { Radio } from '../Radio';
@@ -12,14 +12,22 @@ export function RadioCard(props) {
12
12
  onClick,
13
13
  children
14
14
  } = props;
15
- return React.createElement(RootBox, {
15
+ return _jsxs(RootBox, {
16
16
  "$width": width,
17
17
  isActive: isActive,
18
- onClick: onClick
19
- }, React.createElement(Vertical, null, React.createElement(Horizontal, {
20
- "$alignItems": "center",
21
- "$justifyContent": "space-between"
22
- }, React.createElement(H4, null, title), React.createElement(Radio, {
23
- isChecked: isActive
24
- })), React.createElement(Paragraph, null, description)), children);
18
+ onClick: onClick,
19
+ children: [_jsxs(Vertical, {
20
+ children: [_jsxs(Horizontal, {
21
+ "$alignItems": "center",
22
+ "$justifyContent": "space-between",
23
+ children: [_jsx(H4, {
24
+ children: title
25
+ }), _jsx(Radio, {
26
+ isChecked: isActive
27
+ })]
28
+ }), _jsx(Paragraph, {
29
+ children: description
30
+ })]
31
+ }), children]
32
+ });
25
33
  }
@@ -1,8 +1,8 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { RECAPTCHA_CONTAINER_ID } from './constants';
3
3
  import { RecaptchaElement } from './styles';
4
4
  export function ReCaptcha() {
5
- return React.createElement(RecaptchaElement, {
5
+ return _jsx(RecaptchaElement, {
6
6
  id: RECAPTCHA_CONTAINER_ID
7
7
  });
8
8
  }
@@ -1,13 +1,15 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { EditorEmojiPickerStyled } from './EditorEmojiPicker.styled';
3
3
  import { EmojiPicker } from '../EmojiPicker';
4
4
  export const EditorEmojiPicker = ({
5
5
  onEmojiSelect
6
6
  }) => {
7
- return React.createElement(EditorEmojiPickerStyled, null, React.createElement(EmojiPicker, {
8
- onEmojiSelect: emoji => {
9
- onEmojiSelect(emoji.native);
10
- },
11
- theme: "light"
12
- }));
7
+ return _jsx(EditorEmojiPickerStyled, {
8
+ children: _jsx(EmojiPicker, {
9
+ onEmojiSelect: emoji => {
10
+ onEmojiSelect(emoji.native);
11
+ },
12
+ theme: "light"
13
+ })
14
+ });
13
15
  };
@@ -1,6 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { arrow, autoPlacement, offset, useFloating } from '@floating-ui/react-dom';
2
3
  import { isEqual } from 'es-toolkit';
3
- import React, { useEffect, useRef, useState } from 'react';
4
+ import { useEffect, useRef, useState } from 'react';
4
5
  import { Transforms } from 'slate';
5
6
  import { Collapse, elementAddListener, Horizontal, usePersistentFunction } from '@pushwoosh/kit-helpers';
6
7
  import { FieldBox } from '../FieldBox';
@@ -85,73 +86,82 @@ export const RichMessageEditor = ({
85
86
  }
86
87
  });
87
88
  }, [clickAwayHandler, isFocused, refs.reference]);
88
- return React.createElement(SlateEditor, {
89
+ return _jsx(SlateEditor, {
89
90
  initialValue: initialValue,
90
91
  onChange: onChange,
91
- onSelectionChange: onSelectionChange
92
- }, ({
93
- editor
94
- }) => {
95
- var _getDcByPath, _middlewareData$arrow, _middlewareData$arrow2;
96
- return React.createElement(FieldBox, {
97
- title: title,
98
- boxRef: refs.setReference,
99
- error: error,
100
- actions: React.createElement(Collapse, {
101
- expanded: isFocused
102
- }, React.createElement(Horizontal, {
103
- "$gap": 8
104
- }, canUsePersonalization && React.createElement(ImSpan, {
105
- onClick: () => setShowDrop({
106
- type: 'personalization'
107
- })
108
- }, React.createElement(PersonalizationIcon, null), "Personalization"), canUseEmoji && React.createElement(ImSpan, {
109
- onClick: () => setShowDrop({
110
- type: 'emoji'
111
- })
112
- }, React.createElement(EmojiIcon, null), "Emoji")))
113
- }, React.createElement(SlateEditable, {
114
- minHeight: minHeight,
115
- onFocus: () => {
116
- setIsFocused(true);
117
- const {
118
- selection
119
- } = editor;
120
- if (selection) {
121
- onSelectionChange(selection);
122
- }
123
- },
124
- onDelete: () => {
125
- setShowDrop(undefined);
126
- }
127
- }), showDrop && React.createElement(DropArea, {
128
- style: floatingStyles,
129
- ref: refs.setFloating,
130
- key: showDrop.type
131
- }, showDrop.type === 'personalization' && React.createElement(DropContent, null, renderDynamicContent === null || renderDynamicContent === void 0 ? void 0 : renderDynamicContent({
132
- dc: showDrop.path ? (_getDcByPath = getDcByPath(editor.children, showDrop.path)) === null || _getDcByPath === void 0 ? void 0 : _getDcByPath.dc : undefined,
133
- onChange: newDC => {
134
- if (showDrop.path) {
135
- Transforms.setNodes(editor, {
136
- dc: newDC
137
- }, {
138
- at: showDrop.path
139
- });
140
- } else {
141
- insertDynamicContent(editor, newDC);
142
- }
143
- },
144
- onClose,
145
- update
146
- })), showDrop.type === 'emoji' && React.createElement(EditorEmojiPicker, {
147
- onEmojiSelect: s => editor.insertText(s)
148
- }), React.createElement(Arrow, {
149
- "$direction": placementToDirection(placement),
150
- ref: arrowRef,
151
- style: {
152
- left: (_middlewareData$arrow = middlewareData.arrow) === null || _middlewareData$arrow === void 0 ? void 0 : _middlewareData$arrow.x,
153
- top: (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y
154
- }
155
- }, React.createElement(ArrowIcon, null))));
92
+ onSelectionChange: onSelectionChange,
93
+ children: ({
94
+ editor
95
+ }) => {
96
+ var _getDcByPath, _middlewareData$arrow, _middlewareData$arrow2;
97
+ return _jsxs(FieldBox, {
98
+ title: title,
99
+ boxRef: refs.setReference,
100
+ error: error,
101
+ actions: _jsx(Collapse, {
102
+ expanded: isFocused,
103
+ children: _jsxs(Horizontal, {
104
+ "$gap": 8,
105
+ children: [canUsePersonalization && _jsxs(ImSpan, {
106
+ onClick: () => setShowDrop({
107
+ type: 'personalization'
108
+ }),
109
+ children: [_jsx(PersonalizationIcon, {}), "Personalization"]
110
+ }), canUseEmoji && _jsxs(ImSpan, {
111
+ onClick: () => setShowDrop({
112
+ type: 'emoji'
113
+ }),
114
+ children: [_jsx(EmojiIcon, {}), "Emoji"]
115
+ })]
116
+ })
117
+ }),
118
+ children: [_jsx(SlateEditable, {
119
+ minHeight: minHeight,
120
+ onFocus: () => {
121
+ setIsFocused(true);
122
+ const {
123
+ selection
124
+ } = editor;
125
+ if (selection) {
126
+ onSelectionChange(selection);
127
+ }
128
+ },
129
+ onDelete: () => {
130
+ setShowDrop(undefined);
131
+ }
132
+ }), showDrop && _jsxs(DropArea, {
133
+ style: floatingStyles,
134
+ ref: refs.setFloating,
135
+ children: [showDrop.type === 'personalization' && _jsx(DropContent, {
136
+ children: renderDynamicContent === null || renderDynamicContent === void 0 ? void 0 : renderDynamicContent({
137
+ dc: showDrop.path ? (_getDcByPath = getDcByPath(editor.children, showDrop.path)) === null || _getDcByPath === void 0 ? void 0 : _getDcByPath.dc : undefined,
138
+ onChange: newDC => {
139
+ if (showDrop.path) {
140
+ Transforms.setNodes(editor, {
141
+ dc: newDC
142
+ }, {
143
+ at: showDrop.path
144
+ });
145
+ } else {
146
+ insertDynamicContent(editor, newDC);
147
+ }
148
+ },
149
+ onClose,
150
+ update
151
+ })
152
+ }), showDrop.type === 'emoji' && _jsx(EditorEmojiPicker, {
153
+ onEmojiSelect: s => editor.insertText(s)
154
+ }), _jsx(Arrow, {
155
+ "$direction": placementToDirection(placement),
156
+ ref: arrowRef,
157
+ style: {
158
+ left: (_middlewareData$arrow = middlewareData.arrow) === null || _middlewareData$arrow === void 0 ? void 0 : _middlewareData$arrow.x,
159
+ top: (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y
160
+ },
161
+ children: _jsx(ArrowIcon, {})
162
+ })]
163
+ }, showDrop.type)]
164
+ });
165
+ }
156
166
  });
157
167
  };
@@ -1,4 +1,5 @@
1
- import React, { Fragment, useMemo } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Fragment, useMemo } from 'react';
2
3
  import { DynamicContentBracket, DynamicContentRoot, Paragraph } from './RichMessageViewer.styled';
3
4
  import { isElement, string2content } from './slate/helpers';
4
5
  export const RichMessageViewer = ({
@@ -13,9 +14,13 @@ export const RichMessageViewer = ({
13
14
  if (isElement(child) && child.type === 'dc') {
14
15
  return (
15
16
  // eslint-disable-next-line react/no-array-index-key
16
- React.createElement(DynamicContentRoot, {
17
- key: idx
18
- }, React.createElement(DynamicContentBracket, null, '{'), "\u00A0", child.dc.tagName, "\u00A0", React.createElement(DynamicContentBracket, null, '}'))
17
+ _jsxs(DynamicContentRoot, {
18
+ children: [_jsx(DynamicContentBracket, {
19
+ children: '{'
20
+ }), "\u00A0", child.dc.tagName, "\u00A0", _jsx(DynamicContentBracket, {
21
+ children: '}'
22
+ })]
23
+ }, idx)
19
24
  );
20
25
  }
21
26
  return child.text;
@@ -23,19 +28,20 @@ export const RichMessageViewer = ({
23
28
  if (flat) {
24
29
  return (
25
30
  // eslint-disable-next-line react/no-array-index-key
26
- React.createElement(Fragment, {
27
- key: index
28
- }, index > 0 && ' ', React.createElement("span", {
29
- dir: "auto"
30
- }, children))
31
+ _jsxs(Fragment, {
32
+ children: [index > 0 && ' ', _jsx("span", {
33
+ dir: "auto",
34
+ children: children
35
+ })]
36
+ }, index)
31
37
  );
32
38
  }
33
39
  return (
34
40
  // eslint-disable-next-line react/no-array-index-key
35
- React.createElement(Paragraph, {
36
- key: index,
37
- dir: "auto"
38
- }, children)
41
+ _jsx(Paragraph, {
42
+ dir: "auto",
43
+ children: children
44
+ }, index)
39
45
  );
40
46
  });
41
47
  };
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare function renderElement(props: any, onDelete: () => void): React.JSX.Element;
1
+ export declare function renderElement(props: any, onDelete: () => void): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Transforms } from 'slate';
3
3
  import { useSelected, useSlateStatic } from 'slate-react';
4
4
  import { findPath } from './helpers';
@@ -14,7 +14,7 @@ const DynamicContentElementComponent = ({
14
14
  const {
15
15
  tagName
16
16
  } = element.dc;
17
- return React.createElement(Chip, {
17
+ return _jsxs(Chip, {
18
18
  ...attributes,
19
19
  as: "span",
20
20
  contentEditable: false,
@@ -40,8 +40,11 @@ const DynamicContentElementComponent = ({
40
40
  });
41
41
  }
42
42
  onDelete();
43
- }
44
- }, React.createElement("span", null, tagName || 'Not set'), children);
43
+ },
44
+ children: [_jsx("span", {
45
+ children: tagName || 'Not set'
46
+ }), children]
47
+ });
45
48
  };
46
49
  const Element = props => {
47
50
  const {
@@ -52,18 +55,19 @@ const Element = props => {
52
55
  } = props;
53
56
  switch (element.type) {
54
57
  case 'dc':
55
- return React.createElement(DynamicContentElementComponent, {
58
+ return _jsx(DynamicContentElementComponent, {
56
59
  ...props,
57
60
  onDelete: onDelete
58
61
  });
59
62
  default:
60
- return React.createElement("p", {
61
- ...attributes
62
- }, children);
63
+ return _jsx("p", {
64
+ ...attributes,
65
+ children: children
66
+ });
63
67
  }
64
68
  };
65
69
  export function renderElement(props, onDelete) {
66
- return React.createElement(Element, {
70
+ return _jsx(Element, {
67
71
  ...props,
68
72
  onDelete: onDelete
69
73
  });
@@ -1,4 +1,5 @@
1
- import React, { useState } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useState } from 'react';
2
3
  import { Slate } from 'slate-react';
3
4
  import { usePersistentFunction } from '@pushwoosh/kit-helpers';
4
5
  import { renderElement } from './DynamicContentElement';
@@ -13,14 +14,15 @@ export const SlateEditor = ({
13
14
  }) => {
14
15
  const [initialValue] = useState(() => string2content(initialValueString));
15
16
  const [editor] = useState(createMKEditor);
16
- return React.createElement(Slate, {
17
+ return _jsx(Slate, {
17
18
  editor: editor,
18
19
  initialValue: initialValue,
19
20
  onValueChange: value => onChange(content2string(value)),
20
- onSelectionChange: onSelectionChange
21
- }, children({
22
- editor
23
- }));
21
+ onSelectionChange: onSelectionChange,
22
+ children: children({
23
+ editor
24
+ })
25
+ });
24
26
  };
25
27
  export const SlateEditable = ({
26
28
  minHeight,
@@ -30,7 +32,7 @@ export const SlateEditable = ({
30
32
  const renderElementPersistent = usePersistentFunction(props => {
31
33
  return renderElement(props, onDelete);
32
34
  });
33
- return React.createElement(EditableStyled, {
35
+ return _jsx(EditableStyled, {
34
36
  "$minHeight": minHeight,
35
37
  renderElement: renderElementPersistent,
36
38
  onFocus: onFocus
@@ -1,4 +1,5 @@
1
- import React, { useRef, useEffect } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useRef, useEffect } from 'react';
2
3
  import { Color } from '@pushwoosh/kit-constants';
3
4
  import { Spinner } from '../Spinner';
4
5
  import { useRichmediaHtml } from './hooks';
@@ -32,17 +33,18 @@ export function RichmediaPreview(props) {
32
33
  $ref.current.contentWindow.document.write(richmediaHtml);
33
34
  $ref.current.contentWindow.document.close();
34
35
  }, [$ref, richmediaHtml]);
35
- return React.createElement(RichMediaPreviewContainer, {
36
+ return _jsx(RichMediaPreviewContainer, {
36
37
  width: width,
37
38
  height: height,
38
39
  "$isLoading": isLoading,
39
- "$placeItems": "center"
40
- }, isLoading ? React.createElement(Spinner, {
41
- size: "medium",
42
- color: Color.LOCKED
43
- }) : React.createElement(RichMediaPreviewIframe, {
44
- ref: $ref,
45
- title: name,
46
- sandbox: "allow-same-origin allow-scripts"
47
- }));
40
+ "$placeItems": "center",
41
+ children: isLoading ? _jsx(Spinner, {
42
+ size: "medium",
43
+ color: Color.LOCKED
44
+ }) : _jsx(RichMediaPreviewIframe, {
45
+ ref: $ref,
46
+ title: name,
47
+ sandbox: "allow-same-origin allow-scripts"
48
+ })
49
+ });
48
50
  }
package/Select/Select.js CHANGED
@@ -1,14 +1,16 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { CloseIcon } from '@pushwoosh/kit-icons';
3
3
  import { CLASS_NAME_PREFIX } from './constants';
4
4
  import { SelectStyled, SelectAsyncStyled, SelectCreatableStyled, ClearIndicatorBox } from './styles';
5
5
  const componentsProps = {
6
6
  ClearIndicator: ({
7
7
  clearValue
8
- }) => React.createElement(ClearIndicatorBox, null, React.createElement(CloseIcon, {
9
- size: "small",
10
- onClick: clearValue
11
- }))
8
+ }) => _jsx(ClearIndicatorBox, {
9
+ children: _jsx(CloseIcon, {
10
+ size: "small",
11
+ onClick: clearValue
12
+ })
13
+ })
12
14
  };
13
15
  export function Select(props) {
14
16
  const {
@@ -18,7 +20,7 @@ export function Select(props) {
18
20
  ...props,
19
21
  classNamePrefix
20
22
  };
21
- return React.createElement(SelectStyled, {
23
+ return _jsx(SelectStyled, {
22
24
  components: componentsProps,
23
25
  ...customProps
24
26
  });
@@ -31,7 +33,7 @@ export function SelectAsync(props) {
31
33
  ...props,
32
34
  classNamePrefix
33
35
  };
34
- return React.createElement(SelectAsyncStyled, {
36
+ return _jsx(SelectAsyncStyled, {
35
37
  components: componentsProps,
36
38
  ...customProps
37
39
  });
@@ -44,7 +46,7 @@ export function CreatableSelect(props) {
44
46
  ...props,
45
47
  classNamePrefix
46
48
  };
47
- return React.createElement(SelectCreatableStyled, {
49
+ return _jsx(SelectCreatableStyled, {
48
50
  components: componentsProps,
49
51
  ...customProps
50
52
  });
@@ -1,3 +1,2 @@
1
- import React from 'react';
2
1
  import { type SendRateEditProps, type SendRateBase } from './types';
3
- export declare function SendRateEdit<T extends SendRateBase>({ sendRate, globalSendRate, onChange, applicationCode, minValue, maxValue, editGlobalClicked, }: SendRateEditProps<T>): React.JSX.Element;
2
+ export declare function SendRateEdit<T extends SendRateBase>({ sendRate, globalSendRate, onChange, applicationCode, minValue, maxValue, editGlobalClicked, }: SendRateEditProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback } from 'react';
2
3
  import { Color } from '@pushwoosh/kit-constants';
3
4
  import { Vertical } from '@pushwoosh/kit-helpers';
4
5
  import { OpenIcon } from '@pushwoosh/kit-icons';
@@ -27,7 +28,7 @@ export function SendRateEdit({
27
28
  } = sendRate;
28
29
  const isGlobalSendRateDisabled = globalSendRate.count === 0 && globalSendRate.count === 0;
29
30
  const globalSendRateLinkText = getGlobalSendRateLinkText(lang, isGlobalSendRateDisabled);
30
- const onChangeSendRate = React.useCallback(value => {
31
+ const onChangeSendRate = useCallback(value => {
31
32
  if (value === 'CUSTOM') {
32
33
  onChange({
33
34
  ...sendRate,
@@ -41,44 +42,51 @@ export function SendRateEdit({
41
42
  });
42
43
  }
43
44
  }, [onChange, sendRate, minValue]);
44
- const onSettingsChange = React.useCallback(count => {
45
+ const onSettingsChange = useCallback(count => {
45
46
  onChange({
46
47
  ...sendRate,
47
48
  sendRate: count
48
49
  });
49
50
  }, [sendRate, onChange]);
50
- return React.createElement(Container, {
51
+ return _jsx(Container, {
51
52
  "$padding": 16,
52
53
  "$bgColor": Color.SOFT_LIGHT,
53
- "$borderRadius": 8
54
- }, React.createElement(Vertical, {
55
- "$gap": 12
56
- }, React.createElement(FieldBox, {
57
- title: lang({
58
- message: 'DUMB.SEND_RATE.FIELD_TITLE'
54
+ "$borderRadius": 8,
55
+ children: _jsxs(Vertical, {
56
+ "$gap": 12,
57
+ children: [_jsx(FieldBox, {
58
+ title: lang({
59
+ message: 'DUMB.SEND_RATE.FIELD_TITLE'
60
+ }),
61
+ children: _jsx(Select, {
62
+ name: "sendRateOption",
63
+ options: sendRateOptions,
64
+ value: sendRateOptions.find(option => option.value === policy),
65
+ onChange: newValue => onChangeSendRate(newValue.value)
66
+ })
67
+ }), _jsx(Description, {
68
+ sendRateOption: policy,
69
+ messages: globalSendRate.count,
70
+ seconds: globalSendRate.seconds,
71
+ children: policy === 'GLOBAL' && _jsx(Link, {
72
+ href: `/applications/${applicationCode}/message-delivery?tab=sendRate`,
73
+ title: globalSendRateLinkText,
74
+ target: "_blank",
75
+ onClick: editGlobalClicked,
76
+ children: _jsxs(LinkWrapper, {
77
+ children: [globalSendRateLinkText, _jsx(OpenIcon, {
78
+ size: "small",
79
+ view: "lined",
80
+ as: "span"
81
+ })]
82
+ })
83
+ })
84
+ }), policy === 'CUSTOM' && _jsx(EditSendRateSettings, {
85
+ messages: count,
86
+ onChange: onSettingsChange,
87
+ minValue: minValue,
88
+ maxValue: maxValue
89
+ })]
59
90
  })
60
- }, React.createElement(Select, {
61
- name: "sendRateOption",
62
- options: sendRateOptions,
63
- value: sendRateOptions.find(option => option.value === policy),
64
- onChange: newValue => onChangeSendRate(newValue.value)
65
- })), React.createElement(Description, {
66
- sendRateOption: policy,
67
- messages: globalSendRate.count,
68
- seconds: globalSendRate.seconds
69
- }, policy === 'GLOBAL' && React.createElement(Link, {
70
- href: `/applications/${applicationCode}/message-delivery?tab=sendRate`,
71
- title: globalSendRateLinkText,
72
- target: "_blank",
73
- onClick: editGlobalClicked
74
- }, React.createElement(LinkWrapper, null, globalSendRateLinkText, React.createElement(OpenIcon, {
75
- size: "small",
76
- view: "lined",
77
- as: "span"
78
- })))), policy === 'CUSTOM' && React.createElement(EditSendRateSettings, {
79
- messages: count,
80
- onChange: onSettingsChange,
81
- minValue: minValue,
82
- maxValue: maxValue
83
- })));
91
+ });
84
92
  }