@atlaskit/editor-core 238.0.1 → 238.0.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 +17 -0
- package/dist/cjs/composable-editor/editor-internal.js +3 -3
- package/dist/cjs/create-editor/editorStateNotificationPlugin.js +6 -1
- package/dist/cjs/ui/Appearance/Comment/Comment.js +12 -11
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +8 -8
- package/dist/cjs/utils/performance/components/RenderTracking.js +2 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/editor-internal.js +1 -1
- package/dist/es2019/create-editor/editorStateNotificationPlugin.js +6 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +5 -4
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +3 -3
- package/dist/es2019/utils/performance/components/RenderTracking.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/editor-internal.js +1 -1
- package/dist/esm/create-editor/editorStateNotificationPlugin.js +6 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +5 -4
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +3 -3
- package/dist/esm/utils/performance/components/RenderTracking.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/composable-editor/editor-internal.d.ts +1 -1
- package/dist/types/composable-editor/hooks/useProviders.d.ts +1 -1
- package/dist/types/types/editor-props.d.ts +1 -1
- package/dist/types/ui/Appearance/Comment/Comment.d.ts +2 -2
- package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +6 -3
- package/dist/types/ui/quick-insert/QuickInsertSkillMenuItem.d.ts +2 -2
- package/dist/types/utils/performance/components/RenderTracking.d.ts +2 -1
- package/package.json +14 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 238.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`fc2f6ea92bf86`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fc2f6ea92bf86) -
|
|
8
|
+
Behind `platform_editor_reduce_memory_leaks`: stop `editorStateNotificationPlugin` accumulating
|
|
9
|
+
every transaction in an array that is never read. The array kept each transaction, its documents
|
|
10
|
+
and any closures stored in transaction meta alive for the life of the editor, which in turn
|
|
11
|
+
retained deleted node views and their DOM.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 238.0.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 238.0.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -9,7 +9,7 @@ exports.EditorInternal = void 0;
|
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var
|
|
12
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
13
13
|
var _usePortalProvider5 = require("@atlaskit/editor-common/usePortalProvider");
|
|
14
14
|
var _constants = require("@atlaskit/editor-shared-styles/constants");
|
|
15
15
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
@@ -65,8 +65,8 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
|
|
|
65
65
|
});
|
|
66
66
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, renderTrackingEnabled && /*#__PURE__*/_react.default.createElement(_RenderTracking.RenderTracking, {
|
|
67
67
|
componentProps: props,
|
|
68
|
-
action:
|
|
69
|
-
actionSubject:
|
|
68
|
+
action: _enums.ACTION.RE_RENDERED,
|
|
69
|
+
actionSubject: _enums.ACTION_SUBJECT.EDITOR,
|
|
70
70
|
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
71
71
|
propsToIgnore: propsToIgnore,
|
|
72
72
|
useShallow: false
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createEditorStateNotificationPlugin = void 0;
|
|
7
7
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
8
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
|
+
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
9
10
|
var key = new _state.PluginKey('editorStateNotificationPlugin');
|
|
10
11
|
var createEditorStateNotificationPlugin = exports.createEditorStateNotificationPlugin = function createEditorStateNotificationPlugin(onEditorStateUpdated, onEditorViewStateUpdatedCallbacks) {
|
|
11
12
|
var transactions = [];
|
|
@@ -18,7 +19,11 @@ var createEditorStateNotificationPlugin = exports.createEditorStateNotificationP
|
|
|
18
19
|
};
|
|
19
20
|
},
|
|
20
21
|
apply: function apply(tr) {
|
|
21
|
-
|
|
22
|
+
if (!(0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_memory_leaks')) {
|
|
23
|
+
// Dead accumulator: nothing reads it, so it pins every transaction for the
|
|
24
|
+
// editor's lifetime. Delete it when the experiment ships.
|
|
25
|
+
transactions.push(tr);
|
|
26
|
+
}
|
|
22
27
|
return {
|
|
23
28
|
latestTransaction: tr
|
|
24
29
|
};
|
|
@@ -16,11 +16,12 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
16
16
|
var _reactIntl = require("react-intl");
|
|
17
17
|
var _buttonGroup = _interopRequireDefault(require("@atlaskit/button/button-group"));
|
|
18
18
|
var _button = _interopRequireDefault(require("@atlaskit/button/default/button"));
|
|
19
|
-
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
20
19
|
var _messages = _interopRequireDefault(require("@atlaskit/editor-common/messages"));
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
var
|
|
20
|
+
var _ToolbarArrowKeyNavigationProvider = require("@atlaskit/editor-common/ui-menu/ToolbarArrowKeyNavigationProvider");
|
|
21
|
+
var _useSharedPluginState3 = require("@atlaskit/editor-common/useSharedPluginState");
|
|
22
|
+
var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useSharedPluginStateWithSelector");
|
|
23
|
+
var _WidthProvider = require("@atlaskit/editor-common/WidthProvider");
|
|
24
|
+
var _constants = require("@atlaskit/editor-shared-styles/constants");
|
|
24
25
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
25
26
|
var _ClickAreaBlock = _interopRequireDefault(require("../../Addon/ClickAreaBlock"));
|
|
26
27
|
var _contentComponentWrapper = require("../../Addon/ClickAreaBlock/contentComponentWrapper");
|
|
@@ -52,7 +53,7 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
52
53
|
// Get useStandardNodeWidth from block menu plugin shared state
|
|
53
54
|
// Only access editorAPI when the experiment is enabled to avoid performance impact
|
|
54
55
|
var useStandardNodeWidth = (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') && ((_editorAPI$blockMenu$ = editorAPI === null || editorAPI === void 0 || (_editorAPI$blockMenu = editorAPI.blockMenu) === null || _editorAPI$blockMenu === void 0 || (_editorAPI$blockMenu = _editorAPI$blockMenu.sharedState) === null || _editorAPI$blockMenu === void 0 || (_editorAPI$blockMenu = _editorAPI$blockMenu.currentState()) === null || _editorAPI$blockMenu === void 0 ? void 0 : _editorAPI$blockMenu.useStandardNodeWidth) !== null && _editorAPI$blockMenu$ !== void 0 ? _editorAPI$blockMenu$ : false);
|
|
55
|
-
var _useSharedPluginState = (0,
|
|
56
|
+
var _useSharedPluginState = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(editorAPI, ['maxContentSize', 'primaryToolbar', 'editorViewMode'], function (states) {
|
|
56
57
|
var _states$maxContentSiz, _states$primaryToolba, _states$editorViewMod;
|
|
57
58
|
return {
|
|
58
59
|
maxContentSizeReached: !!((_states$maxContentSiz = states.maxContentSizeState) !== null && _states$maxContentSiz !== void 0 && _states$maxContentSiz.maxContentSizeReached),
|
|
@@ -64,7 +65,7 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
64
65
|
primaryToolbarComponentsState = _useSharedPluginState.primaryToolbarComponentsState,
|
|
65
66
|
maxContentSizeReached = _useSharedPluginState.maxContentSizeReached;
|
|
66
67
|
var primaryToolbarState = (0, _getPrimaryToolbarComponents.getPrimaryToolbarComponents)(editorAPI, primaryToolbarComponentsState);
|
|
67
|
-
var _useSharedPluginState2 = (0,
|
|
68
|
+
var _useSharedPluginState2 = (0, _useSharedPluginState3.useSharedPluginState)(editorAPI, ['media']),
|
|
68
69
|
mediaState = _useSharedPluginState2.mediaState;
|
|
69
70
|
var intl = (0, _reactIntl.useIntl)();
|
|
70
71
|
var editorDOMElement = props.editorDOMElement,
|
|
@@ -152,7 +153,7 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
152
153
|
}, customPrimaryToolbarComponents);
|
|
153
154
|
return /*#__PURE__*/_react.default.createElement(_WithFlash.default, {
|
|
154
155
|
animate: maxContentSizeReached
|
|
155
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
156
|
+
}, /*#__PURE__*/_react.default.createElement(_WidthProvider.WidthProvider, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
156
157
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic minHeight/maxHeight from props
|
|
157
158
|
style: wrapperStyle
|
|
158
159
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -164,7 +165,7 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
164
165
|
useStickyToolbar: useStickyToolbar,
|
|
165
166
|
twoLineEditorToolbar: isTwoLineToolbarEnabled,
|
|
166
167
|
isNewToolbarEnabled: isToolbarAIFCEnabled
|
|
167
|
-
}, isToolbarAIFCEnabled ? /*#__PURE__*/_react.default.createElement(
|
|
168
|
+
}, isToolbarAIFCEnabled ? /*#__PURE__*/_react.default.createElement(_ToolbarArrowKeyNavigationProvider.ToolbarArrowKeyNavigationProvider, {
|
|
168
169
|
editorView: editorView,
|
|
169
170
|
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
170
171
|
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
@@ -180,7 +181,7 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
180
181
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
181
182
|
popupsScrollableElement: popupsScrollableElement,
|
|
182
183
|
popupsMountPoint: popupsMountPoint
|
|
183
|
-
}), customPrimaryToolbarComponents ? customToolbarSlot : null) : /*#__PURE__*/_react.default.createElement(
|
|
184
|
+
}), customPrimaryToolbarComponents ? customToolbarSlot : null) : /*#__PURE__*/_react.default.createElement(_ToolbarArrowKeyNavigationProvider.ToolbarArrowKeyNavigationProvider, {
|
|
184
185
|
editorView: editorView,
|
|
185
186
|
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
186
187
|
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
@@ -214,7 +215,7 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
214
215
|
}), customToolbarSlot)), /*#__PURE__*/_react.default.createElement(_ClickAreaBlock.default, {
|
|
215
216
|
editorView: editorView,
|
|
216
217
|
editorDisabled: disabled
|
|
217
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
218
|
+
}, /*#__PURE__*/_react.default.createElement(_WidthProvider.WidthConsumer, null, function (_ref) {
|
|
218
219
|
var width = _ref.width;
|
|
219
220
|
return /*#__PURE__*/_react.default.createElement(_EditorContentContainer.default, {
|
|
220
221
|
ref: containerElement,
|
|
@@ -222,7 +223,7 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
222
223
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
223
224
|
,
|
|
224
225
|
className: (0, _runtime.ax)([maxHeight && commentEditorCompiledStyles.contentAreaMaxHeight, (0, _classnames.default)('ak-editor-content-area', {
|
|
225
|
-
'less-margin': width <
|
|
226
|
+
'less-margin': width < _constants.akEditorMobileBreakoutPoint
|
|
226
227
|
})]),
|
|
227
228
|
featureFlags: featureFlags,
|
|
228
229
|
viewMode: editorViewMode,
|
|
@@ -12,9 +12,9 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
14
|
var _reactIntl = require("react-intl");
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
15
|
+
var _fullPage = require("@atlaskit/editor-common/messages/full-page");
|
|
16
|
+
var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useSharedPluginStateWithSelector");
|
|
17
|
+
var _constants = require("@atlaskit/editor-shared-styles/constants");
|
|
18
18
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
19
19
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
20
20
|
var _ClickAreaBlock = require("../../Addon/ClickAreaBlock");
|
|
@@ -35,7 +35,7 @@ var akLayoutGutterOffset = 12;
|
|
|
35
35
|
var SWOOP_ANIMATION = "0.5s ".concat(akEditorSwoopCubicBezier);
|
|
36
36
|
var AK_NESTED_DND_GUTTER_OFFSET = 8;
|
|
37
37
|
var getTotalPadding = function getTotalPadding() {
|
|
38
|
-
return (0,
|
|
38
|
+
return (0, _constants.akEditorGutterPaddingDynamic)() * 2;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
// Isolates the scroll container's layout and size from the rest of the page.
|
|
@@ -74,7 +74,7 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
74
74
|
var contentAreaRef = (0, _react.useRef)(null);
|
|
75
75
|
var containerRef = (0, _react.useRef)(null);
|
|
76
76
|
var allowScrollGutter = (_props$editorAPI = props.editorAPI) === null || _props$editorAPI === void 0 || (_props$editorAPI = _props$editorAPI.base) === null || _props$editorAPI === void 0 || (_props$editorAPI = _props$editorAPI.sharedState.currentState()) === null || _props$editorAPI === void 0 ? void 0 : _props$editorAPI.allowScrollGutter;
|
|
77
|
-
var contentAreaMaxWidth = getTotalPadding() + (!fullWidthMode ? maxWidthMode ? akEditorUltraWideLayoutWidth :
|
|
77
|
+
var contentAreaMaxWidth = getTotalPadding() + (!fullWidthMode ? maxWidthMode ? akEditorUltraWideLayoutWidth : _constants.akEditorDefaultLayoutWidth : akEditorFullWidthLayoutWidth);
|
|
78
78
|
|
|
79
79
|
// Get useStandardNodeWidth from block menu plugin shared state
|
|
80
80
|
// Only access editorAPI when the experiment is enabled to avoid performance impact
|
|
@@ -92,11 +92,11 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
}, []);
|
|
95
|
-
var markdownPluginCurrentView = (0,
|
|
95
|
+
var markdownPluginCurrentView = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(props.editorAPI, ['markdownMode'], function (states) {
|
|
96
96
|
var _states$markdownModeS;
|
|
97
97
|
return (_states$markdownModeS = states.markdownModeState) === null || _states$markdownModeS === void 0 ? void 0 : _states$markdownModeS.view;
|
|
98
98
|
});
|
|
99
|
-
var markdownPluginCurrentIsMarkdownMode = (0,
|
|
99
|
+
var markdownPluginCurrentIsMarkdownMode = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(props.editorAPI, ['markdownMode'], function (states) {
|
|
100
100
|
var _states$markdownModeS2;
|
|
101
101
|
return (_states$markdownModeS2 = states.markdownModeState) === null || _states$markdownModeS2 === void 0 ? void 0 : _states$markdownModeS2.isMarkdownMode;
|
|
102
102
|
});
|
|
@@ -130,7 +130,7 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
130
130
|
compiledStyles.editorContentAreaContainerStyleExcludeCodeBlockNew, compiledStyles.editorContentAreaContainerNestedDndStyle, "ak-editor-content-area-region"]),
|
|
131
131
|
"data-editor-editable-content": true,
|
|
132
132
|
role: "region",
|
|
133
|
-
"aria-label": props.intl.formatMessage(
|
|
133
|
+
"aria-label": props.intl.formatMessage(_fullPage.messages.editableContentLabel),
|
|
134
134
|
ref: contentAreaRef,
|
|
135
135
|
"data-vc": "editor-content-area-region"
|
|
136
136
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.RenderTracking = RenderTracking;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
10
|
-
var
|
|
10
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
11
11
|
var _useComponentRenderTracking = require("@atlaskit/editor-common/use-component-render-tracking");
|
|
12
12
|
function RenderTracking(props) {
|
|
13
13
|
var debouncedHandleAnalyticsEvent = (0, _react.useMemo)(function () {
|
|
@@ -28,7 +28,7 @@ function RenderTracking(props) {
|
|
|
28
28
|
count: renderCount,
|
|
29
29
|
propsDifference: propsDifference
|
|
30
30
|
},
|
|
31
|
-
eventType:
|
|
31
|
+
eventType: _enums.EVENT_TYPE.OPERATIONAL
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
},
|
|
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.name = void 0;
|
|
7
7
|
var name = exports.name = "@atlaskit/editor-core";
|
|
8
8
|
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
9
|
-
var version = exports.version = "238.0.
|
|
9
|
+
var version = exports.version = "238.0.2";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Fragment, memo } from 'react';
|
|
2
|
-
import { ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
3
|
import { usePortalProvider } from '@atlaskit/editor-common/usePortalProvider';
|
|
4
4
|
import { editorFontSize } from '@atlaskit/editor-shared-styles/constants';
|
|
5
5
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
3
4
|
const key = new PluginKey('editorStateNotificationPlugin');
|
|
4
5
|
export const createEditorStateNotificationPlugin = (onEditorStateUpdated, onEditorViewStateUpdatedCallbacks) => {
|
|
5
6
|
const transactions = [];
|
|
@@ -12,7 +13,11 @@ export const createEditorStateNotificationPlugin = (onEditorStateUpdated, onEdit
|
|
|
12
13
|
};
|
|
13
14
|
},
|
|
14
15
|
apply(tr) {
|
|
15
|
-
|
|
16
|
+
if (!isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
|
|
17
|
+
// Dead accumulator: nothing reads it, so it pins every transaction for the
|
|
18
|
+
// editor's lifetime. Delete it when the experiment ships.
|
|
19
|
+
transactions.push(tr);
|
|
20
|
+
}
|
|
16
21
|
return {
|
|
17
22
|
latestTransaction: tr
|
|
18
23
|
};
|
|
@@ -6,11 +6,12 @@ import classnames from 'classnames';
|
|
|
6
6
|
import { useIntl } from 'react-intl';
|
|
7
7
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
8
8
|
import Button from '@atlaskit/button/default/button';
|
|
9
|
-
import { useSharedPluginState, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
10
9
|
import messages from '@atlaskit/editor-common/messages';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
10
|
+
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu/ToolbarArrowKeyNavigationProvider';
|
|
11
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/useSharedPluginState';
|
|
12
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
13
|
+
import { WidthConsumer, WidthProvider } from '@atlaskit/editor-common/WidthProvider';
|
|
14
|
+
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles/constants';
|
|
14
15
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
15
16
|
// Ignored via go/ees005
|
|
16
17
|
// eslint-disable-next-line import/no-named-as-default
|
|
@@ -4,9 +4,9 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { useImperativeHandle, useRef } from 'react';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
6
|
import { injectIntl } from 'react-intl';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { akEditorGutterPaddingDynamic, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
7
|
+
import { messages } from '@atlaskit/editor-common/messages/full-page';
|
|
8
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
9
|
+
import { akEditorGutterPaddingDynamic, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles/constants';
|
|
10
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
11
11
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
12
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import debounce from 'lodash/debounce';
|
|
3
|
-
import { EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
4
|
import { useComponentRenderTracking } from '@atlaskit/editor-common/use-component-render-tracking';
|
|
5
5
|
export function RenderTracking(props) {
|
|
6
6
|
const debouncedHandleAnalyticsEvent = useMemo(() => debounce(props.handleAnalyticsEvent, 500), [props.handleAnalyticsEvent]);
|
|
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
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; }
|
|
4
4
|
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) { _defineProperty(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; }
|
|
5
5
|
import React, { Fragment, memo } from 'react';
|
|
6
|
-
import { ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
6
|
+
import { ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics/types/enums';
|
|
7
7
|
import { usePortalProvider } from '@atlaskit/editor-common/usePortalProvider';
|
|
8
8
|
import { editorFontSize } from '@atlaskit/editor-shared-styles/constants';
|
|
9
9
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
3
4
|
var key = new PluginKey('editorStateNotificationPlugin');
|
|
4
5
|
export var createEditorStateNotificationPlugin = function createEditorStateNotificationPlugin(onEditorStateUpdated, onEditorViewStateUpdatedCallbacks) {
|
|
5
6
|
var transactions = [];
|
|
@@ -12,7 +13,11 @@ export var createEditorStateNotificationPlugin = function createEditorStateNotif
|
|
|
12
13
|
};
|
|
13
14
|
},
|
|
14
15
|
apply: function apply(tr) {
|
|
15
|
-
|
|
16
|
+
if (!isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
|
|
17
|
+
// Dead accumulator: nothing reads it, so it pins every transaction for the
|
|
18
|
+
// editor's lifetime. Delete it when the experiment ships.
|
|
19
|
+
transactions.push(tr);
|
|
20
|
+
}
|
|
16
21
|
return {
|
|
17
22
|
latestTransaction: tr
|
|
18
23
|
};
|
|
@@ -10,11 +10,12 @@ import classnames from 'classnames';
|
|
|
10
10
|
import { useIntl } from 'react-intl';
|
|
11
11
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
12
12
|
import Button from '@atlaskit/button/default/button';
|
|
13
|
-
import { useSharedPluginState, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
14
13
|
import messages from '@atlaskit/editor-common/messages';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
14
|
+
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu/ToolbarArrowKeyNavigationProvider';
|
|
15
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/useSharedPluginState';
|
|
16
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
17
|
+
import { WidthConsumer, WidthProvider } from '@atlaskit/editor-common/WidthProvider';
|
|
18
|
+
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles/constants';
|
|
18
19
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
19
20
|
// Ignored via go/ees005
|
|
20
21
|
// eslint-disable-next-line import/no-named-as-default
|
|
@@ -4,9 +4,9 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { useImperativeHandle, useRef } from 'react';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
6
|
import { injectIntl } from 'react-intl';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { akEditorGutterPaddingDynamic, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
7
|
+
import { messages } from '@atlaskit/editor-common/messages/full-page';
|
|
8
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
9
|
+
import { akEditorGutterPaddingDynamic, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles/constants';
|
|
10
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
11
11
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
12
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import debounce from 'lodash/debounce';
|
|
3
|
-
import { EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
4
|
import { useComponentRenderTracking } from '@atlaskit/editor-common/use-component-render-tracking';
|
|
5
5
|
export function RenderTracking(props) {
|
|
6
6
|
var debouncedHandleAnalyticsEvent = useMemo(function () {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MemoExoticComponent } from 'react';
|
|
3
3
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
4
|
-
import type { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import type { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics/types/events';
|
|
5
5
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
6
6
|
import type { AllEditorPresetPluginTypes, EditorPresetBuilder } from '@atlaskit/editor-common/preset/builder';
|
|
7
7
|
import type ProviderFactory from '@atlaskit/editor-common/provider-factory/provider-factory';
|
|
@@ -10,7 +10,7 @@ import type { EmojiPlugin } from '@atlaskit/editor-plugins/emoji';
|
|
|
10
10
|
import type { MediaPlugin } from '@atlaskit/editor-plugins/media';
|
|
11
11
|
import type { MentionsPlugin } from '@atlaskit/editor-plugins/mentions';
|
|
12
12
|
import type { TasksAndDecisionsPlugin } from '@atlaskit/editor-plugins/tasks-and-decisions';
|
|
13
|
-
import type { EmojiProvider } from '@atlaskit/emoji';
|
|
13
|
+
import type { EmojiProvider } from '@atlaskit/emoji/types';
|
|
14
14
|
import type { MentionProvider } from '@atlaskit/mention/types';
|
|
15
15
|
import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
|
|
16
16
|
interface UseProvidersProps {
|
|
@@ -38,7 +38,7 @@ import type { Node, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
|
38
38
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
39
39
|
import type { SyncedBlockProvider } from '@atlaskit/editor-synced-block-provider/syncBlockProvider';
|
|
40
40
|
import type { MentionProvider } from '@atlaskit/mention/types';
|
|
41
|
-
import type { TaskDecisionProvider } from '@atlaskit/task-decision';
|
|
41
|
+
import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
|
|
42
42
|
import type EditorActions from '../actions';
|
|
43
43
|
import type { EditorOnChangeHandler } from './editor-onchange';
|
|
44
44
|
import type { ExtensionConfig } from './extension-config';
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
7
|
-
import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu';
|
|
6
|
+
import type { OptionalPlugin } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
7
|
+
import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu/blockMenuPluginType';
|
|
8
8
|
import type { MaxContentSizePlugin } from '@atlaskit/editor-plugins/max-content-size';
|
|
9
9
|
import type { MediaPlugin } from '@atlaskit/editor-plugins/media';
|
|
10
10
|
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugins/primary-toolbar';
|
|
@@ -5,10 +5,13 @@
|
|
|
5
5
|
import type { ReactElement } from 'react';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
8
|
-
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
8
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics/types/dispatch-analytics-event';
|
|
9
9
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
10
|
-
import type
|
|
11
|
-
import type { EditorAppearance, EditorContentMode
|
|
10
|
+
import type ProviderFactory from '@atlaskit/editor-common/provider-factory/provider-factory';
|
|
11
|
+
import type { EditorAppearance, EditorContentMode } from '@atlaskit/editor-common/types/editor-appearance';
|
|
12
|
+
import type { FeatureFlags } from '@atlaskit/editor-common/types/feature-flags';
|
|
13
|
+
import type { OptionalPlugin, PublicPluginAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
14
|
+
import type { ReactHookFactory, UIComponentFactory } from '@atlaskit/editor-common/types/ui-components';
|
|
12
15
|
import type { BasePlugin } from '@atlaskit/editor-plugins/base';
|
|
13
16
|
import type { BlockMenuPlugin } from '@atlaskit/editor-plugins/block-menu';
|
|
14
17
|
import type { ContextPanelPlugin } from '@atlaskit/editor-plugins/context-panel';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
3
|
-
import type { MenuItem } from '@atlaskit/editor-common/extensions';
|
|
4
|
-
import type { PublicPluginAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { MenuItem } from '@atlaskit/editor-common/extensions/types/utils';
|
|
4
|
+
import type { PublicPluginAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
5
5
|
import type { ExtensionPlugin } from '@atlaskit/editor-plugins/extension';
|
|
6
6
|
import type EditorActions from '../../actions';
|
|
7
7
|
export declare const QuickInsertSkillMenuItem: ({ apiRef, createAnalyticsEvent, editorActions, item, onInsert, }: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ACTION, ACTION_SUBJECT
|
|
1
|
+
import type { ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
|
+
import type { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics/types/events';
|
|
2
3
|
type RenderActions = ACTION.RE_RENDERED;
|
|
3
4
|
type RenderActionSubjects = ACTION_SUBJECT.EDITOR | ACTION_SUBJECT.REACT_EDITOR_VIEW;
|
|
4
5
|
export type RenderTrackingProps<ComponentProps> = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "238.0.
|
|
3
|
+
"version": "238.0.3",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -72,12 +72,12 @@
|
|
|
72
72
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
73
73
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
74
74
|
"@atlaskit/platform-feature-flags-react": "^1.2.0",
|
|
75
|
-
"@atlaskit/popup": "^
|
|
75
|
+
"@atlaskit/popup": "^10.0.0",
|
|
76
76
|
"@atlaskit/primitives": "^22.6.0",
|
|
77
77
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
78
78
|
"@atlaskit/react-ufo": "^8.1.0",
|
|
79
79
|
"@atlaskit/task-decision": "^21.12.0",
|
|
80
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
80
|
+
"@atlaskit/tmp-editor-statsig": "^241.0.0",
|
|
81
81
|
"@atlaskit/tokens": "^20.6.0",
|
|
82
82
|
"@atlaskit/tooltip": "^24.4.0",
|
|
83
83
|
"@atlaskit/width-detector": "^7.2.0",
|
|
@@ -106,6 +106,7 @@
|
|
|
106
106
|
"devDependencies": {
|
|
107
107
|
"@af/editor-examples-helpers": "workspace:^",
|
|
108
108
|
"@af/editor-libra": "workspace:^",
|
|
109
|
+
"@af/integration-testing": "workspace:^",
|
|
109
110
|
"@af/suppress-react-warnings": "workspace:^",
|
|
110
111
|
"@af/visual-regression": "workspace:^",
|
|
111
112
|
"@atlaskit/adf-utils": "^20.9.0",
|
|
@@ -116,7 +117,7 @@
|
|
|
116
117
|
"@atlaskit/docs": "^12.3.0",
|
|
117
118
|
"@atlaskit/drawer": "^14.3.0",
|
|
118
119
|
"@atlaskit/editor-plugin-alignment": "^29.0.0",
|
|
119
|
-
"@atlaskit/editor-plugin-annotation": "^28.
|
|
120
|
+
"@atlaskit/editor-plugin-annotation": "^28.1.0",
|
|
120
121
|
"@atlaskit/editor-plugin-base": "^29.0.0",
|
|
121
122
|
"@atlaskit/editor-plugin-card": "^34.0.0",
|
|
122
123
|
"@atlaskit/editor-plugin-code-block-advanced": "^28.0.0",
|
|
@@ -127,11 +128,13 @@
|
|
|
127
128
|
"@atlaskit/editor-plugin-grid": "^28.0.0",
|
|
128
129
|
"@atlaskit/editor-plugin-guideline": "^28.0.0",
|
|
129
130
|
"@atlaskit/editor-plugin-highlight": "^28.0.0",
|
|
131
|
+
"@atlaskit/editor-plugin-hyperlink": "^30.0.0",
|
|
130
132
|
"@atlaskit/editor-plugin-insert-block": "^29.0.0",
|
|
131
133
|
"@atlaskit/editor-plugin-layout": "^29.0.0",
|
|
132
134
|
"@atlaskit/editor-plugin-limited-mode": "^25.0.0",
|
|
133
135
|
"@atlaskit/editor-plugin-list": "^30.0.0",
|
|
134
136
|
"@atlaskit/editor-plugin-media": "^30.0.0",
|
|
137
|
+
"@atlaskit/editor-plugin-media-insert": "^46.0.0",
|
|
135
138
|
"@atlaskit/editor-plugin-paste": "^29.0.0",
|
|
136
139
|
"@atlaskit/editor-plugin-selection-marker": "^28.0.0",
|
|
137
140
|
"@atlaskit/editor-plugin-show-diff": "^26.0.0",
|
|
@@ -139,10 +142,13 @@
|
|
|
139
142
|
"@atlaskit/editor-plugin-table": "^40.0.0",
|
|
140
143
|
"@atlaskit/editor-plugin-tasks-and-decisions": "^31.0.0",
|
|
141
144
|
"@atlaskit/editor-plugin-text-color": "^28.0.0",
|
|
145
|
+
"@atlaskit/editor-plugin-text-formatting": "^28.0.0",
|
|
146
|
+
"@atlaskit/editor-plugin-toolbar": "^25.0.0",
|
|
142
147
|
"@atlaskit/editor-plugin-toolbar-lists-indentation": "^29.0.0",
|
|
143
148
|
"@atlaskit/editor-plugin-track-changes": "^27.0.0",
|
|
144
149
|
"@atlaskit/editor-synced-block-provider": "^24.0.0",
|
|
145
150
|
"@atlaskit/editor-synced-block-renderer": "^26.0.0",
|
|
151
|
+
"@atlaskit/editor-tables": "^3.2.0",
|
|
146
152
|
"@atlaskit/editor-test-helpers": "workspace:^",
|
|
147
153
|
"@atlaskit/form": "^18.2.0",
|
|
148
154
|
"@atlaskit/link-provider": "^6.0.0",
|
|
@@ -153,11 +159,11 @@
|
|
|
153
159
|
"@atlaskit/media-picker": "^73.2.0",
|
|
154
160
|
"@atlaskit/media-test-helpers": "^43.0.0",
|
|
155
161
|
"@atlaskit/media-ui": "^31.3.0",
|
|
156
|
-
"@atlaskit/modal-dialog": "^17.
|
|
162
|
+
"@atlaskit/modal-dialog": "^17.1.0",
|
|
157
163
|
"@atlaskit/navigation-system": "^11.3.0",
|
|
158
164
|
"@atlaskit/popper": "^9.4.0",
|
|
159
165
|
"@atlaskit/portal": "^7.0.0",
|
|
160
|
-
"@atlaskit/profilecard": "^27.
|
|
166
|
+
"@atlaskit/profilecard": "^27.2.0",
|
|
161
167
|
"@atlaskit/radio": "^10.2.0",
|
|
162
168
|
"@atlaskit/renderer": "^151.0.0",
|
|
163
169
|
"@atlaskit/section-message": "^10.2.0",
|
|
@@ -172,12 +178,13 @@
|
|
|
172
178
|
"@atlassian/adf-schema-json": "^1.35.0",
|
|
173
179
|
"@atlassian/editor-rovo-bridge": "^27.0.0",
|
|
174
180
|
"@atlassian/experiment-test-utils": "^0.2.0",
|
|
181
|
+
"@atlassian/feature-flags-storybook-utils": "^0.5.0",
|
|
175
182
|
"@atlassian/feature-flags-test-utils": "^1.3.0",
|
|
176
183
|
"@atlassian/search-client": "^3.9.0",
|
|
177
184
|
"@atlassian/search-provider": "^29.0.0",
|
|
178
185
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
179
186
|
"@atlassian/testing-library": "^0.12.0",
|
|
180
|
-
"@atlassian/user-profile-card": "^1.
|
|
187
|
+
"@atlassian/user-profile-card": "^1.46.0",
|
|
181
188
|
"@emotion/jest": "^11.8.0",
|
|
182
189
|
"@testing-library/react": "^16.3.0",
|
|
183
190
|
"@types/diff": "^5.0.2",
|