@atlaskit/editor-core 204.6.4 → 204.7.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 204.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#130191](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/130191)
8
+ [`e1cf89e2fc15b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e1cf89e2fc15b) -
9
+ [ED-26903] Add class to full page editor content area region
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 204.6.4
4
16
 
5
17
  ### Patch Changes
@@ -8,6 +8,7 @@ var _collab = require("@atlaskit/editor-common/collab");
8
8
  var _commands = require("@atlaskit/editor-common/commands");
9
9
  var _selection = require("@atlaskit/editor-common/selection");
10
10
  var _utils = require("@atlaskit/editor-common/utils");
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _contentComponentWrapper = require("./ClickAreaBlock/contentComponentWrapper");
12
13
  // we ignore all of the clicks made inside <div class="ak-editor-content-area" /> (but not clicks on the node itself)
13
14
  var insideContentArea = function insideContentArea(ref) {
@@ -45,7 +46,7 @@ var checkForModal = exports.checkForModal = function checkForModal(target) {
45
46
  return true;
46
47
  };
47
48
  var clickAreaClickHandler = exports.clickAreaClickHandler = function clickAreaClickHandler(view, event) {
48
- var _view$hasFocus, _event$currentTarget;
49
+ var _view$hasFocus, _target$parentElement, _event$currentTarget;
49
50
  var isEditorFocused = !!(view !== null && view !== void 0 && (_view$hasFocus = view.hasFocus) !== null && _view$hasFocus !== void 0 && _view$hasFocus.call(view));
50
51
  if (!(event.target instanceof HTMLElement)) {
51
52
  return;
@@ -79,7 +80,9 @@ var clickAreaClickHandler = exports.clickAreaClickHandler = function clickAreaCl
79
80
  // Ignored via go/ees005
80
81
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
81
82
  (0, _utils.closestElement)(selection === null || selection === void 0 ? void 0 : selection.anchorNode, '[data-editor-popup]');
82
- var isContentComponent = !!(0, _utils.closestElement)(target, "[".concat(_contentComponentWrapper.ignoreAttribute, "]")) || (target === null || target === void 0 ? void 0 : target.getAttribute(_contentComponentWrapper.ignoreAttribute)) === 'true';
83
+
84
+ // For clicks directly on the content component -- they should not be ignored
85
+ var isContentComponent = (0, _platformFeatureFlags.fg)('platform_editor_keep_focus_on_content_comp_clicks') ? target === null || target === void 0 || (_target$parentElement = target.parentElement) === null || _target$parentElement === void 0 ? void 0 : _target$parentElement.closest("[".concat(_contentComponentWrapper.ignoreAttribute, "]")) : !!(0, _utils.closestElement)(target, "[".concat(_contentComponentWrapper.ignoreAttribute, "]")) || (target === null || target === void 0 ? void 0 : target.getAttribute(_contentComponentWrapper.ignoreAttribute)) === 'true';
83
86
 
84
87
  // This is a super workaround to find when events are coming from Confluence InlineComment modal
85
88
  // We don't own those components, so we can't change them
@@ -11,6 +11,7 @@ var _react = _interopRequireWildcard(require("react"));
11
11
  var _react2 = require("@emotion/react");
12
12
  var _reactIntlNext = require("react-intl-next");
13
13
  var _messages = require("@atlaskit/editor-common/messages");
14
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
15
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
15
16
  var _ClickAreaBlock = _interopRequireDefault(require("../../Addon/ClickAreaBlock"));
16
17
  var _contentComponentWrapper = require("../../Addon/ClickAreaBlock/contentComponentWrapper");
@@ -86,7 +87,10 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
86
87
  fullWidthMode: fullWidthMode,
87
88
  layoutMaxWidth: theme.layoutMaxWidth,
88
89
  isEditorToolbarHidden: props.isEditorToolbarHidden
89
- })),
90
+ }))
91
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
92
+ ,
93
+ className: (0, _platformFeatureFlags.fg)('platform_editor_lcm_styling_uplift') ? 'ak-editor-content-area-region' : undefined,
90
94
  "data-editor-editable-content": true,
91
95
  "data-editor-primary-toolbar-hidden": props.isEditorToolbarHidden && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? 'true' : undefined,
92
96
  role: "region",
@@ -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 = "204.6.4";
8
+ var version = exports.version = "204.7.0";
@@ -2,6 +2,7 @@ import { tintDirtyTransaction } from '@atlaskit/editor-common/collab';
2
2
  import { addParagraphAtEnd } from '@atlaskit/editor-common/commands';
3
3
  import { setSelectionTopLevelBlocks } from '@atlaskit/editor-common/selection';
4
4
  import { closestElement } from '@atlaskit/editor-common/utils';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { ignoreAttribute } from './ClickAreaBlock/contentComponentWrapper';
6
7
 
7
8
  // we ignore all of the clicks made inside <div class="ak-editor-content-area" /> (but not clicks on the node itself)
@@ -40,7 +41,7 @@ export const checkForModal = target => {
40
41
  return true;
41
42
  };
42
43
  const clickAreaClickHandler = (view, event) => {
43
- var _view$hasFocus, _event$currentTarget;
44
+ var _view$hasFocus, _target$parentElement, _event$currentTarget;
44
45
  const isEditorFocused = !!(view !== null && view !== void 0 && (_view$hasFocus = view.hasFocus) !== null && _view$hasFocus !== void 0 && _view$hasFocus.call(view));
45
46
  if (!(event.target instanceof HTMLElement)) {
46
47
  return;
@@ -74,7 +75,9 @@ const clickAreaClickHandler = (view, event) => {
74
75
  // Ignored via go/ees005
75
76
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
76
77
  closestElement(selection === null || selection === void 0 ? void 0 : selection.anchorNode, '[data-editor-popup]');
77
- const isContentComponent = !!closestElement(target, `[${ignoreAttribute}]`) || (target === null || target === void 0 ? void 0 : target.getAttribute(ignoreAttribute)) === 'true';
78
+
79
+ // For clicks directly on the content component -- they should not be ignored
80
+ const isContentComponent = fg('platform_editor_keep_focus_on_content_comp_clicks') ? target === null || target === void 0 ? void 0 : (_target$parentElement = target.parentElement) === null || _target$parentElement === void 0 ? void 0 : _target$parentElement.closest(`[${ignoreAttribute}]`) : !!closestElement(target, `[${ignoreAttribute}]`) || (target === null || target === void 0 ? void 0 : target.getAttribute(ignoreAttribute)) === 'true';
78
81
 
79
82
  // This is a super workaround to find when events are coming from Confluence InlineComment modal
80
83
  // We don't own those components, so we can't change them
@@ -9,6 +9,7 @@ import React, { useImperativeHandle, useRef } from 'react';
9
9
  import { jsx, useTheme } from '@emotion/react';
10
10
  import { injectIntl } from 'react-intl-next';
11
11
  import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
12
+ import { fg } from '@atlaskit/platform-feature-flags';
12
13
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
13
14
  // Ignored via go/ees005
14
15
  // eslint-disable-next-line import/no-named-as-default
@@ -74,7 +75,10 @@ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
74
75
  fullWidthMode,
75
76
  layoutMaxWidth: theme.layoutMaxWidth,
76
77
  isEditorToolbarHidden: props.isEditorToolbarHidden
77
- })],
78
+ })]
79
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
80
+ ,
81
+ className: fg('platform_editor_lcm_styling_uplift') ? 'ak-editor-content-area-region' : undefined,
78
82
  "data-editor-editable-content": true,
79
83
  "data-editor-primary-toolbar-hidden": props.isEditorToolbarHidden && editorExperiment('platform_editor_controls', 'variant1') ? 'true' : undefined,
80
84
  role: "region",
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "204.6.4";
2
+ export const version = "204.7.0";
@@ -2,6 +2,7 @@ import { tintDirtyTransaction } from '@atlaskit/editor-common/collab';
2
2
  import { addParagraphAtEnd } from '@atlaskit/editor-common/commands';
3
3
  import { setSelectionTopLevelBlocks } from '@atlaskit/editor-common/selection';
4
4
  import { closestElement } from '@atlaskit/editor-common/utils';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { ignoreAttribute } from './ClickAreaBlock/contentComponentWrapper';
6
7
 
7
8
  // we ignore all of the clicks made inside <div class="ak-editor-content-area" /> (but not clicks on the node itself)
@@ -40,7 +41,7 @@ export var checkForModal = function checkForModal(target) {
40
41
  return true;
41
42
  };
42
43
  var clickAreaClickHandler = function clickAreaClickHandler(view, event) {
43
- var _view$hasFocus, _event$currentTarget;
44
+ var _view$hasFocus, _target$parentElement, _event$currentTarget;
44
45
  var isEditorFocused = !!(view !== null && view !== void 0 && (_view$hasFocus = view.hasFocus) !== null && _view$hasFocus !== void 0 && _view$hasFocus.call(view));
45
46
  if (!(event.target instanceof HTMLElement)) {
46
47
  return;
@@ -74,7 +75,9 @@ var clickAreaClickHandler = function clickAreaClickHandler(view, event) {
74
75
  // Ignored via go/ees005
75
76
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
76
77
  closestElement(selection === null || selection === void 0 ? void 0 : selection.anchorNode, '[data-editor-popup]');
77
- var isContentComponent = !!closestElement(target, "[".concat(ignoreAttribute, "]")) || (target === null || target === void 0 ? void 0 : target.getAttribute(ignoreAttribute)) === 'true';
78
+
79
+ // For clicks directly on the content component -- they should not be ignored
80
+ var isContentComponent = fg('platform_editor_keep_focus_on_content_comp_clicks') ? target === null || target === void 0 || (_target$parentElement = target.parentElement) === null || _target$parentElement === void 0 ? void 0 : _target$parentElement.closest("[".concat(ignoreAttribute, "]")) : !!closestElement(target, "[".concat(ignoreAttribute, "]")) || (target === null || target === void 0 ? void 0 : target.getAttribute(ignoreAttribute)) === 'true';
78
81
 
79
82
  // This is a super workaround to find when events are coming from Confluence InlineComment modal
80
83
  // We don't own those components, so we can't change them
@@ -10,6 +10,7 @@ import React, { useImperativeHandle, useRef } from 'react';
10
10
  import { jsx, useTheme } from '@emotion/react';
11
11
  import { injectIntl } from 'react-intl-next';
12
12
  import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
13
+ import { fg } from '@atlaskit/platform-feature-flags';
13
14
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
15
  // Ignored via go/ees005
15
16
  // eslint-disable-next-line import/no-named-as-default
@@ -75,7 +76,10 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
75
76
  fullWidthMode: fullWidthMode,
76
77
  layoutMaxWidth: theme.layoutMaxWidth,
77
78
  isEditorToolbarHidden: props.isEditorToolbarHidden
78
- })),
79
+ }))
80
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
81
+ ,
82
+ className: fg('platform_editor_lcm_styling_uplift') ? 'ak-editor-content-area-region' : undefined,
79
83
  "data-editor-editable-content": true,
80
84
  "data-editor-primary-toolbar-hidden": props.isEditorToolbarHidden && editorExperiment('platform_editor_controls', 'variant1') ? 'true' : undefined,
81
85
  role: "region",
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "204.6.4";
2
+ export var version = "204.7.0";
@@ -22,6 +22,7 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
22
22
  dependencies: import("packages/editor/editor-plugin-find-replace/dist/types/findReplacePluginType").FindReplacePluginDependencies;
23
23
  actions: {
24
24
  getToolbarButton: (params: import("@atlaskit/editor-plugins/find-replace").FindReplaceToolbarButtonActionProps) => import("react").ReactNode;
25
+ activateFindReplace: (triggerMethod?: import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.SHORTCUT | import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.TOOLBAR | import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.EXTERNAL | undefined) => boolean;
25
26
  };
26
27
  }, {
27
28
  takeFullWidth: boolean;
@@ -74,6 +74,7 @@ export default function createUniversalPresetInternal({ appearance, props, featu
74
74
  dependencies: import("packages/editor/editor-plugin-find-replace/dist/types/findReplacePluginType").FindReplacePluginDependencies;
75
75
  actions: {
76
76
  getToolbarButton: (params: import("@atlaskit/editor-plugins/find-replace").FindReplaceToolbarButtonActionProps) => import("react").ReactNode;
77
+ activateFindReplace: (triggerMethod?: import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.SHORTCUT | import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.TOOLBAR | import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.EXTERNAL | undefined) => boolean;
77
78
  };
78
79
  }, {
79
80
  takeFullWidth: boolean;
@@ -22,6 +22,7 @@ export default function useUniversalPreset({ props, initialPluginConfiguration }
22
22
  dependencies: import("packages/editor/editor-plugin-find-replace/dist/types/findReplacePluginType").FindReplacePluginDependencies;
23
23
  actions: {
24
24
  getToolbarButton: (params: import("@atlaskit/editor-plugins/find-replace").FindReplaceToolbarButtonActionProps) => import("react").ReactNode;
25
+ activateFindReplace: (triggerMethod?: import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.SHORTCUT | import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.TOOLBAR | import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.EXTERNAL | undefined) => boolean;
25
26
  };
26
27
  }, {
27
28
  takeFullWidth: boolean;
@@ -14,7 +14,7 @@ import { type ViewMode } from '@atlaskit/editor-plugins/editor-viewmode';
14
14
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
15
15
  import type EditorActions from '../../../actions';
16
16
  import type { ContentComponents, ReactComponents } from '../../../types';
17
- import { type ScrollContainerRefs } from './types';
17
+ import type { ScrollContainerRefs } from './types';
18
18
  interface FullPageEditorContentAreaProps {
19
19
  editorAPI: PublicPluginAPI<[OptionalPlugin<ContextPanelPlugin>]> | undefined;
20
20
  appearance: EditorAppearance | undefined;
@@ -106,6 +106,7 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
106
106
  dependencies: import("packages/editor/editor-plugin-find-replace/dist/types/findReplacePluginType").FindReplacePluginDependencies;
107
107
  actions: {
108
108
  getToolbarButton: (params: import("@atlaskit/editor-plugins/find-replace").FindReplaceToolbarButtonActionProps) => import("react").ReactNode;
109
+ activateFindReplace: (triggerMethod?: import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.SHORTCUT | import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.TOOLBAR | import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.EXTERNAL | undefined) => boolean;
109
110
  };
110
111
  }, {
111
112
  takeFullWidth: boolean;
@@ -158,6 +158,7 @@ export default function createUniversalPresetInternal({ appearance, props, featu
158
158
  dependencies: import("packages/editor/editor-plugin-find-replace/dist/types/findReplacePluginType").FindReplacePluginDependencies;
159
159
  actions: {
160
160
  getToolbarButton: (params: import("@atlaskit/editor-plugins/find-replace").FindReplaceToolbarButtonActionProps) => import("react").ReactNode;
161
+ activateFindReplace: (triggerMethod?: import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.SHORTCUT | import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.TOOLBAR | import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.EXTERNAL | undefined) => boolean;
161
162
  };
162
163
  }, {
163
164
  takeFullWidth: boolean;
@@ -106,6 +106,7 @@ export default function useUniversalPreset({ props, initialPluginConfiguration }
106
106
  dependencies: import("packages/editor/editor-plugin-find-replace/dist/types/findReplacePluginType").FindReplacePluginDependencies;
107
107
  actions: {
108
108
  getToolbarButton: (params: import("@atlaskit/editor-plugins/find-replace").FindReplaceToolbarButtonActionProps) => import("react").ReactNode;
109
+ activateFindReplace: (triggerMethod?: import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.SHORTCUT | import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.TOOLBAR | import("@atlaskit/editor-common/analytics").TRIGGER_METHOD.EXTERNAL | undefined) => boolean;
109
110
  };
110
111
  }, {
111
112
  takeFullWidth: boolean;
@@ -14,7 +14,7 @@ import { type ViewMode } from '@atlaskit/editor-plugins/editor-viewmode';
14
14
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
15
15
  import type EditorActions from '../../../actions';
16
16
  import type { ContentComponents, ReactComponents } from '../../../types';
17
- import { type ScrollContainerRefs } from './types';
17
+ import type { ScrollContainerRefs } from './types';
18
18
  interface FullPageEditorContentAreaProps {
19
19
  editorAPI: PublicPluginAPI<[
20
20
  OptionalPlugin<ContextPanelPlugin>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "204.6.4",
3
+ "version": "204.7.0",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -91,7 +91,7 @@
91
91
  "@atlaskit/collab-provider": "^10.10.0",
92
92
  "@atlaskit/editor-plugin-annotation": "^2.1.0",
93
93
  "@atlaskit/editor-plugin-card": "^5.4.0",
94
- "@atlaskit/editor-plugin-list": "^4.1.0",
94
+ "@atlaskit/editor-plugin-list": "^4.2.0",
95
95
  "@atlaskit/editor-plugin-paste": "^3.1.0",
96
96
  "@atlaskit/link-provider": "^2.0.0",
97
97
  "@atlaskit/logo": "^16.0.0",
@@ -117,7 +117,7 @@
117
117
  "@types/is-number": "^7.0.0",
118
118
  "diff": "^4.0.1",
119
119
  "enzyme": "^3.10.0",
120
- "jscodeshift": "^0.16.1",
120
+ "jscodeshift": "^17.0.0",
121
121
  "mockdate": "^3.0.5",
122
122
  "raf-stub": "^2.0.1",
123
123
  "react": "^18.2.0",
@@ -522,6 +522,10 @@
522
522
  "type": "boolean",
523
523
  "referenceOnly": true
524
524
  },
525
+ "platform_editor_split_list_item_for_gap_cursor": {
526
+ "type": "boolean",
527
+ "referenceOnly": true
528
+ },
525
529
  "platform_editor_non_macros_list_indent_fix": {
526
530
  "type": "boolean",
527
531
  "referenceOnly": true
@@ -550,6 +554,9 @@
550
554
  "type": "boolean",
551
555
  "referenceOnly": true
552
556
  },
557
+ "platform_editor_lcm_styling_uplift": {
558
+ "type": "boolean"
559
+ },
553
560
  "platform_editor_scroll_table_flickering_fix": {
554
561
  "type": "boolean",
555
562
  "referenceOnly": true
@@ -565,6 +572,9 @@
565
572
  "platform_editor_tables_numbered_column_correction": {
566
573
  "type": "boolean",
567
574
  "referenceOnly": true
575
+ },
576
+ "platform_editor_keep_focus_on_content_comp_clicks": {
577
+ "type": "boolean"
568
578
  }
569
579
  },
570
580
  "stricter": {