@atlaskit/editor-plugin-block-menu 5.0.8 → 5.0.9
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,12 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-menu
|
|
2
2
|
|
|
3
|
+
## 5.0.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d43ebcd35ce11`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d43ebcd35ce11) -
|
|
8
|
+
[ux] Enable block menu on all top level nodes by default
|
|
9
|
+
|
|
3
10
|
## 5.0.8
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/afm-jira/tsconfig.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"extends": "../../../../tsconfig.entry-points.jira.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"target": "es5",
|
|
5
|
-
"outDir": "../../../../../tsDist/@atlaskit__editor-plugin-block-menu/app",
|
|
5
|
+
"outDir": "../../../../../jira/tsDist/@atlaskit__editor-plugin-block-menu/app",
|
|
6
6
|
"rootDir": "../",
|
|
7
7
|
"composite": true
|
|
8
8
|
},
|
|
@@ -9,11 +9,18 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
9
9
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
10
10
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
11
11
|
var _isNestedNode = require("./isNestedNode");
|
|
12
|
+
var TRANSFORM_MENU_ENABLED_FOR_ALL_TOP_LEVEL_NODES = true;
|
|
12
13
|
var getIsFormatMenuHidden = function getIsFormatMenuHidden(selection, schema, menuTriggerBy) {
|
|
13
14
|
var nodes = schema.nodes;
|
|
14
15
|
if (!nodes) {
|
|
15
16
|
return false;
|
|
16
17
|
}
|
|
18
|
+
var isNested = (0, _isNestedNode.isNestedNode)(selection, menuTriggerBy);
|
|
19
|
+
if (TRANSFORM_MENU_ENABLED_FOR_ALL_TOP_LEVEL_NODES) {
|
|
20
|
+
var disabledOnNodes = [nodes.syncBlock, nodes.bodiedSyncBlock, nodes.rule];
|
|
21
|
+
var disabledNode = (0, _utils.findSelectedNodeOfType)(disabledOnNodes)(selection);
|
|
22
|
+
return !!disabledNode || isNested && !(0, _platformFeatureFlags.fg)('platform_editor_block_menu_transform_nested_node');
|
|
23
|
+
}
|
|
17
24
|
var content;
|
|
18
25
|
var allowedNodes = [nodes.paragraph, nodes.heading, nodes.blockquote, nodes.panel, nodes.codeBlock, nodes.bulletList, nodes.orderedList, nodes.taskList];
|
|
19
26
|
if ((0, _expValEquals.expValEquals)('platform_editor_block_menu_layout_format', 'isEnabled', true)) {
|
|
@@ -31,7 +38,6 @@ var getIsFormatMenuHidden = function getIsFormatMenuHidden(selection, schema, me
|
|
|
31
38
|
content = listTypeOrBlockQuoteNode.node;
|
|
32
39
|
}
|
|
33
40
|
}
|
|
34
|
-
var isNested = (0, _isNestedNode.isNestedNode)(selection, menuTriggerBy);
|
|
35
41
|
return !content || isNested && !(0, _platformFeatureFlags.fg)('platform_editor_block_menu_transform_nested_node');
|
|
36
42
|
};
|
|
37
43
|
var getIsFormatMenuHiddenEmptyLine = function getIsFormatMenuHiddenEmptyLine(selection, schema, menuTriggerBy) {
|
|
@@ -40,6 +46,11 @@ var getIsFormatMenuHiddenEmptyLine = function getIsFormatMenuHiddenEmptyLine(sel
|
|
|
40
46
|
return false;
|
|
41
47
|
}
|
|
42
48
|
var isNested = (0, _isNestedNode.isNestedNode)(selection, menuTriggerBy);
|
|
49
|
+
if (TRANSFORM_MENU_ENABLED_FOR_ALL_TOP_LEVEL_NODES) {
|
|
50
|
+
var disabledOnNodes = [nodes.syncBlock, nodes.bodiedSyncBlock, nodes.rule];
|
|
51
|
+
var disabledNode = (0, _utils.findSelectedNodeOfType)(disabledOnNodes)(selection);
|
|
52
|
+
return !!disabledNode || isNested && !(0, _platformFeatureFlags.fg)('platform_editor_block_menu_transform_nested_node');
|
|
53
|
+
}
|
|
43
54
|
if (selection.empty || selection.content().size === 0) {
|
|
44
55
|
// if empty selection, show format menu
|
|
45
56
|
return false;
|
|
@@ -3,11 +3,18 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
3
3
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
4
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
5
5
|
import { isNestedNode } from './isNestedNode';
|
|
6
|
+
const TRANSFORM_MENU_ENABLED_FOR_ALL_TOP_LEVEL_NODES = true;
|
|
6
7
|
const getIsFormatMenuHidden = (selection, schema, menuTriggerBy) => {
|
|
7
8
|
const nodes = schema.nodes;
|
|
8
9
|
if (!nodes) {
|
|
9
10
|
return false;
|
|
10
11
|
}
|
|
12
|
+
const isNested = isNestedNode(selection, menuTriggerBy);
|
|
13
|
+
if (TRANSFORM_MENU_ENABLED_FOR_ALL_TOP_LEVEL_NODES) {
|
|
14
|
+
const disabledOnNodes = [nodes.syncBlock, nodes.bodiedSyncBlock, nodes.rule];
|
|
15
|
+
const disabledNode = findSelectedNodeOfType(disabledOnNodes)(selection);
|
|
16
|
+
return !!disabledNode || isNested && !fg('platform_editor_block_menu_transform_nested_node');
|
|
17
|
+
}
|
|
11
18
|
let content;
|
|
12
19
|
const allowedNodes = [nodes.paragraph, nodes.heading, nodes.blockquote, nodes.panel, nodes.codeBlock, nodes.bulletList, nodes.orderedList, nodes.taskList];
|
|
13
20
|
if (expValEquals('platform_editor_block_menu_layout_format', 'isEnabled', true)) {
|
|
@@ -25,7 +32,6 @@ const getIsFormatMenuHidden = (selection, schema, menuTriggerBy) => {
|
|
|
25
32
|
content = listTypeOrBlockQuoteNode.node;
|
|
26
33
|
}
|
|
27
34
|
}
|
|
28
|
-
const isNested = isNestedNode(selection, menuTriggerBy);
|
|
29
35
|
return !content || isNested && !fg('platform_editor_block_menu_transform_nested_node');
|
|
30
36
|
};
|
|
31
37
|
const getIsFormatMenuHiddenEmptyLine = (selection, schema, menuTriggerBy) => {
|
|
@@ -34,6 +40,11 @@ const getIsFormatMenuHiddenEmptyLine = (selection, schema, menuTriggerBy) => {
|
|
|
34
40
|
return false;
|
|
35
41
|
}
|
|
36
42
|
const isNested = isNestedNode(selection, menuTriggerBy);
|
|
43
|
+
if (TRANSFORM_MENU_ENABLED_FOR_ALL_TOP_LEVEL_NODES) {
|
|
44
|
+
const disabledOnNodes = [nodes.syncBlock, nodes.bodiedSyncBlock, nodes.rule];
|
|
45
|
+
const disabledNode = findSelectedNodeOfType(disabledOnNodes)(selection);
|
|
46
|
+
return !!disabledNode || isNested && !fg('platform_editor_block_menu_transform_nested_node');
|
|
47
|
+
}
|
|
37
48
|
if (selection.empty || selection.content().size === 0) {
|
|
38
49
|
// if empty selection, show format menu
|
|
39
50
|
return false;
|
|
@@ -3,11 +3,18 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
3
3
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
4
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
5
5
|
import { isNestedNode } from './isNestedNode';
|
|
6
|
+
var TRANSFORM_MENU_ENABLED_FOR_ALL_TOP_LEVEL_NODES = true;
|
|
6
7
|
var getIsFormatMenuHidden = function getIsFormatMenuHidden(selection, schema, menuTriggerBy) {
|
|
7
8
|
var nodes = schema.nodes;
|
|
8
9
|
if (!nodes) {
|
|
9
10
|
return false;
|
|
10
11
|
}
|
|
12
|
+
var isNested = isNestedNode(selection, menuTriggerBy);
|
|
13
|
+
if (TRANSFORM_MENU_ENABLED_FOR_ALL_TOP_LEVEL_NODES) {
|
|
14
|
+
var disabledOnNodes = [nodes.syncBlock, nodes.bodiedSyncBlock, nodes.rule];
|
|
15
|
+
var disabledNode = findSelectedNodeOfType(disabledOnNodes)(selection);
|
|
16
|
+
return !!disabledNode || isNested && !fg('platform_editor_block_menu_transform_nested_node');
|
|
17
|
+
}
|
|
11
18
|
var content;
|
|
12
19
|
var allowedNodes = [nodes.paragraph, nodes.heading, nodes.blockquote, nodes.panel, nodes.codeBlock, nodes.bulletList, nodes.orderedList, nodes.taskList];
|
|
13
20
|
if (expValEquals('platform_editor_block_menu_layout_format', 'isEnabled', true)) {
|
|
@@ -25,7 +32,6 @@ var getIsFormatMenuHidden = function getIsFormatMenuHidden(selection, schema, me
|
|
|
25
32
|
content = listTypeOrBlockQuoteNode.node;
|
|
26
33
|
}
|
|
27
34
|
}
|
|
28
|
-
var isNested = isNestedNode(selection, menuTriggerBy);
|
|
29
35
|
return !content || isNested && !fg('platform_editor_block_menu_transform_nested_node');
|
|
30
36
|
};
|
|
31
37
|
var getIsFormatMenuHiddenEmptyLine = function getIsFormatMenuHiddenEmptyLine(selection, schema, menuTriggerBy) {
|
|
@@ -34,6 +40,11 @@ var getIsFormatMenuHiddenEmptyLine = function getIsFormatMenuHiddenEmptyLine(sel
|
|
|
34
40
|
return false;
|
|
35
41
|
}
|
|
36
42
|
var isNested = isNestedNode(selection, menuTriggerBy);
|
|
43
|
+
if (TRANSFORM_MENU_ENABLED_FOR_ALL_TOP_LEVEL_NODES) {
|
|
44
|
+
var disabledOnNodes = [nodes.syncBlock, nodes.bodiedSyncBlock, nodes.rule];
|
|
45
|
+
var disabledNode = findSelectedNodeOfType(disabledOnNodes)(selection);
|
|
46
|
+
return !!disabledNode || isNested && !fg('platform_editor_block_menu_transform_nested_node');
|
|
47
|
+
}
|
|
37
48
|
if (selection.empty || selection.content().size === 0) {
|
|
38
49
|
// if empty selection, show format menu
|
|
39
50
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-menu",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.9",
|
|
4
4
|
"description": "BlockMenu plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/css": "^0.15.0",
|
|
32
32
|
"@atlaskit/dropdown-menu": "^16.3.0",
|
|
33
33
|
"@atlaskit/editor-plugin-analytics": "^6.2.0",
|
|
34
|
-
"@atlaskit/editor-plugin-block-controls": "^7.
|
|
34
|
+
"@atlaskit/editor-plugin-block-controls": "^7.7.0",
|
|
35
35
|
"@atlaskit/editor-plugin-decorations": "^6.1.0",
|
|
36
36
|
"@atlaskit/editor-plugin-selection": "^6.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-user-intent": "^4.0.0",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
45
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
46
46
|
"@atlaskit/primitives": "^16.1.0",
|
|
47
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
47
|
+
"@atlaskit/tmp-editor-statsig": "^13.38.0",
|
|
48
48
|
"@atlaskit/tokens": "^8.0.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@atlaskit/editor-common": "^110.
|
|
52
|
+
"@atlaskit/editor-common": "^110.31.0",
|
|
53
53
|
"react": "^18.2.0",
|
|
54
54
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
55
55
|
},
|