@atlaskit/editor-plugin-type-ahead 15.1.3 → 16.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/pm-plugins/utils.js +19 -8
- package/dist/es2019/pm-plugins/utils.js +19 -8
- package/dist/esm/pm-plugins/utils.js +19 -8
- package/package.json +10 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-type-ahead
|
|
2
2
|
|
|
3
|
+
## 16.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`6997a74055219`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6997a74055219) -
|
|
8
|
+
Add profile card on hover in the mentions typeahead for agent mentions
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 16.0.0
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 15.1.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.skipForwardToSafeItem = exports.skipBackwardToSafeItem = exports.moveSelectedIndex = exports.isTypeAheadOpen = exports.isTypeAheadHandler = exports.isTypeAheadAllowed = exports.getTypeAheadQuery = exports.getTypeAheadListAriaLabels = exports.getTypeAheadHandler = exports.getPluginState = exports.findHandlerByTrigger = exports.findHandler = void 0;
|
|
7
7
|
var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
8
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
9
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
9
10
|
var _updateSelectedIndex = require("./commands/update-selected-index");
|
|
10
11
|
var _itemIsDisabled = require("./item-is-disabled");
|
|
@@ -162,16 +163,26 @@ var moveSelectedIndex = exports.moveSelectedIndex = function moveSelectedIndex(_
|
|
|
162
163
|
};
|
|
163
164
|
};
|
|
164
165
|
var getTypeAheadListAriaLabels = exports.getTypeAheadListAriaLabels = function getTypeAheadListAriaLabels(trigger, intl, item) {
|
|
165
|
-
var _item$
|
|
166
|
+
var _item$emoji, _item$emoji2, _item$emoji3;
|
|
166
167
|
switch (trigger) {
|
|
167
168
|
case '@':
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
169
|
+
{
|
|
170
|
+
var _item$mention, _item$mention2, _item$mention3;
|
|
171
|
+
var description = (0, _experiments.editorExperiment)('platform_editor_agent_mentions', true) && (0, _platformFeatureFlags.fg)('platform_editor_mention_typeahead_profilecard') ? item === null || item === void 0 || (_item$mention = item.mention) === null || _item$mention === void 0 ? void 0 : _item$mention.description : undefined;
|
|
172
|
+
var name = (item === null || item === void 0 || (_item$mention2 = item.mention) === null || _item$mention2 === void 0 ? void 0 : _item$mention2.name) || '';
|
|
173
|
+
var shortName = (item === null || item === void 0 || (_item$mention3 = item.mention) === null || _item$mention3 === void 0 ? void 0 : _item$mention3.mentionName) || '';
|
|
174
|
+
return {
|
|
175
|
+
popupAriaLabel: intl.formatMessage(_typeAhead.typeAheadListMessages.mentionPopupLabel),
|
|
176
|
+
listItemAriaLabel: description ? intl.formatMessage(_typeAhead.typeAheadListMessages.mentionListItemLabelWithDescription, {
|
|
177
|
+
name: name,
|
|
178
|
+
shortName: shortName,
|
|
179
|
+
description: description
|
|
180
|
+
}) : intl.formatMessage(_typeAhead.typeAheadListMessages.metionListItemLabel, {
|
|
181
|
+
name: name,
|
|
182
|
+
shortName: shortName
|
|
183
|
+
})
|
|
184
|
+
};
|
|
185
|
+
}
|
|
175
186
|
case '/':
|
|
176
187
|
return {
|
|
177
188
|
popupAriaLabel: intl.formatMessage(_typeAhead.typeAheadListMessages.quickInsertPopupLabel),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TypeAheadAvailableNodes, typeAheadListMessages } from '@atlaskit/editor-common/type-ahead';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
4
|
import { updateSelectedIndex } from './commands/update-selected-index';
|
|
4
5
|
import { itemIsDisabled } from './item-is-disabled';
|
|
@@ -158,16 +159,26 @@ export const moveSelectedIndex = ({
|
|
|
158
159
|
updateSelectedIndex(nextIndex, api)(editorView.state, editorView.dispatch);
|
|
159
160
|
};
|
|
160
161
|
export const getTypeAheadListAriaLabels = (trigger, intl, item) => {
|
|
161
|
-
var _item$
|
|
162
|
+
var _item$emoji, _item$emoji2, _item$emoji3;
|
|
162
163
|
switch (trigger) {
|
|
163
164
|
case '@':
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
165
|
+
{
|
|
166
|
+
var _item$mention, _item$mention2, _item$mention3;
|
|
167
|
+
const description = editorExperiment('platform_editor_agent_mentions', true) && fg('platform_editor_mention_typeahead_profilecard') ? item === null || item === void 0 ? void 0 : (_item$mention = item.mention) === null || _item$mention === void 0 ? void 0 : _item$mention.description : undefined;
|
|
168
|
+
const name = (item === null || item === void 0 ? void 0 : (_item$mention2 = item.mention) === null || _item$mention2 === void 0 ? void 0 : _item$mention2.name) || '';
|
|
169
|
+
const shortName = (item === null || item === void 0 ? void 0 : (_item$mention3 = item.mention) === null || _item$mention3 === void 0 ? void 0 : _item$mention3.mentionName) || '';
|
|
170
|
+
return {
|
|
171
|
+
popupAriaLabel: intl.formatMessage(typeAheadListMessages.mentionPopupLabel),
|
|
172
|
+
listItemAriaLabel: description ? intl.formatMessage(typeAheadListMessages.mentionListItemLabelWithDescription, {
|
|
173
|
+
name,
|
|
174
|
+
shortName,
|
|
175
|
+
description
|
|
176
|
+
}) : intl.formatMessage(typeAheadListMessages.metionListItemLabel, {
|
|
177
|
+
name,
|
|
178
|
+
shortName
|
|
179
|
+
})
|
|
180
|
+
};
|
|
181
|
+
}
|
|
171
182
|
case '/':
|
|
172
183
|
return {
|
|
173
184
|
popupAriaLabel: intl.formatMessage(typeAheadListMessages.quickInsertPopupLabel),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TypeAheadAvailableNodes, typeAheadListMessages } from '@atlaskit/editor-common/type-ahead';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
4
|
import { updateSelectedIndex } from './commands/update-selected-index';
|
|
4
5
|
import { itemIsDisabled } from './item-is-disabled';
|
|
@@ -156,16 +157,26 @@ export var moveSelectedIndex = function moveSelectedIndex(_ref4) {
|
|
|
156
157
|
};
|
|
157
158
|
};
|
|
158
159
|
export var getTypeAheadListAriaLabels = function getTypeAheadListAriaLabels(trigger, intl, item) {
|
|
159
|
-
var _item$
|
|
160
|
+
var _item$emoji, _item$emoji2, _item$emoji3;
|
|
160
161
|
switch (trigger) {
|
|
161
162
|
case '@':
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
163
|
+
{
|
|
164
|
+
var _item$mention, _item$mention2, _item$mention3;
|
|
165
|
+
var description = editorExperiment('platform_editor_agent_mentions', true) && fg('platform_editor_mention_typeahead_profilecard') ? item === null || item === void 0 || (_item$mention = item.mention) === null || _item$mention === void 0 ? void 0 : _item$mention.description : undefined;
|
|
166
|
+
var name = (item === null || item === void 0 || (_item$mention2 = item.mention) === null || _item$mention2 === void 0 ? void 0 : _item$mention2.name) || '';
|
|
167
|
+
var shortName = (item === null || item === void 0 || (_item$mention3 = item.mention) === null || _item$mention3 === void 0 ? void 0 : _item$mention3.mentionName) || '';
|
|
168
|
+
return {
|
|
169
|
+
popupAriaLabel: intl.formatMessage(typeAheadListMessages.mentionPopupLabel),
|
|
170
|
+
listItemAriaLabel: description ? intl.formatMessage(typeAheadListMessages.mentionListItemLabelWithDescription, {
|
|
171
|
+
name: name,
|
|
172
|
+
shortName: shortName,
|
|
173
|
+
description: description
|
|
174
|
+
}) : intl.formatMessage(typeAheadListMessages.metionListItemLabel, {
|
|
175
|
+
name: name,
|
|
176
|
+
shortName: shortName
|
|
177
|
+
})
|
|
178
|
+
};
|
|
179
|
+
}
|
|
169
180
|
case '/':
|
|
170
181
|
return {
|
|
171
182
|
popupAriaLabel: intl.formatMessage(typeAheadListMessages.quickInsertPopupLabel),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-type-ahead",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.1.0",
|
|
4
4
|
"description": "Type-ahead plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@atlaskit/adf-schema": "^56.7.0",
|
|
25
25
|
"@atlaskit/css": "^1.0.0",
|
|
26
|
-
"@atlaskit/editor-plugin-analytics": "^
|
|
27
|
-
"@atlaskit/editor-plugin-connectivity": "^
|
|
28
|
-
"@atlaskit/editor-plugin-context-panel": "^
|
|
29
|
-
"@atlaskit/editor-plugin-metrics": "^
|
|
30
|
-
"@atlaskit/editor-plugin-ui-control-registry": "^
|
|
26
|
+
"@atlaskit/editor-plugin-analytics": "^15.0.0",
|
|
27
|
+
"@atlaskit/editor-plugin-connectivity": "^15.0.0",
|
|
28
|
+
"@atlaskit/editor-plugin-context-panel": "^17.0.0",
|
|
29
|
+
"@atlaskit/editor-plugin-metrics": "^16.0.0",
|
|
30
|
+
"@atlaskit/editor-plugin-ui-control-registry": "^9.0.0",
|
|
31
31
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
32
32
|
"@atlaskit/editor-shared-styles": "^4.0.0",
|
|
33
33
|
"@atlaskit/editor-ui-control-model": "^2.6.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"w3c-keyname": "^2.1.8"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@atlaskit/editor-common": "^
|
|
56
|
+
"@atlaskit/editor-common": "^119.2.0",
|
|
57
57
|
"react": "^18.2.0 || ^19.2.0",
|
|
58
58
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
59
59
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -98,6 +98,9 @@
|
|
|
98
98
|
},
|
|
99
99
|
"platform_editor_agent_mentions_drop_one_fixes": {
|
|
100
100
|
"type": "boolean"
|
|
101
|
+
},
|
|
102
|
+
"platform_editor_mention_typeahead_profilecard": {
|
|
103
|
+
"type": "boolean"
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
106
|
}
|