@pushwoosh/dumb-components 4.10.1 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Combobox/Combobox.js +8 -3
- package/Combobox/types.d.ts +4 -0
- package/NotificationInbox/NotificationBar.js +5 -1
- package/NotificationInbox/NotificationInbox.d.ts +1 -1
- package/NotificationInbox/NotificationInbox.js +13 -4
- package/NotificationInbox/helpers.d.ts +1 -1
- package/NotificationInbox/helpers.js +2 -2
- package/NotificationInbox/polyglot/messages_ar.js +4 -1
- package/NotificationInbox/polyglot/messages_bn.js +4 -1
- package/NotificationInbox/polyglot/messages_de.js +4 -1
- package/NotificationInbox/polyglot/messages_en.js +4 -1
- package/NotificationInbox/polyglot/messages_es.js +4 -1
- package/NotificationInbox/polyglot/messages_fr.js +4 -1
- package/NotificationInbox/polyglot/messages_he.js +4 -1
- package/NotificationInbox/polyglot/messages_hi.js +4 -1
- package/NotificationInbox/polyglot/messages_ja.js +4 -1
- package/NotificationInbox/polyglot/messages_ko.js +4 -1
- package/NotificationInbox/polyglot/messages_pt.js +4 -1
- package/NotificationInbox/polyglot/messages_ru.js +4 -1
- package/NotificationInbox/polyglot/messages_th.js +4 -1
- package/NotificationInbox/polyglot/messages_zh.js +4 -1
- package/NotificationInbox/polyglot/types.d.ts +3 -0
- package/RichMessageEditor/RichMessageEditor.js +2 -0
- package/RichMessageEditor/RichMessageEditor.types.d.ts +2 -0
- package/RichMessageEditor/slate/SlateEditor.d.ts +1 -0
- package/RichMessageEditor/slate/SlateEditor.js +4 -2
- package/RichMessageEditor/slate/styles.d.ts +1 -0
- package/RichMessageEditor/slate/styles.js +5 -3
- package/package.json +1 -1
- package/shared/dropdownField/SuggestionsDropdown.js +1 -0
- package/shared/dropdownField/styles.d.ts +1 -0
- package/shared/dropdownField/styles.js +6 -2
- package/shared/dropdownField/types.d.ts +2 -0
package/Combobox/Combobox.js
CHANGED
|
@@ -171,7 +171,9 @@ function SelectCombobox({
|
|
|
171
171
|
hasError,
|
|
172
172
|
width,
|
|
173
173
|
minWidth,
|
|
174
|
-
fullWidth
|
|
174
|
+
fullWidth,
|
|
175
|
+
searchable = true,
|
|
176
|
+
selectedTone = 'soft'
|
|
175
177
|
}) {
|
|
176
178
|
const inputRef = useRef(null);
|
|
177
179
|
const baseId = useId();
|
|
@@ -200,7 +202,7 @@ function SelectCombobox({
|
|
|
200
202
|
const hasValue = value !== null && value !== undefined;
|
|
201
203
|
const valueLabel = hasValue ? getLabel(value) : '';
|
|
202
204
|
const selectedKey = hasValue ? getKey(value) : null;
|
|
203
|
-
const inputValue = isOpen ? query : valueLabel;
|
|
205
|
+
const inputValue = isOpen && searchable ? query : valueLabel;
|
|
204
206
|
const userMovedRef = useRef(false);
|
|
205
207
|
const selectedIndex = sourceItems.findIndex(it => getKey(it) === selectedKey);
|
|
206
208
|
const activateSelected = useCallback(() => {
|
|
@@ -222,6 +224,7 @@ function SelectCombobox({
|
|
|
222
224
|
setActiveIndex(next);
|
|
223
225
|
}, [setActiveIndex]);
|
|
224
226
|
const search = event => {
|
|
227
|
+
if (!searchable) return;
|
|
225
228
|
setQuery(event.target.value);
|
|
226
229
|
if (event.target.value) moveActive(0);else activateSelected();
|
|
227
230
|
};
|
|
@@ -269,9 +272,10 @@ function SelectCombobox({
|
|
|
269
272
|
label: renderItem ? renderItem(item, state) : getLabel(item),
|
|
270
273
|
active: state.active,
|
|
271
274
|
selected,
|
|
275
|
+
selectedTone,
|
|
272
276
|
onSelect: () => commit(item)
|
|
273
277
|
};
|
|
274
|
-
}), [filteredItems, activeIndex, selectedKey, getLabel, getKey, renderItem, commit, baseId]);
|
|
278
|
+
}), [filteredItems, activeIndex, selectedKey, getLabel, getKey, renderItem, commit, baseId, selectedTone]);
|
|
275
279
|
const activeDescendant = activeIndex >= 0 && activeIndex < filteredItems.length ? optionId(getKey(filteredItems[activeIndex])) : undefined;
|
|
276
280
|
return _jsx(FieldShell, {
|
|
277
281
|
isOpen: isOpen,
|
|
@@ -303,6 +307,7 @@ function SelectCombobox({
|
|
|
303
307
|
autosize: autosize,
|
|
304
308
|
value: inputValue,
|
|
305
309
|
onChange: search,
|
|
310
|
+
readOnly: !searchable,
|
|
306
311
|
onKeyDown: onInputKeyDown,
|
|
307
312
|
onFocus: open,
|
|
308
313
|
onClick: open,
|
package/Combobox/types.d.ts
CHANGED
|
@@ -85,6 +85,10 @@ export type SelectComboboxProps<T> = ComboboxSource<T> & GetKeyProp<T> & CommonP
|
|
|
85
85
|
onChange: (value: T | null) => void;
|
|
86
86
|
/** Map an item to its display label (required). */
|
|
87
87
|
getLabel: (item: T) => string;
|
|
88
|
+
/** Typing filters the items (default `true`); `false` keeps the selected label in the field while the list is open. */
|
|
89
|
+
searchable?: boolean;
|
|
90
|
+
/** Highlight of the selected row: `soft` (default) or `solid` (bright fill, white text). */
|
|
91
|
+
selectedTone?: 'soft' | 'solid';
|
|
88
92
|
};
|
|
89
93
|
/** Props of {@link Combobox} — free-text by default, strict single-select with `select`. */
|
|
90
94
|
export type ComboboxProps<T> = FreeComboboxProps | SelectComboboxProps<T>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { NotificationIcon } from '@pushwoosh/kit-icons';
|
|
4
|
+
import { useLang } from './polyglot';
|
|
4
5
|
import { NotificationBarButton, NotificationBarIcon, NotificationBarBadge, NotificationBarText, NotificationBarBadgeText } from './styles';
|
|
5
6
|
function getIconView(isOpened, filled, hasNotifications) {
|
|
6
7
|
if (isOpened && !hasNotifications) return 'lined';
|
|
@@ -22,6 +23,7 @@ export function NotificationBar({
|
|
|
22
23
|
count = 0,
|
|
23
24
|
onClick
|
|
24
25
|
}) {
|
|
26
|
+
const lang = useLang();
|
|
25
27
|
const hasNotifications = count > 0 && type !== 'no-notifications';
|
|
26
28
|
const shouldUseFilledIcon = !isOpened && (!read && type !== 'no-notifications' || read);
|
|
27
29
|
const getIconColor = () => {
|
|
@@ -49,7 +51,9 @@ export function NotificationBar({
|
|
|
49
51
|
color: getIconColor()
|
|
50
52
|
})
|
|
51
53
|
}), _jsx(NotificationBarText, {
|
|
52
|
-
children:
|
|
54
|
+
children: lang({
|
|
55
|
+
message: 'DUMB.NOTIFICATION_INBOX.BAR_LABEL'
|
|
56
|
+
})
|
|
53
57
|
}), hasNotifications && _jsx(NotificationBarBadge, {
|
|
54
58
|
children: _jsx(NotificationBarBadgeText, {
|
|
55
59
|
"$variant": "h4",
|
|
@@ -7,4 +7,4 @@ import type { NotificationInboxProps } from './types';
|
|
|
7
7
|
* @example
|
|
8
8
|
* <NotificationInbox notifications={items} hasMore={hasMore} onLoadMore={loadMore} onNotificationClick={open} />
|
|
9
9
|
*/
|
|
10
|
-
export declare function NotificationInbox({ notifications, isLoading, hasMore, onLoadMore, onNotificationClick, onMarkAsRead, emptyStateTitle, emptyStateDescription, }: NotificationInboxProps): ReactElement;
|
|
10
|
+
export declare function NotificationInbox({ notifications, isLoading, hasMore, onLoadMore, onNotificationClick, onMarkAsRead, emptyStateTitle: emptyStateTitleProp, emptyStateDescription: emptyStateDescriptionProp, }: NotificationInboxProps): ReactElement;
|
|
@@ -9,7 +9,8 @@ import { useInfiniteScroll } from './useInfiniteScroll';
|
|
|
9
9
|
import { Badge } from '../Badge';
|
|
10
10
|
import { Spinner } from '../Spinner';
|
|
11
11
|
import emptyNotificationsIcon from './assets/EmptyNotifications.svg?url';
|
|
12
|
-
import { Lang } from './polyglot';
|
|
12
|
+
import { Lang, useLang } from './polyglot';
|
|
13
|
+
import { useLanguage } from '../polyglot';
|
|
13
14
|
import { NotificationInboxContainer, NotificationInboxHeader, NotificationInboxTitle, NotificationInboxList, NotificationItem, NotificationIndicator, NotificationHeader, NotificationDescription, NotificationActionLink, NotificationInboxEmptyIcon } from './styles';
|
|
14
15
|
/**
|
|
15
16
|
* Scrollable notification list with severity indicators, read state, per-item
|
|
@@ -25,9 +26,17 @@ export function NotificationInbox({
|
|
|
25
26
|
onLoadMore,
|
|
26
27
|
onNotificationClick,
|
|
27
28
|
onMarkAsRead,
|
|
28
|
-
emptyStateTitle
|
|
29
|
-
emptyStateDescription
|
|
29
|
+
emptyStateTitle: emptyStateTitleProp,
|
|
30
|
+
emptyStateDescription: emptyStateDescriptionProp
|
|
30
31
|
}) {
|
|
32
|
+
const lang = useLang();
|
|
33
|
+
const language = useLanguage();
|
|
34
|
+
const emptyStateTitle = emptyStateTitleProp ?? lang({
|
|
35
|
+
message: 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE'
|
|
36
|
+
});
|
|
37
|
+
const emptyStateDescription = emptyStateDescriptionProp ?? lang({
|
|
38
|
+
message: 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION'
|
|
39
|
+
});
|
|
31
40
|
const descriptionRefs = useRef({});
|
|
32
41
|
const [expandedId, setExpandedId] = useState(null);
|
|
33
42
|
const [showExpandMap, setShowExpandMap] = useState({});
|
|
@@ -135,7 +144,7 @@ export function NotificationInbox({
|
|
|
135
144
|
children: [_jsx(Text, {
|
|
136
145
|
"$variant": "footnote",
|
|
137
146
|
"$color": Color.LOCKED,
|
|
138
|
-
children: formatTimestamp(notification.timestamp)
|
|
147
|
+
children: formatTimestamp(notification.timestamp, language)
|
|
139
148
|
}), notification.projectName && _jsxs(_Fragment, {
|
|
140
149
|
children: [_jsx(Text, {
|
|
141
150
|
"$color": Color.LOCKED,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function formatTimestamp(timestamp: string | Date): string;
|
|
1
|
+
export declare function formatTimestamp(timestamp: string | Date, language: string): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function formatTimestamp(timestamp) {
|
|
1
|
+
export function formatTimestamp(timestamp, language) {
|
|
2
2
|
const date = typeof timestamp === 'string' ? new Date(timestamp) : timestamp;
|
|
3
3
|
const day = date.getDate();
|
|
4
|
-
const month = date.toLocaleString(
|
|
4
|
+
const month = date.toLocaleString(language, {
|
|
5
5
|
month: 'short'
|
|
6
6
|
});
|
|
7
7
|
const hours = date.getHours();
|
|
@@ -4,5 +4,8 @@ export const messages = {
|
|
|
4
4
|
'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'طي',
|
|
5
5
|
'DUMB.NOTIFICATION_INBOX.EXPAND': 'توسيع',
|
|
6
6
|
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'جارٍ تحميل المزيد…',
|
|
7
|
-
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'لديك إشعارات غير مقروءة'
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'لديك إشعارات غير مقروءة',
|
|
8
|
+
'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'مركز الإشعارات',
|
|
9
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'لا توجد إشعارات بعد',
|
|
10
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'ستظهر هنا التحديثات والتنبيهات عندما يتطلب أمر ما انتباهك.'
|
|
8
11
|
};
|
|
@@ -4,5 +4,8 @@ export const messages = {
|
|
|
4
4
|
'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'সংকুচিত করুন',
|
|
5
5
|
'DUMB.NOTIFICATION_INBOX.EXPAND': 'প্রসারিত করুন',
|
|
6
6
|
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'আরও লোড হচ্ছে…',
|
|
7
|
-
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'আপনার অপঠিত বিজ্ঞপ্তি রয়েছে'
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'আপনার অপঠিত বিজ্ঞপ্তি রয়েছে',
|
|
8
|
+
'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'নোটিফিকেশন কেন্দ্র',
|
|
9
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'এখনও কোনো নোটিফিকেশন নেই',
|
|
10
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'কোনো কিছুতে আপনার মনোযোগ প্রয়োজন হলে আপডেট ও অ্যালার্ট এখানে দেখা যাবে।'
|
|
8
11
|
};
|
|
@@ -4,5 +4,8 @@ export const messages = {
|
|
|
4
4
|
'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Einklappen',
|
|
5
5
|
'DUMB.NOTIFICATION_INBOX.EXPAND': 'Ausklappen',
|
|
6
6
|
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Mehr wird geladen…',
|
|
7
|
-
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Sie haben ungelesene Benachrichtigungen'
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Sie haben ungelesene Benachrichtigungen',
|
|
8
|
+
'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'Benachrichtigungszentrale',
|
|
9
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'Noch keine Benachrichtigungen',
|
|
10
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'Hier sehen Sie Updates und Warnungen, sobald etwas Ihre Aufmerksamkeit erfordert.'
|
|
8
11
|
};
|
|
@@ -4,5 +4,8 @@ export const messages = {
|
|
|
4
4
|
'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Collapse',
|
|
5
5
|
'DUMB.NOTIFICATION_INBOX.EXPAND': 'Expand',
|
|
6
6
|
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Loading more…',
|
|
7
|
-
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'You have unread notifications'
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'You have unread notifications',
|
|
8
|
+
'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'Notification center',
|
|
9
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'No notifications yet',
|
|
10
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'You\'ll see updates and alerts here once something requires your attention.'
|
|
8
11
|
};
|
|
@@ -4,5 +4,8 @@ export const messages = {
|
|
|
4
4
|
'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Contraer',
|
|
5
5
|
'DUMB.NOTIFICATION_INBOX.EXPAND': 'Expandir',
|
|
6
6
|
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Cargando más…',
|
|
7
|
-
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Tienes notificaciones sin leer'
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Tienes notificaciones sin leer',
|
|
8
|
+
'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'Centro de notificaciones',
|
|
9
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'Aún no hay notificaciones',
|
|
10
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'Aquí verás actualizaciones y alertas cuando algo requiera tu atención.'
|
|
8
11
|
};
|
|
@@ -4,5 +4,8 @@ export const messages = {
|
|
|
4
4
|
'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Réduire',
|
|
5
5
|
'DUMB.NOTIFICATION_INBOX.EXPAND': 'Développer',
|
|
6
6
|
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Chargement de la suite…',
|
|
7
|
-
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Vous avez des notifications non lues'
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Vous avez des notifications non lues',
|
|
8
|
+
'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'Centre de notifications',
|
|
9
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'Aucune notification pour le moment',
|
|
10
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'Vous verrez ici les mises à jour et les alertes dès que quelque chose nécessitera votre attention.'
|
|
8
11
|
};
|
|
@@ -4,5 +4,8 @@ export const messages = {
|
|
|
4
4
|
'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'כווץ',
|
|
5
5
|
'DUMB.NOTIFICATION_INBOX.EXPAND': 'הרחב',
|
|
6
6
|
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'טוען עוד…',
|
|
7
|
-
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'יש לך התראות שלא נקראו'
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'יש לך התראות שלא נקראו',
|
|
8
|
+
'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'מרכז התראות',
|
|
9
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'אין עדיין התראות',
|
|
10
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'עדכונים והתראות יופיעו כאן כשמשהו ידרוש את תשומת לבך.'
|
|
8
11
|
};
|
|
@@ -4,5 +4,8 @@ export const messages = {
|
|
|
4
4
|
'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'संक्षिप्त करें',
|
|
5
5
|
'DUMB.NOTIFICATION_INBOX.EXPAND': 'विस्तृत करें',
|
|
6
6
|
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'और लोड हो रहा है…',
|
|
7
|
-
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'आपके पास अपठित सूचनाएँ हैं'
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'आपके पास अपठित सूचनाएँ हैं',
|
|
8
|
+
'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'नोटिफिकेशन सेंटर',
|
|
9
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'अभी तक कोई सूचना नहीं',
|
|
10
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'जब किसी चीज़ पर आपका ध्यान देना ज़रूरी होगा, तो अपडेट और अलर्ट यहाँ दिखाई देंगे।'
|
|
8
11
|
};
|
|
@@ -4,5 +4,8 @@ export const messages = {
|
|
|
4
4
|
'DUMB.NOTIFICATION_INBOX.COLLAPSE': '折りたたむ',
|
|
5
5
|
'DUMB.NOTIFICATION_INBOX.EXPAND': '展開する',
|
|
6
6
|
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'さらに読み込み中…',
|
|
7
|
-
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': '未読の通知があります'
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': '未読の通知があります',
|
|
8
|
+
'DUMB.NOTIFICATION_INBOX.BAR_LABEL': '通知センター',
|
|
9
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'まだ通知はありません',
|
|
10
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': '対応が必要なことがあると、ここに更新情報やアラートが表示されます。'
|
|
8
11
|
};
|
|
@@ -4,5 +4,8 @@ export const messages = {
|
|
|
4
4
|
'DUMB.NOTIFICATION_INBOX.COLLAPSE': '접기',
|
|
5
5
|
'DUMB.NOTIFICATION_INBOX.EXPAND': '펼치기',
|
|
6
6
|
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': '더 불러오는 중…',
|
|
7
|
-
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': '읽지 않은 알림이 있습니다'
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': '읽지 않은 알림이 있습니다',
|
|
8
|
+
'DUMB.NOTIFICATION_INBOX.BAR_LABEL': '알림 센터',
|
|
9
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': '아직 알림이 없습니다',
|
|
10
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': '확인이 필요한 사항이 생기면 여기에 업데이트와 알림이 표시됩니다.'
|
|
8
11
|
};
|
|
@@ -4,5 +4,8 @@ export const messages = {
|
|
|
4
4
|
'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Recolher',
|
|
5
5
|
'DUMB.NOTIFICATION_INBOX.EXPAND': 'Expandir',
|
|
6
6
|
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Carregando mais…',
|
|
7
|
-
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Você tem notificações não lidas'
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Você tem notificações não lidas',
|
|
8
|
+
'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'Central de notificações',
|
|
9
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'Nenhuma notificação ainda',
|
|
10
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'Você verá atualizações e alertas aqui quando algo precisar da sua atenção.'
|
|
8
11
|
};
|
|
@@ -4,5 +4,8 @@ export const messages = {
|
|
|
4
4
|
'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Свернуть',
|
|
5
5
|
'DUMB.NOTIFICATION_INBOX.EXPAND': 'Развернуть',
|
|
6
6
|
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Загрузка…',
|
|
7
|
-
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Есть непрочитанные уведомления'
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Есть непрочитанные уведомления',
|
|
8
|
+
'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'Центр уведомлений',
|
|
9
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'Уведомлений пока нет',
|
|
10
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'Здесь появятся обновления и предупреждения, когда что-то потребует вашего внимания.'
|
|
8
11
|
};
|
|
@@ -4,5 +4,8 @@ export const messages = {
|
|
|
4
4
|
'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'ย่อ',
|
|
5
5
|
'DUMB.NOTIFICATION_INBOX.EXPAND': 'ขยาย',
|
|
6
6
|
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'กำลังโหลดเพิ่มเติม…',
|
|
7
|
-
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'คุณมีการแจ้งเตือนที่ยังไม่ได้อ่าน'
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'คุณมีการแจ้งเตือนที่ยังไม่ได้อ่าน',
|
|
8
|
+
'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'ศูนย์การแจ้งเตือน',
|
|
9
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'ยังไม่มีการแจ้งเตือน',
|
|
10
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'การอัปเดตและการแจ้งเตือนจะแสดงที่นี่เมื่อมีสิ่งที่ต้องให้คุณดำเนินการ'
|
|
8
11
|
};
|
|
@@ -4,5 +4,8 @@ export const messages = {
|
|
|
4
4
|
'DUMB.NOTIFICATION_INBOX.COLLAPSE': '收起',
|
|
5
5
|
'DUMB.NOTIFICATION_INBOX.EXPAND': '展开',
|
|
6
6
|
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': '加载更多…',
|
|
7
|
-
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': '您有未读通知'
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': '您有未读通知',
|
|
8
|
+
'DUMB.NOTIFICATION_INBOX.BAR_LABEL': '通知中心',
|
|
9
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': '暂无通知',
|
|
10
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': '当有需要您关注的事项时,更新和提醒将显示在这里。'
|
|
8
11
|
};
|
|
@@ -8,4 +8,7 @@ export type NotificationInboxMessages = {
|
|
|
8
8
|
'DUMB.NOTIFICATION_INBOX.EXPAND': NoParams;
|
|
9
9
|
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': NoParams;
|
|
10
10
|
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': NoParams;
|
|
11
|
+
'DUMB.NOTIFICATION_INBOX.BAR_LABEL': NoParams;
|
|
12
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': NoParams;
|
|
13
|
+
'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': NoParams;
|
|
11
14
|
};
|
|
@@ -25,6 +25,7 @@ export const RichMessageEditor = ({
|
|
|
25
25
|
title,
|
|
26
26
|
initialValue,
|
|
27
27
|
minHeight,
|
|
28
|
+
compact,
|
|
28
29
|
placeholder,
|
|
29
30
|
error,
|
|
30
31
|
isErrored,
|
|
@@ -129,6 +130,7 @@ export const RichMessageEditor = ({
|
|
|
129
130
|
}),
|
|
130
131
|
children: [_jsx(SlateEditable, {
|
|
131
132
|
minHeight: minHeight,
|
|
133
|
+
compact: compact,
|
|
132
134
|
placeholder: placeholder,
|
|
133
135
|
isErrored: isErrored || !!error,
|
|
134
136
|
onFocus: () => {
|
|
@@ -24,6 +24,8 @@ export type RichMessageEditorProps = {
|
|
|
24
24
|
onChange: (value: string) => void;
|
|
25
25
|
/** Minimum editor height (CSS value). */
|
|
26
26
|
minHeight?: string;
|
|
27
|
+
/** Size a one-line editor like a text input, 36px high (default `false`). */
|
|
28
|
+
compact?: boolean;
|
|
27
29
|
/** Hint shown while the editor is empty. */
|
|
28
30
|
placeholder?: string;
|
|
29
31
|
/** Error message; switches the field to the error state. */
|
|
@@ -26,6 +26,7 @@ export const SlateEditor = ({
|
|
|
26
26
|
};
|
|
27
27
|
export const SlateEditable = ({
|
|
28
28
|
minHeight,
|
|
29
|
+
compact,
|
|
29
30
|
placeholder,
|
|
30
31
|
isErrored,
|
|
31
32
|
onFocus,
|
|
@@ -35,10 +36,11 @@ export const SlateEditable = ({
|
|
|
35
36
|
return renderElement(props, onDelete);
|
|
36
37
|
});
|
|
37
38
|
return _jsx(EditableStyled, {
|
|
38
|
-
style: minHeight ? {
|
|
39
|
-
minHeight
|
|
39
|
+
style: minHeight || compact ? {
|
|
40
|
+
minHeight: minHeight ?? '36px'
|
|
40
41
|
} : undefined,
|
|
41
42
|
"$isErrored": isErrored,
|
|
43
|
+
"$compact": compact,
|
|
42
44
|
placeholder: placeholder,
|
|
43
45
|
renderElement: renderElementPersistent,
|
|
44
46
|
onFocus: onFocus
|
|
@@ -17,6 +17,7 @@ export declare const EditableStyled: import("styled-components/dist/types").ISty
|
|
|
17
17
|
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
18
18
|
}, {
|
|
19
19
|
$isErrored?: boolean;
|
|
20
|
+
$compact?: boolean;
|
|
20
21
|
}>> & string & Omit<import("react").ForwardRefExoticComponent<{
|
|
21
22
|
decorate?: ((entry: import("slate").NodeEntry) => import("slate").DecoratedRange[]) | undefined;
|
|
22
23
|
onDOMBeforeInput?: ((event: InputEvent) => void) | undefined;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Editable } from 'slate-react';
|
|
2
|
-
import styled from 'styled-components';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
3
|
import { Color, FontSize, FontWeight, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
4
4
|
export const EditableStyled = styled(Editable).withConfig({
|
|
5
5
|
displayName: "EditableStyled",
|
|
6
6
|
componentId: "sc-16lukqt-0"
|
|
7
|
-
})(["font-weight:", ";font-size:", ";line-height:140%;padding:8px;color:", ";background:", ";caret-color:", ";border:1px solid ", ";border-radius:", ";overflow-x:auto
|
|
7
|
+
})(["font-weight:", ";font-size:", ";line-height:140%;padding:8px;color:", ";background:", ";caret-color:", ";border:1px solid ", ";border-radius:", ";overflow-x:auto;", " & [data-slate-placeholder='true']{color:", ";opacity:1 !important;}&:focus{border-color:", ";outline:none;}& > p{position:relative;margin:4px 0;&:first-child{margin-top:0;}&:last-child{margin-bottom:0;}}"], FontWeight.REGULAR, FontSize.REGULAR, Color.MAIN, Color.CLEAR, Color.BRIGHT, ({
|
|
8
8
|
$isErrored
|
|
9
|
-
}) => $isErrored ? Color.DANGER : Color.FORM, ShapeRadius.CONTROL,
|
|
9
|
+
}) => $isErrored ? Color.DANGER : Color.FORM, ShapeRadius.CONTROL, ({
|
|
10
|
+
$compact
|
|
11
|
+
}) => $compact && css(["box-sizing:border-box;padding-top:7px;padding-bottom:7px;"]), Color.PHANTOM, Color.BRIGHT);
|
package/package.json
CHANGED
|
@@ -35,6 +35,7 @@ export declare const DropdownItem: import("styled-components/dist/types").IStyle
|
|
|
35
35
|
}, {
|
|
36
36
|
$active?: boolean;
|
|
37
37
|
$selected?: boolean;
|
|
38
|
+
$solid?: boolean;
|
|
38
39
|
}>> & string;
|
|
39
40
|
export declare const DropdownEmpty: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
40
41
|
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
@@ -63,7 +63,7 @@ export const Dropdown = styled.div.withConfig({
|
|
|
63
63
|
export const DropdownItem = styled.div.withConfig({
|
|
64
64
|
displayName: "DropdownItem",
|
|
65
65
|
componentId: "sc-1pvwhhw-7"
|
|
66
|
-
})(["display:flex;align-items:center;gap:6px;padding:6px 12px;overflow-wrap:anywhere;", ";& > *{min-width:0;}background:", ";cursor:pointer;&:hover{background:", ";}"], textBase, ({
|
|
66
|
+
})(["display:flex;align-items:center;gap:6px;padding:6px 12px;overflow-wrap:anywhere;", ";& > *{min-width:0;}background:", ";cursor:pointer;&:hover{background:", ";}", ""], textBase, ({
|
|
67
67
|
$active,
|
|
68
68
|
$selected
|
|
69
69
|
}) => {
|
|
@@ -72,7 +72,11 @@ export const DropdownItem = styled.div.withConfig({
|
|
|
72
72
|
return 'transparent';
|
|
73
73
|
}, ({
|
|
74
74
|
$selected
|
|
75
|
-
}) => $selected ? Color.BRIGHT_LIGHT_HOVER : Color.ROW_HOVER
|
|
75
|
+
}) => $selected ? Color.BRIGHT_LIGHT_HOVER : Color.ROW_HOVER, ({
|
|
76
|
+
$selected,
|
|
77
|
+
$solid,
|
|
78
|
+
$active
|
|
79
|
+
}) => $selected && $solid && css(["background:", ";color:", ";&:hover{background:", ";}"], $active ? Color.BRIGHT_HOVER : Color.BRIGHT, Color.CLEAR, Color.BRIGHT_HOVER));
|
|
76
80
|
export const DropdownEmpty = styled.div.withConfig({
|
|
77
81
|
displayName: "DropdownEmpty",
|
|
78
82
|
componentId: "sc-1pvwhhw-8"
|
|
@@ -66,6 +66,8 @@ export type DropdownItemDescriptor = {
|
|
|
66
66
|
active?: boolean;
|
|
67
67
|
/** Row is the selected value. */
|
|
68
68
|
selected?: boolean;
|
|
69
|
+
/** Highlight of the selected row: `soft` (default) or `solid` (bright fill, white text). */
|
|
70
|
+
selectedTone?: 'soft' | 'solid';
|
|
69
71
|
/** Called when the row is chosen. */
|
|
70
72
|
onSelect?: () => void;
|
|
71
73
|
};
|