@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.
- package/AccessForbidden/AccessForbidden.js +19 -5
- package/AccessForbidden/polyglot/index.d.ts +2 -0
- package/AccessForbidden/polyglot/index.js +10 -0
- package/AccessForbidden/polyglot/messages_en.d.ts +3 -0
- package/AccessForbidden/polyglot/messages_en.js +4 -0
- package/AccessForbidden/polyglot/messages_ru.d.ts +3 -0
- package/AccessForbidden/polyglot/messages_ru.js +4 -0
- package/AccessForbidden/polyglot/types.d.ts +5 -0
- package/AccessForbidden/polyglot/types.js +1 -0
- package/Alert/Alert.d.ts +1 -2
- package/Alert/Alert.js +31 -25
- package/ApplicationPreloader/ApplicationPreloader.d.ts +1 -2
- package/ApplicationPreloader/ApplicationPreloader.js +5 -4
- package/Badge/Badge.js +2 -2
- package/Banner/Banner.js +40 -24
- package/Button/Button.js +20 -9
- package/Button/RemoveButton.js +7 -6
- package/Calendar/CalendarDropdown/CalendarDropdown.js +121 -108
- package/Calendar/CalendarMonth/CalendarMonth.js +68 -66
- package/Calendar/CalendarMonthSlider/CalendarMonthSlider.d.ts +2 -2
- package/Calendar/CalendarMonthSlider/CalendarMonthSlider.js +68 -55
- package/Calendar/CalendarSuperForm/CalendarSuperForm.js +75 -70
- package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.d.ts +2 -2
- package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.js +3 -2
- package/Calendar/CalendarSuperForm/components/CalendarTimeAndTimezoneSection/CalendarTimeAndTimezoneSection.js +106 -88
- package/Calendar/CalendarSuperForm/components/CalendarTimeInput.d.ts +1 -2
- package/Calendar/CalendarSuperForm/components/CalendarTimeInput.js +2 -2
- package/Calendar/CalendarSuperForm/components/CalendarTimezoneSelect.js +3 -2
- package/CardMetric/CardChildren.js +9 -6
- package/CardMetric/CardCollapse.js +8 -6
- package/CardMetric/CardMetric.js +52 -33
- package/Checkbox/Checkbox.js +30 -24
- package/Chip/Chip.d.ts +6 -7
- package/Chip/Chip.js +22 -15
- package/CodeEditor/CodeEditor.d.ts +1 -2
- package/CodeEditor/CodeEditor.js +2 -2
- package/CrashScreen/CrashScreen.js +19 -6
- package/CrashScreen/polyglot/index.d.ts +2 -0
- package/CrashScreen/polyglot/index.js +10 -0
- package/CrashScreen/polyglot/messages_en.d.ts +3 -0
- package/CrashScreen/polyglot/messages_en.js +4 -0
- package/CrashScreen/polyglot/messages_ru.d.ts +3 -0
- package/CrashScreen/polyglot/messages_ru.js +4 -0
- package/CrashScreen/polyglot/types.d.ts +5 -0
- package/CrashScreen/polyglot/types.js +1 -0
- package/DateTimePicker/components/AutosizeInput/AutosizeInput.js +17 -13
- package/DateTimePicker/components/DatePicker/DatePicker.js +35 -32
- package/DateTimePicker/components/DatePickerField/DatePickerField.js +32 -22
- package/DateTimePicker/components/DateTimePicker/DateTimePicker.js +22 -20
- package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +30 -22
- package/DateTimePicker/components/DecadeView/DecadeView.js +19 -17
- package/DateTimePicker/components/Input/Input.js +2 -2
- package/DateTimePicker/components/Month/Month.js +52 -21
- package/DateTimePicker/components/MonthView/MonthView.js +21 -17
- package/DateTimePicker/components/NumberPicker/NumberPicker.js +49 -40
- package/DateTimePicker/components/PickerPlate/PickerPlate.js +17 -14
- package/DateTimePicker/components/YearView/YearView.js +22 -18
- package/DateTimePicker/polyglot/index.d.ts +2 -0
- package/DateTimePicker/polyglot/index.js +9 -0
- package/DateTimePicker/polyglot/messages_en.d.ts +3 -0
- package/DateTimePicker/polyglot/messages_en.js +11 -0
- package/DateTimePicker/polyglot/messages_ru.d.ts +3 -0
- package/DateTimePicker/polyglot/messages_ru.js +11 -0
- package/DateTimePicker/polyglot/types.d.ts +12 -0
- package/DateTimePicker/polyglot/types.js +1 -0
- package/Drawer/components/Drawer/Drawer.js +18 -13
- package/Drawer/components/Drawer/styles.d.ts +2 -2
- package/Drawer/components/Drawer/styles.js +5 -4
- package/Drawer/components/DrawerDocs/DrawerDocs.js +28 -17
- package/Drawer/polyglot/index.d.ts +2 -0
- package/Drawer/polyglot/index.js +10 -0
- package/Drawer/polyglot/messages_en.d.ts +3 -0
- package/Drawer/polyglot/messages_en.js +4 -0
- package/Drawer/polyglot/messages_ru.d.ts +3 -0
- package/Drawer/polyglot/messages_ru.js +4 -0
- package/Drawer/polyglot/types.d.ts +5 -0
- package/Drawer/polyglot/types.js +1 -0
- package/DropdownMenu/components/DropdownMenu/DropdownMenu.js +28 -24
- package/DropdownMenu/components/DropdownMenuButton/DropdownMenuButton.js +8 -6
- package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.js +6 -4
- package/DropdownMenu/components/DropdownMenuSection/DropdownMenuSection.js +13 -10
- package/DropdownMenu/components/DropdownMenuSubmenu/DropdownMenuSubmenu.js +40 -31
- package/EditableField/EditableField.js +56 -39
- package/EditableField/polyglot/index.d.ts +2 -0
- package/EditableField/polyglot/index.js +9 -0
- package/EditableField/polyglot/messages_en.d.ts +3 -0
- package/EditableField/polyglot/messages_en.js +4 -0
- package/EditableField/polyglot/messages_ru.d.ts +3 -0
- package/EditableField/polyglot/messages_ru.js +4 -0
- package/EditableField/polyglot/types.d.ts +5 -0
- package/EditableField/polyglot/types.js +1 -0
- package/EmailTemplatePreview/EmailTemplatePreview.js +10 -8
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +30 -16
- package/EmailTemplatePreview/polyglot/index.d.ts +2 -0
- package/EmailTemplatePreview/polyglot/index.js +10 -0
- package/EmailTemplatePreview/polyglot/messages_en.d.ts +3 -0
- package/EmailTemplatePreview/polyglot/messages_en.js +5 -0
- package/EmailTemplatePreview/polyglot/messages_ru.d.ts +3 -0
- package/EmailTemplatePreview/polyglot/messages_ru.js +5 -0
- package/EmailTemplatePreview/polyglot/types.d.ts +6 -0
- package/EmailTemplatePreview/polyglot/types.js +1 -0
- package/EnhancedInput/EnhancedInput.d.ts +3 -4
- package/EnhancedInput/EnhancedInput.js +14 -10
- package/EnhancedInput/SearchInput.js +3 -3
- package/ExportResult/ExportResult.js +33 -23
- package/ExternalImagePreview/ExternalImagePreview.js +24 -20
- package/FieldBox/FieldBox.js +50 -37
- package/FrequencyCapping/FrequencyCappingEdit.js +41 -33
- package/FrequencyCapping/FrequencyCappingInApps.js +41 -33
- package/FrequencyCapping/FrequencyCappingReadonly.d.ts +1 -2
- package/FrequencyCapping/FrequencyCappingReadonly.js +24 -20
- package/FrequencyCapping/components/Condition/index.d.ts +1 -2
- package/FrequencyCapping/components/Condition/index.js +24 -20
- package/FrequencyCapping/components/Description/index.d.ts +2 -2
- package/FrequencyCapping/components/Description/index.js +7 -5
- package/FrequencyCapping/components/Settings/EditCappingSettings.js +28 -20
- package/FrequencyCapping/components/Settings/EditInAppCappingSettings.js +86 -71
- package/FrequencyCapping/helpers/getReadonlyCappingHelpers.d.ts +1 -2
- package/FrequencyCapping/helpers/getReadonlyCappingHelpers.js +41 -32
- package/GetStartedPage/GetStartedPage.js +44 -25
- package/InputFile/InputFile.js +44 -35
- package/Link/Link.js +2 -2
- package/Modal/components/Modal/Modal.js +17 -12
- package/Modal/components/Modal/styles.js +5 -4
- package/Modal/components/ModalConfirm/ModalConfirm.js +51 -24
- package/Modal/components/ModalConfirm/ModalConfirmProvider.d.ts +2 -2
- package/Modal/components/ModalConfirm/ModalConfirmProvider.js +8 -6
- package/Modal/components/ModalConfirm/types.d.ts +1 -1
- package/Modal/components/ModalTitle/ModalTitle.js +10 -8
- package/Modal/polyglot/index.d.ts +2 -0
- package/Modal/polyglot/index.js +9 -0
- package/Modal/polyglot/messages_en.d.ts +3 -0
- package/Modal/polyglot/messages_en.js +6 -0
- package/Modal/polyglot/messages_ru.d.ts +3 -0
- package/Modal/polyglot/messages_ru.js +6 -0
- package/Modal/polyglot/types.d.ts +7 -0
- package/Modal/polyglot/types.js +1 -0
- package/NotificationInbox/NotificationBar.js +19 -11
- package/NotificationInbox/NotificationBell.js +21 -12
- package/NotificationInbox/NotificationInbox.js +160 -105
- package/NotificationInbox/polyglot/index.d.ts +2 -0
- package/NotificationInbox/polyglot/index.js +10 -0
- package/NotificationInbox/polyglot/messages_en.d.ts +3 -0
- package/NotificationInbox/polyglot/messages_en.js +8 -0
- package/NotificationInbox/polyglot/messages_ru.d.ts +3 -0
- package/NotificationInbox/polyglot/messages_ru.js +8 -0
- package/NotificationInbox/polyglot/types.d.ts +11 -0
- package/NotificationInbox/polyglot/types.js +1 -0
- package/NumberPicker/NumberPicker.js +53 -44
- package/NumberPicker/components/AutosizeInput/AutosizeInput.js +19 -15
- package/PageHeader/components/AutosizeInput/AutosizeInput.js +30 -22
- package/PageHeader/components/PageHeader/PageHeader.js +44 -27
- package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.js +51 -34
- package/PageHeader/components/PageHeaderError/PageHeaderError.js +17 -10
- package/PageHeader/components/PageHeaderSkeleton/PageHeaderSkeleton.js +20 -16
- package/Pagination/Pagination.js +60 -49
- package/Popover/Popover.js +6 -5
- package/ProgressBar/ProgressBar.js +25 -10
- package/PushPreview/PushPreview.js +30 -22
- package/PushPreview/components/MissedContentPreview/MissedContentPreview.js +23 -11
- package/PushPreview/components/SilentPushPreview/SilentPushPreview.js +20 -13
- package/PushPreview/polyglot/index.d.ts +2 -0
- package/PushPreview/polyglot/index.js +9 -0
- package/PushPreview/polyglot/messages_en.d.ts +3 -0
- package/PushPreview/polyglot/messages_en.js +4 -0
- package/PushPreview/polyglot/messages_ru.d.ts +3 -0
- package/PushPreview/polyglot/messages_ru.js +4 -0
- package/PushPreview/polyglot/types.d.ts +5 -0
- package/PushPreview/polyglot/types.js +1 -0
- package/Radio/Radio.js +32 -26
- package/RadioCard/RadioCard.js +17 -9
- package/ReCaptcha/ReCaptcha.js +2 -2
- package/RichMessageEditor/EditorEmojiPicker.js +9 -7
- package/RichMessageEditor/RichMessageEditor.js +77 -67
- package/RichMessageEditor/RichMessageViewer.js +19 -13
- package/RichMessageEditor/slate/DynamicContentElement.d.ts +1 -2
- package/RichMessageEditor/slate/DynamicContentElement.js +13 -9
- package/RichMessageEditor/slate/SlateEditor.js +9 -7
- package/RichmediaPreview/RichmediaPreview.js +13 -11
- package/Select/Select.js +10 -8
- package/SendRate/SendRateEdit.d.ts +1 -2
- package/SendRate/SendRateEdit.js +42 -34
- package/SendRate/SendRateReadonly.d.ts +1 -2
- package/SendRate/SendRateReadonly.js +24 -20
- package/SendRate/components/Condition/index.d.ts +1 -2
- package/SendRate/components/Condition/index.js +15 -13
- package/SendRate/components/Description/index.d.ts +2 -2
- package/SendRate/components/Description/index.js +30 -22
- package/SendRate/components/Settings/index.d.ts +1 -2
- package/SendRate/components/Settings/index.js +20 -14
- package/SendRate/helpers/getReadonlySendRateHelpers.d.ts +1 -2
- package/SendRate/helpers/getReadonlySendRateHelpers.js +39 -30
- package/Skeleton/TextSkeleton.js +5 -4
- package/SortButton/SortButton.js +11 -7
- package/Spinner/Spinner.js +7 -4
- package/StatisticCard/StatisticCard.js +44 -29
- package/Switch/Switch.js +16 -13
- package/Tabs/components/Tab/Tab.d.ts +3 -4
- package/Tabs/components/Tab/Tab.js +6 -4
- package/Tabs/components/TabBar/TabBar.d.ts +3 -4
- package/Tabs/components/TabBar/TabBar.js +12 -4
- package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.d.ts +1 -2
- package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.js +27 -21
- package/Tabs/components/TabBase/TabBase.d.ts +3 -4
- package/Tabs/components/TabBase/TabBase.js +11 -6
- package/Tabs/components/TabPanel/TabPanel.js +4 -2
- package/Tabs/components/Tabs/Tabs.js +8 -4
- package/Toast/Toast.js +31 -18
- package/Toast/ToastProvider.d.ts +2 -3
- package/Toast/ToastProvider.js +10 -8
- package/Tooltip/Tooltip.js +2 -2
- package/Tooltip/TooltipTrigger.js +13 -11
- package/package.json +2 -2
- package/polyglot/__tests__/render.test.js +46 -16
- package/polyglot/liquid/render.d.ts +2 -2
- package/polyglot/liquid/render.js +7 -6
- package/polyglot/react.js +7 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/Radio/Radio.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
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 =
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
|
54
|
+
return _jsxs(Horizontal, {
|
|
50
55
|
"$gap": 4,
|
|
51
|
-
"$alignItems": "start"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
}
|
package/RadioCard/RadioCard.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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
|
|
15
|
+
return _jsxs(RootBox, {
|
|
16
16
|
"$width": width,
|
|
17
17
|
isActive: isActive,
|
|
18
|
-
onClick: onClick
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
}
|
package/ReCaptcha/ReCaptcha.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
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
|
|
5
|
+
return _jsx(RecaptchaElement, {
|
|
6
6
|
id: RECAPTCHA_CONTAINER_ID
|
|
7
7
|
});
|
|
8
8
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import
|
|
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
|
|
8
|
-
|
|
9
|
-
onEmojiSelect
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
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
|
|
89
|
+
return _jsx(SlateEditor, {
|
|
89
90
|
initialValue: initialValue,
|
|
90
91
|
onChange: onChange,
|
|
91
|
-
onSelectionChange: onSelectionChange
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
41
|
+
_jsx(Paragraph, {
|
|
42
|
+
dir: "auto",
|
|
43
|
+
children: children
|
|
44
|
+
}, index)
|
|
39
45
|
);
|
|
40
46
|
});
|
|
41
47
|
};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
58
|
+
return _jsx(DynamicContentElementComponent, {
|
|
56
59
|
...props,
|
|
57
60
|
onDelete: onDelete
|
|
58
61
|
});
|
|
59
62
|
default:
|
|
60
|
-
return
|
|
61
|
-
...attributes
|
|
62
|
-
|
|
63
|
+
return _jsx("p", {
|
|
64
|
+
...attributes,
|
|
65
|
+
children: children
|
|
66
|
+
});
|
|
63
67
|
}
|
|
64
68
|
};
|
|
65
69
|
export function renderElement(props, onDelete) {
|
|
66
|
-
return
|
|
70
|
+
return _jsx(Element, {
|
|
67
71
|
...props,
|
|
68
72
|
onDelete: onDelete
|
|
69
73
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
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
|
|
17
|
+
return _jsx(Slate, {
|
|
17
18
|
editor: editor,
|
|
18
19
|
initialValue: initialValue,
|
|
19
20
|
onValueChange: value => onChange(content2string(value)),
|
|
20
|
-
onSelectionChange: onSelectionChange
|
|
21
|
-
|
|
22
|
-
|
|
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
|
|
35
|
+
return _jsx(EditableStyled, {
|
|
34
36
|
"$minHeight": minHeight,
|
|
35
37
|
renderElement: renderElementPersistent,
|
|
36
38
|
onFocus: onFocus
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
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
|
|
36
|
+
return _jsx(RichMediaPreviewContainer, {
|
|
36
37
|
width: width,
|
|
37
38
|
height: height,
|
|
38
39
|
"$isLoading": isLoading,
|
|
39
|
-
"$placeItems": "center"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
|
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
|
-
}) =>
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
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
|
|
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
|
|
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>):
|
|
2
|
+
export declare function SendRateEdit<T extends SendRateBase>({ sendRate, globalSendRate, onChange, applicationCode, minValue, maxValue, editGlobalClicked, }: SendRateEditProps<T>): import("react/jsx-runtime").JSX.Element;
|
package/SendRate/SendRateEdit.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
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 =
|
|
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 =
|
|
45
|
+
const onSettingsChange = useCallback(count => {
|
|
45
46
|
onChange({
|
|
46
47
|
...sendRate,
|
|
47
48
|
sendRate: count
|
|
48
49
|
});
|
|
49
50
|
}, [sendRate, onChange]);
|
|
50
|
-
return
|
|
51
|
+
return _jsx(Container, {
|
|
51
52
|
"$padding": 16,
|
|
52
53
|
"$bgColor": Color.SOFT_LIGHT,
|
|
53
|
-
"$borderRadius": 8
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
}
|
|
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
|
}
|