@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,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Columns } from '@pushwoosh/kit-helpers';
|
|
3
3
|
import { format, addPeriod, setPeriod, monthName, isSamePeriod } from '../../helpers';
|
|
4
4
|
import { CellBox, DateInfo } from '../../styles';
|
|
@@ -10,23 +10,27 @@ export function YearView(props) {
|
|
|
10
10
|
onChange,
|
|
11
11
|
onSelect
|
|
12
12
|
} = props;
|
|
13
|
-
return
|
|
13
|
+
return _jsx(PickerPlate, {
|
|
14
14
|
onPrev: () => onChange(format(addPeriod(year, 'year', -1), 'year')),
|
|
15
15
|
onNext: () => onChange(format(addPeriod(year, 'year', 1), 'year')),
|
|
16
|
-
slot:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
16
|
+
slot: _jsx(DateInfo, {
|
|
17
|
+
children: year
|
|
18
|
+
}),
|
|
19
|
+
children: _jsx(Columns, {
|
|
20
|
+
"$sizes": 4,
|
|
21
|
+
"$gap": 4,
|
|
22
|
+
"$justifyContent": "space-between",
|
|
23
|
+
children: Array.from({
|
|
24
|
+
length: 12
|
|
25
|
+
}).map((_, i) => {
|
|
26
|
+
const month = format(setPeriod(year, 'month', i + 1), 'year-month');
|
|
27
|
+
return _jsx(CellBox, {
|
|
28
|
+
height: "59px",
|
|
29
|
+
"$isActive": !!activeDay && isSamePeriod(month, activeDay, 'month'),
|
|
30
|
+
onClick: () => onSelect(month),
|
|
31
|
+
children: monthName(i + 1, 'short')
|
|
32
|
+
}, `${year}-${month}`);
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
});
|
|
32
36
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState, useEffect, useCallback } from 'react';
|
|
2
3
|
import { createPortal } from 'react-dom';
|
|
3
4
|
import { drawerSizes } from './maps';
|
|
4
5
|
import { DrawerBoxTrans, DrawerBox, LockBody, DrawerInner, DrawerContainer } from './styles';
|
|
@@ -40,18 +41,22 @@ export function Drawer({
|
|
|
40
41
|
handleClose(event);
|
|
41
42
|
}
|
|
42
43
|
}, [handleClose, closeOnClickOutside]);
|
|
43
|
-
return createPortal(
|
|
44
|
+
return createPortal(_jsx(DrawerBoxTrans, {
|
|
44
45
|
nodeRef: ref,
|
|
45
46
|
isOpen: isOpen,
|
|
46
|
-
withoutLockScreen: withoutLockScreen
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
withoutLockScreen: withoutLockScreen,
|
|
48
|
+
children: _jsxs(DrawerBox, {
|
|
49
|
+
ref: ref,
|
|
50
|
+
"$zIndex": resolvedZIndex,
|
|
51
|
+
children: [_jsx(LockBody, {}), _jsx(DrawerInner, {
|
|
52
|
+
onMouseDown: handleClickOutside,
|
|
53
|
+
"$padding": padding,
|
|
54
|
+
children: _jsx(DrawerContainer, {
|
|
55
|
+
"$width": drawerSizes[size],
|
|
56
|
+
onClick: handleClose,
|
|
57
|
+
children: children
|
|
58
|
+
})
|
|
59
|
+
})]
|
|
60
|
+
})
|
|
61
|
+
}), element);
|
|
57
62
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type FC } from 'react';
|
|
2
2
|
import type { ContentPadding, DrawerBoxBaseProps, IDrawerBoxTransProps } from './types';
|
|
3
3
|
export declare const LockBody: import("styled-components").GlobalStyleComponent<{}, import("styled-components").DefaultTheme>;
|
|
4
4
|
export declare const DrawerBox: import("styled-components").StyledComponent<"div", any, {
|
|
@@ -7,7 +7,7 @@ export declare const DrawerBox: import("styled-components").StyledComponent<"div
|
|
|
7
7
|
export declare const DrawerInner: import("styled-components").StyledComponent<"div", any, {
|
|
8
8
|
$padding?: ContentPadding;
|
|
9
9
|
}, never>;
|
|
10
|
-
export declare const DrawerBoxTrans: import("styled-components").StyledComponent<
|
|
10
|
+
export declare const DrawerBoxTrans: import("styled-components").StyledComponent<FC<DrawerBoxBaseProps>, any, IDrawerBoxTransProps, never>;
|
|
11
11
|
export declare const DrawerContainer: import("styled-components").StyledComponent<"div", any, {
|
|
12
12
|
$width: string;
|
|
13
13
|
}, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { CSSTransition } from 'react-transition-group';
|
|
3
3
|
import styled, { createGlobalStyle } from 'styled-components';
|
|
4
4
|
import { ShapeRadius } from '@pushwoosh/kit-constants';
|
|
@@ -40,14 +40,15 @@ const DrawerBoxBase = props => {
|
|
|
40
40
|
className,
|
|
41
41
|
children
|
|
42
42
|
} = props;
|
|
43
|
-
return
|
|
43
|
+
return _jsx(CSSTransition, {
|
|
44
44
|
appear: true,
|
|
45
45
|
unmountOnExit: true,
|
|
46
46
|
in: isOpen,
|
|
47
47
|
timeout: animationTimeout,
|
|
48
48
|
classNames: className,
|
|
49
|
-
nodeRef: nodeRef
|
|
50
|
-
|
|
49
|
+
nodeRef: nodeRef,
|
|
50
|
+
children: children
|
|
51
|
+
});
|
|
51
52
|
};
|
|
52
53
|
export const DrawerBoxTrans = styled(DrawerBoxBase).withConfig({
|
|
53
54
|
displayName: "DrawerBoxTrans",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
3
|
import { DrawerBodyIframe, IframeElement, LoadingBox } from './styles';
|
|
3
4
|
import { Spinner } from '../../../Spinner';
|
|
4
5
|
import { Lang, useLang } from '../../polyglot';
|
|
@@ -27,25 +28,29 @@ export function DrawerDocs(props) {
|
|
|
27
28
|
window.removeEventListener('resize', updateDrawerWidth);
|
|
28
29
|
};
|
|
29
30
|
}, [isOpen]);
|
|
30
|
-
return
|
|
31
|
+
return _jsx(Drawer, {
|
|
31
32
|
size: "large",
|
|
32
33
|
isOpen: isOpen,
|
|
33
|
-
onClose: onClose
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
34
|
+
onClose: onClose,
|
|
35
|
+
children: _jsxs(DrawerBodyIframe, {
|
|
36
|
+
ref: drawerDocsRef,
|
|
37
|
+
children: [!iframeLoaded && _jsxs(LoadingBox, {
|
|
38
|
+
children: [_jsx(Spinner, {
|
|
39
|
+
size: "medium"
|
|
40
|
+
}), ' ', _jsx(Lang, {
|
|
41
|
+
message: "DUMB.DRAWER.DOCS_LOADING"
|
|
42
|
+
})]
|
|
43
|
+
}), _jsx(IframeElement, {
|
|
44
|
+
src: url,
|
|
45
|
+
ref: iframeRef,
|
|
46
|
+
title: lang({
|
|
47
|
+
message: 'DUMB.DRAWER.DOCS_TITLE'
|
|
48
|
+
}),
|
|
49
|
+
width: drawerWidth,
|
|
50
|
+
height: "95%",
|
|
51
|
+
"$isLoaded": iframeLoaded,
|
|
52
|
+
onLoad: () => setIframeLoaded(true)
|
|
53
|
+
})]
|
|
54
|
+
})
|
|
55
|
+
});
|
|
51
56
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { autoPlacement, size, offset, useFloating } from '@floating-ui/react-dom';
|
|
2
|
-
import
|
|
3
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
3
4
|
import { createPortal, flushSync } from 'react-dom';
|
|
4
5
|
import { Place } from './styles';
|
|
5
6
|
import { useLayer } from '../../../hooks';
|
|
@@ -75,27 +76,30 @@ export const DropdownMenu = ({
|
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
}, [isOpen, isScrollable, refs.floating]);
|
|
78
|
-
return
|
|
79
|
-
value: setIsOpen
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
79
|
+
return _jsxs(DropdownContext.Provider, {
|
|
80
|
+
value: setIsOpen,
|
|
81
|
+
children: [renderHandler({
|
|
82
|
+
onClick: () => {
|
|
83
|
+
if (isOpen) {
|
|
84
|
+
handleClose();
|
|
85
|
+
} else {
|
|
86
|
+
setIsOpen(true);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
ref: refs.setReference,
|
|
90
|
+
isOpen
|
|
91
|
+
}), isOpen && createPortal(_jsx(DropdownZIndexContext.Provider, {
|
|
92
|
+
value: resolvedZIndex,
|
|
93
|
+
children: _jsx(Place, {
|
|
94
|
+
ref: refs.setFloating,
|
|
95
|
+
style: floatingStyles,
|
|
96
|
+
"$color": color,
|
|
97
|
+
"$width": width ?? undefined,
|
|
98
|
+
"$fitContent": windowWidth === null && !fullWidth,
|
|
99
|
+
"$scrollable": isScrollable,
|
|
100
|
+
"$zIndex": resolvedZIndex,
|
|
101
|
+
children: renderChildren(children)
|
|
102
|
+
})
|
|
103
|
+
}), document.body)]
|
|
104
|
+
});
|
|
101
105
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from '../../../Button';
|
|
3
3
|
import { DropdownMenu } from '../DropdownMenu';
|
|
4
4
|
export const DropdownMenuButton = ({
|
|
@@ -13,7 +13,7 @@ export const DropdownMenuButton = ({
|
|
|
13
13
|
children,
|
|
14
14
|
...buttonProps
|
|
15
15
|
}) => {
|
|
16
|
-
return
|
|
16
|
+
return _jsx(DropdownMenu, {
|
|
17
17
|
isScrollable: isScrollable,
|
|
18
18
|
openOnMount: openOnMount,
|
|
19
19
|
menuZIndex: menuZIndex,
|
|
@@ -23,13 +23,15 @@ export const DropdownMenuButton = ({
|
|
|
23
23
|
ref,
|
|
24
24
|
onClick,
|
|
25
25
|
isOpen
|
|
26
|
-
}) =>
|
|
26
|
+
}) => _jsx(Button, {
|
|
27
27
|
...buttonProps,
|
|
28
28
|
boxRef: ref,
|
|
29
29
|
onClick: onClick,
|
|
30
30
|
isOpen: isOpen,
|
|
31
31
|
isDisabled: isDisabled,
|
|
32
|
-
isLoading: isLoading
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
isLoading: isLoading,
|
|
33
|
+
children: label
|
|
34
|
+
}),
|
|
35
|
+
children: children
|
|
36
|
+
});
|
|
35
37
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useContext } from 'react';
|
|
2
3
|
import { DropdownMenuItemStyled } from './styles';
|
|
3
4
|
import { DropdownContext } from '../../context';
|
|
4
5
|
export const DropdownMenuItem = ({
|
|
@@ -15,7 +16,7 @@ export const DropdownMenuItem = ({
|
|
|
15
16
|
console.error('DropdownMenuItem must be inside DropdownMenu');
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
|
-
return
|
|
19
|
+
return _jsx(DropdownMenuItemStyled, {
|
|
19
20
|
"$active": isActive,
|
|
20
21
|
"$danger": isDanger,
|
|
21
22
|
onClick: () => {
|
|
@@ -25,6 +26,7 @@ export const DropdownMenuItem = ({
|
|
|
25
26
|
onClick();
|
|
26
27
|
},
|
|
27
28
|
disabled: disabled,
|
|
28
|
-
"data-active": isActive || undefined
|
|
29
|
-
|
|
29
|
+
"data-active": isActive || undefined,
|
|
30
|
+
children: children
|
|
31
|
+
});
|
|
30
32
|
};
|
|
@@ -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 { Horizontal } from '@pushwoosh/kit-helpers';
|
|
4
4
|
import { Text } from '@pushwoosh/kit-typography';
|
|
@@ -8,13 +8,16 @@ export const DropdownMenuSection = ({
|
|
|
8
8
|
bgColor,
|
|
9
9
|
children
|
|
10
10
|
}) => {
|
|
11
|
-
return
|
|
12
|
-
"$bgColor": bgColor
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
return _jsxs(DropdownMenuSectionRoot, {
|
|
12
|
+
"$bgColor": bgColor,
|
|
13
|
+
children: [title && _jsx(Horizontal, {
|
|
14
|
+
"$padding": "8px 12px",
|
|
15
|
+
children: _jsx(Text, {
|
|
16
|
+
"$variant": "h5",
|
|
17
|
+
"$color": Color.LOCKED,
|
|
18
|
+
"$uppercase": true,
|
|
19
|
+
children: title
|
|
20
|
+
})
|
|
21
|
+
}), children]
|
|
22
|
+
});
|
|
20
23
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { flip, shift, useFloating } from '@floating-ui/react-dom';
|
|
2
|
-
import
|
|
3
|
+
import { useCallback, useContext, useEffect, useRef, useState } from 'react';
|
|
3
4
|
import { createPortal } from 'react-dom';
|
|
4
5
|
import { ChevronIcon } from '@pushwoosh/kit-icons';
|
|
5
6
|
import { SubmenuTriggerInner } from './styles';
|
|
@@ -58,34 +59,42 @@ export const DropdownMenuSubmenu = ({
|
|
|
58
59
|
setIsOpen(false);
|
|
59
60
|
parentClose === null || parentClose === void 0 || parentClose(false);
|
|
60
61
|
}, [parentClose]);
|
|
61
|
-
return
|
|
62
|
-
value: closeChain
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
62
|
+
return _jsx(DropdownContext.Provider, {
|
|
63
|
+
value: closeChain,
|
|
64
|
+
children: _jsxs(DropdownZIndexContext.Provider, {
|
|
65
|
+
value: submenuZIndex,
|
|
66
|
+
children: [_jsx(DropdownMenuItemStyled, {
|
|
67
|
+
ref: refs.setReference,
|
|
68
|
+
type: "button",
|
|
69
|
+
"$active": isOpen,
|
|
70
|
+
"$danger": isDanger,
|
|
71
|
+
disabled: disabled,
|
|
72
|
+
onMouseEnter: scheduleOpen,
|
|
73
|
+
onMouseLeave: scheduleClose,
|
|
74
|
+
onClick: () => {
|
|
75
|
+
if (disabled) return;
|
|
76
|
+
clearTimers();
|
|
77
|
+
openedByClick.current = !isOpen;
|
|
78
|
+
setIsOpen(prev => !prev);
|
|
79
|
+
},
|
|
80
|
+
children: _jsxs(SubmenuTriggerInner, {
|
|
81
|
+
children: [_jsx("span", {
|
|
82
|
+
children: label
|
|
83
|
+
}), _jsx(ChevronIcon, {
|
|
84
|
+
direction: "right",
|
|
85
|
+
size: "small"
|
|
86
|
+
})]
|
|
87
|
+
})
|
|
88
|
+
}), isOpen && createPortal(_jsx(Place, {
|
|
89
|
+
ref: refs.setFloating,
|
|
90
|
+
style: floatingStyles,
|
|
91
|
+
"$fitContent": true,
|
|
92
|
+
"$zIndex": submenuZIndex,
|
|
93
|
+
onMouseEnter: clearTimers,
|
|
94
|
+
onMouseLeave: scheduleClose,
|
|
95
|
+
onClick: e => e.stopPropagation(),
|
|
96
|
+
children: renderChildren(children)
|
|
97
|
+
}), document.body)]
|
|
98
|
+
})
|
|
99
|
+
});
|
|
91
100
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
2
3
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
4
|
import { Vertical } from '@pushwoosh/kit-helpers';
|
|
4
5
|
import { DropdownIcon, EditIcon } from '@pushwoosh/kit-icons';
|
|
@@ -23,46 +24,57 @@ export function EditableField({
|
|
|
23
24
|
const rootRef = useRef(null);
|
|
24
25
|
const buttonRef = useRef(null);
|
|
25
26
|
useOnClickOutside(rootRef, onCancel);
|
|
26
|
-
return
|
|
27
|
-
ref: rootRef
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
27
|
+
return _jsxs(PopoverContainer, {
|
|
28
|
+
ref: rootRef,
|
|
29
|
+
children: [_jsxs(FieldBox, {
|
|
30
|
+
open: open,
|
|
31
|
+
onClick: onToggleOpen,
|
|
32
|
+
ref: buttonRef,
|
|
33
|
+
children: [_jsx("span", {
|
|
34
|
+
children: value
|
|
35
|
+
}), open ? _jsx(DropdownIcon, {
|
|
36
|
+
direction: "up",
|
|
37
|
+
size: "small",
|
|
38
|
+
color: Color.CLEAR
|
|
39
|
+
}) : _jsx(EditIcon, {
|
|
40
|
+
view: "lined",
|
|
41
|
+
size: "small"
|
|
42
|
+
})]
|
|
43
|
+
}), _jsx(Popover, {
|
|
44
|
+
open: open,
|
|
45
|
+
position: position,
|
|
46
|
+
anchorEl: buttonRef,
|
|
47
|
+
windowWidth: width,
|
|
48
|
+
internalWindowRef: rootRef,
|
|
49
|
+
loading: loading,
|
|
50
|
+
zIndex: zIndex,
|
|
51
|
+
children: _jsxs(Vertical, {
|
|
52
|
+
"$padding": 16,
|
|
53
|
+
children: [title && _jsx(TitleBox, {
|
|
54
|
+
children: title
|
|
55
|
+
}), children, _jsxs(ButtonsGroup, {
|
|
56
|
+
"$isLoading": loading,
|
|
57
|
+
children: [_jsx(Button, {
|
|
58
|
+
view: "shape",
|
|
59
|
+
color: "primary",
|
|
60
|
+
size: "compact",
|
|
61
|
+
isLoading: loading,
|
|
62
|
+
onClick: onSubmit,
|
|
63
|
+
children: _jsx(Lang, {
|
|
64
|
+
message: "DUMB.EDITABLE_FIELD.SUBMIT"
|
|
65
|
+
})
|
|
66
|
+
}), _jsx(Button, {
|
|
67
|
+
view: "shape",
|
|
68
|
+
color: "secondary",
|
|
69
|
+
size: "compact",
|
|
70
|
+
isDisabled: loading,
|
|
71
|
+
onClick: onCancel,
|
|
72
|
+
children: _jsx(Lang, {
|
|
73
|
+
message: "DUMB.EDITABLE_FIELD.CANCEL"
|
|
74
|
+
})
|
|
75
|
+
})]
|
|
76
|
+
})]
|
|
77
|
+
})
|
|
78
|
+
})]
|
|
79
|
+
});
|
|
68
80
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Liquid } from 'liquidjs';
|
|
2
|
-
import
|
|
3
|
+
import { useMemo, useState } from 'react';
|
|
3
4
|
import { replaceLocalization, replacePlaceholders } from './helpers';
|
|
4
5
|
import { IframeStyled } from './styles';
|
|
5
6
|
const createLiquidInstance = () => {
|
|
@@ -37,13 +38,14 @@ export function EmailTemplatePreview(props) {
|
|
|
37
38
|
return `<body style="font-size: 24px; color: darkred">${e.message}</body>`;
|
|
38
39
|
}
|
|
39
40
|
}, [template, localization, values, liquidInstance]);
|
|
40
|
-
return
|
|
41
|
+
return _jsx(IframeStyled, {
|
|
41
42
|
"$scale": scale,
|
|
42
43
|
"$width": width,
|
|
43
|
-
"$height": height
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
"$height": height,
|
|
45
|
+
children: _jsx("iframe", {
|
|
46
|
+
srcDoc: src,
|
|
47
|
+
sandbox: "allow-same-origin",
|
|
48
|
+
title: "preview"
|
|
49
|
+
})
|
|
50
|
+
});
|
|
49
51
|
}
|
|
@@ -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 { Vertical } from '@pushwoosh/kit-helpers';
|
|
4
4
|
import { Text } from '@pushwoosh/kit-typography';
|
|
@@ -7,26 +7,32 @@ import { Container, PreviewMock } from './styles';
|
|
|
7
7
|
import { Lang, useLang } from '../../polyglot';
|
|
8
8
|
export function NoEmailTemplatePreview() {
|
|
9
9
|
const lang = useLang();
|
|
10
|
-
return
|
|
10
|
+
return _jsxs(Container, {
|
|
11
11
|
"$padding": "12px 12px 24px",
|
|
12
|
-
"$gap": 12
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
12
|
+
"$gap": 12,
|
|
13
|
+
children: [_jsx(PreviewMock, {
|
|
14
|
+
"$alignItems": "center",
|
|
15
|
+
"$justifyContent": "center",
|
|
16
|
+
children: _jsx("img", {
|
|
17
|
+
src: Email,
|
|
18
|
+
alt: lang({
|
|
19
|
+
message: 'DUMB.EMAIL_TEMPLATE_PREVIEW.ALT'
|
|
20
|
+
})
|
|
21
|
+
})
|
|
22
|
+
}), _jsxs(Vertical, {
|
|
23
|
+
children: [_jsx(Text, {
|
|
24
|
+
"$variant": "footnote",
|
|
25
|
+
"$color": Color.LOCKED,
|
|
26
|
+
children: _jsx(Lang, {
|
|
27
|
+
message: "DUMB.EMAIL_TEMPLATE_PREVIEW.CONTENT_MISSED"
|
|
28
|
+
})
|
|
29
|
+
}), _jsx(Text, {
|
|
30
|
+
"$variant": "footnote",
|
|
31
|
+
"$color": Color.LOCKED,
|
|
32
|
+
children: _jsx(Lang, {
|
|
33
|
+
message: "DUMB.EMAIL_TEMPLATE_PREVIEW.HINT"
|
|
34
|
+
})
|
|
35
|
+
})]
|
|
36
|
+
})]
|
|
37
|
+
});
|
|
32
38
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
$icon?: React.ReactNode;
|
|
1
|
+
export declare const EnhancedInput: import("react").ForwardRefExoticComponent<import("react").InputHTMLAttributes<HTMLInputElement> & import("../native/Input").NativeInputProps & {
|
|
2
|
+
$icon?: import("react").ReactNode;
|
|
4
3
|
$onClear?: () => void;
|
|
5
4
|
hint?: string;
|
|
6
|
-
} &
|
|
5
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|