@atlaskit/editor-plugin-expand 8.0.0 → 8.1.0

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,31 @@
1
1
  # @atlaskit/editor-plugin-expand
2
2
 
3
+ ## 8.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`e61bb8b32e4b1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e61bb8b32e4b1) -
8
+ [https://hello.jira.atlassian.cloud/browse/EDITOR-4386](EDITOR-4386) - clean up
9
+ platform_editor_disable_unnecessary_expand_renders
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 8.0.2
16
+
17
+ ### Patch Changes
18
+
19
+ - [`b909e5f47ea91`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b909e5f47ea91) -
20
+ EDITOR-4159 Make sure block-menu-item type component return null when tranform disabled
21
+ - Updated dependencies
22
+
23
+ ## 8.0.1
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies
28
+
3
29
  ## 8.0.0
4
30
 
5
31
  ### Patch Changes
@@ -19,6 +19,7 @@ var _commands = require("./commands");
19
19
  var _keymap = require("./pm-plugins/keymap");
20
20
  var _main = require("./pm-plugins/main");
21
21
  var _toolbar = require("./toolbar");
22
+ var EXPAND_NODE_NAME = 'expand';
22
23
  // Ignored via go/ees005
23
24
  // eslint-disable-next-line prefer-const
24
25
  var expandPlugin = exports.expandPlugin = function expandPlugin(_ref) {
@@ -36,7 +37,11 @@ var expandPlugin = exports.expandPlugin = function expandPlugin(_ref) {
36
37
  key: _blockMenu.TRANSFORM_STRUCTURE_MENU_SECTION.key,
37
38
  rank: _blockMenu.TRANSFORM_STRUCTURE_MENU_SECTION_RANK[_blockMenu.TRANSFORM_STRUCTURE_EXPAND_MENU_ITEM.key]
38
39
  },
39
- component: (0, _ExpandBlockMenuItem.createExpandBlockMenuItem)(api)
40
+ component: (0, _ExpandBlockMenuItem.createExpandBlockMenuItem)(api),
41
+ isHidden: function isHidden() {
42
+ var _api$blockMenu2;
43
+ return Boolean(api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(EXPAND_NODE_NAME));
44
+ }
40
45
  }]);
41
46
  }
42
47
  return {
@@ -18,7 +18,6 @@ var _styles = require("@atlaskit/editor-common/styles");
18
18
  var _utils = require("@atlaskit/editor-common/utils");
19
19
  var _model = require("@atlaskit/editor-prosemirror/model");
20
20
  var _state = require("@atlaskit/editor-prosemirror/state");
21
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
21
  var _prosemirrorHistory = require("@atlaskit/prosemirror-history");
23
22
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
24
23
  var _renderExpandButton = require("../../ui/renderExpandButton");
@@ -547,9 +546,6 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
547
546
  }
548
547
  } else {
549
548
  this.node = node;
550
- if (!(0, _platformFeatureFlags.fg)('platform_editor_disable_unnecessary_expand_renders')) {
551
- this.updateExpandToggleIcon(this.node);
552
- }
553
549
  }
554
550
  return true;
555
551
  }
@@ -20,6 +20,7 @@ var _commands = require("./commands");
20
20
  var _keymap = require("./pm-plugins/keymap");
21
21
  var _main = require("./pm-plugins/main");
22
22
  var _toolbar = require("./toolbar");
23
+ var EXPAND_NODE_NAME = 'expand';
23
24
  // Ignored via go/ees005
24
25
  // eslint-disable-next-line prefer-const
25
26
  var expandPlugin = exports.expandPlugin = function expandPlugin(_ref) {
@@ -36,7 +37,11 @@ var expandPlugin = exports.expandPlugin = function expandPlugin(_ref) {
36
37
  key: _blockMenu.TRANSFORM_STRUCTURE_MENU_SECTION.key,
37
38
  rank: _blockMenu.TRANSFORM_STRUCTURE_MENU_SECTION_RANK[_blockMenu.TRANSFORM_STRUCTURE_EXPAND_MENU_ITEM.key]
38
39
  },
39
- component: (0, _ExpandBlockMenuItem.createExpandBlockMenuItem)(api)
40
+ component: (0, _ExpandBlockMenuItem.createExpandBlockMenuItem)(api),
41
+ isHidden: function isHidden() {
42
+ var _api$blockMenu2;
43
+ return Boolean(api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(EXPAND_NODE_NAME));
44
+ }
40
45
  }]);
