@atlaskit/editor-plugin-selection 2.2.3 → 2.2.5

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,20 @@
1
1
  # @atlaskit/editor-plugin-selection
2
2
 
3
+ ## 2.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 2.2.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [#157322](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/157322)
14
+ [`0e61040734cef`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0e61040734cef) -
15
+ [ED-27842] Consolidate extraneous no_cursor flags into one flag for full rollout
16
+ - Updated dependencies
17
+
3
18
  ## 2.2.3
4
19
 
5
20
  ### Patch Changes
@@ -70,15 +70,14 @@ var createPlugin = exports.createPlugin = function createPlugin(api, dispatch, d
70
70
  props: {
71
71
  createSelectionBetween: _createSelectionBetween.onCreateSelectionBetween,
72
72
  decorations: function decorations(state) {
73
- var _api$interaction;
74
- // TODO: ED-27865 - This has to be explicitly checked against false to ensure that
75
- // we don't change behaviour when hasHadInteraction is undefined.
73
+ var _api$interaction, _api$interaction2;
76
74
  var hasHadInteraction = (api === null || api === void 0 || (_api$interaction = api.interaction) === null || _api$interaction === void 0 || (_api$interaction = _api$interaction.sharedState.currentState()) === null || _api$interaction === void 0 ? void 0 : _api$interaction.hasHadInteraction) !== false;
75
+ var interactionState = api === null || api === void 0 || (_api$interaction2 = api.interaction) === null || _api$interaction2 === void 0 || (_api$interaction2 = _api$interaction2.sharedState.currentState()) === null || _api$interaction2 === void 0 ? void 0 : _api$interaction2.interactionState;
77
76
 
78
77
  // Do not show selection decorations for live pages where the user has not
79
78
  // interacted with the page. We do not show cursor until interaction and we do not
80
79
  // want to show selections either.
81
- if (options.__livePage && !hasHadInteraction && (0, _platformFeatureFlags.fg)('platform_editor_no_selection_decorations')) {
80
+ if (options.__livePage && ((0, _platformFeatureFlags.fg)('platform_editor_interaction_api_refactor') ? interactionState === 'hasNotHadInteraction' : !hasHadInteraction) && (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init')) {
82
81
  return _view.DecorationSet.empty;
83
82
  }
84
83
  return (0, _pluginFactory.getPluginState)(state).decorationSet;
@@ -63,15 +63,14 @@ export const createPlugin = (api, dispatch, dispatchAnalyticsEvent, options = {}
63
63
  props: {
64
64
  createSelectionBetween: onCreateSelectionBetween,
65
65
  decorations(state) {
66
- var _api$interaction, _api$interaction$shar;
67
- // TODO: ED-27865 - This has to be explicitly checked against false to ensure that
68
- // we don't change behaviour when hasHadInteraction is undefined.
66
+ var _api$interaction, _api$interaction$shar, _api$interaction2, _api$interaction2$sha;
69
67
  const hasHadInteraction = (api === null || api === void 0 ? void 0 : (_api$interaction = api.interaction) === null || _api$interaction === void 0 ? void 0 : (_api$interaction$shar = _api$interaction.sharedState.currentState()) === null || _api$interaction$shar === void 0 ? void 0 : _api$interaction$shar.hasHadInteraction) !== false;
68
+ const interactionState = api === null || api === void 0 ? void 0 : (_api$interaction2 = api.interaction) === null || _api$interaction2 === void 0 ? void 0 : (_api$interaction2$sha = _api$interaction2.sharedState.currentState()) === null || _api$interaction2$sha === void 0 ? void 0 : _api$interaction2$sha.interactionState;
70
69
 
71
70
  // Do not show selection decorations for live pages where the user has not
72
71
  // interacted with the page. We do not show cursor until interaction and we do not
73
72
  // want to show selections either.
74
- if (options.__livePage && !hasHadInteraction && fg('platform_editor_no_selection_decorations')) {
73
+ if (options.__livePage && (fg('platform_editor_interaction_api_refactor') ? interactionState === 'hasNotHadInteraction' : !hasHadInteraction) && fg('platform_editor_no_cursor_on_live_doc_init')) {
75
74
  return DecorationSet.empty;
76
75
  }
77
76
  return getPluginState(state).decorationSet;
@@ -64,15 +64,14 @@ export var createPlugin = function createPlugin(api, dispatch, dispatchAnalytics
64
64
  props: {
65
65
  createSelectionBetween: onCreateSelectionBetween,
66
66
  decorations: function decorations(state) {
67
- var _api$interaction;
68
- // TODO: ED-27865 - This has to be explicitly checked against false to ensure that
69
- // we don't change behaviour when hasHadInteraction is undefined.
67
+ var _api$interaction, _api$interaction2;
70
68
  var hasHadInteraction = (api === null || api === void 0 || (_api$interaction = api.interaction) === null || _api$interaction === void 0 || (_api$interaction = _api$interaction.sharedState.currentState()) === null || _api$interaction === void 0 ? void 0 : _api$interaction.hasHadInteraction) !== false;
69
+ var interactionState = api === null || api === void 0 || (_api$interaction2 = api.interaction) === null || _api$interaction2 === void 0 || (_api$interaction2 = _api$interaction2.sharedState.currentState()) === null || _api$interaction2 === void 0 ? void 0 : _api$interaction2.interactionState;
71
70
 
72
71
  // Do not show selection decorations for live pages where the user has not
73
72
  // interacted with the page. We do not show cursor until interaction and we do not
74
73
  // want to show selections either.
75
- if (options.__livePage && !hasHadInteraction && fg('platform_editor_no_selection_decorations')) {
74
+ if (options.__livePage && (fg('platform_editor_interaction_api_refactor') ? interactionState === 'hasNotHadInteraction' : !hasHadInteraction) && fg('platform_editor_no_cursor_on_live_doc_init')) {
76
75
  return DecorationSet.empty;
77
76
  }
78
77
  return getPluginState(state).decorationSet;
@@ -2,9 +2,9 @@ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
2
  import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
4
  import type { SelectionPluginState } from '@atlaskit/editor-common/selection';
5
- import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
6
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
7
- import { SelectionPlugin } from '../selectionPluginType';
7
+ import type { SelectionPlugin } from '../selectionPluginType';
8
8
  import type { SelectionPluginOptions } from '../types';
9
9
  export declare const getInitialState: (state: EditorState) => SelectionPluginState;
10
10
  export declare const createPlugin: (api: ExtractInjectionAPI<SelectionPlugin> | undefined, dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, options?: SelectionPluginOptions) => SafePlugin<SelectionPluginState>;
@@ -2,9 +2,9 @@ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
2
  import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
4
  import type { SelectionPluginState } from '@atlaskit/editor-common/selection';
5
- import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
6
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
7
- import { SelectionPlugin } from '../selectionPluginType';
7
+ import type { SelectionPlugin } from '../selectionPluginType';
8
8
  import type { SelectionPluginOptions } from '../types';
9
9
  export declare const getInitialState: (state: EditorState) => SelectionPluginState;
10
10
  export declare const createPlugin: (api: ExtractInjectionAPI<SelectionPlugin> | undefined, dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, options?: SelectionPluginOptions) => SafePlugin<SelectionPluginState>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection",
3
- "version": "2.2.3",
3
+ "version": "2.2.5",
4
4
  "description": "Selection plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -20,14 +20,14 @@
20
20
  "runReact18": true
21
21
  },
22
22
  "dependencies": {
23
- "@atlaskit/editor-common": "^105.0.0",
24
- "@atlaskit/editor-plugin-interaction": "^1.0.0",
23
+ "@atlaskit/editor-common": "^105.10.0",
24
+ "@atlaskit/editor-plugin-interaction": "^1.1.0",
25
25
  "@atlaskit/editor-prosemirror": "7.0.0",
26
26
  "@atlaskit/editor-shared-styles": "^3.4.0",
27
27
  "@atlaskit/editor-tables": "^2.9.0",
28
28
  "@atlaskit/platform-feature-flags": "^1.1.0",
29
- "@atlaskit/tmp-editor-statsig": "^4.19.0",
30
- "@atlaskit/tokens": "^4.8.0",
29
+ "@atlaskit/tmp-editor-statsig": "^5.0.0",
30
+ "@atlaskit/tokens": "^4.9.0",
31
31
  "@babel/runtime": "^7.0.0"
32
32
  },
33
33
  "peerDependencies": {
@@ -91,7 +91,10 @@
91
91
  "platform_editor_nested_tables_gap_cursor": {
92
92
  "type": "boolean"
93
93
  },
94
- "platform_editor_no_selection_decorations": {
94
+ "platform_editor_no_cursor_on_live_doc_init": {
95
+ "type": "boolean"
96
+ },
97
+ "platform_editor_interaction_api_refactor": {
95
98
  "type": "boolean"
96
99
  }
97
100
  }