@atlaskit/editor-plugin-type-ahead 7.0.0 → 7.0.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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-plugin-type-ahead
2
2
 
3
+ ## 7.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`656adaeec9d0b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/656adaeec9d0b) -
8
+ [ux] EDITOR-1665 add experience tracking for create sync block
9
+ - Updated dependencies
10
+
11
+ ## 7.0.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`31b6da6a9ab84`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/31b6da6a9ab84) -
16
+ Clean up platform_editor_fix_a11y_aria_posinset_0 experiment - Fix ARIA posinset to use 1-based
17
+ indexing
18
+ - Updated dependencies
19
+
3
20
  ## 7.0.0
4
21
 
5
22
  ### Patch Changes
@@ -17,8 +17,8 @@ var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
17
17
  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
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
21
  var _colors = require("@atlaskit/theme/colors");
21
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
22
22
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
23
23
  var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
24
24
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
@@ -116,8 +116,7 @@ var titleWithLozengeStyle = (0, _react2.css)({
116
116
  alignItems: 'center',
117
117
  gap: "var(--ds-space-050, 4px)"
118
118
  });
119
- var FallbackIcon = /*#__PURE__*/_react.default.memo(function (_ref) {
120
- var label = _ref.label;
119
+ var FallbackIcon = /*#__PURE__*/_react.default.memo(function () {
121
120
  return (0, _react2.jsx)(_quickInsert.IconFallback, null);
122
121
  });
123
122
  var noop = function noop() {};
@@ -139,7 +138,7 @@ var CustomItemComponentWrapper = /*#__PURE__*/_react.default.memo(function (prop
139
138
  role: "option",
140
139
  "aria-label": ariaLabel,
141
140
  "aria-setsize": itemsLength,
142
- "aria-posinset": (0, _expValEquals.expValEquals)('platform_editor_fix_a11y_aria_posinset_0', 'isEnabled', true) ? itemIndex + 1 : itemIndex,
141
+ "aria-posinset": itemIndex + 1,
143
142
  tabIndex: 0
144
143
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
145
144
  ,
@@ -159,16 +158,16 @@ var CustomItemComponentWrapper = /*#__PURE__*/_react.default.memo(function (prop
159
158
  onHover: noop
160
159
  })));
161
160
  });
