@atlaskit/editor-plugin-block-controls 9.1.17 → 9.1.18
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,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 9.1.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1bd298ad0a152`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1bd298ad0a152) -
|
|
8
|
+
[ux] EDITOR-6280 Clean up platform_editor_block_menu_v2_patch_3 to fix icon and copy in jira block
|
|
9
|
+
menu
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 9.1.17
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -9,7 +9,6 @@ var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
|
9
9
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
10
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
11
11
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
14
13
|
var getInlineNodePos = exports.getInlineNodePos = function getInlineNodePos(doc, start, nodeSize) {
|
|
15
14
|
var $startPos = doc.resolve(start);
|
|
@@ -97,21 +96,11 @@ var newGetSelection = exports.newGetSelection = function newGetSelection(doc, se
|
|
|
97
96
|
var nodeSize = node ? node.nodeSize : 1;
|
|
98
97
|
var nodeName = node === null || node === void 0 ? void 0 : node.type.name;
|
|
99
98
|
if ((0, _experiments.editorExperiment)('platform_editor_block_menu', true)) {
|
|
100
|
-
var _doc$nodeAt;
|
|
101
99
|
// if mediaGroup only has a single child, we want to select the child
|
|
102
100
|
if (nodeName === 'mediaGroup' && (node === null || node === void 0 ? void 0 : node.childCount) === 1) {
|
|
103
101
|
var $mediaStartPos = doc.resolve(start + 1);
|
|
104
102
|
return new _state.NodeSelection($mediaStartPos);
|
|
105
103
|
}
|
|
106
|
-
|
|
107
|
-
// if heading with alignment nested inside a layout column, return TextSelection
|
|
108
|
-
// As NodeSelection cause the desc.selectNode is not a function error in the syncNodeSelection in prosemirror view
|
|
109
|
-
// Results in block menu not open on the first 2 clicks for a heading with alignment nested inside a layout column
|
|
110
|
-
if (nodeName === 'heading' && node !== null && node !== void 0 && node.marks.some(function (mark) {
|
|
111
|
-
return mark.type.name === 'alignment';
|
|
112
|
-
}) && ((_doc$nodeAt = doc.nodeAt(start - 1)) === null || _doc$nodeAt === void 0 ? void 0 : _doc$nodeAt.type.name) === 'layoutColumn' && !(0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3')) {
|
|
113
|
-
return _state.TextSelection.create(doc, start, start + nodeSize);
|
|
114
|
-
}
|
|
115
104
|
return new _state.NodeSelection(doc.resolve(start));
|
|
116
105
|
}
|
|
117
106
|
|
|
@@ -3,7 +3,6 @@ import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-che
|
|
|
3
3
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
import { selectTableClosestToPos } from '@atlaskit/editor-tables/utils';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
export const getInlineNodePos = (doc, start, nodeSize) => {
|
|
9
8
|
const $startPos = doc.resolve(start);
|
|
@@ -92,19 +91,11 @@ export const newGetSelection = (doc, selectionEmpty, start) => {
|
|
|
92
91
|
const nodeSize = node ? node.nodeSize : 1;
|
|
93
92
|
const nodeName = node === null || node === void 0 ? void 0 : node.type.name;
|
|
94
93
|
if (editorExperiment('platform_editor_block_menu', true)) {
|
|
95
|
-
var _doc$nodeAt;
|
|
96
94
|
// if mediaGroup only has a single child, we want to select the child
|
|
97
95
|
if (nodeName === 'mediaGroup' && (node === null || node === void 0 ? void 0 : node.childCount) === 1) {
|
|
98
96
|
const $mediaStartPos = doc.resolve(start + 1);
|
|
99
97
|
return new NodeSelection($mediaStartPos);
|
|
100
98
|
}
|
|
101
|
-
|
|
102
|
-
// if heading with alignment nested inside a layout column, return TextSelection
|
|
103
|
-
// As NodeSelection cause the desc.selectNode is not a function error in the syncNodeSelection in prosemirror view
|
|
104
|
-
// Results in block menu not open on the first 2 clicks for a heading with alignment nested inside a layout column
|
|
105
|
-
if (nodeName === 'heading' && node !== null && node !== void 0 && node.marks.some(mark => mark.type.name === 'alignment') && ((_doc$nodeAt = doc.nodeAt(start - 1)) === null || _doc$nodeAt === void 0 ? void 0 : _doc$nodeAt.type.name) === 'layoutColumn' && !fg('platform_editor_block_menu_v2_patch_3')) {
|
|
106
|
-
return TextSelection.create(doc, start, start + nodeSize);
|
|
107
|
-
}
|
|
108
99
|
return new NodeSelection(doc.resolve(start));
|
|
109
100
|
}
|
|
110
101
|
|
|
@@ -3,7 +3,6 @@ import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-che
|
|
|
3
3
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
import { selectTableClosestToPos } from '@atlaskit/editor-tables/utils';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
export var getInlineNodePos = function getInlineNodePos(doc, start, nodeSize) {
|
|
9
8
|
var $startPos = doc.resolve(start);
|
|
@@ -91,21 +90,11 @@ export var newGetSelection = function newGetSelection(doc, selectionEmpty, start
|
|
|
91
90
|
var nodeSize = node ? node.nodeSize : 1;
|
|
92
91
|
var nodeName = node === null || node === void 0 ? void 0 : node.type.name;
|
|
93
92
|
if (editorExperiment('platform_editor_block_menu', true)) {
|
|
94
|
-
var _doc$nodeAt;
|
|
95
93
|
// if mediaGroup only has a single child, we want to select the child
|
|
96
94
|
if (nodeName === 'mediaGroup' && (node === null || node === void 0 ? void 0 : node.childCount) === 1) {
|
|
97
95
|
var $mediaStartPos = doc.resolve(start + 1);
|
|
98
96
|
return new NodeSelection($mediaStartPos);
|
|
99
97
|
}
|
|
100
|
-
|
|
101
|
-
// if heading with alignment nested inside a layout column, return TextSelection
|
|
102
|
-
// As NodeSelection cause the desc.selectNode is not a function error in the syncNodeSelection in prosemirror view
|
|
103
|
-
// Results in block menu not open on the first 2 clicks for a heading with alignment nested inside a layout column
|
|
104
|
-
if (nodeName === 'heading' && node !== null && node !== void 0 && node.marks.some(function (mark) {
|
|
105
|
-
return mark.type.name === 'alignment';
|
|
106
|
-
}) && ((_doc$nodeAt = doc.nodeAt(start - 1)) === null || _doc$nodeAt === void 0 ? void 0 : _doc$nodeAt.type.name) === 'layoutColumn' && !fg('platform_editor_block_menu_v2_patch_3')) {
|
|
107
|
-
return TextSelection.create(doc, start, start + nodeSize);
|
|
108
|
-
}
|
|
109
98
|
return new NodeSelection(doc.resolve(start));
|
|
110
99
|
}
|
|
111
100
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.18",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
57
57
|
"@atlaskit/primitives": "^19.0.0",
|
|
58
58
|
"@atlaskit/theme": "^23.0.0",
|
|
59
|
-
"@atlaskit/tmp-editor-statsig": "^62.
|
|
59
|
+
"@atlaskit/tmp-editor-statsig": "^62.2.0",
|
|
60
60
|
"@atlaskit/tokens": "^13.0.0",
|
|
61
61
|
"@atlaskit/tooltip": "^21.1.0",
|
|
62
62
|
"@babel/runtime": "^7.0.0",
|
|
@@ -132,9 +132,6 @@
|
|
|
132
132
|
"platform_editor_content_mode_button_mvp": {
|
|
133
133
|
"type": "boolean"
|
|
134
134
|
},
|
|
135
|
-
"platform_editor_block_menu_v2_patch_3": {
|
|
136
|
-
"type": "boolean"
|
|
137
|
-
},
|
|
138
135
|
"platform_editor_table_sticky_header_patch_6": {
|
|
139
136
|
"type": "boolean"
|
|
140
137
|
},
|