@atlaskit/editor-core 188.5.0 → 188.6.0
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 +13 -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/plugins/insert-block/ui/ToolbarInsertBlock/index.js +30 -29
- package/dist/cjs/plugins/status/actions.js +14 -11
- package/dist/cjs/plugins/status/index.js +17 -8
- package/dist/cjs/plugins/status/keymap.js +1 -1
- package/dist/cjs/plugins/status/ui/statusPicker.js +2 -2
- 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/plugins/insert-block/ui/ToolbarInsertBlock/index.js +3 -3
- package/dist/es2019/plugins/status/actions.js +3 -2
- package/dist/es2019/plugins/status/index.js +91 -80
- package/dist/es2019/plugins/status/keymap.js +1 -1
- package/dist/es2019/plugins/status/ui/statusPicker.js +1 -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/plugins/insert-block/ui/ToolbarInsertBlock/index.js +30 -29
- package/dist/esm/plugins/status/actions.js +14 -11
- package/dist/esm/plugins/status/index.js +17 -8
- package/dist/esm/plugins/status/keymap.js +1 -1
- package/dist/esm/plugins/status/ui/statusPicker.js +1 -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/plugins/insert-block/types.d.ts +3 -1
- package/dist/types/plugins/status/actions.d.ts +4 -2
- package/dist/types/plugins/status/index.d.ts +12 -3
- package/dist/types/plugins/status/nodeviews/status.d.ts +1 -1
- package/dist/types/plugins/status/plugin.d.ts +1 -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,18 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 188.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#41341](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41341) [`bd128fb1cfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bd128fb1cfb) - Decouple status plugin from editor-core. Add new actions for updating status.
|
|
8
|
+
|
|
9
|
+
## 188.5.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#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'.
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 188.5.0
|
|
4
17
|
|
|
5
18
|
### 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"));
|
|
@@ -26,7 +26,6 @@ var _actions = require("../../../placeholder-text/actions");
|
|
|
26
26
|
var _actions2 = require("../../../layout/actions");
|
|
27
27
|
var _commands = require("../../../tasks-and-decisions/commands");
|
|
28
28
|
var _commands2 = require("../../../expand/commands");
|
|
29
|
-
var _actions3 = require("../../../status/actions");
|
|
30
29
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
31
30
|
var _messages = require("./messages");
|
|
32
31
|
var _createItems3 = require("./create-items");
|
|
@@ -220,14 +219,16 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
220
219
|
return true;
|
|
221
220
|
});
|
|
222
221
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createStatus", function (inputMethod) {
|
|
223
|
-
var
|
|
224
|
-
|
|
225
|
-
|
|
222
|
+
var _pluginInjectionApi$s, _pluginInjectionApi$s2;
|
|
223
|
+
var _this$props4 = _this.props,
|
|
224
|
+
pluginInjectionApi = _this$props4.pluginInjectionApi,
|
|
225
|
+
editorView = _this$props4.editorView;
|
|
226
|
+
return (_pluginInjectionApi$s = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$s2 = pluginInjectionApi.status) === null || _pluginInjectionApi$s2 === void 0 || (_pluginInjectionApi$s2 = _pluginInjectionApi$s2.actions) === null || _pluginInjectionApi$s2 === void 0 ? void 0 : _pluginInjectionApi$s2.updateStatus(inputMethod)(editorView.state, editorView.dispatch)) !== null && _pluginInjectionApi$s !== void 0 ? _pluginInjectionApi$s : false;
|
|
226
227
|
});
|
|
227
228
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "openMediaPicker", function (inputMethod) {
|
|
228
|
-
var _this$
|
|
229
|
-
onShowMediaPicker = _this$
|
|
230
|
-
dispatchAnalyticsEvent = _this$
|
|
229
|
+
var _this$props5 = _this.props,
|
|
230
|
+
onShowMediaPicker = _this$props5.onShowMediaPicker,
|
|
231
|
+
dispatchAnalyticsEvent = _this$props5.dispatchAnalyticsEvent;
|
|
231
232
|
if (onShowMediaPicker) {
|
|
232
233
|
onShowMediaPicker();
|
|
233
234
|
if (dispatchAnalyticsEvent) {
|
|
@@ -255,11 +256,11 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
255
256
|
});
|
|
256
257
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertHorizontalRule", function (inputMethod) {
|
|
257
258
|
var _pluginInjectionApi$r, _pluginInjectionApi$r2;
|
|
258
|
-
var _this$
|
|
259
|
-
_this$
|
|
260
|
-
state = _this$
|
|
261
|
-
dispatch = _this$
|
|
262
|
-
pluginInjectionApi = _this$
|
|
259
|
+
var _this$props6 = _this.props,
|
|
260
|
+
_this$props6$editorVi = _this$props6.editorView,
|
|
261
|
+
state = _this$props6$editorVi.state,
|
|
262
|
+
dispatch = _this$props6$editorVi.dispatch,
|
|
263
|
+
pluginInjectionApi = _this$props6.pluginInjectionApi;
|
|
263
264
|
return (_pluginInjectionApi$r = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$r2 = pluginInjectionApi.rule) === null || _pluginInjectionApi$r2 === void 0 ? void 0 : _pluginInjectionApi$r2.actions.insertHorizontalRule(inputMethod)(state, dispatch)) !== null && _pluginInjectionApi$r !== void 0 ? _pluginInjectionApi$r : false;
|
|
264
265
|
});
|
|
265
266
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertExpand", function () {
|
|
@@ -270,9 +271,9 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
270
271
|
});
|
|
271
272
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertBlockType", function (itemName) {
|
|
272
273
|
return function () {
|
|
273
|
-
var _this$
|
|
274
|
-
editorView = _this$
|
|
275
|
-
onInsertBlockType = _this$
|
|
274
|
+
var _this$props7 = _this.props,
|
|
275
|
+
editorView = _this$props7.editorView,
|
|
276
|
+
onInsertBlockType = _this$props7.onInsertBlockType;
|
|
276
277
|
var state = editorView.state,
|
|
277
278
|
dispatch = editorView.dispatch;
|
|
278
279
|
onInsertBlockType(itemName)(state, dispatch);
|
|
@@ -295,11 +296,11 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
295
296
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onItemActivated", function (_ref2) {
|
|
296
297
|
var item = _ref2.item,
|
|
297
298
|
inputMethod = _ref2.inputMethod;
|
|
298
|
-
var _this$
|
|
299
|
-
editorView = _this$
|
|
300
|
-
editorActions = _this$
|
|
301
|
-
handleImageUpload = _this$
|
|
302
|
-
expandEnabled = _this$
|
|
299
|
+
var _this$props8 = _this.props,
|
|
300
|
+
editorView = _this$props8.editorView,
|
|
301
|
+
editorActions = _this$props8.editorActions,
|
|
302
|
+
handleImageUpload = _this$props8.handleImageUpload,
|
|
303
|
+
expandEnabled = _this$props8.expandEnabled;
|
|
303
304
|
|
|
304
305
|
// need to do this before inserting nodes so scrollIntoView works properly
|
|
305
306
|
if (!editorView.hasFocus()) {
|
|
@@ -415,12 +416,12 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
415
416
|
key: "renderPopup",
|
|
416
417
|
value: function renderPopup() {
|
|
417
418
|
var emojiPickerOpen = this.state.emojiPickerOpen;
|
|
418
|
-
var _this$
|
|
419
|
-
popupsMountPoint = _this$
|
|
420
|
-
popupsBoundariesElement = _this$
|
|
421
|
-
popupsScrollableElement = _this$
|
|
422
|
-
emojiProvider = _this$
|
|
423
|
-
replacePlusMenuWithElementBrowser = _this$
|
|
419
|
+
var _this$props9 = this.props,
|
|
420
|
+
popupsMountPoint = _this$props9.popupsMountPoint,
|
|
421
|
+
popupsBoundariesElement = _this$props9.popupsBoundariesElement,
|
|
422
|
+
popupsScrollableElement = _this$props9.popupsScrollableElement,
|
|
423
|
+
emojiProvider = _this$props9.emojiProvider,
|
|
424
|
+
replacePlusMenuWithElementBrowser = _this$props9.replacePlusMenuWithElementBrowser;
|
|
424
425
|
var dropdownEmoji = this.state.dropdownItems.some(function (_ref4) {
|
|
425
426
|
var name = _ref4.value.name;
|
|
426
427
|
return name === 'emoji';
|
|
@@ -457,9 +458,9 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
457
458
|
buttons = _this$state.buttons,
|
|
458
459
|
dropdownItems = _this$state.dropdownItems,
|
|
459
460
|
emojiPickerOpen = _this$state.emojiPickerOpen;
|
|
460
|
-
var _this$
|
|
461
|
-
isDisabled = _this$
|
|
462
|
-
isReducedSpacing = _this$
|
|
461
|
+
var _this$props10 = this.props,
|
|
462
|
+
isDisabled = _this$props10.isDisabled,
|
|
463
|
+
isReducedSpacing = _this$props10.isReducedSpacing;
|
|
463
464
|
if (buttons.length === 0 && dropdownItems.length === 0) {
|
|
464
465
|
return null;
|
|
465
466
|
}
|
|
@@ -9,7 +9,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
10
10
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
11
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
12
|
-
var _analytics = require("
|
|
12
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
|
+
var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
|
|
13
14
|
var _pluginKey = require("./plugin-key");
|
|
14
15
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
15
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -78,16 +79,18 @@ var updateStatus = exports.updateStatus = function updateStatus(status) {
|
|
|
78
79
|
return false;
|
|
79
80
|
};
|
|
80
81
|
};
|
|
81
|
-
var updateStatusWithAnalytics = exports.updateStatusWithAnalytics = function updateStatusWithAnalytics(
|
|
82
|
-
return (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
82
|
+
var updateStatusWithAnalytics = exports.updateStatusWithAnalytics = function updateStatusWithAnalytics(editorAnalyticsAPI) {
|
|
83
|
+
return function (inputMethod, status) {
|
|
84
|
+
return (0, _editorAnalytics.withAnalytics)(editorAnalyticsAPI, {
|
|
85
|
+
action: _analytics.ACTION.INSERTED,
|
|
86
|
+
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
87
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.STATUS,
|
|
88
|
+
attributes: {
|
|
89
|
+
inputMethod: inputMethod
|
|
90
|
+
},
|
|
91
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
92
|
+
})(updateStatus(status));
|
|
93
|
+
};
|
|
91
94
|
};
|
|
92
95
|
var setStatusPickerAt = exports.setStatusPickerAt = function setStatusPickerAt(showStatusPickerAt) {
|
|
93
96
|
return function (state, dispatch) {
|
|
@@ -8,8 +8,8 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
10
10
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
11
|
-
var
|
|
12
|
-
var _analytics = require("
|
|
11
|
+
var _withPluginState = require("@atlaskit/editor-common/with-plugin-state");
|
|
12
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
13
|
var _messages = require("../insert-block/ui/ToolbarInsertBlock/messages");
|
|
14
14
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
15
15
|
var _actions = require("./actions");
|
|
@@ -18,7 +18,9 @@ var _plugin = _interopRequireDefault(require("./plugin"));
|
|
|
18
18
|
var _pluginKey = require("./plugin-key");
|
|
19
19
|
var _statusPicker = _interopRequireDefault(require("./ui/statusPicker"));
|
|
20
20
|
var baseStatusPlugin = function baseStatusPlugin(_ref) {
|
|
21
|
-
var
|
|
21
|
+
var _api$analytics;
|
|
22
|
+
var options = _ref.config,
|
|
23
|
+
api = _ref.api;
|
|
22
24
|
return {
|
|
23
25
|
name: 'status',
|
|
24
26
|
nodes: function nodes() {
|
|
@@ -38,13 +40,17 @@ var baseStatusPlugin = function baseStatusPlugin(_ref) {
|
|
|
38
40
|
plugin: _keymap.keymapPlugin
|
|
39
41
|
}];
|
|
40
42
|
},
|
|
43
|
+
actions: {
|
|
44
|
+
commitStatusPicker: _actions.commitStatusPicker,
|
|
45
|
+
updateStatus: (0, _actions.updateStatusWithAnalytics)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)
|
|
46
|
+
},
|
|
41
47
|
contentComponent: function contentComponent(_ref2) {
|
|
42
48
|
var editorView = _ref2.editorView,
|
|
43
49
|
popupsMountPoint = _ref2.popupsMountPoint,
|
|
44
50
|
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
45
51
|
popupsScrollableElement = _ref2.popupsScrollableElement;
|
|
46
52
|
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
47
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_withPluginState.WithPluginState, {
|
|
48
54
|
plugins: {
|
|
49
55
|
statusState: _pluginKey.pluginKey
|
|
50
56
|
},
|
|
@@ -91,7 +97,7 @@ var baseStatusPlugin = function baseStatusPlugin(_ref) {
|
|
|
91
97
|
}
|
|
92
98
|
};
|
|
93
99
|
};
|
|
94
|
-
var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, options) {
|
|
100
|
+
var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, options, api) {
|
|
95
101
|
if ((options === null || options === void 0 ? void 0 : options.menuDisabled) === true) {
|
|
96
102
|
return plugin;
|
|
97
103
|
}
|
|
@@ -108,7 +114,9 @@ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, optio
|
|
|
108
114
|
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconStatus, null);
|
|
109
115
|
},
|
|
110
116
|
action: function action(insert, state) {
|
|
111
|
-
|
|
117
|
+
var _api$analytics2;
|
|
118
|
+
var tr = (0, _actions.createStatus)()(insert, state);
|
|
119
|
+
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
|
|
112
120
|
action: _analytics.ACTION.INSERTED,
|
|
113
121
|
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
114
122
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.STATUS,
|
|
@@ -116,7 +124,8 @@ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, optio
|
|
|
116
124
|
inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
|
|
117
125
|
},
|
|
118
126
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
119
|
-
});
|
|
127
|
+
})(tr);
|
|
128
|
+
return tr;
|
|
120
129
|
}
|
|
121
130
|
}];
|
|
122
131
|
}
|
|
@@ -129,6 +138,6 @@ var statusPlugin = function statusPlugin(_ref5) {
|
|
|
129
138
|
return decorateWithPluginOptions(baseStatusPlugin({
|
|
130
139
|
config: options,
|
|
131
140
|
api: api
|
|
132
|
-
}), options);
|
|
141
|
+
}), options, api);
|
|
133
142
|
};
|
|
134
143
|
var _default = exports.default = statusPlugin;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
exports.keymapPlugin = keymapPlugin;
|
|
8
8
|
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
9
|
-
var _keymaps = require("
|
|
9
|
+
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
10
10
|
var _utils = require("./utils");
|
|
11
11
|
function keymapPlugin() {
|
|
12
12
|
var list = {};
|
|
@@ -21,14 +21,14 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
21
21
|
var _picker = require("@atlaskit/status/picker");
|
|
22
22
|
var _constants = require("@atlaskit/theme/constants");
|
|
23
23
|
var _colors = require("@atlaskit/theme/colors");
|
|
24
|
-
var
|
|
24
|
+
var _uiReact = require("@atlaskit/editor-common/ui-react");
|
|
25
25
|
var _actions = require("../actions");
|
|
26
26
|
var _analytics = require("../analytics");
|
|
27
27
|
var _templateObject;
|
|
28
28
|
/** @jsx jsx */
|
|
29
29
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
30
30
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
31
|
-
var PopupWithListeners = (0,
|
|
31
|
+
var PopupWithListeners = (0, _uiReact.withReactEditorViewOuterListeners)(_ui.Popup);
|
|
32
32
|
var InputMethod = exports.InputMethod = /*#__PURE__*/function (InputMethod) {
|
|
33
33
|
InputMethod["blur"] = "blur";
|
|
34
34
|
InputMethod["escKey"] = "escKey";
|
|
@@ -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.
|
|
8
|
+
var version = exports.version = "188.6.0";
|
|
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';
|