@atlaskit/editor-plugin-floating-toolbar 8.2.8 → 8.2.9

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,14 @@
1
1
  # @atlaskit/editor-plugin-floating-toolbar
2
2
 
3
+ ## 8.2.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4f5569bde5e64`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4f5569bde5e64) -
8
+ Add new 'dragHandleSelected' user intent, use this to control table toolbar when drag handle is
9
+ selected
10
+ - Updated dependencies
11
+
3
12
  ## 8.2.8
4
13
 
5
14
  ### Patch Changes
@@ -270,8 +270,16 @@ function ContentComponent(_ref5) {
270
270
  var selection = editorView.state.selection;
271
271
  var isCellSelection = '$anchorCell' in selection && !selection.empty;
272
272
  var isTextSelected = selection instanceof _state.TextSelection && !selection.empty;
273
- if (isTextSelected && config.className !== 'hyperlink-floating-toolbar' || isCellSelection) {
274
- return null;
273
+
274
+ // don't dismiss table toolbar when a cell selection is caused by clicking the drag handle (which has it's own userIntent)
275
+ if ((0, _platformFeatureFlags.fg)('platform_editor_toolbar_aifc_user_intent_fix')) {
276
+ if (isTextSelected && config.className !== 'hyperlink-floating-toolbar' || isCellSelection && (userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'default') {
277
+ return null;
278
+ }
279
+ } else {
280
+ if (isTextSelected && config.className !== 'hyperlink-floating-toolbar' || isCellSelection) {
281
+ return null;
282
+ }
275
283
  }
276
284
  }
277
285
  var items = config.items;
@@ -262,8 +262,16 @@ export function ContentComponent({
262
262
  const selection = editorView.state.selection;
263
263
  const isCellSelection = '$anchorCell' in selection && !selection.empty;
264
264
  const isTextSelected = selection instanceof TextSelection && !selection.empty;
265
- if (isTextSelected && config.className !== 'hyperlink-floating-toolbar' || isCellSelection) {
266
- return null;
265
+
266
+ // don't dismiss table toolbar when a cell selection is caused by clicking the drag handle (which has it's own userIntent)
267
+ if (fg('platform_editor_toolbar_aifc_user_intent_fix')) {
268
+ if (isTextSelected && config.className !== 'hyperlink-floating-toolbar' || isCellSelection && (userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'default') {
269
+ return null;
270
+ }
271
+ } else {
272
+ if (isTextSelected && config.className !== 'hyperlink-floating-toolbar' || isCellSelection) {
273
+ return null;
274
+ }
267
275
  }
268
276
  }
269
277
  let {
@@ -261,8 +261,16 @@ export function ContentComponent(_ref5) {
261
261
  var selection = editorView.state.selection;
262
262
  var isCellSelection = '$anchorCell' in selection && !selection.empty;
263
263
  var isTextSelected = selection instanceof TextSelection && !selection.empty;
264
- if (isTextSelected && config.className !== 'hyperlink-floating-toolbar' || isCellSelection) {
265
- return null;
264
+
265
+ // don't dismiss table toolbar when a cell selection is caused by clicking the drag handle (which has it's own userIntent)
266
+ if (fg('platform_editor_toolbar_aifc_user_intent_fix')) {
267
+ if (isTextSelected && config.className !== 'hyperlink-floating-toolbar' || isCellSelection && (userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'default') {
268
+ return null;
269
+ }
270
+ } else {
271
+ if (isTextSelected && config.className !== 'hyperlink-floating-toolbar' || isCellSelection) {
272
+ return null;
273
+ }
266
274
  }
267
275
  }
268
276
  var items = config.items;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-floating-toolbar",
3
- "version": "8.2.8",
3
+ "version": "8.2.9",
4
4
  "description": "Floating toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -45,7 +45,7 @@
45
45
  "@atlaskit/primitives": "^16.0.0",
46
46
  "@atlaskit/select": "^21.3.0",
47
47
  "@atlaskit/theme": "^21.0.0",
48
- "@atlaskit/tmp-editor-statsig": "^13.13.0",
48
+ "@atlaskit/tmp-editor-statsig": "^13.16.0",
49
49
  "@atlaskit/tokens": "^7.0.0",
50
50
  "@atlaskit/tooltip": "^20.6.0",
51
51
  "@babel/runtime": "^7.0.0",
@@ -57,7 +57,7 @@
57
57
  "react-loadable": "^5.1.0"
58
58
  },
59
59
  "peerDependencies": {
60
- "@atlaskit/editor-common": "^110.14.0",
60
+ "@atlaskit/editor-common": "^110.15.0",
61
61
  "react": "^18.2.0",
62
62
  "react-dom": "^18.2.0"
63
63
  },
@@ -127,6 +127,9 @@
127
127
  },
128
128
  "platform_editor_update_modal_close_button": {
129
129
  "type": "boolean"
130
+ },
131
+ "platform_editor_toolbar_aifc_user_intent_fix": {
132
+ "type": "boolean"
130
133
  }
131
134
  }
132
135
  }