@atlaskit/editor-core 214.2.0 → 214.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 214.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`124f42c79b002`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/124f42c79b002) -
8
+ Clean up feature gate cc_complexit_fe_improve_node_validation
9
+ - Updated dependencies
10
+
11
+ ## 214.2.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`ff53e1bfc6c25`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ff53e1bfc6c25) -
16
+ [ED-29482] clean up references to platform_editor_toolbar_rerender_optimization_exp
17
+ - Updated dependencies
18
+
3
19
  ## 214.2.0
4
20
 
5
21
  ### Minor Changes
@@ -99,13 +99,11 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
99
99
  };
100
100
  }
101
101
  });
102
- var isShortcutToFocusToolbarRaw = function isShortcutToFocusToolbarRaw(event) {
102
+ var isShortcutToFocusToolbar = (0, _react.useCallback)(function (event) {
103
103
  //Alt + F9 to reach first element in this main toolbar
104
104
  return event.altKey && (event.key === 'F9' || event.keyCode === 120);
105
- };
106
- var isShortcutToFocusToolbarMemoized = (0, _react.useCallback)(isShortcutToFocusToolbarRaw, []);
107
- var isShortcutToFocusToolbar = (0, _experiments.editorExperiment)('platform_editor_toolbar_rerender_optimization_exp', true) ? isShortcutToFocusToolbarMemoized : isShortcutToFocusToolbarRaw;
108
- var handleEscapeRaw = function handleEscapeRaw(event) {
105
+ }, []);
106
+ var handleEscape = (0, _react.useCallback)(function (event) {
109
107
  var _props$editorView;
110
108
  if (!((_props$editorView = props.editorView) !== null && _props$editorView !== void 0 && _props$editorView.hasFocus())) {
111
109
  var _props$editorView2;
@@ -113,17 +111,7 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
113
111
  }
114
112
  event.preventDefault();
115
113
  event.stopPropagation();
116
- };
117
- var handleEscapeMemoized = (0, _react.useCallback)(function (event) {
118
- var _props$editorView3;
119
- if (!((_props$editorView3 = props.editorView) !== null && _props$editorView3 !== void 0 && _props$editorView3.hasFocus())) {
120
- var _props$editorView4;
121
- (_props$editorView4 = props.editorView) === null || _props$editorView4 === void 0 || _props$editorView4.focus();
122
- }
123
- event.preventDefault();
124
- event.stopPropagation();
125
114
  }, [props.editorView]);
126
- var handleEscape = (0, _experiments.editorExperiment)('platform_editor_toolbar_rerender_optimization_exp', true) ? handleEscapeMemoized : handleEscapeRaw;
127
115
  return (0, _react2.jsx)(_contextPanel.ContextPanelConsumer, null, function (_ref2) {
128
116
  var contextPanelWidth = _ref2.width;
129
117
  return (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
@@ -14,7 +14,6 @@ var _contextPanel = require("@atlaskit/editor-common/context-panel");
14
14
  var _toolbar = require("@atlaskit/editor-common/toolbar");
15
15
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
16
16
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
- var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
18
17
  var _toolbar2 = require("../../../utils/toolbar");
19
18
  var _Toolbar = require("../../Toolbar/Toolbar");
20
19
  var _ToolbarPortal = require("../../Toolbar/ToolbarPortal");
@@ -78,27 +77,17 @@ var FullPageToolbarNext = exports.FullPageToolbarNext = function FullPageToolbar
78
77
  ToolbarPortal = _ref5.Portal;
79
78
  var hasToolbarPortal = ToolbarPortal !== _react.default.Fragment;
80
79
  var mountPoint = hasToolbarPortal ? undefined : popupsMountPoint;
81
- var isShortcutToFocusToolbarRaw = function isShortcutToFocusToolbarRaw(event) {
80
+ var isShortcutToFocusToolbar = (0, _react.useCallback)(function (event) {
82
81
  //Alt + F9 to reach first element in this main toolbar
83
82
  return event.altKey && event.key === 'F9';
84
- };
85
- var isShortcutToFocusToolbarMemoized = (0, _react.useCallback)(isShortcutToFocusToolbarRaw, []);
86
- var isShortcutToFocusToolbar = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_toolbar_rerender_optimization_exp', 'isEnabled', true) ? isShortcutToFocusToolbarMemoized : isShortcutToFocusToolbarRaw;
87
- var handleEscapeRaw = function handleEscapeRaw(event) {
88
- if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
89
- editorView === null || editorView === void 0 || editorView.focus();
90
- }
91
- event.preventDefault();
92
- event.stopPropagation();
93
- };
94
- var handleEscapeMemoized = (0, _react.useCallback)(function (event) {
83
+ }, []);
84
+ var handleEscape = (0, _react.useCallback)(function (event) {
95
85
  if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
96
86
  editorView === null || editorView === void 0 || editorView.focus();
97
87
  }
98
88
  event.preventDefault();
99
89
  event.stopPropagation();
100
90
  }, [editorView]);
101
- var handleEscape = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_toolbar_rerender_optimization_exp', 'isEnabled', true) ? handleEscapeMemoized : handleEscapeRaw;
102
91
  return /*#__PURE__*/_react.default.createElement(_contextPanel.ContextPanelConsumer, null, function (_ref6) {
103
92
  var ContextPanelWidth = _ref6.width;
104
93
  return /*#__PURE__*/_react.default.createElement(_uiMenu.ToolbarArrowKeyNavigationProvider, {
@@ -4,8 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.findChangedNodesFromTransaction = void 0;
7
- var _utils = require("@atlaskit/editor-prosemirror/utils");
8
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
7
  /**
10
8
  * Finds all top level nodes affected by the transaction
11
9
  * Uses from/to positions in transaction's steps to work out which nodes will
@@ -15,20 +13,12 @@ var findChangedNodesFromTransaction = exports.findChangedNodesFromTransaction =
15
13
  var nodes = [];
16
14
  var steps = tr.steps || [];
17
15
  steps.forEach(function (step) {
18
- step.getMap().forEach(function (oldStart, oldEnd, newStart, newEnd) {
16
+ step.getMap().forEach(function (_oldStart, _oldEnd, newStart, newEnd) {
19
17
  tr.doc.nodesBetween(newStart, Math.min(newEnd, tr.doc.content.size), function (node) {
20
- var nodeToCheck = node;
21
- if ((0, _platformFeatureFlags.fg)('cc_complexit_fe_improve_node_validation')) {
22
- var schema = tr.selection.$from.doc.type.schema;
23
- var parentNode = (0, _utils.findParentNode)(function (node) {
24
- return node.type !== schema.nodes.paragraph;
25
- })(tr.selection);
26
- nodeToCheck = parentNode ? parentNode.node : node;
27
- }
28
18
  if (!nodes.find(function (n) {
29
- return n === nodeToCheck;
19
+ return n === node;
30
20
  })) {
31
- nodes.push(nodeToCheck);
21
+ nodes.push(node);
32
22
  }
33
23
  return false;
34
24
  });
@@ -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 = "214.1.7";
8
+ var version = exports.version = "214.2.1";
@@ -87,13 +87,11 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
87
87
  return () => window.removeEventListener('resize', updateOnResize);
88
88
  }
89
89
  });
90
- const isShortcutToFocusToolbarRaw = event => {
90
+ const isShortcutToFocusToolbar = useCallback(event => {
91
91
  //Alt + F9 to reach first element in this main toolbar
92
92
  return event.altKey && (event.key === 'F9' || event.keyCode === 120);
93
- };
94
- const isShortcutToFocusToolbarMemoized = useCallback(isShortcutToFocusToolbarRaw, []);
95
- const isShortcutToFocusToolbar = editorExperiment('platform_editor_toolbar_rerender_optimization_exp', true) ? isShortcutToFocusToolbarMemoized : isShortcutToFocusToolbarRaw;
96
- const handleEscapeRaw = event => {
93
+ }, []);
94
+ const handleEscape = useCallback(event => {
97
95
  var _props$editorView;
98
96
  if (!((_props$editorView = props.editorView) !== null && _props$editorView !== void 0 && _props$editorView.hasFocus())) {
99
97
  var _props$editorView2;
@@ -101,17 +99,7 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
101
99
  }
102
100
  event.preventDefault();
103
101
  event.stopPropagation();
104
- };
105
- const handleEscapeMemoized = useCallback(event => {
106
- var _props$editorView3;
107
- if (!((_props$editorView3 = props.editorView) !== null && _props$editorView3 !== void 0 && _props$editorView3.hasFocus())) {
108
- var _props$editorView4;
109
- (_props$editorView4 = props.editorView) === null || _props$editorView4 === void 0 ? void 0 : _props$editorView4.focus();
110
- }
111
- event.preventDefault();
112
- event.stopPropagation();
113
102
  }, [props.editorView]);
114
- const handleEscape = editorExperiment('platform_editor_toolbar_rerender_optimization_exp', true) ? handleEscapeMemoized : handleEscapeRaw;
115
103
  return jsx(ContextPanelConsumer, null, ({
116
104
  width: contextPanelWidth
117
105
  }) => jsx(ToolbarArrowKeyNavigationProvider, {
@@ -7,7 +7,6 @@ import { ContextPanelConsumer } from '@atlaskit/editor-common/context-panel';
7
7
  import { TOOLBARS } from '@atlaskit/editor-common/toolbar';
8
8
  import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
9
9
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
11
10
  import { isToolbar } from '../../../utils/toolbar';
12
11
  import { ToolbarNext } from '../../Toolbar/Toolbar';
13
12
  import { useToolbarPortal } from '../../Toolbar/ToolbarPortal';
@@ -73,27 +72,17 @@ export const FullPageToolbarNext = ({
73
72
  };
74
73
  const hasToolbarPortal = ToolbarPortal !== React.Fragment;
75
74
  const mountPoint = hasToolbarPortal ? undefined : popupsMountPoint;
76
- const isShortcutToFocusToolbarRaw = event => {
75
+ const isShortcutToFocusToolbar = useCallback(event => {
77
76
  //Alt + F9 to reach first element in this main toolbar
78
77
  return event.altKey && event.key === 'F9';
79
- };
80
- const isShortcutToFocusToolbarMemoized = useCallback(isShortcutToFocusToolbarRaw, []);
81
- const isShortcutToFocusToolbar = expValEqualsNoExposure('platform_editor_toolbar_rerender_optimization_exp', 'isEnabled', true) ? isShortcutToFocusToolbarMemoized : isShortcutToFocusToolbarRaw;
82
- const handleEscapeRaw = event => {
83
- if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
84
- editorView === null || editorView === void 0 ? void 0 : editorView.focus();
85
- }
86
- event.preventDefault();
87
- event.stopPropagation();
88
- };
89
- const handleEscapeMemoized = useCallback(event => {
78
+ }, []);
79
+ const handleEscape = useCallback(event => {
90
80
  if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
91
81
  editorView === null || editorView === void 0 ? void 0 : editorView.focus();
92
82
  }
93
83
  event.preventDefault();
94
84
  event.stopPropagation();
95
85
  }, [editorView]);
96
- const handleEscape = expValEqualsNoExposure('platform_editor_toolbar_rerender_optimization_exp', 'isEnabled', true) ? handleEscapeMemoized : handleEscapeRaw;
97
86
  return /*#__PURE__*/React.createElement(ContextPanelConsumer, null, ({
98
87
  width: ContextPanelWidth
99
88
  }) => /*#__PURE__*/React.createElement(ToolbarArrowKeyNavigationProvider, {
@@ -1,6 +1,3 @@
1
- import { findParentNode } from '@atlaskit/editor-prosemirror/utils';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
-
4
1
  /**
5
2
  * Finds all top level nodes affected by the transaction
6
3
  * Uses from/to positions in transaction's steps to work out which nodes will
@@ -10,18 +7,10 @@ export const findChangedNodesFromTransaction = tr => {
10
7
  const nodes = [];
11
8
  const steps = tr.steps || [];
12
9
  steps.forEach(step => {
13
- step.getMap().forEach((oldStart, oldEnd, newStart, newEnd) => {
10
+ step.getMap().forEach((_oldStart, _oldEnd, newStart, newEnd) => {
14
11
  tr.doc.nodesBetween(newStart, Math.min(newEnd, tr.doc.content.size), node => {
15
- let nodeToCheck = node;
16
- if (fg('cc_complexit_fe_improve_node_validation')) {
17
- const {
18
- schema
19
- } = tr.selection.$from.doc.type;
20
- const parentNode = findParentNode(node => node.type !== schema.nodes.paragraph)(tr.selection);
21
- nodeToCheck = parentNode ? parentNode.node : node;
22
- }
23
- if (!nodes.find(n => n === nodeToCheck)) {
24
- nodes.push(nodeToCheck);
12
+ if (!nodes.find(n => n === node)) {
13
+ nodes.push(node);
25
14
  }
26
15
  return false;
27
16
  });
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "214.1.7";
2
+ export const version = "214.2.1";
@@ -90,13 +90,11 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
90
90
  };
91
91
  }
92
92
  });
93
- var isShortcutToFocusToolbarRaw = function isShortcutToFocusToolbarRaw(event) {
93
+ var isShortcutToFocusToolbar = useCallback(function (event) {
94
94
  //Alt + F9 to reach first element in this main toolbar
95
95
  return event.altKey && (event.key === 'F9' || event.keyCode === 120);
96
- };
97
- var isShortcutToFocusToolbarMemoized = useCallback(isShortcutToFocusToolbarRaw, []);
98
- var isShortcutToFocusToolbar = editorExperiment('platform_editor_toolbar_rerender_optimization_exp', true) ? isShortcutToFocusToolbarMemoized : isShortcutToFocusToolbarRaw;
99
- var handleEscapeRaw = function handleEscapeRaw(event) {
96
+ }, []);
97
+ var handleEscape = useCallback(function (event) {
100
98
  var _props$editorView;
101
99
  if (!((_props$editorView = props.editorView) !== null && _props$editorView !== void 0 && _props$editorView.hasFocus())) {
102
100
  var _props$editorView2;
@@ -104,17 +102,7 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
104
102
  }
105
103
  event.preventDefault();
106
104
  event.stopPropagation();
107
- };
108
- var handleEscapeMemoized = useCallback(function (event) {
109
- var _props$editorView3;
110
- if (!((_props$editorView3 = props.editorView) !== null && _props$editorView3 !== void 0 && _props$editorView3.hasFocus())) {
111
- var _props$editorView4;
112
- (_props$editorView4 = props.editorView) === null || _props$editorView4 === void 0 || _props$editorView4.focus();
113
- }
114
- event.preventDefault();
115
- event.stopPropagation();
116
105
  }, [props.editorView]);
117
- var handleEscape = editorExperiment('platform_editor_toolbar_rerender_optimization_exp', true) ? handleEscapeMemoized : handleEscapeRaw;
118
106
  return jsx(ContextPanelConsumer, null, function (_ref2) {
119
107
  var contextPanelWidth = _ref2.width;
120
108
  return jsx(ToolbarArrowKeyNavigationProvider, {
@@ -7,7 +7,6 @@ import { ContextPanelConsumer } from '@atlaskit/editor-common/context-panel';
7
7
  import { TOOLBARS } from '@atlaskit/editor-common/toolbar';
8
8
  import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
9
9
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
11
10
  import { isToolbar } from '../../../utils/toolbar';
12
11
  import { ToolbarNext } from '../../Toolbar/Toolbar';
13
12
  import { useToolbarPortal } from '../../Toolbar/ToolbarPortal';
@@ -70,27 +69,17 @@ export var FullPageToolbarNext = function FullPageToolbarNext(_ref4) {
70
69
  ToolbarPortal = _ref5.Portal;
71
70
  var hasToolbarPortal = ToolbarPortal !== React.Fragment;
72
71
  var mountPoint = hasToolbarPortal ? undefined : popupsMountPoint;
73
- var isShortcutToFocusToolbarRaw = function isShortcutToFocusToolbarRaw(event) {
72
+ var isShortcutToFocusToolbar = useCallback(function (event) {
74
73
  //Alt + F9 to reach first element in this main toolbar
75
74
  return event.altKey && event.key === 'F9';
76
- };
77
- var isShortcutToFocusToolbarMemoized = useCallback(isShortcutToFocusToolbarRaw, []);
78
- var isShortcutToFocusToolbar = expValEqualsNoExposure('platform_editor_toolbar_rerender_optimization_exp', 'isEnabled', true) ? isShortcutToFocusToolbarMemoized : isShortcutToFocusToolbarRaw;
79
- var handleEscapeRaw = function handleEscapeRaw(event) {
80
- if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
81
- editorView === null || editorView === void 0 || editorView.focus();
82
- }
83
- event.preventDefault();
84
- event.stopPropagation();
85
- };
86
- var handleEscapeMemoized = useCallback(function (event) {
75
+ }, []);
76
+ var handleEscape = useCallback(function (event) {
87
77
  if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
88
78
  editorView === null || editorView === void 0 || editorView.focus();
89
79
  }
90
80
  event.preventDefault();
91
81
  event.stopPropagation();
92
82
  }, [editorView]);
93
- var handleEscape = expValEqualsNoExposure('platform_editor_toolbar_rerender_optimization_exp', 'isEnabled', true) ? handleEscapeMemoized : handleEscapeRaw;
94
83
  return /*#__PURE__*/React.createElement(ContextPanelConsumer, null, function (_ref6) {
95
84
  var ContextPanelWidth = _ref6.width;
96
85
  return /*#__PURE__*/React.createElement(ToolbarArrowKeyNavigationProvider, {
@@ -1,6 +1,3 @@
1
- import { findParentNode } from '@atlaskit/editor-prosemirror/utils';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
-
4
1
  /**
5
2
  * Finds all top level nodes affected by the transaction
6
3
  * Uses from/to positions in transaction's steps to work out which nodes will
@@ -10,20 +7,12 @@ export var findChangedNodesFromTransaction = function findChangedNodesFromTransa
10
7
  var nodes = [];
11
8
  var steps = tr.steps || [];
12
9
  steps.forEach(function (step) {
13
- step.getMap().forEach(function (oldStart, oldEnd, newStart, newEnd) {
10
+ step.getMap().forEach(function (_oldStart, _oldEnd, newStart, newEnd) {
14
11
  tr.doc.nodesBetween(newStart, Math.min(newEnd, tr.doc.content.size), function (node) {
15
- var nodeToCheck = node;
16
- if (fg('cc_complexit_fe_improve_node_validation')) {
17
- var schema = tr.selection.$from.doc.type.schema;
18
- var parentNode = findParentNode(function (node) {
19
- return node.type !== schema.nodes.paragraph;
20
- })(tr.selection);
21
- nodeToCheck = parentNode ? parentNode.node : node;
22
- }
23
12
  if (!nodes.find(function (n) {
24
- return n === nodeToCheck;
13
+ return n === node;
25
14
  })) {
26
- nodes.push(nodeToCheck);
15
+ nodes.push(node);
27
16
  }
28
17
  return false;
29
18
  });
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "214.1.7";
2
+ export var version = "214.2.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "214.2.0",
3
+ "version": "214.2.2",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -56,7 +56,7 @@
56
56
  "@atlaskit/editor-toolbar": "^0.14.0",
57
57
  "@atlaskit/editor-toolbar-model": "^0.2.0",
58
58
  "@atlaskit/emoji": "^69.5.0",
59
- "@atlaskit/icon": "^28.4.0",
59
+ "@atlaskit/icon": "^28.5.0",
60
60
  "@atlaskit/link": "^3.2.0",
61
61
  "@atlaskit/media-card": "^79.5.0",
62
62
  "@atlaskit/mention": "^24.2.0",
@@ -64,7 +64,7 @@
64
64
  "@atlaskit/platform-feature-flags-react": "^0.3.0",
65
65
  "@atlaskit/react-ufo": "^4.11.0",
66
66
  "@atlaskit/task-decision": "^19.2.0",
67
- "@atlaskit/tmp-editor-statsig": "^13.4.0",
67
+ "@atlaskit/tmp-editor-statsig": "^13.5.0",
68
68
  "@atlaskit/tokens": "^6.4.0",
69
69
  "@atlaskit/tooltip": "^20.5.0",
70
70
  "@atlaskit/width-detector": "^5.0.0",
@@ -81,7 +81,7 @@
81
81
  "uuid": "^3.1.0"
82
82
  },
83
83
  "peerDependencies": {
84
- "@atlaskit/editor-common": "^110.7.0",
84
+ "@atlaskit/editor-common": "^110.8.0",
85
85
  "@atlaskit/link-provider": "^4.0.0",
86
86
  "@atlaskit/media-core": "^37.0.0",
87
87
  "react": "^18.2.0",
@@ -150,9 +150,6 @@
150
150
  }
151
151
  },
152
152
  "platform-feature-flags": {
153
- "cc_complexit_fe_improve_node_validation": {
154
- "type": "boolean"
155
- },
156
153
  "cc_editor_abort_ufo_load_on_editor_scroll": {
157
154
  "type": "boolean"
158
155
  },