162
- var TypeAheadListItem = exports.TypeAheadListItem = /*#__PURE__*/_react.default.memo(function (_ref2) {
163
- var item = _ref2.item,
164
- itemsLength = _ref2.itemsLength,
165
- selectedIndex = _ref2.selectedIndex,
166
- onItemClick = _ref2.onItemClick,
167
- itemIndex = _ref2.itemIndex,
168
- ariaLabel = _ref2.ariaLabel,
169
- moreElementsInQuickInsertViewEnabled = _ref2.moreElementsInQuickInsertViewEnabled,
170
- api = _ref2.api,
171
- firstOnlineSupportedIndex = _ref2.firstOnlineSupportedIndex;
161
+ var TypeAheadListItem = exports.TypeAheadListItem = /*#__PURE__*/_react.default.memo(function (_ref) {
162
+ var item = _ref.item,
163
+ itemsLength = _ref.itemsLength,
164
+ selectedIndex = _ref.selectedIndex,
165
+ onItemClick = _ref.onItemClick,
166
+ itemIndex = _ref.itemIndex,
167
+ ariaLabel = _ref.ariaLabel,
168
+ moreElementsInQuickInsertViewEnabled = _ref.moreElementsInQuickInsertViewEnabled,
169
+ api = _ref.api,
170
+ firstOnlineSupportedIndex = _ref.firstOnlineSupportedIndex;
172
171
  var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['connectivity'], function (states) {
173
172
  var _states$connectivityS;
174
173
  return {
@@ -206,10 +205,8 @@ var TypeAheadListItem = exports.TypeAheadListItem = /*#__PURE__*/_react.default.
206
205
  var elementIcon = (0, _react.useMemo)(function () {
207
206
  return (0, _react2.jsx)("div", {
208
207
  css: [itemIcon, moreElementsInQuickInsertViewEnabled && itemIconSizeUpdated]
209
- }, icon ? icon() : (0, _react2.jsx)(FallbackIcon, {
210
- label: title
211
- }));
212
- }, [icon, title, moreElementsInQuickInsertViewEnabled]);
208
+ }, icon ? icon() : (0, _react2.jsx)(FallbackIcon, null));
209
+ }, [icon, moreElementsInQuickInsertViewEnabled]);
213
210
  var insertSelectedItem = (0, _react.useCallback)(function () {
214
211
  if (itemIsDisabled) {
215
212
  return;
@@ -260,10 +257,11 @@ var TypeAheadListItem = exports.TypeAheadListItem = /*#__PURE__*/_react.default.
260
257
  "aria-label": title,
261
258
  "aria-describedby": descriptionText || shortcutText ? descriptionId : undefined,
262
259
  "aria-setsize": itemsLength,
263
- "aria-posinset": (0, _expValEquals.expValEquals)('platform_editor_fix_a11y_aria_posinset_0', 'isEnabled', true) ? itemIndex + 1 : itemIndex,
260
+ "aria-posinset": itemIndex + 1,
264
261
  role: "option",
265
262
  ref: buttonItemRef,
266
- isDisabled: itemIsDisabled
263
+ isDisabled: itemIsDisabled,
264
+ testId: (0, _experiments.editorExperiment)('platform_synced_block', true) && (0, _platformFeatureFlags.fg)('platform_synced_block_dogfooding') ? item.testId : undefined
267
265
  // @ts-ignore
268
266
  ,
269
267
  css: listItemClasses
@@ -14,8 +14,8 @@ import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
14
14
  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
+ import { fg } from '@atlaskit/platform-feature-flags';
17
18
  import { B400, N30, N800 } from '@atlaskit/theme/colors';
18
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
19
19
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
20
20
  import VisuallyHidden from '@atlaskit/visually-hidden';
21
21
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
@@ -123,9 +123,7 @@ const titleWithLozengeStyle = css({
123
123
  alignItems: 'center',
124
124
  gap: `${"var(--ds-space-050, 4px)"}`
125
125
  });
126
- const FallbackIcon = /*#__PURE__*/React.memo(({
127
- label
128
- }) => {
126
+ const FallbackIcon = /*#__PURE__*/React.memo(() => {
129
127
  return jsx(IconFallback, null);
130
128
  });
131
129
  const noop = () => {};
@@ -149,7 +147,7 @@ const CustomItemComponentWrapper = /*#__PURE__*/React.memo(props => {
149
147
  role: "option",
150
148
  "aria-label": ariaLabel,
151
149
  "aria-setsize": itemsLength,
152
- "aria-posinset": expValEquals('platform_editor_fix_a11y_aria_posinset_0', 'isEnabled', true) ? itemIndex + 1 : itemIndex,
150
+ "aria-posinset": itemIndex + 1,
153
151
  tabIndex: 0
154
152
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
155
153
  ,
@@ -220,10 +218,8 @@ export const TypeAheadListItem = /*#__PURE__*/React.memo(({
220
218
  const elementIcon = useMemo(() => {
221
219
  return jsx("div", {
222
220
  css: [itemIcon, moreElementsInQuickInsertViewEnabled && itemIconSizeUpdated]
223
- }, icon ? icon() : jsx(FallbackIcon, {
224
- label: title
225
- }));
226
- }, [icon, title, moreElementsInQuickInsertViewEnabled]);
221
+ }, icon ? icon() : jsx(FallbackIcon, null));
222
+ }, [icon, moreElementsInQuickInsertViewEnabled]);
227
223
  const insertSelectedItem = useCallback(() => {
228
224
  if (itemIsDisabled) {
229
225
  return;
@@ -274,10 +270,11 @@ export const TypeAheadListItem = /*#__PURE__*/React.memo(({
274
270
  "aria-label": title,
275
271
  "aria-describedby": descriptionText || shortcutText ? descriptionId : undefined,
276
272
  "aria-setsize": itemsLength,
277
- "aria-posinset": expValEquals('platform_editor_fix_a11y_aria_posinset_0', 'isEnabled', true) ? itemIndex + 1 : itemIndex,
273
+ "aria-posinset": itemIndex + 1,
278
274
  role: "option",
279
275
  ref: buttonItemRef,
280
- isDisabled: itemIsDisabled
276
+ isDisabled: itemIsDisabled,
277
+ testId: editorExperiment('platform_synced_block', true) && fg('platform_synced_block_dogfooding') ? item.testId : undefined
281
278
  // @ts-ignore
282
279
  ,
283
280
  css: listItemClasses
@@ -16,8 +16,8 @@ import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
16
16
  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
+ import { fg } from '@atlaskit/platform-feature-flags';
19
20
  import { B400, N30, N800 } from '@atlaskit/theme/colors';
20
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
21
21
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
22
22
  import VisuallyHidden from '@atlaskit/visually-hidden';
23
23
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
@@ -108,8 +108,7 @@ var titleWithLozengeStyle = css({
108
108
  alignItems: 'center',
109
109
  gap: "var(--ds-space-050, 4px)"
110
110
  });
111
- var FallbackIcon = /*#__PURE__*/React.memo(function (_ref) {
112
- var label = _ref.label;
111
+ var FallbackIcon = /*#__PURE__*/React.memo(function () {
113
112
  return jsx(IconFallback, null);
114
113
  });
115
114
  var noop = function noop() {};
@@ -131,7 +130,7 @@ var CustomItemComponentWrapper = /*#__PURE__*/React.memo(function (props) {
131
130
  role: "option",
132
131
  "aria-label": ariaLabel,
133
132
  "aria-setsize": itemsLength,
134
- "aria-posinset": expValEquals('platform_editor_fix_a11y_aria_posinset_0', 'isEnabled', true) ? itemIndex + 1 : itemIndex,
133
+ "aria-posinset": itemIndex + 1,
135
134
  tabIndex: 0
136
135
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
137
136
  ,
@@ -151,16 +150,16 @@ var CustomItemComponentWrapper = /*#__PURE__*/React.memo(function (props) {
151
150
  onHover: noop
152
151
  })));
153
152
  });
154
- export var TypeAheadListItem = /*#__PURE__*/React.memo(function (_ref2) {
155
- var item = _ref2.item,
156
- itemsLength = _ref2.itemsLength,
157
- selectedIndex = _ref2.selectedIndex,
158
- onItemClick = _ref2.onItemClick,
159
- itemIndex = _ref2.itemIndex,
160
- ariaLabel = _ref2.ariaLabel,
161
- moreElementsInQuickInsertViewEnabled = _ref2.moreElementsInQuickInsertViewEnabled,
162
- api = _ref2.api,
163
- firstOnlineSupportedIndex = _ref2.firstOnlineSupportedIndex;
153
+ export var TypeAheadListItem = /*#__PURE__*/React.memo(function (_ref) {
154
+ var item = _ref.item,
155
+ itemsLength = _ref.itemsLength,
156
+ selectedIndex = _ref.selectedIndex,
157
+ onItemClick = _ref.onItemClick,
158
+ itemIndex = _ref.itemIndex,
159
+ ariaLabel = _ref.ariaLabel,
160
+ moreElementsInQuickInsertViewEnabled = _ref.moreElementsInQuickInsertViewEnabled,
161
+ api = _ref.api,
162
+ firstOnlineSupportedIndex = _ref.firstOnlineSupportedIndex;
164
163
  var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['connectivity'], function (states) {
165
164
  var _states$connectivityS;
166
165
  return {
@@ -198,10 +197,8 @@ export var TypeAheadListItem = /*#__PURE__*/React.memo(function (_ref2) {
198
197
  var elementIcon = useMemo(function () {
199
198
  return jsx("div", {
200
199
  css: [itemIcon, moreElementsInQuickInsertViewEnabled && itemIconSizeUpdated]
201
- }, icon ? icon() : jsx(FallbackIcon, {
202
- label: title
203
- }));
204
- }, [icon, title, moreElementsInQuickInsertViewEnabled]);
200
+ }, icon ? icon() : jsx(FallbackIcon, null));
201
+ }, [icon, moreElementsInQuickInsertViewEnabled]);
205
202
  var insertSelectedItem = useCallback(function () {
206
203
  if (itemIsDisabled) {
207
204
  return;
@@ -252,10 +249,11 @@ export var TypeAheadListItem = /*#__PURE__*/React.memo(function (_ref2) {
252
249
  "aria-label": title,
253
250
  "aria-describedby": descriptionText || shortcutText ? descriptionId : undefined,
254
251
  "aria-setsize": itemsLength,
255
- "aria-posinset": expValEquals('platform_editor_fix_a11y_aria_posinset_0', 'isEnabled', true) ? itemIndex + 1 : itemIndex,
252
+ "aria-posinset": itemIndex + 1,
256
253
  role: "option",
257
254
  ref: buttonItemRef,
258
- isDisabled: itemIsDisabled
255
+ isDisabled: itemIsDisabled,
256
+ testId: editorExperiment('platform_synced_block', true) && fg('platform_synced_block_dogfooding') ? item.testId : undefined
259
257
  // @ts-ignore
260
258
  ,
261
259
  css: listItemClasses
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-type-ahead",
3
- "version": "7.0.0",
3
+ "version": "7.0.2",
4
4
  "description": "Type-ahead plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.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.3.0",
48
+ "@atlaskit/tmp-editor-statsig": "^16.4.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": "^111.0.0",
60
+ "@atlaskit/editor-common": "^111.2.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"
@@ -101,6 +101,9 @@
101
101
  },
102
102
  "platform_editor_refactor_view_more": {
103
103
  "type": "boolean"
104
+ },
105
+ "platform_synced_block_dogfooding": {
106
+ "type": "boolean"
104
107
  }
105
108
  }
106
109
  }