@atlaskit/editor-plugin-type-ahead 6.6.1 → 7.0.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
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-type-ahead
|
|
2
2
|
|
|
3
|
+
## 7.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`31b6da6a9ab84`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/31b6da6a9ab84) -
|
|
8
|
+
Clean up platform_editor_fix_a11y_aria_posinset_0 experiment - Fix ARIA posinset to use 1-based
|
|
9
|
+
indexing
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 7.0.0
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 6.6.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -18,7 +18,6 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
18
18
|
var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
19
19
|
var _menu = require("@atlaskit/menu");
|
|
20
20
|
var _colors = require("@atlaskit/theme/colors");
|
|
21
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
22
21
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
23
22
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
24
23
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
@@ -116,8 +115,7 @@ var titleWithLozengeStyle = (0, _react2.css)({
|
|
|
116
115
|
alignItems: 'center',
|
|
117
116
|
gap: "var(--ds-space-050, 4px)"
|
|
118
117
|
});
|
|
119
|
-
var FallbackIcon = /*#__PURE__*/_react.default.memo(function (
|
|
120
|
-
var label = _ref.label;
|
|
118
|
+
var FallbackIcon = /*#__PURE__*/_react.default.memo(function () {
|
|
121
119
|
return (0, _react2.jsx)(_quickInsert.IconFallback, null);
|
|
122
120
|
});
|
|
123
121
|
var noop = function noop() {};
|
|
@@ -139,7 +137,7 @@ var CustomItemComponentWrapper = /*#__PURE__*/_react.default.memo(function (prop
|
|
|
139
137
|
role: "option",
|
|
140
138
|
"aria-label": ariaLabel,
|
|
141
139
|
"aria-setsize": itemsLength,
|
|
142
|
-
"aria-posinset":
|
|
140
|
+
"aria-posinset": itemIndex + 1,
|
|
143
141
|
tabIndex: 0
|
|
144
142
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
145
143
|
,
|
|
@@ -159,16 +157,16 @@ var CustomItemComponentWrapper = /*#__PURE__*/_react.default.memo(function (prop
|
|
|
159
157
|
onHover: noop
|
|
160
158
|
})));
|
|
161
159
|
});
|
|
162
|
-
var TypeAheadListItem = exports.TypeAheadListItem = /*#__PURE__*/_react.default.memo(function (
|
|
163
|
-
var item =
|
|
164
|
-
itemsLength =
|
|
165
|
-
selectedIndex =
|
|
166
|
-
onItemClick =
|
|
167
|
-
itemIndex =
|
|
168
|
-
ariaLabel =
|
|
169
|
-
moreElementsInQuickInsertViewEnabled =
|
|
170
|
-
api =
|
|
171
|
-
firstOnlineSupportedIndex =
|
|
160
|
+
var TypeAheadListItem = exports.TypeAheadListItem = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
161
|
+
var item = _ref.item,
|
|
162
|
+
itemsLength = _ref.itemsLength,
|
|
163
|
+
selectedIndex = _ref.selectedIndex,
|
|
164
|
+
onItemClick = _ref.onItemClick,
|
|
165
|
+
itemIndex = _ref.itemIndex,
|
|
166
|
+
ariaLabel = _ref.ariaLabel,
|
|
167
|
+
moreElementsInQuickInsertViewEnabled = _ref.moreElementsInQuickInsertViewEnabled,
|
|
168
|
+
api = _ref.api,
|
|
169
|
+
firstOnlineSupportedIndex = _ref.firstOnlineSupportedIndex;
|
|
172
170
|
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['connectivity'], function (states) {
|
|
173
171
|
var _states$connectivityS;
|
|
174
172
|
return {
|
|
@@ -206,10 +204,8 @@ var TypeAheadListItem = exports.TypeAheadListItem = /*#__PURE__*/_react.default.
|
|
|
206
204
|
var elementIcon = (0, _react.useMemo)(function () {
|
|
207
205
|
return (0, _react2.jsx)("div", {
|
|
208
206
|
css: [itemIcon, moreElementsInQuickInsertViewEnabled && itemIconSizeUpdated]
|
|
209
|
-
}, icon ? icon() : (0, _react2.jsx)(FallbackIcon,
|
|
210
|
-
|
|
211
|
-
}));
|
|
212
|
-
}, [icon, title, moreElementsInQuickInsertViewEnabled]);
|
|
207
|
+
}, icon ? icon() : (0, _react2.jsx)(FallbackIcon, null));
|
|
208
|
+
}, [icon, moreElementsInQuickInsertViewEnabled]);
|
|
213
209
|
var insertSelectedItem = (0, _react.useCallback)(function () {
|
|
214
210
|
if (itemIsDisabled) {
|
|
215
211
|
return;
|
|
@@ -260,7 +256,7 @@ var TypeAheadListItem = exports.TypeAheadListItem = /*#__PURE__*/_react.default.
|
|
|
260
256
|
"aria-label": title,
|
|
261
257
|
"aria-describedby": descriptionText || shortcutText ? descriptionId : undefined,
|
|
262
258
|
"aria-setsize": itemsLength,
|
|
263
|
-
"aria-posinset":
|
|
259
|
+
"aria-posinset": itemIndex + 1,
|
|
264
260
|
role: "option",
|
|
265
261
|
ref: buttonItemRef,
|
|
266
262
|
isDisabled: itemIsDisabled
|
|
@@ -15,7 +15,6 @@ import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
|
15
15
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
16
16
|
import { ButtonItem } from '@atlaskit/menu';
|
|
17
17
|
import { B400, N30, N800 } from '@atlaskit/theme/colors';
|
|
18
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
19
18
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
20
19
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
21
20
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
@@ -123,9 +122,7 @@ const titleWithLozengeStyle = css({
|
|
|
123
122
|
alignItems: 'center',
|
|
124
123
|
gap: `${"var(--ds-space-050, 4px)"}`
|
|
125
124
|
});
|
|
126
|
-
const FallbackIcon = /*#__PURE__*/React.memo(({
|
|
127
|
-
label
|
|
128
|
-
}) => {
|
|
125
|
+
const FallbackIcon = /*#__PURE__*/React.memo(() => {
|
|
129
126
|
return jsx(IconFallback, null);
|
|
130
127
|
});
|
|
131
128
|
const noop = () => {};
|
|
@@ -149,7 +146,7 @@ const CustomItemComponentWrapper = /*#__PURE__*/React.memo(props => {
|
|
|
149
146
|
role: "option",
|
|
150
147
|
"aria-label": ariaLabel,
|
|
151
148
|
"aria-setsize": itemsLength,
|
|
152
|
-
"aria-posinset":
|
|
149
|
+
"aria-posinset": itemIndex + 1,
|
|
153
150
|
tabIndex: 0
|
|
154
151
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
155
152
|
,
|
|
@@ -220,10 +217,8 @@ export const TypeAheadListItem = /*#__PURE__*/React.memo(({
|
|
|
220
217
|
const elementIcon = useMemo(() => {
|
|
221
218
|
return jsx("div", {
|
|
222
219
|
css: [itemIcon, moreElementsInQuickInsertViewEnabled && itemIconSizeUpdated]
|
|
223
|
-
}, icon ? icon() : jsx(FallbackIcon,
|
|
224
|
-
|
|
225
|
-
}));
|
|
226
|
-
}, [icon, title, moreElementsInQuickInsertViewEnabled]);
|
|
220
|
+
}, icon ? icon() : jsx(FallbackIcon, null));
|
|
221
|
+
}, [icon, moreElementsInQuickInsertViewEnabled]);
|
|
227
222
|
const insertSelectedItem = useCallback(() => {
|
|
228
223
|
if (itemIsDisabled) {
|
|
229
224
|
return;
|
|
@@ -274,7 +269,7 @@ export const TypeAheadListItem = /*#__PURE__*/React.memo(({
|
|
|
274
269
|
"aria-label": title,
|
|
275
270
|
"aria-describedby": descriptionText || shortcutText ? descriptionId : undefined,
|
|
276
271
|
"aria-setsize": itemsLength,
|
|
277
|
-
"aria-posinset":
|
|
272
|
+
"aria-posinset": itemIndex + 1,
|
|
278
273
|
role: "option",
|
|
279
274
|
ref: buttonItemRef,
|
|
280
275
|
isDisabled: itemIsDisabled
|
|
@@ -17,7 +17,6 @@ import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
|
17
17
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
18
18
|
import { ButtonItem } from '@atlaskit/menu';
|
|
19
19
|
import { B400, N30, N800 } from '@atlaskit/theme/colors';
|
|
20
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
21
20
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
22
21
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
23
22
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
@@ -108,8 +107,7 @@ var titleWithLozengeStyle = css({
|
|
|
108
107
|
alignItems: 'center',
|
|
109
108
|
gap: "var(--ds-space-050, 4px)"
|
|
110
109
|
});
|
|
111
|
-
var FallbackIcon = /*#__PURE__*/React.memo(function (
|
|
112
|
-
var label = _ref.label;
|
|
110
|
+
var FallbackIcon = /*#__PURE__*/React.memo(function () {
|
|
113
111
|
return jsx(IconFallback, null);
|
|
114
112
|
});
|
|
115
113
|
var noop = function noop() {};
|
|
@@ -131,7 +129,7 @@ var CustomItemComponentWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
131
129
|
role: "option",
|
|
132
130
|
"aria-label": ariaLabel,
|
|
133
131
|
"aria-setsize": itemsLength,
|
|
134
|
-
"aria-posinset":
|
|
132
|
+
"aria-posinset": itemIndex + 1,
|
|
135
133
|
tabIndex: 0
|
|
136
134
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
137
135
|
,
|
|
@@ -151,16 +149,16 @@ var CustomItemComponentWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
151
149
|
onHover: noop
|
|
152
150
|
})));
|
|
153
151
|
});
|
|
154
|
-
export var TypeAheadListItem = /*#__PURE__*/React.memo(function (
|
|
155
|
-
var item =
|
|
156
|
-
itemsLength =
|
|
157
|
-
selectedIndex =
|
|
158
|
-
onItemClick =
|
|
159
|
-
itemIndex =
|
|
160
|
-
ariaLabel =
|
|
161
|
-
moreElementsInQuickInsertViewEnabled =
|
|
162
|
-
api =
|
|
163
|
-
firstOnlineSupportedIndex =
|
|
152
|
+
export var TypeAheadListItem = /*#__PURE__*/React.memo(function (_ref) {
|
|
153
|
+
var item = _ref.item,
|
|
154
|
+
itemsLength = _ref.itemsLength,
|
|
155
|
+
selectedIndex = _ref.selectedIndex,
|
|
156
|
+
onItemClick = _ref.onItemClick,
|
|
157
|
+
itemIndex = _ref.itemIndex,
|
|
158
|
+
ariaLabel = _ref.ariaLabel,
|
|
159
|
+
moreElementsInQuickInsertViewEnabled = _ref.moreElementsInQuickInsertViewEnabled,
|
|
160
|
+
api = _ref.api,
|
|
161
|
+
firstOnlineSupportedIndex = _ref.firstOnlineSupportedIndex;
|
|
164
162
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['connectivity'], function (states) {
|
|
165
163
|
var _states$connectivityS;
|
|
166
164
|
return {
|
|
@@ -198,10 +196,8 @@ export var TypeAheadListItem = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
198
196
|
var elementIcon = useMemo(function () {
|
|
199
197
|
return jsx("div", {
|
|
200
198
|
css: [itemIcon, moreElementsInQuickInsertViewEnabled && itemIconSizeUpdated]
|
|
201
|
-
}, icon ? icon() : jsx(FallbackIcon,
|
|
202
|
-
|
|
203
|
-
}));
|
|
204
|
-
}, [icon, title, moreElementsInQuickInsertViewEnabled]);
|
|
199
|
+
}, icon ? icon() : jsx(FallbackIcon, null));
|
|
200
|
+
}, [icon, moreElementsInQuickInsertViewEnabled]);
|
|
205
201
|
var insertSelectedItem = useCallback(function () {
|
|
206
202
|
if (itemIsDisabled) {
|
|
207
203
|
return;
|
|
@@ -252,7 +248,7 @@ export var TypeAheadListItem = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
252
248
|
"aria-label": title,
|
|
253
249
|
"aria-describedby": descriptionText || shortcutText ? descriptionId : undefined,
|
|
254
250
|
"aria-setsize": itemsLength,
|
|
255
|
-
"aria-posinset":
|
|
251
|
+
"aria-posinset": itemIndex + 1,
|
|
256
252
|
role: "option",
|
|
257
253
|
ref: buttonItemRef,
|
|
258
254
|
isDisabled: itemIsDisabled
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-type-ahead",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"description": "Type-ahead plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"atlaskit:src": "src/index.ts",
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/adf-schema": "^51.5.0",
|
|
33
|
-
"@atlaskit/editor-plugin-analytics": "^
|
|
34
|
-
"@atlaskit/editor-plugin-connectivity": "^
|
|
35
|
-
"@atlaskit/editor-plugin-context-panel": "^
|
|
36
|
-
"@atlaskit/editor-plugin-metrics": "^
|
|
33
|
+
"@atlaskit/editor-plugin-analytics": "^7.0.0",
|
|
34
|
+
"@atlaskit/editor-plugin-connectivity": "^7.0.0",
|
|
35
|
+
"@atlaskit/editor-plugin-context-panel": "^9.0.0",
|
|
36
|
+
"@atlaskit/editor-plugin-metrics": "^8.0.0",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "^7.2.0",
|
|
38
38
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
39
39
|
"@atlaskit/feature-gate-js-client": "^5.5.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
46
46
|
"@atlaskit/prosemirror-input-rules": "^3.6.0",
|
|
47
47
|
"@atlaskit/theme": "^21.0.0",
|
|
48
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
48
|
+
"@atlaskit/tmp-editor-statsig": "^16.3.0",
|
|
49
49
|
"@atlaskit/tokens": "^9.0.0",
|
|
50
50
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"w3c-keyname": "^2.1.8"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@atlaskit/editor-common": "^
|
|
60
|
+
"@atlaskit/editor-common": "^111.0.0",
|
|
61
61
|
"react": "^18.2.0",
|
|
62
62
|
"react-dom": "^18.2.0",
|
|
63
63
|
"react-intl-next": "npm:react-intl@^5.18.1"
|