@atlaskit/editor-core 197.12.0 → 197.13.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 +8 -0
- package/dist/cjs/composable-editor/editor-internal.js +19 -4
- package/dist/cjs/composable-editor/hooks/useProviders.js +2 -3
- package/dist/cjs/create-editor/ReactEditorView.js +25 -0
- package/dist/cjs/ui/Appearance/Chromeless.js +7 -3
- package/dist/cjs/ui/Appearance/Comment/Comment.js +5 -3
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +2 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/cjs/ui/ContentStyles/index.js +2 -3
- package/dist/cjs/ui/EditorContext/index.js +10 -3
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/editor-internal.js +18 -6
- package/dist/es2019/composable-editor/hooks/useProviders.js +1 -2
- package/dist/es2019/create-editor/ReactEditorView.js +28 -3
- package/dist/es2019/ui/Appearance/Chromeless.js +6 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +5 -3
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +2 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/es2019/ui/ContentStyles/index.js +2 -3
- package/dist/es2019/ui/EditorContext/index.js +10 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/editor-internal.js +21 -6
- package/dist/esm/composable-editor/hooks/useProviders.js +2 -3
- package/dist/esm/create-editor/ReactEditorView.js +25 -0
- package/dist/esm/ui/Appearance/Chromeless.js +7 -3
- package/dist/esm/ui/Appearance/Comment/Comment.js +5 -3
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +2 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/esm/ui/ContentStyles/index.js +2 -3
- package/dist/esm/ui/EditorContext/index.js +10 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/composable-editor/hooks/useProviders.d.ts +14 -1
- package/dist/types/create-editor/ReactEditorView.d.ts +1 -0
- package/dist/types/ui/Appearance/Chromeless.d.ts +5 -1
- package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +2 -0
- package/dist/types-ts4.5/composable-editor/hooks/useProviders.d.ts +14 -1
- package/dist/types-ts4.5/create-editor/ReactEditorView.d.ts +1 -0
- package/dist/types-ts4.5/ui/Appearance/Chromeless.d.ts +3 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageContentArea.d.ts +2 -0
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 197.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#144103](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/144103)
|
|
8
|
+
[`fa7b54fa5353e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fa7b54fa5353e) -
|
|
9
|
+
Remove the use of usePresetContext in editor-core
|
|
10
|
+
|
|
3
11
|
## 197.12.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -12,6 +12,7 @@ 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");
|
|
15
16
|
var _ErrorBoundary = _interopRequireDefault(require("../create-editor/ErrorBoundary"));
|
|
16
17
|
var _featureFlagsFromProps = require("../create-editor/feature-flags-from-props");
|
|
17
18
|
var _ReactEditorView = _interopRequireDefault(require("../create-editor/ReactEditorView"));
|
|
@@ -142,7 +143,15 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
|
|
|
142
143
|
});
|
|
143
144
|
function ReactEditorViewContextWrapper(props) {
|
|
144
145
|
var _props$editorProps$me, _props$editorProps$li;
|
|
146
|
+
// deprecated, unable to be FF due to hook usage
|
|
145
147
|
var setInternalEditorAPI = (0, _context.useSetPresetContext)();
|
|
148
|
+
var presetContextEditorAPI = (0, _context.usePresetContext)();
|
|
149
|
+
|
|
150
|
+
// new way of storing the editorApi when FF platform_editor_remove_use_preset_context is enabled
|
|
151
|
+
var _useState = (0, _react.useState)(undefined),
|
|
152
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
153
|
+
editorAPI = _useState2[0],
|
|
154
|
+
setEditorAPI = _useState2[1];
|
|
146
155
|
|
|
147
156
|
/**
|
|
148
157
|
* We use the context to retrieve the editorAPI
|
|
@@ -152,16 +161,21 @@ function ReactEditorViewContextWrapper(props) {
|
|
|
152
161
|
* so we should also set the value for the `EditorContext` that is used in
|
|
153
162
|
* `EditorInternal`.
|
|
154
163
|
*/
|
|
155
|
-
var
|
|
164
|
+
var setPresetContextEditorAPI = (0, _react.useCallback)(
|
|
156
165
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
157
166
|
function (api) {
|
|
158
|
-
|
|
159
|
-
|
|
167
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_remove_use_preset_context')) {
|
|
168
|
+
setEditorAPI(api);
|
|
169
|
+
} else {
|
|
170
|
+
setInternalEditorAPI === null || setInternalEditorAPI === void 0 || setInternalEditorAPI(api);
|
|
171
|
+
}
|
|
172
|
+
}, [setInternalEditorAPI, setEditorAPI]);
|
|
160
173
|
|
|
161
174
|
// 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
|
|
162
175
|
var UNSAFE_cards = props.editorProps.UNSAFE_cards;
|
|
163
176
|
var smartLinks = props.editorProps.smartLinks;
|
|
164
177
|
(0, _useProviders.useProviders)({
|
|
178
|
+
editorApi: (0, _platformFeatureFlags.fg)('platform_editor_remove_use_preset_context') ? editorAPI : presetContextEditorAPI,
|
|
165
179
|
contextIdentifierProvider: props.editorProps.contextIdentifierProvider,
|
|
166
180
|
mediaProvider: (_props$editorProps$me = props.editorProps.media) === null || _props$editorProps$me === void 0 ? void 0 : _props$editorProps$me.provider,
|
|
167
181
|
cardProvider: ((_props$editorProps$li = props.editorProps.linking) === null || _props$editorProps$li === void 0 || (_props$editorProps$li = _props$editorProps$li.smartLinks) === null || _props$editorProps$li === void 0 ? void 0 : _props$editorProps$li.provider) || smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider,
|
|
@@ -169,6 +183,7 @@ function ReactEditorViewContextWrapper(props) {
|
|
|
169
183
|
autoformattingProvider: props.editorProps.autoformattingProvider
|
|
170
184
|
});
|
|
171
185
|
return (0, _react2.jsx)(_ReactEditorView.default, (0, _extends2.default)({}, props, {
|
|
172
|
-
|
|
186
|
+
editorAPI: editorAPI,
|
|
187
|
+
setEditorApi: setPresetContextEditorAPI
|
|
173
188
|
}));
|
|
174
189
|
}
|
|
@@ -9,7 +9,6 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
|
-
var _context2 = require("../../presets/context");
|
|
13
12
|
/**
|
|
14
13
|
* This hook is used to replace the old approach of using the `providerFactory`.
|
|
15
14
|
*
|
|
@@ -19,12 +18,12 @@ var _context2 = require("../../presets/context");
|
|
|
19
18
|
* In the future ideally consumers implement this behaviour themselves.
|
|
20
19
|
*/
|
|
21
20
|
var useProviders = exports.useProviders = function useProviders(_ref) {
|
|
22
|
-
var
|
|
21
|
+
var editorApi = _ref.editorApi,
|
|
22
|
+
contextIdentifierProvider = _ref.contextIdentifierProvider,
|
|
23
23
|
mediaProvider = _ref.mediaProvider,
|
|
24
24
|
cardProvider = _ref.cardProvider,
|
|
25
25
|
emojiProvider = _ref.emojiProvider,
|
|
26
26
|
autoformattingProvider = _ref.autoformattingProvider;
|
|
27
|
-
var editorApi = (0, _context2.usePresetContext)();
|
|
28
27
|
(0, _react.useEffect)(function () {
|
|
29
28
|
function setProvider() {
|
|
30
29
|
return _setProvider.apply(this, arguments);
|
|
@@ -769,6 +769,31 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
|
|
|
769
769
|
var renderTracking = (_this$props$editorPro10 = this.props.editorProps.performanceTracking) === null || _this$props$editorPro10 === void 0 || (_this$props$editorPro10 = _this$props$editorPro10.renderTracking) === null || _this$props$editorPro10 === void 0 ? void 0 : _this$props$editorPro10.reactEditorView;
|
|
770
770
|
var renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
|
|
771
771
|
var useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
|
|
772
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_remove_use_preset_context')) {
|
|
773
|
+
var _this$props$render, _this$props$render2, _this$props;
|
|
774
|
+
return /*#__PURE__*/_react.default.createElement(_ReactEditorViewContext.default.Provider, {
|
|
775
|
+
value: {
|
|
776
|
+
editorRef: this.editorRef,
|
|
777
|
+
editorView: this.view,
|
|
778
|
+
popupsMountPoint: this.props.editorProps.popupsMountPoint
|
|
779
|
+
}
|
|
780
|
+
}, renderTrackingEnabled && /*#__PURE__*/_react.default.createElement(_RenderTracking.RenderTracking, {
|
|
781
|
+
componentProps: this.props,
|
|
782
|
+
action: _analytics.ACTION.RE_RENDERED,
|
|
783
|
+
actionSubject: _analytics.ACTION_SUBJECT.REACT_EDITOR_VIEW,
|
|
784
|
+
handleAnalyticsEvent: this.handleAnalyticsEvent,
|
|
785
|
+
useShallow: useShallow
|
|
786
|
+
}), this.props.render ? (_this$props$render = (_this$props$render2 = (_this$props = this.props).render) === null || _this$props$render2 === void 0 ? void 0 : _this$props$render2.call(_this$props, {
|
|
787
|
+
editor: this.editor,
|
|
788
|
+
view: this.view,
|
|
789
|
+
config: this.config,
|
|
790
|
+
eventDispatcher: this.eventDispatcher,
|
|
791
|
+
transformer: this.contentTransformer,
|
|
792
|
+
dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
|
|
793
|
+
editorRef: this.editorRef,
|
|
794
|
+
editorAPI: this.props.editorAPI
|
|
795
|
+
})) !== null && _this$props$render !== void 0 ? _this$props$render : this.editor : this.editor);
|
|
796
|
+
}
|
|
772
797
|
return /*#__PURE__*/_react.default.createElement(_ReactEditorViewContext.default.Provider, {
|
|
773
798
|
value: {
|
|
774
799
|
editorRef: this.editorRef,
|
|
@@ -17,6 +17,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
17
17
|
var _react2 = require("@emotion/react");
|
|
18
18
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
19
19
|
var _scrollbar = require("@atlaskit/editor-shared-styles/scrollbar");
|
|
20
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
21
|
var _ContentStyles = require("../ContentStyles");
|
|
21
22
|
var _PluginSlot = _interopRequireDefault(require("../PluginSlot"));
|
|
22
23
|
var _WithFlash = _interopRequireDefault(require("../WithFlash"));
|
|
@@ -85,6 +86,8 @@ var Editor = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
|
85
86
|
pluginHooks = _this$props.pluginHooks,
|
|
86
87
|
featureFlags = _this$props.featureFlags;
|
|
87
88
|
var maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
|
|
89
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(_this.props.editorAPI, ['editorViewMode']),
|
|
90
|
+
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
88
91
|
return (0, _react2.jsx)(_WithFlash.default, {
|
|
89
92
|
animate: maxContentSizeReached
|
|
90
93
|
}, (0, _react2.jsx)("div", {
|
|
@@ -107,7 +110,8 @@ var Editor = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
|
107
110
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
108
111
|
, {
|
|
109
112
|
className: "ak-editor-content-area",
|
|
110
|
-
featureFlags: featureFlags
|
|
113
|
+
featureFlags: featureFlags,
|
|
114
|
+
viewMode: (0, _platformFeatureFlags.fg)('platform_editor_remove_use_preset_context') ? editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode : undefined
|
|
111
115
|
}, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, (0, _react2.jsx)(_PluginSlot.default, {
|
|
112
116
|
editorView: editorView,
|
|
113
117
|
editorActions: editorActions,
|
|
@@ -142,8 +146,8 @@ var Editor = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
|
142
146
|
function RenderWithPluginState(_ref3) {
|
|
143
147
|
var renderChrome = _ref3.renderChrome,
|
|
144
148
|
editorAPI = _ref3.editorAPI;
|
|
145
|
-
var
|
|
146
|
-
maxContentSizeState =
|
|
149
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(editorAPI, ['maxContentSize']),
|
|
150
|
+
maxContentSizeState = _useSharedPluginState2.maxContentSizeState;
|
|
147
151
|
return (0, _react2.jsx)(_react.Fragment, null, renderChrome({
|
|
148
152
|
maxContentSize: maxContentSizeState
|
|
149
153
|
}));
|
|
@@ -85,10 +85,11 @@ var secondaryToolbarStyles = (0, _react2.css)({
|
|
|
85
85
|
var appearance = 'comment';
|
|
86
86
|
var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEditorWithIntl(props) {
|
|
87
87
|
var editorAPI = props.editorAPI;
|
|
88
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(editorAPI, ['media', 'maxContentSize', 'primaryToolbar']),
|
|
88
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(editorAPI, ['media', 'maxContentSize', 'primaryToolbar', 'editorViewMode']),
|
|
89
89
|
mediaState = _useSharedPluginState.mediaState,
|
|
90
90
|
maxContentSizeState = _useSharedPluginState.maxContentSizeState,
|
|
91
|
-
primaryToolbarState = _useSharedPluginState.primaryToolbarState
|
|
91
|
+
primaryToolbarState = _useSharedPluginState.primaryToolbarState,
|
|
92
|
+
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
92
93
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
93
94
|
var editorDOMElement = props.editorDOMElement,
|
|
94
95
|
editorView = props.editorView,
|
|
@@ -218,7 +219,8 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
218
219
|
className: (0, _classnames.default)('ak-editor-content-area', {
|
|
219
220
|
'less-margin': width < _editorSharedStyles.akEditorMobileBreakoutPoint
|
|
220
221
|
}),
|
|
221
|
-
featureFlags: featureFlags
|
|
222
|
+
featureFlags: featureFlags,
|
|
223
|
+
viewMode: (0, _platformFeatureFlags.fg)('platform_editor_remove_use_preset_context') ? editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode : undefined
|
|
222
224
|
}, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, (0, _react2.jsx)(_PluginSlot.default, {
|
|
223
225
|
editorView: editorView,
|
|
224
226
|
editorActions: editorActions,
|
|
@@ -118,6 +118,7 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
|
|
|
118
118
|
wrapperElement: (_wrapperElementRef$cu = wrapperElementRef === null || wrapperElementRef === void 0 ? void 0 : wrapperElementRef.current) !== null && _wrapperElementRef$cu !== void 0 ? _wrapperElementRef$cu : null,
|
|
119
119
|
pluginHooks: props.pluginHooks,
|
|
120
120
|
featureFlags: props.featureFlags,
|
|
121
|
-
isEditorToolbarHidden: isEditorToolbarHidden
|
|
121
|
+
isEditorToolbarHidden: isEditorToolbarHidden,
|
|
122
|
+
viewMode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode
|
|
122
123
|
})));
|
|
123
124
|
};
|
|
@@ -60,7 +60,8 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
60
60
|
, {
|
|
61
61
|
className: "fabric-editor-popup-scroll-parent",
|
|
62
62
|
featureFlags: props.featureFlags,
|
|
63
|
-
ref: scrollContainerRef
|
|
63
|
+
ref: scrollContainerRef,
|
|
64
|
+
viewMode: (0, _platformFeatureFlags.fg)('platform_editor_remove_use_preset_context') ? props === null || props === void 0 ? void 0 : props.viewMode : undefined
|
|
64
65
|
}, (0, _react2.jsx)(_Addon.ClickAreaBlock, {
|
|
65
66
|
editorView: props.editorView,
|
|
66
67
|
editorDisabled: props.disabled
|
|
@@ -101,15 +101,14 @@ var createEditorContentStyle = exports.createEditorContentStyle = function creat
|
|
|
101
101
|
var editorAPI = (0, _context.usePresetContext)();
|
|
102
102
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(editorAPI, ['editorViewMode']),
|
|
103
103
|
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
104
|
-
var viewMode = editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode;
|
|
105
104
|
var memoizedStyle = (0, _react.useMemo)(function () {
|
|
106
105
|
return contentStyles({
|
|
107
106
|
theme: theme,
|
|
108
107
|
colorMode: colorMode,
|
|
109
108
|
featureFlags: featureFlags,
|
|
110
|
-
viewMode: viewMode
|
|
109
|
+
viewMode: (0, _platformFeatureFlags.fg)('platform_editor_remove_use_preset_context') ? props.viewMode : editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode
|
|
111
110
|
});
|
|
112
|
-
}, [theme, colorMode, featureFlags, viewMode]);
|
|
111
|
+
}, [theme, colorMode, featureFlags, editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode, props.viewMode]);
|
|
113
112
|
return (
|
|
114
113
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
115
114
|
(0, _react2.jsx)("div", {
|
|
@@ -13,6 +13,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _actions = _interopRequireDefault(require("../../actions"));
|
|
17
18
|
var _context = require("../../presets/context");
|
|
18
19
|
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
@@ -41,9 +42,15 @@ var LegacyEditorContext = exports.default = /*#__PURE__*/function (_React$Compon
|
|
|
41
42
|
}, {
|
|
42
43
|
key: "render",
|
|
43
44
|
value: function render() {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_remove_use_preset_context')) {
|
|
46
|
+
return /*#__PURE__*/_react.default.createElement(EditorContext.Provider, {
|
|
47
|
+
value: this.getChildContext()
|
|
48
|
+
}, this.props.children);
|
|
49
|
+
} else {
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement(EditorContext.Provider, {
|
|
51
|
+
value: this.getChildContext()
|
|
52
|
+
}, /*#__PURE__*/_react.default.createElement(_context.PresetContextProvider, null, this.props.children));
|
|
53
|
+
}
|
|
47
54
|
}
|
|
48
55
|
}]);
|
|
49
56
|
return LegacyEditorContext;
|
|
@@ -3,17 +3,18 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
* @jsxRuntime classic
|
|
4
4
|
* @jsx jsx
|
|
5
5
|
*/
|
|
6
|
-
import { Fragment, memo, useCallback } from 'react';
|
|
6
|
+
import { Fragment, memo, useCallback, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
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';
|
|
12
13
|
import ErrorBoundary from '../create-editor/ErrorBoundary';
|
|
13
14
|
import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
|
|
14
15
|
import ReactEditorView from '../create-editor/ReactEditorView';
|
|
15
16
|
import { ContextAdapter } from '../nodeviews/context-adapter';
|
|
16
|
-
import { useSetPresetContext } from '../presets/context';
|
|
17
|
+
import { usePresetContext, useSetPresetContext } from '../presets/context';
|
|
17
18
|
import EditorContext from '../ui/EditorContext';
|
|
18
19
|
import { IntlProviderIfMissingWrapper } from '../ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper';
|
|
19
20
|
import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
@@ -134,7 +135,12 @@ export const EditorInternal = /*#__PURE__*/memo(({
|
|
|
134
135
|
});
|
|
135
136
|
function ReactEditorViewContextWrapper(props) {
|
|
136
137
|
var _props$editorProps$me, _props$editorProps$li, _props$editorProps$li2;
|
|
138
|
+
// deprecated, unable to be FF due to hook usage
|
|
137
139
|
const setInternalEditorAPI = useSetPresetContext();
|
|
140
|
+
const presetContextEditorAPI = usePresetContext();
|
|
141
|
+
|
|
142
|
+
// new way of storing the editorApi when FF platform_editor_remove_use_preset_context is enabled
|
|
143
|
+
const [editorAPI, setEditorAPI] = useState(undefined);
|
|
138
144
|
|
|
139
145
|
/**
|
|
140
146
|
* We use the context to retrieve the editorAPI
|
|
@@ -144,16 +150,21 @@ function ReactEditorViewContextWrapper(props) {
|
|
|
144
150
|
* so we should also set the value for the `EditorContext` that is used in
|
|
145
151
|
* `EditorInternal`.
|
|
146
152
|
*/
|
|
147
|
-
const
|
|
153
|
+
const setPresetContextEditorAPI = useCallback(
|
|
148
154
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
149
155
|
api => {
|
|
150
|
-
|
|
151
|
-
|
|
156
|
+
if (fg('platform_editor_remove_use_preset_context')) {
|
|
157
|
+
setEditorAPI(api);
|
|
158
|
+
} else {
|
|
159
|
+
setInternalEditorAPI === null || setInternalEditorAPI === void 0 ? void 0 : setInternalEditorAPI(api);
|
|
160
|
+
}
|
|
161
|
+
}, [setInternalEditorAPI, setEditorAPI]);
|
|
152
162
|
|
|
153
163
|
// 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
|
|
154
164
|
const UNSAFE_cards = props.editorProps.UNSAFE_cards;
|
|
155
165
|
const smartLinks = props.editorProps.smartLinks;
|
|
156
166
|
useProviders({
|
|
167
|
+
editorApi: fg('platform_editor_remove_use_preset_context') ? editorAPI : presetContextEditorAPI,
|
|
157
168
|
contextIdentifierProvider: props.editorProps.contextIdentifierProvider,
|
|
158
169
|
mediaProvider: (_props$editorProps$me = props.editorProps.media) === null || _props$editorProps$me === void 0 ? void 0 : _props$editorProps$me.provider,
|
|
159
170
|
cardProvider: ((_props$editorProps$li = props.editorProps.linking) === null || _props$editorProps$li === void 0 ? void 0 : (_props$editorProps$li2 = _props$editorProps$li.smartLinks) === null || _props$editorProps$li2 === void 0 ? void 0 : _props$editorProps$li2.provider) || smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider,
|
|
@@ -161,6 +172,7 @@ function ReactEditorViewContextWrapper(props) {
|
|
|
161
172
|
autoformattingProvider: props.editorProps.autoformattingProvider
|
|
162
173
|
});
|
|
163
174
|
return jsx(ReactEditorView, _extends({}, props, {
|
|
164
|
-
|
|
175
|
+
editorAPI: editorAPI,
|
|
176
|
+
setEditorApi: setPresetContextEditorAPI
|
|
165
177
|
}));
|
|
166
178
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import { usePresetContext } from '../../presets/context';
|
|
4
3
|
/**
|
|
5
4
|
* This hook is used to replace the old approach of using the `providerFactory`.
|
|
6
5
|
*
|
|
@@ -10,13 +9,13 @@ import { usePresetContext } from '../../presets/context';
|
|
|
10
9
|
* In the future ideally consumers implement this behaviour themselves.
|
|
11
10
|
*/
|
|
12
11
|
export const useProviders = ({
|
|
12
|
+
editorApi,
|
|
13
13
|
contextIdentifierProvider,
|
|
14
14
|
mediaProvider,
|
|
15
15
|
cardProvider,
|
|
16
16
|
emojiProvider,
|
|
17
17
|
autoformattingProvider
|
|
18
18
|
}) => {
|
|
19
|
-
const editorApi = usePresetContext();
|
|
20
19
|
useEffect(() => {
|
|
21
20
|
async function setProvider() {
|
|
22
21
|
var _editorApi$core, _editorApi$contextIde;
|
|
@@ -712,6 +712,31 @@ export class ReactEditorView extends React.Component {
|
|
|
712
712
|
const renderTracking = (_this$props$editorPro14 = this.props.editorProps.performanceTracking) === null || _this$props$editorPro14 === void 0 ? void 0 : (_this$props$editorPro15 = _this$props$editorPro14.renderTracking) === null || _this$props$editorPro15 === void 0 ? void 0 : _this$props$editorPro15.reactEditorView;
|
|
713
713
|
const renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
|
|
714
714
|
const useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
|
|
715
|
+
if (fg('platform_editor_remove_use_preset_context')) {
|
|
716
|
+
var _this$props$render, _this$props$render2, _this$props;
|
|
717
|
+
return /*#__PURE__*/React.createElement(ReactEditorViewContext.Provider, {
|
|
718
|
+
value: {
|
|
719
|
+
editorRef: this.editorRef,
|
|
720
|
+
editorView: this.view,
|
|
721
|
+
popupsMountPoint: this.props.editorProps.popupsMountPoint
|
|
722
|
+
}
|
|
723
|
+
}, renderTrackingEnabled && /*#__PURE__*/React.createElement(RenderTracking, {
|
|
724
|
+
componentProps: this.props,
|
|
725
|
+
action: ACTION.RE_RENDERED,
|
|
726
|
+
actionSubject: ACTION_SUBJECT.REACT_EDITOR_VIEW,
|
|
727
|
+
handleAnalyticsEvent: this.handleAnalyticsEvent,
|
|
728
|
+
useShallow: useShallow
|
|
729
|
+
}), this.props.render ? (_this$props$render = (_this$props$render2 = (_this$props = this.props).render) === null || _this$props$render2 === void 0 ? void 0 : _this$props$render2.call(_this$props, {
|
|
730
|
+
editor: this.editor,
|
|
731
|
+
view: this.view,
|
|
732
|
+
config: this.config,
|
|
733
|
+
eventDispatcher: this.eventDispatcher,
|
|
734
|
+
transformer: this.contentTransformer,
|
|
735
|
+
dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
|
|
736
|
+
editorRef: this.editorRef,
|
|
737
|
+
editorAPI: this.props.editorAPI
|
|
738
|
+
})) !== null && _this$props$render !== void 0 ? _this$props$render : this.editor : this.editor);
|
|
739
|
+
}
|
|
715
740
|
return /*#__PURE__*/React.createElement(ReactEditorViewContext.Provider, {
|
|
716
741
|
value: {
|
|
717
742
|
editorRef: this.editorRef,
|
|
@@ -727,8 +752,8 @@ export class ReactEditorView extends React.Component {
|
|
|
727
752
|
}), this.props.render ? /*#__PURE__*/React.createElement(EditorAPIContext.Consumer, null, ({
|
|
728
753
|
editorApi
|
|
729
754
|
}) => {
|
|
730
|
-
var _this$props$
|
|
731
|
-
return (_this$props$
|
|
755
|
+
var _this$props$render3, _this$props$render4, _this$props2;
|
|
756
|
+
return (_this$props$render3 = (_this$props$render4 = (_this$props2 = this.props).render) === null || _this$props$render4 === void 0 ? void 0 : _this$props$render4.call(_this$props2, {
|
|
732
757
|
editor: this.editor,
|
|
733
758
|
view: this.view,
|
|
734
759
|
config: this.config,
|
|
@@ -737,7 +762,7 @@ export class ReactEditorView extends React.Component {
|
|
|
737
762
|
dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
|
|
738
763
|
editorRef: this.editorRef,
|
|
739
764
|
editorAPI: editorApi
|
|
740
|
-
})) !== null && _this$props$
|
|
765
|
+
})) !== null && _this$props$render3 !== void 0 ? _this$props$render3 : this.editor;
|
|
741
766
|
}) : this.editor);
|
|
742
767
|
}
|
|
743
768
|
}
|
|
@@ -9,6 +9,7 @@ import React, { Fragment } from 'react';
|
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
11
11
|
import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { createEditorContentStyle } from '../ContentStyles';
|
|
13
14
|
import PluginSlot from '../PluginSlot';
|
|
14
15
|
import WithFlash from '../WithFlash';
|
|
@@ -64,6 +65,9 @@ export default class Editor extends React.Component {
|
|
|
64
65
|
featureFlags
|
|
65
66
|
} = this.props;
|
|
66
67
|
const maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
|
|
68
|
+
const {
|
|
69
|
+
editorViewModeState
|
|
70
|
+
} = useSharedPluginState(this.props.editorAPI, ['editorViewMode']);
|
|
67
71
|
return jsx(WithFlash, {
|
|
68
72
|
animate: maxContentSizeReached
|
|
69
73
|
}, jsx("div", {
|
|
@@ -84,7 +88,8 @@ export default class Editor extends React.Component {
|
|
|
84
88
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
85
89
|
, {
|
|
86
90
|
className: "ak-editor-content-area",
|
|
87
|
-
featureFlags: featureFlags
|
|
91
|
+
featureFlags: featureFlags,
|
|
92
|
+
viewMode: fg('platform_editor_remove_use_preset_context') ? editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode : undefined
|
|
88
93
|
}, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, jsx(PluginSlot, {
|
|
89
94
|
editorView: editorView,
|
|
90
95
|
editorActions: editorActions,
|
|
@@ -78,8 +78,9 @@ export const CommentEditorWithIntl = props => {
|
|
|
78
78
|
const {
|
|
79
79
|
mediaState,
|
|
80
80
|
maxContentSizeState,
|
|
81
|
-
primaryToolbarState
|
|
82
|
-
|
|
81
|
+
primaryToolbarState,
|
|
82
|
+
editorViewModeState
|
|
83
|
+
} = useSharedPluginState(editorAPI, ['media', 'maxContentSize', 'primaryToolbar', 'editorViewMode']);
|
|
83
84
|
const intl = useIntl();
|
|
84
85
|
const {
|
|
85
86
|
editorDOMElement,
|
|
@@ -204,7 +205,8 @@ export const CommentEditorWithIntl = props => {
|
|
|
204
205
|
className: classnames('ak-editor-content-area', {
|
|
205
206
|
'less-margin': width < akEditorMobileBreakoutPoint
|
|
206
207
|
}),
|
|
207
|
-
featureFlags: featureFlags
|
|
208
|
+
featureFlags: featureFlags,
|
|
209
|
+
viewMode: fg('platform_editor_remove_use_preset_context') ? editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode : undefined
|
|
208
210
|
}, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, jsx(PluginSlot, {
|
|
209
211
|
editorView: editorView,
|
|
210
212
|
editorActions: editorActions,
|
|
@@ -100,6 +100,7 @@ export const FullPageEditor = props => {
|
|
|
100
100
|
wrapperElement: (_wrapperElementRef$cu = wrapperElementRef === null || wrapperElementRef === void 0 ? void 0 : wrapperElementRef.current) !== null && _wrapperElementRef$cu !== void 0 ? _wrapperElementRef$cu : null,
|
|
101
101
|
pluginHooks: props.pluginHooks,
|
|
102
102
|
featureFlags: props.featureFlags,
|
|
103
|
-
isEditorToolbarHidden: isEditorToolbarHidden
|
|
103
|
+
isEditorToolbarHidden: isEditorToolbarHidden,
|
|
104
|
+
viewMode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode
|
|
104
105
|
})));
|
|
105
106
|
};
|
|
@@ -48,7 +48,8 @@ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
48
48
|
, {
|
|
49
49
|
className: "fabric-editor-popup-scroll-parent",
|
|
50
50
|
featureFlags: props.featureFlags,
|
|
51
|
-
ref: scrollContainerRef
|
|
51
|
+
ref: scrollContainerRef,
|
|
52
|
+
viewMode: fg('platform_editor_remove_use_preset_context') ? props === null || props === void 0 ? void 0 : props.viewMode : undefined
|
|
52
53
|
}, jsx(ClickAreaBlock, {
|
|
53
54
|
editorView: props.editorView,
|
|
54
55
|
editorDisabled: props.disabled
|
|
@@ -372,13 +372,12 @@ export const createEditorContentStyle = styles => {
|
|
|
372
372
|
const {
|
|
373
373
|
editorViewModeState
|
|
374
374
|
} = useSharedPluginState(editorAPI, ['editorViewMode']);
|
|
375
|
-
const viewMode = editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode;
|
|
376
375
|
const memoizedStyle = useMemo(() => contentStyles({
|
|
377
376
|
theme,
|
|
378
377
|
colorMode,
|
|
379
378
|
featureFlags,
|
|
380
|
-
viewMode
|
|
381
|
-
}), [theme, colorMode, featureFlags, viewMode]);
|
|
379
|
+
viewMode: fg('platform_editor_remove_use_preset_context') ? props.viewMode : editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode
|
|
380
|
+
}), [theme, colorMode, featureFlags, editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode, props.viewMode]);
|
|
382
381
|
return (
|
|
383
382
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
384
383
|
jsx("div", {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import EditorActions from '../../actions';
|
|
5
6
|
import { PresetContextProvider } from '../../presets/context';
|
|
6
7
|
const EditorContext = /*#__PURE__*/React.createContext({});
|
|
@@ -16,9 +17,15 @@ export default class LegacyEditorContext extends React.Component {
|
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
19
|
render() {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
if (fg('platform_editor_remove_use_preset_context')) {
|
|
21
|
+
return /*#__PURE__*/React.createElement(EditorContext.Provider, {
|
|
22
|
+
value: this.getChildContext()
|
|
23
|
+
}, this.props.children);
|
|
24
|
+
} else {
|
|
25
|
+
return /*#__PURE__*/React.createElement(EditorContext.Provider, {
|
|
26
|
+
value: this.getChildContext()
|
|
27
|
+
}, /*#__PURE__*/React.createElement(PresetContextProvider, null, this.props.children));
|
|
28
|
+
}
|
|
22
29
|
}
|
|
23
30
|
}
|
|
24
31
|
_defineProperty(LegacyEditorContext, "childContextTypes", {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "197.
|
|
2
|
+
export const version = "197.13.0";
|
|
@@ -7,17 +7,18 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
* @jsxRuntime classic
|
|
8
8
|
* @jsx jsx
|
|
9
9
|
*/
|
|
10
|
-
import { Fragment, memo, useCallback } from 'react';
|
|
10
|
+
import { Fragment, memo, useCallback, useState } from 'react';
|
|
11
11
|
|
|
12
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
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';
|
|
16
17
|
import ErrorBoundary from '../create-editor/ErrorBoundary';
|
|
17
18
|
import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
|
|
18
19
|
import ReactEditorView from '../create-editor/ReactEditorView';
|
|
19
20
|
import { ContextAdapter } from '../nodeviews/context-adapter';
|
|
20
|
-
import { useSetPresetContext } from '../presets/context';
|
|
21
|
+
import { usePresetContext, useSetPresetContext } from '../presets/context';
|
|
21
22
|
import EditorContext from '../ui/EditorContext';
|
|
22
23
|
import { IntlProviderIfMissingWrapper } from '../ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper';
|
|
23
24
|
import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
@@ -138,7 +139,15 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
138
139
|
});
|
|
139
140
|
function ReactEditorViewContextWrapper(props) {
|
|
140
141
|
var _props$editorProps$me, _props$editorProps$li;
|
|
142
|
+
// deprecated, unable to be FF due to hook usage
|
|
141
143
|
var setInternalEditorAPI = useSetPresetContext();
|
|
144
|
+
var presetContextEditorAPI = usePresetContext();
|
|
145
|
+
|
|
146
|
+
// new way of storing the editorApi when FF platform_editor_remove_use_preset_context is enabled
|
|
147
|
+
var _useState = useState(undefined),
|
|
148
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
149
|
+
editorAPI = _useState2[0],
|
|
150
|
+
setEditorAPI = _useState2[1];
|
|
142
151
|
|
|
143
152
|
/**
|
|
144
153
|
* We use the context to retrieve the editorAPI
|
|
@@ -148,16 +157,21 @@ function ReactEditorViewContextWrapper(props) {
|
|
|
148
157
|
* so we should also set the value for the `EditorContext` that is used in
|
|
149
158
|
* `EditorInternal`.
|
|
150
159
|
*/
|
|
151
|
-
var
|
|
160
|
+
var setPresetContextEditorAPI = useCallback(
|
|
152
161
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
153
162
|
function (api) {
|
|
154
|
-
|
|
155
|
-
|
|
163
|
+
if (fg('platform_editor_remove_use_preset_context')) {
|
|
164
|
+
setEditorAPI(api);
|
|
165
|
+
} else {
|
|
166
|
+
setInternalEditorAPI === null || setInternalEditorAPI === void 0 || setInternalEditorAPI(api);
|
|
167
|
+
}
|
|
168
|
+
}, [setInternalEditorAPI, setEditorAPI]);
|
|
156
169
|
|
|
157
170
|
// 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
|
|
158
171
|
var UNSAFE_cards = props.editorProps.UNSAFE_cards;
|
|
159
172
|
var smartLinks = props.editorProps.smartLinks;
|
|
160
173
|
useProviders({
|
|
174
|
+
editorApi: fg('platform_editor_remove_use_preset_context') ? editorAPI : presetContextEditorAPI,
|
|
161
175
|
contextIdentifierProvider: props.editorProps.contextIdentifierProvider,
|
|
162
176
|
mediaProvider: (_props$editorProps$me = props.editorProps.media) === null || _props$editorProps$me === void 0 ? void 0 : _props$editorProps$me.provider,
|
|
163
177
|
cardProvider: ((_props$editorProps$li = props.editorProps.linking) === null || _props$editorProps$li === void 0 || (_props$editorProps$li = _props$editorProps$li.smartLinks) === null || _props$editorProps$li === void 0 ? void 0 : _props$editorProps$li.provider) || smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider,
|
|
@@ -165,6 +179,7 @@ function ReactEditorViewContextWrapper(props) {
|
|
|
165
179
|
autoformattingProvider: props.editorProps.autoformattingProvider
|
|
166
180
|
});
|
|
167
181
|
return jsx(ReactEditorView, _extends({}, props, {
|
|
168
|
-
|
|
182
|
+
editorAPI: editorAPI,
|
|
183
|
+
setEditorApi: setPresetContextEditorAPI
|
|
169
184
|
}));
|
|
170
185
|
}
|
|
@@ -2,7 +2,6 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { useEffect } from 'react';
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
|
-
import { usePresetContext } from '../../presets/context';
|
|
6
5
|
/**
|
|
7
6
|
* This hook is used to replace the old approach of using the `providerFactory`.
|
|
8
7
|
*
|
|
@@ -12,12 +11,12 @@ import { usePresetContext } from '../../presets/context';
|
|
|
12
11
|
* In the future ideally consumers implement this behaviour themselves.
|
|
13
12
|
*/
|
|
14
13
|
export var useProviders = function useProviders(_ref) {
|
|
15
|
-
var
|
|
14
|
+
var editorApi = _ref.editorApi,
|
|
15
|
+
contextIdentifierProvider = _ref.contextIdentifierProvider,
|
|
16
16
|
mediaProvider = _ref.mediaProvider,
|
|
17
17
|
cardProvider = _ref.cardProvider,
|
|
18
18
|
emojiProvider = _ref.emojiProvider,
|
|
19
19
|
autoformattingProvider = _ref.autoformattingProvider;
|
|
20
|
-
var editorApi = usePresetContext();
|
|
21
20
|
useEffect(function () {
|
|
22
21
|
function setProvider() {
|
|
23
22
|
return _setProvider.apply(this, arguments);
|
|
@@ -762,6 +762,31 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
762
762
|
var renderTracking = (_this$props$editorPro10 = this.props.editorProps.performanceTracking) === null || _this$props$editorPro10 === void 0 || (_this$props$editorPro10 = _this$props$editorPro10.renderTracking) === null || _this$props$editorPro10 === void 0 ? void 0 : _this$props$editorPro10.reactEditorView;
|
|
763
763
|
var renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
|
|
764
764
|
var useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
|
|
765
|
+
if (fg('platform_editor_remove_use_preset_context')) {
|
|
766
|
+
var _this$props$render, _this$props$render2, _this$props;
|
|
767
|
+
return /*#__PURE__*/React.createElement(ReactEditorViewContext.Provider, {
|
|
768
|
+
value: {
|
|
769
|
+
editorRef: this.editorRef,
|
|
770
|
+
editorView: this.view,
|
|
771
|
+
popupsMountPoint: this.props.editorProps.popupsMountPoint
|
|
772
|
+
}
|
|
773
|
+
}, renderTrackingEnabled && /*#__PURE__*/React.createElement(RenderTracking, {
|
|
774
|
+
componentProps: this.props,
|
|
775
|
+
action: ACTION.RE_RENDERED,
|
|
776
|
+
actionSubject: ACTION_SUBJECT.REACT_EDITOR_VIEW,
|
|
777
|
+
handleAnalyticsEvent: this.handleAnalyticsEvent,
|
|
778
|
+
useShallow: useShallow
|
|
779
|
+
}), this.props.render ? (_this$props$render = (_this$props$render2 = (_this$props = this.props).render) === null || _this$props$render2 === void 0 ? void 0 : _this$props$render2.call(_this$props, {
|
|
780
|
+
editor: this.editor,
|
|
781
|
+
view: this.view,
|
|
782
|
+
config: this.config,
|
|
783
|
+
eventDispatcher: this.eventDispatcher,
|
|
784
|
+
transformer: this.contentTransformer,
|
|
785
|
+
dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
|
|
786
|
+
editorRef: this.editorRef,
|
|
787
|
+
editorAPI: this.props.editorAPI
|
|
788
|
+
})) !== null && _this$props$render !== void 0 ? _this$props$render : this.editor : this.editor);
|
|
789
|
+
}
|
|
765
790
|
return /*#__PURE__*/React.createElement(ReactEditorViewContext.Provider, {
|
|
766
791
|
value: {
|
|
767
792
|
editorRef: this.editorRef,
|
|
@@ -17,6 +17,7 @@ import React, { Fragment } from 'react';
|
|
|
17
17
|
import { css, jsx } from '@emotion/react';
|
|
18
18
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
19
19
|
import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
20
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
20
21
|
import { createEditorContentStyle } from '../ContentStyles';
|
|
21
22
|
import PluginSlot from '../PluginSlot';
|
|
22
23
|
import WithFlash from '../WithFlash';
|
|
@@ -78,6 +79,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
78
79
|
pluginHooks = _this$props.pluginHooks,
|
|
79
80
|
featureFlags = _this$props.featureFlags;
|
|
80
81
|
var maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
|
|
82
|
+
var _useSharedPluginState = useSharedPluginState(_this.props.editorAPI, ['editorViewMode']),
|
|
83
|
+
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
81
84
|
return jsx(WithFlash, {
|
|
82
85
|
animate: maxContentSizeReached
|
|
83
86
|
}, jsx("div", {
|
|
@@ -100,7 +103,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
100
103
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
101
104
|
, {
|
|
102
105
|
className: "ak-editor-content-area",
|
|
103
|
-
featureFlags: featureFlags
|
|
106
|
+
featureFlags: featureFlags,
|
|
107
|
+
viewMode: fg('platform_editor_remove_use_preset_context') ? editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode : undefined
|
|
104
108
|
}, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, jsx(PluginSlot, {
|
|
105
109
|
editorView: editorView,
|
|
106
110
|
editorActions: editorActions,
|
|
@@ -136,8 +140,8 @@ export { Editor as default };
|
|
|
136
140
|
function RenderWithPluginState(_ref3) {
|
|
137
141
|
var renderChrome = _ref3.renderChrome,
|
|
138
142
|
editorAPI = _ref3.editorAPI;
|
|
139
|
-
var
|
|
140
|
-
maxContentSizeState =
|
|
143
|
+
var _useSharedPluginState2 = useSharedPluginState(editorAPI, ['maxContentSize']),
|
|
144
|
+
maxContentSizeState = _useSharedPluginState2.maxContentSizeState;
|
|
141
145
|
return jsx(Fragment, null, renderChrome({
|
|
142
146
|
maxContentSize: maxContentSizeState
|
|
143
147
|
}));
|
|
@@ -74,10 +74,11 @@ var secondaryToolbarStyles = css({
|
|
|
74
74
|
var appearance = 'comment';
|
|
75
75
|
export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
|
|
76
76
|
var editorAPI = props.editorAPI;
|
|
77
|
-
var _useSharedPluginState = useSharedPluginState(editorAPI, ['media', 'maxContentSize', 'primaryToolbar']),
|
|
77
|
+
var _useSharedPluginState = useSharedPluginState(editorAPI, ['media', 'maxContentSize', 'primaryToolbar', 'editorViewMode']),
|
|
78
78
|
mediaState = _useSharedPluginState.mediaState,
|
|
79
79
|
maxContentSizeState = _useSharedPluginState.maxContentSizeState,
|
|
80
|
-
primaryToolbarState = _useSharedPluginState.primaryToolbarState
|
|
80
|
+
primaryToolbarState = _useSharedPluginState.primaryToolbarState,
|
|
81
|
+
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
81
82
|
var intl = useIntl();
|
|
82
83
|
var editorDOMElement = props.editorDOMElement,
|
|
83
84
|
editorView = props.editorView,
|
|
@@ -207,7 +208,8 @@ export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
|
|
|
207
208
|
className: classnames('ak-editor-content-area', {
|
|
208
209
|
'less-margin': width < akEditorMobileBreakoutPoint
|
|
209
210
|
}),
|
|
210
|
-
featureFlags: featureFlags
|
|
211
|
+
featureFlags: featureFlags,
|
|
212
|
+
viewMode: fg('platform_editor_remove_use_preset_context') ? editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode : undefined
|
|
211
213
|
}, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, jsx(PluginSlot, {
|
|
212
214
|
editorView: editorView,
|
|
213
215
|
editorActions: editorActions,
|
|
@@ -107,6 +107,7 @@ export var FullPageEditor = function FullPageEditor(props) {
|
|
|
107
107
|
wrapperElement: (_wrapperElementRef$cu = wrapperElementRef === null || wrapperElementRef === void 0 ? void 0 : wrapperElementRef.current) !== null && _wrapperElementRef$cu !== void 0 ? _wrapperElementRef$cu : null,
|
|
108
108
|
pluginHooks: props.pluginHooks,
|
|
109
109
|
featureFlags: props.featureFlags,
|
|
110
|
-
isEditorToolbarHidden: isEditorToolbarHidden
|
|
110
|
+
isEditorToolbarHidden: isEditorToolbarHidden,
|
|
111
|
+
viewMode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode
|
|
111
112
|
})));
|
|
112
113
|
};
|
|
@@ -50,7 +50,8 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
50
50
|
, {
|
|
51
51
|
className: "fabric-editor-popup-scroll-parent",
|
|
52
52
|
featureFlags: props.featureFlags,
|
|
53
|
-
ref: scrollContainerRef
|
|
53
|
+
ref: scrollContainerRef,
|
|
54
|
+
viewMode: fg('platform_editor_remove_use_preset_context') ? props === null || props === void 0 ? void 0 : props.viewMode : undefined
|
|
54
55
|
}, jsx(ClickAreaBlock, {
|
|
55
56
|
editorView: props.editorView,
|
|
56
57
|
editorDisabled: props.disabled
|
|
@@ -93,15 +93,14 @@ export var createEditorContentStyle = function createEditorContentStyle(styles)
|
|
|
93
93
|
var editorAPI = usePresetContext();
|
|
94
94
|
var _useSharedPluginState = useSharedPluginState(editorAPI, ['editorViewMode']),
|
|
95
95
|
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
96
|
-
var viewMode = editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode;
|
|
97
96
|
var memoizedStyle = useMemo(function () {
|
|
98
97
|
return contentStyles({
|
|
99
98
|
theme: theme,
|
|
100
99
|
colorMode: colorMode,
|
|
101
100
|
featureFlags: featureFlags,
|
|
102
|
-
viewMode: viewMode
|
|
101
|
+
viewMode: fg('platform_editor_remove_use_preset_context') ? props.viewMode : editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode
|
|
103
102
|
});
|
|
104
|
-
}, [theme, colorMode, featureFlags, viewMode]);
|
|
103
|
+
}, [theme, colorMode, featureFlags, editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode, props.viewMode]);
|
|
105
104
|
return (
|
|
106
105
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
107
106
|
jsx("div", {
|
|
@@ -8,6 +8,7 @@ function _createSuper(t) { var r = _isNativeReflectConstruct(); return function
|
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
import EditorActions from '../../actions';
|
|
12
13
|
import { PresetContextProvider } from '../../presets/context';
|
|
13
14
|
var EditorContext = /*#__PURE__*/React.createContext({});
|
|
@@ -34,9 +35,15 @@ var LegacyEditorContext = /*#__PURE__*/function (_React$Component) {
|
|
|
34
35
|
}, {
|
|
35
36
|
key: "render",
|
|
36
37
|
value: function render() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
if (fg('platform_editor_remove_use_preset_context')) {
|
|
39
|
+
return /*#__PURE__*/React.createElement(EditorContext.Provider, {
|
|
40
|
+
value: this.getChildContext()
|
|
41
|
+
}, this.props.children);
|
|
42
|
+
} else {
|
|
43
|
+
return /*#__PURE__*/React.createElement(EditorContext.Provider, {
|
|
44
|
+
value: this.getChildContext()
|
|
45
|
+
}, /*#__PURE__*/React.createElement(PresetContextProvider, null, this.props.children));
|
|
46
|
+
}
|
|
40
47
|
}
|
|
41
48
|
}]);
|
|
42
49
|
return LegacyEditorContext;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "197.
|
|
2
|
+
export var version = "197.13.0";
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import type { AutoformattingProvider, CardProvider, ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
+
import type { OptionalPlugin, PublicPluginAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { CardPlugin } from '@atlaskit/editor-plugins/card';
|
|
4
|
+
import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugins/context-identifier';
|
|
5
|
+
import { type CustomAutoformatPlugin } from '@atlaskit/editor-plugins/custom-autoformat';
|
|
6
|
+
import { type EmojiPlugin } from '@atlaskit/editor-plugins/emoji';
|
|
7
|
+
import type { MediaPlugin } from '@atlaskit/editor-plugins/media';
|
|
2
8
|
import { type EmojiProvider } from '@atlaskit/emoji';
|
|
3
9
|
interface UseProvidersProps {
|
|
10
|
+
editorApi: PublicPluginAPI<[
|
|
11
|
+
OptionalPlugin<ContextIdentifierPlugin>,
|
|
12
|
+
OptionalPlugin<MediaPlugin>,
|
|
13
|
+
OptionalPlugin<CardPlugin>,
|
|
14
|
+
OptionalPlugin<EmojiPlugin>,
|
|
15
|
+
OptionalPlugin<CustomAutoformatPlugin>
|
|
16
|
+
]> | undefined;
|
|
4
17
|
contextIdentifierProvider: Promise<ContextIdentifierProvider> | undefined;
|
|
5
18
|
mediaProvider: Promise<MediaProvider> | undefined;
|
|
6
19
|
cardProvider: Promise<CardProvider> | undefined;
|
|
@@ -15,5 +28,5 @@ interface UseProvidersProps {
|
|
|
15
28
|
*
|
|
16
29
|
* In the future ideally consumers implement this behaviour themselves.
|
|
17
30
|
*/
|
|
18
|
-
export declare const useProviders: ({ contextIdentifierProvider, mediaProvider, cardProvider, emojiProvider, autoformattingProvider, }: UseProvidersProps) => void;
|
|
31
|
+
export declare const useProviders: ({ editorApi, contextIdentifierProvider, mediaProvider, cardProvider, emojiProvider, autoformattingProvider, }: UseProvidersProps) => void;
|
|
19
32
|
export {};
|
|
@@ -30,6 +30,7 @@ export interface EditorViewProps {
|
|
|
30
30
|
portalProviderAPI: PortalProviderAPI;
|
|
31
31
|
disabled?: boolean;
|
|
32
32
|
experienceStore?: ExperienceStore;
|
|
33
|
+
editorAPI: PublicPluginAPI<any> | undefined;
|
|
33
34
|
setEditorApi?: SetEditorAPI;
|
|
34
35
|
render?: (props: {
|
|
35
36
|
editor: JSX.Element;
|
|
@@ -5,9 +5,13 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { type OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
8
|
+
import { type EditorViewModePlugin } from '@atlaskit/editor-plugins/editor-viewmode';
|
|
8
9
|
import type { MaxContentSizePlugin } from '@atlaskit/editor-plugins/max-content-size';
|
|
9
10
|
import type { EditorAppearanceComponentProps } from '../../types';
|
|
10
|
-
type AppearanceProps = EditorAppearanceComponentProps<[
|
|
11
|
+
type AppearanceProps = EditorAppearanceComponentProps<[
|
|
12
|
+
OptionalPlugin<MaxContentSizePlugin>,
|
|
13
|
+
OptionalPlugin<EditorViewModePlugin>
|
|
14
|
+
]>;
|
|
11
15
|
export default class Editor extends React.Component<AppearanceProps> {
|
|
12
16
|
static displayName: string;
|
|
13
17
|
private appearance;
|
|
@@ -9,6 +9,7 @@ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
|
9
9
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
10
10
|
import type { OptionalPlugin, PublicPluginAPI, ReactHookFactory } from '@atlaskit/editor-common/types';
|
|
11
11
|
import { type ContextPanelPlugin } from '@atlaskit/editor-plugins/context-panel';
|
|
12
|
+
import { type ViewMode } from '@atlaskit/editor-plugins/editor-viewmode';
|
|
12
13
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
13
14
|
import type EditorActions from '../../../actions';
|
|
14
15
|
import type { EventDispatcher } from '../../../event-dispatcher';
|
|
@@ -34,6 +35,7 @@ interface FullPageEditorContentAreaProps {
|
|
|
34
35
|
providerFactory: ProviderFactory;
|
|
35
36
|
wrapperElement: HTMLElement | null;
|
|
36
37
|
featureFlags?: FeatureFlags;
|
|
38
|
+
viewMode: ViewMode | undefined;
|
|
37
39
|
isEditorToolbarHidden?: boolean;
|
|
38
40
|
}
|
|
39
41
|
export declare const CONTENT_AREA_TEST_ID = "ak-editor-fp-content-area";
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import type { AutoformattingProvider, CardProvider, ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
+
import type { OptionalPlugin, PublicPluginAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { CardPlugin } from '@atlaskit/editor-plugins/card';
|
|
4
|
+
import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugins/context-identifier';
|
|
5
|
+
import { type CustomAutoformatPlugin } from '@atlaskit/editor-plugins/custom-autoformat';
|
|
6
|
+
import { type EmojiPlugin } from '@atlaskit/editor-plugins/emoji';
|
|
7
|
+
import type { MediaPlugin } from '@atlaskit/editor-plugins/media';
|
|
2
8
|
import { type EmojiProvider } from '@atlaskit/emoji';
|
|
3
9
|
interface UseProvidersProps {
|
|
10
|
+
editorApi: PublicPluginAPI<[
|
|
11
|
+
OptionalPlugin<ContextIdentifierPlugin>,
|
|
12
|
+
OptionalPlugin<MediaPlugin>,
|
|
13
|
+
OptionalPlugin<CardPlugin>,
|
|
14
|
+
OptionalPlugin<EmojiPlugin>,
|
|
15
|
+
OptionalPlugin<CustomAutoformatPlugin>
|
|
16
|
+
]> | undefined;
|
|
4
17
|
contextIdentifierProvider: Promise<ContextIdentifierProvider> | undefined;
|
|
5
18
|
mediaProvider: Promise<MediaProvider> | undefined;
|
|
6
19
|
cardProvider: Promise<CardProvider> | undefined;
|
|
@@ -15,5 +28,5 @@ interface UseProvidersProps {
|
|
|
15
28
|
*
|
|
16
29
|
* In the future ideally consumers implement this behaviour themselves.
|
|
17
30
|
*/
|
|
18
|
-
export declare const useProviders: ({ contextIdentifierProvider, mediaProvider, cardProvider, emojiProvider, autoformattingProvider, }: UseProvidersProps) => void;
|
|
31
|
+
export declare const useProviders: ({ editorApi, contextIdentifierProvider, mediaProvider, cardProvider, emojiProvider, autoformattingProvider, }: UseProvidersProps) => void;
|
|
19
32
|
export {};
|
|
@@ -30,6 +30,7 @@ export interface EditorViewProps {
|
|
|
30
30
|
portalProviderAPI: PortalProviderAPI;
|
|
31
31
|
disabled?: boolean;
|
|
32
32
|
experienceStore?: ExperienceStore;
|
|
33
|
+
editorAPI: PublicPluginAPI<any> | undefined;
|
|
33
34
|
setEditorApi?: SetEditorAPI;
|
|
34
35
|
render?: (props: {
|
|
35
36
|
editor: JSX.Element;
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { type OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
8
|
+
import { type EditorViewModePlugin } from '@atlaskit/editor-plugins/editor-viewmode';
|
|
8
9
|
import type { MaxContentSizePlugin } from '@atlaskit/editor-plugins/max-content-size';
|
|
9
10
|
import type { EditorAppearanceComponentProps } from '../../types';
|
|
10
11
|
type AppearanceProps = EditorAppearanceComponentProps<[
|
|
11
|
-
OptionalPlugin<MaxContentSizePlugin
|
|
12
|
+
OptionalPlugin<MaxContentSizePlugin>,
|
|
13
|
+
OptionalPlugin<EditorViewModePlugin>
|
|
12
14
|
]>;
|
|
13
15
|
export default class Editor extends React.Component<AppearanceProps> {
|
|
14
16
|
static displayName: string;
|
|
@@ -9,6 +9,7 @@ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
|
9
9
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
10
10
|
import type { OptionalPlugin, PublicPluginAPI, ReactHookFactory } from '@atlaskit/editor-common/types';
|
|
11
11
|
import { type ContextPanelPlugin } from '@atlaskit/editor-plugins/context-panel';
|
|
12
|
+
import { type ViewMode } from '@atlaskit/editor-plugins/editor-viewmode';
|
|
12
13
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
13
14
|
import type EditorActions from '../../../actions';
|
|
14
15
|
import type { EventDispatcher } from '../../../event-dispatcher';
|
|
@@ -36,6 +37,7 @@ interface FullPageEditorContentAreaProps {
|
|
|
36
37
|
providerFactory: ProviderFactory;
|
|
37
38
|
wrapperElement: HTMLElement | null;
|
|
38
39
|
featureFlags?: FeatureFlags;
|
|
40
|
+
viewMode: ViewMode | undefined;
|
|
39
41
|
isEditorToolbarHidden?: boolean;
|
|
40
42
|
}
|
|
41
43
|
export declare const CONTENT_AREA_TEST_ID = "ak-editor-fp-content-area";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "197.
|
|
3
|
+
"version": "197.13.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -87,7 +87,6 @@
|
|
|
87
87
|
"@atlaskit/collab-provider": "9.42.0",
|
|
88
88
|
"@atlaskit/editor-plugin-annotation": "1.19.8",
|
|
89
89
|
"@atlaskit/editor-plugin-card": "^3.2.0",
|
|
90
|
-
"@atlaskit/editor-plugin-editor-viewmode": "^2.1.0",
|
|
91
90
|
"@atlaskit/editor-plugin-list": "^3.8.0",
|
|
92
91
|
"@atlaskit/editor-plugin-paste": "^1.12.0",
|
|
93
92
|
"@atlaskit/editor-test-helpers": "*",
|
|
@@ -285,6 +284,9 @@
|
|
|
285
284
|
},
|
|
286
285
|
"platform_editor_ssr_fix_block_controls": {
|
|
287
286
|
"type": "boolean"
|
|
287
|
+
},
|
|
288
|
+
"platform_editor_remove_use_preset_context": {
|
|
289
|
+
"type": "boolean"
|
|
288
290
|
}
|
|
289
291
|
},
|
|
290
292
|
"stricter": {
|