41
46
  }
42
47
  return {
@@ -13,7 +13,6 @@ var _editorToolbar = require("@atlaskit/editor-toolbar");
13
13
  var _expandElement = _interopRequireDefault(require("@atlaskit/icon-lab/core/expand-element"));
14
14
  var NODE_NAME = 'expand';
15
15
  var ExpandBlockMenuItem = function ExpandBlockMenuItem(_ref) {
16
- var _api$blockMenu2;
17
16
  var api = _ref.api;
18
17
  var _useIntl = (0, _reactIntlNext.useIntl)(),
19
18
  formatMessage = _useIntl.formatMessage;
@@ -33,10 +32,6 @@ var ExpandBlockMenuItem = function ExpandBlockMenuItem(_ref) {
33
32
  }) : null;
34
33
  });
35
34
  };
36
- var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME);
37
- if (isTransfromToPanelDisabled) {
38
- return null;
39
- }
40
35
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
41
36
  onClick: handleClick,
42
37
  elemBefore: /*#__PURE__*/_react.default.createElement(_expandElement.default, {
@@ -8,6 +8,7 @@ import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
8
8
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
9
9
  import { toggleExpandRange } from '../editor-commands/toggleExpandRange';
10
10
  import { createExpandBlockMenuItem } from '../ui/ExpandBlockMenuItem';
11
+ const EXPAND_NODE_NAME = 'expand';
11
12
  import { createExpandNode, insertExpand, insertExpandWithInputMethod, toggleExpandWithMatch } from './commands';
12
13
  import { expandKeymap } from './pm-plugins/keymap';
13
14
  import { createPlugin } from './pm-plugins/main';
@@ -30,7 +31,11 @@ export let expandPlugin = ({
30
31
  key: TRANSFORM_STRUCTURE_MENU_SECTION.key,
31
32
  rank: TRANSFORM_STRUCTURE_MENU_SECTION_RANK[TRANSFORM_STRUCTURE_EXPAND_MENU_ITEM.key]
32
33
  },
33
- component: createExpandBlockMenuItem(api)
34
+ component: createExpandBlockMenuItem(api),
35
+ isHidden: () => {
36
+ var _api$blockMenu2;
37
+ return Boolean(api === null || api === void 0 ? void 0 : (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(EXPAND_NODE_NAME));
38
+ }
34
39
  }]);
35
40
  }
36
41
  return {
@@ -9,7 +9,6 @@ import { expandClassNames } from '@atlaskit/editor-common/styles';
9
9
  import { closestElement, isEmptyNode } from '@atlaskit/editor-common/utils';
10
10
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
11
11
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
12
- import { fg } from '@atlaskit/platform-feature-flags';
13
12
  import { redo, undo } from '@atlaskit/prosemirror-history';
14
13
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
14
  import { renderExpandButton } from '../../ui/renderExpandButton';
@@ -541,9 +540,6 @@ export class ExpandNodeView {
541
540
  }
542
541
  } else {
543
542
  this.node = node;
544
- if (!fg('platform_editor_disable_unnecessary_expand_renders')) {
545
- this.updateExpandToggleIcon(this.node);
546
- }
547
543
  }
548
544
  return true;
549
545
  }
@@ -9,6 +9,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
10
10
  import { toggleExpandRange } from '../editor-commands/toggleExpandRange';
11
11
  import { createExpandBlockMenuItem } from '../ui/ExpandBlockMenuItem';
12
+ const EXPAND_NODE_NAME = 'expand';
12
13
  import { createExpandNode, insertExpand, insertExpandWithInputMethod, toggleExpandWithMatch, wrapSelectionAndSetExpandedState } from './commands';
13
14
  import { expandKeymap } from './pm-plugins/keymap';
