@atlaskit/mention 21.0.18 → 22.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.
Files changed (153) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/api/TeamMentionResource.js +4 -10
  3. package/dist/cjs/components/MentionPicker/index.js +1 -5
  4. package/dist/cjs/components/ResourcedMentionList/index.js +1 -27
  5. package/dist/cjs/components/i18n.js +0 -20
  6. package/dist/cjs/i18n/cs.js +16 -15
  7. package/dist/cjs/i18n/da.js +16 -15
  8. package/dist/cjs/i18n/de.js +16 -15
  9. package/dist/cjs/i18n/en.js +16 -15
  10. package/dist/cjs/i18n/en_GB.js +16 -15
  11. package/dist/cjs/i18n/es.js +16 -15
  12. package/dist/cjs/i18n/fi.js +16 -15
  13. package/dist/cjs/i18n/fr.js +16 -15
  14. package/dist/cjs/i18n/hu.js +16 -15
  15. package/dist/cjs/i18n/it.js +16 -15
  16. package/dist/cjs/i18n/ja.js +16 -15
  17. package/dist/cjs/i18n/ko.js +16 -15
  18. package/dist/cjs/i18n/nb.js +16 -15
  19. package/dist/cjs/i18n/nl.js +16 -15
  20. package/dist/cjs/i18n/pl.js +16 -15
  21. package/dist/cjs/i18n/pt_BR.js +16 -15
  22. package/dist/cjs/i18n/ru.js +16 -15
  23. package/dist/cjs/i18n/sv.js +16 -15
  24. package/dist/cjs/i18n/th.js +16 -15
  25. package/dist/cjs/i18n/tr.js +16 -15
  26. package/dist/cjs/i18n/uk.js +16 -15
  27. package/dist/cjs/i18n/vi.js +16 -15
  28. package/dist/cjs/i18n/zh.js +16 -15
  29. package/dist/cjs/i18n/zh_TW.js +16 -15
  30. package/dist/cjs/index.js +0 -14
  31. package/dist/cjs/util/analytics.js +1 -24
  32. package/dist/cjs/util/i18n.js +2 -10
  33. package/dist/cjs/version.json +1 -1
  34. package/dist/es2019/api/TeamMentionResource.js +1 -2
  35. package/dist/es2019/components/MentionPicker/index.js +1 -5
  36. package/dist/es2019/components/ResourcedMentionList/index.js +1 -27
  37. package/dist/es2019/components/i18n.js +0 -20
  38. package/dist/es2019/i18n/cs.js +16 -15
  39. package/dist/es2019/i18n/da.js +16 -15
  40. package/dist/es2019/i18n/de.js +16 -15
  41. package/dist/es2019/i18n/en.js +16 -15
  42. package/dist/es2019/i18n/en_GB.js +16 -15
  43. package/dist/es2019/i18n/es.js +16 -15
  44. package/dist/es2019/i18n/fi.js +16 -15
  45. package/dist/es2019/i18n/fr.js +16 -15
  46. package/dist/es2019/i18n/hu.js +16 -15
  47. package/dist/es2019/i18n/it.js +16 -15
  48. package/dist/es2019/i18n/ja.js +16 -15
  49. package/dist/es2019/i18n/ko.js +16 -15
  50. package/dist/es2019/i18n/nb.js +16 -15
  51. package/dist/es2019/i18n/nl.js +16 -15
  52. package/dist/es2019/i18n/pl.js +16 -15
  53. package/dist/es2019/i18n/pt_BR.js +16 -15
  54. package/dist/es2019/i18n/ru.js +16 -15
  55. package/dist/es2019/i18n/sv.js +16 -15
  56. package/dist/es2019/i18n/th.js +16 -15
  57. package/dist/es2019/i18n/tr.js +16 -15
  58. package/dist/es2019/i18n/uk.js +16 -15
  59. package/dist/es2019/i18n/vi.js +16 -15
  60. package/dist/es2019/i18n/zh.js +16 -15
  61. package/dist/es2019/i18n/zh_TW.js +16 -15
  62. package/dist/es2019/index.js +1 -3
  63. package/dist/es2019/util/analytics.js +0 -20
  64. package/dist/es2019/util/i18n.js +0 -4
  65. package/dist/es2019/version.json +1 -1
  66. package/dist/esm/api/TeamMentionResource.js +4 -10
  67. package/dist/esm/components/MentionPicker/index.js +1 -5
  68. package/dist/esm/components/ResourcedMentionList/index.js +1 -24
  69. package/dist/esm/components/i18n.js +0 -20
  70. package/dist/esm/i18n/cs.js +16 -15
  71. package/dist/esm/i18n/da.js +16 -15
  72. package/dist/esm/i18n/de.js +16 -15
  73. package/dist/esm/i18n/en.js +16 -15
  74. package/dist/esm/i18n/en_GB.js +16 -15
  75. package/dist/esm/i18n/es.js +16 -15
  76. package/dist/esm/i18n/fi.js +16 -15
  77. package/dist/esm/i18n/fr.js +16 -15
  78. package/dist/esm/i18n/hu.js +16 -15
  79. package/dist/esm/i18n/it.js +16 -15
  80. package/dist/esm/i18n/ja.js +16 -15
  81. package/dist/esm/i18n/ko.js +16 -15
  82. package/dist/esm/i18n/nb.js +16 -15
  83. package/dist/esm/i18n/nl.js +16 -15
  84. package/dist/esm/i18n/pl.js +16 -15
  85. package/dist/esm/i18n/pt_BR.js +16 -15
  86. package/dist/esm/i18n/ru.js +16 -15
  87. package/dist/esm/i18n/sv.js +16 -15
  88. package/dist/esm/i18n/th.js +16 -15
  89. package/dist/esm/i18n/tr.js +16 -15
  90. package/dist/esm/i18n/uk.js +16 -15
  91. package/dist/esm/i18n/vi.js +16 -15
  92. package/dist/esm/i18n/zh.js +16 -15
  93. package/dist/esm/i18n/zh_TW.js +16 -15
  94. package/dist/esm/index.js +1 -3
  95. package/dist/esm/util/analytics.js +0 -22
  96. package/dist/esm/util/i18n.js +0 -4
  97. package/dist/esm/version.json +1 -1
  98. package/dist/types/api/MentionResource.d.ts +0 -6
  99. package/dist/types/api/TeamMentionResource.d.ts +2 -4
  100. package/dist/types/components/MentionPicker/index.d.ts +0 -2
  101. package/dist/types/components/ResourcedMentionList/index.d.ts +0 -4
  102. package/dist/types/components/i18n.d.ts +0 -20
  103. package/dist/types/i18n/cs.d.ts +15 -15
  104. package/dist/types/i18n/da.d.ts +15 -15
  105. package/dist/types/i18n/de.d.ts +15 -15
  106. package/dist/types/i18n/en.d.ts +15 -15
  107. package/dist/types/i18n/en_GB.d.ts +15 -15
  108. package/dist/types/i18n/es.d.ts +15 -15
  109. package/dist/types/i18n/fi.d.ts +15 -15
  110. package/dist/types/i18n/fr.d.ts +15 -15
  111. package/dist/types/i18n/hu.d.ts +15 -15
  112. package/dist/types/i18n/it.d.ts +15 -15
  113. package/dist/types/i18n/ja.d.ts +15 -15
  114. package/dist/types/i18n/ko.d.ts +15 -15
  115. package/dist/types/i18n/nb.d.ts +15 -15
  116. package/dist/types/i18n/nl.d.ts +15 -15
  117. package/dist/types/i18n/pl.d.ts +15 -15
  118. package/dist/types/i18n/pt_BR.d.ts +15 -15
  119. package/dist/types/i18n/ru.d.ts +15 -15
  120. package/dist/types/i18n/sv.d.ts +15 -15
  121. package/dist/types/i18n/th.d.ts +15 -15
  122. package/dist/types/i18n/tr.d.ts +15 -15
  123. package/dist/types/i18n/uk.d.ts +15 -15
  124. package/dist/types/i18n/vi.d.ts +15 -15
  125. package/dist/types/i18n/zh.d.ts +15 -15
  126. package/dist/types/i18n/zh_TW.d.ts +15 -15
  127. package/dist/types/index.d.ts +1 -3
  128. package/dist/types/resource.d.ts +2 -2
  129. package/dist/types/util/analytics.d.ts +1 -3
  130. package/dist/types/util/i18n.d.ts +0 -4
  131. package/package.json +12 -11
  132. package/report.api.md +1 -118
  133. package/dist/cjs/components/TeamMentionHighlight/TeamMentionHighlightController.js +0 -85
  134. package/dist/cjs/components/TeamMentionHighlight/index.js +0 -184
  135. package/dist/cjs/components/TeamMentionHighlight/lazy.js +0 -21
  136. package/dist/cjs/components/TeamMentionHighlight/styles.js +0 -29
  137. package/dist/cjs/spotlight.js +0 -20
  138. package/dist/es2019/components/TeamMentionHighlight/TeamMentionHighlightController.js +0 -64
  139. package/dist/es2019/components/TeamMentionHighlight/index.js +0 -148
  140. package/dist/es2019/components/TeamMentionHighlight/lazy.js +0 -4
  141. package/dist/es2019/components/TeamMentionHighlight/styles.js +0 -40
  142. package/dist/es2019/spotlight.js +0 -5
  143. package/dist/esm/components/TeamMentionHighlight/TeamMentionHighlightController.js +0 -77
  144. package/dist/esm/components/TeamMentionHighlight/index.js +0 -172
  145. package/dist/esm/components/TeamMentionHighlight/lazy.js +0 -8
  146. package/dist/esm/components/TeamMentionHighlight/styles.js +0 -14
  147. package/dist/esm/spotlight.js +0 -5
  148. package/dist/types/components/TeamMentionHighlight/TeamMentionHighlightController.d.ts +0 -17
  149. package/dist/types/components/TeamMentionHighlight/index.d.ts +0 -35
  150. package/dist/types/components/TeamMentionHighlight/lazy.d.ts +0 -4
  151. package/dist/types/components/TeamMentionHighlight/styles.d.ts +0 -33
  152. package/dist/types/spotlight.d.ts +0 -3
  153. package/spotlight/package.json +0 -15
