@atlaskit/mention 19.9.6 → 20.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 +18 -0
- package/dist/cjs/api/MentionResource.js +4 -6
- package/dist/cjs/api/SmartMentionResource.js +2 -2
- package/dist/cjs/api/TeamMentionResource.js +2 -2
- 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/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/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/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/SmartMentionResource.js +2 -2
- package/dist/esm/api/TeamMentionResource.js +2 -2
- 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/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/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/shared-styles.d.ts +2 -2
- package/dist/types/util/i18n.d.ts +32 -17
- package/package.json +22 -11
- package/dist/cjs/components/Mention/styles.js +0 -66
- package/dist/es2019/components/Mention/styles.js +0 -61
- package/dist/esm/components/Mention/styles.js +0 -50
- package/dist/types/components/Mention/styles.d.ts +0 -6
|
@@ -7,9 +7,9 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
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
|
|
|
@@ -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
|
|
|
@@ -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));
|
|
@@ -15,6 +15,7 @@ import debug from '../../util/logger';
|
|
|
15
15
|
import { actualMouseMove, mouseLocation } from '../../util/mouse';
|
|
16
16
|
import MentionItem from '../MentionItem';
|
|
17
17
|
import MentionListError from '../MentionListError';
|
|
18
|
+
import MessagesIntlProvider from '../MessagesIntlProvider';
|
|
18
19
|
import Scrollable from '../Scrollable';
|
|
19
20
|
import { MentionListStyle } from './styles';
|
|
20
21
|
|
|
@@ -269,9 +270,9 @@ var MentionList = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
269
270
|
}, this.renderItems());
|
|
270
271
|
}
|
|
271
272
|
|
|
272
|
-
return /*#__PURE__*/React.createElement(MentionListStyle, {
|
|
273
|
+
return /*#__PURE__*/React.createElement(MessagesIntlProvider, null, /*#__PURE__*/React.createElement(MentionListStyle, {
|
|
273
274
|
empty: !hasMentions && !resourceError
|
|
274
|
-
}, errorSection, resultSection);
|
|
275
|
+
}, errorSection, resultSection));
|
|
275
276
|
}
|
|
276
277
|
}]);
|
|
277
278
|
|
|
@@ -2,10 +2,9 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import styled from 'styled
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import styled from '@emotion/styled';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
8
7
|
import { mentionListWidth, noDialogContainerBorderColor, noDialogContainerBorderRadius, noDialogContainerBoxShadow } from '../../shared-styles';
|
|
9
|
-
export var MentionListStyle = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: ", ";\n\n /* list style */\n width: ", ";\n color:
|
|
8
|
+
export var MentionListStyle = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: ", ";\n\n /* list style */\n width: ", ";\n color: ", ";\n\n border: 1px solid ", ";\n border-radius: ", ";\n box-shadow: ", ";\n"])), function (props) {
|
|
10
9
|
return props.empty ? 'none' : 'block';
|
|
11
|
-
}, mentionListWidth, noDialogContainerBorderColor, noDialogContainerBorderRadius, noDialogContainerBoxShadow);
|
|
10
|
+
}, mentionListWidth, token('color.text.subtle', '#333'), noDialogContainerBorderColor, noDialogContainerBorderRadius, noDialogContainerBoxShadow);
|
|
@@ -8,6 +8,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
8
8
|
|
|
9
9
|
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; } }
|
|
10
10
|
|
|
11
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
11
12
|
import React from 'react';
|
|
12
13
|
import { GenericErrorVisualStyle } from './styles';
|
|
13
14
|
export var GenericErrorIllustration = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -2,13 +2,12 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
4
4
|
|
|
5
|
-
import styled from 'styled
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import styled from '@emotion/styled';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
8
7
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
9
8
|
import { N500 } from '@atlaskit/theme/colors';
|
|
10
9
|
import { h400 } from '@atlaskit/theme/typography';
|
|
11
|
-
export var MentionListErrorStyle = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n align-items: center;\n display: flex;\n justify-content: center;\n flex-direction: column;\n background-color:
|
|
10
|
+
export var MentionListErrorStyle = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n align-items: center;\n display: flex;\n justify-content: center;\n flex-direction: column;\n background-color: ", ";\n color: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n"])), token('elevation.surface.overlay', 'white'), token('color.text.subtle', N500), token('elevation.surface.overlay', '#fff'), borderRadius());
|
|
12
11
|
export var GenericErrorVisualStyle = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: 108px;\n margin-bottom: 8px;\n margin-top: 36px;\n width: 83px;\n"]))); // TODO: Figure out why the themed css function is causing type errors when passed prop children
|
|
13
12
|
|
|
14
13
|
export var MentionListErrorHeadlineStyle = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", ";\n margin-bottom: 8px;\n"])), h400());
|
|
@@ -10,8 +10,9 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
10
|
|
|
11
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; } }
|
|
12
12
|
|
|
13
|
-
import
|
|
13
|
+
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import React from 'react';
|
|
15
|
+
import { IntlProvider, injectIntl } from 'react-intl-next';
|
|
15
16
|
import { fireAnalyticsMentionTypeaheadEvent } from '../../util/analytics';
|
|
16
17
|
import uniqueId from '../../util/id';
|
|
17
18
|
import debug from '../../util/logger';
|
|
@@ -200,7 +201,8 @@ export var MentionPicker = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
200
201
|
zIndex = _this$props.zIndex,
|
|
201
202
|
offsetX = _this$props.offsetX,
|
|
202
203
|
offsetY = _this$props.offsetY,
|
|
203
|
-
showTeamMentionsHighlight = _this$props.showTeamMentionsHighlight
|
|
204
|
+
showTeamMentionsHighlight = _this$props.showTeamMentionsHighlight,
|
|
205
|
+
intl = _this$props.intl;
|
|
204
206
|
var _this$state = this.state,
|
|
205
207
|
visible = _this$state.visible,
|
|
206
208
|
info = _this$state.info;
|
|
@@ -226,7 +228,9 @@ export var MentionPicker = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
226
228
|
zIndex: zIndex,
|
|
227
229
|
offsetX: offsetX,
|
|
228
230
|
offsetY: offsetY
|
|
229
|
-
}, /*#__PURE__*/React.createElement(
|
|
231
|
+
}, /*#__PURE__*/React.createElement(IntlProvider, {
|
|
232
|
+
locale: (intl === null || intl === void 0 ? void 0 : intl.locale) || 'en'
|
|
233
|
+
}, /*#__PURE__*/React.createElement("div", null, resourceMentionList, infoContent)));
|
|
230
234
|
} else {
|
|
231
235
|
// don't show if we have a position, but no target yet
|
|
232
236
|
content = null;
|
|
@@ -256,5 +260,8 @@ _defineProperty(MentionPicker, "defaultProps", {
|
|
|
256
260
|
onClose: function onClose() {}
|
|
257
261
|
});
|
|
258
262
|
|
|
259
|
-
|
|
263
|
+
var MentionPickerWithIntl = injectIntl(MentionPicker, {
|
|
264
|
+
forwardRef: true
|
|
265
|
+
});
|
|
266
|
+
export var MentionPickerWithAnalytics = withAnalyticsEvents({})(MentionPickerWithIntl);
|
|
260
267
|
export default MentionPickerWithAnalytics;
|
|
@@ -2,12 +2,11 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject, _templateObject2;
|
|
4
4
|
|
|
5
|
-
import styled from 'styled
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import styled from '@emotion/styled';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
8
7
|
import { N100 } from '@atlaskit/theme/colors';
|
|
9
8
|
import { mentionListWidth, noDialogContainerBorderColor, noDialogContainerBorderRadius, noDialogContainerBoxShadow } from '../../shared-styles';
|
|
10
9
|
export var MentionPickerStyle = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: ", ";\n"])), function (props) {
|
|
11
10
|
return props.visible ? 'block' : 'none';
|
|
12
11
|
});
|
|
13
|
-
export var MentionPickerInfoStyle = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background:
|
|
12
|
+
export var MentionPickerInfoStyle = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n color: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n box-shadow: ", ";\n display: block;\n width: ", ";\n white-space: nowrap;\n\n & {\n p {\n margin: 0;\n overflow: hidden;\n padding: 9px;\n text-overflow: ellipsis;\n }\n }\n"])), token('elevation.surface', '#fff'), token('color.text.subtlest', N100), noDialogContainerBorderColor, noDialogContainerBorderRadius, noDialogContainerBoxShadow, mentionListWidth);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { IntlProvider, useIntl } from 'react-intl-next';
|
|
5
|
+
import { getMessagesForLocale } from '../../util/i18n';
|
|
6
|
+
var EMPTY = {};
|
|
7
|
+
|
|
8
|
+
var useI18n = function useI18n(locale) {
|
|
9
|
+
var _React$useState = React.useState(EMPTY),
|
|
10
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
11
|
+
messages = _React$useState2[0],
|
|
12
|
+
setMessages = _React$useState2[1];
|
|
13
|
+
|
|
14
|
+
React.useEffect(function () {
|
|
15
|
+
var aborted = false;
|
|
16
|
+
setMessages(EMPTY);
|
|
17
|
+
getMessagesForLocale(locale).then(function (messages) {
|
|
18
|
+
if (!aborted) {
|
|
19
|
+
setMessages(messages);
|
|
20
|
+
}
|
|
21
|
+
}).catch(function (error) {
|
|
22
|
+
// eslint-disable-next-line no-console
|
|
23
|
+
console.error(error);
|
|
24
|
+
});
|
|
25
|
+
return function () {
|
|
26
|
+
aborted = true;
|
|
27
|
+
};
|
|
28
|
+
}, [locale]);
|
|
29
|
+
return messages;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var MessagesIntlProvider = function MessagesIntlProvider(props) {
|
|
33
|
+
var children = props.children;
|
|
34
|
+
var intl = useIntl();
|
|
35
|
+
var messages = useI18n(intl.locale);
|
|
36
|
+
return /*#__PURE__*/React.createElement(IntlProvider, _extends({}, intl, {
|
|
37
|
+
messages: messages
|
|
38
|
+
}), children);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default MessagesIntlProvider;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
var AsyncNoAccessTooltip = /*#__PURE__*/React.lazy(function () {
|
|
3
|
+
return import(
|
|
4
|
+
/* webpackChunkName: "@atlaskit-internal_@atlaskit/mention/no-access-tooltip" */
|
|
5
|
+
'./main').then(function (module) {
|
|
6
|
+
return {
|
|
7
|
+
default: module.NoAccessTooltip
|
|
8
|
+
};
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
export default AsyncNoAccessTooltip;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import Tooltip from '@atlaskit/tooltip';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { NoAccessWarning } from '
|
|
3
|
+
import { NoAccessWarning } from '../../util/i18n';
|
|
4
4
|
export var NoAccessTooltip = function NoAccessTooltip(_ref) {
|
|
5
5
|
var name = _ref.name,
|
|
6
6
|
children = _ref.children;
|
|
7
7
|
return /*#__PURE__*/React.createElement(NoAccessWarning, {
|
|
8
|
-
|
|
8
|
+
values: {
|
|
9
|
+
name: name
|
|
10
|
+
}
|
|
9
11
|
}, function (text) {
|
|
10
12
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
11
13
|
content: text,
|
|
@@ -10,16 +10,16 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
10
|
|
|
11
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; } }
|
|
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
|
-
import React from 'react';
|
|
17
|
+
import React, { Suspense } from 'react';
|
|
18
18
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
19
19
|
import uniqueId from '../../util/id';
|
|
20
20
|
import debug from '../../util/logger';
|
|
21
21
|
import MentionList from '../MentionList';
|
|
22
|
-
import
|
|
22
|
+
import { LazyTeamMentionHighlight } from '../TeamMentionHighlight/lazy';
|
|
23
23
|
import TeamMentionHighlightController from '../TeamMentionHighlight/TeamMentionHighlightController';
|
|
24
24
|
import { fireSliAnalyticsEvent, SLI_EVENT_TYPE } from '../../util/analytics';
|
|
25
25
|
|
|
@@ -166,10 +166,12 @@ export var ResourcedMentionListWithoutAnalytics = /*#__PURE__*/function (_React$
|
|
|
166
166
|
return null;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
return /*#__PURE__*/React.createElement(
|
|
169
|
+
return /*#__PURE__*/React.createElement(Suspense, {
|
|
170
|
+
fallback: null
|
|
171
|
+
}, /*#__PURE__*/React.createElement(LazyTeamMentionHighlight, {
|
|
170
172
|
createTeamLink: createTeamPath,
|
|
171
173
|
onClose: _this.closeHighlight
|
|
172
|
-
});
|
|
174
|
+
}));
|
|
173
175
|
});
|
|
174
176
|
|
|
175
177
|
_this.subscriberKey = uniqueId('ak-resourced-mention-list');
|
|
@@ -58,7 +58,7 @@ var Scrollable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
58
58
|
key: "render",
|
|
59
59
|
value: function render() {
|
|
60
60
|
return /*#__PURE__*/React.createElement(ScrollableStyle, {
|
|
61
|
-
|
|
61
|
+
ref: this.handleRef
|
|
62
62
|
}, this.props.children);
|
|
63
63
|
}
|
|
64
64
|
}]);
|
|
@@ -2,9 +2,8 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import styled from 'styled
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import styled from '@emotion/styled';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
8
7
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
9
8
|
import { scrollableMaxHeight } from '../../shared-styles';
|
|
10
|
-
export var ScrollableStyle = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n overflow-x: hidden;\n overflow-y: auto;\n\n padding: 4px 0;\n margin: 0;\n\n background:
|
|
9
|
+
export var ScrollableStyle = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n overflow-x: hidden;\n overflow-y: auto;\n\n padding: 4px 0;\n margin: 0;\n\n background: ", ";\n max-height: ", ";\n\n border-radius: ", "px;\n"])), token('elevation.surface', 'white'), scrollableMaxHeight, borderRadius());
|
|
@@ -11,7 +11,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
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; } }
|
|
12
12
|
|
|
13
13
|
import React from 'react';
|
|
14
|
-
import
|
|
14
|
+
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
15
15
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
16
16
|
import EditorCloseIcon from '@atlaskit/icon/glyph/editor/close';
|
|
17
17
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -19,6 +19,7 @@ import TeamMentionHighlightController from './TeamMentionHighlightController';
|
|
|
19
19
|
import { fireAnalyticsTeamMentionHighlightEvent, ComponentNames, Actions } from '../../util/analytics';
|
|
20
20
|
import { TeamMentionHighlightTitle, TeamMentionHighlightCloseTooltip, TeamMentionHighlightDescription, TeamMentionHighlightDescriptionLink } from '../../util/i18n';
|
|
21
21
|
import * as Styled from './styles';
|
|
22
|
+
import MessagesIntlProvider from '../MessagesIntlProvider';
|
|
22
23
|
var ICON_URL = 'data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIHdpZHRoPSIxMjgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGN4PSI2NCIgY3k9IjY0IiBmaWxsPSIjNTI0M2FhIiBmaWxsLXJ1bGU9Im5vbnplcm8iIHI9IjY0Ii8+PHBhdGggZD0ibTgwIDY0Yy02LjYyNzQxNyAwLTEyLTUuMzcyNTgzLTEyLTEyczUuMzcyNTgzLTEyIDEyLTEyIDEyIDUuMzcyNTgzIDEyIDEyLTUuMzcyNTgzIDEyLTEyIDEyem0tMzItMTJjLTYuNjI3NDE3IDAtMTItNS4zNzI1ODMtMTItMTJzNS4zNzI1ODMtMTIgMTItMTIgMTIgNS4zNzI1ODMgMTIgMTItNS4zNzI1ODMgMTItMTIgMTJ6bTEyIDI0YzAtNC40MiAzLjU0OC04IDgtOGgyNGM0LjQyIDAgOCAzLjU0IDggOHYxNC45MmMwIDEyLjEwOC00MCAxMi4xMDgtNDAgMHptOC0xMmgtLjAxMmMtMy4xODQzNTM3LjAwNDI0LTYuMjM2NTQxIDEuMjczNTYxNS04LjQ4NDg0MjcgMy41Mjg2MTQ5LTIuMjQ4MzAxOCAyLjI1NTA1MzQtMy41MDg0NjU2IDUuMzExMDMzLTMuNTAzMTU3MyA4LjQ5NTM4NTF2MTEuMjI4Yy0xMS43ODQgMi4xMzYtMjgtLjI1Mi0yOC03LjkzNnYtMTUuMzA0YzAtNC40MjQgMy41NDgtOC4wMTIgOC04LjAxMmgyNGMyLjEyMjcwODYtLjAwMzE5MTIgNC4xNTkzOTQ2LjgzODYzODYgNS42NjAzNzggMi4zMzk2MjJzMi4zNDI4MTMyIDMuNTM3NjY5NCAyLjMzOTYyMiA1LjY2MDM3OHoiIGZpbGw9IiNmZmYiIGZpbGwtb3BhY2l0eT0iLjk1Ii8+PC9nPjwvc3ZnPg==';
|
|
23
24
|
export var TeamMentionHighlightInternal = /*#__PURE__*/function (_React$Component) {
|
|
24
25
|
_inherits(TeamMentionHighlightInternal, _React$Component);
|
|
@@ -133,7 +134,7 @@ export var TeamMentionHighlightInternal = /*#__PURE__*/function (_React$Componen
|
|
|
133
134
|
return null;
|
|
134
135
|
}
|
|
135
136
|
|
|
136
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
137
|
+
return /*#__PURE__*/React.createElement(MessagesIntlProvider, null, /*#__PURE__*/React.createElement("div", {
|
|
137
138
|
ref: this.elWrapper
|
|
138
139
|
}, /*#__PURE__*/React.createElement(Styled.Card, null, /*#__PURE__*/React.createElement(Styled.Content, null, /*#__PURE__*/React.createElement(Styled.Aside, null, /*#__PURE__*/React.createElement("img", {
|
|
139
140
|
src: ICON_URL,
|
|
@@ -163,7 +164,7 @@ export var TeamMentionHighlightInternal = /*#__PURE__*/function (_React$Componen
|
|
|
163
164
|
spacing: "none" // on click fired by preventClickOnCard, not here
|
|
164
165
|
|
|
165
166
|
}));
|
|
166
|
-
}))))));
|
|
167
|
+
})))))));
|
|
167
168
|
}
|
|
168
169
|
}]);
|
|
169
170
|
|