@atlaskit/editor-plugin-extension 1.0.4 → 1.0.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,11 @@
1
1
  # @atlaskit/editor-plugin-extension
2
2
 
3
+ ## 1.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#75436](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75436) [`bfcf32bb4fa3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bfcf32bb4fa3) - [ux] ED-21941 Disable resize/layout options for table, media and extension when added to MBE. Table rendering fixed for Confluence editor
8
+
3
9
  ## 1.0.4
4
10
 
5
11
  ### Patch Changes
@@ -15,6 +15,7 @@ var _mediaCenter = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/m
15
15
  var _mediaFullWidth = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/media-full-width"));
16
16
  var _mediaWide = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/media-wide"));
17
17
  var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
18
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
19
  var _actions = require("./actions");
19
20
  var _commands = require("./commands");
20
21
  var _pluginKey = require("./pm-plugins/macro/plugin-key");
@@ -32,7 +33,13 @@ var isLayoutSupported = function isLayoutSupported(state, selectedExtNode) {
32
33
  if (!selectedExtNode) {
33
34
  return false;
34
35
  }
35
- return !!(([bodiedExtension, multiBodiedExtension].includes(selectedExtNode.node.type) || selectedExtNode.node.type === extension && !(0, _utils2.hasParentNodeOfType)([bodiedExtension, table, expand].filter(Boolean))(selection)) && !(0, _utils2.hasParentNodeOfType)([layoutSection])(selection));
36
+ var isMultiBodiedExtension = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.multi-bodied-extension_0rygg') && selectedExtNode.node.type === multiBodiedExtension;
37
+ var isNonEmbeddedBodiedExtension = selectedExtNode.node.type === bodiedExtension && !(0, _utils2.hasParentNodeOfType)([multiBodiedExtension].filter(Boolean))(selection);
38
+ var isNonEmbeddedExtension = selectedExtNode.node.type === extension && !(0, _utils2.hasParentNodeOfType)([bodiedExtension, table, expand, multiBodiedExtension].filter(Boolean))(selection);
39
+
40
+ // if selection belongs to layout supported extension category
41
+ // and not inside a layoutSection
42
+ return !!((isMultiBodiedExtension || isNonEmbeddedBodiedExtension || isNonEmbeddedExtension) && !(0, _utils2.hasParentNodeOfType)([layoutSection])(selection));
36
43
  };
