@atlaskit/editor-core 207.19.2 → 207.19.3

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,14 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 207.19.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#168742](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/168742)
8
+ [`43b55fe50be89`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/43b55fe50be89) -
9
+ Add experiment to show no cursor on initial edit page
10
+ - Updated dependencies
11
+
3
12
  ## 207.19.2
4
13
 
5
14
  ### Patch Changes
@@ -479,13 +479,13 @@ function ReactEditorView(props) {
479
479
  if (shouldFocus && editorView !== null && editorView !== void 0 && (_editorView$props$edi = (_editorView$props = editorView.props).editable) !== null && _editorView$props$edi !== void 0 && _editorView$props$edi.call(_editorView$props, editorView.state) && (0, _platformFeatureFlags.fg)('platform_editor_react_18_autofocus_fix')) {
480
480
  if ((0, _platformFeatureFlags.fg)('platform_editor_reduce_scroll_jump_on_editor_start')) {
481
481
  if (!mitigateScrollJump) {
482
- var liveDocWithContent = __livePage && !(0, _document.isEmptyDocument)(editorView.state.doc);
482
+ var liveDocWithContent = (__livePage || (0, _expValEquals.expValEquals)('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)) && !(0, _document.isEmptyDocument)(editorView.state.doc);
483
483
  if (!liveDocWithContent || !(0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init')) {
484
484
  focusTimeoutId.current = (0, _handleEditorFocus.handleEditorFocus)(editorView);
485
485
  }
486
486
  }
487
487
  } else {
488
- var _liveDocWithContent = __livePage && !(0, _document.isEmptyDocument)(editorView.state.doc);
488
+ var _liveDocWithContent = (__livePage || (0, _expValEquals.expValEquals)('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)) && !(0, _document.isEmptyDocument)(editorView.state.doc);
489
489
  if (!_liveDocWithContent || !(0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init')) {
490
490
  focusTimeoutId.current = (0, _handleEditorFocus.handleEditorFocus)(editorView);
491
491
  }
@@ -534,13 +534,13 @@ function ReactEditorView(props) {
534
534
  if (shouldFocus && view.props.editable && view.props.editable(view.state)) {
535
535
  if ((0, _platformFeatureFlags.fg)('platform_editor_reduce_scroll_jump_on_editor_start')) {
536
536
  if (!mitigateScrollJump) {
537
- var isLivePageWithContent = __livePage && !(0, _document.isEmptyDocument)(view.state.doc) && (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init');
537
+ var isLivePageWithContent = (__livePage || (0, _expValEquals.expValEquals)('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)) && !(0, _document.isEmptyDocument)(view.state.doc) && (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init');
538
538
  if (!isLivePageWithContent && shouldFocus && view.props.editable && view.props.editable(view.state)) {
539
539
  focusTimeoutId.current = (0, _handleEditorFocus.handleEditorFocus)(view);
540
540
  }
541
541
  }
542
542
  } else {
543
- var _isLivePageWithContent = __livePage && !(0, _document.isEmptyDocument)(view.state.doc) && (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init');
543
+ var _isLivePageWithContent = (__livePage || (0, _expValEquals.expValEquals)('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)) && !(0, _document.isEmptyDocument)(view.state.doc) && (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init');
544
544
  if (!_isLivePageWithContent && shouldFocus && view.props.editable && view.props.editable(view.state)) {
545
545
  focusTimeoutId.current = (0, _handleEditorFocus.handleEditorFocus)(view);
546
546
  }
@@ -611,7 +611,7 @@ function ReactEditorView(props) {
611
611
  return !disabled;
612
612
  }
613
613
  });
614
- var isLivePageWithContent = __livePage && !(0, _document.isEmptyDocument)(viewRef.current.state.doc) && (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init');
614
+ var isLivePageWithContent = (__livePage || (0, _expValEquals.expValEquals)('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)) && !(0, _document.isEmptyDocument)(viewRef.current.state.doc) && (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init');
615
615
  if (!disabled && shouldFocus && !isLivePageWithContent) {
616
616
  focusTimeoutId.current = (0, _handleEditorFocus.handleEditorFocus)(viewRef.current);
617
617
  }
@@ -39,6 +39,7 @@ var _undoRedo = require("@atlaskit/editor-plugins/undo-redo");
39
39
  var _unsupportedContent = require("@atlaskit/editor-plugins/unsupported-content");
40
40
  var _width = require("@atlaskit/editor-plugins/width");
41
41
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
42
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
42
43
  var _isFullPage = require("../utils/is-full-page");
43
44
  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; }
44
45
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // #region Imports
@@ -58,7 +59,7 @@ function createDefaultPreset(options) {
58
59
  performanceTracking: options.performanceTracking
59
60
  }], Boolean(options.allowAnalyticsGASV3)).add(_betterTypeHistory.betterTypeHistoryPlugin).add([_paste.pastePlugin, _objectSpread(_objectSpread({}, options === null || options === void 0 ? void 0 : options.paste), {}, {
60
61
  isFullPage: isFullPage
61
- })]).add(_clipboard.clipboardPlugin).add(_focus.focusPlugin).maybeAdd(_interaction.interactionPlugin, Boolean(options === null || options === void 0 ? void 0 : options.__livePage) && (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init')).add(_composition.compositionPlugin).add([_contextIdentifier.contextIdentifierPlugin, {
62
+ })]).add(_clipboard.clipboardPlugin).add(_focus.focusPlugin).maybeAdd(_interaction.interactionPlugin, Boolean(options === null || options === void 0 ? void 0 : options.__livePage) ? (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init') : (0, _expValEquals.expValEquals)('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)).add(_composition.compositionPlugin).add([_contextIdentifier.contextIdentifierPlugin, {
62
63
  contextIdentifierProvider: options.contextIdentifierProvider
63
64
  }]).add([_base.basePlugin, options.base]).add(_decorations.decorationsPlugin).add([_typeAhead.typeAheadPlugin, options.typeAhead]).maybeAdd(_history.historyPlugin, Boolean(options.allowUndoRedoButtons)).add([_primaryToolbar.primaryToolbarPlugin, {
64
65
  contextualFormattingEnabled: isFullPage
@@ -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 = "207.19.2";
8
+ var version = exports.version = "207.19.3";
@@ -450,13 +450,13 @@ export function ReactEditorView(props) {
450
450
  if (shouldFocus && editorView !== null && editorView !== void 0 && (_editorView$props$edi = (_editorView$props = editorView.props).editable) !== null && _editorView$props$edi !== void 0 && _editorView$props$edi.call(_editorView$props, editorView.state) && fg('platform_editor_react_18_autofocus_fix')) {
451
451
  if (fg('platform_editor_reduce_scroll_jump_on_editor_start')) {
452
452
  if (!mitigateScrollJump) {
453
- const liveDocWithContent = __livePage && !isEmptyDocument(editorView.state.doc);
453
+ const liveDocWithContent = (__livePage || expValEquals('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)) && !isEmptyDocument(editorView.state.doc);
454
454
  if (!liveDocWithContent || !fg('platform_editor_no_cursor_on_live_doc_init')) {
455
455
  focusTimeoutId.current = handleEditorFocus(editorView);
456
456
  }
457
457
  }
458
458
  } else {
459
- const liveDocWithContent = __livePage && !isEmptyDocument(editorView.state.doc);
459
+ const liveDocWithContent = (__livePage || expValEquals('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)) && !isEmptyDocument(editorView.state.doc);
460
460
  if (!liveDocWithContent || !fg('platform_editor_no_cursor_on_live_doc_init')) {
461
461
  focusTimeoutId.current = handleEditorFocus(editorView);
462
462
  }
@@ -503,13 +503,13 @@ export function ReactEditorView(props) {
503
503
  if (shouldFocus && view.props.editable && view.props.editable(view.state)) {
504
504
  if (fg('platform_editor_reduce_scroll_jump_on_editor_start')) {
505
505
  if (!mitigateScrollJump) {
506
- const isLivePageWithContent = __livePage && !isEmptyDocument(view.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
506
+ const isLivePageWithContent = (__livePage || expValEquals('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)) && !isEmptyDocument(view.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
507
507
  if (!isLivePageWithContent && shouldFocus && view.props.editable && view.props.editable(view.state)) {
508
508
  focusTimeoutId.current = handleEditorFocus(view);
509
509
  }
510
510
  }
511
511
  } else {
512
- const isLivePageWithContent = __livePage && !isEmptyDocument(view.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
512
+ const isLivePageWithContent = (__livePage || expValEquals('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)) && !isEmptyDocument(view.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
513
513
  if (!isLivePageWithContent && shouldFocus && view.props.editable && view.props.editable(view.state)) {
514
514
  focusTimeoutId.current = handleEditorFocus(view);
515
515
  }
@@ -578,7 +578,7 @@ export function ReactEditorView(props) {
578
578
  viewRef.current.setProps({
579
579
  editable: _state => !disabled
580
580
  });
581
- const isLivePageWithContent = __livePage && !isEmptyDocument(viewRef.current.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
581
+ const isLivePageWithContent = (__livePage || expValEquals('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)) && !isEmptyDocument(viewRef.current.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
582
582
  if (!disabled && shouldFocus && !isLivePageWithContent) {
583
583
  focusTimeoutId.current = handleEditorFocus(viewRef.current);
584
584
  }
@@ -32,6 +32,7 @@ import { undoRedoPlugin } from '@atlaskit/editor-plugins/undo-redo';
32
32
  import { unsupportedContentPlugin } from '@atlaskit/editor-plugins/unsupported-content';
33
33
  import { widthPlugin } from '@atlaskit/editor-plugins/width';
34
34
  import { fg } from '@atlaskit/platform-feature-flags';
35
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
35
36
  import { isFullPage as fullPageCheck } from '../utils/is-full-page';
36
37
 
37
38
  // #endregion
@@ -51,7 +52,7 @@ export function createDefaultPreset(options) {
51
52
  }], Boolean(options.allowAnalyticsGASV3)).add(betterTypeHistoryPlugin).add([pastePlugin, {
52
53
  ...(options === null || options === void 0 ? void 0 : options.paste),
53
54
  isFullPage
54
- }]).add(clipboardPlugin).add(focusPlugin).maybeAdd(interactionPlugin, Boolean(options === null || options === void 0 ? void 0 : options.__livePage) && fg('platform_editor_no_cursor_on_live_doc_init')).add(compositionPlugin).add([contextIdentifierPlugin, {
55
+ }]).add(clipboardPlugin).add(focusPlugin).maybeAdd(interactionPlugin, Boolean(options === null || options === void 0 ? void 0 : options.__livePage) ? fg('platform_editor_no_cursor_on_live_doc_init') : expValEquals('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)).add(compositionPlugin).add([contextIdentifierPlugin, {
55
56
  contextIdentifierProvider: options.contextIdentifierProvider
56
57
  }]).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead]).maybeAdd(historyPlugin, Boolean(options.allowUndoRedoButtons)).add([primaryToolbarPlugin, {
57
58
  contextualFormattingEnabled: isFullPage
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "207.19.2";
2
+ export const version = "207.19.3";
@@ -469,13 +469,13 @@ export function ReactEditorView(props) {
469
469
  if (shouldFocus && editorView !== null && editorView !== void 0 && (_editorView$props$edi = (_editorView$props = editorView.props).editable) !== null && _editorView$props$edi !== void 0 && _editorView$props$edi.call(_editorView$props, editorView.state) && fg('platform_editor_react_18_autofocus_fix')) {
470
470
  if (fg('platform_editor_reduce_scroll_jump_on_editor_start')) {
471
471
  if (!mitigateScrollJump) {
472
- var liveDocWithContent = __livePage && !isEmptyDocument(editorView.state.doc);
472
+ var liveDocWithContent = (__livePage || expValEquals('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)) && !isEmptyDocument(editorView.state.doc);
473
473
  if (!liveDocWithContent || !fg('platform_editor_no_cursor_on_live_doc_init')) {
474
474
  focusTimeoutId.current = handleEditorFocus(editorView);
475
475
  }
476
476
  }
477
477
  } else {
478
- var _liveDocWithContent = __livePage && !isEmptyDocument(editorView.state.doc);
478
+ var _liveDocWithContent = (__livePage || expValEquals('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)) && !isEmptyDocument(editorView.state.doc);
479
479
  if (!_liveDocWithContent || !fg('platform_editor_no_cursor_on_live_doc_init')) {
480
480
  focusTimeoutId.current = handleEditorFocus(editorView);
481
481
  }
@@ -524,13 +524,13 @@ export function ReactEditorView(props) {
524
524
  if (shouldFocus && view.props.editable && view.props.editable(view.state)) {
525
525
  if (fg('platform_editor_reduce_scroll_jump_on_editor_start')) {
526
526
  if (!mitigateScrollJump) {
527
- var isLivePageWithContent = __livePage && !isEmptyDocument(view.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
527
+ var isLivePageWithContent = (__livePage || expValEquals('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)) && !isEmptyDocument(view.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
528
528
  if (!isLivePageWithContent && shouldFocus && view.props.editable && view.props.editable(view.state)) {
529
529
  focusTimeoutId.current = handleEditorFocus(view);
530
530
  }
531
531
  }
532
532
  } else {
533
- var _isLivePageWithContent = __livePage && !isEmptyDocument(view.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
533
+ var _isLivePageWithContent = (__livePage || expValEquals('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)) && !isEmptyDocument(view.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
534
534
  if (!_isLivePageWithContent && shouldFocus && view.props.editable && view.props.editable(view.state)) {
535
535
  focusTimeoutId.current = handleEditorFocus(view);
536
536
  }
@@ -601,7 +601,7 @@ export function ReactEditorView(props) {
601
601
  return !disabled;
602
602
  }
603
603
  });
604
- var isLivePageWithContent = __livePage && !isEmptyDocument(viewRef.current.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
604
+ var isLivePageWithContent = (__livePage || expValEquals('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)) && !isEmptyDocument(viewRef.current.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
605
605
  if (!disabled && shouldFocus && !isLivePageWithContent) {
606
606
  focusTimeoutId.current = handleEditorFocus(viewRef.current);
607
607
  }
@@ -35,6 +35,7 @@ import { undoRedoPlugin } from '@atlaskit/editor-plugins/undo-redo';
35
35
  import { unsupportedContentPlugin } from '@atlaskit/editor-plugins/unsupported-content';
36
36
  import { widthPlugin } from '@atlaskit/editor-plugins/width';
37
37
  import { fg } from '@atlaskit/platform-feature-flags';
38
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
38
39
  import { isFullPage as fullPageCheck } from '../utils/is-full-page';
39
40
 
40
41
  // #endregion
@@ -53,7 +54,7 @@ export function createDefaultPreset(options) {
53
54
  performanceTracking: options.performanceTracking
54
55
  }], Boolean(options.allowAnalyticsGASV3)).add(betterTypeHistoryPlugin).add([pastePlugin, _objectSpread(_objectSpread({}, options === null || options === void 0 ? void 0 : options.paste), {}, {
55
56
  isFullPage: isFullPage
56
- })]).add(clipboardPlugin).add(focusPlugin).maybeAdd(interactionPlugin, Boolean(options === null || options === void 0 ? void 0 : options.__livePage) && fg('platform_editor_no_cursor_on_live_doc_init')).add(compositionPlugin).add([contextIdentifierPlugin, {
57
+ })]).add(clipboardPlugin).add(focusPlugin).maybeAdd(interactionPlugin, Boolean(options === null || options === void 0 ? void 0 : options.__livePage) ? fg('platform_editor_no_cursor_on_live_doc_init') : expValEquals('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)).add(compositionPlugin).add([contextIdentifierPlugin, {
57
58
  contextIdentifierProvider: options.contextIdentifierProvider
58
59
  }]).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead]).maybeAdd(historyPlugin, Boolean(options.allowUndoRedoButtons)).add([primaryToolbarPlugin, {
59
60
  contextualFormattingEnabled: isFullPage
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "207.19.2";
2
+ export var version = "207.19.3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "207.19.2",
3
+ "version": "207.19.3",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -62,7 +62,7 @@
62
62
  "@atlaskit/platform-feature-flags-react": "^0.2.0",
63
63
  "@atlaskit/react-ufo": "^3.13.0",
64
64
  "@atlaskit/task-decision": "^19.2.0",
65
- "@atlaskit/tmp-editor-statsig": "^6.0.0",
65
+ "@atlaskit/tmp-editor-statsig": "^6.1.0",
66
66
  "@atlaskit/tokens": "^5.1.0",
67
67
  "@atlaskit/tooltip": "^20.3.0",
68
68
  "@atlaskit/width-detector": "^5.0.0",