14
15
  import { createPlugin } from './pm-plugins/main';
@@ -30,7 +31,11 @@ export let expandPlugin = ({
30
31
  key: TRANSFORM_STRUCTURE_MENU_SECTION.key,
31
32
  rank: TRANSFORM_STRUCTURE_MENU_SECTION_RANK[TRANSFORM_STRUCTURE_EXPAND_MENU_ITEM.key]
32
33
  },
33
- component: createExpandBlockMenuItem(api)
34
+ component: createExpandBlockMenuItem(api),
35
+ isHidden: () => {
36
+ var _api$blockMenu2;
37
+ return Boolean(api === null || api === void 0 ? void 0 : (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(EXPAND_NODE_NAME));
38
+ }
34
39
  }]);
35
40
  }
36
41
  return {
@@ -8,7 +8,6 @@ const NODE_NAME = 'expand';
8
8
  const ExpandBlockMenuItem = ({
9
9
  api
10
10
  }) => {
11
- var _api$blockMenu2;
12
11
  const {
13
12
  formatMessage
14
13
  } = useIntl();
@@ -29,10 +28,6 @@ const ExpandBlockMenuItem = ({
29
28
  }) : null;
30
29
  });
31
30
  };
32
- const isTransfromToPanelDisabled = api === null || api === void 0 ? void 0 : (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME);
33
- if (isTransfromToPanelDisabled) {
34
- return null;
35
- }
36
31
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
37
32
  onClick: handleClick,
38
33
  elemBefore: /*#__PURE__*/React.createElement(ExpandElementIcon, {
@@ -8,6 +8,7 @@ import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
8
8
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
9
9
  import { toggleExpandRange } from '../editor-commands/toggleExpandRange';
10
10
  import { createExpandBlockMenuItem } from '../ui/ExpandBlockMenuItem';
11
+ var EXPAND_NODE_NAME = 'expand';
11
12
  import { createExpandNode, insertExpand, insertExpandWithInputMethod, toggleExpandWithMatch as _toggleExpandWithMatch } from './commands';
12
13
  import { expandKeymap } from './pm-plugins/keymap';
13
14
  import { createPlugin } from './pm-plugins/main';
@@ -30,7 +31,11 @@ export var expandPlugin = function expandPlugin(_ref) {
30
31
  key: TRANSFORM_STRUCTURE_MENU_SECTION.key,
31
32
  rank: TRANSFORM_STRUCTURE_MENU_SECTION_RANK[TRANSFORM_STRUCTURE_EXPAND_MENU_ITEM.key]
32
33
  },
33
- component: createExpandBlockMenuItem(api)
34
+ component: createExpandBlockMenuItem(api),
35
+ isHidden: function isHidden() {
36
+ var _api$blockMenu2;
37
+ return Boolean(api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(EXPAND_NODE_NAME));
38
+ }
34
39
  }]);
35
40
  }
36
41
  return {
@@ -11,7 +11,6 @@ import { expandClassNames } from '@atlaskit/editor-common/styles';
11
11
  import { closestElement, isEmptyNode } from '@atlaskit/editor-common/utils';
12
12
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
13
13
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
14
- import { fg } from '@atlaskit/platform-feature-flags';
15
14
  import { redo, undo } from '@atlaskit/prosemirror-history';
16
15
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
17
16
  import { renderExpandButton } from '../../ui/renderExpandButton';
@@ -539,9 +538,6 @@ export var ExpandNodeView = /*#__PURE__*/function () {
539
538
  }
540
539
  } else {
541
540
  this.node = node;
542
- if (!fg('platform_editor_disable_unnecessary_expand_renders')) {
543
- this.updateExpandToggleIcon(this.node);
544
- }
545
541
  }
546
542
  return true;
547
543
  }
@@ -9,6 +9,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
10
10
  import { toggleExpandRange } from '../editor-commands/toggleExpandRange';
11
11
  import { createExpandBlockMenuItem } from '../ui/ExpandBlockMenuItem';
