@atlaskit/editor-plugin-selection 7.0.1 → 7.0.3

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-selection
2
2
 
3
+ ## 7.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`5c3f8d87c2290`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5c3f8d87c2290) -
8
+ Cleanup general AIFC bug fix feature gate
9
+ - Updated dependencies
10
+
11
+ ## 7.0.2
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 7.0.1
4
18
 
5
19
  ### Patch Changes
@@ -96,7 +96,9 @@ var getSelectionFragment = exports.getSelectionFragment = function getSelectionF
96
96
  return fragment;
97
97
  };
98
98
  };
99
- var getSelectionLocalIds = exports.getSelectionLocalIds = function getSelectionLocalIds(api) {
99
+ var getSelectionLocalIds = exports.getSelectionLocalIds =
100
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
101
+ function getSelectionLocalIds(api) {
100
102
  return function () {
101
103
  var _api$selection$shared2, _selection;
102
104
  var selection = api === null || api === void 0 || (_api$selection$shared2 = api.selection.sharedState) === null || _api$selection$shared2 === void 0 || (_api$selection$shared2 = _api$selection$shared2.currentState()) === null || _api$selection$shared2 === void 0 ? void 0 : _api$selection$shared2.selection;
@@ -7,7 +7,6 @@ exports.getInitialState = exports.createPlugin = void 0;
7
7
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
8
  var _state = require("@atlaskit/editor-prosemirror/state");
9
9
  var _view = require("@atlaskit/editor-prosemirror/view");
10
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
10
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
12
11
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
13
12
  var _types = require("../types");
@@ -35,12 +34,11 @@ var createPlugin = exports.createPlugin = function createPlugin(api, dispatch, d
35
34
  var manualSelection;
36
35
  var hideCursorChanged = false;
37
36
  var blockSelectionChanged = false;
38
- var needsHideCursor = (0, _platformFeatureFlags.fg)('platform_editor_ai_generic_prep_for_aifc_2');
39
37
  var needsManualSelection = (0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true);
40
38
  var needsBlockSelection = (0, _expValEquals.expValEquals)('platform_editor_block_menu', 'isEnabled', true);
41
39
  for (var i = transactions.length - 1; i >= 0; i--) {
42
40
  var meta = transactions[i].getMeta(_types.selectionPluginKey);
43
- if (needsHideCursor && (meta === null || meta === void 0 ? void 0 : meta.hideCursor) !== undefined) {
41
+ if ((meta === null || meta === void 0 ? void 0 : meta.hideCursor) !== undefined) {
44
42
  var newHideCursorValue = meta.hideCursor;
45
43
  if (cursorHidden !== newHideCursorValue) {
46
44
  cursorHidden = newHideCursorValue;
@@ -49,9 +47,6 @@ var createPlugin = exports.createPlugin = function createPlugin(api, dispatch, d
49
47
  }
50
48
  if (needsManualSelection && meta !== null && meta !== void 0 && meta.manualSelection && !manualSelection) {
51
49
  manualSelection = meta.manualSelection;
52
- if (!needsHideCursor && !needsBlockSelection) {
53
- break;
54
- }
55
50
  }
56
51
  if (needsBlockSelection) {
57
52
  if (meta !== null && meta !== void 0 && meta.setBlockSelection) {
@@ -20,7 +20,7 @@ var _hideCursorDecoration = require("./cursor/ui/hide-cursor-decoration");
20
20
  var getDecorations = exports.getDecorations = function getDecorations(tr, manualSelection, hideCursor, blockSelection) {
21
21
  var selection = tr.selection;
22
22
  var decorations = [];
23
- if (hideCursor && (0, _platformFeatureFlags.fg)('platform_editor_ai_generic_prep_for_aifc_2')) {
23
+ if (hideCursor) {
24
24
  decorations.push((0, _hideCursorDecoration.createHideCursorDecoration)());
25
25
  }
26
26
  if (selection instanceof _state.NodeSelection) {
@@ -76,7 +76,9 @@ export const getSelectionFragment = api => () => {
76
76
  });
77
77
  return fragment;
78
78
  };
79
- export const getSelectionLocalIds = api => () => {
79
+ export const getSelectionLocalIds =
80
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
81
+ api => () => {
80
82
  var _api$selection$shared3, _api$selection$shared4, _selection;
81
83
  let selection = api === null || api === void 0 ? void 0 : (_api$selection$shared3 = api.selection.sharedState) === null || _api$selection$shared3 === void 0 ? void 0 : (_api$selection$shared4 = _api$selection$shared3.currentState()) === null || _api$selection$shared4 === void 0 ? void 0 : _api$selection$shared4.selection;
82
84
  if ((_selection = selection) !== null && _selection !== void 0 && _selection.empty) {
@@ -1,7 +1,6 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
5
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
6
  import { selectionPluginKey } from '../types';
@@ -28,12 +27,11 @@ export const createPlugin = (api, dispatch, dispatchAnalyticsEvent, options = {}
28
27
  let manualSelection;
29
28
  let hideCursorChanged = false;
30
29
  let blockSelectionChanged = false;
31
- const needsHideCursor = fg('platform_editor_ai_generic_prep_for_aifc_2');
32
30
  const needsManualSelection = editorExperiment('platform_editor_element_drag_and_drop_multiselect', true);
33
31
  const needsBlockSelection = expValEquals('platform_editor_block_menu', 'isEnabled', true);
34
32
  for (let i = transactions.length - 1; i >= 0; i--) {
35
33
  const meta = transactions[i].getMeta(selectionPluginKey);
36
- if (needsHideCursor && (meta === null || meta === void 0 ? void 0 : meta.hideCursor) !== undefined) {
34
+ if ((meta === null || meta === void 0 ? void 0 : meta.hideCursor) !== undefined) {
37
35
  const newHideCursorValue = meta.hideCursor;
38
36
  if (cursorHidden !== newHideCursorValue) {
39
37
  cursorHidden = newHideCursorValue;
@@ -42,9 +40,6 @@ export const createPlugin = (api, dispatch, dispatchAnalyticsEvent, options = {}
42
40
  }
43
41
  if (needsManualSelection && meta !== null && meta !== void 0 && meta.manualSelection && !manualSelection) {
44
42
  manualSelection = meta.manualSelection;
45
- if (!needsHideCursor && !needsBlockSelection) {
46
- break;
47
- }
48
43
  }
49
44
  if (needsBlockSelection) {
50
45
  if (meta !== null && meta !== void 0 && meta.setBlockSelection) {
@@ -11,7 +11,7 @@ import { createHideCursorDecoration } from './cursor/ui/hide-cursor-decoration';
11
11
  export const getDecorations = (tr, manualSelection, hideCursor, blockSelection) => {
12
12
  let selection = tr.selection;
13
13
  const decorations = [];
14
- if (hideCursor && fg('platform_editor_ai_generic_prep_for_aifc_2')) {
14
+ if (hideCursor) {
15
15
  decorations.push(createHideCursorDecoration());
16
16
  }
17
17
  if (selection instanceof NodeSelection) {
@@ -89,7 +89,9 @@ export var getSelectionFragment = function getSelectionFragment(api) {
89
89
  return fragment;
90
90
  };
91
91
  };
92
- export var getSelectionLocalIds = function getSelectionLocalIds(api) {
92
+ export var getSelectionLocalIds =
93
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
94
+ function getSelectionLocalIds(api) {
93
95
  return function () {
94
96
  var _api$selection$shared2, _selection;
95
97
  var selection = api === null || api === void 0 || (_api$selection$shared2 = api.selection.sharedState) === null || _api$selection$shared2 === void 0 || (_api$selection$shared2 = _api$selection$shared2.currentState()) === null || _api$selection$shared2 === void 0 ? void 0 : _api$selection$shared2.selection;
@@ -1,7 +1,6 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
5
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
6
  import { selectionPluginKey } from '../types';
@@ -29,12 +28,11 @@ export var createPlugin = function createPlugin(api, dispatch, dispatchAnalytics
29
28
  var manualSelection;
30
29
  var hideCursorChanged = false;
31
30
  var blockSelectionChanged = false;
32
- var needsHideCursor = fg('platform_editor_ai_generic_prep_for_aifc_2');
33
31
  var needsManualSelection = editorExperiment('platform_editor_element_drag_and_drop_multiselect', true);
34
32
  var needsBlockSelection = expValEquals('platform_editor_block_menu', 'isEnabled', true);
35
33
  for (var i = transactions.length - 1; i >= 0; i--) {
36
34
  var meta = transactions[i].getMeta(selectionPluginKey);
37
- if (needsHideCursor && (meta === null || meta === void 0 ? void 0 : meta.hideCursor) !== undefined) {
35
+ if ((meta === null || meta === void 0 ? void 0 : meta.hideCursor) !== undefined) {
38
36
  var newHideCursorValue = meta.hideCursor;
39
37
  if (cursorHidden !== newHideCursorValue) {
40
38
  cursorHidden = newHideCursorValue;
@@ -43,9 +41,6 @@ export var createPlugin = function createPlugin(api, dispatch, dispatchAnalytics
43
41
  }
44
42
  if (needsManualSelection && meta !== null && meta !== void 0 && meta.manualSelection && !manualSelection) {
45
43
  manualSelection = meta.manualSelection;
46
- if (!needsHideCursor && !needsBlockSelection) {
47
- break;
48
- }
49
44
  }
50
45
  if (needsBlockSelection) {
51
46
  if (meta !== null && meta !== void 0 && meta.setBlockSelection) {
@@ -12,7 +12,7 @@ import { createHideCursorDecoration } from './cursor/ui/hide-cursor-decoration';
12
12
  export var getDecorations = function getDecorations(tr, manualSelection, hideCursor, blockSelection) {
13
13
  var selection = tr.selection;
14
14
  var decorations = [];
15
- if (hideCursor && fg('platform_editor_ai_generic_prep_for_aifc_2')) {
15
+ if (hideCursor) {
16
16
  decorations.push(createHideCursorDecoration());
17
17
  }
18
18
  if (selection instanceof NodeSelection) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection",
3
- "version": "7.0.1",
3
+ "version": "7.0.3",
4
4
  "description": "Selection plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -20,17 +20,17 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@atlaskit/editor-json-transformer": "^8.31.0",
23
- "@atlaskit/editor-plugin-interaction": "^12.0.0",
23
+ "@atlaskit/editor-plugin-interaction": "^13.0.0",
24
24
  "@atlaskit/editor-prosemirror": "^7.2.0",
25
25
  "@atlaskit/editor-shared-styles": "^3.10.0",
26
26
  "@atlaskit/editor-tables": "^2.9.0",
27
27
  "@atlaskit/platform-feature-flags": "^1.1.0",
28
- "@atlaskit/tmp-editor-statsig": "^16.11.0",
29
- "@atlaskit/tokens": "^9.1.0",
28
+ "@atlaskit/tmp-editor-statsig": "^16.35.0",
29
+ "@atlaskit/tokens": "^10.1.0",
30
30
  "@babel/runtime": "^7.0.0"
31
31
  },
32
32
  "peerDependencies": {
33
- "@atlaskit/editor-common": "^111.7.0",
33
+ "@atlaskit/editor-common": "^111.9.0",
34
34
  "react": "^18.2.0"
35
35
  },
36
36
  "techstack": {
@@ -81,9 +81,6 @@
81
81
  "platform_editor_nested_tables_gap_cursor": {
82
82
  "type": "boolean"
83
83
  },
84
- "platform_editor_ai_generic_prep_for_aifc_2": {
85
- "type": "boolean"
86
- },
87
84
  "platform_editor_fix_list_item_nav_bug_in_layout": {
88
85
  "type": "boolean"
89
86
  }