@atlaskit/mention 23.4.5 → 23.4.7
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 +17 -0
- package/dist/cjs/api/ContextMentionResource.js +1 -2
- package/dist/cjs/api/MentionNameResolver.js +1 -2
- package/dist/cjs/api/MentionResource.js +9 -14
- package/dist/cjs/api/PresenceResource.js +11 -18
- package/dist/cjs/api/TeamMentionResource.js +11 -13
- package/dist/cjs/components/Mention/PrimitiveMention.js +7 -7
- package/dist/cjs/components/Mention/ResourcedMention.js +6 -9
- package/dist/cjs/components/Mention/index.js +9 -12
- package/dist/cjs/components/Mention/ufoExperiences.js +5 -7
- package/dist/cjs/components/MentionDescriptionByline/TeamMentionDescriptionByline.js +7 -10
- package/dist/cjs/components/MentionDescriptionByline/UserMentionDescriptionByline.js +5 -7
- package/dist/cjs/components/MentionDescriptionByline/index.js +5 -7
- package/dist/cjs/components/MentionItem/index.js +8 -11
- package/dist/cjs/components/MentionList/index.js +14 -17
- package/dist/cjs/components/MentionListError/GenericErrorIllustration.js +5 -7
- package/dist/cjs/components/MentionListError/index.js +26 -10
- package/dist/cjs/components/MentionListError/styles.js +2 -29
- package/dist/cjs/components/MentionPicker/index.js +16 -19
- package/dist/cjs/components/Popup/index.js +5 -7
- package/dist/cjs/components/ResourcedMentionList/index.js +17 -20
- package/dist/cjs/components/Scrollable/index.js +7 -10
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/components/Mention/PrimitiveMention.js +1 -1
- package/dist/es2019/components/MentionListError/index.js +21 -3
- package/dist/es2019/components/MentionListError/styles.js +0 -31
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/api/ContextMentionResource.js +1 -2
- package/dist/esm/api/MentionNameResolver.js +1 -2
- package/dist/esm/api/MentionResource.js +9 -14
- package/dist/esm/api/PresenceResource.js +11 -18
- package/dist/esm/api/TeamMentionResource.js +11 -13
- package/dist/esm/components/Mention/PrimitiveMention.js +7 -7
- package/dist/esm/components/Mention/ResourcedMention.js +6 -9
- package/dist/esm/components/Mention/index.js +9 -12
- package/dist/esm/components/Mention/ufoExperiences.js +5 -7
- package/dist/esm/components/MentionDescriptionByline/TeamMentionDescriptionByline.js +7 -10
- package/dist/esm/components/MentionDescriptionByline/UserMentionDescriptionByline.js +5 -7
- package/dist/esm/components/MentionDescriptionByline/index.js +5 -7
- package/dist/esm/components/MentionItem/index.js +8 -11
- package/dist/esm/components/MentionList/index.js +14 -17
- package/dist/esm/components/MentionListError/GenericErrorIllustration.js +5 -7
- package/dist/esm/components/MentionListError/index.js +26 -10
- package/dist/esm/components/MentionListError/styles.js +0 -30
- package/dist/esm/components/MentionPicker/index.js +16 -19
- package/dist/esm/components/Popup/index.js +5 -7
- package/dist/esm/components/ResourcedMentionList/index.js +17 -20
- package/dist/esm/components/Scrollable/index.js +7 -10
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types/components/MentionListError/styles.d.ts +0 -12
- package/dist/types-ts4.5/components/MentionListError/styles.d.ts +0 -12
- package/package.json +1 -1
|
@@ -2,8 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
+
var _templateObject;
|
|
5
6
|
var _excluded = ["mentionType"];
|
|
6
|
-
var _mentionStyle, _templateObject;
|
|
7
7
|
/**
|
|
8
8
|
* @jsxRuntime classic
|
|
9
9
|
* @jsx jsx
|
|
@@ -13,25 +13,25 @@ import { jsx, css } from '@emotion/react';
|
|
|
13
13
|
import { B400, N500, N30A, N20 } from '@atlaskit/theme/colors';
|
|
14
14
|
import { MentionType } from '../../types';
|
|
15
15
|
import { forwardRef } from 'react';
|
|
16
|
-
var mentionStyle = (
|
|
16
|
+
var mentionStyle = _defineProperty(_defineProperty(_defineProperty({}, MentionType.SELF, {
|
|
17
17
|
background: "var(--ds-background-brand-bold, ".concat(B400, ")"),
|
|
18
18
|
borderColor: 'transparent',
|
|
19
19
|
text: "var(--ds-text-inverse, ".concat(N20, ")"),
|
|
20
20
|
hoveredBackground: "var(--ds-background-brand-bold-hovered, ".concat(B400, ")"),
|
|
21
21
|
pressedBackground: "var(--ds-background-brand-bold-pressed, ".concat(B400, ")")
|
|
22
|
-
}),
|
|
22
|
+
}), MentionType.RESTRICTED, {
|
|
23
23
|
background: 'transparent',
|
|
24
24
|
borderColor: "var(--ds-border-bold, ".concat(N500, ")"),
|
|
25
25
|
text: "var(--ds-text, ".concat(N500, ")"),
|
|
26
26
|
hoveredBackground: 'transparent',
|
|
27
27
|
pressedBackground: 'transparent'
|
|
28
|
-
}),
|
|
28
|
+
}), MentionType.DEFAULT, {
|
|
29
29
|
background: "var(--ds-background-neutral, ".concat(N30A, ")"),
|
|
30
30
|
borderColor: 'transparent',
|
|
31
31
|
text: "var(--ds-text-subtle, ".concat(N500, ")"),
|
|
32
32
|
hoveredBackground: "var(--ds-background-neutral-hovered, ".concat(N30A, ")"),
|
|
33
33
|
pressedBackground: "var(--ds-background-neutral-pressed, ".concat(N30A, ")")
|
|
34
|
-
})
|
|
34
|
+
});
|
|
35
35
|
var getStyle = function getStyle(_ref, property) {
|
|
36
36
|
var mentionType = _ref.mentionType;
|
|
37
37
|
var obj = mentionStyle[mentionType][property];
|
|
@@ -44,13 +44,13 @@ var PrimitiveMention = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
44
44
|
ref: ref
|
|
45
45
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
46
46
|
,
|
|
47
|
-
css: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t\t\t\tdisplay: inline;\n\t\t\t\t\tborder: 1px solid ", ";\n\t\t\t\t\tbackground: ", ";\n\t\t\t\t\tcolor: ", ";\n\t\t\t\t\tborder-radius: 20px;\n\t\t\t\t\tcursor: pointer;\n\t\t\t\t\tpadding: 0 0.3em 2px 0.23em;\n\t\t\t\t\tline-height: 1.714;\n\t\t\t\t\tfont-size: 1em;\n\t\t\t\t\tfont-weight:
|
|
47
|
+
css: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t\t\t\tdisplay: inline;\n\t\t\t\t\tborder: 1px solid ", ";\n\t\t\t\t\tbackground: ", ";\n\t\t\t\t\tcolor: ", ";\n\t\t\t\t\tborder-radius: 20px;\n\t\t\t\t\tcursor: pointer;\n\t\t\t\t\tpadding: 0 0.3em 2px 0.23em;\n\t\t\t\t\tline-height: 1.714;\n\t\t\t\t\tfont-size: 1em;\n\t\t\t\t\tfont-weight: ", ";\n\t\t\t\t\tword-break: break-word;\n\t\t\t\t\t&:hover {\n\t\t\t\t\t\tbackground: ", ";\n\t\t\t\t\t}\n\t\t\t\t\t&:active {\n\t\t\t\t\t\tbackground: ", ";\n\t\t\t\t\t}\n\t\t\t\t"])), getStyle({
|
|
48
48
|
mentionType: mentionType
|
|
49
49
|
}, 'borderColor'), getStyle({
|
|
50
50
|
mentionType: mentionType
|
|
51
51
|
}, 'background'), getStyle({
|
|
52
52
|
mentionType: mentionType
|
|
53
|
-
}, 'text'), getStyle({
|
|
53
|
+
}, 'text'), "var(--ds-font-weight-regular, 400)", getStyle({
|
|
54
54
|
mentionType: mentionType
|
|
55
55
|
}, 'hoveredBackground'), getStyle({
|
|
56
56
|
mentionType: mentionType
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
9
|
import React from 'react';
|
|
11
10
|
import { isResolvingMentionProvider } from '../../api/MentionResource';
|
|
@@ -13,13 +12,11 @@ import { isPromise, MentionNameStatus } from '../../types';
|
|
|
13
12
|
import Mention, { UNKNOWN_USER_ID } from './';
|
|
14
13
|
import debug from '../../util/logger';
|
|
15
14
|
var ResourcedMention = /*#__PURE__*/function (_React$PureComponent) {
|
|
16
|
-
_inherits(ResourcedMention, _React$PureComponent);
|
|
17
|
-
var _super = _createSuper(ResourcedMention);
|
|
18
15
|
function ResourcedMention(_props) {
|
|
19
16
|
var _this;
|
|
20
17
|
_classCallCheck(this, ResourcedMention);
|
|
21
|
-
_this =
|
|
22
|
-
_defineProperty(
|
|
18
|
+
_this = _callSuper(this, ResourcedMention, [_props]);
|
|
19
|
+
_defineProperty(_this, "handleMentionProvider", function (props) {
|
|
23
20
|
var id = props.id,
|
|
24
21
|
mentionProvider = props.mentionProvider,
|
|
25
22
|
text = props.text;
|
|
@@ -60,7 +57,8 @@ var ResourcedMention = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
60
57
|
};
|
|
61
58
|
return _this;
|
|
62
59
|
}
|
|
63
|
-
|
|
60
|
+
_inherits(ResourcedMention, _React$PureComponent);
|
|
61
|
+
return _createClass(ResourcedMention, [{
|
|
64
62
|
key: "componentDidMount",
|
|
65
63
|
value: function componentDidMount() {
|
|
66
64
|
this.handleMentionProvider(this.props);
|
|
@@ -121,6 +119,5 @@ var ResourcedMention = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
121
119
|
});
|
|
122
120
|
}
|
|
123
121
|
}]);
|
|
124
|
-
return ResourcedMention;
|
|
125
122
|
}(React.PureComponent);
|
|
126
123
|
export { ResourcedMention as default };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
9
|
import React from 'react';
|
|
11
10
|
import FocusRing from '@atlaskit/focus-ring';
|
|
@@ -21,13 +20,11 @@ import { UfoErrorBoundary, mentionRenderedUfoExperience } from './ufoExperiences
|
|
|
21
20
|
export var ANALYTICS_HOVER_DELAY = 1000;
|
|
22
21
|
export var UNKNOWN_USER_ID = '_|unknown|_';
|
|
23
22
|
export var MentionInternal = /*#__PURE__*/function (_React$PureComponent) {
|
|
24
|
-
_inherits(MentionInternal, _React$PureComponent);
|
|
25
|
-
var _super = _createSuper(MentionInternal);
|
|
26
23
|
function MentionInternal(props) {
|
|
27
24
|
var _this;
|
|
28
25
|
_classCallCheck(this, MentionInternal);
|
|
29
|
-
_this =
|
|
30
|
-
_defineProperty(
|
|
26
|
+
_this = _callSuper(this, MentionInternal, [props]);
|
|
27
|
+
_defineProperty(_this, "handleOnClick", function (e) {
|
|
31
28
|
var _this$props = _this.props,
|
|
32
29
|
id = _this$props.id,
|
|
33
30
|
text = _this$props.text,
|
|
@@ -36,7 +33,7 @@ export var MentionInternal = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
36
33
|
onClick(id, text, e);
|
|
37
34
|
}
|
|
38
35
|
});
|
|
39
|
-
_defineProperty(
|
|
36
|
+
_defineProperty(_this, "handleOnMouseEnter", function (e) {
|
|
40
37
|
var _this$props2 = _this.props,
|
|
41
38
|
id = _this$props2.id,
|
|
42
39
|
text = _this$props2.text,
|
|
@@ -52,7 +49,7 @@ export var MentionInternal = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
52
49
|
_this.hoverTimeout = undefined;
|
|
53
50
|
}, ANALYTICS_HOVER_DELAY);
|
|
54
51
|
});
|
|
55
|
-
_defineProperty(
|
|
52
|
+
_defineProperty(_this, "handleOnMouseLeave", function (e) {
|
|
56
53
|
var _this$props3 = _this.props,
|
|
57
54
|
id = _this$props3.id,
|
|
58
55
|
text = _this$props3.text,
|
|
@@ -64,7 +61,7 @@ export var MentionInternal = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
64
61
|
clearTimeout(_this.hoverTimeout);
|
|
65
62
|
}
|
|
66
63
|
});
|
|
67
|
-
_defineProperty(
|
|
64
|
+
_defineProperty(_this, "getMentionType", function () {
|
|
68
65
|
var _this$props4 = _this.props,
|
|
69
66
|
accessLevel = _this$props4.accessLevel,
|
|
70
67
|
isHighlighted = _this$props4.isHighlighted;
|
|
@@ -79,7 +76,8 @@ export var MentionInternal = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
79
76
|
mentionRenderedUfoExperience.getInstance(props.id).start();
|
|
80
77
|
return _this;
|
|
81
78
|
}
|
|
82
|
-
|
|
79
|
+
_inherits(MentionInternal, _React$PureComponent);
|
|
80
|
+
return _createClass(MentionInternal, [{
|
|
83
81
|
key: "componentDidMount",
|
|
84
82
|
value: function componentDidMount() {
|
|
85
83
|
mentionRenderedUfoExperience.getInstance(this.props.id).success();
|
|
@@ -141,7 +139,6 @@ export var MentionInternal = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
141
139
|
}, mentionComponent)) : mentionComponent)));
|
|
142
140
|
}
|
|
143
141
|
}]);
|
|
144
|
-
return MentionInternal;
|
|
145
142
|
}(React.PureComponent);
|
|
146
143
|
var MentionWithAnalytics = withAnalyticsEvents({
|
|
147
144
|
onClick: function onClick(createEvent, props) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
7
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { ExperiencePerformanceTypes, ExperienceTypes, ConcurrentExperience } from '@atlaskit/ufo';
|
|
@@ -15,13 +15,12 @@ export var mentionRenderedUfoExperience = new ConcurrentExperience('mention-rend
|
|
|
15
15
|
performanceType: ExperiencePerformanceTypes.PageSegmentLoad
|
|
16
16
|
});
|
|
17
17
|
export var UfoErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
18
|
-
_inherits(UfoErrorBoundary, _React$Component);
|
|
19
|
-
var _super = _createSuper(UfoErrorBoundary);
|
|
20
18
|
function UfoErrorBoundary() {
|
|
21
19
|
_classCallCheck(this, UfoErrorBoundary);
|
|
22
|
-
return
|
|
20
|
+
return _callSuper(this, UfoErrorBoundary, arguments);
|
|
23
21
|
}
|
|
24
|
-
|
|
22
|
+
_inherits(UfoErrorBoundary, _React$Component);
|
|
23
|
+
return _createClass(UfoErrorBoundary, [{
|
|
25
24
|
key: "componentDidCatch",
|
|
26
25
|
value: function componentDidCatch() {
|
|
27
26
|
mentionRenderedUfoExperience.getInstance(this.props.id).failure();
|
|
@@ -32,5 +31,4 @@ export var UfoErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
32
31
|
return this.props.children;
|
|
33
32
|
}
|
|
34
33
|
}]);
|
|
35
|
-
return UfoErrorBoundary;
|
|
36
34
|
}(React.Component);
|
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
function
|
|
8
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
10
|
import React from 'react';
|
|
12
11
|
import { FormattedMessage } from 'react-intl-next';
|
|
13
12
|
import { DescriptionBylineStyle } from './styles';
|
|
14
13
|
import { messages } from '../i18n';
|
|
15
14
|
var TeamMentionDescriptionByline = /*#__PURE__*/function (_React$PureComponent) {
|
|
16
|
-
_inherits(TeamMentionDescriptionByline, _React$PureComponent);
|
|
17
|
-
var _super = _createSuper(TeamMentionDescriptionByline);
|
|
18
15
|
function TeamMentionDescriptionByline() {
|
|
19
16
|
var _this;
|
|
20
17
|
_classCallCheck(this, TeamMentionDescriptionByline);
|
|
21
18
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22
19
|
args[_key] = arguments[_key];
|
|
23
20
|
}
|
|
24
|
-
_this =
|
|
25
|
-
_defineProperty(
|
|
21
|
+
_this = _callSuper(this, TeamMentionDescriptionByline, [].concat(args));
|
|
22
|
+
_defineProperty(_this, "renderByline", function (memberCount, includesYou) {
|
|
26
23
|
if (includesYou) {
|
|
27
24
|
if (memberCount > 50) {
|
|
28
25
|
return _this.getBylineComponent( /*#__PURE__*/React.createElement(FormattedMessage, messages.plus50MembersWithYou));
|
|
@@ -43,12 +40,13 @@ var TeamMentionDescriptionByline = /*#__PURE__*/function (_React$PureComponent)
|
|
|
43
40
|
})));
|
|
44
41
|
}
|
|
45
42
|
});
|
|
46
|
-
_defineProperty(
|
|
43
|
+
_defineProperty(_this, "getBylineComponent", function (message) {
|
|
47
44
|
return /*#__PURE__*/React.createElement(DescriptionBylineStyle, null, message);
|
|
48
45
|
});
|
|
49
46
|
return _this;
|
|
50
47
|
}
|
|
51
|
-
|
|
48
|
+
_inherits(TeamMentionDescriptionByline, _React$PureComponent);
|
|
49
|
+
return _createClass(TeamMentionDescriptionByline, [{
|
|
52
50
|
key: "render",
|
|
53
51
|
value: function render() {
|
|
54
52
|
var context = this.props.mention.context;
|
|
@@ -60,6 +58,5 @@ var TeamMentionDescriptionByline = /*#__PURE__*/function (_React$PureComponent)
|
|
|
60
58
|
return this.renderByline(memberCount, includesYou);
|
|
61
59
|
}
|
|
62
60
|
}]);
|
|
63
|
-
return TeamMentionDescriptionByline;
|
|
64
61
|
}(React.PureComponent);
|
|
65
62
|
export { TeamMentionDescriptionByline as default };
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
7
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { renderHighlight } from '../MentionItem/MentionHighlightHelpers';
|
|
10
10
|
import { DescriptionBylineStyle } from './styles';
|
|
11
11
|
var UserMentionDescriptionByline = /*#__PURE__*/function (_React$PureComponent) {
|
|
12
|
-
_inherits(UserMentionDescriptionByline, _React$PureComponent);
|
|
13
|
-
var _super = _createSuper(UserMentionDescriptionByline);
|
|
14
12
|
function UserMentionDescriptionByline() {
|
|
15
13
|
_classCallCheck(this, UserMentionDescriptionByline);
|
|
16
|
-
return
|
|
14
|
+
return _callSuper(this, UserMentionDescriptionByline, arguments);
|
|
17
15
|
}
|
|
18
|
-
|
|
16
|
+
_inherits(UserMentionDescriptionByline, _React$PureComponent);
|
|
17
|
+
return _createClass(UserMentionDescriptionByline, [{
|
|
19
18
|
key: "render",
|
|
20
19
|
value: function render() {
|
|
21
20
|
var _this$props$mention = this.props.mention,
|
|
@@ -29,6 +28,5 @@ var UserMentionDescriptionByline = /*#__PURE__*/function (_React$PureComponent)
|
|
|
29
28
|
return renderHighlight(DescriptionBylineStyle, nickname, nicknameHighlights, '@');
|
|
30
29
|
}
|
|
31
30
|
}]);
|
|
32
|
-
return UserMentionDescriptionByline;
|
|
33
31
|
}(React.PureComponent);
|
|
34
32
|
export { UserMentionDescriptionByline as default };
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
7
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { UserType } from '../../types';
|
|
10
10
|
import UserMentionDescriptionByline from './UserMentionDescriptionByline';
|
|
11
11
|
import TeamMentionDescriptionByline from './TeamMentionDescriptionByline';
|
|
12
12
|
var MentionDescriptionByline = /*#__PURE__*/function (_React$PureComponent) {
|
|
13
|
-
_inherits(MentionDescriptionByline, _React$PureComponent);
|
|
14
|
-
var _super = _createSuper(MentionDescriptionByline);
|
|
15
13
|
function MentionDescriptionByline() {
|
|
16
14
|
_classCallCheck(this, MentionDescriptionByline);
|
|
17
|
-
return
|
|
15
|
+
return _callSuper(this, MentionDescriptionByline, arguments);
|
|
18
16
|
}
|
|
19
|
-
|
|
17
|
+
_inherits(MentionDescriptionByline, _React$PureComponent);
|
|
18
|
+
return _createClass(MentionDescriptionByline, [{
|
|
20
19
|
key: "render",
|
|
21
20
|
value: function render() {
|
|
22
21
|
var userType = this.props.mention.userType;
|
|
@@ -36,6 +35,5 @@ var MentionDescriptionByline = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
}]);
|
|
39
|
-
return MentionDescriptionByline;
|
|
40
38
|
}(React.PureComponent);
|
|
41
39
|
export { MentionDescriptionByline as default };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
7
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
9
|
-
function
|
|
8
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
10
|
import Avatar from '@atlaskit/avatar';
|
|
12
11
|
import Lozenge from '@atlaskit/lozenge';
|
|
@@ -42,35 +41,34 @@ function renderTime(time) {
|
|
|
42
41
|
return null;
|
|
43
42
|
}
|
|
44
43
|
var MentionItem = /*#__PURE__*/function (_React$PureComponent) {
|
|
45
|
-
_inherits(MentionItem, _React$PureComponent);
|
|
46
|
-
var _super = _createSuper(MentionItem);
|
|
47
44
|
function MentionItem() {
|
|
48
45
|
var _this;
|
|
49
46
|
_classCallCheck(this, MentionItem);
|
|
50
47
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
51
48
|
args[_key] = arguments[_key];
|
|
52
49
|
}
|
|
53
|
-
_this =
|
|
50
|
+
_this = _callSuper(this, MentionItem, [].concat(args));
|
|
54
51
|
// internal, used for callbacks
|
|
55
|
-
_defineProperty(
|
|
52
|
+
_defineProperty(_this, "onMentionSelected", function (event) {
|
|
56
53
|
if (leftClick(event) && _this.props.onSelection) {
|
|
57
54
|
event.preventDefault();
|
|
58
55
|
_this.props.onSelection(_this.props.mention, event);
|
|
59
56
|
}
|
|
60
57
|
});
|
|
61
|
-
_defineProperty(
|
|
58
|
+
_defineProperty(_this, "onMentionMenuItemMouseMove", function (event) {
|
|
62
59
|
if (_this.props.onMouseMove) {
|
|
63
60
|
_this.props.onMouseMove(_this.props.mention, event);
|
|
64
61
|
}
|
|
65
62
|
});
|
|
66
|
-
_defineProperty(
|
|
63
|
+
_defineProperty(_this, "onMentionMenuItemMouseEnter", function (event) {
|
|
67
64
|
if (_this.props.onMouseEnter) {
|
|
68
65
|
_this.props.onMouseEnter(_this.props.mention, event);
|
|
69
66
|
}
|
|
70
67
|
});
|
|
71
68
|
return _this;
|
|
72
69
|
}
|
|
73
|
-
|
|
70
|
+
_inherits(MentionItem, _React$PureComponent);
|
|
71
|
+
return _createClass(MentionItem, [{
|
|
74
72
|
key: "render",
|
|
75
73
|
value: function render() {
|
|
76
74
|
var _this$props = this.props,
|
|
@@ -121,6 +119,5 @@ var MentionItem = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
121
119
|
} /* safe to cast to string given there is no value binding */)))) : null)));
|
|
122
120
|
}
|
|
123
121
|
}]);
|
|
124
|
-
return MentionItem;
|
|
125
122
|
}(React.PureComponent);
|
|
126
123
|
export { MentionItem as default };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
9
|
import React from 'react';
|
|
11
10
|
import debug from '../../util/logger';
|
|
@@ -40,29 +39,27 @@ function getIndex(key, mentions) {
|
|
|
40
39
|
return index;
|
|
41
40
|
}
|
|
42
41
|
var MentionList = /*#__PURE__*/function (_React$PureComponent) {
|
|
43
|
-
_inherits(MentionList, _React$PureComponent);
|
|
44
|
-
var _super = _createSuper(MentionList);
|
|
45
42
|
function MentionList(props) {
|
|
46
43
|
var _this;
|
|
47
44
|
_classCallCheck(this, MentionList);
|
|
48
|
-
_this =
|
|
45
|
+
_this = _callSuper(this, MentionList, [props]);
|
|
49
46
|
// API
|
|
50
|
-
_defineProperty(
|
|
47
|
+
_defineProperty(_this, "selectNext", function () {
|
|
51
48
|
var newIndex = wrapIndex(_this.props.mentions, _this.state.selectedIndex + 1);
|
|
52
49
|
_this.selectIndex(newIndex);
|
|
53
50
|
});
|
|
54
|
-
_defineProperty(
|
|
51
|
+
_defineProperty(_this, "selectPrevious", function () {
|
|
55
52
|
var newIndex = wrapIndex(_this.props.mentions, _this.state.selectedIndex - 1);
|
|
56
53
|
_this.selectIndex(newIndex);
|
|
57
54
|
});
|
|
58
|
-
_defineProperty(
|
|
55
|
+
_defineProperty(_this, "selectIndex", function (index, callback) {
|
|
59
56
|
var mentions = _this.props.mentions;
|
|
60
57
|
_this.setState({
|
|
61
58
|
selectedIndex: index,
|
|
62
59
|
selectedKey: getKey(index, mentions)
|
|
63
60
|
}, callback);
|
|
64
61
|
});
|
|
65
|
-
_defineProperty(
|
|
62
|
+
_defineProperty(_this, "selectId", function (id, callback) {
|
|
66
63
|
var mentions = _this.props.mentions;
|
|
67
64
|
var index = getIndex(id, mentions);
|
|
68
65
|
if (index !== undefined) {
|
|
@@ -72,7 +69,7 @@ var MentionList = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
72
69
|
}, callback);
|
|
73
70
|
}
|
|
74
71
|
});
|
|
75
|
-
_defineProperty(
|
|
72
|
+
_defineProperty(_this, "chooseCurrentSelection", function () {
|
|
76
73
|
var _this$props = _this.props,
|
|
77
74
|
mentions = _this$props.mentions,
|
|
78
75
|
onSelection = _this$props.onSelection;
|
|
@@ -83,11 +80,11 @@ var MentionList = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
83
80
|
onSelection(selectedMention);
|
|
84
81
|
}
|
|
85
82
|
});
|
|
86
|
-
_defineProperty(
|
|
83
|
+
_defineProperty(_this, "mentionsCount", function () {
|
|
87
84
|
var mentions = _this.props.mentions;
|
|
88
85
|
return mentions && mentions.length || 0;
|
|
89
86
|
});
|
|
90
|
-
_defineProperty(
|
|
87
|
+
_defineProperty(_this, "selectIndexOnHover", function (mention, event) {
|
|
91
88
|
if (!event) {
|
|
92
89
|
return;
|
|
93
90
|
}
|
|
@@ -97,18 +94,19 @@ var MentionList = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
97
94
|
}
|
|
98
95
|
_this.lastMousePosition = mousePosition;
|
|
99
96
|
});
|
|
100
|
-
_defineProperty(
|
|
97
|
+
_defineProperty(_this, "itemSelected", function (mention) {
|
|
101
98
|
_this.selectId(mention.id, function () {
|
|
102
99
|
_this.chooseCurrentSelection();
|
|
103
100
|
});
|
|
104
101
|
});
|
|
105
|
-
_defineProperty(
|
|
102
|
+
_defineProperty(_this, "handleScrollableRef", function (ref) {
|
|
106
103
|
_this.scrollable = ref;
|
|
107
104
|
});
|
|
108
105
|
_this.setDefaultSelectionState();
|
|
109
106
|
return _this;
|
|
110
107
|
}
|
|
111
|
-
|
|
108
|
+
_inherits(MentionList, _React$PureComponent);
|
|
109
|
+
return _createClass(MentionList, [{
|
|
112
110
|
key: "UNSAFE_componentWillReceiveProps",
|
|
113
111
|
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
114
112
|
// adjust selection
|
|
@@ -230,6 +228,5 @@ var MentionList = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
230
228
|
}, errorSection, resultSection));
|
|
231
229
|
}
|
|
232
230
|
}]);
|
|
233
|
-
return MentionList;
|
|
234
231
|
}(React.PureComponent);
|
|
235
232
|
export { MentionList as default };
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
7
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { GenericErrorVisualStyle } from './styles';
|
|
11
11
|
export var GenericErrorIllustration = /*#__PURE__*/function (_React$PureComponent) {
|
|
12
|
-
_inherits(GenericErrorIllustration, _React$PureComponent);
|
|
13
|
-
var _super = _createSuper(GenericErrorIllustration);
|
|
14
12
|
function GenericErrorIllustration() {
|
|
15
13
|
_classCallCheck(this, GenericErrorIllustration);
|
|
16
|
-
return
|
|
14
|
+
return _callSuper(this, GenericErrorIllustration, arguments);
|
|
17
15
|
}
|
|
18
|
-
|
|
16
|
+
_inherits(GenericErrorIllustration, _React$PureComponent);
|
|
17
|
+
return _createClass(GenericErrorIllustration, [{
|
|
19
18
|
key: "render",
|
|
20
19
|
value: function render() {
|
|
21
20
|
return /*#__PURE__*/React.createElement(GenericErrorVisualStyle, null, /*#__PURE__*/React.createElement("svg", {
|
|
@@ -92,5 +91,4 @@ export var GenericErrorIllustration = /*#__PURE__*/function (_React$PureComponen
|
|
|
92
91
|
}))))));
|
|
93
92
|
}
|
|
94
93
|
}]);
|
|
95
|
-
return GenericErrorIllustration;
|
|
96
94
|
}(React.PureComponent);
|
|
@@ -1,32 +1,45 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
7
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import React from 'react';
|
|
9
|
+
import Heading from '@atlaskit/heading';
|
|
10
|
+
import { Stack, Text, xcss } from '@atlaskit/primitives';
|
|
9
11
|
import { DefaultAdvisedAction, DefaultHeadline, DifferentText, LoginAgain } from '../../util/i18n';
|
|
10
12
|
import { GenericErrorIllustration } from './GenericErrorIllustration';
|
|
11
|
-
import { MentionListAdviceStyle, MentionListErrorHeadlineStyle, MentionListErrorStyle } from './styles';
|
|
12
13
|
var advisedActionMessages = {
|
|
13
14
|
'401': LoginAgain,
|
|
14
15
|
'403': DifferentText,
|
|
15
16
|
default: DefaultAdvisedAction
|
|
16
17
|
};
|
|
17
18
|
var MentionListError = /*#__PURE__*/function (_React$PureComponent) {
|
|
18
|
-
_inherits(MentionListError, _React$PureComponent);
|
|
19
|
-
var _super = _createSuper(MentionListError);
|
|
20
19
|
function MentionListError() {
|
|
21
20
|
_classCallCheck(this, MentionListError);
|
|
22
|
-
return
|
|
21
|
+
return _callSuper(this, MentionListError, arguments);
|
|
23
22
|
}
|
|
24
|
-
|
|
23
|
+
_inherits(MentionListError, _React$PureComponent);
|
|
24
|
+
return _createClass(MentionListError, [{
|
|
25
25
|
key: "render",
|
|
26
26
|
value: function render() {
|
|
27
27
|
var error = this.props.error;
|
|
28
28
|
var ErrorMessage = MentionListError.getAdvisedActionMessage(error);
|
|
29
|
-
return /*#__PURE__*/React.createElement(
|
|
29
|
+
return /*#__PURE__*/React.createElement(Stack, {
|
|
30
|
+
space: "space.400",
|
|
31
|
+
alignBlock: "center",
|
|
32
|
+
alignInline: "center",
|
|
33
|
+
xcss: mentionListErrorStyles
|
|
34
|
+
}, /*#__PURE__*/React.createElement(GenericErrorIllustration, null), /*#__PURE__*/React.createElement(Stack, {
|
|
35
|
+
space: "space.100"
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Heading, {
|
|
37
|
+
size: "xsmall",
|
|
38
|
+
as: "div"
|
|
39
|
+
}, /*#__PURE__*/React.createElement(DefaultHeadline, null)), /*#__PURE__*/React.createElement(Text, {
|
|
40
|
+
as: "p",
|
|
41
|
+
color: "color.text.subtle"
|
|
42
|
+
}, /*#__PURE__*/React.createElement(ErrorMessage, null))));
|
|
30
43
|
}
|
|
31
44
|
}], [{
|
|
32
45
|
key: "getAdvisedActionMessage",
|
|
@@ -44,6 +57,9 @@ var MentionListError = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
44
57
|
return advisedActionMessages.default;
|
|
45
58
|
}
|
|
46
59
|
}]);
|
|
47
|
-
return MentionListError;
|
|
48
60
|
}(React.PureComponent);
|
|
49
|
-
export { MentionListError as default };
|
|
61
|
+
export { MentionListError as default };
|
|
62
|
+
var mentionListErrorStyles = xcss({
|
|
63
|
+
paddingBlock: 'space.500',
|
|
64
|
+
textAlign: 'center'
|
|
65
|
+
});
|