@atlaskit/mention 19.9.5 → 21.0.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/CHANGELOG.md +34 -0
- package/dist/cjs/api/MentionResource.js +4 -6
- package/dist/cjs/api/TeamMentionResource.js +2 -2
- package/dist/cjs/api/analytics.js +2 -15
- package/dist/cjs/components/LockCircleIcon/index.js +28 -0
- package/dist/cjs/components/Mention/PrimitiveMention.js +118 -0
- package/dist/cjs/components/Mention/index.js +19 -16
- package/dist/cjs/components/MentionDescriptionByline/TeamMentionDescriptionByline.js +5 -5
- package/dist/cjs/components/MentionDescriptionByline/styles.js +4 -2
- package/dist/cjs/components/MentionItem/index.js +14 -8
- package/dist/cjs/components/MentionItem/styles.js +12 -10
- package/dist/cjs/components/MentionList/index.js +4 -2
- package/dist/cjs/components/MentionList/styles.js +5 -3
- package/dist/cjs/components/MentionListError/styles.js +7 -5
- package/dist/cjs/components/MentionPicker/index.js +12 -4
- package/dist/cjs/components/MentionPicker/styles.js +5 -3
- package/dist/cjs/components/MessagesIntlProvider/index.js +57 -0
- package/dist/cjs/components/NoAccessTooltip/index.js +29 -0
- package/dist/cjs/components/{NoAccessTooltip.js → NoAccessTooltip/main.js} +4 -2
- package/dist/cjs/components/ResourcedMentionList/index.js +14 -6
- package/dist/cjs/components/Scrollable/index.js +1 -1
- package/dist/cjs/components/Scrollable/styles.js +4 -2
- package/dist/cjs/components/TeamMentionHighlight/index.js +6 -4
- package/dist/cjs/components/TeamMentionHighlight/lazy.js +28 -0
- package/dist/cjs/components/TeamMentionHighlight/styles.js +11 -9
- package/dist/cjs/components/i18n.js +2 -2
- package/dist/cjs/i18n/cs.js +2 -2
- package/dist/cjs/i18n/da.js +2 -2
- package/dist/cjs/i18n/de.js +2 -2
- package/dist/cjs/i18n/en_ZZ.js +32 -0
- package/dist/cjs/i18n/es.js +2 -2
- package/dist/cjs/i18n/et.js +2 -2
- package/dist/cjs/i18n/fi.js +2 -2
- package/dist/cjs/i18n/fr.js +2 -2
- package/dist/cjs/i18n/hu.js +2 -2
- package/dist/cjs/i18n/it.js +2 -2
- package/dist/cjs/i18n/ja.js +2 -2
- package/dist/cjs/i18n/ko.js +2 -2
- package/dist/cjs/i18n/nb.js +2 -2
- package/dist/cjs/i18n/nl.js +2 -2
- package/dist/cjs/i18n/pl.js +2 -2
- package/dist/cjs/i18n/pt_BR.js +2 -2
- package/dist/cjs/i18n/pt_PT.js +2 -2
- package/dist/cjs/i18n/ru.js +2 -2
- package/dist/cjs/i18n/sk.js +2 -2
- package/dist/cjs/i18n/sv.js +2 -2
- package/dist/cjs/i18n/th.js +2 -2
- package/dist/cjs/i18n/tr.js +2 -2
- package/dist/cjs/i18n/uk.js +2 -2
- package/dist/cjs/i18n/vi.js +2 -2
- package/dist/cjs/i18n/zh.js +2 -2
- package/dist/cjs/i18n/zh_TW.js +2 -2
- package/dist/cjs/index.js +12 -8
- package/dist/cjs/shared-styles.js +4 -2
- package/dist/cjs/util/analytics.js +2 -2
- package/dist/cjs/util/i18n.js +297 -26
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/api/analytics.js +0 -9
- package/dist/es2019/components/LockCircleIcon/index.js +7 -0
- package/dist/es2019/components/Mention/PrimitiveMention.js +117 -0
- package/dist/es2019/components/Mention/index.js +16 -13
- package/dist/es2019/components/MentionDescriptionByline/TeamMentionDescriptionByline.js +1 -1
- package/dist/es2019/components/MentionDescriptionByline/styles.js +3 -4
- package/dist/es2019/components/MentionItem/index.js +11 -7
- package/dist/es2019/components/MentionItem/styles.js +6 -7
- package/dist/es2019/components/MentionList/index.js +3 -2
- package/dist/es2019/components/MentionList/styles.js +3 -4
- package/dist/es2019/components/MentionListError/GenericErrorIllustration.js +1 -0
- package/dist/es2019/components/MentionListError/styles.js +5 -6
- package/dist/es2019/components/MentionPicker/index.js +11 -4
- package/dist/es2019/components/MentionPicker/styles.js +4 -5
- package/dist/es2019/components/MessagesIntlProvider/index.js +38 -0
- package/dist/es2019/components/NoAccessTooltip/index.js +9 -0
- package/dist/es2019/components/{NoAccessTooltip.js → NoAccessTooltip/main.js} +4 -2
- package/dist/es2019/components/ResourcedMentionList/index.js +6 -4
- package/dist/es2019/components/Scrollable/index.js +1 -1
- package/dist/es2019/components/Scrollable/styles.js +3 -4
- package/dist/es2019/components/TeamMentionHighlight/index.js +4 -3
- package/dist/es2019/components/TeamMentionHighlight/lazy.js +6 -0
- package/dist/es2019/components/TeamMentionHighlight/styles.js +3 -2
- package/dist/es2019/components/i18n.js +1 -1
- package/dist/es2019/i18n/cs.js +2 -2
- package/dist/es2019/i18n/da.js +2 -2
- package/dist/es2019/i18n/de.js +2 -2
- package/dist/es2019/i18n/en_ZZ.js +24 -0
- package/dist/es2019/i18n/es.js +2 -2
- package/dist/es2019/i18n/et.js +2 -2
- package/dist/es2019/i18n/fi.js +2 -2
- package/dist/es2019/i18n/fr.js +2 -2
- package/dist/es2019/i18n/hu.js +2 -2
- package/dist/es2019/i18n/it.js +2 -2
- package/dist/es2019/i18n/ja.js +2 -2
- package/dist/es2019/i18n/ko.js +2 -2
- package/dist/es2019/i18n/nb.js +2 -2
- package/dist/es2019/i18n/nl.js +2 -2
- package/dist/es2019/i18n/pl.js +2 -2
- package/dist/es2019/i18n/pt_BR.js +2 -2
- package/dist/es2019/i18n/pt_PT.js +2 -2
- package/dist/es2019/i18n/ru.js +2 -2
- package/dist/es2019/i18n/sk.js +2 -2
- package/dist/es2019/i18n/sv.js +2 -2
- package/dist/es2019/i18n/th.js +2 -2
- package/dist/es2019/i18n/tr.js +2 -2
- package/dist/es2019/i18n/uk.js +2 -2
- package/dist/es2019/i18n/vi.js +2 -2
- package/dist/es2019/i18n/zh.js +2 -2
- package/dist/es2019/i18n/zh_TW.js +2 -2
- package/dist/es2019/index.js +3 -4
- package/dist/es2019/shared-styles.js +3 -2
- package/dist/es2019/util/i18n.js +260 -18
- package/dist/es2019/version.json +1 -1
- package/dist/esm/api/MentionResource.js +4 -4
- package/dist/esm/api/TeamMentionResource.js +2 -2
- package/dist/esm/api/analytics.js +0 -10
- package/dist/esm/components/LockCircleIcon/index.js +11 -0
- package/dist/esm/components/Mention/PrimitiveMention.js +100 -0
- package/dist/esm/components/Mention/index.js +17 -14
- package/dist/esm/components/MentionDescriptionByline/TeamMentionDescriptionByline.js +1 -1
- package/dist/esm/components/MentionDescriptionByline/styles.js +3 -4
- package/dist/esm/components/MentionItem/index.js +11 -7
- package/dist/esm/components/MentionItem/styles.js +6 -7
- package/dist/esm/components/MentionList/index.js +3 -2
- package/dist/esm/components/MentionList/styles.js +4 -5
- package/dist/esm/components/MentionListError/GenericErrorIllustration.js +1 -0
- package/dist/esm/components/MentionListError/styles.js +3 -4
- package/dist/esm/components/MentionPicker/index.js +11 -4
- package/dist/esm/components/MentionPicker/styles.js +3 -4
- package/dist/esm/components/MessagesIntlProvider/index.js +41 -0
- package/dist/esm/components/NoAccessTooltip/index.js +11 -0
- package/dist/esm/components/{NoAccessTooltip.js → NoAccessTooltip/main.js} +4 -2
- package/dist/esm/components/ResourcedMentionList/index.js +8 -6
- package/dist/esm/components/Scrollable/index.js +1 -1
- package/dist/esm/components/Scrollable/styles.js +3 -4
- package/dist/esm/components/TeamMentionHighlight/index.js +4 -3
- package/dist/esm/components/TeamMentionHighlight/lazy.js +10 -0
- package/dist/esm/components/TeamMentionHighlight/styles.js +3 -2
- package/dist/esm/components/i18n.js +1 -1
- package/dist/esm/i18n/cs.js +2 -2
- package/dist/esm/i18n/da.js +2 -2
- package/dist/esm/i18n/de.js +2 -2
- package/dist/esm/i18n/en_ZZ.js +24 -0
- package/dist/esm/i18n/es.js +2 -2
- package/dist/esm/i18n/et.js +2 -2
- package/dist/esm/i18n/fi.js +2 -2
- package/dist/esm/i18n/fr.js +2 -2
- package/dist/esm/i18n/hu.js +2 -2
- package/dist/esm/i18n/it.js +2 -2
- package/dist/esm/i18n/ja.js +2 -2
- package/dist/esm/i18n/ko.js +2 -2
- package/dist/esm/i18n/nb.js +2 -2
- package/dist/esm/i18n/nl.js +2 -2
- package/dist/esm/i18n/pl.js +2 -2
- package/dist/esm/i18n/pt_BR.js +2 -2
- package/dist/esm/i18n/pt_PT.js +2 -2
- package/dist/esm/i18n/ru.js +2 -2
- package/dist/esm/i18n/sk.js +2 -2
- package/dist/esm/i18n/sv.js +2 -2
- package/dist/esm/i18n/th.js +2 -2
- package/dist/esm/i18n/tr.js +2 -2
- package/dist/esm/i18n/uk.js +2 -2
- package/dist/esm/i18n/vi.js +2 -2
- package/dist/esm/i18n/zh.js +2 -2
- package/dist/esm/i18n/zh_TW.js +2 -2
- package/dist/esm/index.js +3 -4
- package/dist/esm/shared-styles.js +3 -2
- package/dist/esm/util/analytics.js +2 -2
- package/dist/esm/util/i18n.js +284 -23
- package/dist/esm/version.json +1 -1
- package/dist/types/api/analytics.d.ts +0 -5
- package/dist/types/components/LockCircleIcon/index.d.ts +3 -0
- package/dist/types/components/Mention/PrimitiveMention.d.ts +7 -0
- package/dist/types/components/Mention/index.d.ts +1 -1
- package/dist/types/components/MentionDescriptionByline/styles.d.ts +2 -2
- package/dist/types/components/MentionItem/MentionHighlightHelpers.d.ts +2 -3
- package/dist/types/components/MentionItem/styles.d.ts +9 -9
- package/dist/types/components/MentionList/styles.d.ts +2 -2
- package/dist/types/components/MentionListError/styles.d.ts +5 -5
- package/dist/types/components/MentionPicker/index.d.ts +11 -8
- package/dist/types/components/MentionPicker/styles.d.ts +3 -3
- package/dist/types/components/MessagesIntlProvider/index.d.ts +3 -0
- package/dist/types/components/NoAccessTooltip/index.d.ts +6 -0
- package/dist/types/components/{NoAccessTooltip.d.ts → NoAccessTooltip/main.d.ts} +0 -0
- package/dist/types/components/Scrollable/styles.d.ts +2 -4
- package/dist/types/components/TeamMentionHighlight/index.d.ts +1 -1
- package/dist/types/components/TeamMentionHighlight/lazy.d.ts +4 -0
- package/dist/types/components/TeamMentionHighlight/styles.d.ts +8 -8
- package/dist/types/i18n/cs.d.ts +1 -1
- package/dist/types/i18n/da.d.ts +1 -1
- package/dist/types/i18n/de.d.ts +1 -1
- package/dist/types/i18n/en_ZZ.d.ts +24 -0
- package/dist/types/i18n/es.d.ts +1 -1
- package/dist/types/i18n/et.d.ts +1 -1
- package/dist/types/i18n/fi.d.ts +1 -1
- package/dist/types/i18n/fr.d.ts +1 -1
- package/dist/types/i18n/hu.d.ts +1 -1
- package/dist/types/i18n/it.d.ts +1 -1
- package/dist/types/i18n/ja.d.ts +1 -1
- package/dist/types/i18n/ko.d.ts +1 -1
- package/dist/types/i18n/nb.d.ts +1 -1
- package/dist/types/i18n/nl.d.ts +1 -1
- package/dist/types/i18n/pl.d.ts +1 -1
- package/dist/types/i18n/pt_BR.d.ts +1 -1
- package/dist/types/i18n/pt_PT.d.ts +1 -1
- package/dist/types/i18n/ru.d.ts +1 -1
- package/dist/types/i18n/sk.d.ts +1 -1
- package/dist/types/i18n/sv.d.ts +1 -1
- package/dist/types/i18n/th.d.ts +1 -1
- package/dist/types/i18n/tr.d.ts +1 -1
- package/dist/types/i18n/uk.d.ts +1 -1
- package/dist/types/i18n/vi.d.ts +1 -1
- package/dist/types/i18n/zh.d.ts +1 -1
- package/dist/types/i18n/zh_TW.d.ts +1 -1
- package/dist/types/index.d.ts +3 -4
- package/dist/types/shared-styles.d.ts +2 -2
- package/dist/types/util/i18n.d.ts +32 -17
- package/docs/1-in-editor.tsx +4 -36
- package/package.json +25 -14
- package/tsconfig.json +1 -2
- package/dist/cjs/api/SmartMentionResource.js +0 -338
- package/dist/cjs/api/SmartMentionTypes.js +0 -15
- package/dist/cjs/api/extract-react-types/smart-config-props.js +0 -15
- package/dist/cjs/api/recommendationClient.js +0 -57
- package/dist/cjs/components/Mention/styles.js +0 -66
- package/dist/cjs/default-mention-name-resolver/default-mention-name-resolver.js +0 -136
- package/dist/cjs/default-mention-name-resolver/graphqlUtils.js +0 -48
- package/dist/es2019/api/SmartMentionResource.js +0 -219
- package/dist/es2019/api/SmartMentionTypes.js +0 -7
- package/dist/es2019/api/extract-react-types/smart-config-props.js +0 -8
- package/dist/es2019/api/recommendationClient.js +0 -46
- package/dist/es2019/components/Mention/styles.js +0 -61
- package/dist/es2019/default-mention-name-resolver/default-mention-name-resolver.js +0 -64
- package/dist/es2019/default-mention-name-resolver/graphqlUtils.js +0 -39
- package/dist/esm/api/SmartMentionResource.js +0 -317
- package/dist/esm/api/SmartMentionTypes.js +0 -7
- package/dist/esm/api/extract-react-types/smart-config-props.js +0 -8
- package/dist/esm/api/recommendationClient.js +0 -48
- package/dist/esm/components/Mention/styles.js +0 -50
- package/dist/esm/default-mention-name-resolver/default-mention-name-resolver.js +0 -121
- package/dist/esm/default-mention-name-resolver/graphqlUtils.js +0 -41
- package/dist/types/api/SmartMentionResource.d.ts +0 -63
- package/dist/types/api/SmartMentionTypes.d.ts +0 -81
- package/dist/types/api/extract-react-types/smart-config-props.d.ts +0 -7
- package/dist/types/api/recommendationClient.d.ts +0 -3
- package/dist/types/components/Mention/styles.d.ts +0 -6
- package/dist/types/default-mention-name-resolver/default-mention-name-resolver.d.ts +0 -16
- package/dist/types/default-mention-name-resolver/graphqlUtils.d.ts +0 -14
package/dist/es2019/util/i18n.js
CHANGED
|
@@ -1,22 +1,264 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { FormattedMessage } from 'react-intl';
|
|
3
|
+
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
4
4
|
import { messages } from '../components/i18n';
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
export const propFormatter = messageDescriptor => ({
|
|
6
|
+
values,
|
|
7
|
+
children
|
|
8
|
+
}) => {
|
|
9
|
+
const {
|
|
10
|
+
formatMessage
|
|
11
|
+
} = useIntl();
|
|
12
|
+
const message = formatMessage(messageDescriptor, values);
|
|
13
|
+
|
|
14
|
+
if (typeof children === 'function') {
|
|
15
|
+
return children(message);
|
|
12
16
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export const
|
|
19
|
-
export const
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
17
|
+
|
|
18
|
+
return /*#__PURE__*/React.createElement(FormattedMessage, _extends({
|
|
19
|
+
values: values
|
|
20
|
+
}, messageDescriptor));
|
|
21
|
+
};
|
|
22
|
+
export const UnknownUserError = propFormatter(messages.unknownUserError);
|
|
23
|
+
export const NoAccessWarning = propFormatter(messages.noAccessWarning);
|
|
24
|
+
export const NoAccessLabel = propFormatter(messages.noAccessLabel);
|
|
25
|
+
export const DefaultHeadline = propFormatter(messages.defaultHeadline);
|
|
26
|
+
export const DefaultAdvisedAction = propFormatter(messages.defaultAdvisedAction);
|
|
27
|
+
export const LoginAgain = propFormatter(messages.loginAgain);
|
|
28
|
+
export const DifferentText = propFormatter(messages.differentText);
|
|
29
|
+
export const TeamMentionHighlightTitle = propFormatter(messages.TeamMentionHighlightTitle);
|
|
30
|
+
export const TeamMentionHighlightCloseTooltip = propFormatter(messages.TeamMentionHighlightCloseButtonToolTip);
|
|
31
|
+
export const TeamMentionHighlightDescription = propFormatter(messages.TeamMentionHighlightDescription);
|
|
32
|
+
export const TeamMentionHighlightDescriptionLink = propFormatter(messages.TeamMentionHighlightDescriptionLink);
|
|
33
|
+
/**
|
|
34
|
+
* Tries to get the most specific messages bundle for a given locale.
|
|
35
|
+
*
|
|
36
|
+
* Strategy:
|
|
37
|
+
* 1. Try to find messages with the exact string (i.e. 'fr_FR')
|
|
38
|
+
* 2. If that doesn't work, try to find messages for the country locale (i.e. 'fr')
|
|
39
|
+
* 3. If that doesn't work, return english messages as a fallback.
|
|
40
|
+
*
|
|
41
|
+
* @param locale string specifying the locale like 'en_GB', or 'fr'.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
export const getMessagesForLocale = async locale => {
|
|
45
|
+
switch (locale) {
|
|
46
|
+
case 'cs':
|
|
47
|
+
{
|
|
48
|
+
return import(
|
|
49
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-cs" */
|
|
50
|
+
'../i18n/cs').then(mod => mod.default);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
case 'da':
|
|
54
|
+
{
|
|
55
|
+
return import(
|
|
56
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-da" */
|
|
57
|
+
'../i18n/da').then(mod => mod.default);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
case 'de':
|
|
61
|
+
{
|
|
62
|
+
return import(
|
|
63
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-de" */
|
|
64
|
+
'../i18n/de').then(mod => mod.default);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
case 'en':
|
|
68
|
+
{
|
|
69
|
+
return import(
|
|
70
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-en" */
|
|
71
|
+
'../i18n/en').then(mod => mod.default);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
case 'en_GB':
|
|
75
|
+
{
|
|
76
|
+
return import(
|
|
77
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-en_GB" */
|
|
78
|
+
'../i18n/en_GB').then(mod => mod.default);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
case 'es':
|
|
82
|
+
{
|
|
83
|
+
return import(
|
|
84
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-es" */
|
|
85
|
+
'../i18n/es').then(mod => mod.default);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
case 'et':
|
|
89
|
+
{
|
|
90
|
+
return import(
|
|
91
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-et" */
|
|
92
|
+
'../i18n/et').then(mod => mod.default);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
case 'fi':
|
|
96
|
+
{
|
|
97
|
+
return import(
|
|
98
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-fi" */
|
|
99
|
+
'../i18n/fi').then(mod => mod.default);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
case 'fr':
|
|
103
|
+
{
|
|
104
|
+
return import(
|
|
105
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-fr" */
|
|
106
|
+
'../i18n/fr').then(mod => mod.default);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
case 'hu':
|
|
110
|
+
{
|
|
111
|
+
return import(
|
|
112
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-hu" */
|
|
113
|
+
'../i18n/hu').then(mod => mod.default);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
case 'is':
|
|
117
|
+
{
|
|
118
|
+
return import(
|
|
119
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-is" */
|
|
120
|
+
'../i18n/is').then(mod => mod.default);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
case 'it':
|
|
124
|
+
{
|
|
125
|
+
return import(
|
|
126
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-it" */
|
|
127
|
+
'../i18n/it').then(mod => mod.default);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
case 'ja':
|
|
131
|
+
{
|
|
132
|
+
return import(
|
|
133
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-ja" */
|
|
134
|
+
'../i18n/ja').then(mod => mod.default);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
case 'ko':
|
|
138
|
+
{
|
|
139
|
+
return import(
|
|
140
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-ko" */
|
|
141
|
+
'../i18n/ko').then(mod => mod.default);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
case 'nb':
|
|
145
|
+
{
|
|
146
|
+
return import(
|
|
147
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-nb" */
|
|
148
|
+
'../i18n/nb').then(mod => mod.default);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
case 'nl':
|
|
152
|
+
{
|
|
153
|
+
return import(
|
|
154
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-nl" */
|
|
155
|
+
'../i18n/nl').then(mod => mod.default);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
case 'pl':
|
|
159
|
+
{
|
|
160
|
+
return import(
|
|
161
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-pl" */
|
|
162
|
+
'../i18n/pl').then(mod => mod.default);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
case 'pt_BR':
|
|
166
|
+
case 'pt-BR':
|
|
167
|
+
{
|
|
168
|
+
return import(
|
|
169
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-pt_BR" */
|
|
170
|
+
'../i18n/pt_BR').then(mod => mod.default);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
case 'pt_PT':
|
|
174
|
+
case 'pt-PT':
|
|
175
|
+
{
|
|
176
|
+
return import(
|
|
177
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-pt_PT" */
|
|
178
|
+
'../i18n/pt_PT').then(mod => mod.default);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
case 'ro':
|
|
182
|
+
{
|
|
183
|
+
return import(
|
|
184
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-ro" */
|
|
185
|
+
'../i18n/ro').then(mod => mod.default);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
case 'ru':
|
|
189
|
+
{
|
|
190
|
+
return import(
|
|
191
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-ru" */
|
|
192
|
+
'../i18n/ru').then(mod => mod.default);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
case 'sk':
|
|
196
|
+
{
|
|
197
|
+
return import(
|
|
198
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-sk" */
|
|
199
|
+
'../i18n/sk').then(mod => mod.default);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
case 'sv':
|
|
203
|
+
{
|
|
204
|
+
return import(
|
|
205
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-sv" */
|
|
206
|
+
'../i18n/sv').then(mod => mod.default);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
case 'th':
|
|
210
|
+
{
|
|
211
|
+
return import(
|
|
212
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-th" */
|
|
213
|
+
'../i18n/th').then(mod => mod.default);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
case 'tr':
|
|
217
|
+
{
|
|
218
|
+
return import(
|
|
219
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-tr" */
|
|
220
|
+
'../i18n/tr').then(mod => mod.default);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
case 'uk':
|
|
224
|
+
{
|
|
225
|
+
return import(
|
|
226
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-uk" */
|
|
227
|
+
'../i18n/uk').then(mod => mod.default);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
case 'vi':
|
|
231
|
+
{
|
|
232
|
+
return import(
|
|
233
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-vi" */
|
|
234
|
+
'../i18n/vi').then(mod => mod.default);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
case 'zh_TW':
|
|
238
|
+
{
|
|
239
|
+
return import(
|
|
240
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-zh_TW" */
|
|
241
|
+
'../i18n/zh_TW').then(mod => mod.default);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
case 'zh':
|
|
245
|
+
{
|
|
246
|
+
return import(
|
|
247
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-zh" */
|
|
248
|
+
'../i18n/zh').then(mod => mod.default);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
default:
|
|
252
|
+
{
|
|
253
|
+
const fragments = locale.split(/[_-]/);
|
|
254
|
+
|
|
255
|
+
if (fragments.length === 2) {
|
|
256
|
+
return getMessagesForLocale(fragments[0]);
|
|
257
|
+
} else {
|
|
258
|
+
return import(
|
|
259
|
+
/* webpackChunkName: "@atlaskit-internal_mention-i18n-en" */
|
|
260
|
+
'../i18n/en').then(mod => mod.default);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
};
|
package/dist/es2019/version.json
CHANGED
|
@@ -7,9 +7,9 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
8
8
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
9
9
|
|
|
10
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
11
|
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
13
|
|
|
14
14
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
15
|
|
|
@@ -588,14 +588,14 @@ export var MentionResource = /*#__PURE__*/function (_AbstractMentionResou) {
|
|
|
588
588
|
|
|
589
589
|
return MentionResource;
|
|
590
590
|
}(AbstractMentionResource);
|
|
591
|
-
export var HttpError = function HttpError(statusCode, statusMessage) {
|
|
591
|
+
export var HttpError = /*#__PURE__*/_createClass(function HttpError(statusCode, statusMessage) {
|
|
592
592
|
_classCallCheck(this, HttpError);
|
|
593
593
|
|
|
594
594
|
this.statusCode = statusCode;
|
|
595
595
|
this.message = statusMessage;
|
|
596
596
|
this.name = 'HttpError';
|
|
597
597
|
this.stack = new Error().stack;
|
|
598
|
-
};
|
|
598
|
+
});
|
|
599
599
|
export var isResolvingMentionProvider = function isResolvingMentionProvider(p) {
|
|
600
600
|
return !!(p && p.supportsMentionNameResolving && p.supportsMentionNameResolving());
|
|
601
601
|
};
|
|
@@ -10,9 +10,9 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
10
10
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
11
11
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
12
12
|
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
14
|
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
16
|
|
|
17
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
18
|
|
|
@@ -16,14 +16,4 @@ export var defaultAttributes = function defaultAttributes(context) {
|
|
|
16
16
|
pickerType: 'mentions',
|
|
17
17
|
source: 'smarts'
|
|
18
18
|
};
|
|
19
|
-
};
|
|
20
|
-
export var getUsersForAnalytics = function getUsersForAnalytics(users) {
|
|
21
|
-
return users ? users.map(function (_ref) {
|
|
22
|
-
var id = _ref.id,
|
|
23
|
-
entityType = _ref.entityType;
|
|
24
|
-
return {
|
|
25
|
-
id: id,
|
|
26
|
-
type: entityType.toLowerCase()
|
|
27
|
-
};
|
|
28
|
-
}) : [];
|
|
29
19
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { lazy } from 'react';
|
|
2
|
+
var AsyncLockCircleIcon = /*#__PURE__*/lazy(function () {
|
|
3
|
+
return import(
|
|
4
|
+
/* webpackChunkName: "@atlaskit-internal_mention/LockCircleIcon" */
|
|
5
|
+
'@atlaskit/icon/glyph/lock-circle').then(function (module) {
|
|
6
|
+
return {
|
|
7
|
+
default: module.default
|
|
8
|
+
};
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
export default AsyncLockCircleIcon;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
+
var _excluded = ["mentionType"];
|
|
6
|
+
|
|
7
|
+
var _mentionStyle, _templateObject;
|
|
8
|
+
|
|
9
|
+
/** @jsx jsx */
|
|
10
|
+
import { jsx, css } from '@emotion/core';
|
|
11
|
+
import { themed, useGlobalTheme } from '@atlaskit/theme/components';
|
|
12
|
+
import { B400, B200, N500, DN800, DN100, DN80, N30A, DN30, N20 } from '@atlaskit/theme/colors';
|
|
13
|
+
import { token } from '@atlaskit/tokens';
|
|
14
|
+
import { MentionType } from '../../types';
|
|
15
|
+
import { forwardRef } from 'react';
|
|
16
|
+
var mentionStyle = (_mentionStyle = {}, _defineProperty(_mentionStyle, MentionType.SELF, {
|
|
17
|
+
background: themed({
|
|
18
|
+
light: token('color.background.brand.bold', B400),
|
|
19
|
+
dark: token('color.background.brand.bold', B200)
|
|
20
|
+
}),
|
|
21
|
+
borderColor: 'transparent',
|
|
22
|
+
text: themed({
|
|
23
|
+
light: token('color.text.inverse', N20),
|
|
24
|
+
dark: token('color.text.inverse', DN30)
|
|
25
|
+
}),
|
|
26
|
+
hoveredBackground: themed({
|
|
27
|
+
light: token('color.background.brand.bold.hovered', B400),
|
|
28
|
+
dark: token('color.background.brand.bold.hovered', B200)
|
|
29
|
+
}),
|
|
30
|
+
pressedBackground: themed({
|
|
31
|
+
light: token('color.background.brand.bold.pressed', B400),
|
|
32
|
+
dark: token('color.background.brand.bold.pressed', B200)
|
|
33
|
+
})
|
|
34
|
+
}), _defineProperty(_mentionStyle, MentionType.RESTRICTED, {
|
|
35
|
+
background: 'transparent',
|
|
36
|
+
borderColor: themed({
|
|
37
|
+
light: token('color.border', N500),
|
|
38
|
+
dark: token('color.border', DN80)
|
|
39
|
+
}),
|
|
40
|
+
text: themed({
|
|
41
|
+
light: token('color.text.disabled', N500),
|
|
42
|
+
dark: token('color.text.disabled', DN100)
|
|
43
|
+
}),
|
|
44
|
+
hoveredBackground: 'transparent',
|
|
45
|
+
pressedBackground: 'transparent'
|
|
46
|
+
}), _defineProperty(_mentionStyle, MentionType.DEFAULT, {
|
|
47
|
+
background: themed({
|
|
48
|
+
light: token('color.background.neutral', N30A),
|
|
49
|
+
dark: token('color.background.neutral', DN80)
|
|
50
|
+
}),
|
|
51
|
+
borderColor: 'transparent',
|
|
52
|
+
text: themed({
|
|
53
|
+
light: token('color.text.subtle', N500),
|
|
54
|
+
dark: token('color.text.subtle', DN800)
|
|
55
|
+
}),
|
|
56
|
+
hoveredBackground: themed({
|
|
57
|
+
light: token('color.background.neutral.hovered', N30A),
|
|
58
|
+
dark: token('color.background.neutral.hovered', DN80)
|
|
59
|
+
}),
|
|
60
|
+
pressedBackground: themed({
|
|
61
|
+
light: token('color.background.neutral.pressed', N30A),
|
|
62
|
+
dark: token('color.background.neutral.pressed', DN80)
|
|
63
|
+
})
|
|
64
|
+
}), _mentionStyle);
|
|
65
|
+
|
|
66
|
+
var getStyle = function getStyle(_ref, property) {
|
|
67
|
+
var mentionType = _ref.mentionType,
|
|
68
|
+
theme = _ref.theme;
|
|
69
|
+
var obj = mentionStyle[mentionType][property];
|
|
70
|
+
return typeof obj === 'string' ? obj : obj({
|
|
71
|
+
theme: theme
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
var PrimitiveMention = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
76
|
+
var mentionType = _ref2.mentionType,
|
|
77
|
+
other = _objectWithoutProperties(_ref2, _excluded);
|
|
78
|
+
|
|
79
|
+
var theme = useGlobalTheme();
|
|
80
|
+
return jsx("span", _extends({
|
|
81
|
+
ref: ref,
|
|
82
|
+
css: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline;\n border: 1px solid ", ";\n background: ", ";\n color: ", ";\n border-radius: 20px;\n cursor: pointer;\n padding: 0 0.3em 2px 0.23em;\n line-height: 1.714;\n font-size: 1em;\n font-weight: normal;\n word-break: break-word;\n &:hover {\n background: ", ";\n }\n &:active {\n background: ", ";\n }\n "])), getStyle({
|
|
83
|
+
theme: theme,
|
|
84
|
+
mentionType: mentionType
|
|
85
|
+
}, 'borderColor'), getStyle({
|
|
86
|
+
theme: theme,
|
|
87
|
+
mentionType: mentionType
|
|
88
|
+
}, 'background'), getStyle({
|
|
89
|
+
theme: theme,
|
|
90
|
+
mentionType: mentionType
|
|
91
|
+
}, 'text'), getStyle({
|
|
92
|
+
theme: theme,
|
|
93
|
+
mentionType: mentionType
|
|
94
|
+
}, 'hoveredBackground'), getStyle({
|
|
95
|
+
theme: theme,
|
|
96
|
+
mentionType: mentionType
|
|
97
|
+
}, 'pressedBackground'))
|
|
98
|
+
}, other));
|
|
99
|
+
});
|
|
100
|
+
export default PrimitiveMention;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
3
|
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
@@ -12,13 +11,14 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
12
|
|
|
14
13
|
import React from 'react';
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
14
|
+
import FocusRing from '@atlaskit/focus-ring';
|
|
15
|
+
import MessagesIntlProvider from '../MessagesIntlProvider';
|
|
16
|
+
import PrimitiveMention from './PrimitiveMention';
|
|
17
|
+
import AsyncNoAccessTooltip from '../NoAccessTooltip';
|
|
18
18
|
import { isRestricted, MentionType } from '../../types';
|
|
19
19
|
import { fireAnalyticsMentionEvent } from '../../util/analytics';
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
20
|
+
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
21
|
+
import { UnknownUserError } from '../../util/i18n';
|
|
22
22
|
export var ANALYTICS_HOVER_DELAY = 1000;
|
|
23
23
|
export var UNKNOWN_USER_ID = '_|unknown|_';
|
|
24
24
|
export var MentionInternal = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -112,12 +112,12 @@ export var MentionInternal = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
112
112
|
}, {
|
|
113
113
|
key: "renderUnknownUserError",
|
|
114
114
|
value: function renderUnknownUserError(id) {
|
|
115
|
-
return /*#__PURE__*/React.createElement(
|
|
115
|
+
return /*#__PURE__*/React.createElement(UnknownUserError, {
|
|
116
116
|
values: {
|
|
117
117
|
userId: id.slice(-5)
|
|
118
118
|
}
|
|
119
|
-
}
|
|
120
|
-
return "@".concat(message);
|
|
119
|
+
}, function (message) {
|
|
120
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, "@".concat(message));
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
}, {
|
|
@@ -132,19 +132,22 @@ export var MentionInternal = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
132
132
|
accessLevel = props.accessLevel;
|
|
133
133
|
var mentionType = this.getMentionType();
|
|
134
134
|
var failedMention = text === "@".concat(UNKNOWN_USER_ID);
|
|
135
|
-
var mentionComponent = /*#__PURE__*/React.createElement(
|
|
135
|
+
var mentionComponent = /*#__PURE__*/React.createElement(FocusRing, null, /*#__PURE__*/React.createElement(PrimitiveMention, {
|
|
136
136
|
mentionType: mentionType,
|
|
137
137
|
onClick: handleOnClick,
|
|
138
138
|
onMouseEnter: handleOnMouseEnter,
|
|
139
|
-
onMouseLeave: handleOnMouseLeave
|
|
140
|
-
|
|
139
|
+
onMouseLeave: handleOnMouseLeave,
|
|
140
|
+
spellCheck: false
|
|
141
|
+
}, failedMention ? this.renderUnknownUserError(id) : text || '@...'));
|
|
141
142
|
return /*#__PURE__*/React.createElement("span", {
|
|
142
143
|
"data-mention-id": id,
|
|
143
144
|
"data-access-level": accessLevel,
|
|
144
145
|
spellCheck: false
|
|
145
|
-
}, mentionType === MentionType.RESTRICTED ? /*#__PURE__*/React.createElement(
|
|
146
|
+
}, /*#__PURE__*/React.createElement(MessagesIntlProvider, null, mentionType === MentionType.RESTRICTED ? /*#__PURE__*/React.createElement(React.Suspense, {
|
|
147
|
+
fallback: mentionComponent
|
|
148
|
+
}, /*#__PURE__*/React.createElement(AsyncNoAccessTooltip, {
|
|
146
149
|
name: text
|
|
147
|
-
}, mentionComponent) : mentionComponent);
|
|
150
|
+
}, mentionComponent)) : mentionComponent));
|
|
148
151
|
}
|
|
149
152
|
}]);
|
|
150
153
|
|
|
@@ -12,7 +12,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
13
|
|
|
14
14
|
import React from 'react';
|
|
15
|
-
import { FormattedMessage } from 'react-intl';
|
|
15
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
16
16
|
import { DescriptionBylineStyle } from './styles';
|
|
17
17
|
import { messages } from '../i18n';
|
|
18
18
|
|
|
@@ -2,8 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import styled from 'styled
|
|
6
|
-
// prettier-ignore
|
|
7
|
-
|
|
5
|
+
import styled from '@emotion/styled';
|
|
8
6
|
import { N100 } from '@atlaskit/theme/colors';
|
|
9
|
-
|
|
7
|
+
import { token } from '@atlaskit/tokens';
|
|
8
|
+
export var DescriptionBylineStyle = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 12px;\n\n margin-top: 2px;\n\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])), token('color.text.subtlest', N100));
|
|
@@ -12,17 +12,19 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
13
|
|
|
14
14
|
import Avatar from '@atlaskit/avatar';
|
|
15
|
-
import LockCircleIcon from '@atlaskit/icon/glyph/lock-circle';
|
|
16
15
|
import Lozenge from '@atlaskit/lozenge';
|
|
17
16
|
import { N30 } from '@atlaskit/theme/colors';
|
|
18
17
|
import React from 'react';
|
|
18
|
+
import { token } from '@atlaskit/tokens';
|
|
19
19
|
import { isRestricted } from '../../types';
|
|
20
20
|
import { NoAccessLabel } from '../../util/i18n';
|
|
21
21
|
import { leftClick } from '../../util/mouse';
|
|
22
|
-
import
|
|
22
|
+
import AsyncNoAccessTooltip from '../NoAccessTooltip';
|
|
23
|
+
import AsyncLockCircleIcon from '../LockCircleIcon';
|
|
23
24
|
import { AccessSectionStyle, AvatarStyle, FullNameStyle, InfoSectionStyle, MentionItemStyle, NameSectionStyle, RowStyle, TimeStyle } from './styles';
|
|
24
25
|
import { renderHighlight } from './MentionHighlightHelpers';
|
|
25
26
|
import MentionDescriptionByline from '../MentionDescriptionByline';
|
|
27
|
+
import MessagesIntlProvider from '../MessagesIntlProvider';
|
|
26
28
|
export { MENTION_ITEM_HEIGHT } from './styles';
|
|
27
29
|
|
|
28
30
|
function renderLozenge(lozenge) {
|
|
@@ -109,8 +111,8 @@ var MentionItem = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
109
111
|
|
|
110
112
|
var restricted = isRestricted(accessLevel);
|
|
111
113
|
var nameHighlights = highlight && highlight.name;
|
|
112
|
-
var borderColor = selected ? N30 : undefined;
|
|
113
|
-
return /*#__PURE__*/React.createElement(MentionItemStyle, {
|
|
114
|
+
var borderColor = selected ? token('color.border', N30) : undefined;
|
|
115
|
+
return /*#__PURE__*/React.createElement(MessagesIntlProvider, null, /*#__PURE__*/React.createElement(MentionItemStyle, {
|
|
114
116
|
selected: selected,
|
|
115
117
|
onMouseDown: this.onMentionSelected,
|
|
116
118
|
onMouseMove: this.onMentionMenuItemMouseMove,
|
|
@@ -130,15 +132,17 @@ var MentionItem = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
130
132
|
mention: mention
|
|
131
133
|
})), /*#__PURE__*/React.createElement(InfoSectionStyle, {
|
|
132
134
|
restricted: restricted
|
|
133
|
-
}, renderLozenge(lozenge), renderTime(time)), restricted ? /*#__PURE__*/React.createElement(
|
|
135
|
+
}, renderLozenge(lozenge), renderTime(time)), restricted ? /*#__PURE__*/React.createElement(React.Suspense, {
|
|
136
|
+
fallback: null
|
|
137
|
+
}, /*#__PURE__*/React.createElement(AsyncNoAccessTooltip, {
|
|
134
138
|
name: name
|
|
135
139
|
}, /*#__PURE__*/React.createElement(AccessSectionStyle, null, /*#__PURE__*/React.createElement(NoAccessLabel, null, function (text) {
|
|
136
|
-
return /*#__PURE__*/React.createElement(
|
|
140
|
+
return /*#__PURE__*/React.createElement(AsyncLockCircleIcon, {
|
|
137
141
|
label: text
|
|
138
142
|
});
|
|
139
143
|
}
|
|
140
144
|
/* safe to cast to string given there is no value binding */
|
|
141
|
-
))) : null));
|
|
145
|
+
)))) : null)));
|
|
142
146
|
}
|
|
143
147
|
}]);
|
|
144
148
|
|
|
@@ -2,10 +2,9 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
4
4
|
|
|
5
|
-
import styled from 'styled
|
|
6
|
-
// prettier-ignore
|
|
7
|
-
|
|
5
|
+
import styled from '@emotion/styled';
|
|
8
6
|
import { N900, N100, N30, N500 } from '@atlaskit/theme/colors';
|
|
7
|
+
import { token } from '@atlaskit/tokens';
|
|
9
8
|
export var RowStyle = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n align-items: center;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n overflow: hidden;\n padding: 6px 14px;\n text-overflow: ellipsis;\n vertical-align: middle;\n"])));
|
|
10
9
|
export var AvatarStyle = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n flex: initial;\n opacity: ", ";\n"])), function (props) {
|
|
11
10
|
return props.restricted ? '0.5' : 'inherit';
|
|
@@ -13,13 +12,13 @@ export var AvatarStyle = styled.span(_templateObject2 || (_templateObject2 = _ta
|
|
|
13
12
|
export var NameSectionStyle = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex: 1;\n min-width: 0;\n margin-left: 14px;\n opacity: ", ";\n"])), function (props) {
|
|
14
13
|
return props.restricted ? '0.5' : 'inherit';
|
|
15
14
|
});
|
|
16
|
-
export var FullNameStyle = styled.span(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: ", ";\n"])), N900);
|
|
15
|
+
export var FullNameStyle = styled.span(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: ", ";\n"])), token('color.text', N900));
|
|
17
16
|
export var InfoSectionStyle = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n text-align: right;\n opacity: ", ";\n\n & {\n /* Lozenge */\n & > span {\n margin-bottom: 2px;\n }\n }\n"])), function (props) {
|
|
18
17
|
return props.restricted ? '0.5' : 'inherit';
|
|
19
18
|
});
|
|
20
|
-
export var TimeStyle = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-left: 20px;\n flex: none;\n color: ", ";\n font-size: 12px;\n"])), N100);
|
|
19
|
+
export var TimeStyle = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-left: 20px;\n flex: none;\n color: ", ";\n font-size: 12px;\n"])), token('color.text.subtlest', N100));
|
|
21
20
|
export var MENTION_ITEM_HEIGHT = 48;
|
|
22
21
|
export var MentionItemStyle = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n background-color: ", ";\n display: block;\n overflow: hidden;\n list-style-type: none;\n height: ", "px;\n line-height: 1.2;\n cursor: pointer;\n"])), function (props) {
|
|
23
|
-
return props.selected ? N30 : 'transparent';
|
|
22
|
+
return props.selected ? token('color.background.brand', N30) : 'transparent';
|
|
24
23
|
}, MENTION_ITEM_HEIGHT);
|
|
25
|
-
export var AccessSectionStyle = styled.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n padding-left: 5px;\n color: ", ";\n"])), N500);
|
|
24
|
+
export var AccessSectionStyle = styled.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n padding-left: 5px;\n color: ", ";\n"])), token('color.text.subtle', N500));
|