@atlaskit/editor-plugin-layout 2.6.0 → 2.6.1
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-layout
|
|
2
2
|
|
|
3
|
+
## 2.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#145340](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/145340)
|
|
8
|
+
[`21717a29553b2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/21717a29553b2) -
|
|
9
|
+
Switching from 5, 4, 3 empty columns layout to 1 column should work
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 2.6.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -14,6 +14,7 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
14
14
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
15
15
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
16
16
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
18
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
18
19
|
var _consts = require("./consts");
|
|
19
20
|
var _pluginKey = require("./plugin-key");
|
|
@@ -209,7 +210,8 @@ function removeLastColumnInLayout(column, columnPos, insideRightEdgePos) {
|
|
|
209
210
|
// check if the column only contains a paragraph with a placeholder text
|
|
210
211
|
// if so, remove the whole column, otherwise just remove the paragraph
|
|
211
212
|
if ((0, _utils.isEmptyDocument)(column)) {
|
|
212
|
-
|
|
213
|
+
var fromPos = (0, _platformFeatureFlags.fg)('platform_editor_convert_multiple_columns_to_single') ? columnPos : columnPos - 1;
|
|
214
|
+
tr.replaceRange(tr.mapping.map(fromPos), tr.mapping.map(insideRightEdgePos), _model.Slice.empty);
|
|
213
215
|
} else {
|
|
214
216
|
tr.replaceRange(tr.mapping.map(columnPos - 1), tr.mapping.map(columnPos + 1), _model.Slice.empty);
|
|
215
217
|
}
|
|
@@ -4,6 +4,7 @@ import { flatmap, getStepRange, isEmptyDocument, mapChildren } from '@atlaskit/e
|
|
|
4
4
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
9
|
import { EVEN_DISTRIBUTED_COL_WIDTHS } from './consts';
|
|
9
10
|
import { pluginKey } from './plugin-key';
|
|
@@ -188,7 +189,8 @@ function removeLastColumnInLayout(column, columnPos, insideRightEdgePos) {
|
|
|
188
189
|
// check if the column only contains a paragraph with a placeholder text
|
|
189
190
|
// if so, remove the whole column, otherwise just remove the paragraph
|
|
190
191
|
if (isEmptyDocument(column)) {
|
|
191
|
-
|
|
192
|
+
const fromPos = fg('platform_editor_convert_multiple_columns_to_single') ? columnPos : columnPos - 1;
|
|
193
|
+
tr.replaceRange(tr.mapping.map(fromPos), tr.mapping.map(insideRightEdgePos), Slice.empty);
|
|
192
194
|
} else {
|
|
193
195
|
tr.replaceRange(tr.mapping.map(columnPos - 1), tr.mapping.map(columnPos + 1), Slice.empty);
|
|
194
196
|
}
|
|
@@ -7,6 +7,7 @@ import { flatmap, getStepRange, isEmptyDocument, mapChildren } from '@atlaskit/e
|
|
|
7
7
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
8
8
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
12
|
import { EVEN_DISTRIBUTED_COL_WIDTHS } from './consts';
|
|
12
13
|
import { pluginKey } from './plugin-key';
|
|
@@ -200,7 +201,8 @@ function removeLastColumnInLayout(column, columnPos, insideRightEdgePos) {
|
|
|
200
201
|
// check if the column only contains a paragraph with a placeholder text
|
|
201
202
|
// if so, remove the whole column, otherwise just remove the paragraph
|
|
202
203
|
if (isEmptyDocument(column)) {
|
|
203
|
-
|
|
204
|
+
var fromPos = fg('platform_editor_convert_multiple_columns_to_single') ? columnPos : columnPos - 1;
|
|
205
|
+
tr.replaceRange(tr.mapping.map(fromPos), tr.mapping.map(insideRightEdgePos), Slice.empty);
|
|
204
206
|
} else {
|
|
205
207
|
tr.replaceRange(tr.mapping.map(columnPos - 1), tr.mapping.map(columnPos + 1), Slice.empty);
|
|
206
208
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-layout",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "Layout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
37
|
-
"@atlaskit/editor-common": "^103.
|
|
37
|
+
"@atlaskit/editor-common": "^103.17.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
39
39
|
"@atlaskit/editor-plugin-decorations": "^2.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
46
46
|
"@atlaskit/icon": "^25.6.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
48
|
+
"@atlaskit/tmp-editor-statsig": "^4.14.0",
|
|
49
49
|
"@atlaskit/tokens": "^4.8.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"@emotion/react": "^11.7.1"
|
|
@@ -101,6 +101,9 @@
|
|
|
101
101
|
"platform-feature-flags": {
|
|
102
102
|
"platform-visual-refresh-icons": {
|
|
103
103
|
"type": "boolean"
|
|
104
|
+
},
|
|
105
|
+
"platform_editor_convert_multiple_columns_to_single": {
|
|
106
|
+
"type": "boolean"
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
109
|
}
|