@atlaskit/editor-plugin-type-ahead 6.5.8 → 6.5.10

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,19 @@
1
1
  # @atlaskit/editor-plugin-type-ahead
2
2
 
3
+ ## 6.5.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4b461c96cc5a0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4b461c96cc5a0) -
8
+ Remove fg platform_editor_legacy_content_macro_typeahead_fix
9
+ - Updated dependencies
10
+
11
+ ## 6.5.9
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 6.5.8
4
18
 
5
19
  ### Patch Changes
@@ -256,12 +256,7 @@ var TypeAheadListItem = exports.TypeAheadListItem = /*#__PURE__*/_react.default.
256
256
  iconBefore: elementIcon,
257
257
  isSelected: isSelected,
258
258
  "aria-selected": isSelected,
259
- "aria-label": title
260
- // TODO: ED-26959 - aria-description is in draft for ARIA 1.3.
261
- // For now replace it with aria-describedby.
262
- // eslint-disable-next-line @atlassian/a11y/aria-props -- TODO: Avoid using "aria-description" as aria attribute. See https://go/a11y-aria-props for more details.
263
- ,
264
- "aria-description": (0, _platformFeatureFlags.fg)('platform_editor_a11y_fix_aria_description') ? undefined : "".concat(descriptionText, " ").concat(shortcutText),
259
+ "aria-label": title,
265
260
  "aria-describedby": (descriptionText || shortcutText) && (0, _platformFeatureFlags.fg)('platform_editor_a11y_fix_aria_description') ? descriptionId : undefined,
266
261
  "aria-setsize": itemsLength,
267
262
  "aria-posinset": (0, _expValEquals.expValEquals)('platform_editor_fix_a11y_aria_posinset_0', 'isEnabled', true) ? itemIndex + 1 : itemIndex,
@@ -231,25 +231,19 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
231
231
 
232
232
  // Handles cases like emoji (:) and mention (@) typeaheads that open new typeaheads
