@pushwoosh/dumb-components 1.1.135 → 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 +17 -11
- 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 +18 -10
- package/DateTimePicker/components/AutosizeInput/AutosizeInput.js +17 -13
- package/DateTimePicker/components/DatePicker/DatePicker.js +35 -32
- package/DateTimePicker/components/DatePickerField/DatePickerField.js +31 -24
- package/DateTimePicker/components/DateTimePicker/DateTimePicker.js +22 -20
- package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +29 -24
- package/DateTimePicker/components/DecadeView/DecadeView.js +19 -17
- package/DateTimePicker/components/Input/Input.js +2 -2
- package/DateTimePicker/components/Month/Month.js +51 -35
- 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/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 +25 -20
- 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 +55 -43
- package/EmailTemplatePreview/EmailTemplatePreview.js +10 -8
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +28 -22
- 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 +33 -19
- package/Modal/components/ModalConfirm/ModalConfirmProvider.d.ts +2 -2
- package/Modal/components/ModalConfirm/ModalConfirmProvider.js +8 -6
- package/Modal/components/ModalTitle/ModalTitle.js +10 -8
- package/NotificationInbox/NotificationBar.js +19 -11
- package/NotificationInbox/NotificationBell.js +15 -12
- package/NotificationInbox/NotificationInbox.js +159 -118
- 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 +22 -15
- package/PushPreview/components/SilentPushPreview/SilentPushPreview.js +20 -13
- 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
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import { CloseIcon } from '@pushwoosh/kit-icons';
|
|
3
4
|
import { Wrapper, RightSlot } from './styles';
|
|
4
5
|
import { NativeInput } from '../native';
|
|
@@ -8,16 +9,19 @@ export const EnhancedInput = forwardRef(({
|
|
|
8
9
|
hint,
|
|
9
10
|
...props
|
|
10
11
|
}, ref) => {
|
|
11
|
-
return
|
|
12
|
+
return _jsxs(Wrapper, {
|
|
12
13
|
"$hasIcon": !!$icon,
|
|
13
14
|
"$hasClear": !!$onClear,
|
|
14
15
|
"$hasError": !!props.$isErrored,
|
|
15
|
-
"$hasHint": !!hint
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
"$hasHint": !!hint,
|
|
17
|
+
children: [$icon, _jsx(NativeInput, {
|
|
18
|
+
...props,
|
|
19
|
+
ref: ref
|
|
20
|
+
}), hint && _jsx(RightSlot, {
|
|
21
|
+
children: hint
|
|
22
|
+
}), $onClear && _jsx(CloseIcon, {
|
|
23
|
+
size: "small",
|
|
24
|
+
onClick: $onClear
|
|
25
|
+
})]
|
|
26
|
+
});
|
|
23
27
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { SearchIcon } from '@pushwoosh/kit-icons';
|
|
3
3
|
import { EnhancedInput } from './EnhancedInput';
|
|
4
4
|
export const SearchInput = props => {
|
|
5
|
-
return
|
|
5
|
+
return _jsx(EnhancedInput, {
|
|
6
6
|
...props,
|
|
7
|
-
"$icon":
|
|
7
|
+
"$icon": _jsx(SearchIcon, {
|
|
8
8
|
size: "medium",
|
|
9
9
|
view: "lined"
|
|
10
10
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
3
3
|
import { CloseIcon, CsvIcon } from '@pushwoosh/kit-icons';
|
|
4
4
|
import { Button } from '../Button';
|
|
@@ -12,28 +12,38 @@ export function ExportResult(props) {
|
|
|
12
12
|
rightSlot,
|
|
13
13
|
handleClose
|
|
14
14
|
} = props;
|
|
15
|
-
return
|
|
15
|
+
return _jsxs(Horizontal, {
|
|
16
16
|
"$justifyContent": "space-between",
|
|
17
17
|
"$alignItems": "center",
|
|
18
|
-
"$gap": 12
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
18
|
+
"$gap": 12,
|
|
19
|
+
children: [_jsxs(Horizontal, {
|
|
20
|
+
"$gap": 12,
|
|
21
|
+
children: [_jsx(LeftSlot, {
|
|
22
|
+
"$type": type,
|
|
23
|
+
"$alignItems": "center",
|
|
24
|
+
"$padding": 4,
|
|
25
|
+
children: leftSlotIcon || _jsx(CsvIcon, {
|
|
26
|
+
size: "medium",
|
|
27
|
+
view: "filled"
|
|
28
|
+
})
|
|
29
|
+
}), _jsxs(MainInfoContainer, {
|
|
30
|
+
children: [_jsx(Title, {
|
|
31
|
+
children: title
|
|
32
|
+
}), _jsx(Subtitle, {
|
|
33
|
+
children: subtitle
|
|
34
|
+
})]
|
|
35
|
+
})]
|
|
36
|
+
}), _jsxs(RightSlotContainer, {
|
|
37
|
+
"$alignItems": "center",
|
|
38
|
+
"$gap": 8,
|
|
39
|
+
children: [rightSlot, _jsx(Button, {
|
|
40
|
+
color: "secondary",
|
|
41
|
+
onClick: handleClose,
|
|
42
|
+
size: "compact",
|
|
43
|
+
icon: _jsx(CloseIcon, {
|
|
44
|
+
size: "small"
|
|
45
|
+
})
|
|
46
|
+
})]
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
39
49
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
2
3
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
4
|
import { Spinner } from '../Spinner';
|
|
4
5
|
import { RootBox, ImgPreview, PlaceholderWrapper } from './styles';
|
|
@@ -26,25 +27,28 @@ export function ExternalImagePreview(props) {
|
|
|
26
27
|
onError(error);
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
|
-
return
|
|
30
|
-
width: width,
|
|
31
|
-
height: height
|
|
32
|
-
}, (!src || isError) && React.createElement(PlaceholderWrapper, {
|
|
33
|
-
width: width,
|
|
34
|
-
height: height
|
|
35
|
-
}, placeholder), isLoading && React.createElement(PlaceholderWrapper, {
|
|
36
|
-
width: width,
|
|
37
|
-
height: height
|
|
38
|
-
}, React.createElement(Spinner, {
|
|
39
|
-
size: "small",
|
|
40
|
-
color: Color.CLEAR
|
|
41
|
-
})), React.createElement(ImgPreview, {
|
|
30
|
+
return _jsxs(RootBox, {
|
|
42
31
|
width: width,
|
|
43
32
|
height: height,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
33
|
+
children: [(!src || isError) && _jsx(PlaceholderWrapper, {
|
|
34
|
+
width: width,
|
|
35
|
+
height: height,
|
|
36
|
+
children: placeholder
|
|
37
|
+
}), isLoading && _jsx(PlaceholderWrapper, {
|
|
38
|
+
width: width,
|
|
39
|
+
height: height,
|
|
40
|
+
children: _jsx(Spinner, {
|
|
41
|
+
size: "small",
|
|
42
|
+
color: Color.CLEAR
|
|
43
|
+
})
|
|
44
|
+
}), _jsx(ImgPreview, {
|
|
45
|
+
width: width,
|
|
46
|
+
height: height,
|
|
47
|
+
isHide: !src || isLoading || isError,
|
|
48
|
+
alt: alt,
|
|
49
|
+
src: src,
|
|
50
|
+
onError: handleOnError,
|
|
51
|
+
onLoad: () => setIsLoading(false)
|
|
52
|
+
})]
|
|
53
|
+
});
|
|
50
54
|
}
|
package/FieldBox/FieldBox.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Color, Tag } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { Horizontal, Vertical } from '@pushwoosh/kit-helpers';
|
|
4
4
|
import { OpenIcon, InfoRoundIcon } from '@pushwoosh/kit-icons';
|
|
@@ -18,41 +18,54 @@ export function FieldBox(props) {
|
|
|
18
18
|
actionsRef,
|
|
19
19
|
children
|
|
20
20
|
} = props;
|
|
21
|
-
return
|
|
21
|
+
return _jsxs(Vertical, {
|
|
22
22
|
ref: boxRef,
|
|
23
|
-
"$gap": 4
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
23
|
+
"$gap": 4,
|
|
24
|
+
children: [title && _jsxs(Horizontal, {
|
|
25
|
+
"$alignItems": "center",
|
|
26
|
+
"$justifyContent": "space-between",
|
|
27
|
+
children: [_jsxs(TitleBox, {
|
|
28
|
+
children: [_jsx(Text, {
|
|
29
|
+
"$variant": "h5",
|
|
30
|
+
children: title
|
|
31
|
+
}), isOptional && _jsx(Text, {
|
|
32
|
+
"$color": Color.LOCKED,
|
|
33
|
+
"$variant": "footnote",
|
|
34
|
+
children: "(optional)"
|
|
35
|
+
}), tooltip && _jsx(Tooltip, {
|
|
36
|
+
content: tooltip,
|
|
37
|
+
position: "right-middle",
|
|
38
|
+
children: _jsx("div", {
|
|
39
|
+
children: _jsx(InfoRoundIcon, {
|
|
40
|
+
color: Color.LOCKED,
|
|
41
|
+
size: "small",
|
|
42
|
+
view: "lined"
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
}), link && _jsx(Link, {
|
|
46
|
+
as: Tag.A,
|
|
47
|
+
href: link,
|
|
48
|
+
target: "_blank",
|
|
49
|
+
rel: "noopener noreferrer",
|
|
50
|
+
children: _jsx(OpenIcon, {
|
|
51
|
+
size: "small",
|
|
52
|
+
view: "lined"
|
|
53
|
+
})
|
|
54
|
+
})]
|
|
55
|
+
}), actions && _jsx(Horizontal, {
|
|
56
|
+
ref: actionsRef,
|
|
57
|
+
"$alignItems": "center",
|
|
58
|
+
"$gap": 4,
|
|
59
|
+
children: actions
|
|
60
|
+
})]
|
|
61
|
+
}), children, description && !error && _jsx(Text, {
|
|
62
|
+
"$variant": "footnote",
|
|
63
|
+
"$color": Color.LOCKED,
|
|
64
|
+
children: description
|
|
65
|
+
}), error && _jsx(Text, {
|
|
66
|
+
"$variant": "footnote",
|
|
67
|
+
"$color": Color.DANGER,
|
|
68
|
+
children: error
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
58
71
|
}
|
|
@@ -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';
|
|
@@ -64,39 +65,46 @@ export function FrequencyCappingEdit({
|
|
|
64
65
|
days
|
|
65
66
|
});
|
|
66
67
|
}, [capping, onChange]);
|
|
67
|
-
return
|
|
68
|
+
return _jsx(Container, {
|
|
68
69
|
"$padding": 16,
|
|
69
70
|
"$bgColor": Color.SOFT_LIGHT,
|
|
70
|
-
"$borderRadius": 8
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
"$borderRadius": 8,
|
|
72
|
+
children: _jsxs(Vertical, {
|
|
73
|
+
"$gap": 12,
|
|
74
|
+
children: [_jsx(FieldBox, {
|
|
75
|
+
title: lang({
|
|
76
|
+
message: 'DUMB.FREQUENCY_CAPPING.FIELD_TITLE'
|
|
77
|
+
}),
|
|
78
|
+
children: _jsx(Select, {
|
|
79
|
+
name: "cappingOption",
|
|
80
|
+
isDisabled: isDisabled,
|
|
81
|
+
options: cappingOptions,
|
|
82
|
+
value: cappingOptions.find(option => option.value === cappingOption),
|
|
83
|
+
onChange: newValue => onChangeFrequencyCapping(newValue.value)
|
|
84
|
+
})
|
|
85
|
+
}), _jsx(Description, {
|
|
86
|
+
cappingOption: cappingOption,
|
|
87
|
+
messages: globalCapping.count,
|
|
88
|
+
days: globalCapping.days,
|
|
89
|
+
isInJourney: isInJourney,
|
|
90
|
+
children: cappingOption === CappingTypes.GLOBAL && _jsx(Link, {
|
|
91
|
+
target: "_blank",
|
|
92
|
+
href: `/applications/${applicationCode}/message-delivery?tab=capping`,
|
|
93
|
+
title: globalCappingLinkText,
|
|
94
|
+
onClick: editGlobalClicked,
|
|
95
|
+
children: _jsxs(LinkWrapper, {
|
|
96
|
+
children: [globalCappingLinkText, _jsx(OpenIcon, {
|
|
97
|
+
size: "small",
|
|
98
|
+
view: "lined",
|
|
99
|
+
as: "span"
|
|
100
|
+
})]
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
}), cappingOption === CappingTypes.CUSTOM && !isDisabled && _jsx(EditCappingSettings, {
|
|
104
|
+
messages: messages,
|
|
105
|
+
days: days,
|
|
106
|
+
onChange: onSettingsChange
|
|
107
|
+
})]
|
|
76
108
|
})
|
|
77
|
-
}
|
|
78
|
-
name: "cappingOption",
|
|
79
|
-
isDisabled: isDisabled,
|
|
80
|
-
options: cappingOptions,
|
|
81
|
-
value: cappingOptions.find(option => option.value === cappingOption),
|
|
82
|
-
onChange: newValue => onChangeFrequencyCapping(newValue.value)
|
|
83
|
-
})), React.createElement(Description, {
|
|
84
|
-
cappingOption: cappingOption,
|
|
85
|
-
messages: globalCapping.count,
|
|
86
|
-
days: globalCapping.days,
|
|
87
|
-
isInJourney: isInJourney
|
|
88
|
-
}, cappingOption === CappingTypes.GLOBAL && React.createElement(Link, {
|
|
89
|
-
target: "_blank",
|
|
90
|
-
href: `/applications/${applicationCode}/message-delivery?tab=capping`,
|
|
91
|
-
title: globalCappingLinkText,
|
|
92
|
-
onClick: editGlobalClicked
|
|
93
|
-
}, React.createElement(LinkWrapper, null, globalCappingLinkText, React.createElement(OpenIcon, {
|
|
94
|
-
size: "small",
|
|
95
|
-
view: "lined",
|
|
96
|
-
as: "span"
|
|
97
|
-
})))), cappingOption === CappingTypes.CUSTOM && !isDisabled && React.createElement(EditCappingSettings, {
|
|
98
|
-
messages: messages,
|
|
99
|
-
days: days,
|
|
100
|
-
onChange: onSettingsChange
|
|
101
|
-
})));
|
|
109
|
+
});
|
|
102
110
|
}
|
|
@@ -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';
|
|
@@ -57,39 +58,46 @@ export function FrequencyCappingInApps(props) {
|
|
|
57
58
|
const onSettingsChange = useCallback(newCapping => {
|
|
58
59
|
onChange(newCapping);
|
|
59
60
|
}, [onChange]);
|
|
60
|
-
return
|
|
61
|
+
return _jsx(Container, {
|
|
61
62
|
"$padding": 16,
|
|
62
63
|
"$bgColor": Color.SOFT_LIGHT,
|
|
63
|
-
"$borderRadius": 8
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
"$borderRadius": 8,
|
|
65
|
+
children: _jsxs(Vertical, {
|
|
66
|
+
"$gap": 12,
|
|
67
|
+
children: [_jsx(FieldBox, {
|
|
68
|
+
title: lang({
|
|
69
|
+
message: 'DUMB.FREQUENCY_CAPPING.FIELD_TITLE'
|
|
70
|
+
}),
|
|
71
|
+
children: _jsx(Select, {
|
|
72
|
+
name: "cappingOption",
|
|
73
|
+
isDisabled: isDisabled,
|
|
74
|
+
options: cappingOptions,
|
|
75
|
+
value: cappingOptions.find(option => option.value === cappingOption),
|
|
76
|
+
onChange: newValue => onChangeFrequencyCapping(newValue.value)
|
|
77
|
+
})
|
|
78
|
+
}), _jsx(Description, {
|
|
79
|
+
cappingOption: cappingOption,
|
|
80
|
+
messages: globalCapping.count,
|
|
81
|
+
days: globalCapping.days,
|
|
82
|
+
isInJourney: isInJourney,
|
|
83
|
+
variant: "in-app",
|
|
84
|
+
children: cappingOption === CappingTypes.GLOBAL && _jsx(Link, {
|
|
85
|
+
target: "_blank",
|
|
86
|
+
href: `/applications/${applicationCode}/message-delivery?tab=capping`,
|
|
87
|
+
title: globalCappingLinkText,
|
|
88
|
+
onClick: editGlobalClicked,
|
|
89
|
+
children: _jsxs(LinkWrapper, {
|
|
90
|
+
children: [globalCappingLinkText, _jsx(OpenIcon, {
|
|
91
|
+
size: "small",
|
|
92
|
+
view: "lined",
|
|
93
|
+
as: "span"
|
|
94
|
+
})]
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
}), cappingOption === CappingTypes.CUSTOM && !isDisabled && _jsx(EditInAppCappingSettings, {
|
|
98
|
+
capping: capping,
|
|
99
|
+
onChange: onSettingsChange
|
|
100
|
+
})]
|
|
69
101
|
})
|
|
70
|
-
}
|
|
71
|
-
name: "cappingOption",
|
|
72
|
-
isDisabled: isDisabled,
|
|
73
|
-
options: cappingOptions,
|
|
74
|
-
value: cappingOptions.find(option => option.value === cappingOption),
|
|
75
|
-
onChange: newValue => onChangeFrequencyCapping(newValue.value)
|
|
76
|
-
})), React.createElement(Description, {
|
|
77
|
-
cappingOption: cappingOption,
|
|
78
|
-
messages: globalCapping.count,
|
|
79
|
-
days: globalCapping.days,
|
|
80
|
-
isInJourney: isInJourney,
|
|
81
|
-
variant: "in-app"
|
|
82
|
-
}, cappingOption === CappingTypes.GLOBAL && React.createElement(Link, {
|
|
83
|
-
target: "_blank",
|
|
84
|
-
href: `/applications/${applicationCode}/message-delivery?tab=capping`,
|
|
85
|
-
title: globalCappingLinkText,
|
|
86
|
-
onClick: editGlobalClicked
|
|
87
|
-
}, React.createElement(LinkWrapper, null, globalCappingLinkText, React.createElement(OpenIcon, {
|
|
88
|
-
size: "small",
|
|
89
|
-
view: "lined",
|
|
90
|
-
as: "span"
|
|
91
|
-
})))), cappingOption === CappingTypes.CUSTOM && !isDisabled && React.createElement(EditInAppCappingSettings, {
|
|
92
|
-
capping: capping,
|
|
93
|
-
onChange: onSettingsChange
|
|
94
|
-
})));
|
|
102
|
+
});
|
|
95
103
|
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { type CappingBase, type FrequencyCappingReadonlyProps } from './types';
|
|
3
|
-
export declare function FrequencyCappingReadonly<T extends CappingBase>({ capping, globalCapping, applicationCode, editGlobalClicked, isInJourney, }: FrequencyCappingReadonlyProps<T>):
|
|
2
|
+
export declare function FrequencyCappingReadonly<T extends CappingBase>({ capping, globalCapping, applicationCode, editGlobalClicked, isInJourney, }: FrequencyCappingReadonlyProps<T>): 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 { Horizontal, Vertical } from '@pushwoosh/kit-helpers';
|
|
3
3
|
import { OpenIcon } from '@pushwoosh/kit-icons';
|
|
4
4
|
import { Link } from '../Link';
|
|
@@ -19,23 +19,27 @@ export function FrequencyCappingReadonly({
|
|
|
19
19
|
const isGlobalCappingDisabled = globalCapping.count === 0 && globalCapping.days === 0;
|
|
20
20
|
const globalCappingLinkText = getGlobalCappingLinkText(lang, isGlobalCappingDisabled);
|
|
21
21
|
const label = getReadonlyCappingLabel(cappingOption, isGlobalCappingDisabled, capping, globalCapping, isInJourney, lang);
|
|
22
|
-
return
|
|
23
|
-
"$gap": 24
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
22
|
+
return _jsx(Vertical, {
|
|
23
|
+
"$gap": 24,
|
|
24
|
+
children: _jsxs(Horizontal, {
|
|
25
|
+
"$gap": 8,
|
|
26
|
+
"$justifyContent": "start",
|
|
27
|
+
"$alignItems": "center",
|
|
28
|
+
children: [label, cappingOption === CappingTypes.GLOBAL && _jsx(Link, {
|
|
29
|
+
href: `/applications/${applicationCode}/message-delivery?tab=capping`,
|
|
30
|
+
title: globalCappingLinkText,
|
|
31
|
+
target: "_blank",
|
|
32
|
+
onClick: editGlobalClicked,
|
|
33
|
+
children: _jsxs(Horizontal, {
|
|
34
|
+
"$gap": 4,
|
|
35
|
+
"$justifyContent": "start",
|
|
36
|
+
"$alignItems": "center",
|
|
37
|
+
children: [globalCappingLinkText, _jsx(OpenIcon, {
|
|
38
|
+
size: "small",
|
|
39
|
+
view: "lined"
|
|
40
|
+
})]
|
|
41
|
+
})
|
|
42
|
+
})]
|
|
43
|
+
})
|
|
44
|
+
});
|
|
41
45
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
type ChipFrequencyCappingProps = {
|
|
3
2
|
text: string;
|
|
4
3
|
tooltip?: string;
|
|
5
4
|
$inText?: boolean;
|
|
6
5
|
};
|
|
7
|
-
export declare function ChipFrequencyCapping({ text, tooltip, $inText }: ChipFrequencyCappingProps):
|
|
6
|
+
export declare function ChipFrequencyCapping({ text, tooltip, $inText }: ChipFrequencyCappingProps): import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { HelpRoundIcon } from '@pushwoosh/kit-icons';
|
|
4
4
|
import { ChipWithinTextContainer } from './styles';
|
|
@@ -9,23 +9,27 @@ export function ChipFrequencyCapping({
|
|
|
9
9
|
tooltip,
|
|
10
10
|
$inText = false
|
|
11
11
|
}) {
|
|
12
|
-
return
|
|
13
|
-
"$inText": $inText
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
12
|
+
return _jsx(ChipWithinTextContainer, {
|
|
13
|
+
"$inText": $inText,
|
|
14
|
+
children: tooltip ? _jsx(Tooltip, {
|
|
15
|
+
content: tooltip,
|
|
16
|
+
position: "top-middle",
|
|
17
|
+
children: _jsxs(Chip, {
|
|
18
|
+
"$variant": "primary",
|
|
19
|
+
"$readOnly": true,
|
|
20
|
+
as: "span",
|
|
21
|
+
children: [text, _jsx(HelpRoundIcon, {
|
|
22
|
+
as: "span",
|
|
23
|
+
size: "small",
|
|
24
|
+
view: "lined",
|
|
25
|
+
color: Color.PHANTOM
|
|
26
|
+
})]
|
|
27
|
+
})
|
|
28
|
+
}) : _jsx(Chip, {
|
|
29
|
+
"$variant": "primary",
|
|
30
|
+
"$readOnly": true,
|
|
31
|
+
as: "span",
|
|
32
|
+
children: text
|
|
33
|
+
})
|
|
34
|
+
});
|
|
31
35
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import { type CappingTypes } from '../../types';
|
|
3
3
|
type Props = {
|
|
4
4
|
cappingOption: CappingTypes;
|
|
@@ -8,5 +8,5 @@ type Props = {
|
|
|
8
8
|
isInJourney: boolean;
|
|
9
9
|
variant?: 'message' | 'in-app';
|
|
10
10
|
};
|
|
11
|
-
export declare function Description(props: Props):
|
|
11
|
+
export declare function Description(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Paragraph } from '@pushwoosh/kit-typography';
|
|
3
3
|
import { getDescriptionMessages } from '../../helpers/getDescriptionMessages';
|
|
4
4
|
import { useLang } from '../../polyglot';
|
|
@@ -24,8 +24,10 @@ export function Description(props) {
|
|
|
24
24
|
days,
|
|
25
25
|
isInJourney
|
|
26
26
|
}, lang);
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
return _jsxs(Paragraph, {
|
|
28
|
+
children: [prefix, chip && _jsx(ChipFrequencyCapping, {
|
|
29
|
+
text: chip,
|
|
30
|
+
"$inText": true
|
|
31
|
+
}), suffix, ' ', children]
|
|
32
|
+
});
|
|
31
33
|
}
|