@atlaskit/editor-plugin-floating-toolbar 9.1.13 → 9.1.15

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,18 @@
1
1
  # @atlaskit/editor-plugin-floating-toolbar
2
2
 
3
+ ## 9.1.15
4
+
5
+ ### Patch Changes
6
+
7
+ - [`34c3a60cb9325`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/34c3a60cb9325) -
8
+ Cleanup FG platform_editor_fix_confirm_table_removal
9
+
10
+ ## 9.1.14
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 9.1.13
4
17
 
5
18
  ### Patch Changes
@@ -394,29 +394,20 @@ function ContentComponent(_ref5) {
394
394
 
395
395
  // Confirm dialog
396
396
  var confirmButtonItem;
397
- if ((0, _platformFeatureFlags.fg)('platform_editor_fix_confirm_table_removal')) {
398
- var _ref7 = floatingToolbarData || {},
399
- confirmDialogForItem = _ref7.confirmDialogForItem,
400
- confirmDialogForItemOption = _ref7.confirmDialogForItemOption;
401
- var matchingItem = confirmDialogForItem ? toolbarItems === null || toolbarItems === void 0 ? void 0 : toolbarItems[confirmDialogForItem] : undefined;
402
- if ((matchingItem === null || matchingItem === void 0 ? void 0 : matchingItem.type) === 'button') {
403
- confirmButtonItem = matchingItem;
404
- }
405
- if ((matchingItem === null || matchingItem === void 0 ? void 0 : matchingItem.type) === 'overflow-dropdown' && confirmDialogForItemOption !== undefined) {
406
- var matchingItemOption = matchingItem.options[confirmDialogForItemOption];
397
+ var _ref7 = floatingToolbarData || {},
398
+ confirmDialogForItem = _ref7.confirmDialogForItem,
399
+ confirmDialogForItemOption = _ref7.confirmDialogForItemOption;
400
+ var matchingItem = confirmDialogForItem ? toolbarItems === null || toolbarItems === void 0 ? void 0 : toolbarItems[confirmDialogForItem] : undefined;
401
+ if ((matchingItem === null || matchingItem === void 0 ? void 0 : matchingItem.type) === 'button') {
402
+ confirmButtonItem = matchingItem;
403
+ }
404
+ if ((matchingItem === null || matchingItem === void 0 ? void 0 : matchingItem.type) === 'overflow-dropdown' && confirmDialogForItemOption !== undefined) {
405
+ var matchingItemOption = matchingItem.options[confirmDialogForItemOption];
407
406
 
408
- // OverflowDropdownOption is the only member of the union that does not have a 'type' property
409
- if (!('type' in matchingItemOption)) {
410
- confirmButtonItem = matchingItemOption;
411
- }
407
+ // OverflowDropdownOption is the only member of the union that does not have a 'type' property
408
+ if (!('type' in matchingItemOption)) {
409
+ confirmButtonItem = matchingItemOption;
412
410
  }
413
- } else {
414
- var _ref8 = floatingToolbarData || {},
415
- _confirmDialogForItem = _ref8.confirmDialogForItem;
416
- confirmButtonItem = _confirmDialogForItem ?
417
- // Ignored via go/ees005
418
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
419
- toolbarItems[_confirmDialogForItem] : undefined;
420
411
  }
421
412
  var scrollable = config.scrollable;
422
413
  var confirmDialogOptions = typeof ((_confirmButtonItem = confirmButtonItem) === null || _confirmButtonItem === void 0 ? void 0 : _confirmButtonItem.confirmDialog) === 'function' ? (_confirmButtonItem2 = confirmButtonItem) === null || _confirmButtonItem2 === void 0 ? void 0 : _confirmButtonItem2.confirmDialog() : (_confirmButtonItem3 = confirmButtonItem) === null || _confirmButtonItem3 === void 0 ? void 0 : _confirmButtonItem3.confirmDialog;
@@ -26,7 +26,6 @@ var _uiColor = require("@atlaskit/editor-common/ui-color");
26
26
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
27
27
  var _editorPalette = require("@atlaskit/editor-palette");
28
28
  var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
29
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
30
29
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
31
30
  var _forceFocus = require("../pm-plugins/force-focus");
32
31
  var _commands = require("../pm-plugins/toolbar-data/commands");
@@ -195,25 +194,20 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
195
194
  return item.render(editorView, idx, dispatchAnalyticsEvent);
196
195
  }
197
196
  case 'overflow-dropdown':
198
- var options;
199
- if ((0, _platformFeatureFlags.fg)('platform_editor_fix_confirm_table_removal')) {
200
- // if an option has a confirmDialog, we need to replace its onClick handler
201
- // to set the state to show the confirm dialog
197
+ // if an option has a confirmDialog, we need to replace its onClick handler
198
+ // to set the state to show the confirm dialog
202
199
 
203
- // crudely done here to avoid greater coupling with DropdownMenuItem from `floating-toolbar`
204
- // which would need knowledge of indexes, showConfirmDialog etc.
205
- options = item.options.map(function (option, optionIndex) {
206
- if (!('type' in option) && option.confirmDialog) {
207
- var onClick = option.confirmDialog ? (0, _commands.showConfirmDialog)(idx, optionIndex) : option.onClick;
208
- return _objectSpread(_objectSpread({}, option), {}, {
209
- onClick: onClick
210
- });
211
- }
212
- return option;
213
- });
214
- } else {
215
- options = item.options;
216
- }
200
+ // crudely done here to avoid greater coupling with DropdownMenuItem from `floating-toolbar`
201
+ // which would need knowledge of indexes, showConfirmDialog etc.
202
+ var options = item.options.map(function (option, optionIndex) {
203
+ if (!('type' in option) && option.confirmDialog) {
204
+ var onClick = option.confirmDialog ? (0, _commands.showConfirmDialog)(idx, optionIndex) : option.onClick;
205
+ return _objectSpread(_objectSpread({}, option), {}, {
206
+ onClick: onClick
207
+ });
208
+ }
209
+ return option;
210
+ });
217
211
  return (0, _react2.jsx)(_Dropdown.default, {
218
212
  alignX: areAnyNewToolbarFlagsEnabled ? 'right' : undefined,
219
213
  key: idx,
@@ -377,31 +377,21 @@ export function ContentComponent({
377
377
 
378
378
  // Confirm dialog
379
379
  let confirmButtonItem;
380
- if (fg('platform_editor_fix_confirm_table_removal')) {
381
- const {
382
- confirmDialogForItem,
383
- confirmDialogForItemOption
384
- } = floatingToolbarData || {};
385
- const matchingItem = confirmDialogForItem ? toolbarItems === null || toolbarItems === void 0 ? void 0 : toolbarItems[confirmDialogForItem] : undefined;
386
- if ((matchingItem === null || matchingItem === void 0 ? void 0 : matchingItem.type) === 'button') {
387
- confirmButtonItem = matchingItem;
388
- }
389
- if ((matchingItem === null || matchingItem === void 0 ? void 0 : matchingItem.type) === 'overflow-dropdown' && confirmDialogForItemOption !== undefined) {
390
- const matchingItemOption = matchingItem.options[confirmDialogForItemOption];
380
+ const {
381
+ confirmDialogForItem,
382
+ confirmDialogForItemOption
383
+ } = floatingToolbarData || {};
384
+ const matchingItem = confirmDialogForItem ? toolbarItems === null || toolbarItems === void 0 ? void 0 : toolbarItems[confirmDialogForItem] : undefined;
385
+ if ((matchingItem === null || matchingItem === void 0 ? void 0 : matchingItem.type) === 'button') {
386
+ confirmButtonItem = matchingItem;
387
+ }
388
+ if ((matchingItem === null || matchingItem === void 0 ? void 0 : matchingItem.type) === 'overflow-dropdown' && confirmDialogForItemOption !== undefined) {
389
+ const matchingItemOption = matchingItem.options[confirmDialogForItemOption];
391
390
 
392
- // OverflowDropdownOption is the only member of the union that does not have a 'type' property
393
- if (!('type' in matchingItemOption)) {
394
- confirmButtonItem = matchingItemOption;
395
- }
391
+ // OverflowDropdownOption is the only member of the union that does not have a 'type' property
392
+ if (!('type' in matchingItemOption)) {
393
+ confirmButtonItem = matchingItemOption;
396
394
  }
397
- } else {
398
- const {
399
- confirmDialogForItem
400
- } = floatingToolbarData || {};
401
- confirmButtonItem = confirmDialogForItem ?
402
- // Ignored via go/ees005
403
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
404
- toolbarItems[confirmDialogForItem] : undefined;
405
395
  }
406
396
  const scrollable = config.scrollable;
407
397
  const confirmDialogOptions = typeof ((_confirmButtonItem = confirmButtonItem) === null || _confirmButtonItem === void 0 ? void 0 : _confirmButtonItem.confirmDialog) === 'function' ? (_confirmButtonItem2 = confirmButtonItem) === null || _confirmButtonItem2 === void 0 ? void 0 : _confirmButtonItem2.confirmDialog() : (_confirmButtonItem3 = confirmButtonItem) === null || _confirmButtonItem3 === void 0 ? void 0 : _confirmButtonItem3.confirmDialog;
@@ -19,7 +19,6 @@ import { backgroundPaletteTooltipMessages } from '@atlaskit/editor-common/ui-col
19
19
  import { ColorPickerButton, ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
20
20
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
21
21
  import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
22
- import { fg } from '@atlaskit/platform-feature-flags';
23
22
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
24
23
  import { checkShouldForceFocusAndApply, forceFocusSelector } from '../pm-plugins/force-focus';
25
24
  import { showConfirmDialog } from '../pm-plugins/toolbar-data/commands';
@@ -171,26 +170,21 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
171
170
  return item.render(editorView, idx, dispatchAnalyticsEvent);
172
171
  }
173
172
  case 'overflow-dropdown':
174
- let options;
175
- if (fg('platform_editor_fix_confirm_table_removal')) {
176
- // if an option has a confirmDialog, we need to replace its onClick handler
177
- // to set the state to show the confirm dialog
173
+ // if an option has a confirmDialog, we need to replace its onClick handler
174
+ // to set the state to show the confirm dialog
178
175
 
179
- // crudely done here to avoid greater coupling with DropdownMenuItem from `floating-toolbar`
180
- // which would need knowledge of indexes, showConfirmDialog etc.
181
- options = item.options.map((option, optionIndex) => {
182
- if (!('type' in option) && option.confirmDialog) {
183
- const onClick = option.confirmDialog ? showConfirmDialog(idx, optionIndex) : option.onClick;
184
- return {
185
- ...option,
186
- onClick
187
- };
188
- }
189
- return option;
190
- });
191
- } else {
192
- options = item.options;
193
- }
176
+ // crudely done here to avoid greater coupling with DropdownMenuItem from `floating-toolbar`
177
+ // which would need knowledge of indexes, showConfirmDialog etc.
178
+ const options = item.options.map((option, optionIndex) => {
179
+ if (!('type' in option) && option.confirmDialog) {
180
+ const onClick = option.confirmDialog ? showConfirmDialog(idx, optionIndex) : option.onClick;
181
+ return {
182
+ ...option,
183
+ onClick
184
+ };
185
+ }
186
+ return option;
187
+ });
194
188
  return jsx(Dropdown, {
195
189
  alignX: areAnyNewToolbarFlagsEnabled ? 'right' : undefined,
196
190
  key: idx,
@@ -384,29 +384,20 @@ export function ContentComponent(_ref5) {
384
384
 
385
385
  // Confirm dialog
386
386
  var confirmButtonItem;
387
- if (fg('platform_editor_fix_confirm_table_removal')) {
388
- var _ref7 = floatingToolbarData || {},
389
- confirmDialogForItem = _ref7.confirmDialogForItem,
390
- confirmDialogForItemOption = _ref7.confirmDialogForItemOption;
391
- var matchingItem = confirmDialogForItem ? toolbarItems === null || toolbarItems === void 0 ? void 0 : toolbarItems[confirmDialogForItem] : undefined;
392
- if ((matchingItem === null || matchingItem === void 0 ? void 0 : matchingItem.type) === 'button') {
393
- confirmButtonItem = matchingItem;
394
- }
395
- if ((matchingItem === null || matchingItem === void 0 ? void 0 : matchingItem.type) === 'overflow-dropdown' && confirmDialogForItemOption !== undefined) {
396
- var matchingItemOption = matchingItem.options[confirmDialogForItemOption];
387
+ var _ref7 = floatingToolbarData || {},
388
+ confirmDialogForItem = _ref7.confirmDialogForItem,
389
+ confirmDialogForItemOption = _ref7.confirmDialogForItemOption;
390
+ var matchingItem = confirmDialogForItem ? toolbarItems === null || toolbarItems === void 0 ? void 0 : toolbarItems[confirmDialogForItem] : undefined;
391
+ if ((matchingItem === null || matchingItem === void 0 ? void 0 : matchingItem.type) === 'button') {
392
+ confirmButtonItem = matchingItem;
393
+ }
394
+ if ((matchingItem === null || matchingItem === void 0 ? void 0 : matchingItem.type) === 'overflow-dropdown' && confirmDialogForItemOption !== undefined) {
395
+ var matchingItemOption = matchingItem.options[confirmDialogForItemOption];
397
396
 
398
- // OverflowDropdownOption is the only member of the union that does not have a 'type' property
399
- if (!('type' in matchingItemOption)) {
400
- confirmButtonItem = matchingItemOption;
401
- }
397
+ // OverflowDropdownOption is the only member of the union that does not have a 'type' property
398
+ if (!('type' in matchingItemOption)) {
399
+ confirmButtonItem = matchingItemOption;
402
400
  }
403
- } else {
404
- var _ref8 = floatingToolbarData || {},
405
- _confirmDialogForItem = _ref8.confirmDialogForItem;
406
- confirmButtonItem = _confirmDialogForItem ?
407
- // Ignored via go/ees005
408
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
409
- toolbarItems[_confirmDialogForItem] : undefined;
410
401
  }
411
402
  var scrollable = config.scrollable;
412
403
  var confirmDialogOptions = typeof ((_confirmButtonItem = confirmButtonItem) === null || _confirmButtonItem === void 0 ? void 0 : _confirmButtonItem.confirmDialog) === 'function' ? (_confirmButtonItem2 = confirmButtonItem) === null || _confirmButtonItem2 === void 0 ? void 0 : _confirmButtonItem2.confirmDialog() : (_confirmButtonItem3 = confirmButtonItem) === null || _confirmButtonItem3 === void 0 ? void 0 : _confirmButtonItem3.confirmDialog;
@@ -28,7 +28,6 @@ import { backgroundPaletteTooltipMessages } from '@atlaskit/editor-common/ui-col
28
28
  import { ColorPickerButton, ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
29
29
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
30
30
  import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
31
- import { fg } from '@atlaskit/platform-feature-flags';
32
31
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
33
32
  import { checkShouldForceFocusAndApply, forceFocusSelector } from '../pm-plugins/force-focus';
34
33
  import { showConfirmDialog } from '../pm-plugins/toolbar-data/commands';
@@ -189,25 +188,20 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
189
188
  return item.render(editorView, idx, dispatchAnalyticsEvent);
190
189
  }
191
190
  case 'overflow-dropdown':
192
- var options;
193
- if (fg('platform_editor_fix_confirm_table_removal')) {
194
- // if an option has a confirmDialog, we need to replace its onClick handler
195
- // to set the state to show the confirm dialog
191
+ // if an option has a confirmDialog, we need to replace its onClick handler
192
+ // to set the state to show the confirm dialog
196
193
 
197
- // crudely done here to avoid greater coupling with DropdownMenuItem from `floating-toolbar`
198
- // which would need knowledge of indexes, showConfirmDialog etc.
199
- options = item.options.map(function (option, optionIndex) {
200
- if (!('type' in option) && option.confirmDialog) {
201
- var onClick = option.confirmDialog ? showConfirmDialog(idx, optionIndex) : option.onClick;
202
- return _objectSpread(_objectSpread({}, option), {}, {
203
- onClick: onClick
204
- });
205
- }
206
- return option;
207
- });
208
- } else {
209
- options = item.options;
210
- }
194
+ // crudely done here to avoid greater coupling with DropdownMenuItem from `floating-toolbar`
195
+ // which would need knowledge of indexes, showConfirmDialog etc.
196
+ var options = item.options.map(function (option, optionIndex) {
197
+ if (!('type' in option) && option.confirmDialog) {
198
+ var onClick = option.confirmDialog ? showConfirmDialog(idx, optionIndex) : option.onClick;
199
+ return _objectSpread(_objectSpread({}, option), {}, {
200
+ onClick: onClick
201
+ });
202
+ }
203
+ return option;
204
+ });
211
205
  return jsx(Dropdown, {
212
206
  alignX: areAnyNewToolbarFlagsEnabled ? 'right' : undefined,
213
207
  key: idx,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-floating-toolbar",
3
- "version": "9.1.13",
3
+ "version": "9.1.15",
4
4
  "description": "Floating toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -27,12 +27,12 @@
27
27
  "@atlaskit/editor-palette": "^2.1.0",
28
28
  "@atlaskit/editor-plugin-analytics": "^7.0.0",
29
29
  "@atlaskit/editor-plugin-context-panel": "^9.0.0",
30
- "@atlaskit/editor-plugin-copy-button": "^7.0.0",
30
+ "@atlaskit/editor-plugin-copy-button": "^7.1.0",
31
31
  "@atlaskit/editor-plugin-decorations": "^7.0.0",
32
32
  "@atlaskit/editor-plugin-editor-disabled": "^7.0.0",
33
33
  "@atlaskit/editor-plugin-editor-viewmode": "^9.0.0",
34
34
  "@atlaskit/editor-plugin-emoji": "^8.1.0",
35
- "@atlaskit/editor-plugin-extension": "^10.0.0",
35
+ "@atlaskit/editor-plugin-extension": "^10.1.0",
36
36
  "@atlaskit/editor-plugin-interaction": "^14.0.0",
37
37
  "@atlaskit/editor-plugin-user-intent": "^5.0.0",
38
38
  "@atlaskit/editor-prosemirror": "^7.3.0",
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/primitives": "^18.0.0",
45
45
  "@atlaskit/select": "^21.7.0",
46
46
  "@atlaskit/theme": "^21.0.0",
47
- "@atlaskit/tmp-editor-statsig": "^24.1.0",
47
+ "@atlaskit/tmp-editor-statsig": "^25.2.0",
48
48
  "@atlaskit/tokens": "^11.0.0",
49
49
  "@atlaskit/tooltip": "^20.14.0",
50
50
  "@babel/runtime": "^7.0.0",
@@ -56,7 +56,7 @@
56
56
  "react-loadable": "^5.1.0"
57
57
  },
58
58
  "peerDependencies": {
59
- "@atlaskit/editor-common": "^111.12.0",
59
+ "@atlaskit/editor-common": "^111.13.0",
60
60
  "react": "^18.2.0",
61
61
  "react-dom": "^18.2.0"
62
62
  },
@@ -112,9 +112,6 @@
112
112
  "platform-visual-refresh-icons": {
113
113
  "type": "boolean"
114
114
  },
115
- "platform_editor_fix_confirm_table_removal": {
116
- "type": "boolean"
117
- },
118
115
  "platform_editor_a11y_add_role_to_popup": {
119
116
  "type": "boolean"
120
117
  }