@atlaskit/editor-plugin-block-menu 3.1.1 → 3.1.2

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-block-menu
2
2
 
3
+ ## 3.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`77f5d276a6b30`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/77f5d276a6b30) -
8
+ [ux] Put layout and expand format menu visibility behind experiment flags
9
+ - Updated dependencies
10
+
3
11
  ## 3.1.1
4
12
 
5
13
  ### Patch Changes
@@ -56,6 +56,9 @@
56
56
  {
57
57
  "path": "../../../design-system/primitives/afm-cc/tsconfig.json"
58
58
  },
59
+ {
60
+ "path": "../../tmp-editor-statsig/afm-cc/tsconfig.json"
61
+ },
59
62
  {
60
63
  "path": "../../../design-system/tokens/afm-cc/tsconfig.json"
61
64
  },
@@ -56,6 +56,9 @@
56
56
  {
57
57
  "path": "../../../design-system/primitives/afm-dev-agents/tsconfig.json"
58
58
  },
59
+ {
60
+ "path": "../../tmp-editor-statsig/afm-dev-agents/tsconfig.json"
61
+ },
59
62
  {
60
63
  "path": "../../../design-system/tokens/afm-dev-agents/tsconfig.json"
61
64
  },
@@ -56,6 +56,9 @@
56
56
  {
57
57
  "path": "../../../design-system/primitives/afm-jira/tsconfig.json"
58
58
  },
59
+ {
60
+ "path": "../../tmp-editor-statsig/afm-jira/tsconfig.json"
61
+ },
59
62
  {
60
63
  "path": "../../../design-system/tokens/afm-jira/tsconfig.json"
61
64
  },
@@ -56,6 +56,9 @@
56
56
  {
57
57
  "path": "../../../design-system/primitives/afm-passionfruit/tsconfig.json"
58
58
  },
59
+ {
60
+ "path": "../../tmp-editor-statsig/afm-passionfruit/tsconfig.json"
61
+ },
59
62
  {
60
63
  "path": "../../../design-system/tokens/afm-passionfruit/tsconfig.json"
61
64
  },
@@ -56,6 +56,9 @@
56
56
  {
57
57
  "path": "../../../design-system/primitives/afm-post-office/tsconfig.json"
58
58
  },
59
+ {
60
+ "path": "../../tmp-editor-statsig/afm-post-office/tsconfig.json"
61
+ },
59
62
  {
60
63
  "path": "../../../design-system/tokens/afm-post-office/tsconfig.json"
61
64
  },
@@ -56,6 +56,9 @@
56
56
  {
57
57
  "path": "../../../design-system/primitives/afm-rovo-extension/tsconfig.json"
58
58
  },
59
+ {
60
+ "path": "../../tmp-editor-statsig/afm-rovo-extension/tsconfig.json"
61
+ },
59
62
  {
60
63
  "path": "../../../design-system/tokens/afm-rovo-extension/tsconfig.json"
61
64
  },
@@ -56,6 +56,9 @@
56
56
  {
57
57
  "path": "../../../design-system/primitives/afm-townsquare/tsconfig.json"
58
58
  },
59
+ {
60
+ "path": "../../tmp-editor-statsig/afm-townsquare/tsconfig.json"
61
+ },
59
62
  {
60
63
  "path": "../../../design-system/tokens/afm-townsquare/tsconfig.json"
61
64
  },
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.checkIsFormatMenuHidden = void 0;
7
7
  var _utils = require("@atlaskit/editor-prosemirror/utils");
8
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
8
9
  var _isNestedNode = require("./isNestedNode");
