@axelor/aos-mobile-message 8.4.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/README.md +42 -0
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js +19 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/mail-message-api.d.ts +53 -0
- package/lib/api/mail-message-api.js +133 -0
- package/lib/api/mail-message-api.js.map +1 -0
- package/lib/components/atoms/AuthorText/AuthorText.d.ts +8 -0
- package/lib/components/atoms/AuthorText/AuthorText.js +41 -0
- package/lib/components/atoms/AuthorText/AuthorText.js.map +1 -0
- package/lib/components/atoms/Avatar/Avatar.d.ts +9 -0
- package/lib/components/atoms/Avatar/Avatar.js +49 -0
- package/lib/components/atoms/Avatar/Avatar.js.map +1 -0
- package/lib/components/atoms/ExpandableText/ExpandableText.d.ts +7 -0
- package/lib/components/atoms/ExpandableText/ExpandableText.js +68 -0
- package/lib/components/atoms/ExpandableText/ExpandableText.js.map +1 -0
- package/lib/components/atoms/MessageBox/MessageBox.d.ts +12 -0
- package/lib/components/atoms/MessageBox/MessageBox.js +63 -0
- package/lib/components/atoms/MessageBox/MessageBox.js.map +1 -0
- package/lib/components/atoms/MessageFlags/MessageFlags.d.ts +9 -0
- package/lib/components/atoms/MessageFlags/MessageFlags.js +74 -0
- package/lib/components/atoms/MessageFlags/MessageFlags.js.map +1 -0
- package/lib/components/atoms/TrackItem/TrackItem.d.ts +10 -0
- package/lib/components/atoms/TrackItem/TrackItem.js +59 -0
- package/lib/components/atoms/TrackItem/TrackItem.js.map +1 -0
- package/lib/components/atoms/index.d.ts +6 -0
- package/lib/components/atoms/index.js +24 -0
- package/lib/components/atoms/index.js.map +1 -0
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.js +22 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/molecules/CommentCard/CommentCard.d.ts +14 -0
- package/lib/components/molecules/CommentCard/CommentCard.js +60 -0
- package/lib/components/molecules/CommentCard/CommentCard.js.map +1 -0
- package/lib/components/molecules/NotificationCard/NotificationCard.d.ts +19 -0
- package/lib/components/molecules/NotificationCard/NotificationCard.js +59 -0
- package/lib/components/molecules/NotificationCard/NotificationCard.js.map +1 -0
- package/lib/components/molecules/SendMessageBox/SendMessageBox.d.ts +13 -0
- package/lib/components/molecules/SendMessageBox/SendMessageBox.js +62 -0
- package/lib/components/molecules/SendMessageBox/SendMessageBox.js.map +1 -0
- package/lib/components/molecules/UnsubscribeIcon/UnsubscribeIcon.d.ts +3 -0
- package/lib/components/molecules/UnsubscribeIcon/UnsubscribeIcon.js +47 -0
- package/lib/components/molecules/UnsubscribeIcon/UnsubscribeIcon.js.map +1 -0
- package/lib/components/molecules/index.d.ts +4 -0
- package/lib/components/molecules/index.js +22 -0
- package/lib/components/molecules/index.js.map +1 -0
- package/lib/components/organisms/MailMessageCard/MailMessageCard.d.ts +22 -0
- package/lib/components/organisms/MailMessageCard/MailMessageCard.js +148 -0
- package/lib/components/organisms/MailMessageCard/MailMessageCard.js.map +1 -0
- package/lib/components/organisms/index.d.ts +1 -0
- package/lib/components/organisms/index.js +19 -0
- package/lib/components/organisms/index.js.map +1 -0
- package/lib/components/templates/MailMessageView/MailMessageView.d.ts +9 -0
- package/lib/components/templates/MailMessageView/MailMessageView.js +69 -0
- package/lib/components/templates/MailMessageView/MailMessageView.js.map +1 -0
- package/lib/components/templates/index.d.ts +1 -0
- package/lib/components/templates/index.js +19 -0
- package/lib/components/templates/index.js.map +1 -0
- package/lib/features/asyncFunctions-index.d.ts +1 -0
- package/lib/features/asyncFunctions-index.js +19 -0
- package/lib/features/asyncFunctions-index.js.map +1 -0
- package/lib/features/index.d.ts +1 -0
- package/lib/features/index.js +19 -0
- package/lib/features/index.js.map +1 -0
- package/lib/features/mailMessageSlice.d.ts +110 -0
- package/lib/features/mailMessageSlice.js +180 -0
- package/lib/features/mailMessageSlice.js.map +1 -0
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +19 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/use-is-subscribed.d.ts +1 -0
- package/lib/hooks/use-is-subscribed.js +25 -0
- package/lib/hooks/use-is-subscribed.js.map +1 -0
- package/lib/hooks/use-message-header-actions.d.ts +1 -0
- package/lib/hooks/use-message-header-actions.js +162 -0
- package/lib/hooks/use-message-header-actions.js.map +1 -0
- package/lib/i18n/en.json +32 -0
- package/lib/i18n/fr.json +32 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +48 -0
- package/lib/index.js.map +1 -0
- package/lib/screens/InboxScreen.d.ts +3 -0
- package/lib/screens/InboxScreen.js +35 -0
- package/lib/screens/InboxScreen.js.map +1 -0
- package/lib/screens/MailMessageAttachedFilesScreen.d.ts +5 -0
- package/lib/screens/MailMessageAttachedFilesScreen.js +37 -0
- package/lib/screens/MailMessageAttachedFilesScreen.js.map +1 -0
- package/lib/screens/MailMessageLinkFilesScreen.d.ts +5 -0
- package/lib/screens/MailMessageLinkFilesScreen.js +88 -0
- package/lib/screens/MailMessageLinkFilesScreen.js.map +1 -0
- package/lib/screens/MailMessageScreen.d.ts +5 -0
- package/lib/screens/MailMessageScreen.js +32 -0
- package/lib/screens/MailMessageScreen.js.map +1 -0
- package/lib/screens/index.d.ts +43 -0
- package/lib/screens/index.js +53 -0
- package/lib/screens/index.js.map +1 -0
- package/lib/types/inbox-type.d.ts +5 -0
- package/lib/types/inbox-type.js +24 -0
- package/lib/types/inbox-type.js.map +1 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.js +21 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/mail-message-notification-type.d.ts +13 -0
- package/lib/types/mail-message-notification-type.js +48 -0
- package/lib/types/mail-message-notification-type.js.map +1 -0
- package/lib/types/mail-message-type.d.ts +17 -0
- package/lib/types/mail-message-type.js +55 -0
- package/lib/types/mail-message-type.js.map +1 -0
- package/lib/utils/date.d.ts +2 -0
- package/lib/utils/date.js +24 -0
- package/lib/utils/date.js.map +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +20 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/mailMessagesGenericAction.d.ts +24 -0
- package/lib/utils/mailMessagesGenericAction.js +53 -0
- package/lib/utils/mailMessagesGenericAction.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface TrackItemProps {
|
|
3
|
+
title: string;
|
|
4
|
+
oldDisplayValue: string;
|
|
5
|
+
oldValue: string;
|
|
6
|
+
displayValue: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}
|
|
9
|
+
declare const TrackItem: ({ title, oldDisplayValue, oldValue, displayValue, value, }: TrackItemProps) => React.JSX.Element;
|
|
10
|
+
export default TrackItem;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import React, { useCallback, useMemo } from 'react';
|
|
19
|
+
import { StyleSheet } from 'react-native';
|
|
20
|
+
import { isDate, useTranslator } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { Icon, Text } from '@axelor/aos-mobile-ui';
|
|
22
|
+
import { formatDateItem } from '../../../utils';
|
|
23
|
+
const TrackItem = ({ title, oldDisplayValue, oldValue, displayValue, value, }) => {
|
|
24
|
+
const I18n = useTranslator();
|
|
25
|
+
const values = useMemo(() => {
|
|
26
|
+
return {
|
|
27
|
+
oldValue: oldDisplayValue || oldValue,
|
|
28
|
+
value: displayValue || value,
|
|
29
|
+
};
|
|
30
|
+
}, [oldDisplayValue, oldValue, displayValue, value]);
|
|
31
|
+
const parseDate = useCallback((item) => {
|
|
32
|
+
return isDate(item) ? formatDateItem(item, I18n) : item;
|
|
33
|
+
}, [I18n]);
|
|
34
|
+
return (<Text style={styles.listItem}>
|
|
35
|
+
<Text style={styles.itemTitle}>{`${title}: `}</Text>
|
|
36
|
+
<Text style={styles.itemValue}>
|
|
37
|
+
{parseDate(values.oldValue)}
|
|
38
|
+
{values.oldValue && (<Icon name="arrow-right" size={10} style={styles.arrowIcon}/>)}
|
|
39
|
+
{parseDate(values.value)}
|
|
40
|
+
</Text>
|
|
41
|
+
</Text>);
|
|
42
|
+
};
|
|
43
|
+
const styles = StyleSheet.create({
|
|
44
|
+
arrowIcon: {
|
|
45
|
+
paddingHorizontal: 5,
|
|
46
|
+
},
|
|
47
|
+
listItem: {
|
|
48
|
+
flexDirection: 'row',
|
|
49
|
+
fontSize: 13,
|
|
50
|
+
},
|
|
51
|
+
itemTitle: {
|
|
52
|
+
fontWeight: 'bold',
|
|
53
|
+
},
|
|
54
|
+
itemValue: {
|
|
55
|
+
textAlign: 'justify',
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
export default TrackItem;
|
|
59
|
+
//# sourceMappingURL=TrackItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrackItem.js","sourceRoot":"","sources":["../../../../src/components/atoms/TrackItem/TrackItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC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a,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,EAAG,CAC/D,CACD;QAAA,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAC1B;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,iBAAiB,EAAE,CAAC;KACrB;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,QAAQ,EAAE,EAAE;KACb;IACD,SAAS,EAAE;QACT,UAAU,EAAE,MAAM;KACnB;IACD,SAAS,EAAE;QACT,SAAS,EAAE,SAAS;KACrB;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as AuthorText } from './AuthorText/AuthorText';
|
|
2
|
+
export { default as Avatar, AVATAR_SIZE, AVATAR_PADDING } from './Avatar/Avatar';
|
|
3
|
+
export { default as ExpandableText } from './ExpandableText/ExpandableText';
|
|
4
|
+
export { default as MessageBox } from './MessageBox/MessageBox';
|
|
5
|
+
export { default as MessageFlags } from './MessageFlags/MessageFlags';
|
|
6
|
+
export { default as TrackItem } from './TrackItem/TrackItem';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
export { default as AuthorText } from './AuthorText/AuthorText';
|
|
19
|
+
export { default as Avatar, AVATAR_SIZE, AVATAR_PADDING } from './Avatar/Avatar';
|
|
20
|
+
export { default as ExpandableText } from './ExpandableText/ExpandableText';
|
|
21
|
+
export { default as MessageBox } from './MessageBox/MessageBox';
|
|
22
|
+
export { default as MessageFlags } from './MessageFlags/MessageFlags';
|
|
23
|
+
export { default as TrackItem } from './TrackItem/TrackItem';
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/atoms/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,MAAM,EAAE,WAAW,EAAE,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
export * from './atoms';
|
|
19
|
+
export * from './molecules';
|
|
20
|
+
export * from './organisms';
|
|
21
|
+
export * from './templates';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface CommentCardProps {
|
|
3
|
+
relatedModel: string;
|
|
4
|
+
relatedId: number;
|
|
5
|
+
subject?: string;
|
|
6
|
+
files: any[];
|
|
7
|
+
value: string;
|
|
8
|
+
flags?: any;
|
|
9
|
+
style?: any;
|
|
10
|
+
navigation?: any;
|
|
11
|
+
isInbox?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const CommentCard: ({ relatedModel, relatedId, subject, files, value, flags, style, isInbox, }: CommentCardProps) => React.JSX.Element;
|
|
14
|
+
export default CommentCard;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import React, { useMemo } from 'react';
|
|
19
|
+
import { StyleSheet, View } from 'react-native';
|
|
20
|
+
import { useNavigation, useTranslator } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { ActionCard, Card, LabelText, useThemeColor, } from '@axelor/aos-mobile-ui';
|
|
22
|
+
import { ExpandableText, MessageFlags } from '../../atoms';
|
|
23
|
+
const CommentCard = ({ relatedModel, relatedId, subject, files, value, flags, style, isInbox, }) => {
|
|
24
|
+
const Colors = useThemeColor();
|
|
25
|
+
const I18n = useTranslator();
|
|
26
|
+
const navigation = useNavigation();
|
|
27
|
+
const actionList = useMemo(() => {
|
|
28
|
+
const _actions = [];
|
|
29
|
+
if (Array.isArray(files) && files.length > 0) {
|
|
30
|
+
_actions.push({
|
|
31
|
+
iconName: 'paperclip',
|
|
32
|
+
onPress: () => navigation.navigate('MailMessageAttachedFilesScreen', { files }),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return _actions;
|
|
36
|
+
}, [files, navigation]);
|
|
37
|
+
return (<ActionCard style={style} actionList={actionList} translator={I18n.t}>
|
|
38
|
+
<Card style={styles.card}>
|
|
39
|
+
<View style={styles.headerContainer}>
|
|
40
|
+
<LabelText iconName="chat-fill" size={18} value={subject || I18n.t('Base_Comment')} style={styles.flexOne} textStyle={styles.flexOne} textSize={16} color={Colors.primaryColor.background}/>
|
|
41
|
+
{flags != null && (<MessageFlags flags={flags} model={relatedModel} modelId={relatedId} isInbox={isInbox}/>)}
|
|
42
|
+
</View>
|
|
43
|
+
<ExpandableText value={value}/>
|
|
44
|
+
</Card>
|
|
45
|
+
</ActionCard>);
|
|
46
|
+
};
|
|
47
|
+
const styles = StyleSheet.create({
|
|
48
|
+
card: { flex: 1, paddingHorizontal: 15, paddingRight: 15, paddingVertical: 10 },
|
|
49
|
+
headerContainer: {
|
|
50
|
+
flexDirection: 'row',
|
|
51
|
+
justifyContent: 'space-between',
|
|
52
|
+
gap: 5,
|
|
53
|
+
zIndex: 10,
|
|
54
|
+
},
|
|
55
|
+
flexOne: { flex: 1 },
|
|
56
|
+
floatingButtonContainer: { position: 'relative' },
|
|
57
|
+
floatingButton: { width: 20, height: 20 },
|
|
58
|
+
});
|
|
59
|
+
export default CommentCard;
|
|
60
|
+
//# sourceMappingURL=CommentCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommentCard.js","sourceRoot":"","sources":["../../../../src/components/molecules/CommentCard/CommentCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,aAAa,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACrE,OAAO,EACL,UAAU,EACV,IAAI,EACJ,SAAS,EACT,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,cAAc,EAAE,YAAY,EAAC,MAAM,aAAa,CAAC;AAczD,MAAM,WAAW,GAAG,CAAC,EACnB,YAAY,EACZ,SAAS,EACT,OAAO,EACP,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,OAAO,GACU,EAAE,EAAE;IACrB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;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AAC,YAAY,CACX,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,KAAK,CAAC,CAAC,YAAY,CAAC,CACpB,OAAO,CAAC,CAAC,SAAS,CAAC,CACnB,OAAO,CAAC,CAAC,OAAO,CAAC,EACjB,CACH,CACH;QAAA,EAAE,IAAI,CACN;QAAA,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAC/B;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE,EAAC,IAAI,EAAE,CAAC,EAAE,iBAAiB,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,eAAe,EAAE,EAAE,EAAC;IAC7E,eAAe,EAAE;QACf,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,GAAG,EAAE,CAAC;QACN,MAAM,EAAE,EAAE;KACX;IACD,OAAO,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC;IAClB,uBAAuB,EAAE,EAAC,QAAQ,EAAE,UAAU,EAAC;IAC/C,cAAc,EAAE,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAC;CACxC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
interface TagProps {
|
|
3
|
+
title: string;
|
|
4
|
+
style: string;
|
|
5
|
+
}
|
|
6
|
+
interface NotificationCardProps {
|
|
7
|
+
relatedModel?: string;
|
|
8
|
+
relatedId?: number;
|
|
9
|
+
relatedName?: string;
|
|
10
|
+
subject: string;
|
|
11
|
+
tag?: TagProps;
|
|
12
|
+
tracks?: any[];
|
|
13
|
+
flags?: any;
|
|
14
|
+
style?: any;
|
|
15
|
+
customTopComponent?: ReactElement<any>;
|
|
16
|
+
isInbox?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const NotificationCard: ({ relatedModel, relatedId, relatedName, subject, tag, tracks, flags, style, customTopComponent, isInbox, }: NotificationCardProps) => React.JSX.Element;
|
|
19
|
+
export default NotificationCard;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import React, { useMemo, useState } from 'react';
|
|
19
|
+
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
20
|
+
import { Card, Icon, LabelText, useThemeColor, UnorderedList, Badge, } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { MessageFlags, TrackItem } from '../../atoms';
|
|
22
|
+
import { MailMessageNotificationType } from '../../../types';
|
|
23
|
+
const MAX_TRACK_ITEMS = 5;
|
|
24
|
+
const NotificationCard = ({ relatedModel, relatedId, relatedName, subject, tag, tracks, flags, style, customTopComponent, isInbox, }) => {
|
|
25
|
+
const Colors = useThemeColor();
|
|
26
|
+
const [moreItems, setMoreItems] = useState(false);
|
|
27
|
+
const displayFlags = useMemo(() => relatedModel != null && relatedId != null && flags != null, [flags, relatedId, relatedModel]);
|
|
28
|
+
return (<TouchableOpacity style={style} onPress={() => setMoreItems(!moreItems)} disabled={tracks.length < MAX_TRACK_ITEMS} activeOpacity={0.9}>
|
|
29
|
+
<Card style={styles.card}>
|
|
30
|
+
<View style={styles.cardHeader}>
|
|
31
|
+
<LabelText iconName="info-circle-fill" size={18} title={relatedName} value={subject} style={styles.flexOne} textStyle={styles.flexOne} textSize={16} color={Colors.primaryColor.background}/>
|
|
32
|
+
{customTopComponent && React.cloneElement(customTopComponent)}
|
|
33
|
+
{tag && (<View style={styles.tagContainer}>
|
|
34
|
+
<Badge title={tag.title} color={MailMessageNotificationType.getTagColor(tag.style, Colors)} txtStyle={styles.tagTxt}/>
|
|
35
|
+
</View>)}
|
|
36
|
+
{displayFlags && (<MessageFlags flags={flags} model={relatedModel} modelId={relatedId} isInbox={isInbox}/>)}
|
|
37
|
+
</View>
|
|
38
|
+
{tracks && (<>
|
|
39
|
+
<UnorderedList data={tracks} numberOfItems={!moreItems && tracks.length > MAX_TRACK_ITEMS && MAX_TRACK_ITEMS} renderItem={({ item }) => (<TrackItem title={item.title} oldDisplayValue={item.oldDisplayValue} oldValue={item.oldValue} displayValue={item.displayValue} value={item.value}/>)}/>
|
|
40
|
+
{tracks.length > MAX_TRACK_ITEMS && (<Icon name={moreItems ? 'chevron-up' : 'chevron-down'} color={Colors.primaryColor.background} style={styles.moreIcon}/>)}
|
|
41
|
+
</>)}
|
|
42
|
+
</Card>
|
|
43
|
+
</TouchableOpacity>);
|
|
44
|
+
};
|
|
45
|
+
const styles = StyleSheet.create({
|
|
46
|
+
card: { flex: 1, paddingHorizontal: 15, paddingRight: 15, paddingVertical: 10 },
|
|
47
|
+
cardHeader: {
|
|
48
|
+
flexDirection: 'row',
|
|
49
|
+
justifyContent: 'space-between',
|
|
50
|
+
gap: 5,
|
|
51
|
+
zIndex: 10,
|
|
52
|
+
},
|
|
53
|
+
moreIcon: { alignSelf: 'center' },
|
|
54
|
+
tagContainer: { width: '30%', flexDirection: 'row-reverse' },
|
|
55
|
+
tagTxt: { fontSize: 12 },
|
|
56
|
+
flexOne: { flex: 1 },
|
|
57
|
+
});
|
|
58
|
+
export default NotificationCard;
|
|
59
|
+
//# sourceMappingURL=NotificationCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationCard.js","sourceRoot":"","sources":["../../../../src/components/molecules/NotificationCard/NotificationCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAgB,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAChE,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,aAAa,EACb,aAAa,EACb,KAAK,GACN,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,aAAa,CAAC;AACpD,OAAO,EAAC,2BAA2B,EAAC,MAAM,gBAAgB,CAAC;AAE3D,MAAM,eAAe,GAAG,CAAC,CAAC;AAoB1B,MAAM,gBAAgB,GAAG,CAAC,EACxB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,OAAO,EACP,GAAG,EACH,MAAM,EACN,KAAK,EACL,KAAK,EACL,kBAAkB,EAClB,OAAO,GACe,EAAE,EAAE;IAC1B,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,YAAY,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,EAChE,CAAC,KAAK,EAAE,SAAS,EAAE,YAAY,CAAC,CACjC,CAAC;IAEF,OAAO,CACL,CAAC,gBAAgB,CACf,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,YAA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IACD,QAAQ,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAC;IAC/B,YAAY,EAAE,EAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,EAAC;IAC1D,MAAM,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAC;IACtB,OAAO,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC;CACnB,CAAC,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface SendMessageBoxProps {
|
|
3
|
+
style?: any;
|
|
4
|
+
model: string;
|
|
5
|
+
modelId: number;
|
|
6
|
+
parentId?: number;
|
|
7
|
+
hideMessageBox?: boolean;
|
|
8
|
+
onSend?: (message: any) => void;
|
|
9
|
+
wrapperRef?: any;
|
|
10
|
+
onLinkFiles?: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare const SendMessageBox: ({ style, model, modelId, parentId, hideMessageBox, onSend, wrapperRef, onLinkFiles, }: SendMessageBoxProps) => React.JSX.Element;
|
|
13
|
+
export default SendMessageBox;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import React, { useCallback, useState } from 'react';
|
|
19
|
+
import { Dimensions, Keyboard, StyleSheet, View } from 'react-native';
|
|
20
|
+
import { useDispatch, useNavigation, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { checkNullString } from '@axelor/aos-mobile-ui';
|
|
22
|
+
import { MessageBox } from '../../atoms';
|
|
23
|
+
import { saveLinkFiles, sendMailMessageComment, } from '../../../features/mailMessageSlice';
|
|
24
|
+
const SendMessageBox = ({ style, model, modelId, parentId, hideMessageBox = false, onSend, wrapperRef, onLinkFiles, }) => {
|
|
25
|
+
const I18n = useTranslator();
|
|
26
|
+
const navigation = useNavigation();
|
|
27
|
+
const dispatch = useDispatch();
|
|
28
|
+
const [comment, setComment] = useState('');
|
|
29
|
+
const { linkFiles } = useSelector(state => state.mailMessages);
|
|
30
|
+
const handleSendComment = useCallback(() => {
|
|
31
|
+
dispatch(sendMailMessageComment({
|
|
32
|
+
model,
|
|
33
|
+
modelId,
|
|
34
|
+
comment,
|
|
35
|
+
parentId,
|
|
36
|
+
files: linkFiles?.map(file => file?.metaFile?.id) ?? [],
|
|
37
|
+
})).then(res => onSend?.(res.payload));
|
|
38
|
+
Keyboard.dismiss();
|
|
39
|
+
setComment('');
|
|
40
|
+
linkFiles?.length > 0 && dispatch(saveLinkFiles([]));
|
|
41
|
+
}, [dispatch, model, modelId, comment, parentId, linkFiles, onSend]);
|
|
42
|
+
const handleLinkFiles = useCallback(() => {
|
|
43
|
+
onLinkFiles?.();
|
|
44
|
+
navigation.navigate('MailMessageLinkFilesScreen');
|
|
45
|
+
}, [navigation, onLinkFiles]);
|
|
46
|
+
if (hideMessageBox) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return (<View style={[styles.messageBox, style]} ref={wrapperRef}>
|
|
50
|
+
<MessageBox placeholder={I18n.t('Message_CommentInput_Placeholder')} disabled={checkNullString(comment)} value={comment} onChange={setComment} onSend={handleSendComment} onLinkFiles={handleLinkFiles} numberLinkedFiles={linkFiles.length}/>
|
|
51
|
+
</View>);
|
|
52
|
+
};
|
|
53
|
+
const styles = StyleSheet.create({
|
|
54
|
+
messageBox: {
|
|
55
|
+
width: Dimensions.get('screen').width,
|
|
56
|
+
justifyContent: 'center',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
marginBottom: 10,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
export default SendMessageBox;
|
|
62
|
+
//# sourceMappingURL=SendMessageBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SendMessageBox.js","sourceRoot":"","sources":["../../../../src/components/molecules/SendMessageBox/SendMessageBox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACnD,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AACpE,OAAO,EACL,WAAW,EACX,aAAa,EACb,WAAW,EACX,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,aAAa,EACb,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAa5C,MAAM,cAAc,GAAG,CAAC,EACtB,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,EACR,cAAc,GAAG,KAAK,EACtB,MAAM,EACN,UAAU,EACV,WAAW,GACS,EAAE,EAAE;IACxB,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAE3C,M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AAC,eAAe,CAAC,OAAO,CAAC,CAAC,CACnC,KAAK,CAAC,CAAC,OAAO,CAAC,CACf,QAAQ,CAAC,CAAC,UAAU,CAAC,CACrB,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAC1B,WAAW,CAAC,CAAC,eAAe,CAAC,CAC7B,iBAAiB,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,EAExC;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,UAAU,EAAE;QACV,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK;QACrC,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,YAAY,EAAE,EAAE;KACjB;CACF,CAAC,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import React, { useCallback, useState } from 'react';
|
|
19
|
+
import { useDispatch, useSelector, useTranslator } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { Alert, Icon, Text, useThemeColor } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { useIsSubscribed } from '../../../hooks';
|
|
22
|
+
import { subscribeModel, unsubscribeModel, } from '../../../features/mailMessageSlice';
|
|
23
|
+
const UnsubscribeIcon = ({}) => {
|
|
24
|
+
const Colors = useThemeColor();
|
|
25
|
+
const I18n = useTranslator();
|
|
26
|
+
const isSubscribed = useIsSubscribed();
|
|
27
|
+
const dispatch = useDispatch();
|
|
28
|
+
const { model, modelId } = useSelector(state => state.mailMessages);
|
|
29
|
+
const [alertVisible, setAlertVisible] = useState(false);
|
|
30
|
+
const handleSubscribe = useCallback(() => {
|
|
31
|
+
dispatch(subscribeModel({ model, modelId }));
|
|
32
|
+
}, [dispatch, model, modelId]);
|
|
33
|
+
const handleUnsubscribe = useCallback(() => {
|
|
34
|
+
dispatch(unsubscribeModel({ model, modelId }));
|
|
35
|
+
setAlertVisible(false);
|
|
36
|
+
}, [dispatch, model, modelId]);
|
|
37
|
+
return (<>
|
|
38
|
+
<Icon name={isSubscribed ? 'star-fill' : 'star'} color={isSubscribed
|
|
39
|
+
? Colors.primaryColor.background
|
|
40
|
+
: Colors.secondaryColor_dark.background} touchable onPress={isSubscribed ? () => setAlertVisible(true) : handleSubscribe}/>
|
|
41
|
+
<Alert visible={alertVisible} title={I18n.t('Message_Question')} cancelButtonConfig={{ onPress: () => setAlertVisible(false) }} confirmButtonConfig={{ onPress: handleUnsubscribe }} translator={I18n.t}>
|
|
42
|
+
<Text>{I18n.t('Message_Unfollow_Confirmation')}</Text>
|
|
43
|
+
</Alert>
|
|
44
|
+
</>);
|
|
45
|
+
};
|
|
46
|
+
export default UnsubscribeIcon;
|
|
47
|
+
//# sourceMappingURL=UnsubscribeIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsubscribeIcon.js","sourceRoot":"","sources":["../../../../src/components/molecules/UnsubscribeIcon/UnsubscribeIcon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,O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,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAC1C,KAAK,CAAC,CACJ,YAAY;YACV,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,UAAU;YAChC,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,UAAU,CAC1C,CACD,SAAS,CACT,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,EAExE;MAAA,CAAC,KAAK,CACJ,OAAO,CAAC,CAAC,YAAY,CAAC,CACtB,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAClC,kBAAkB,CAAC,CAAC,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,EAAC,CAAC,CAC5D,mBAAmB,CAAC,CAAC,EAAC,OAAO,EAAE,iBAAiB,EAAC,CAAC,CAClD,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACnB;QAAA,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,EAAE,IAAI,CACvD;MAAA,EAAE,KAAK,CACT;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as CommentCard } from './CommentCard/CommentCard';
|
|
2
|
+
export { default as NotificationCard } from './NotificationCard/NotificationCard';
|
|
3
|
+
export { default as SendMessageBox } from './SendMessageBox/SendMessageBox';
|
|
4
|
+
export { default as UnsubscribeIcon } from './UnsubscribeIcon/UnsubscribeIcon';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
export { default as CommentCard } from './CommentCard/CommentCard';
|
|
19
|
+
export { default as NotificationCard } from './NotificationCard/NotificationCard';
|
|
20
|
+
export { default as SendMessageBox } from './SendMessageBox/SendMessageBox';
|
|
21
|
+
export { default as UnsubscribeIcon } from './UnsubscribeIcon/UnsubscribeIcon';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/molecules/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface MailMessageCardProps {
|
|
3
|
+
messageId?: number;
|
|
4
|
+
author: string;
|
|
5
|
+
avatar: string;
|
|
6
|
+
body: any;
|
|
7
|
+
eventText: string;
|
|
8
|
+
eventTime: string;
|
|
9
|
+
files: any[];
|
|
10
|
+
style?: any;
|
|
11
|
+
relatedName?: string;
|
|
12
|
+
subject: string;
|
|
13
|
+
type: string;
|
|
14
|
+
flags: any[];
|
|
15
|
+
relatedId: number;
|
|
16
|
+
relatedModel: string;
|
|
17
|
+
isInbox?: boolean;
|
|
18
|
+
numReplies?: number;
|
|
19
|
+
getParentReplies?: (newMessage?: any) => void;
|
|
20
|
+
}
|
|
21
|
+
declare const MailMessageCard: ({ messageId, author, avatar, body, eventText, eventTime, files, style, relatedName, subject, type, flags, relatedId, relatedModel, isInbox, numReplies, getParentReplies, }: MailMessageCardProps) => React.JSX.Element;
|
|
22
|
+
export default MailMessageCard;
|