@atlaskit/editor-plugin-expand 2.6.4 → 2.6.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,13 @@
1
1
  # @atlaskit/editor-plugin-expand
2
2
 
3
+ ## 2.6.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#140869](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/140869)
8
+ [`e69985951ade3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e69985951ade3) -
9
+ ED-24557: Cleaned up platform_editor_single_player_expand_ed_24536
10
+
3
11
  ## 2.6.4
4
12
 
5
13
  ### Patch Changes
@@ -16,7 +16,6 @@ var _utils = require("@atlaskit/editor-common/utils");
16
16
  var _state2 = require("@atlaskit/editor-prosemirror/state");
17
17
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
18
18
  var _utils3 = require("@atlaskit/editor-tables/utils");
19
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
19
  var _utils4 = require("../utils");
21
20
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
22
21
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -39,30 +38,23 @@ var createExpandNode = exports.createExpandNode = function createExpandNode(stat
39
38
  var insertExpandWithInputMethod = exports.insertExpandWithInputMethod = function insertExpandWithInputMethod(editorAnalyticsAPI, isNestingExpandsSupported) {
40
39
  return function (inputMethod) {
41
40
  return function (state, dispatch) {
42
- var expandNode = (0, _platformFeatureFlags.fg)('platform_editor_single_player_expand_ed_24536') ? createExpandNode(state, false, isNestingExpandsSupported) : createExpandNode(state, undefined, isNestingExpandsSupported);
41
+ var expandNode = createExpandNode(state, false, isNestingExpandsSupported);
43
42
  if (!expandNode) {
44
43
  return false;
45
44
  }
46
45
  var tr;
47
- if ((0, _platformFeatureFlags.fg)('platform_editor_single_player_expand_ed_24536')) {
48
- if (state.selection.empty) {
49
- tr = (0, _utils2.safeInsert)(expandNode)(state.tr).scrollIntoView();
50
- _expand.expandedState.set(expandNode, true);
51
- } else {
52
- tr = (0, _utils.createWrapSelectionTransaction)({
53
- state: state,
54
- type: expandNode.type
55
- });
56
- var wrapperNode = (0, _utils2.findParentNodeOfType)(expandNode.type)(tr.selection);
57
- if (wrapperNode) {
58
- _expand.expandedState.set(wrapperNode.node, true);
59
- }
60
- }
46
+ if (state.selection.empty) {
47
+ tr = (0, _utils2.safeInsert)(expandNode)(state.tr).scrollIntoView();
48
+ _expand.expandedState.set(expandNode, true);
61
49
  } else {
62
- tr = state.selection.empty ? (0, _utils2.safeInsert)(expandNode)(state.tr).scrollIntoView() : (0, _utils.createWrapSelectionTransaction)({
50
+ tr = (0, _utils.createWrapSelectionTransaction)({
63
51
  state: state,
64
52
  type: expandNode.type
65
53
  });
54
+ var wrapperNode = (0, _utils2.findParentNodeOfType)(expandNode.type)(tr.selection);
55
+ if (wrapperNode) {
56
+ _expand.expandedState.set(wrapperNode.node, true);
57
+ }
66
58
  }
67
59
  var payload = {
68
60
  action: _analytics.ACTION.INSERTED,
@@ -8,7 +8,6 @@ import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
8
8
  import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
9
9
  import { findParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
10
10
  import { findTable } from '@atlaskit/editor-tables/utils';
11
- import { fg } from '@atlaskit/platform-feature-flags';
12
11
  import { isNestedInExpand } from '../utils';
13
12
 
14
13
  // Creates either an expand or a nestedExpand node based on the current selection
@@ -27,30 +26,23 @@ export const createExpandNode = (state, setExpandedState = true, isNestingExpand
27
26
  return expandNode;
28
27
  };
29
28
  export const insertExpandWithInputMethod = (editorAnalyticsAPI, isNestingExpandsSupported) => inputMethod => (state, dispatch) => {
30
- const expandNode = fg('platform_editor_single_player_expand_ed_24536') ? createExpandNode(state, false, isNestingExpandsSupported) : createExpandNode(state, undefined, isNestingExpandsSupported);
29
+ const expandNode = createExpandNode(state, false, isNestingExpandsSupported);
31
30
  if (!expandNode) {
32
31
  return false;
33
32
  }
34
33
  let tr;
35
- if (fg('platform_editor_single_player_expand_ed_24536')) {
36
- if (state.selection.empty) {
37
- tr = safeInsert(expandNode)(state.tr).scrollIntoView();
38
- expandedState.set(expandNode, true);
39
- } else {
40
- tr = createWrapSelectionTransaction({
41
- state,
42
- type: expandNode.type
43
- });
44
- const wrapperNode = findParentNodeOfType(expandNode.type)(tr.selection);
45
- if (wrapperNode) {
46
- expandedState.set(wrapperNode.node, true);
47
- }
48
- }
34
+ if (state.selection.empty) {
35
+ tr = safeInsert(expandNode)(state.tr).scrollIntoView();
36
+ expandedState.set(expandNode, true);
49
37
  } else {
50
- tr = state.selection.empty ? safeInsert(expandNode)(state.tr).scrollIntoView() : createWrapSelectionTransaction({
38
+ tr = createWrapSelectionTransaction({
51
39
  state,
52
40
  type: expandNode.type
53
41
  });
42
+ const wrapperNode = findParentNodeOfType(expandNode.type)(tr.selection);
43
+ if (wrapperNode) {
44
+ expandedState.set(wrapperNode.node, true);
45
+ }
54
46
  }
55
47
  const payload = {
56
48
  action: ACTION.INSERTED,
@@ -11,7 +11,6 @@ import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
11
11
  import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
12
12
  import { findParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
13
13
  import { findTable } from '@atlaskit/editor-tables/utils';
14
- import { fg } from '@atlaskit/platform-feature-flags';
15
14
  import { isNestedInExpand } from '../utils';
16
15
 
17
16
  // Creates either an expand or a nestedExpand node based on the current selection
@@ -33,30 +32,23 @@ export var createExpandNode = function createExpandNode(state) {
33
32
  export var insertExpandWithInputMethod = function insertExpandWithInputMethod(editorAnalyticsAPI, isNestingExpandsSupported) {
34
33
  return function (inputMethod) {
35
34
  return function (state, dispatch) {
36
- var expandNode = fg('platform_editor_single_player_expand_ed_24536') ? createExpandNode(state, false, isNestingExpandsSupported) : createExpandNode(state, undefined, isNestingExpandsSupported);
35
+ var expandNode = createExpandNode(state, false, isNestingExpandsSupported);
37
36
  if (!expandNode) {
38
37
  return false;
39
38
  }
40
39
  var tr;
41
- if (fg('platform_editor_single_player_expand_ed_24536')) {
42
- if (state.selection.empty) {
43
- tr = safeInsert(expandNode)(state.tr).scrollIntoView();
44
- expandedState.set(expandNode, true);
45
- } else {
46
- tr = createWrapSelectionTransaction({
47
- state: state,
48
- type: expandNode.type
49
- });
50
- var wrapperNode = findParentNodeOfType(expandNode.type)(tr.selection);
51
- if (wrapperNode) {
52
- expandedState.set(wrapperNode.node, true);
53
- }
54
- }
40
+ if (state.selection.empty) {
41
+ tr = safeInsert(expandNode)(state.tr).scrollIntoView();
42
+ expandedState.set(expandNode, true);
55
43
  } else {
56
- tr = state.selection.empty ? safeInsert(expandNode)(state.tr).scrollIntoView() : createWrapSelectionTransaction({
44
+ tr = createWrapSelectionTransaction({
57
45
  state: state,
58
46
  type: expandNode.type
59
47
  });
48
+ var wrapperNode = findParentNodeOfType(expandNode.type)(tr.selection);
49
+ if (wrapperNode) {
50
+ expandedState.set(wrapperNode.node, true);
51
+ }
60
52
  }
61
53
  var payload = {
62
54
  action: ACTION.INSERTED,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-expand",
3
- "version": "2.6.4",
3
+ "version": "2.6.5",
4
4
  "description": "Expand plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^40.9.0",
35
35
  "@atlaskit/button": "^20.1.0",
36
- "@atlaskit/editor-common": "^89.0.0",
36
+ "@atlaskit/editor-common": "^89.1.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.8.0",
38
38
  "@atlaskit/editor-plugin-decorations": "^1.3.0",
39
39
  "@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
@@ -42,7 +42,7 @@
42
42
  "@atlaskit/editor-prosemirror": "6.0.0",
43
43
  "@atlaskit/editor-shared-styles": "^2.13.0",
44
44
  "@atlaskit/editor-tables": "^2.8.0",
45
- "@atlaskit/icon": "^22.16.0",
45
+ "@atlaskit/icon": "^22.18.0",
46
46
  "@atlaskit/platform-feature-flags": "^0.3.0",
47
47
  "@atlaskit/tooltip": "^18.7.0",
48
48
  "@babel/runtime": "^7.0.0",
@@ -109,9 +109,6 @@
109
109
  "platform.editor.live-view.disable-editing-in-view-mode_fi1rx": {
110
110
  "type": "boolean"
111
111
  },
112
- "platform_editor_single_player_expand_ed_24536": {
113
- "type": "boolean"
114
- },
115
112
  "platform_editor_nest_nested_expand_in_expand_jira": {
116
113
  "type": "boolean"
117
114
  },