@atlaskit/editor-plugin-block-controls 3.19.9 → 3.19.11
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 +17 -0
- package/dist/cjs/pm-plugins/decorations-quick-insert-button.js +4 -0
- package/dist/cjs/ui/quick-insert-button.js +2 -2
- package/dist/cjs/ui/utils/editor-commands.js +2 -1
- package/dist/es2019/pm-plugins/decorations-quick-insert-button.js +4 -0
- package/dist/es2019/ui/quick-insert-button.js +2 -2
- package/dist/es2019/ui/utils/editor-commands.js +2 -1
- package/dist/esm/pm-plugins/decorations-quick-insert-button.js +4 -0
- package/dist/esm/ui/quick-insert-button.js +2 -2
- package/dist/esm/ui/utils/editor-commands.js +2 -1
- package/package.json +11 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 3.19.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#177025](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/177025)
|
|
8
|
+
[`b000694948f37`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b000694948f37) -
|
|
9
|
+
[ED-27900] Fix cursor disappear when focusing editor at the first line by pressing Tab or down
|
|
10
|
+
arrow key at page title
|
|
11
|
+
|
|
12
|
+
## 3.19.10
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#175523](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/175523)
|
|
17
|
+
[`0623f8fb2b5ee`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0623f8fb2b5ee) -
|
|
18
|
+
Fix a bug where slash command via quick insert button is not inserted at the correct location
|
|
19
|
+
|
|
3
20
|
## 3.19.9
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -53,6 +53,10 @@ var quickInsertButtonDecoration = exports.quickInsertButtonDecoration = function
|
|
|
53
53
|
};
|
|
54
54
|
return _view.Decoration.widget(rootPos, function (view, getPos) {
|
|
55
55
|
var element = document.createElement('span');
|
|
56
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_15')) {
|
|
57
|
+
// inline decoration causes cursor disappear when focusing editor at the first line (e.g. press Tab when title is focused)
|
|
58
|
+
element.style.display = 'block';
|
|
59
|
+
}
|
|
56
60
|
element.contentEditable = 'false';
|
|
57
61
|
element.setAttribute('data-blocks-quick-insert-container', 'true');
|
|
58
62
|
element.setAttribute('data-testid', 'block-ctrl-quick-insert-button');
|
|
@@ -249,7 +249,7 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
|
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
if (currentSelection instanceof _cellSelection.CellSelection
|
|
252
|
+
if (currentSelection instanceof _cellSelection.CellSelection) {
|
|
253
253
|
// find the last inline position in the selection
|
|
254
254
|
var lastInlinePosition = _state.TextSelection.near(view.state.selection.$to, -1);
|
|
255
255
|
lastInlinePosition && api.core.actions.execute(function (_ref4) {
|
|
@@ -306,7 +306,7 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
|
|
|
306
306
|
style: positionStyles,
|
|
307
307
|
xcss: [containerStaticStyles, isTypeAheadOpen && !(0, _platformFeatureFlags.fg)('platform_editor_controls_widget_visibility') && disabledContainerStyles]
|
|
308
308
|
}, (0, _react2.jsx)("span", {
|
|
309
|
-
css: [tooltipContainerStyles,
|
|
309
|
+
css: [tooltipContainerStyles, tooltipContainerStylesStickyHeader, tooltipContainerStylesStickyHeaderWithMarksFix]
|
|
310
310
|
}, tooltipPressable()));
|
|
311
311
|
};
|
|
312
312
|
var QuickInsertWithVisibility = exports.QuickInsertWithVisibility = function QuickInsertWithVisibility(_ref5) {
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.createNewLine = void 0;
|
|
7
7
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
9
|
var createNewLine = exports.createNewLine = function createNewLine(start) {
|
|
9
10
|
return function (_ref) {
|
|
10
11
|
var _tr$doc$nodeAt;
|
|
@@ -15,6 +16,6 @@ var createNewLine = exports.createNewLine = function createNewLine(start) {
|
|
|
15
16
|
}
|
|
16
17
|
var position = start + nodeSize;
|
|
17
18
|
tr.insert(position, tr.doc.type.schema.nodes.paragraph.create());
|
|
18
|
-
return tr.setSelection(_state.TextSelection.create(tr.doc, position));
|
|
19
|
+
return tr.setSelection((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_14') ? _state.TextSelection.near(tr.doc.resolve(position)) : _state.TextSelection.create(tr.doc, position));
|
|
19
20
|
};
|
|
20
21
|
};
|
|
@@ -44,6 +44,10 @@ export const quickInsertButtonDecoration = (api, formatMessage, rootPos, anchorN
|
|
|
44
44
|
};
|
|
45
45
|
return Decoration.widget(rootPos, (view, getPos) => {
|
|
46
46
|
const element = document.createElement('span');
|
|
47
|
+
if (fg('platform_editor_controls_patch_15')) {
|
|
48
|
+
// inline decoration causes cursor disappear when focusing editor at the first line (e.g. press Tab when title is focused)
|
|
49
|
+
element.style.display = 'block';
|
|
50
|
+
}
|
|
47
51
|
element.contentEditable = 'false';
|
|
48
52
|
element.setAttribute('data-blocks-quick-insert-container', 'true');
|
|
49
53
|
element.setAttribute('data-testid', 'block-ctrl-quick-insert-button');
|
|
@@ -244,7 +244,7 @@ export const TypeAheadControl = ({
|
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
if (currentSelection instanceof CellSelection
|
|
247
|
+
if (currentSelection instanceof CellSelection) {
|
|
248
248
|
// find the last inline position in the selection
|
|
249
249
|
const lastInlinePosition = TextSelection.near(view.state.selection.$to, -1);
|
|
250
250
|
lastInlinePosition && api.core.actions.execute(({
|
|
@@ -300,7 +300,7 @@ export const TypeAheadControl = ({
|
|
|
300
300
|
style: positionStyles,
|
|
301
301
|
xcss: [containerStaticStyles, isTypeAheadOpen && !fg('platform_editor_controls_widget_visibility') && disabledContainerStyles]
|
|
302
302
|
}, jsx("span", {
|
|
303
|
-
css: [tooltipContainerStyles,
|
|
303
|
+
css: [tooltipContainerStyles, tooltipContainerStylesStickyHeader, tooltipContainerStylesStickyHeaderWithMarksFix]
|
|
304
304
|
}, tooltipPressable()));
|
|
305
305
|
};
|
|
306
306
|
export const QuickInsertWithVisibility = ({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
export const createNewLine = start => ({
|
|
3
4
|
tr
|
|
4
5
|
}) => {
|
|
@@ -9,5 +10,5 @@ export const createNewLine = start => ({
|
|
|
9
10
|
}
|
|
10
11
|
const position = start + nodeSize;
|
|
11
12
|
tr.insert(position, tr.doc.type.schema.nodes.paragraph.create());
|
|
12
|
-
return tr.setSelection(TextSelection.create(tr.doc, position));
|
|
13
|
+
return tr.setSelection(fg('platform_editor_controls_patch_14') ? TextSelection.near(tr.doc.resolve(position)) : TextSelection.create(tr.doc, position));
|
|
13
14
|
};
|
|
@@ -46,6 +46,10 @@ export var quickInsertButtonDecoration = function quickInsertButtonDecoration(ap
|
|
|
46
46
|
};
|
|
47
47
|
return Decoration.widget(rootPos, function (view, getPos) {
|
|
48
48
|
var element = document.createElement('span');
|
|
49
|
+
if (fg('platform_editor_controls_patch_15')) {
|
|
50
|
+
// inline decoration causes cursor disappear when focusing editor at the first line (e.g. press Tab when title is focused)
|
|
51
|
+
element.style.display = 'block';
|
|
52
|
+
}
|
|
49
53
|
element.contentEditable = 'false';
|
|
50
54
|
element.setAttribute('data-blocks-quick-insert-container', 'true');
|
|
51
55
|
element.setAttribute('data-testid', 'block-ctrl-quick-insert-button');
|
|
@@ -244,7 +244,7 @@ export var TypeAheadControl = function TypeAheadControl(_ref) {
|
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
if (currentSelection instanceof CellSelection
|
|
247
|
+
if (currentSelection instanceof CellSelection) {
|
|
248
248
|
// find the last inline position in the selection
|
|
249
249
|
var lastInlinePosition = TextSelection.near(view.state.selection.$to, -1);
|
|
250
250
|
lastInlinePosition && api.core.actions.execute(function (_ref4) {
|
|
@@ -301,7 +301,7 @@ export var TypeAheadControl = function TypeAheadControl(_ref) {
|
|
|
301
301
|
style: positionStyles,
|
|
302
302
|
xcss: [containerStaticStyles, isTypeAheadOpen && !fg('platform_editor_controls_widget_visibility') && disabledContainerStyles]
|
|
303
303
|
}, jsx("span", {
|
|
304
|
-
css: [tooltipContainerStyles,
|
|
304
|
+
css: [tooltipContainerStyles, tooltipContainerStylesStickyHeader, tooltipContainerStylesStickyHeaderWithMarksFix]
|
|
305
305
|
}, tooltipPressable()));
|
|
306
306
|
};
|
|
307
307
|
export var QuickInsertWithVisibility = function QuickInsertWithVisibility(_ref5) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
export var createNewLine = function createNewLine(start) {
|
|
3
4
|
return function (_ref) {
|
|
4
5
|
var _tr$doc$nodeAt;
|
|
@@ -9,6 +10,6 @@ export var createNewLine = function createNewLine(start) {
|
|
|
9
10
|
}
|
|
10
11
|
var position = start + nodeSize;
|
|
11
12
|
tr.insert(position, tr.doc.type.schema.nodes.paragraph.create());
|
|
12
|
-
return tr.setSelection(TextSelection.create(tr.doc, position));
|
|
13
|
+
return tr.setSelection(fg('platform_editor_controls_patch_14') ? TextSelection.near(tr.doc.resolve(position)) : TextSelection.create(tr.doc, position));
|
|
13
14
|
};
|
|
14
15
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "3.19.
|
|
3
|
+
"version": "3.19.11",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
36
|
-
"@atlaskit/editor-common": "^107.
|
|
36
|
+
"@atlaskit/editor-common": "^107.3.0",
|
|
37
37
|
"@atlaskit/editor-plugin-accessibility-utils": "^2.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-disabled": "^2.1.0",
|
|
@@ -48,15 +48,15 @@
|
|
|
48
48
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
49
49
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
50
50
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
51
|
-
"@atlaskit/icon": "^27.
|
|
51
|
+
"@atlaskit/icon": "^27.2.0",
|
|
52
52
|
"@atlaskit/link": "^3.2.0",
|
|
53
53
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
54
54
|
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
|
|
55
55
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
56
56
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
57
|
-
"@atlaskit/primitives": "^14.
|
|
57
|
+
"@atlaskit/primitives": "^14.10.0",
|
|
58
58
|
"@atlaskit/theme": "^18.0.0",
|
|
59
|
-
"@atlaskit/tmp-editor-statsig": "^8.
|
|
59
|
+
"@atlaskit/tmp-editor-statsig": "^8.4.0",
|
|
60
60
|
"@atlaskit/tokens": "^5.4.0",
|
|
61
61
|
"@atlaskit/tooltip": "^20.3.0",
|
|
62
62
|
"@babel/runtime": "^7.0.0",
|
|
@@ -159,9 +159,6 @@
|
|
|
159
159
|
"platform_editor_controls_widget_visibility": {
|
|
160
160
|
"type": "boolean"
|
|
161
161
|
},
|
|
162
|
-
"platform_editor_controls_patch_4": {
|
|
163
|
-
"type": "boolean"
|
|
164
|
-
},
|
|
165
162
|
"platform_editor_no_cursor_on_live_doc_init": {
|
|
166
163
|
"type": "boolean"
|
|
167
164
|
},
|
|
@@ -183,11 +180,17 @@
|
|
|
183
180
|
"platform_editor_controls_patch_13": {
|
|
184
181
|
"type": "boolean"
|
|
185
182
|
},
|
|
183
|
+
"platform_editor_controls_patch_14": {
|
|
184
|
+
"type": "boolean"
|
|
185
|
+
},
|
|
186
186
|
"platform_editor_breakout_resizing_hello_release": {
|
|
187
187
|
"type": "boolean"
|
|
188
188
|
},
|
|
189
189
|
"platform_editor_block_controls_drop_target_mem_fix": {
|
|
190
190
|
"type": "boolean"
|
|
191
|
+
},
|
|
192
|
+
"platform_editor_controls_patch_15": {
|
|
193
|
+
"type": "boolean"
|
|
191
194
|
}
|
|
192
195
|
}
|
|
193
196
|
}
|