@atlaskit/editor-plugin-mentions 0.1.0 → 0.1.2
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 +12 -0
- package/README.md +24 -3
- package/dist/cjs/nodeviews/mention.js +1 -8
- package/dist/es2019/nodeviews/mention.js +1 -8
- package/dist/esm/nodeviews/mention.js +1 -8
- package/package.json +6 -10
package/CHANGELOG.md
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-mentions
|
|
2
|
+
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#42451](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42451) [`36764ad64a9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/36764ad64a9) - [ECA11Y-87] Mentioned name is not communicated to the users of screen reader
|
|
8
|
+
|
|
9
|
+
## 0.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
package/README.md
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Editor plugin mentions
|
|
2
2
|
|
|
3
3
|
Mentions plugin for @atlaskit/editor-core
|
|
4
4
|
|
|
5
|
+
**Note:** This component is designed for internal Atlassian development.
|
|
6
|
+
External contributors will be able to use this component but will not be able to submit issues.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
---
|
|
10
|
+
- **Install** - *yarn add @atlaskit/editor-plugin-mentions*
|
|
11
|
+
- **npm** - [@atlaskit/editor-plugin-mentions](https://www.npmjs.com/package/@atlaskit/editor-plugin-mentions)
|
|
12
|
+
- **Source** - [Bitbucket](https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/editor/editor-plugin-mentions)
|
|
13
|
+
- **Bundle** - [unpkg.com](https://unpkg.com/@atlaskit/editor-plugin-mentions/dist/)
|
|
14
|
+
|
|
5
15
|
## Usage
|
|
16
|
+
---
|
|
17
|
+
**Internal use only**
|
|
18
|
+
|
|
19
|
+
@atlaskit/editor-plugin-mentions is intended for internal use by the @atlaskit/editor-core and as a plugin dependency of the Editor within your product.
|
|
20
|
+
|
|
21
|
+
Direct use of this component is not supported.
|
|
6
22
|
|
|
7
|
-
|
|
23
|
+
Please see [Atlaskit - Editor plugin mentions](https://atlaskit.atlassian.com/packages/editor/editor-plugin-mentions) for documentation and examples for this package.
|
|
8
24
|
|
|
9
|
-
|
|
25
|
+
## Support
|
|
26
|
+
---
|
|
27
|
+
For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
|
|
28
|
+
## License
|
|
29
|
+
---
|
|
30
|
+
Please see [Atlassian Frontend - License](https://developer.atlassian.com/cloud/framework/atlassian-frontend/#license) for more licensing information.
|
|
@@ -10,11 +10,9 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
var _reactIntlNext = require("react-intl-next");
|
|
14
13
|
var _providerFactory = require("@atlaskit/editor-common/provider-factory");
|
|
15
14
|
var _mention = require("@atlaskit/mention");
|
|
16
15
|
var _types = require("@atlaskit/mention/types");
|
|
17
|
-
var _messages = require("../messages");
|
|
18
16
|
var _Mention = _interopRequireDefault(require("../ui/Mention"));
|
|
19
17
|
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); }
|
|
20
18
|
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; }
|
|
@@ -29,7 +27,6 @@ var MentionAssistiveTextComponent = function MentionAssistiveTextComponent(_ref)
|
|
|
29
27
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
30
28
|
resolvedName = _useState2[0],
|
|
31
29
|
setResolvedName = _useState2[1];
|
|
32
|
-
var intl = (0, _reactIntlNext.useIntl)();
|
|
33
30
|
var processName = function processName(name) {
|
|
34
31
|
if (name.status === _mention.MentionNameStatus.OK) {
|
|
35
32
|
return "@".concat(name.name || '');
|
|
@@ -81,11 +78,7 @@ var MentionAssistiveTextComponent = function MentionAssistiveTextComponent(_ref)
|
|
|
81
78
|
});
|
|
82
79
|
}
|
|
83
80
|
}, [id, text, mentionProvider]);
|
|
84
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
85
|
-
className: 'assistive'
|
|
86
|
-
}, "".concat(intl.formatMessage(_messages.messages.mentionsNodeLabel), " ").concat(resolvedName)), /*#__PURE__*/_react.default.createElement("span", {
|
|
87
|
-
"aria-hidden": "true"
|
|
88
|
-
}, /*#__PURE__*/_react.default.createElement(_Mention.default, {
|
|
81
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_Mention.default, {
|
|
89
82
|
id: id,
|
|
90
83
|
text: resolvedName,
|
|
91
84
|
accessLevel: accessLevel,
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { useIntl } from 'react-intl-next';
|
|
3
2
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
4
3
|
import { isResolvingMentionProvider, MentionNameStatus } from '@atlaskit/mention';
|
|
5
4
|
import { isPromise } from '@atlaskit/mention/types';
|
|
6
|
-
import { messages } from '../messages';
|
|
7
5
|
import Mention from '../ui/Mention';
|
|
8
6
|
const UNKNOWN_USER_ID = '_|unknown|_';
|
|
9
7
|
const MentionAssistiveTextComponent = ({
|
|
@@ -14,7 +12,6 @@ const MentionAssistiveTextComponent = ({
|
|
|
14
12
|
mentionProvider
|
|
15
13
|
}) => {
|
|
16
14
|
const [resolvedName, setResolvedName] = useState(text);
|
|
17
|
-
const intl = useIntl();
|
|
18
15
|
const processName = name => {
|
|
19
16
|
if (name.status === MentionNameStatus.OK) {
|
|
20
17
|
return `@${name.name || ''}`;
|
|
@@ -40,11 +37,7 @@ const MentionAssistiveTextComponent = ({
|
|
|
40
37
|
});
|
|
41
38
|
}
|
|
42
39
|
}, [id, text, mentionProvider]);
|
|
43
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
44
|
-
className: 'assistive'
|
|
45
|
-
}, `${intl.formatMessage(messages.mentionsNodeLabel)} ${resolvedName}`), /*#__PURE__*/React.createElement("span", {
|
|
46
|
-
"aria-hidden": "true"
|
|
47
|
-
}, /*#__PURE__*/React.createElement(Mention, {
|
|
40
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Mention, {
|
|
48
41
|
id: id,
|
|
49
42
|
text: resolvedName,
|
|
50
43
|
accessLevel: accessLevel,
|
|
@@ -2,11 +2,9 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import React, { useEffect, useState } from 'react';
|
|
5
|
-
import { useIntl } from 'react-intl-next';
|
|
6
5
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
7
6
|
import { isResolvingMentionProvider, MentionNameStatus } from '@atlaskit/mention';
|
|
8
7
|
import { isPromise } from '@atlaskit/mention/types';
|
|
9
|
-
import { messages } from '../messages';
|
|
10
8
|
import Mention from '../ui/Mention';
|
|
11
9
|
var UNKNOWN_USER_ID = '_|unknown|_';
|
|
12
10
|
var MentionAssistiveTextComponent = function MentionAssistiveTextComponent(_ref) {
|
|
@@ -19,7 +17,6 @@ var MentionAssistiveTextComponent = function MentionAssistiveTextComponent(_ref)
|
|
|
19
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
20
18
|
resolvedName = _useState2[0],
|
|
21
19
|
setResolvedName = _useState2[1];
|
|
22
|
-
var intl = useIntl();
|
|
23
20
|
var processName = function processName(name) {
|
|
24
21
|
if (name.status === MentionNameStatus.OK) {
|
|
25
22
|
return "@".concat(name.name || '');
|
|
@@ -71,11 +68,7 @@ var MentionAssistiveTextComponent = function MentionAssistiveTextComponent(_ref)
|
|
|
71
68
|
});
|
|
72
69
|
}
|
|
73
70
|
}, [id, text, mentionProvider]);
|
|
74
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
75
|
-
className: 'assistive'
|
|
76
|
-
}, "".concat(intl.formatMessage(messages.mentionsNodeLabel), " ").concat(resolvedName)), /*#__PURE__*/React.createElement("span", {
|
|
77
|
-
"aria-hidden": "true"
|
|
78
|
-
}, /*#__PURE__*/React.createElement(Mention, {
|
|
71
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Mention, {
|
|
79
72
|
id: id,
|
|
80
73
|
text: resolvedName,
|
|
81
74
|
accessLevel: accessLevel,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-mentions",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Mentions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -8,13 +8,9 @@
|
|
|
8
8
|
"registry": "https://registry.npmjs.org/"
|
|
9
9
|
},
|
|
10
10
|
"atlassian": {
|
|
11
|
-
"team": "Editor:
|
|
11
|
+
"team": "Editor: AI",
|
|
12
12
|
"inPublicMirror": false,
|
|
13
|
-
"releaseModel": "continuous"
|
|
14
|
-
"website": {
|
|
15
|
-
"name": "EditorPluginMentions",
|
|
16
|
-
"category": "Components"
|
|
17
|
-
}
|
|
13
|
+
"releaseModel": "continuous"
|
|
18
14
|
},
|
|
19
15
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
20
16
|
"main": "dist/cjs/index.js",
|
|
@@ -37,14 +33,14 @@
|
|
|
37
33
|
"dependencies": {
|
|
38
34
|
"@atlaskit/adf-schema": "^32.0.0",
|
|
39
35
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
40
|
-
"@atlaskit/editor-common": "^76.
|
|
41
|
-
"@atlaskit/editor-plugin-analytics": "^0.
|
|
36
|
+
"@atlaskit/editor-common": "^76.18.0",
|
|
37
|
+
"@atlaskit/editor-plugin-analytics": "^0.3.0",
|
|
42
38
|
"@atlaskit/editor-plugin-type-ahead": "^0.7.0",
|
|
43
39
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
44
40
|
"@atlaskit/icon": "^21.12.0",
|
|
45
41
|
"@atlaskit/mention": "^22.1.0",
|
|
46
42
|
"@atlaskit/theme": "^12.6.0",
|
|
47
|
-
"@atlaskit/tokens": "^1.
|
|
43
|
+
"@atlaskit/tokens": "^1.28.0",
|
|
48
44
|
"@babel/runtime": "^7.0.0",
|
|
49
45
|
"@emotion/react": "^11.7.1",
|
|
50
46
|
"uuid": "^3.1.0"
|