@atlaskit/editor-core 188.5.0 → 188.5.2
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/labs/next/presets/default.js +2 -2
- package/dist/cjs/labs/next/presets/universal.js +1 -6
- package/dist/cjs/plugins/expand/index.js +0 -2
- package/dist/cjs/plugins/expand/nodeviews/index.js +37 -13
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/ui/Addon/click-area-helper.js +9 -11
- package/dist/cjs/ui/ContentStyles/index.js +13 -13
- package/dist/cjs/utils/selection.js +12 -14
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/labs/next/presets/universal.js +1 -6
- package/dist/es2019/plugins/expand/index.js +0 -2
- package/dist/es2019/plugins/expand/nodeviews/index.js +37 -13
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/ui/Addon/click-area-helper.js +4 -6
- package/dist/es2019/ui/ContentStyles/index.js +1 -1
- package/dist/es2019/utils/selection.js +2 -17
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/labs/next/presets/universal.js +1 -6
- package/dist/esm/plugins/expand/index.js +0 -2
- package/dist/esm/plugins/expand/nodeviews/index.js +37 -13
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/ui/Addon/click-area-helper.js +4 -6
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/utils/selection.js +2 -13
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/labs/next/presets/default.d.ts +22 -8
- package/dist/types/plugins/expand/index.d.ts +1 -1
- package/dist/types/plugins/expand/nodeviews/index.d.ts +3 -2
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/utils/selection.d.ts +1 -4
- package/package.json +4 -3
- package/dist/cjs/plugins/selection/actions.js +0 -11
- package/dist/cjs/plugins/selection/commands.js +0 -257
- package/dist/cjs/plugins/selection/gap-cursor/actions.js +0 -272
- package/dist/cjs/plugins/selection/gap-cursor/direction.js +0 -23
- package/dist/cjs/plugins/selection/gap-cursor/selection.js +0 -30
- package/dist/cjs/plugins/selection/gap-cursor/styles.js +0 -17
- package/dist/cjs/plugins/selection/gap-cursor/utils/is-ignored.js +0 -12
- package/dist/cjs/plugins/selection/gap-cursor/utils/is-valid-target-node.js +0 -12
- package/dist/cjs/plugins/selection/gap-cursor/utils/place-gap-cursor.js +0 -103
- package/dist/cjs/plugins/selection/gap-cursor/utils.js +0 -137
- package/dist/cjs/plugins/selection/gap-cursor-selection.js +0 -37
- package/dist/cjs/plugins/selection/index.js +0 -65
- package/dist/cjs/plugins/selection/plugin-factory.js +0 -49
- package/dist/cjs/plugins/selection/pm-plugins/events/create-selection-between.js +0 -92
- package/dist/cjs/plugins/selection/pm-plugins/events/keydown.js +0 -115
- package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-keymap.js +0 -46
- package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-main.js +0 -160
- package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-plugin-key.js +0 -8
- package/dist/cjs/plugins/selection/pm-plugins/keymap.js +0 -16
- package/dist/cjs/plugins/selection/pm-plugins/selection-main.js +0 -104
- package/dist/cjs/plugins/selection/reducer.js +0 -26
- package/dist/cjs/plugins/selection/types.js +0 -20
- package/dist/cjs/plugins/selection/utils.js +0 -280
- package/dist/cjs/selection-api/api.js +0 -27
- package/dist/es2019/plugins/selection/actions.js +0 -5
- package/dist/es2019/plugins/selection/commands.js +0 -250
- package/dist/es2019/plugins/selection/gap-cursor/actions.js +0 -270
- package/dist/es2019/plugins/selection/gap-cursor/direction.js +0 -15
- package/dist/es2019/plugins/selection/gap-cursor/selection.js +0 -1
- package/dist/es2019/plugins/selection/gap-cursor/styles.js +0 -145
- package/dist/es2019/plugins/selection/gap-cursor/utils/is-ignored.js +0 -1
- package/dist/es2019/plugins/selection/gap-cursor/utils/is-valid-target-node.js +0 -1
- package/dist/es2019/plugins/selection/gap-cursor/utils/place-gap-cursor.js +0 -94
- package/dist/es2019/plugins/selection/gap-cursor/utils.js +0 -124
- package/dist/es2019/plugins/selection/gap-cursor-selection.js +0 -2
- package/dist/es2019/plugins/selection/index.js +0 -51
- package/dist/es2019/plugins/selection/plugin-factory.js +0 -43
- package/dist/es2019/plugins/selection/pm-plugins/events/create-selection-between.js +0 -89
- package/dist/es2019/plugins/selection/pm-plugins/events/keydown.js +0 -112
- package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-keymap.js +0 -40
- package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-main.js +0 -158
- package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-plugin-key.js +0 -2
- package/dist/es2019/plugins/selection/pm-plugins/keymap.js +0 -10
- package/dist/es2019/plugins/selection/pm-plugins/selection-main.js +0 -97
- package/dist/es2019/plugins/selection/reducer.js +0 -18
- package/dist/es2019/plugins/selection/types.js +0 -9
- package/dist/es2019/plugins/selection/utils.js +0 -233
- package/dist/es2019/selection-api/api.js +0 -20
- package/dist/esm/plugins/selection/actions.js +0 -5
- package/dist/esm/plugins/selection/commands.js +0 -251
- package/dist/esm/plugins/selection/gap-cursor/actions.js +0 -266
- package/dist/esm/plugins/selection/gap-cursor/direction.js +0 -15
- package/dist/esm/plugins/selection/gap-cursor/selection.js +0 -1
- package/dist/esm/plugins/selection/gap-cursor/styles.js +0 -10
- package/dist/esm/plugins/selection/gap-cursor/utils/is-ignored.js +0 -1
- package/dist/esm/plugins/selection/gap-cursor/utils/is-valid-target-node.js +0 -1
- package/dist/esm/plugins/selection/gap-cursor/utils/place-gap-cursor.js +0 -97
- package/dist/esm/plugins/selection/gap-cursor/utils.js +0 -128
- package/dist/esm/plugins/selection/gap-cursor-selection.js +0 -2
- package/dist/esm/plugins/selection/index.js +0 -58
- package/dist/esm/plugins/selection/plugin-factory.js +0 -43
- package/dist/esm/plugins/selection/pm-plugins/events/create-selection-between.js +0 -86
- package/dist/esm/plugins/selection/pm-plugins/events/keydown.js +0 -110
- package/dist/esm/plugins/selection/pm-plugins/gap-cursor-keymap.js +0 -40
- package/dist/esm/plugins/selection/pm-plugins/gap-cursor-main.js +0 -154
- package/dist/esm/plugins/selection/pm-plugins/gap-cursor-plugin-key.js +0 -2
- package/dist/esm/plugins/selection/pm-plugins/keymap.js +0 -10
- package/dist/esm/plugins/selection/pm-plugins/selection-main.js +0 -98
- package/dist/esm/plugins/selection/reducer.js +0 -19
- package/dist/esm/plugins/selection/types.js +0 -9
- package/dist/esm/plugins/selection/utils.js +0 -241
- package/dist/esm/selection-api/api.js +0 -21
- package/dist/types/plugins/selection/actions.d.ts +0 -17
- package/dist/types/plugins/selection/commands.d.ts +0 -10
- package/dist/types/plugins/selection/gap-cursor/actions.d.ts +0 -25
- package/dist/types/plugins/selection/gap-cursor/direction.d.ts +0 -10
- package/dist/types/plugins/selection/gap-cursor/selection.d.ts +0 -1
- package/dist/types/plugins/selection/gap-cursor/styles.d.ts +0 -2
- package/dist/types/plugins/selection/gap-cursor/utils/is-ignored.d.ts +0 -1
- package/dist/types/plugins/selection/gap-cursor/utils/is-valid-target-node.d.ts +0 -1
- package/dist/types/plugins/selection/gap-cursor/utils/place-gap-cursor.d.ts +0 -2
- package/dist/types/plugins/selection/gap-cursor/utils.d.ts +0 -8
- package/dist/types/plugins/selection/gap-cursor-selection.d.ts +0 -2
- package/dist/types/plugins/selection/index.d.ts +0 -13
- package/dist/types/plugins/selection/plugin-factory.d.ts +0 -2
- package/dist/types/plugins/selection/pm-plugins/events/create-selection-between.d.ts +0 -4
- package/dist/types/plugins/selection/pm-plugins/events/keydown.d.ts +0 -2
- package/dist/types/plugins/selection/pm-plugins/gap-cursor-keymap.d.ts +0 -2
- package/dist/types/plugins/selection/pm-plugins/gap-cursor-main.d.ts +0 -6
- package/dist/types/plugins/selection/pm-plugins/gap-cursor-plugin-key.d.ts +0 -2
- package/dist/types/plugins/selection/pm-plugins/keymap.d.ts +0 -3
- package/dist/types/plugins/selection/pm-plugins/selection-main.d.ts +0 -7
- package/dist/types/plugins/selection/reducer.d.ts +0 -3
- package/dist/types/plugins/selection/types.d.ts +0 -12
- package/dist/types/plugins/selection/utils.d.ts +0 -58
- package/dist/types/selection-api/api.d.ts +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 188.5.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#40750](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40750) [`fc19a7b9edd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fc19a7b9edd) - [ED-19875] Extraction of Editor Core's Selection Plugin into independent package '@atlaskit/editor-plugin-selection'.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 188.5.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
@@ -29,7 +29,7 @@ var _editorPluginPlaceholder = require("@atlaskit/editor-plugin-placeholder");
|
|
|
29
29
|
var _annotation = _interopRequireDefault(require("../../../plugins/annotation"));
|
|
30
30
|
var _editorPluginComposition = require("@atlaskit/editor-plugin-composition");
|
|
31
31
|
var _editorPluginQuickInsert = require("@atlaskit/editor-plugin-quick-insert");
|
|
32
|
-
var
|
|
32
|
+
var _editorPluginSelection = require("@atlaskit/editor-plugin-selection");
|
|
33
33
|
var _codeBlock = _interopRequireDefault(require("../../../plugins/code-block"));
|
|
34
34
|
var _undoRedo = _interopRequireDefault(require("../../../plugins/undo-redo"));
|
|
35
35
|
var _editorPluginDecorations = require("@atlaskit/editor-plugin-decorations");
|
|
@@ -77,7 +77,7 @@ function createDefaultPreset(options) {
|
|
|
77
77
|
return builder;
|
|
78
78
|
}).add([_editorPluginHyperlink.hyperlinkPlugin, options.hyperlinkOptions]).add([_editorPluginTextFormatting.textFormattingPlugin, options.textFormatting]).add(_editorPluginWidth.widthPlugin).add([_editorPluginQuickInsert.quickInsertPlugin, options.quickInsert]).add([_typeAhead.default, options.typeAhead || {
|
|
79
79
|
createAnalyticsEvent: options.createAnalyticsEvent
|
|
80
|
-
}]).add([_editorPluginPlaceholder.placeholderPlugin, options.placeholder]).add(_editorPluginUnsupportedContent.unsupportedContentPlugin).add(_editorPluginEditorDisabled.editorDisabledPlugin).add([_submitEditor.default, options.submitEditor]).add(_fakeTextCursor.default).add(_editorPluginCopyButton.copyButtonPlugin).add(_editorPluginFloatingToolbar.floatingToolbarPlugin).add([
|
|
80
|
+
}]).add([_editorPluginPlaceholder.placeholderPlugin, options.placeholder]).add(_editorPluginUnsupportedContent.unsupportedContentPlugin).add(_editorPluginEditorDisabled.editorDisabledPlugin).add([_submitEditor.default, options.submitEditor]).add(_fakeTextCursor.default).add(_editorPluginCopyButton.copyButtonPlugin).add(_editorPluginFloatingToolbar.floatingToolbarPlugin).add([_editorPluginSelection.selectionPlugin, options.selection]).add([_codeBlock.default, options.codeBlock || {
|
|
81
81
|
appearance: 'full-page'
|
|
82
82
|
}]);
|
|
83
83
|
return preset;
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = createUniversalPreset;
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
-
var _api = require("../../../selection-api/api");
|
|
11
10
|
var _plugins = require("../../../plugins");
|
|
12
11
|
var _date = require("../../../plugins/date");
|
|
13
12
|
var _editorPluginCaption = require("@atlaskit/editor-plugin-caption");
|
|
@@ -50,7 +49,6 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
50
49
|
var getEditorFeatureFlags = function getEditorFeatureFlags() {
|
|
51
50
|
return featureFlags;
|
|
52
51
|
};
|
|
53
|
-
var editorSelectionAPI = (0, _api.createEditorSelectionAPI)();
|
|
54
52
|
var defaultPreset = (0, _default.createDefaultPreset)(_objectSpread(_objectSpread({}, props), {}, {
|
|
55
53
|
createAnalyticsEvent: createAnalyticsEvent
|
|
56
54
|
}));
|
|
@@ -120,7 +118,6 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
120
118
|
allowDropzoneDropLine: isFullPage,
|
|
121
119
|
allowMediaSingleEditable: !isMobile,
|
|
122
120
|
allowRemoteDimensionsFetch: !isMobile,
|
|
123
|
-
editorSelectionAPI: editorSelectionAPI,
|
|
124
121
|
// This is a wild one. I didnt quite understand what the code was doing
|
|
125
122
|
// so a bit of guess for now.
|
|
126
123
|
allowMarkingUploadsAsIncomplete: isMobile,
|
|
@@ -168,7 +165,6 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
168
165
|
allowContextualMenu: !isMobile,
|
|
169
166
|
fullWidthEnabled: appearance === 'full-width',
|
|
170
167
|
wasFullWidthEnabled: prevAppearance && prevAppearance === 'full-width',
|
|
171
|
-
editorSelectionAPI: editorSelectionAPI,
|
|
172
168
|
getEditorFeatureFlags: getEditorFeatureFlags
|
|
173
169
|
}]);
|
|
174
170
|
}
|
|
@@ -209,8 +205,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
209
205
|
disableLayout: true
|
|
210
206
|
},
|
|
211
207
|
allowMediaGroup: false,
|
|
212
|
-
isCopyPasteEnabled: true
|
|
213
|
-
editorSelectionAPI: editorSelectionAPI
|
|
208
|
+
isCopyPasteEnabled: true
|
|
214
209
|
}]);
|
|
215
210
|
}
|
|
216
211
|
return builder;
|
|
@@ -24,8 +24,6 @@ var _commands = require("./commands");
|
|
|
24
24
|
var _messages = require("../insert-block/ui/ToolbarInsertBlock/messages");
|
|
25
25
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
26
26
|
var _pluginFactory = require("./pm-plugins/plugin-factory");
|
|
27
|
-
// TO-DO: replace with editor-plugin-selection
|
|
28
|
-
|
|
29
27
|
var expandPlugin = function expandPlugin(_ref) {
|
|
30
28
|
var _api$featureFlags;
|
|
31
29
|
var _ref$config = _ref.config,
|
|
@@ -69,8 +69,12 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
69
69
|
state = _this$view.state,
|
|
70
70
|
dispatch = _this$view.dispatch;
|
|
71
71
|
if (_this.selectNearNode) {
|
|
72
|
-
var _this
|
|
73
|
-
|
|
72
|
+
var tr = _this.selectNearNode({
|
|
73
|
+
selectionRelativeToNode: _selection.RelativeSelectionPos.Start
|
|
74
|
+
})(state);
|
|
75
|
+
if (dispatch) {
|
|
76
|
+
dispatch(tr);
|
|
77
|
+
}
|
|
74
78
|
}
|
|
75
79
|
var pos = _this.getPos();
|
|
76
80
|
if (typeof pos === 'number') {
|
|
@@ -280,11 +284,18 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
280
284
|
selectionStart = _this$input4.selectionStart,
|
|
281
285
|
selectionEnd = _this$input4.selectionEnd;
|
|
282
286
|
if (selectionStart === selectionEnd && selectionStart === value.length) {
|
|
283
|
-
var _this$api2;
|
|
284
287
|
event.preventDefault();
|
|
285
|
-
var
|
|
288
|
+
var _this$view8 = _this.view,
|
|
289
|
+
state = _this$view8.state,
|
|
290
|
+
dispatch = _this$view8.dispatch;
|
|
286
291
|
_this.view.focus();
|
|
287
|
-
|
|
292
|
+
var tr = _this.selectNearNode({
|
|
293
|
+
selectionRelativeToNode: _selection.RelativeSelectionPos.End,
|
|
294
|
+
selection: _state.NodeSelection.create(state.doc, pos)
|
|
295
|
+
})(state);
|
|
296
|
+
if (dispatch) {
|
|
297
|
+
dispatch(tr);
|
|
298
|
+
}
|
|
288
299
|
}
|
|
289
300
|
});
|
|
290
301
|
(0, _defineProperty2.default)(this, "handleArrowLeftFromTitle", function (event) {
|
|
@@ -299,19 +310,31 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
299
310
|
selectionStart = _this$input5.selectionStart,
|
|
300
311
|
selectionEnd = _this$input5.selectionEnd;
|
|
301
312
|
if (selectionStart === selectionEnd && selectionStart === 0) {
|
|
302
|
-
var _this$
|
|
313
|
+
var _this$api;
|
|
303
314
|
event.preventDefault();
|
|
304
|
-
var
|
|
315
|
+
var _this$view9 = _this.view,
|
|
316
|
+
state = _this$view9.state,
|
|
317
|
+
dispatch = _this$view9.dispatch;
|
|
305
318
|
_this.view.focus();
|
|
306
|
-
var selectionSharedState = ((_this$
|
|
319
|
+
var selectionSharedState = ((_this$api = _this.api) === null || _this$api === void 0 || (_this$api = _this$api.selection) === null || _this$api === void 0 ? void 0 : _this$api.sharedState.currentState()) || {};
|
|
307
320
|
// selectionRelativeToNode is undefined when user clicked to select node, then hit left to get focus in title
|
|
308
321
|
// This is a special case where we want to bypass node selection and jump straight to gap cursor
|
|
309
322
|
if ((selectionSharedState === null || selectionSharedState === void 0 ? void 0 : selectionSharedState.selectionRelativeToNode) === undefined) {
|
|
310
|
-
var _this
|
|
311
|
-
|
|
323
|
+
var tr = _this.selectNearNode({
|
|
324
|
+
selectionRelativeToNode: undefined,
|
|
325
|
+
selection: new _selection.GapCursorSelection(state.doc.resolve(pos), _selection.Side.LEFT)
|
|
326
|
+
})(state);
|
|
327
|
+
if (dispatch) {
|
|
328
|
+
dispatch(tr);
|
|
329
|
+
}
|
|
312
330
|
} else {
|
|
313
|
-
var _this
|
|
314
|
-
|
|
331
|
+
var _tr = _this.selectNearNode({
|
|
332
|
+
selectionRelativeToNode: _selection.RelativeSelectionPos.Start,
|
|
333
|
+
selection: _state.NodeSelection.create(state.doc, pos)
|
|
334
|
+
})(state);
|
|
335
|
+
if (dispatch) {
|
|
336
|
+
dispatch(_tr);
|
|
337
|
+
}
|
|
315
338
|
}
|
|
316
339
|
}
|
|
317
340
|
});
|
|
@@ -453,6 +476,7 @@ function _default(_ref2) {
|
|
|
453
476
|
featureFlags = _ref2.featureFlags,
|
|
454
477
|
api = _ref2.api;
|
|
455
478
|
return function (node, view, getPos) {
|
|
456
|
-
|
|
479
|
+
var _api$selection;
|
|
480
|
+
return new ExpandNodeView(node, view, getPos, getIntl, isMobile, featureFlags, api === null || api === void 0 || (_api$selection = api.selection) === null || _api$selection === void 0 || (_api$selection = _api$selection.actions) === null || _api$selection === void 0 ? void 0 : _api$selection.selectNearNode, api);
|
|
457
481
|
};
|
|
458
482
|
}
|
|
@@ -221,12 +221,6 @@ Object.defineProperty(exports, "scrollIntoViewPlugin", {
|
|
|
221
221
|
return _scrollIntoView.default;
|
|
222
222
|
}
|
|
223
223
|
});
|
|
224
|
-
Object.defineProperty(exports, "selectionPlugin", {
|
|
225
|
-
enumerable: true,
|
|
226
|
-
get: function get() {
|
|
227
|
-
return _selection.default;
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
224
|
Object.defineProperty(exports, "statusPlugin", {
|
|
231
225
|
enumerable: true,
|
|
232
226
|
get: function get() {
|
|
@@ -312,7 +306,6 @@ var _expand = _interopRequireWildcard(require("./expand"));
|
|
|
312
306
|
var _scrollIntoView = _interopRequireDefault(require("./scroll-into-view"));
|
|
313
307
|
var _mobileDimensions = _interopRequireDefault(require("./mobile-dimensions"));
|
|
314
308
|
var _findReplace = _interopRequireDefault(require("./find-replace"));
|
|
315
|
-
var _selection = _interopRequireDefault(require("./selection"));
|
|
316
309
|
var _mobileSelection = _interopRequireDefault(require("./mobile-selection"));
|
|
317
310
|
var _undoRedo = _interopRequireDefault(require("./undo-redo"));
|
|
318
311
|
var _avatarGroup = _interopRequireDefault(require("./avatar-group"));
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.clickAreaClickHandler = exports.checkForModal = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var _commands = require("
|
|
7
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
8
|
+
var _selection = require("@atlaskit/editor-common/selection");
|
|
9
|
+
var _commands = require("@atlaskit/editor-common/commands");
|
|
10
10
|
// we ignore all of the clicks made inside <div class="ak-editor-content-area" /> (but not clicks on the node itself)
|
|
11
11
|
var insideContentArea = function insideContentArea(ref) {
|
|
12
12
|
while (ref) {
|
|
@@ -60,17 +60,17 @@ var clickAreaClickHandler = exports.clickAreaClickHandler = function clickAreaCl
|
|
|
60
60
|
// which doesn't pass the check !contentArea.contains(event.target)
|
|
61
61
|
var isInputClicked = target.nodeName === 'INPUT';
|
|
62
62
|
// @see ED-5126
|
|
63
|
-
var isPopupClicked = !!(0,
|
|
63
|
+
var isPopupClicked = !!(0, _utils.closestElement)(target, '[data-editor-popup]');
|
|
64
64
|
// Fixes issue when using a textarea for editor title in full page editor doesn't let user focus it.
|
|
65
65
|
var isTextAreaClicked = target.nodeName === 'TEXTAREA';
|
|
66
|
-
var isBreadcrumbClicked = !!(0,
|
|
66
|
+
var isBreadcrumbClicked = !!(0, _utils.closestElement)(target, 'nav[aria-label="Breadcrumbs"]');
|
|
67
67
|
var selection = window.getSelection();
|
|
68
|
-
var isEditorPopupTextSelected = (selection === null || selection === void 0 ? void 0 : selection.type) === 'Range' && (0,
|
|
68
|
+
var isEditorPopupTextSelected = (selection === null || selection === void 0 ? void 0 : selection.type) === 'Range' && (0, _utils.closestElement)(selection === null || selection === void 0 ? void 0 : selection.anchorNode, '[data-editor-popup]');
|
|
69
69
|
|
|
70
70
|
// This is a super workaround to find when events are coming from Confluence InlineComment modal
|
|
71
71
|
// We don't own those components, so we can't change them
|
|
72
|
-
var isEventComingFromInlineCommentPopup = Boolean((0,
|
|
73
|
-
var isButtonClicked = Boolean((0,
|
|
72
|
+
var isEventComingFromInlineCommentPopup = Boolean((0, _utils.closestElement)(event.currentTarget, 'div[offset]')) || Boolean((0, _utils.closestElement)(target, 'div[offset]'));
|
|
73
|
+
var isButtonClicked = Boolean((0, _utils.closestElement)(event.currentTarget, 'button')) || Boolean((0, _utils.closestElement)(target, 'button')) || ((_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 ? void 0 : _event$currentTarget.nodeName) === 'BUTTON' || target.nodeName === 'BUTTON';
|
|
74
74
|
var isTargetInsideContentArea = Boolean(isTargetChildOfContentArea);
|
|
75
75
|
var isBetweenContentAreaAndEditableContent = isTargetInsideContentArea && !isTargetInsideEditableArea;
|
|
76
76
|
|
|
@@ -99,9 +99,7 @@ var outsideProsemirrorEditorClickHandler = function outsideProsemirrorEditorClic
|
|
|
99
99
|
if (isBottomAreaClicked) {
|
|
100
100
|
(0, _commands.addParagraphAtEnd)(tr);
|
|
101
101
|
}
|
|
102
|
-
|
|
103
|
-
(0, _gapCursorSelection.setSelectionTopLevelBlocks)(tr, event, dom, view.posAtCoords.bind(view), isEditorFocused);
|
|
104
|
-
}
|
|
102
|
+
(0, _selection.setSelectionTopLevelBlocks)(tr, event, dom, view.posAtCoords.bind(view), isEditorFocused);
|
|
105
103
|
if (!tr.docChanged && !tr.selectionSet) {
|
|
106
104
|
return;
|
|
107
105
|
}
|
|
@@ -13,25 +13,25 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
13
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
14
|
var _mention = require("@atlaskit/editor-common/mention");
|
|
15
15
|
var _styles2 = require("../../plugins/collab-edit/styles");
|
|
16
|
-
var _styles3 = require("../../plugins/selection/gap-cursor/styles");
|
|
17
16
|
var _commonStyles = require("@atlaskit/editor-plugin-table/ui/common-styles");
|
|
18
|
-
var
|
|
19
|
-
var
|
|
17
|
+
var _styles3 = require("@atlaskit/editor-plugin-block-type/styles");
|
|
18
|
+
var _styles4 = require("../../plugins/code-block/styles");
|
|
20
19
|
var _media = require("./media");
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var
|
|
20
|
+
var _styles5 = require("../../plugins/layout/styles");
|
|
21
|
+
var _styles6 = require("../../plugins/panel/styles");
|
|
22
|
+
var _styles7 = require("../../plugins/fake-text-cursor/styles");
|
|
23
|
+
var _styles8 = require("../../plugins/placeholder-text/styles");
|
|
24
|
+
var _styles9 = require("../../plugins/extension/ui/styles");
|
|
25
|
+
var _styles10 = require("../../plugins/expand/ui/styles");
|
|
26
|
+
var _styles11 = require("../../plugins/find-replace/styles");
|
|
27
|
+
var _styles12 = require("../../plugins/tasks-and-decisions/styles");
|
|
28
|
+
var _styles13 = require("../../plugins/status/styles");
|
|
30
29
|
var _date = require("./date");
|
|
31
30
|
var _getInlineNodeViewProducer = require("../../nodeviews/getInlineNodeViewProducer.styles");
|
|
32
31
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
33
32
|
var _emoji = require("@atlaskit/editor-common/emoji");
|
|
34
33
|
var _colors = require("@atlaskit/theme/colors");
|
|
34
|
+
var _selection = require("@atlaskit/editor-common/selection");
|
|
35
35
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
36
36
|
/** @jsx jsx */
|
|
37
37
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -47,7 +47,7 @@ var placeholderStyles = exports.placeholderStyles = (0, _react2.css)(_templateOb
|
|
|
47
47
|
var contentStyles = function contentStyles(props) {
|
|
48
48
|
return (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
|
|
49
49
|
theme: props.theme
|
|
50
|
-
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)",
|
|
50
|
+
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles8.placeholderTextStyles, placeholderStyles, (0, _styles4.codeBlockStyles)(props), (0, _styles3.blocktypeStyles)(props), (0, _styles.codeMarkSharedStyles)(props), _styles.textColorStyles, listsStyles, ruleStyles(props), _media.mediaStyles, (0, _styles5.layoutStyles)(props), _styles2.telepointerStyle, _selection.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _styles6.panelStyles)(props), _styles7.fakeCursorStyles, mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles9.extensionStyles, (0, _styles10.expandStyles)(props), _styles11.findReplaceStyles, _styles12.taskDecisionStyles, _styles13.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles.smartCardStyles, _styles.smartCardSharedStyles, _date.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
51
51
|
};
|
|
52
52
|
var createEditorContentStyle = exports.createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
53
53
|
return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
@@ -4,8 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.isValidPosition = exports.duplicateSelection = void 0;
|
|
7
|
-
exports
|
|
8
|
-
|
|
7
|
+
Object.defineProperty(exports, "setAllSelection", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _utils.setAllSelection;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "setCellSelection", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _utils.setCellSelection;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
9
19
|
Object.defineProperty(exports, "setNodeSelection", {
|
|
10
20
|
enumerable: true,
|
|
11
21
|
get: function get() {
|
|
@@ -22,18 +32,6 @@ var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
|
22
32
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
23
33
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
24
34
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
25
|
-
function setAllSelection(view) {
|
|
26
|
-
var state = view.state,
|
|
27
|
-
dispatch = view.dispatch;
|
|
28
|
-
var tr = state.tr.setSelection(new _state.AllSelection(view.state.doc));
|
|
29
|
-
dispatch(tr);
|
|
30
|
-
}
|
|
31
|
-
function setCellSelection(view, anchor, head) {
|
|
32
|
-
var state = view.state,
|
|
33
|
-
dispatch = view.dispatch;
|
|
34
|
-
dispatch(state.tr.setSelection(_cellSelection.CellSelection.create(state.doc, anchor, head)));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
35
|
// checks if the given position is within the ProseMirror document
|
|
38
36
|
var isValidPosition = exports.isValidPosition = function isValidPosition(pos, state) {
|
|
39
37
|
if (pos >= 0 && pos <= state.doc.resolve(0).end()) {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = exports.name = "@atlaskit/editor-core";
|
|
8
|
-
var version = exports.version = "188.5.
|
|
8
|
+
var version = exports.version = "188.5.2";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|
|
@@ -23,7 +23,7 @@ import { placeholderPlugin } from '@atlaskit/editor-plugin-placeholder';
|
|
|
23
23
|
import annotationPlugin from '../../../plugins/annotation';
|
|
24
24
|
import { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
25
25
|
import { quickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
|
|
26
|
-
import selectionPlugin from '
|
|
26
|
+
import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
27
27
|
import codeBlockPlugin from '../../../plugins/code-block';
|
|
28
28
|
import undoRedoPlugin from '../../../plugins/undo-redo';
|
|
29
29
|
import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createEditorSelectionAPI } from '../../../selection-api/api';
|
|
2
1
|
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, fragmentMarkPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, saveOnEnterPlugin, tasksAndDecisionsPlugin, textColorPlugin, statusPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin } from '../../../plugins';
|
|
3
2
|
import { datePlugin } from '../../../plugins/date';
|
|
4
3
|
import { captionPlugin } from '@atlaskit/editor-plugin-caption';
|
|
@@ -37,7 +36,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
37
36
|
const isChromeless = appearance === 'chromeless';
|
|
38
37
|
const isFullPage = fullPageCheck(appearance);
|
|
39
38
|
const getEditorFeatureFlags = () => featureFlags;
|
|
40
|
-
const editorSelectionAPI = createEditorSelectionAPI();
|
|
41
39
|
const defaultPreset = createDefaultPreset({
|
|
42
40
|
...props,
|
|
43
41
|
createAnalyticsEvent
|
|
@@ -109,7 +107,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
109
107
|
allowDropzoneDropLine: isFullPage,
|
|
110
108
|
allowMediaSingleEditable: !isMobile,
|
|
111
109
|
allowRemoteDimensionsFetch: !isMobile,
|
|
112
|
-
editorSelectionAPI,
|
|
113
110
|
// This is a wild one. I didnt quite understand what the code was doing
|
|
114
111
|
// so a bit of guess for now.
|
|
115
112
|
allowMarkingUploadsAsIncomplete: isMobile,
|
|
@@ -157,7 +154,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
157
154
|
allowContextualMenu: !isMobile,
|
|
158
155
|
fullWidthEnabled: appearance === 'full-width',
|
|
159
156
|
wasFullWidthEnabled: prevAppearance && prevAppearance === 'full-width',
|
|
160
|
-
editorSelectionAPI,
|
|
161
157
|
getEditorFeatureFlags
|
|
162
158
|
}]);
|
|
163
159
|
}
|
|
@@ -198,8 +194,7 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
198
194
|
disableLayout: true
|
|
199
195
|
},
|
|
200
196
|
allowMediaGroup: false,
|
|
201
|
-
isCopyPasteEnabled: true
|
|
202
|
-
editorSelectionAPI
|
|
197
|
+
isCopyPasteEnabled: true
|
|
203
198
|
}]);
|
|
204
199
|
}
|
|
205
200
|
return builder;
|
|
@@ -8,8 +8,6 @@ import { getToolbarConfig } from './toolbar';
|
|
|
8
8
|
import { createExpandNode } from './commands';
|
|
9
9
|
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
10
10
|
import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
|
|
11
|
-
// TO-DO: replace with editor-plugin-selection
|
|
12
|
-
|
|
13
11
|
const expandPlugin = ({
|
|
14
12
|
config: options = {},
|
|
15
13
|
api
|
|
@@ -56,8 +56,12 @@ export class ExpandNodeView {
|
|
|
56
56
|
dispatch
|
|
57
57
|
} = this.view;
|
|
58
58
|
if (this.selectNearNode) {
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
const tr = this.selectNearNode({
|
|
60
|
+
selectionRelativeToNode: RelativeSelectionPos.Start
|
|
61
|
+
})(state);
|
|
62
|
+
if (dispatch) {
|
|
63
|
+
dispatch(tr);
|
|
64
|
+
}
|
|
61
65
|
}
|
|
62
66
|
const pos = this.getPos();
|
|
63
67
|
if (typeof pos === 'number') {
|
|
@@ -279,13 +283,19 @@ export class ExpandNodeView {
|
|
|
279
283
|
selectionEnd
|
|
280
284
|
} = this.input;
|
|
281
285
|
if (selectionStart === selectionEnd && selectionStart === value.length) {
|
|
282
|
-
var _this$api2;
|
|
283
286
|
event.preventDefault();
|
|
284
287
|
const {
|
|
285
|
-
state
|
|
288
|
+
state,
|
|
289
|
+
dispatch
|
|
286
290
|
} = this.view;
|
|
287
291
|
this.view.focus();
|
|
288
|
-
|
|
292
|
+
const tr = this.selectNearNode({
|
|
293
|
+
selectionRelativeToNode: RelativeSelectionPos.End,
|
|
294
|
+
selection: NodeSelection.create(state.doc, pos)
|
|
295
|
+
})(state);
|
|
296
|
+
if (dispatch) {
|
|
297
|
+
dispatch(tr);
|
|
298
|
+
}
|
|
289
299
|
}
|
|
290
300
|
});
|
|
291
301
|
_defineProperty(this, "handleArrowLeftFromTitle", event => {
|
|
@@ -301,21 +311,32 @@ export class ExpandNodeView {
|
|
|
301
311
|
selectionEnd
|
|
302
312
|
} = this.input;
|
|
303
313
|
if (selectionStart === selectionEnd && selectionStart === 0) {
|
|
304
|
-
var _this$
|
|
314
|
+
var _this$api, _this$api$selection;
|
|
305
315
|
event.preventDefault();
|
|
306
316
|
const {
|
|
307
|
-
state
|
|
317
|
+
state,
|
|
318
|
+
dispatch
|
|
308
319
|
} = this.view;
|
|
309
320
|
this.view.focus();
|
|
310
|
-
const selectionSharedState = ((_this$
|
|
321
|
+
const selectionSharedState = ((_this$api = this.api) === null || _this$api === void 0 ? void 0 : (_this$api$selection = _this$api.selection) === null || _this$api$selection === void 0 ? void 0 : _this$api$selection.sharedState.currentState()) || {};
|
|
311
322
|
// selectionRelativeToNode is undefined when user clicked to select node, then hit left to get focus in title
|
|
312
323
|
// This is a special case where we want to bypass node selection and jump straight to gap cursor
|
|
313
324
|
if ((selectionSharedState === null || selectionSharedState === void 0 ? void 0 : selectionSharedState.selectionRelativeToNode) === undefined) {
|
|
314
|
-
|
|
315
|
-
|
|
325
|
+
const tr = this.selectNearNode({
|
|
326
|
+
selectionRelativeToNode: undefined,
|
|
327
|
+
selection: new GapCursorSelection(state.doc.resolve(pos), Side.LEFT)
|
|
328
|
+
})(state);
|
|
329
|
+
if (dispatch) {
|
|
330
|
+
dispatch(tr);
|
|
331
|
+
}
|
|
316
332
|
} else {
|
|
317
|
-
|
|
318
|
-
|
|
333
|
+
const tr = this.selectNearNode({
|
|
334
|
+
selectionRelativeToNode: RelativeSelectionPos.Start,
|
|
335
|
+
selection: NodeSelection.create(state.doc, pos)
|
|
336
|
+
})(state);
|
|
337
|
+
if (dispatch) {
|
|
338
|
+
dispatch(tr);
|
|
339
|
+
}
|
|
319
340
|
}
|
|
320
341
|
}
|
|
321
342
|
});
|
|
@@ -444,5 +465,8 @@ export default function ({
|
|
|
444
465
|
featureFlags,
|
|
445
466
|
api
|
|
446
467
|
}) {
|
|
447
|
-
return (node, view, getPos) =>
|
|
468
|
+
return (node, view, getPos) => {
|
|
469
|
+
var _api$selection, _api$selection$action;
|
|
470
|
+
return new ExpandNodeView(node, view, getPos, getIntl, isMobile, featureFlags, api === null || api === void 0 ? void 0 : (_api$selection = api.selection) === null || _api$selection === void 0 ? void 0 : (_api$selection$action = _api$selection.actions) === null || _api$selection$action === void 0 ? void 0 : _api$selection$action.selectNearNode, api);
|
|
471
|
+
};
|
|
448
472
|
}
|
|
@@ -35,7 +35,6 @@ export { default as expandPlugin, isExpandInsertionEnabled } from './expand';
|
|
|
35
35
|
export { default as scrollIntoViewPlugin } from './scroll-into-view';
|
|
36
36
|
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|
|
37
37
|
export { default as findReplacePlugin } from './find-replace';
|
|
38
|
-
export { default as selectionPlugin } from './selection';
|
|
39
38
|
export { default as mobileSelectionPlugin } from './mobile-selection';
|
|
40
39
|
export { default as undoRedoPlugin } from './undo-redo';
|
|
41
40
|
export { default as avatarGroupPlugin } from './avatar-group';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { closestElement } from '
|
|
2
|
-
import { setSelectionTopLevelBlocks
|
|
3
|
-
import { addParagraphAtEnd } from '
|
|
1
|
+
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { setSelectionTopLevelBlocks } from '@atlaskit/editor-common/selection';
|
|
3
|
+
import { addParagraphAtEnd } from '@atlaskit/editor-common/commands';
|
|
4
4
|
|
|
5
5
|
// we ignore all of the clicks made inside <div class="ak-editor-content-area" /> (but not clicks on the node itself)
|
|
6
6
|
const insideContentArea = ref => {
|
|
@@ -98,9 +98,7 @@ const outsideProsemirrorEditorClickHandler = (view, event) => {
|
|
|
98
98
|
if (isBottomAreaClicked) {
|
|
99
99
|
addParagraphAtEnd(tr);
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
setSelectionTopLevelBlocks(tr, event, dom, view.posAtCoords.bind(view), isEditorFocused);
|
|
103
|
-
}
|
|
101
|
+
setSelectionTopLevelBlocks(tr, event, dom, view.posAtCoords.bind(view), isEditorFocused);
|
|
104
102
|
if (!tr.docChanged && !tr.selectionSet) {
|
|
105
103
|
return;
|
|
106
104
|
}
|
|
@@ -5,7 +5,6 @@ import { whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, inden
|
|
|
5
5
|
import { akEditorSelectedBorderSize, akEditorDeleteBorder, akEditorDeleteBackgroundWithOpacity, akEditorSelectedNodeClassName, blockNodesVerticalMargin, editorFontSize, getSelectionStyles, SelectionStyle, akEditorLineHeight, akEditorSelectedBorderColor } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { MentionSharedCssClassName } from '@atlaskit/editor-common/mention';
|
|
7
7
|
import { telepointerStyle } from '../../plugins/collab-edit/styles';
|
|
8
|
-
import { gapCursorStyles } from '../../plugins/selection/gap-cursor/styles';
|
|
9
8
|
import { tableStyles } from '@atlaskit/editor-plugin-table/ui/common-styles';
|
|
10
9
|
import { blocktypeStyles } from '@atlaskit/editor-plugin-block-type/styles';
|
|
11
10
|
import { codeBlockStyles } from '../../plugins/code-block/styles';
|
|
@@ -26,6 +25,7 @@ import { linkSharedStyle, codeMarkSharedStyles, ruleSharedStyles } from '@atlask
|
|
|
26
25
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
27
26
|
import { EmojiSharedCssClassName } from '@atlaskit/editor-common/emoji';
|
|
28
27
|
import { N500, N30A, N200 } from '@atlaskit/theme/colors';
|
|
28
|
+
import { gapCursorStyles } from '@atlaskit/editor-common/selection';
|
|
29
29
|
export const linkStyles = css`
|
|
30
30
|
.ProseMirror {
|
|
31
31
|
${linkSharedStyle}
|
|
@@ -1,22 +1,7 @@
|
|
|
1
1
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
2
|
-
import { NodeSelection, TextSelection
|
|
2
|
+
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
4
|
-
export { setNodeSelection, setTextSelection } from '@atlaskit/editor-common/utils';
|
|
5
|
-
export function setAllSelection(view) {
|
|
6
|
-
const {
|
|
7
|
-
state,
|
|
8
|
-
dispatch
|
|
9
|
-
} = view;
|
|
10
|
-
const tr = state.tr.setSelection(new AllSelection(view.state.doc));
|
|
11
|
-
dispatch(tr);
|
|
12
|
-
}
|
|
13
|
-
export function setCellSelection(view, anchor, head) {
|
|
14
|
-
const {
|
|
15
|
-
state,
|
|
16
|
-
dispatch
|
|
17
|
-
} = view;
|
|
18
|
-
dispatch(state.tr.setSelection(CellSelection.create(state.doc, anchor, head)));
|
|
19
|
-
}
|
|
4
|
+
export { setNodeSelection, setTextSelection, setAllSelection, setCellSelection } from '@atlaskit/editor-common/utils';
|
|
20
5
|
|
|
21
6
|
// checks if the given position is within the ProseMirror document
|
|
22
7
|
export const isValidPosition = (pos, state) => {
|
|
@@ -23,7 +23,7 @@ import { placeholderPlugin } from '@atlaskit/editor-plugin-placeholder';
|
|
|
23
23
|
import annotationPlugin from '../../../plugins/annotation';
|
|
24
24
|
import { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
25
25
|
import { quickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
|
|
26
|
-
import selectionPlugin from '
|
|
26
|
+
import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
27
27
|
import codeBlockPlugin from '../../../plugins/code-block';
|
|
28
28
|
import undoRedoPlugin from '../../../plugins/undo-redo';
|
|
29
29
|
import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|