@@ -1,184 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = exports.TeamMentionHighlightInternal = void 0;
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
- var _react = _interopRequireDefault(require("react"));
17
- var _withAnalyticsEvents = _interopRequireDefault(require("@atlaskit/analytics-next/withAnalyticsEvents"));
18
- var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
19
- var _close = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/close"));
20
- var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
21
- var _TeamMentionHighlightController = _interopRequireDefault(require("./TeamMentionHighlightController"));
22
- var _analytics = require("../../util/analytics");
23
- var _i18n = require("../../util/i18n");
24
- var Styled = _interopRequireWildcard(require("./styles"));
25
- var _MessagesIntlProvider = _interopRequireDefault(require("../MessagesIntlProvider"));
26
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
28
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
29
- 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; } }
30
- var ICON_URL = 'data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIHdpZHRoPSIxMjgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGN4PSI2NCIgY3k9IjY0IiBmaWxsPSIjNTI0M2FhIiBmaWxsLXJ1bGU9Im5vbnplcm8iIHI9IjY0Ii8+PHBhdGggZD0ibTgwIDY0Yy02LjYyNzQxNyAwLTEyLTUuMzcyNTgzLTEyLTEyczUuMzcyNTgzLTEyIDEyLTEyIDEyIDUuMzcyNTgzIDEyIDEyLTUuMzcyNTgzIDEyLTEyIDEyem0tMzItMTJjLTYuNjI3NDE3IDAtMTItNS4zNzI1ODMtMTItMTJzNS4zNzI1ODMtMTIgMTItMTIgMTIgNS4zNzI1ODMgMTIgMTItNS4zNzI1ODMgMTItMTIgMTJ6bTEyIDI0YzAtNC40MiAzLjU0OC04IDgtOGgyNGM0LjQyIDAgOCAzLjU0IDggOHYxNC45MmMwIDEyLjEwOC00MCAxMi4xMDgtNDAgMHptOC0xMmgtLjAxMmMtMy4xODQzNTM3LjAwNDI0LTYuMjM2NTQxIDEuMjczNTYxNS04LjQ4NDg0MjcgMy41Mjg2MTQ5LTIuMjQ4MzAxOCAyLjI1NTA1MzQtMy41MDg0NjU2IDUuMzExMDMzLTMuNTAzMTU3MyA4LjQ5NTM4NTF2MTEuMjI4Yy0xMS43ODQgMi4xMzYtMjgtLjI1Mi0yOC03LjkzNnYtMTUuMzA0YzAtNC40MjQgMy41NDgtOC4wMTIgOC04LjAxMmgyNGMyLjEyMjcwODYtLjAwMzE5MTIgNC4xNTkzOTQ2LjgzODYzODYgNS42NjAzNzggMi4zMzk2MjJzMi4zNDI4MTMyIDMuNTM3NjY5NCAyLjMzOTYyMiA1LjY2MDM3OHoiIGZpbGw9IiNmZmYiIGZpbGwtb3BhY2l0eT0iLjk1Ii8+PC9nPjwvc3ZnPg==';
31
- var TeamMentionHighlightInternal = /*#__PURE__*/function (_React$Component) {
32
- (0, _inherits2.default)(TeamMentionHighlightInternal, _React$Component);
33
- var _super = _createSuper(TeamMentionHighlightInternal);
34
- // Wrap whole dialog so we can catch events, see preventClickOnCard
35
-
36
- // Wrap the close button, so we can still manually invoke onClose()
37
-
38
- // Wrap the create team link, so we can still manually invoke the analytics
39
-
40
- function TeamMentionHighlightInternal(props) {
41
- var _this;
42
- (0, _classCallCheck2.default)(this, TeamMentionHighlightInternal);
43
- _this = _super.call(this, props);
44
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onCreateTeamLinkClick", function () {
45
- _this.setState({
46
- isHighlightHidden: true
47
- });
48
- var onCreateTeamLinkClick = _this.props.onCreateTeamLinkClick;
49
- _TeamMentionHighlightController.default.registerCreateLinkClick();
50
- if (onCreateTeamLinkClick) {
51
- onCreateTeamLinkClick();
52
- }
53
- });
54
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "preventClickOnCard", function (event) {
55
- // event is a MouseEvent
56
-
57
- // We stop the event from propagating, so we need to manually close
58
- var isClickOnCloseButton = _this.elCloseWrapper.current && _this.elCloseWrapper.current.contains(event.target);
59
- if (isClickOnCloseButton) {
60
- _this.onCloseClick();
61
- }
62
-
63
- // Manually perform on-click for the link, if the link was clicked.
64
- var isClickCreateTeamLink = _this.elCreateTeamWrapper.current && _this.elCreateTeamWrapper.current.contains(event.target);
65
- if (isClickCreateTeamLink) {
66
- _this.onCreateTeamLinkClick();
67
- }
68
-
69
- // Allow default so the link to create team still works, but prevent the rest
70
- event.stopPropagation();
71
- event.stopImmediatePropagation();
72
- });
73
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onCloseClick", function () {
74
- _this.setState({
75
- isHighlightHidden: true
76
- });
77
- _this.props.onClose();
78
- });
79
- _this.elWrapper = /*#__PURE__*/_react.default.createRef();
80
- _this.elCloseWrapper = /*#__PURE__*/_react.default.createRef();
81
- _this.elCreateTeamWrapper = /*#__PURE__*/_react.default.createRef();
82
- _this.state = {
83
- isHighlightHidden: false
84
- };
85
- return _this;
86
- }
87
- (0, _createClass2.default)(TeamMentionHighlightInternal, [{
88
- key: "componentDidMount",
89
- value: function componentDidMount() {
90
- var onViewed = this.props.onViewed;
91
- this.addEventHandler();
92
-
93
- // Highlight hiding logic was moved to Mount method because if Highlight is re-rendered after updating the
94
- // counts at MentionHighlightController, Highlight will appear for sometime and then disappear. As of the time
95
- // of writing this code, this was only happening in Fabric Editor ( See TEAMS-623 )
96
- if (!_TeamMentionHighlightController.default.isHighlightEnabled()) {
97
- this.setState({
98
- isHighlightHidden: true
99
- });
100
- } else {
101
- _TeamMentionHighlightController.default.registerRender();
102
- if (onViewed) {
103
- onViewed();
104
- }
105
- }
106
- }
107
- }, {
108
- key: "componentWillUnmount",
109
- value: function componentWillUnmount() {
110
- this.removeEventHandler();
111
- }
112
- }, {
113
- key: "addEventHandler",
114
- value: function addEventHandler() {
115
- this.elWrapper.current && this.elWrapper.current.addEventListener('click', this.preventClickOnCard);
116
- }
117
- }, {
118
- key: "removeEventHandler",
119
- value: function removeEventHandler() {
120
- this.elWrapper.current && this.elWrapper.current.removeEventListener('click', this.preventClickOnCard);
121
- }
122
- }, {
123
- key: "render",
124
- value: function render() {
125
- var _this2 = this;
126
- var createTeamLink = this.props.createTeamLink;
127
- var isHighlightHidden = this.state.isHighlightHidden;
128
- if (isHighlightHidden) {
129
- return null;
130
- }
131
- return /*#__PURE__*/_react.default.createElement(_MessagesIntlProvider.default, null, /*#__PURE__*/_react.default.createElement("div", {
132
- ref: this.elWrapper
133
- }, /*#__PURE__*/_react.default.createElement(Styled.Card, null, /*#__PURE__*/_react.default.createElement(Styled.Content, null, /*#__PURE__*/_react.default.createElement(Styled.Aside, null, /*#__PURE__*/_react.default.createElement("img", {
134
- src: ICON_URL,
135
- height: 32
136
- })), /*#__PURE__*/_react.default.createElement(Styled.Section, null, /*#__PURE__*/_react.default.createElement(Styled.Heading, null, /*#__PURE__*/_react.default.createElement(Styled.Title, null, /*#__PURE__*/_react.default.createElement(_i18n.TeamMentionHighlightTitle, null))), /*#__PURE__*/_react.default.createElement(Styled.Body, null, /*#__PURE__*/_react.default.createElement(_i18n.TeamMentionHighlightDescription, null, function (description) {
137
- return /*#__PURE__*/_react.default.createElement("div", null, description, /*#__PURE__*/_react.default.createElement("span", {
138
- ref: _this2.elCreateTeamWrapper
139
- }, /*#__PURE__*/_react.default.createElement(_i18n.TeamMentionHighlightDescriptionLink, null, function (linkText) {
140
- return /*#__PURE__*/_react.default.createElement("a", {
141
- href: createTeamLink,
142
- target: "_blank"
143
- }, ' ', linkText)
144
- // on click fired by preventClickOnCard, not here
145
- ;
146
- })));
147
- }))), /*#__PURE__*/_react.default.createElement(Styled.Actions, null, /*#__PURE__*/_react.default.createElement("div", {
148
- ref: this.elCloseWrapper
149
- }, /*#__PURE__*/_react.default.createElement(_i18n.TeamMentionHighlightCloseTooltip, null, function (tooltip) {
150
- return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
151
- content: tooltip,
152
- position: "bottom"
153
- }, /*#__PURE__*/_react.default.createElement(_customThemeButton.default, {
154
- appearance: "subtle",
155
- iconBefore: /*#__PURE__*/_react.default.createElement(_close.default, {
156
- label: "Close",
157
- size: "medium"
158
- }),
159
- spacing: "none"
160
- // on click fired by preventClickOnCard, not here
161
- }));
162
- })))))));
163
- }
164
- }]);
165
- return TeamMentionHighlightInternal;
166
- }(_react.default.Component);
167
- exports.TeamMentionHighlightInternal = TeamMentionHighlightInternal;
168
- (0, _defineProperty2.default)(TeamMentionHighlightInternal, "defaultProps", {
169
- createTeamLink: '/people/search#createTeam'
170
- });
171
- var TeamMentionHighlightWithAnalytics = (0, _withAnalyticsEvents.default)({
172
- onClose: function onClose(createEvent) {
173
- (0, _analytics.fireAnalyticsTeamMentionHighlightEvent)(createEvent)(_analytics.ComponentNames.TEAM_MENTION_HIGHLIGHT, _analytics.Actions.CLOSED, _analytics.ComponentNames.MENTION, 'closeButton');
174
- },
175
- onCreateTeamLinkClick: function onCreateTeamLinkClick(createEvent) {
176
- (0, _analytics.fireAnalyticsTeamMentionHighlightEvent)(createEvent)(_analytics.ComponentNames.TEAM_MENTION_HIGHLIGHT, _analytics.Actions.CLICKED, _analytics.ComponentNames.MENTION, 'createTeamLink');
177
- },
178
- onViewed: function onViewed(createEvent) {
179
- (0, _analytics.fireAnalyticsTeamMentionHighlightEvent)(createEvent)(_analytics.ComponentNames.TEAM_MENTION_HIGHLIGHT, _analytics.Actions.VIEWED, _analytics.ComponentNames.MENTION, undefined, _TeamMentionHighlightController.default.getSeenCount());
180
- }
181
- })(TeamMentionHighlightInternal);
182
- var TeamMentionHighlight = TeamMentionHighlightWithAnalytics;
183
- var _default = TeamMentionHighlight;
184
- exports.default = _default;
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.LazyTeamMentionHighlight = void 0;
8
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
- var _react = _interopRequireDefault(require("react"));
10
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || (0, _typeof2.default)(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
- var LazyTeamMentionHighlight = /*#__PURE__*/_react.default.lazy(function () {
13
- return Promise.resolve().then(function () {
14
- return _interopRequireWildcard(require('./'));
15
- }).then(function (module) {
16
- return {
17
- default: module.default
18
- };
19
- });
20
- });
21
- exports.LazyTeamMentionHighlight = LazyTeamMentionHighlight;
@@ -1,29 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.Title = exports.Section = exports.Heading = exports.Content = exports.Card = exports.Body = exports.Aside = exports.Actions = void 0;
8
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
- var _styled = _interopRequireDefault(require("@emotion/styled"));
10
- var _constants = require("@atlaskit/theme/constants");
11
- var _colors = require("@atlaskit/theme/colors");
12
- var _typography = require("@atlaskit/theme/typography");
13
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
14
- var Actions = _styled.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n justify-content: flex-end;\n margin-top: -", "px; /* Negative margin is used to middle align x button with title */\n margin-right: ", "px;\n"])), (0, _constants.gridSize)() * 0.5, (0, _constants.gridSize)() * 0.5);
15
- exports.Actions = Actions;
16
- var Title = _styled.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n margin-top: 0px;\n"])), _typography.h400);
17
- exports.Title = Title;
18
- var Heading = _styled.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: ", "px;\n margin-bottom: ", "px;\n"])), (0, _constants.gridSize)() * 2, (0, _constants.gridSize)() * 0.5);
19
- exports.Heading = Heading;
20
- var Card = _styled.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n background-color: ", ";\n overflow: hidden;\n line-height: 21px;\n padding-top: ", "px;\n padding-bottom: ", "px;\n padding-left: ", "px;\n padding-right: 0px;\n margin-top: -", "px; /* Negative margin is used to fill the entire top of the mention dropdown with background colour of highlight */\n"])), "var(--ds-background-discovery, ".concat(_colors.P50, ")"), (0, _constants.gridSize)() * 2, (0, _constants.gridSize)() * 2, (0, _constants.gridSize)() * 2, (0, _constants.gridSize)() * 0.5);
21
- exports.Card = Card;
22
- var Content = _styled.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n max-width: 290px;\n display: flex;\n"])));
23
- exports.Content = Content;
24
- var Section = _styled.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)([""])));
25
- exports.Section = Section;
26
- var Aside = _styled.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n opacity: 0.8;\n"])));
27
- exports.Aside = Aside;
28
- var Body = _styled.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: ", "px;\n"])), (0, _constants.gridSize)() * 2);
29
- exports.Body = Body;
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- Object.defineProperty(exports, "TeamMentionHighlight", {
8
- enumerable: true,
9
- get: function get() {
10
- return _TeamMentionHighlight.default;
11
- }
12
- });
13
- Object.defineProperty(exports, "TeamMentionHighlightController", {
14
- enumerable: true,
15
- get: function get() {
16
- return _TeamMentionHighlightController.default;
17
- }
18
- });
19
- var _TeamMentionHighlight = _interopRequireDefault(require("./components/TeamMentionHighlight"));
20
- var _TeamMentionHighlightController = _interopRequireDefault(require("./components/TeamMentionHighlight/TeamMentionHighlightController"));
@@ -1,64 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- export const mentionHighlightLocalStorageKey = 'atlassian.people.context.team.mention.highlight';
3
- const EMPTY = {
4
- seenCount: 0,
5
- dontShow: false
6
- };
7
-
8
- // Don't show if the user can't access local storage
9
- const DISABLED_LOCAL_STORAGE = {
10
- seenCount: 99,
11
- dontShow: true
12
- };
13
- const MAX_SEEN_LIMIT = 5;
14
- export default class TeamMentionHighlightController {
15
- // Note - not a simple look up to avoid showing it to users that have local storage disabled
16
- static readFromLocalStorage() {
17
- try {
18
- let localVal = localStorage.getItem(mentionHighlightLocalStorageKey);
19
- if (!localVal) {
20
- // Attempt to write to see if the user has local storage access
21
- localStorage.setItem(mentionHighlightLocalStorageKey, JSON.stringify(EMPTY));
22
- localVal = localStorage.getItem(mentionHighlightLocalStorageKey);
23
- }
24
- if (localVal) {
25
- return JSON.parse(localVal);
26
- } else {
27
- return DISABLED_LOCAL_STORAGE;
28
- }
29
- } catch (err) {
30
- return DISABLED_LOCAL_STORAGE;
31
- }
32
- }
33
- static saveToLocalStorage(item) {
34
- try {
35
- localStorage.setItem(mentionHighlightLocalStorageKey, JSON.stringify(item));
36
- } catch (err) {
37
- // do nothing
38
- }
39
- }
40
- }
41
- _defineProperty(TeamMentionHighlightController, "markAsDone", () => {
42
- const item = TeamMentionHighlightController.readFromLocalStorage();
43
- item.dontShow = true;
44
- TeamMentionHighlightController.saveToLocalStorage(item);
45
- });
46
- _defineProperty(TeamMentionHighlightController, "isHighlightEnabled", () => {
47
- const item = TeamMentionHighlightController.readFromLocalStorage();
48
- return item.seenCount < MAX_SEEN_LIMIT && !item.dontShow;
49
- });
50
- _defineProperty(TeamMentionHighlightController, "registerRender", () => {
51
- const item = TeamMentionHighlightController.readFromLocalStorage();
52
- item.seenCount += 1;
53
- if (item.seenCount > MAX_SEEN_LIMIT) {
54
- item.dontShow = true;
55
- }
56
- TeamMentionHighlightController.saveToLocalStorage(item);
57
- return item;
58
- });
59
- _defineProperty(TeamMentionHighlightController, "getSeenCount", () => {
60
- return TeamMentionHighlightController.readFromLocalStorage().seenCount;
61
- });
62
- _defineProperty(TeamMentionHighlightController, "registerCreateLinkClick", TeamMentionHighlightController.markAsDone);
63
- _defineProperty(TeamMentionHighlightController, "registerTeamMention", TeamMentionHighlightController.markAsDone);
64
- _defineProperty(TeamMentionHighlightController, "registerClosed", TeamMentionHighlightController.markAsDone);
@@ -1,148 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import React from 'react';
3
- import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
4
- import Button from '@atlaskit/button/custom-theme-button';
5
- import EditorCloseIcon from '@atlaskit/icon/glyph/editor/close';
6
- import Tooltip from '@atlaskit/tooltip';
7
- import TeamMentionHighlightController from './TeamMentionHighlightController';
8
- import { fireAnalyticsTeamMentionHighlightEvent, ComponentNames, Actions } from '../../util/analytics';
9
- import { TeamMentionHighlightTitle, TeamMentionHighlightCloseTooltip, TeamMentionHighlightDescription, TeamMentionHighlightDescriptionLink } from '../../util/i18n';
10
- import * as Styled from './styles';
11
- import MessagesIntlProvider from '../MessagesIntlProvider';
12
- const ICON_URL = 'data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIHdpZHRoPSIxMjgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGN4PSI2NCIgY3k9IjY0IiBmaWxsPSIjNTI0M2FhIiBmaWxsLXJ1bGU9Im5vbnplcm8iIHI9IjY0Ii8+PHBhdGggZD0ibTgwIDY0Yy02LjYyNzQxNyAwLTEyLTUuMzcyNTgzLTEyLTEyczUuMzcyNTgzLTEyIDEyLTEyIDEyIDUuMzcyNTgzIDEyIDEyLTUuMzcyNTgzIDEyLTEyIDEyem0tMzItMTJjLTYuNjI3NDE3IDAtMTItNS4zNzI1ODMtMTItMTJzNS4zNzI1ODMtMTIgMTItMTIgMTIgNS4zNzI1ODMgMTIgMTItNS4zNzI1ODMgMTItMTIgMTJ6bTEyIDI0YzAtNC40MiAzLjU0OC04IDgtOGgyNGM0LjQyIDAgOCAzLjU0IDggOHYxNC45MmMwIDEyLjEwOC00MCAxMi4xMDgtNDAgMHptOC0xMmgtLjAxMmMtMy4xODQzNTM3LjAwNDI0LTYuMjM2NTQxIDEuMjczNTYxNS04LjQ4NDg0MjcgMy41Mjg2MTQ5LTIuMjQ4MzAxOCAyLjI1NTA1MzQtMy41MDg0NjU2IDUuMzExMDMzLTMuNTAzMTU3MyA4LjQ5NTM4NTF2MTEuMjI4Yy0xMS43ODQgMi4xMzYtMjgtLjI1Mi0yOC03LjkzNnYtMTUuMzA0YzAtNC40MjQgMy41NDgtOC4wMTIgOC04LjAxMmgyNGMyLjEyMjcwODYtLjAwMzE5MTIgNC4xNTkzOTQ2LjgzODYzODYgNS42NjAzNzggMi4zMzk2MjJzMi4zNDI4MTMyIDMuNTM3NjY5NCAyLjMzOTYyMiA1LjY2MDM3OHoiIGZpbGw9IiNmZmYiIGZpbGwtb3BhY2l0eT0iLjk1Ii8+PC9nPjwvc3ZnPg==';
13
- export class TeamMentionHighlightInternal extends React.Component {
14
- // Wrap whole dialog so we can catch events, see preventClickOnCard
15
-
16
- // Wrap the close button, so we can still manually invoke onClose()
17
-
18
- // Wrap the create team link, so we can still manually invoke the analytics
19
-
20
- constructor(props) {
21
- super(props);
22
- _defineProperty(this, "onCreateTeamLinkClick", () => {
23
- this.setState({
24
- isHighlightHidden: true
25
- });
26
- const {
27
- onCreateTeamLinkClick
28
- } = this.props;
29
- TeamMentionHighlightController.registerCreateLinkClick();
30
- if (onCreateTeamLinkClick) {
31
- onCreateTeamLinkClick();
32
- }
33
- });
34
- _defineProperty(this, "preventClickOnCard", event => {
35
- // event is a MouseEvent
36
-
37
- // We stop the event from propagating, so we need to manually close
38
- const isClickOnCloseButton = this.elCloseWrapper.current && this.elCloseWrapper.current.contains(event.target);
39
- if (isClickOnCloseButton) {
40
- this.onCloseClick();
41
- }
42
-
43
- // Manually perform on-click for the link, if the link was clicked.
44
- const isClickCreateTeamLink = this.elCreateTeamWrapper.current && this.elCreateTeamWrapper.current.contains(event.target);
45
- if (isClickCreateTeamLink) {
46
- this.onCreateTeamLinkClick();
47
- }
48
-
49
- // Allow default so the link to create team still works, but prevent the rest
50
- event.stopPropagation();
51
- event.stopImmediatePropagation();
52
- });
53
- _defineProperty(this, "onCloseClick", () => {
54
- this.setState({
55
- isHighlightHidden: true
56
- });
57
- this.props.onClose();
58
- });
59
- this.elWrapper = /*#__PURE__*/React.createRef();
60
- this.elCloseWrapper = /*#__PURE__*/React.createRef();
61
- this.elCreateTeamWrapper = /*#__PURE__*/React.createRef();
62
- this.state = {
63
- isHighlightHidden: false
64
- };
65
- }
66
- componentDidMount() {
67
- const {
68
- onViewed
69
- } = this.props;
70
- this.addEventHandler();
71
-
72
- // Highlight hiding logic was moved to Mount method because if Highlight is re-rendered after updating the
73
- // counts at MentionHighlightController, Highlight will appear for sometime and then disappear. As of the time
74
- // of writing this code, this was only happening in Fabric Editor ( See TEAMS-623 )
75
- if (!TeamMentionHighlightController.isHighlightEnabled()) {
76
- this.setState({
77
- isHighlightHidden: true
78
- });
79
- } else {
80
- TeamMentionHighlightController.registerRender();
81
- if (onViewed) {
82
- onViewed();
83
- }
84
- }
85
- }
86
- componentWillUnmount() {
87
- this.removeEventHandler();
88
- }
89
- addEventHandler() {
90
- this.elWrapper.current && this.elWrapper.current.addEventListener('click', this.preventClickOnCard);
91
- }
92
- removeEventHandler() {
93
- this.elWrapper.current && this.elWrapper.current.removeEventListener('click', this.preventClickOnCard);
94
- }
95
- render() {
96
- const {
97
- createTeamLink
98
- } = this.props;
99
- const {
100
- isHighlightHidden
101
- } = this.state;
102
- if (isHighlightHidden) {
103
- return null;
104
- }
105
- return /*#__PURE__*/React.createElement(MessagesIntlProvider, null, /*#__PURE__*/React.createElement("div", {
106
- ref: this.elWrapper
107
- }, /*#__PURE__*/React.createElement(Styled.Card, null, /*#__PURE__*/React.createElement(Styled.Content, null, /*#__PURE__*/React.createElement(Styled.Aside, null, /*#__PURE__*/React.createElement("img", {
108
- src: ICON_URL,
109
- height: 32
110
- })), /*#__PURE__*/React.createElement(Styled.Section, null, /*#__PURE__*/React.createElement(Styled.Heading, null, /*#__PURE__*/React.createElement(Styled.Title, null, /*#__PURE__*/React.createElement(TeamMentionHighlightTitle, null))), /*#__PURE__*/React.createElement(Styled.Body, null, /*#__PURE__*/React.createElement(TeamMentionHighlightDescription, null, description => /*#__PURE__*/React.createElement("div", null, description, /*#__PURE__*/React.createElement("span", {
111
- ref: this.elCreateTeamWrapper
112
- }, /*#__PURE__*/React.createElement(TeamMentionHighlightDescriptionLink, null, linkText => /*#__PURE__*/React.createElement("a", {
113
- href: createTeamLink,
114
- target: "_blank"
115
- }, ' ', linkText)
116
- // on click fired by preventClickOnCard, not here
117
- )))))), /*#__PURE__*/React.createElement(Styled.Actions, null, /*#__PURE__*/React.createElement("div", {
118
- ref: this.elCloseWrapper
119
- }, /*#__PURE__*/React.createElement(TeamMentionHighlightCloseTooltip, null, tooltip => /*#__PURE__*/React.createElement(Tooltip, {
120
- content: tooltip,
121
- position: "bottom"
122
- }, /*#__PURE__*/React.createElement(Button, {
123
- appearance: "subtle",
124
- iconBefore: /*#__PURE__*/React.createElement(EditorCloseIcon, {
125
- label: "Close",
126
- size: "medium"
127
- }),
128
- spacing: "none"
129
- // on click fired by preventClickOnCard, not here
130
- })))))))));
131
- }
132
- }
133
- _defineProperty(TeamMentionHighlightInternal, "defaultProps", {
134
- createTeamLink: '/people/search#createTeam'
135
- });
136
- const TeamMentionHighlightWithAnalytics = withAnalyticsEvents({
137
- onClose: createEvent => {
138
- fireAnalyticsTeamMentionHighlightEvent(createEvent)(ComponentNames.TEAM_MENTION_HIGHLIGHT, Actions.CLOSED, ComponentNames.MENTION, 'closeButton');
139
- },
140
- onCreateTeamLinkClick: createEvent => {
141
- fireAnalyticsTeamMentionHighlightEvent(createEvent)(ComponentNames.TEAM_MENTION_HIGHLIGHT, Actions.CLICKED, ComponentNames.MENTION, 'createTeamLink');
142
- },
143
- onViewed: createEvent => {
144
- fireAnalyticsTeamMentionHighlightEvent(createEvent)(ComponentNames.TEAM_MENTION_HIGHLIGHT, Actions.VIEWED, ComponentNames.MENTION, undefined, TeamMentionHighlightController.getSeenCount());
145
- }
146
- })(TeamMentionHighlightInternal);
147
- const TeamMentionHighlight = TeamMentionHighlightWithAnalytics;
148
- export default TeamMentionHighlight;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- export const LazyTeamMentionHighlight = /*#__PURE__*/React.lazy(() => import( /* webpackChunkName: "@atlaskit-internal_@atlassian/mention/TeamMentionHighlight" */'./').then(module => ({
3
- default: module.default
4
- })));
@@ -1,40 +0,0 @@
1
- import styled from '@emotion/styled';
2
- import { gridSize } from '@atlaskit/theme/constants';
3
- import { P50 } from '@atlaskit/theme/colors';
4
- import { h400 } from '@atlaskit/theme/typography';
5
- export const Actions = styled.div`
6
- justify-content: flex-end;
7
- margin-top: -${gridSize() * 0.5}px; /* Negative margin is used to middle align x button with title */
8
- margin-right: ${gridSize() * 0.5}px;
9
- `;
10
- export const Title = styled.div`
11
- ${h400};
12
- margin-top: 0px;
13
- `;
14
- export const Heading = styled.div`
15
- margin-left: ${gridSize() * 2}px;
16
- margin-bottom: ${gridSize() * 0.5}px;
17
- `;
18
- export const Card = styled.div`
19
- display: flex;
20
- flex-direction: row;
21
- background-color: ${`var(--ds-background-discovery, ${P50})`};
22
- overflow: hidden;
23
- line-height: 21px;
24
- padding-top: ${gridSize() * 2}px;
25
- padding-bottom: ${gridSize() * 2}px;
26
- padding-left: ${gridSize() * 2}px;
27
- padding-right: 0px;
28
- margin-top: -${gridSize() * 0.5}px; /* Negative margin is used to fill the entire top of the mention dropdown with background colour of highlight */
29
- `;
30
- export const Content = styled.div`
31
- max-width: 290px;
32
- display: flex;
33
- `;
34
- export const Section = styled.div``;
35
- export const Aside = styled.div`
36
- opacity: 0.8;
37
- `;
38
- export const Body = styled.div`
39
- margin-left: ${gridSize() * 2}px;
40
- `;
@@ -1,5 +0,0 @@
1
- import TeamMentionHighlight from './components/TeamMentionHighlight';
2
- import TeamMentionHighlightController from './components/TeamMentionHighlight/TeamMentionHighlightController';
3
- export {
4
- // Components
5
- TeamMentionHighlight, TeamMentionHighlightController };
@@ -1,77 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- export var mentionHighlightLocalStorageKey = 'atlassian.people.context.team.mention.highlight';
5
- var EMPTY = {
6
- seenCount: 0,
7
- dontShow: false
8
- };
9
-
10
- // Don't show if the user can't access local storage
11
- var DISABLED_LOCAL_STORAGE = {
12
- seenCount: 99,
13
- dontShow: true
14
- };
15
- var MAX_SEEN_LIMIT = 5;
16
- var TeamMentionHighlightController = /*#__PURE__*/function () {
17
- function TeamMentionHighlightController() {
18
- _classCallCheck(this, TeamMentionHighlightController);
19
- }
20
- _createClass(TeamMentionHighlightController, null, [{
21
- key: "readFromLocalStorage",
22
- value:
23
- // Note - not a simple look up to avoid showing it to users that have local storage disabled
24
- function readFromLocalStorage() {
25
- try {
26
- var localVal = localStorage.getItem(mentionHighlightLocalStorageKey);
27
- if (!localVal) {
28
- // Attempt to write to see if the user has local storage access
29
- localStorage.setItem(mentionHighlightLocalStorageKey, JSON.stringify(EMPTY));
30
- localVal = localStorage.getItem(mentionHighlightLocalStorageKey);
31
- }
32
- if (localVal) {
33
- return JSON.parse(localVal);
34
- } else {
35
- return DISABLED_LOCAL_STORAGE;
36
- }
37
- } catch (err) {
38
- return DISABLED_LOCAL_STORAGE;
39
- }
40
- }
41
- }, {
42
- key: "saveToLocalStorage",
43
- value: function saveToLocalStorage(item) {
44
- try {
45
- localStorage.setItem(mentionHighlightLocalStorageKey, JSON.stringify(item));
46
- } catch (err) {
47
- // do nothing
48
- }
49
- }
50
- }]);
51
- return TeamMentionHighlightController;
52
- }();
53
- _defineProperty(TeamMentionHighlightController, "markAsDone", function () {
54
- var item = TeamMentionHighlightController.readFromLocalStorage();
55
- item.dontShow = true;
56
- TeamMentionHighlightController.saveToLocalStorage(item);
57
- });
58
- _defineProperty(TeamMentionHighlightController, "isHighlightEnabled", function () {
59
- var item = TeamMentionHighlightController.readFromLocalStorage();
60
- return item.seenCount < MAX_SEEN_LIMIT && !item.dontShow;
61
- });
62
- _defineProperty(TeamMentionHighlightController, "registerRender", function () {
63
- var item = TeamMentionHighlightController.readFromLocalStorage();
64
- item.seenCount += 1;
65
- if (item.seenCount > MAX_SEEN_LIMIT) {
66
- item.dontShow = true;
67
- }
68
- TeamMentionHighlightController.saveToLocalStorage(item);
69
- return item;
70
- });
71
- _defineProperty(TeamMentionHighlightController, "getSeenCount", function () {
72
- return TeamMentionHighlightController.readFromLocalStorage().seenCount;
73
- });
74
- _defineProperty(TeamMentionHighlightController, "registerCreateLinkClick", TeamMentionHighlightController.markAsDone);
75
- _defineProperty(TeamMentionHighlightController, "registerTeamMention", TeamMentionHighlightController.markAsDone);
76
- _defineProperty(TeamMentionHighlightController, "registerClosed", TeamMentionHighlightController.markAsDone);
77
- export { TeamMentionHighlightController as default };