9
10
  var getIsFormatMenuHidden = function getIsFormatMenuHidden(selection, schema, menuTriggerBy) {
10
11
  var nodes = schema.nodes;
@@ -12,7 +13,14 @@ var getIsFormatMenuHidden = function getIsFormatMenuHidden(selection, schema, me
12
13
  return false;
13
14
  }
14
15
  var content;
15
- var selectedNode = (0, _utils.findSelectedNodeOfType)([nodes.paragraph, nodes.heading, nodes.blockquote, nodes.panel, nodes.expand, nodes.codeBlock, nodes.bulletList, nodes.orderedList, nodes.taskList, nodes.layoutSection])(selection);
16
+ var allowedNodes = [nodes.paragraph, nodes.heading, nodes.blockquote, nodes.panel, nodes.codeBlock, nodes.bulletList, nodes.orderedList, nodes.taskList];
17
+ if ((0, _expValEquals.expValEquals)('platform_editor_block_menu_layout_format', 'isEnabled', true)) {
18
+ allowedNodes.push(nodes.layoutSection);
19
+ }
20
+ if ((0, _expValEquals.expValEquals)('platform_editor_block_menu_expand_format', 'isEnabled', true)) {
21
+ allowedNodes.push(nodes.expand);
22
+ }
23
+ var selectedNode = (0, _utils.findSelectedNodeOfType)(allowedNodes)(selection);
16
24
  if (selectedNode) {
17
25
  content = selectedNode.node;
18
26
  } else {
@@ -1,4 +1,5 @@
1
1
  import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
2
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
2
3
  import { isNestedNode } from './isNestedNode';
3
4
  const getIsFormatMenuHidden = (selection, schema, menuTriggerBy) => {
4
5
  const nodes = schema.nodes;
@@ -6,7 +7,14 @@ const getIsFormatMenuHidden = (selection, schema, menuTriggerBy) => {
6
7
  return false;
7
8
  }
8
9
  let content;
9
- const selectedNode = findSelectedNodeOfType([nodes.paragraph, nodes.heading, nodes.blockquote, nodes.panel, nodes.expand, nodes.codeBlock, nodes.bulletList, nodes.orderedList, nodes.taskList, nodes.layoutSection])(selection);
10
+ const allowedNodes = [nodes.paragraph, nodes.heading, nodes.blockquote, nodes.panel, nodes.codeBlock, nodes.bulletList, nodes.orderedList, nodes.taskList];
11
+ if (expValEquals('platform_editor_block_menu_layout_format', 'isEnabled', true)) {
12
+ allowedNodes.push(nodes.layoutSection);
13
+ }
14
+ if (expValEquals('platform_editor_block_menu_expand_format', 'isEnabled', true)) {
15
+ allowedNodes.push(nodes.expand);
16
+ }
17
+ const selectedNode = findSelectedNodeOfType(allowedNodes)(selection);
10
18
  if (selectedNode) {
11
19
  content = selectedNode.node;
12
20
  } else {
@@ -1,4 +1,5 @@
1
1
  import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
2
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
2
3
  import { isNestedNode } from './isNestedNode';
3
4
  var getIsFormatMenuHidden = function getIsFormatMenuHidden(selection, schema, menuTriggerBy) {
4
5
  var nodes = schema.nodes;
@@ -6,7 +7,14 @@ var getIsFormatMenuHidden = function getIsFormatMenuHidden(selection, schema, me
6
7
  return false;
7
8
  }
8
9
  var content;
9
- var selectedNode = findSelectedNodeOfType([nodes.paragraph, nodes.heading, nodes.blockquote, nodes.panel, nodes.expand, nodes.codeBlock, nodes.bulletList, nodes.orderedList, nodes.taskList, nodes.layoutSection])(selection);
10
+ var allowedNodes = [nodes.paragraph, nodes.heading, nodes.blockquote, nodes.panel, nodes.codeBlock, nodes.bulletList, nodes.orderedList, nodes.taskList];
11
+ if (expValEquals('platform_editor_block_menu_layout_format', 'isEnabled', true)) {
12
+ allowedNodes.push(nodes.layoutSection);
13
+ }
14
+ if (expValEquals('platform_editor_block_menu_expand_format', 'isEnabled', true)) {
15
+ allowedNodes.push(nodes.expand);
16
+ }
17
+ var selectedNode = findSelectedNodeOfType(allowedNodes)(selection);
10
18
  if (selectedNode) {
11
19
  content = selectedNode.node;
12
20
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-menu",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "BlockMenu plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,6 +42,7 @@
42
42
  "@atlaskit/icon-lab": "^5.7.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
44
  "@atlaskit/primitives": "^14.14.0",
45
+ "@atlaskit/tmp-editor-statsig": "^12.19.0",
45
46
  "@atlaskit/tokens": "^6.3.0",
46
47
  "@babel/runtime": "^7.0.0"
47
48
  },