@atlaskit/editor-plugin-selection 19.0.0 → 19.0.1

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,13 @@
1
1
  # @atlaskit/editor-plugin-selection
2
2
 
3
+ ## 19.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8d37dc7e55d62`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8d37dc7e55d62) -
8
+ Clean up shipped experiment `platform_editor_block_menu`
9
+ - Updated dependencies
10
+
3
11
  ## 19.0.0
4
12
 
5
13
  ### Patch Changes
@@ -8,7 +8,6 @@ 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
10
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
11
- var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
12
11
  var _types = require("../types");
13
12
  var _actions = require("./actions");
14
13
  var _createSelectionBetween = require("./events/create-selection-between");
@@ -36,9 +35,6 @@ var createPlugin = exports.createPlugin = function createPlugin(api, dispatch, d
36
35
  var manualSelection;
37
36
  var hideCursorChanged = false;
38
37
  var blockSelectionChanged = false;
39
- var needsBlockSelection = (0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true, {
40
- exposure: true
41
- });
42
38
  for (var i = transactions.length - 1; i >= 0; i--) {
43
39
  var meta = transactions[i].getMeta(_types.selectionPluginKey);
44
40
  if ((meta === null || meta === void 0 ? void 0 : meta.hideCursor) !== undefined) {
@@ -51,15 +47,13 @@ var createPlugin = exports.createPlugin = function createPlugin(api, dispatch, d
51
47
  if (meta !== null && meta !== void 0 && meta.manualSelection && !manualSelection) {
52
48
  manualSelection = meta.manualSelection;
53
49
  }
54
- if (needsBlockSelection) {
55
- if (meta !== null && meta !== void 0 && meta.setBlockSelection) {
56
- blockSelection = meta.setBlockSelection;
57
- blockSelectionChanged = true;
58
- }
59
- if (meta !== null && meta !== void 0 && meta.clearBlockSelection) {
60
- blockSelection = undefined;
61
- blockSelectionChanged = true;
62
- }
50
+ if (meta !== null && meta !== void 0 && meta.setBlockSelection) {
51
+ blockSelection = meta.setBlockSelection;
52
+ blockSelectionChanged = true;
53
+ }
54
+ if (meta !== null && meta !== void 0 && meta.clearBlockSelection) {
55
+ blockSelection = undefined;
56
+ blockSelectionChanged = true;
63
57
  }
64
58
  }
65
59
  if (!(0, _utils.shouldRecalcDecorations)({
@@ -15,7 +15,6 @@ var _utils2 = require("@atlaskit/editor-prosemirror/utils");
15
15
  var _view = require("@atlaskit/editor-prosemirror/view");
16
16
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
17
17
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
18
- var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
19
18
  var _types = require("../types");
20
19
  var _hideCursorDecoration = require("./cursor/ui/hide-cursor-decoration");
21
20
  var getDecorations = exports.getDecorations = function getDecorations(tr, manualSelection, hideCursor, blockSelection) {
@@ -37,9 +36,7 @@ var getDecorations = exports.getDecorations = function getDecorations(tr, manual
37
36
 
38
37
  // Only apply node decorations when there is an active block selection.
39
38
  // When there is no block selection, text selections should use native browser selection appearance.
40
- if (!(0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true, {
41
- exposure: true
42
- }) || blockSelection) {
39
+ if (blockSelection) {
43
40
  var selectionDecorations = getNodesToDecorateFromSelection(selection, tr.doc).map(function (_ref) {
44
41
  var node = _ref.node,
45
42
  pos = _ref.pos;
@@ -5,7 +5,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
6
6
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
7
7
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
9
8
  import { selectionPluginKey } from '../types';
10
9
  import { SelectionActionTypes } from './actions';
11
10
  import { onCreateSelectionBetween } from './events/create-selection-between';
@@ -30,9 +29,6 @@ export const createPlugin = (api, dispatch, dispatchAnalyticsEvent, options = {}
30
29
  let manualSelection;
31
30
  let hideCursorChanged = false;
32
31
  let blockSelectionChanged = false;
33
- const needsBlockSelection = editorExperiment('platform_editor_block_menu', true, {
34
- exposure: true
35
- });
36
32
  for (let i = transactions.length - 1; i >= 0; i--) {
37
33
  const meta = transactions[i].getMeta(selectionPluginKey);
38
34
  if ((meta === null || meta === void 0 ? void 0 : meta.hideCursor) !== undefined) {
@@ -45,15 +41,13 @@ export const createPlugin = (api, dispatch, dispatchAnalyticsEvent, options = {}
45
41
  if (meta !== null && meta !== void 0 && meta.manualSelection && !manualSelection) {
46
42
  manualSelection = meta.manualSelection;
47
43
  }
48
- if (needsBlockSelection) {
49
- if (meta !== null && meta !== void 0 && meta.setBlockSelection) {
50
- blockSelection = meta.setBlockSelection;
51
- blockSelectionChanged = true;
52
- }
53
- if (meta !== null && meta !== void 0 && meta.clearBlockSelection) {
54
- blockSelection = undefined;
55
- blockSelectionChanged = true;
56
- }
44
+ if (meta !== null && meta !== void 0 && meta.setBlockSelection) {
45
+ blockSelection = meta.setBlockSelection;
46
+ blockSelectionChanged = true;
47
+ }
48
+ if (meta !== null && meta !== void 0 && meta.clearBlockSelection) {
49
+ blockSelection = undefined;
50
+ blockSelectionChanged = true;
57
51
  }
58
52
  }
59
53
  if (!shouldRecalcDecorations({
@@ -6,7 +6,6 @@ import { findParentNode, findParentNodeClosestToPos, flatten, hasParentNode } fr
6
6
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
7
7
  import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
8
8
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
10
9
  import { selectionPluginKey } from '../types';
11
10
  import { createHideCursorDecoration } from './cursor/ui/hide-cursor-decoration';
12
11
  export const getDecorations = (tr, manualSelection, hideCursor, blockSelection) => {
@@ -28,9 +27,7 @@ export const getDecorations = (tr, manualSelection, hideCursor, blockSelection)
28
27
 
29
28
  // Only apply node decorations when there is an active block selection.
30
29
  // When there is no block selection, text selections should use native browser selection appearance.
31
- if (!editorExperiment('platform_editor_block_menu', true, {
32
- exposure: true
33
- }) || blockSelection) {
30
+ if (blockSelection) {
34
31
  const selectionDecorations = getNodesToDecorateFromSelection(selection, tr.doc).map(({
35
32
  node,
36
33
  pos
@@ -5,7 +5,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
6
6
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
7
7
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
9
8
  import { selectionPluginKey } from '../types';
10
9
  import { SelectionActionTypes } from './actions';
11
10
  import { onCreateSelectionBetween } from './events/create-selection-between';
@@ -31,9 +30,6 @@ export var createPlugin = function createPlugin(api, dispatch, dispatchAnalytics
31
30
  var manualSelection;
32
31
  var hideCursorChanged = false;
33
32
  var blockSelectionChanged = false;
34
- var needsBlockSelection = editorExperiment('platform_editor_block_menu', true, {
35
- exposure: true
36
- });
37
33
  for (var i = transactions.length - 1; i >= 0; i--) {
38
34
  var meta = transactions[i].getMeta(selectionPluginKey);
39
35
  if ((meta === null || meta === void 0 ? void 0 : meta.hideCursor) !== undefined) {
@@ -46,15 +42,13 @@ export var createPlugin = function createPlugin(api, dispatch, dispatchAnalytics
46
42
  if (meta !== null && meta !== void 0 && meta.manualSelection && !manualSelection) {
47
43
  manualSelection = meta.manualSelection;
48
44
  }
49
- if (needsBlockSelection) {
50
- if (meta !== null && meta !== void 0 && meta.setBlockSelection) {
51
- blockSelection = meta.setBlockSelection;
52
- blockSelectionChanged = true;
53
- }
54
- if (meta !== null && meta !== void 0 && meta.clearBlockSelection) {
55
- blockSelection = undefined;
56
- blockSelectionChanged = true;
57
- }
45
+ if (meta !== null && meta !== void 0 && meta.setBlockSelection) {
46
+ blockSelection = meta.setBlockSelection;
47
+ blockSelectionChanged = true;
48
+ }
49
+ if (meta !== null && meta !== void 0 && meta.clearBlockSelection) {
50
+ blockSelection = undefined;
51
+ blockSelectionChanged = true;
58
52
  }
59
53
  }
60
54
  if (!shouldRecalcDecorations({
@@ -7,7 +7,6 @@ import { findParentNode, findParentNodeClosestToPos, flatten, hasParentNode } fr
7
7
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
8
8
  import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
9
9
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
11
10
  import { selectionPluginKey } from '../types';
12
11
  import { createHideCursorDecoration } from './cursor/ui/hide-cursor-decoration';
13
12
  export var getDecorations = function getDecorations(tr, manualSelection, hideCursor, blockSelection) {
@@ -29,9 +28,7 @@ export var getDecorations = function getDecorations(tr, manualSelection, hideCur
29
28
 
30
29
  // Only apply node decorations when there is an active block selection.
31
30
  // When there is no block selection, text selections should use native browser selection appearance.
32
- if (!editorExperiment('platform_editor_block_menu', true, {
33
- exposure: true
34
- }) || blockSelection) {
31
+ if (blockSelection) {
35
32
  var selectionDecorations = getNodesToDecorateFromSelection(selection, tr.doc).map(function (_ref) {
36
33
  var node = _ref.node,
37
34
  pos = _ref.pos;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection",
3
- "version": "19.0.0",
3
+ "version": "19.0.1",
4
4
  "description": "Selection plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -24,7 +24,7 @@
24
24
  "@atlaskit/editor-prosemirror": "^9.0.0",
25
25
  "@atlaskit/editor-shared-styles": "^4.3.0",
26
26
  "@atlaskit/editor-tables": "^3.2.0",
27
- "@atlaskit/tmp-editor-statsig": "^199.0.0",
27
+ "@atlaskit/tmp-editor-statsig": "^200.0.0",
28
28
  "@atlaskit/tokens": "^18.2.0",
29
29
  "@babel/runtime": "^7.0.0"
30
30
  },