233
233
  var isTextSelected = ((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range';
234
- if ((0, _platformFeatureFlags.fg)('platform_editor_legacy_content_macro_typeahead_fix')) {
235
- var innerEditor = anchorElement.closest('.extension-editable-area');
236
- if (innerEditor) {
237
- // When there is no related target, we default to not closing the popup
238
- var newFocusInsideCurrentEditor = !relatedTarget;
239
- if (relatedTarget instanceof HTMLElement) {
240
- // check if the new focus is inside inner editor, keep popup opens
241
- newFocusInsideCurrentEditor = innerEditor.contains(relatedTarget);
242
- }
243
- if (!isTextSelected && newFocusInsideCurrentEditor) {
244
- return;
245
- }
246
- } else {
247
- // if the current focus in outer editor, keep the existing behaviour, do not close the pop up if text is not selected
248
- if (!isTextSelected) {
249
- return;
250
- }
234
+ var innerEditor = anchorElement.closest('.extension-editable-area');
235
+ if (innerEditor) {
236
+ // When there is no related target, we default to not closing the popup
237
+ var newFocusInsideCurrentEditor = !relatedTarget;
238
+ if (relatedTarget instanceof HTMLElement) {
239
+ // check if the new focus is inside inner editor, keep popup opens
240
+ newFocusInsideCurrentEditor = innerEditor.contains(relatedTarget);
241
+ }
242
+ if (!isTextSelected && newFocusInsideCurrentEditor) {
243
+ return;
251
244
  }
252
245
  } else {
246
+ // if the current focus in outer editor, keep the existing behaviour, do not close the pop up if text is not selected
253
247
  if (!isTextSelected) {
254
248
  return;
255
249
  }
@@ -336,9 +330,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
336
330
  }
337
331
  }
338
332
  }, (0, _react2.jsx)("div", {
339
- css: [typeAheadContent, moreElementsInQuickInsertViewEnabled && typeAheadContentOverride, showMoreOptionsButton && typeAheadWrapperWithViewMoreOverride]
340
- // eslint-disable-next-line @atlassian/a11y/no-noninteractive-tabindex
341
- ,
333
+ css: [typeAheadContent, moreElementsInQuickInsertViewEnabled && typeAheadContentOverride, showMoreOptionsButton && typeAheadWrapperWithViewMoreOverride],
342
334
  tabIndex: (0, _platformFeatureFlags.fg)('platform_editor_a11y_fix_typeahead_tabindex') ? undefined : 0
343
335
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
344
336
  ,
@@ -203,25 +203,19 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
203
203
 
204
204
  // Handles cases like emoji and @ typeaheads that open new typeaheads
205
205
  var isTextSelected = ((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range';
206
- if ((0, _platformFeatureFlags.fg)('platform_editor_legacy_content_macro_typeahead_fix')) {
207
- var innerEditor = anchorElement.closest('.extension-editable-area');
208
- if (innerEditor) {
209
- // When there is no related target, we default to not closing the popup
210
- var newFocusInsideCurrentEditor = !relatedTarget;
211
- if (relatedTarget instanceof HTMLElement) {
212
- // check if the new focus is inside inner editor, keep popup opens
213
- newFocusInsideCurrentEditor = innerEditor.contains(relatedTarget);
214
- }
215
- if (!isTextSelected && newFocusInsideCurrentEditor) {
216
- return;
217
- }
218
- } else {
219
- // if the current focus in outer editor, keep the existing behaviour, do not close the pop up if text is not selected
220
- if (!isTextSelected) {
221
- return;
222
- }
206
+ var innerEditor = anchorElement.closest('.extension-editable-area');
207
+ if (innerEditor) {
208
+ // When there is no related target, we default to not closing the popup
209
+ var newFocusInsideCurrentEditor = !relatedTarget;
210
+ if (relatedTarget instanceof HTMLElement) {
211
+ // check if the new focus is inside inner editor, keep popup opens
212
+ newFocusInsideCurrentEditor = innerEditor.contains(relatedTarget);
213
+ }
214
+ if (!isTextSelected && newFocusInsideCurrentEditor) {
215
+ return;
223
216
  }
224
217
  } else {
218
+ // if the current focus in outer editor, keep the existing behaviour, do not close the pop up if text is not selected
225
219
  if (!isTextSelected) {
226
220
  return;
227
221
  }
@@ -310,9 +304,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
310
304
  ariaLabel: null,
311
305
  preventOverflow: true
312
306
  }, (0, _react2.jsx)("div", {
313
- css: [typeAheadContent]
314
- // eslint-disable-next-line @atlassian/a11y/no-noninteractive-tabindex
315
- ,
307
+ css: [typeAheadContent],
316
308
  tabIndex: (0, _platformFeatureFlags.fg)('platform_editor_a11y_fix_typeahead_tabindex') ? undefined : 0
317
309
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
318
310
  ,
@@ -270,12 +270,7 @@ export const TypeAheadListItem = /*#__PURE__*/React.memo(({
270
270
  iconBefore: elementIcon,
271
271
  isSelected: isSelected,
272
272
  "aria-selected": isSelected,
273
- "aria-label": title
274
- // TODO: ED-26959 - aria-description is in draft for ARIA 1.3.
275
- // For now replace it with aria-describedby.
276
- // eslint-disable-next-line @atlassian/a11y/aria-props -- TODO: Avoid using "aria-description" as aria attribute. See https://go/a11y-aria-props for more details.
277
- ,
278
- "aria-description": fg('platform_editor_a11y_fix_aria_description') ? undefined : `${descriptionText} ${shortcutText}`,
273
+ "aria-label": title,
279
274
  "aria-describedby": (descriptionText || shortcutText) && fg('platform_editor_a11y_fix_aria_description') ? descriptionId : undefined,
280
275
  "aria-setsize": itemsLength,
281
276
  "aria-posinset": expValEquals('platform_editor_fix_a11y_aria_posinset_0', 'isEnabled', true) ? itemIndex + 1 : itemIndex,
@@ -222,25 +222,19 @@ export const TypeAheadPopup = /*#__PURE__*/React.memo(props => {
222
222
 
223
223
  // Handles cases like emoji (:) and mention (@) typeaheads that open new typeaheads
224
224
  const isTextSelected = ((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range';
225
- if (fg('platform_editor_legacy_content_macro_typeahead_fix')) {
226
- const innerEditor = anchorElement.closest('.extension-editable-area');
227
- if (innerEditor) {
228
- // When there is no related target, we default to not closing the popup
229
- let newFocusInsideCurrentEditor = !relatedTarget;
230
- if (relatedTarget instanceof HTMLElement) {
231
- // check if the new focus is inside inner editor, keep popup opens
232
- newFocusInsideCurrentEditor = innerEditor.contains(relatedTarget);
233
- }
234
- if (!isTextSelected && newFocusInsideCurrentEditor) {
235
- return;
236
- }
237
- } else {
238
- // if the current focus in outer editor, keep the existing behaviour, do not close the pop up if text is not selected
239
- if (!isTextSelected) {
240
- return;
241
- }
225
+ const innerEditor = anchorElement.closest('.extension-editable-area');
226
+ if (innerEditor) {
227
+ // When there is no related target, we default to not closing the popup
228
+ let newFocusInsideCurrentEditor = !relatedTarget;
229
+ if (relatedTarget instanceof HTMLElement) {
230
+ // check if the new focus is inside inner editor, keep popup opens
231
+ newFocusInsideCurrentEditor = innerEditor.contains(relatedTarget);
232
+ }
233
+ if (!isTextSelected && newFocusInsideCurrentEditor) {
234
+ return;
242
235
  }
243
236
  } else {
237
+ // if the current focus in outer editor, keep the existing behaviour, do not close the pop up if text is not selected
244
238
  if (!isTextSelected) {
245
239
  return;
246
240
  }
@@ -332,9 +326,7 @@ export const TypeAheadPopup = /*#__PURE__*/React.memo(props => {
332
326
  }
333
327
  }
334
328
  }, jsx("div", {
335
- css: [typeAheadContent, moreElementsInQuickInsertViewEnabled && typeAheadContentOverride, showMoreOptionsButton && typeAheadWrapperWithViewMoreOverride]
336
- // eslint-disable-next-line @atlassian/a11y/no-noninteractive-tabindex
337
- ,
329
+ css: [typeAheadContent, moreElementsInQuickInsertViewEnabled && typeAheadContentOverride, showMoreOptionsButton && typeAheadWrapperWithViewMoreOverride],
338
330
  tabIndex: fg('platform_editor_a11y_fix_typeahead_tabindex') ? undefined : 0
339
331
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
340
332
  ,
@@ -195,25 +195,19 @@ export const TypeAheadPopup = /*#__PURE__*/React.memo(props => {
195
195
 
196
196
  // Handles cases like emoji and @ typeaheads that open new typeaheads
197
197
  const isTextSelected = ((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range';
198
- if (fg('platform_editor_legacy_content_macro_typeahead_fix')) {
199
- const innerEditor = anchorElement.closest('.extension-editable-area');
200
- if (innerEditor) {
201
- // When there is no related target, we default to not closing the popup
202
- let newFocusInsideCurrentEditor = !relatedTarget;
203
- if (relatedTarget instanceof HTMLElement) {
204
- // check if the new focus is inside inner editor, keep popup opens
205
- newFocusInsideCurrentEditor = innerEditor.contains(relatedTarget);
206
- }
207
- if (!isTextSelected && newFocusInsideCurrentEditor) {
208
- return;
209
- }
210
- } else {
211
- // if the current focus in outer editor, keep the existing behaviour, do not close the pop up if text is not selected
212
- if (!isTextSelected) {
213
- return;
214
- }
198
+ const innerEditor = anchorElement.closest('.extension-editable-area');
199
+ if (innerEditor) {
200
+ // When there is no related target, we default to not closing the popup
201
+ let newFocusInsideCurrentEditor = !relatedTarget;
202
+ if (relatedTarget instanceof HTMLElement) {
203
+ // check if the new focus is inside inner editor, keep popup opens
204
+ newFocusInsideCurrentEditor = innerEditor.contains(relatedTarget);
205
+ }
206
+ if (!isTextSelected && newFocusInsideCurrentEditor) {
207
+ return;
215
208
  }
216
209
  } else {
210
+ // if the current focus in outer editor, keep the existing behaviour, do not close the pop up if text is not selected
217
211
  if (!isTextSelected) {
218
212
  return;
219
213
  }
@@ -304,9 +298,7 @@ export const TypeAheadPopup = /*#__PURE__*/React.memo(props => {
304
298
  ariaLabel: null,
305
299
  preventOverflow: true
306
300
  }, jsx("div", {
307
- css: [typeAheadContent]
308
- // eslint-disable-next-line @atlassian/a11y/no-noninteractive-tabindex
309
- ,
301
+ css: [typeAheadContent],
310
302
  tabIndex: fg('platform_editor_a11y_fix_typeahead_tabindex') ? undefined : 0
311
303
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
312
304
  ,
@@ -248,12 +248,7 @@ export var TypeAheadListItem = /*#__PURE__*/React.memo(function (_ref2) {
248
248
  iconBefore: elementIcon,
249
249
  isSelected: isSelected,
250
250
  "aria-selected": isSelected,
251
- "aria-label": title
252
- // TODO: ED-26959 - aria-description is in draft for ARIA 1.3.
253
- // For now replace it with aria-describedby.
254
- // eslint-disable-next-line @atlassian/a11y/aria-props -- TODO: Avoid using "aria-description" as aria attribute. See https://go/a11y-aria-props for more details.
255
- ,
256
- "aria-description": fg('platform_editor_a11y_fix_aria_description') ? undefined : "".concat(descriptionText, " ").concat(shortcutText),
251
+ "aria-label": title,
257
252
  "aria-describedby": (descriptionText || shortcutText) && fg('platform_editor_a11y_fix_aria_description') ? descriptionId : undefined,
258
253
  "aria-setsize": itemsLength,
259
254
  "aria-posinset": expValEquals('platform_editor_fix_a11y_aria_posinset_0', 'isEnabled', true) ? itemIndex + 1 : itemIndex,
@@ -221,25 +221,19 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
221
221
 
222
222
  // Handles cases like emoji (:) and mention (@) typeaheads that open new typeaheads
223
223
  var isTextSelected = ((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range';
224
- if (fg('platform_editor_legacy_content_macro_typeahead_fix')) {
225
- var innerEditor = anchorElement.closest('.extension-editable-area');
226
- if (innerEditor) {
227
- // When there is no related target, we default to not closing the popup
228
- var newFocusInsideCurrentEditor = !relatedTarget;
229
- if (relatedTarget instanceof HTMLElement) {
230
- // check if the new focus is inside inner editor, keep popup opens
231
- newFocusInsideCurrentEditor = innerEditor.contains(relatedTarget);
232
- }
233
- if (!isTextSelected && newFocusInsideCurrentEditor) {
234
- return;
235
- }
236
- } else {
237
- // if the current focus in outer editor, keep the existing behaviour, do not close the pop up if text is not selected
238
- if (!isTextSelected) {
239
- return;
240
- }
224
+ var innerEditor = anchorElement.closest('.extension-editable-area');
225
+ if (innerEditor) {
226
+ // When there is no related target, we default to not closing the popup
227
+ var newFocusInsideCurrentEditor = !relatedTarget;
228
+ if (relatedTarget instanceof HTMLElement) {
229
+ // check if the new focus is inside inner editor, keep popup opens
230
+ newFocusInsideCurrentEditor = innerEditor.contains(relatedTarget);
231
+ }
232
+ if (!isTextSelected && newFocusInsideCurrentEditor) {
233
+ return;
241
234
  }
242
235
  } else {
236
+ // if the current focus in outer editor, keep the existing behaviour, do not close the pop up if text is not selected
243
237
  if (!isTextSelected) {
244
238
  return;
245
239
  }
@@ -326,9 +320,7 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
326
320
  }
327
321
  }
328
322
  }, jsx("div", {
329
- css: [typeAheadContent, moreElementsInQuickInsertViewEnabled && typeAheadContentOverride, showMoreOptionsButton && typeAheadWrapperWithViewMoreOverride]
330
- // eslint-disable-next-line @atlassian/a11y/no-noninteractive-tabindex
331
- ,
323
+ css: [typeAheadContent, moreElementsInQuickInsertViewEnabled && typeAheadContentOverride, showMoreOptionsButton && typeAheadWrapperWithViewMoreOverride],
332
324
  tabIndex: fg('platform_editor_a11y_fix_typeahead_tabindex') ? undefined : 0
333
325
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
334
326
  ,
@@ -194,25 +194,19 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
194
194
 
195
195
  // Handles cases like emoji and @ typeaheads that open new typeaheads
196
196
  var isTextSelected = ((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range';
197
- if (fg('platform_editor_legacy_content_macro_typeahead_fix')) {
198
- var innerEditor = anchorElement.closest('.extension-editable-area');
199
- if (innerEditor) {
200
- // When there is no related target, we default to not closing the popup
201
- var newFocusInsideCurrentEditor = !relatedTarget;
202
- if (relatedTarget instanceof HTMLElement) {
203
- // check if the new focus is inside inner editor, keep popup opens
204
- newFocusInsideCurrentEditor = innerEditor.contains(relatedTarget);
205
- }
206
- if (!isTextSelected && newFocusInsideCurrentEditor) {
207
- return;
208
- }
209
- } else {
210
- // if the current focus in outer editor, keep the existing behaviour, do not close the pop up if text is not selected
211
- if (!isTextSelected) {
212
- return;
213
- }
197
+ var innerEditor = anchorElement.closest('.extension-editable-area');
198
+ if (innerEditor) {
199
+ // When there is no related target, we default to not closing the popup
200
+ var newFocusInsideCurrentEditor = !relatedTarget;
201
+ if (relatedTarget instanceof HTMLElement) {
202
+ // check if the new focus is inside inner editor, keep popup opens
203
+ newFocusInsideCurrentEditor = innerEditor.contains(relatedTarget);
204
+ }
205
+ if (!isTextSelected && newFocusInsideCurrentEditor) {
206
+ return;
214
207
  }
215
208
  } else {
209
+ // if the current focus in outer editor, keep the existing behaviour, do not close the pop up if text is not selected
216
210
  if (!isTextSelected) {
217
211
  return;
218
212
  }
@@ -301,9 +295,7 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
301
295
  ariaLabel: null,
302
296
  preventOverflow: true
303
297
  }, jsx("div", {
304
- css: [typeAheadContent]
305
- // eslint-disable-next-line @atlassian/a11y/no-noninteractive-tabindex
306
- ,
298
+ css: [typeAheadContent],
307
299
  tabIndex: fg('platform_editor_a11y_fix_typeahead_tabindex') ? undefined : 0
308
300
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
309
301
  ,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-type-ahead",
3
- "version": "6.5.8",
3
+ "version": "6.5.10",
4
4
  "description": "Type-ahead plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,15 +39,15 @@
39
39
  "@atlaskit/editor-shared-styles": "^3.8.0",
40
40
  "@atlaskit/heading": "^5.2.0",
41
41
  "@atlaskit/icon": "^28.5.0",
42
- "@atlaskit/insm": "^0.1.0",
42
+ "@atlaskit/insm": "^0.2.0",
43
43
  "@atlaskit/menu": "^8.4.0",
44
44
  "@atlaskit/platform-feature-flags": "^1.1.0",
45
45
  "@atlaskit/primitives": "^16.1.0",
46
46
  "@atlaskit/prosemirror-history": "^0.2.0",
47
47
  "@atlaskit/prosemirror-input-rules": "^3.5.0",
48
48
  "@atlaskit/theme": "^21.0.0",
49
- "@atlaskit/tmp-editor-statsig": "^13.20.0",
50
- "@atlaskit/tokens": "^7.0.0",
49
+ "@atlaskit/tmp-editor-statsig": "^13.26.0",
50
+ "@atlaskit/tokens": "^7.1.0",
51
51
  "@atlaskit/visually-hidden": "^3.0.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "@emotion/react": "^11.7.1",
@@ -58,7 +58,7 @@
58
58
  "w3c-keyname": "^2.1.8"
59
59
  },
60
60
  "peerDependencies": {
61
- "@atlaskit/editor-common": "^110.18.0",
61
+ "@atlaskit/editor-common": "^110.21.0",
62
62
  "react": "^18.2.0",
63
63
  "react-dom": "^18.2.0",
64
64
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -93,9 +93,6 @@
93
93
  }
94
94
  },
95
95
  "platform-feature-flags": {
96
- "platform_editor_legacy_content_macro_typeahead_fix": {
97
- "type": "boolean"
98
- },
99
96
  "platform_editor_quick_insert_placeholder": {
100
97
  "type": "boolean"
101
98
  },