@atlaskit/editor-plugin-type-ahead 16.0.0 → 16.1.1
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/cjs/ui/TypeAheadListItem.js +1 -3
- package/dist/es2019/pm-plugins/utils.js +19 -8
- package/dist/es2019/ui/TypeAheadListItem.js +1 -3
- package/dist/esm/pm-plugins/utils.js +19 -8
- package/dist/esm/ui/TypeAheadListItem.js +1 -3
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-type-ahead
|
|
2
2
|
|
|
3
|
+
## 16.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 16.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`6997a74055219`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6997a74055219) -
|
|
14
|
+
Add profile card on hover in the mentions typeahead for agent mentions
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 16.0.0
|
|
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),
|
|
@@ -271,9 +271,7 @@ var TypeAheadListItem = exports.TypeAheadListItem = /*#__PURE__*/_react.default.
|
|
|
271
271
|
role: "option",
|
|
272
272
|
ref: buttonItemRef,
|
|
273
273
|
isDisabled: itemIsDisabled,
|
|
274
|
-
testId: (0, _experiments.editorExperiment)('platform_synced_block', true) ? item.testId : undefined
|
|
275
|
-
// @ts-ignore
|
|
276
|
-
,
|
|
274
|
+
testId: (0, _experiments.editorExperiment)('platform_synced_block', true) ? item.testId : undefined,
|
|
277
275
|
css: listItemClasses
|
|
278
276
|
}, (0, _react2.jsx)("div", {
|
|
279
277
|
"aria-hidden": true
|
|
@@ -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),
|
|
@@ -284,9 +284,7 @@ export const TypeAheadListItem = /*#__PURE__*/React.memo(({
|
|
|
284
284
|
role: "option",
|
|
285
285
|
ref: buttonItemRef,
|
|
286
286
|
isDisabled: itemIsDisabled,
|
|
287
|
-
testId: editorExperiment('platform_synced_block', true) ? item.testId : undefined
|
|
288
|
-
// @ts-ignore
|
|
289
|
-
,
|
|
287
|
+
testId: editorExperiment('platform_synced_block', true) ? item.testId : undefined,
|
|
290
288
|
css: listItemClasses
|
|
291
289
|
}, jsx("div", {
|
|
292
290
|
"aria-hidden": true
|
|
@@ -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),
|
|
@@ -263,9 +263,7 @@ export var TypeAheadListItem = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
263
263
|
role: "option",
|
|
264
264
|
ref: buttonItemRef,
|
|
265
265
|
isDisabled: itemIsDisabled,
|
|
266
|
-
testId: editorExperiment('platform_synced_block', true) ? item.testId : undefined
|
|
267
|
-
// @ts-ignore
|
|
268
|
-
,
|
|
266
|
+
testId: editorExperiment('platform_synced_block', true) ? item.testId : undefined,
|
|
269
267
|
css: listItemClasses
|
|
270
268
|
}, jsx("div", {
|
|
271
269
|
"aria-hidden": true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-type-ahead",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.1.1",
|
|
4
4
|
"description": "Type-ahead plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"atlaskit:src": "src/index.ts",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@atlaskit/adf-schema": "^
|
|
24
|
+
"@atlaskit/adf-schema": "^57.0.0",
|
|
25
25
|
"@atlaskit/css": "^1.0.0",
|
|
26
26
|
"@atlaskit/editor-plugin-analytics": "^15.0.0",
|
|
27
27
|
"@atlaskit/editor-plugin-connectivity": "^15.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"w3c-keyname": "^2.1.8"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@atlaskit/editor-common": "^119.
|
|
56
|
+
"@atlaskit/editor-common": "^119.4.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
|
}
|