@atlaskit/editor-core 197.5.2 → 197.5.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 +8 -0
- package/dist/cjs/composable-editor/editor-internal.js +1 -15
- package/dist/cjs/create-editor/ReactEditorView.js +0 -5
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/editor-internal.js +1 -17
- package/dist/es2019/create-editor/ReactEditorView.js +0 -5
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/editor-internal.js +1 -15
- package/dist/esm/create-editor/ReactEditorView.js +0 -5
- package/dist/esm/version-wrapper.js +1 -1
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 197.5.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#138334](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/138334)
|
|
8
|
+
[`5bc7950824d2d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5bc7950824d2d) -
|
|
9
|
+
Removing dangerous and deprecated internal API
|
|
10
|
+
|
|
3
11
|
## 197.5.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -12,7 +12,6 @@ var _react = require("react");
|
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
13
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
14
14
|
var _portal = require("@atlaskit/editor-common/portal");
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _ErrorBoundary = _interopRequireDefault(require("../create-editor/ErrorBoundary"));
|
|
17
16
|
var _featureFlagsFromProps = require("../create-editor/feature-flags-from-props");
|
|
18
17
|
var _ReactEditorView = _interopRequireDefault(require("../create-editor/ReactEditorView"));
|
|
@@ -51,16 +50,6 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
|
|
|
51
50
|
onEditorDestroyed = _ref.onEditorDestroyed,
|
|
52
51
|
preset = _ref.preset,
|
|
53
52
|
AppearanceComponent = _ref.AppearanceComponent;
|
|
54
|
-
var setEditorApi = (0, _react.useCallback)(
|
|
55
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
56
|
-
function (api) {
|
|
57
|
-
if (!(0, _platformFeatureFlags.fg)('platform_editor_remove_editor_actions_workaround')) {
|
|
58
|
-
// This is an workaround to unblock Editor Lego Decoupling project, if you have questions ping us #cc-editor-lego
|
|
59
|
-
// We may clean up this code when EditorActions deprecation process starts
|
|
60
|
-
// @ts-expect-error 2339: Property '__EDITOR_INTERNALS_DO_NOT_USE__API' does not exist on type 'EditorActions<any>'.
|
|
61
|
-
editorActions.__EDITOR_INTERNALS_DO_NOT_USE__API = api;
|
|
62
|
-
}
|
|
63
|
-
}, [editorActions]);
|
|
64
53
|
var overriddenEditorProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
65
54
|
onSave: props.onSave ? handleSave : undefined,
|
|
66
55
|
// noop all analytic events, even if a handler is still passed.
|
|
@@ -104,7 +93,6 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
|
|
|
104
93
|
onEditorDestroyed: onEditorDestroyed,
|
|
105
94
|
disabled: props.disabled,
|
|
106
95
|
preset: preset,
|
|
107
|
-
setEditorApi: setEditorApi,
|
|
108
96
|
render: function render(_ref2) {
|
|
109
97
|
var _props$featureFlags, _props$featureFlags2;
|
|
110
98
|
var editor = _ref2.editor,
|
|
@@ -155,7 +143,6 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
|
|
|
155
143
|
function ReactEditorViewContextWrapper(props) {
|
|
156
144
|
var _props$editorProps$me, _props$editorProps$li;
|
|
157
145
|
var setInternalEditorAPI = (0, _context.useSetPresetContext)();
|
|
158
|
-
var setExternalEditorAPI = props.setEditorApi;
|
|
159
146
|
|
|
160
147
|
/**
|
|
161
148
|
* We use the context to retrieve the editorAPI
|
|
@@ -169,8 +156,7 @@ function ReactEditorViewContextWrapper(props) {
|
|
|
169
156
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
170
157
|
function (api) {
|
|
171
158
|
setInternalEditorAPI === null || setInternalEditorAPI === void 0 || setInternalEditorAPI(api);
|
|
172
|
-
|
|
173
|
-
}, [setInternalEditorAPI, setExternalEditorAPI]);
|
|
159
|
+
}, [setInternalEditorAPI]);
|
|
174
160
|
|
|
175
161
|
// TODO: Remove these when we deprecate these props from editor-props - smartLinks is unfortunately still used in some places, we can sidestep this problem if we move everyone across to ComposableEditor and deprecate Editor
|
|
176
162
|
var UNSAFE_cards = props.editorProps.UNSAFE_cards;
|
|
@@ -30,7 +30,6 @@ var _ufo = require("@atlaskit/editor-common/ufo");
|
|
|
30
30
|
var _analytics2 = require("@atlaskit/editor-common/utils/analytics");
|
|
31
31
|
var _state2 = require("@atlaskit/editor-prosemirror/state");
|
|
32
32
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
33
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
34
33
|
var _eventDispatcher = require("../event-dispatcher");
|
|
35
34
|
var _context = require("../presets/context");
|
|
36
35
|
var _findChangedNodesFromTransaction = require("../utils/findChangedNodesFromTransaction");
|
|
@@ -558,10 +557,6 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
|
|
|
558
557
|
});
|
|
559
558
|
var _api = _this.pluginInjectionAPI.api();
|
|
560
559
|
(_props$setEditorApi = props.setEditorApi) === null || _props$setEditorApi === void 0 || _props$setEditorApi.call(props, _api);
|
|
561
|
-
if (props.editorProps.editorActions && !(0, _platformFeatureFlags.fg)('platform_editor_remove_editor_actions_workaround')) {
|
|
562
|
-
// @ts-expect-error
|
|
563
|
-
props.editorProps.editorActions.__EDITOR_INTERNALS_DO_NOT_USE__API = _api;
|
|
564
|
-
}
|
|
565
560
|
_this.eventDispatcher = new _eventDispatcher.EventDispatcher();
|
|
566
561
|
_this.dispatch = (0, _eventDispatcher.createDispatch)(_this.eventDispatcher);
|
|
567
562
|
_this.errorReporter = (0, _createEditor.createErrorReporter)(props.editorProps.errorReporterHandler);
|
|
@@ -9,7 +9,6 @@ import { Fragment, memo, useCallback } from 'react';
|
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
11
11
|
import { usePortalProvider } from '@atlaskit/editor-common/portal';
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import ErrorBoundary from '../create-editor/ErrorBoundary';
|
|
14
13
|
import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
|
|
15
14
|
import ReactEditorView from '../create-editor/ReactEditorView';
|
|
@@ -44,16 +43,6 @@ export const EditorInternal = /*#__PURE__*/memo(({
|
|
|
44
43
|
AppearanceComponent
|
|
45
44
|
}) => {
|
|
46
45
|
var _props$performanceTra, _props$performanceTra2, _props$performanceTra3, _props$performanceTra4;
|
|
47
|
-
const setEditorApi = useCallback(
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
|
-
api => {
|
|
50
|
-
if (!fg('platform_editor_remove_editor_actions_workaround')) {
|
|
51
|
-
// This is an workaround to unblock Editor Lego Decoupling project, if you have questions ping us #cc-editor-lego
|
|
52
|
-
// We may clean up this code when EditorActions deprecation process starts
|
|
53
|
-
// @ts-expect-error 2339: Property '__EDITOR_INTERNALS_DO_NOT_USE__API' does not exist on type 'EditorActions<any>'.
|
|
54
|
-
editorActions.__EDITOR_INTERNALS_DO_NOT_USE__API = api;
|
|
55
|
-
}
|
|
56
|
-
}, [editorActions]);
|
|
57
46
|
const overriddenEditorProps = {
|
|
58
47
|
...props,
|
|
59
48
|
onSave: props.onSave ? handleSave : undefined,
|
|
@@ -95,7 +84,6 @@ export const EditorInternal = /*#__PURE__*/memo(({
|
|
|
95
84
|
onEditorDestroyed: onEditorDestroyed,
|
|
96
85
|
disabled: props.disabled,
|
|
97
86
|
preset: preset,
|
|
98
|
-
setEditorApi: setEditorApi,
|
|
99
87
|
render: ({
|
|
100
88
|
editor,
|
|
101
89
|
view,
|
|
@@ -147,9 +135,6 @@ export const EditorInternal = /*#__PURE__*/memo(({
|
|
|
147
135
|
function ReactEditorViewContextWrapper(props) {
|
|
148
136
|
var _props$editorProps$me, _props$editorProps$li, _props$editorProps$li2;
|
|
149
137
|
const setInternalEditorAPI = useSetPresetContext();
|
|
150
|
-
const {
|
|
151
|
-
setEditorApi: setExternalEditorAPI
|
|
152
|
-
} = props;
|
|
153
138
|
|
|
154
139
|
/**
|
|
155
140
|
* We use the context to retrieve the editorAPI
|
|
@@ -163,8 +148,7 @@ function ReactEditorViewContextWrapper(props) {
|
|
|
163
148
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
164
149
|
api => {
|
|
165
150
|
setInternalEditorAPI === null || setInternalEditorAPI === void 0 ? void 0 : setInternalEditorAPI(api);
|
|
166
|
-
|
|
167
|
-
}, [setInternalEditorAPI, setExternalEditorAPI]);
|
|
151
|
+
}, [setInternalEditorAPI]);
|
|
168
152
|
|
|
169
153
|
// TODO: Remove these when we deprecate these props from editor-props - smartLinks is unfortunately still used in some places, we can sidestep this problem if we move everyone across to ComposableEditor and deprecate Editor
|
|
170
154
|
const UNSAFE_cards = props.editorProps.UNSAFE_cards;
|
|
@@ -16,7 +16,6 @@ import { EditorExperience, ExperienceStore, RELIABILITY_INTERVAL } from '@atlask
|
|
|
16
16
|
import { analyticsEventKey, getAnalyticsEventSeverity } from '@atlaskit/editor-common/utils/analytics';
|
|
17
17
|
import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
18
18
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
19
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
20
19
|
import { createDispatch, EventDispatcher } from '../event-dispatcher';
|
|
21
20
|
import { EditorAPIContext } from '../presets/context';
|
|
22
21
|
import { findChangedNodesFromTransaction } from '../utils/findChangedNodesFromTransaction';
|
|
@@ -557,10 +556,6 @@ export class ReactEditorView extends React.Component {
|
|
|
557
556
|
});
|
|
558
557
|
const _api = this.pluginInjectionAPI.api();
|
|
559
558
|
(_props$setEditorApi = props.setEditorApi) === null || _props$setEditorApi === void 0 ? void 0 : _props$setEditorApi.call(props, _api);
|
|
560
|
-
if (props.editorProps.editorActions && !fg('platform_editor_remove_editor_actions_workaround')) {
|
|
561
|
-
// @ts-expect-error
|
|
562
|
-
props.editorProps.editorActions.__EDITOR_INTERNALS_DO_NOT_USE__API = _api;
|
|
563
|
-
}
|
|
564
559
|
this.eventDispatcher = new EventDispatcher();
|
|
565
560
|
this.dispatch = createDispatch(this.eventDispatcher);
|
|
566
561
|
this.errorReporter = createErrorReporter(props.editorProps.errorReporterHandler);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "197.5.
|
|
2
|
+
export const version = "197.5.3";
|
|
@@ -13,7 +13,6 @@ import { Fragment, memo, useCallback } from 'react';
|
|
|
13
13
|
import { css, jsx } from '@emotion/react';
|
|
14
14
|
import { ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
15
15
|
import { usePortalProvider } from '@atlaskit/editor-common/portal';
|
|
16
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
16
|
import ErrorBoundary from '../create-editor/ErrorBoundary';
|
|
18
17
|
import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
|
|
19
18
|
import ReactEditorView from '../create-editor/ReactEditorView';
|
|
@@ -47,16 +46,6 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
47
46
|
onEditorDestroyed = _ref.onEditorDestroyed,
|
|
48
47
|
preset = _ref.preset,
|
|
49
48
|
AppearanceComponent = _ref.AppearanceComponent;
|
|
50
|
-
var setEditorApi = useCallback(
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
|
-
function (api) {
|
|
53
|
-
if (!fg('platform_editor_remove_editor_actions_workaround')) {
|
|
54
|
-
// This is an workaround to unblock Editor Lego Decoupling project, if you have questions ping us #cc-editor-lego
|
|
55
|
-
// We may clean up this code when EditorActions deprecation process starts
|
|
56
|
-
// @ts-expect-error 2339: Property '__EDITOR_INTERNALS_DO_NOT_USE__API' does not exist on type 'EditorActions<any>'.
|
|
57
|
-
editorActions.__EDITOR_INTERNALS_DO_NOT_USE__API = api;
|
|
58
|
-
}
|
|
59
|
-
}, [editorActions]);
|
|
60
49
|
var overriddenEditorProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
61
50
|
onSave: props.onSave ? handleSave : undefined,
|
|
62
51
|
// noop all analytic events, even if a handler is still passed.
|
|
@@ -100,7 +89,6 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
100
89
|
onEditorDestroyed: onEditorDestroyed,
|
|
101
90
|
disabled: props.disabled,
|
|
102
91
|
preset: preset,
|
|
103
|
-
setEditorApi: setEditorApi,
|
|
104
92
|
render: function render(_ref2) {
|
|
105
93
|
var _props$featureFlags, _props$featureFlags2;
|
|
106
94
|
var editor = _ref2.editor,
|
|
@@ -151,7 +139,6 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
151
139
|
function ReactEditorViewContextWrapper(props) {
|
|
152
140
|
var _props$editorProps$me, _props$editorProps$li;
|
|
153
141
|
var setInternalEditorAPI = useSetPresetContext();
|
|
154
|
-
var setExternalEditorAPI = props.setEditorApi;
|
|
155
142
|
|
|
156
143
|
/**
|
|
157
144
|
* We use the context to retrieve the editorAPI
|
|
@@ -165,8 +152,7 @@ function ReactEditorViewContextWrapper(props) {
|
|
|
165
152
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
166
153
|
function (api) {
|
|
167
154
|
setInternalEditorAPI === null || setInternalEditorAPI === void 0 || setInternalEditorAPI(api);
|
|
168
|
-
|
|
169
|
-
}, [setInternalEditorAPI, setExternalEditorAPI]);
|
|
155
|
+
}, [setInternalEditorAPI]);
|
|
170
156
|
|
|
171
157
|
// TODO: Remove these when we deprecate these props from editor-props - smartLinks is unfortunately still used in some places, we can sidestep this problem if we move everyone across to ComposableEditor and deprecate Editor
|
|
172
158
|
var UNSAFE_cards = props.editorProps.UNSAFE_cards;
|
|
@@ -27,7 +27,6 @@ import { EditorExperience, ExperienceStore, RELIABILITY_INTERVAL } from '@atlask
|
|
|
27
27
|
import { analyticsEventKey, getAnalyticsEventSeverity } from '@atlaskit/editor-common/utils/analytics';
|
|
28
28
|
import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
29
29
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
30
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
31
30
|
import { createDispatch, EventDispatcher } from '../event-dispatcher';
|
|
32
31
|
import { EditorAPIContext } from '../presets/context';
|
|
33
32
|
import { findChangedNodesFromTransaction } from '../utils/findChangedNodesFromTransaction';
|
|
@@ -551,10 +550,6 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
551
550
|
});
|
|
552
551
|
var _api = _this.pluginInjectionAPI.api();
|
|
553
552
|
(_props$setEditorApi = props.setEditorApi) === null || _props$setEditorApi === void 0 || _props$setEditorApi.call(props, _api);
|
|
554
|
-
if (props.editorProps.editorActions && !fg('platform_editor_remove_editor_actions_workaround')) {
|
|
555
|
-
// @ts-expect-error
|
|
556
|
-
props.editorProps.editorActions.__EDITOR_INTERNALS_DO_NOT_USE__API = _api;
|
|
557
|
-
}
|
|
558
553
|
_this.eventDispatcher = new EventDispatcher();
|
|
559
554
|
_this.dispatch = createDispatch(_this.eventDispatcher);
|
|
560
555
|
_this.errorReporter = createErrorReporter(props.editorProps.errorReporterHandler);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "197.5.
|
|
2
|
+
export var version = "197.5.3";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "197.5.
|
|
3
|
+
"version": "197.5.3",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
50
50
|
"@atlaskit/editor-shared-styles": "^2.13.0",
|
|
51
51
|
"@atlaskit/emoji": "^67.7.0",
|
|
52
|
-
"@atlaskit/icon": "^22.
|
|
52
|
+
"@atlaskit/icon": "^22.17.0",
|
|
53
53
|
"@atlaskit/media-card": "^78.2.0",
|
|
54
54
|
"@atlaskit/mention": "^23.2.0",
|
|
55
55
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
@@ -188,9 +188,6 @@
|
|
|
188
188
|
"type": "boolean",
|
|
189
189
|
"referenceOnly": "true"
|
|
190
190
|
},
|
|
191
|
-
"platform_editor_remove_editor_actions_workaround": {
|
|
192
|
-
"type": "boolean"
|
|
193
|
-
},
|
|
194
191
|
"platform.editor.table.use-shared-state-hook": {
|
|
195
192
|
"type": "boolean",
|
|
196
193
|
"referenceOnly": true
|