37
44
  var breakoutOptions = function breakoutOptions(state, formatMessage, extensionState, breakoutEnabled) {
38
45
  var nodeWithPos = (0, _utils3.getSelectedExtension)(state, true);
@@ -7,6 +7,7 @@ import CenterIcon from '@atlaskit/icon/glyph/editor/media-center';
7
7
  import FullWidthIcon from '@atlaskit/icon/glyph/editor/media-full-width';
8
8
  import WideIcon from '@atlaskit/icon/glyph/editor/media-wide';
9
9
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
10
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
10
11
  import { editExtension } from './actions';
11
12
  import { removeDescendantNodes, removeExtension, updateExtensionLayout } from './commands';
12
13
  import { pluginKey as macroPluginKey } from './pm-plugins/macro/plugin-key';
@@ -29,7 +30,13 @@ const isLayoutSupported = (state, selectedExtNode) => {
29
30
  if (!selectedExtNode) {
30
31
  return false;
31
32
  }
32
- return !!(([bodiedExtension, multiBodiedExtension].includes(selectedExtNode.node.type) || selectedExtNode.node.type === extension && !hasParentNodeOfType([bodiedExtension, table, expand].filter(Boolean))(selection)) && !hasParentNodeOfType([layoutSection])(selection));
33
+ const isMultiBodiedExtension = getBooleanFF('platform.editor.multi-bodied-extension_0rygg') && selectedExtNode.node.type === multiBodiedExtension;
34
+ const isNonEmbeddedBodiedExtension = selectedExtNode.node.type === bodiedExtension && !hasParentNodeOfType([multiBodiedExtension].filter(Boolean))(selection);
35
+ const isNonEmbeddedExtension = selectedExtNode.node.type === extension && !hasParentNodeOfType([bodiedExtension, table, expand, multiBodiedExtension].filter(Boolean))(selection);
36
+
37
+ // if selection belongs to layout supported extension category
38
+ // and not inside a layoutSection
39
+ return !!((isMultiBodiedExtension || isNonEmbeddedBodiedExtension || isNonEmbeddedExtension) && !hasParentNodeOfType([layoutSection])(selection));
33
40
  };
34
41
  const breakoutOptions = (state, formatMessage, extensionState, breakoutEnabled) => {
35
42
  const nodeWithPos = getSelectedExtension(state, true);
@@ -8,6 +8,7 @@ import CenterIcon from '@atlaskit/icon/glyph/editor/media-center';
8
8
  import FullWidthIcon from '@atlaskit/icon/glyph/editor/media-full-width';
9
9
  import WideIcon from '@atlaskit/icon/glyph/editor/media-wide';
10
10
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
11
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
11
12
  import { editExtension } from './actions';
12
13
  import { removeDescendantNodes, removeExtension, updateExtensionLayout } from './commands';
13
14
  import { pluginKey as macroPluginKey } from './pm-plugins/macro/plugin-key';
@@ -25,7 +26,13 @@ var isLayoutSupported = function isLayoutSupported(state, selectedExtNode) {
25
26
  if (!selectedExtNode) {
26
27
  return false;
27
28
  }
28
- return !!(([bodiedExtension, multiBodiedExtension].includes(selectedExtNode.node.type) || selectedExtNode.node.type === extension && !hasParentNodeOfType([bodiedExtension, table, expand].filter(Boolean))(selection)) && !hasParentNodeOfType([layoutSection])(selection));
29
+ var isMultiBodiedExtension = getBooleanFF('platform.editor.multi-bodied-extension_0rygg') && selectedExtNode.node.type === multiBodiedExtension;
30
+ var isNonEmbeddedBodiedExtension = selectedExtNode.node.type === bodiedExtension && !hasParentNodeOfType([multiBodiedExtension].filter(Boolean))(selection);
31
+ var isNonEmbeddedExtension = selectedExtNode.node.type === extension && !hasParentNodeOfType([bodiedExtension, table, expand, multiBodiedExtension].filter(Boolean))(selection);
32
+
33
+ // if selection belongs to layout supported extension category
34
+ // and not inside a layoutSection
35
+ return !!((isMultiBodiedExtension || isNonEmbeddedBodiedExtension || isNonEmbeddedExtension) && !hasParentNodeOfType([layoutSection])(selection));
29
36
  };
30
37
  var breakoutOptions = function breakoutOptions(state, formatMessage, extensionState, breakoutEnabled) {
31
38
  var nodeWithPos = getSelectedExtension(state, true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-extension",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "editor-plugin-extension plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  "@atlaskit/button": "^17.6.0",
32
32
  "@atlaskit/checkbox": "^13.0.0",
33
33
  "@atlaskit/datetime-picker": "^13.0.3",
34
- "@atlaskit/editor-common": "^78.7.0",
34
+ "@atlaskit/editor-common": "^78.8.0",
35
35
  "@atlaskit/editor-json-transformer": "^8.10.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.0.0",
37
37
  "@atlaskit/editor-plugin-context-identifier": "^1.0.0",
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/form": "^9.0.3",
47
47
  "@atlaskit/icon": "^22.1.0",
48
48
  "@atlaskit/platform-feature-flags": "^0.2.0",
49
- "@atlaskit/primitives": "^3.0.0",
49
+ "@atlaskit/primitives": "^3.1.0",
50
50
  "@atlaskit/radio": "^6.0.0",
51
51
  "@atlaskit/section-message": "^6.4.0",
52
52
  "@atlaskit/select": "^17.1.0",