12
+ var EXPAND_NODE_NAME = 'expand';
12
13
  import { createExpandNode, insertExpand, insertExpandWithInputMethod, toggleExpandWithMatch as _toggleExpandWithMatch, wrapSelectionAndSetExpandedState } from './commands';
13
14
  import { expandKeymap } from './pm-plugins/keymap';
14
15
  import { createPlugin } from './pm-plugins/main';
@@ -30,7 +31,11 @@ export var expandPlugin = function expandPlugin(_ref) {
30
31
  key: TRANSFORM_STRUCTURE_MENU_SECTION.key,
31
32
  rank: TRANSFORM_STRUCTURE_MENU_SECTION_RANK[TRANSFORM_STRUCTURE_EXPAND_MENU_ITEM.key]
32
33
  },
33
- component: createExpandBlockMenuItem(api)
34
+ component: createExpandBlockMenuItem(api),
35
+ isHidden: function isHidden() {
36
+ var _api$blockMenu2;
37
+ return Boolean(api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(EXPAND_NODE_NAME));
38
+ }
34
39
  }]);
35
40
  }
36
41
  return {
@@ -6,7 +6,6 @@ import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
6
6
  import ExpandElementIcon from '@atlaskit/icon-lab/core/expand-element';
7
7
  var NODE_NAME = 'expand';
8
8
  var ExpandBlockMenuItem = function ExpandBlockMenuItem(_ref) {
9
- var _api$blockMenu2;
10
9
  var api = _ref.api;
11
10
  var _useIntl = useIntl(),
12
11
  formatMessage = _useIntl.formatMessage;
@@ -26,10 +25,6 @@ var ExpandBlockMenuItem = function ExpandBlockMenuItem(_ref) {
26
25
  }) : null;
27
26
  });
28
27
  };
29
- var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME);
30
- if (isTransfromToPanelDisabled) {
31
- return null;
32
- }
33
28
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
34
29
  onClick: handleClick,
35
30
  elemBefore: /*#__PURE__*/React.createElement(ExpandElementIcon, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-expand",
3
- "version": "8.0.0",
3
+ "version": "8.1.0",
4
4
  "description": "Expand plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -43,21 +43,21 @@
43
43
  "@atlaskit/editor-prosemirror": "^7.2.0",
44
44
  "@atlaskit/editor-shared-styles": "^3.10.0",
45
45
  "@atlaskit/editor-tables": "^2.9.0",
46
- "@atlaskit/editor-toolbar": "^0.18.0",
47
- "@atlaskit/icon": "^29.3.0",
48
- "@atlaskit/icon-lab": "^5.13.0",
46
+ "@atlaskit/editor-toolbar": "^0.19.0",
47
+ "@atlaskit/icon": "^29.4.0",
48
+ "@atlaskit/icon-lab": "^5.14.0",
49
49
  "@atlaskit/platform-feature-flags": "^1.1.0",
50
50
  "@atlaskit/prosemirror-history": "^0.2.0",
51
- "@atlaskit/tmp-editor-statsig": "^16.3.0",
52
- "@atlaskit/tokens": "^9.0.0",
53
- "@atlaskit/tooltip": "^20.11.0",
51
+ "@atlaskit/tmp-editor-statsig": "^16.12.0",
52
+ "@atlaskit/tokens": "^9.1.0",
53
+ "@atlaskit/tooltip": "^20.12.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "@emotion/react": "^11.7.1",
56
56
  "uuid": "^3.1.0",
57
57
  "w3c-keyname": "^2.1.8"
58
58
  },
59
59
  "peerDependencies": {
60
- "@atlaskit/editor-common": "^111.0.0",
60
+ "@atlaskit/editor-common": "^111.7.0",
61
61
  "react": "^18.2.0",
62
62
  "react-dom": "^18.2.0",
63
63
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -103,9 +103,6 @@
103
103
  "platform-editor-single-player-expand": {
104
104
  "type": "boolean"
105
105
  },
106
- "platform_editor_disable_unnecessary_expand_renders": {
107
- "type": "boolean"
108
- },
109
106
  "platform_editor_adf_with_localid": {
110
107
  "type": "boolean"
111
108
  }