@atlaskit/editor-core 187.32.5 → 187.32.6
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 +7 -0
- package/dist/cjs/plugins/block-type/commands/transform-to-code-block.js +3 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/block-type/commands/transform-to-code-block.js +3 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/block-type/commands/transform-to-code-block.js +3 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 187.32.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`20fa6edb5d4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/20fa6edb5d4) - ED-19617 Extract Floating Toolbar VR test to editor-core
|
|
8
|
+
- [`7d9ffc3a1ce`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7d9ffc3a1ce) - [ux] ED-19342 Fix: Inserting Code-Block at gap-cursor will not consume all the content after gap-cursor
|
|
9
|
+
|
|
3
10
|
## 187.32.5
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -7,10 +7,11 @@ exports.isConvertableToCodeBlock = isConvertableToCodeBlock;
|
|
|
7
7
|
exports.transformToCodeBlockAction = transformToCodeBlockAction;
|
|
8
8
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
9
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
10
|
+
var _selection = require("@atlaskit/editor-common/selection");
|
|
10
11
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
11
12
|
function transformToCodeBlockAction(state, start, attrs) {
|
|
12
13
|
var startOfCodeBlockText = state.selection.$from;
|
|
13
|
-
var endPosition = state.selection.empty ? startOfCodeBlockText.end() : state.selection.$to.pos;
|
|
14
|
+
var endPosition = state.selection.empty && !(state.selection instanceof _selection.GapCursorSelection) ? startOfCodeBlockText.end() : state.selection.$to.pos;
|
|
14
15
|
var startLinePosition = startOfCodeBlockText.start();
|
|
15
16
|
//when cmd+A is used to select the content. start position should be 0.
|
|
16
17
|
var parentStartPosition = startOfCodeBlockText.depth === 0 ? 0 : startOfCodeBlockText.before();
|
|
@@ -60,7 +61,7 @@ function transformToCodeBlockAction(state, start, attrs) {
|
|
|
60
61
|
|
|
61
62
|
// Reposition cursor when inserting into layouts or table headers
|
|
62
63
|
var mapped = tr.doc.resolve(tr.mapping.map(startMapped) + 1);
|
|
63
|
-
var selection = _state.TextSelection.findFrom(mapped, 1, true);
|
|
64
|
+
var selection = _state.TextSelection.findFrom(mapped, state.selection instanceof _selection.GapCursorSelection ? -1 : 1, true);
|
|
64
65
|
if (selection) {
|
|
65
66
|
return tr.setSelection(selection);
|
|
66
67
|
}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "187.32.
|
|
9
|
+
var version = "187.32.6";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
3
4
|
import { timestampToString, mapSlice } from '@atlaskit/editor-common/utils';
|
|
4
5
|
export function transformToCodeBlockAction(state, start, attrs) {
|
|
5
6
|
const startOfCodeBlockText = state.selection.$from;
|
|
6
|
-
const endPosition = state.selection.empty ? startOfCodeBlockText.end() : state.selection.$to.pos;
|
|
7
|
+
const endPosition = state.selection.empty && !(state.selection instanceof GapCursorSelection) ? startOfCodeBlockText.end() : state.selection.$to.pos;
|
|
7
8
|
const startLinePosition = startOfCodeBlockText.start();
|
|
8
9
|
//when cmd+A is used to select the content. start position should be 0.
|
|
9
10
|
const parentStartPosition = startOfCodeBlockText.depth === 0 ? 0 : startOfCodeBlockText.before();
|
|
@@ -53,7 +54,7 @@ export function transformToCodeBlockAction(state, start, attrs) {
|
|
|
53
54
|
|
|
54
55
|
// Reposition cursor when inserting into layouts or table headers
|
|
55
56
|
const mapped = tr.doc.resolve(tr.mapping.map(startMapped) + 1);
|
|
56
|
-
const selection = TextSelection.findFrom(mapped, 1, true);
|
|
57
|
+
const selection = TextSelection.findFrom(mapped, state.selection instanceof GapCursorSelection ? -1 : 1, true);
|
|
57
58
|
if (selection) {
|
|
58
59
|
return tr.setSelection(selection);
|
|
59
60
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
3
4
|
import { timestampToString, mapSlice } from '@atlaskit/editor-common/utils';
|
|
4
5
|
export function transformToCodeBlockAction(state, start, attrs) {
|
|
5
6
|
var startOfCodeBlockText = state.selection.$from;
|
|
6
|
-
var endPosition = state.selection.empty ? startOfCodeBlockText.end() : state.selection.$to.pos;
|
|
7
|
+
var endPosition = state.selection.empty && !(state.selection instanceof GapCursorSelection) ? startOfCodeBlockText.end() : state.selection.$to.pos;
|
|
7
8
|
var startLinePosition = startOfCodeBlockText.start();
|
|
8
9
|
//when cmd+A is used to select the content. start position should be 0.
|
|
9
10
|
var parentStartPosition = startOfCodeBlockText.depth === 0 ? 0 : startOfCodeBlockText.before();
|
|
@@ -53,7 +54,7 @@ export function transformToCodeBlockAction(state, start, attrs) {
|
|
|
53
54
|
|
|
54
55
|
// Reposition cursor when inserting into layouts or table headers
|
|
55
56
|
var mapped = tr.doc.resolve(tr.mapping.map(startMapped) + 1);
|
|
56
|
-
var selection = TextSelection.findFrom(mapped, 1, true);
|
|
57
|
+
var selection = TextSelection.findFrom(mapped, state.selection instanceof GapCursorSelection ? -1 : 1, true);
|
|
57
58
|
if (selection) {
|
|
58
59
|
return tr.setSelection(selection);
|
|
59
60
|
}
|