@atlaskit/editor-core 195.4.4 → 195.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 195.4.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 195.4.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [#129496](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/129496)
14
+ [`5776cd6d4856e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5776cd6d4856e) -
15
+ remove no editor selection in view mode ff
16
+
3
17
  ## 195.4.4
4
18
 
5
19
  ### Patch Changes
@@ -26,7 +26,6 @@ var _ui = require("@atlaskit/editor-common/ui");
26
26
  var _utils = require("@atlaskit/editor-common/utils");
27
27
  var _state2 = require("@atlaskit/editor-prosemirror/state");
28
28
  var _view = require("@atlaskit/editor-prosemirror/view");
29
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
30
29
  var _eventDispatcher = require("../event-dispatcher");
31
30
  var _document = require("../utils/document");
32
31
  var _isFullPage = require("../utils/is-full-page");
@@ -220,41 +219,27 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
220
219
  var api = _this.pluginInjectionAPI.api();
221
220
  var isViewMode = (api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.sharedState.currentState().mode) === 'view';
222
221
  var selection;
223
- if ((0, _platformFeatureFlags.fg)('platform.editor.live-view.no-editor-selection-in-view-mode')) {
224
- if (doc) {
225
- if (isViewMode) {
226
- var emptySelection = new _state2.TextSelection(doc.resolve(0));
227
- return _state2.EditorState.create({
228
- schema: schema,
229
- plugins: plugins,
230
- doc: doc,
231
- selection: emptySelection
232
- });
233
- } else {
234
- selection = options.selectionAtStart ? _state2.Selection.atStart(doc) : _state2.Selection.atEnd(doc);
235
- }
236
- }
237
- // Workaround for ED-3507: When media node is the last element, scrollIntoView throws an error
238
- var patchedSelection = selection ? _state2.Selection.findFrom(selection.$head, -1, true) || undefined : undefined;
239
- return _state2.EditorState.create({
240
- schema: schema,
241
- plugins: plugins,
242
- doc: doc,
243
- selection: patchedSelection
244
- });
245
- } else {
246
- if (doc) {
222
+ if (doc) {
223
+ if (isViewMode) {
224
+ var emptySelection = new _state2.TextSelection(doc.resolve(0));
225
+ return _state2.EditorState.create({
226
+ schema: schema,
227
+ plugins: plugins,
228
+ doc: doc,
229
+ selection: emptySelection
230
+ });
231
+ } else {
247
232
  selection = options.selectionAtStart ? _state2.Selection.atStart(doc) : _state2.Selection.atEnd(doc);
248
233
  }
249
- // Workaround for ED-3507: When media node is the last element, scrollIntoView throws an error
250
- var _patchedSelection = selection ? _state2.Selection.findFrom(selection.$head, -1, true) || undefined : undefined;
251
- return _state2.EditorState.create({
252
- schema: schema,
253
- plugins: plugins,
254
- doc: doc,
255
- selection: _patchedSelection
256
- });
257
234
  }
235
+ // Workaround for ED-3507: When media node is the last element, scrollIntoView throws an error
236
+ var patchedSelection = selection ? _state2.Selection.findFrom(selection.$head, -1, true) || undefined : undefined;
237
+ return _state2.EditorState.create({
238
+ schema: schema,
239
+ plugins: plugins,
240
+ doc: doc,
241
+ selection: patchedSelection
242
+ });
258
243
  });
259
244
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onEditorViewStateUpdated", function (_ref2) {
260
245
  var originalTransaction = _ref2.originalTransaction,
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "195.4.4";
8
+ var version = exports.version = "195.4.6";
@@ -12,7 +12,6 @@ import { EDIT_AREA_ID } from '@atlaskit/editor-common/ui';
12
12
  import { analyticsEventKey, browser, countNodes, findChangedNodesFromTransaction, getAnalyticsEventSeverity, getResponseEndTime, measureRender, processRawValue, shouldForceTracking, validateNodes, validNode } from '@atlaskit/editor-common/utils';
13
13
  import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
14
14
  import { EditorView } from '@atlaskit/editor-prosemirror/view';
15
- import { fg } from '@atlaskit/platform-feature-flags';
16
15
  import { createDispatch, EventDispatcher } from '../event-dispatcher';
17
16
  import { getNodesCount } from '../utils/document';
18
17
  import { isFullPage } from '../utils/is-full-page';
@@ -214,41 +213,27 @@ export class ReactEditorView extends React.Component {
214
213
  const api = this.pluginInjectionAPI.api();
215
214
  const isViewMode = (api === null || api === void 0 ? void 0 : (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.sharedState.currentState().mode) === 'view';
216
215
  let selection;
217
- if (fg('platform.editor.live-view.no-editor-selection-in-view-mode')) {
218
- if (doc) {
219
- if (isViewMode) {
220
- const emptySelection = new TextSelection(doc.resolve(0));
221
- return EditorState.create({
222
- schema,
223
- plugins: plugins,
224
- doc,
225
- selection: emptySelection
226
- });
227
- } else {
228
- selection = options.selectionAtStart ? Selection.atStart(doc) : Selection.atEnd(doc);
229
- }
230
- }
231
- // Workaround for ED-3507: When media node is the last element, scrollIntoView throws an error
232
- const patchedSelection = selection ? Selection.findFrom(selection.$head, -1, true) || undefined : undefined;
233
- return EditorState.create({
234
- schema,
235
- plugins: plugins,
236
- doc,
237
- selection: patchedSelection
238
- });
239
- } else {
240
- if (doc) {
216
+ if (doc) {
217
+ if (isViewMode) {
218
+ const emptySelection = new TextSelection(doc.resolve(0));
219
+ return EditorState.create({
220
+ schema,
221
+ plugins: plugins,
222
+ doc,
223
+ selection: emptySelection
224
+ });
225
+ } else {
241
226
  selection = options.selectionAtStart ? Selection.atStart(doc) : Selection.atEnd(doc);
242
227
  }
243
- // Workaround for ED-3507: When media node is the last element, scrollIntoView throws an error
244
- const patchedSelection = selection ? Selection.findFrom(selection.$head, -1, true) || undefined : undefined;
245
- return EditorState.create({
246
- schema,
247
- plugins: plugins,
248
- doc,
249
- selection: patchedSelection
250
- });
251
228
  }
229
+ // Workaround for ED-3507: When media node is the last element, scrollIntoView throws an error
230
+ const patchedSelection = selection ? Selection.findFrom(selection.$head, -1, true) || undefined : undefined;
231
+ return EditorState.create({
232
+ schema,
233
+ plugins: plugins,
234
+ doc,
235
+ selection: patchedSelection
236
+ });
252
237
  });
253
238
  _defineProperty(this, "onEditorViewStateUpdated", ({
254
239
  originalTransaction,
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "195.4.4";
2
+ export const version = "195.4.6";
@@ -23,7 +23,6 @@ import { EDIT_AREA_ID } from '@atlaskit/editor-common/ui';
23
23
  import { analyticsEventKey, browser, countNodes as _countNodes, findChangedNodesFromTransaction, getAnalyticsEventSeverity, getResponseEndTime, measureRender, processRawValue, shouldForceTracking, validateNodes, validNode } from '@atlaskit/editor-common/utils';
24
24
  import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
25
25
  import { EditorView } from '@atlaskit/editor-prosemirror/view';
26
- import { fg } from '@atlaskit/platform-feature-flags';
27
26
  import { createDispatch, EventDispatcher } from '../event-dispatcher';
28
27
  import { getNodesCount } from '../utils/document';
29
28
  import { isFullPage } from '../utils/is-full-page';
@@ -213,41 +212,27 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
213
212
  var api = _this.pluginInjectionAPI.api();
214
213
  var isViewMode = (api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.sharedState.currentState().mode) === 'view';
215
214
  var selection;
216
- if (fg('platform.editor.live-view.no-editor-selection-in-view-mode')) {
217
- if (doc) {
218
- if (isViewMode) {
219
- var emptySelection = new TextSelection(doc.resolve(0));
220
- return EditorState.create({
221
- schema: schema,
222
- plugins: plugins,
223
- doc: doc,
224
- selection: emptySelection
225
- });
226
- } else {
227
- selection = options.selectionAtStart ? Selection.atStart(doc) : Selection.atEnd(doc);
228
- }
229
- }
230
- // Workaround for ED-3507: When media node is the last element, scrollIntoView throws an error
231
- var patchedSelection = selection ? Selection.findFrom(selection.$head, -1, true) || undefined : undefined;
232
- return EditorState.create({
233
- schema: schema,
234
- plugins: plugins,
235
- doc: doc,
236
- selection: patchedSelection
237
- });
238
- } else {
239
- if (doc) {
215
+ if (doc) {
216
+ if (isViewMode) {
217
+ var emptySelection = new TextSelection(doc.resolve(0));
218
+ return EditorState.create({
219
+ schema: schema,
220
+ plugins: plugins,
221
+ doc: doc,
222
+ selection: emptySelection
223
+ });
224
+ } else {
240
225
  selection = options.selectionAtStart ? Selection.atStart(doc) : Selection.atEnd(doc);
241
226
  }
242
- // Workaround for ED-3507: When media node is the last element, scrollIntoView throws an error
243
- var _patchedSelection = selection ? Selection.findFrom(selection.$head, -1, true) || undefined : undefined;
244
- return EditorState.create({
245
- schema: schema,
246
- plugins: plugins,
247
- doc: doc,
248
- selection: _patchedSelection
249
- });
250
227
  }
228
+ // Workaround for ED-3507: When media node is the last element, scrollIntoView throws an error
229
+ var patchedSelection = selection ? Selection.findFrom(selection.$head, -1, true) || undefined : undefined;
230
+ return EditorState.create({
231
+ schema: schema,
232
+ plugins: plugins,
233
+ doc: doc,
234
+ selection: patchedSelection
235
+ });
251
236
  });
252
237
  _defineProperty(_assertThisInitialized(_this), "onEditorViewStateUpdated", function (_ref2) {
253
238
  var originalTransaction = _ref2.originalTransaction,
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "195.4.4";
2
+ export var version = "195.4.6";