@atlaskit/editor-core 187.48.2 → 187.48.5
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 +520 -507
- package/dist/cjs/plugins/insert-block/index.js +11 -15
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +3 -1
- package/dist/cjs/plugins/submit-editor/index.js +6 -5
- package/dist/cjs/ui/Appearance/Comment/Comment.js +19 -10
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/insert-block/index.js +6 -10
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +3 -1
- package/dist/es2019/plugins/submit-editor/index.js +6 -5
- package/dist/es2019/ui/Appearance/Comment/Comment.js +18 -10
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/insert-block/index.js +7 -11
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +3 -1
- package/dist/esm/plugins/submit-editor/index.js +6 -5
- package/dist/esm/ui/Appearance/Comment/Comment.js +16 -10
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/labs/next/presets/default.d.ts +230 -0
- package/dist/types/plugins/insert-block/types.d.ts +3 -1
- package/dist/types/plugins/submit-editor/index.d.ts +6 -3
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +298 -0
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +3 -1
- package/dist/types-ts4.5/plugins/submit-editor/index.d.ts +8 -3
- package/package.json +2 -2
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _providerFactory = require("@atlaskit/editor-common/provider-factory");
|
|
10
|
-
var _pluginKey = require("../media/pm-plugins/plugin-key");
|
|
11
10
|
var _utils = require("../type-ahead/utils");
|
|
12
11
|
var _layout = require("../layout");
|
|
13
12
|
var _macro = require("../macro");
|
|
@@ -16,8 +15,8 @@ var _ToolbarInsertBlock = _interopRequireDefault(require("./ui/ToolbarInsertBloc
|
|
|
16
15
|
var _key = require("../type-ahead/pm-plugins/key");
|
|
17
16
|
var _consts = require("@atlaskit/editor-plugin-block-type/consts");
|
|
18
17
|
var _analytics = require("../analytics");
|
|
19
|
-
var
|
|
20
|
-
var
|
|
18
|
+
var _pluginKey = require("../placeholder-text/plugin-key");
|
|
19
|
+
var _pluginKey2 = require("../macro/plugin-key");
|
|
21
20
|
var _types = require("../../ui/Toolbar/types");
|
|
22
21
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
23
22
|
var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize) {
|
|
@@ -79,14 +78,12 @@ var insertBlockPlugin = function insertBlockPlugin(_ref) {
|
|
|
79
78
|
return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
|
|
80
79
|
plugins: {
|
|
81
80
|
typeAheadState: _key.pluginKey,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
placeholderTextState: _pluginKey2.pluginKey,
|
|
81
|
+
macroState: _pluginKey2.pluginKey,
|
|
82
|
+
placeholderTextState: _pluginKey.pluginKey,
|
|
85
83
|
layoutState: _layout.pluginKey
|
|
86
84
|
},
|
|
87
85
|
render: function render(_ref3) {
|
|
88
|
-
var
|
|
89
|
-
_ref3$macroState = _ref3.macroState,
|
|
86
|
+
var _ref3$macroState = _ref3.macroState,
|
|
90
87
|
macroState = _ref3$macroState === void 0 ? {} : _ref3$macroState,
|
|
91
88
|
placeholderTextState = _ref3.placeholderTextState,
|
|
92
89
|
layoutState = _ref3.layoutState;
|
|
@@ -104,7 +101,6 @@ var insertBlockPlugin = function insertBlockPlugin(_ref) {
|
|
|
104
101
|
isToolbarReducedSpacing: isToolbarReducedSpacing,
|
|
105
102
|
isLastItem: isLastItem,
|
|
106
103
|
featureFlags: featureFlags,
|
|
107
|
-
mediaState: mediaState,
|
|
108
104
|
macroState: macroState,
|
|
109
105
|
placeholderTextState: placeholderTextState,
|
|
110
106
|
layoutState: layoutState,
|
|
@@ -123,7 +119,7 @@ var insertBlockPlugin = function insertBlockPlugin(_ref) {
|
|
|
123
119
|
};
|
|
124
120
|
};
|
|
125
121
|
function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
126
|
-
var _pluginInjectionApi$i, _pluginInjectionApi$c, _pluginInjectionApi$p, _pluginInjectionApi$b;
|
|
122
|
+
var _ref5, _ref6, _pluginInjectionApi$i, _pluginInjectionApi$c, _pluginInjectionApi$p, _pluginInjectionApi$b;
|
|
127
123
|
var editorView = _ref4.editorView,
|
|
128
124
|
editorActions = _ref4.editorActions,
|
|
129
125
|
dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent,
|
|
@@ -137,19 +133,19 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
|
137
133
|
providers = _ref4.providers,
|
|
138
134
|
pluginInjectionApi = _ref4.pluginInjectionApi,
|
|
139
135
|
options = _ref4.options,
|
|
140
|
-
mediaState = _ref4.mediaState,
|
|
141
136
|
macroState = _ref4.macroState,
|
|
142
137
|
placeholderTextState = _ref4.placeholderTextState,
|
|
143
138
|
layoutState = _ref4.layoutState,
|
|
144
139
|
featureFlags = _ref4.featureFlags;
|
|
145
140
|
var buttons = toolbarSizeToButtons(toolbarSize);
|
|
146
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType']),
|
|
141
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media']),
|
|
147
142
|
dateState = _useSharedPluginState.dateState,
|
|
148
143
|
hyperlinkState = _useSharedPluginState.hyperlinkState,
|
|
149
144
|
imageUploadState = _useSharedPluginState.imageUploadState,
|
|
150
145
|
mentionState = _useSharedPluginState.mentionState,
|
|
151
146
|
emojiState = _useSharedPluginState.emojiState,
|
|
152
|
-
blockTypeState = _useSharedPluginState.blockTypeState
|
|
147
|
+
blockTypeState = _useSharedPluginState.blockTypeState,
|
|
148
|
+
mediaState = _useSharedPluginState.mediaState;
|
|
153
149
|
return /*#__PURE__*/_react.default.createElement(_ToolbarInsertBlock.default, {
|
|
154
150
|
pluginInjectionApi: pluginInjectionApi,
|
|
155
151
|
buttons: buttons,
|
|
@@ -166,8 +162,8 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
|
166
162
|
placeholderTextEnabled: placeholderTextState && placeholderTextState.allowInserting,
|
|
167
163
|
layoutSectionEnabled: !!layoutState,
|
|
168
164
|
expandEnabled: !!options.allowExpand,
|
|
169
|
-
mediaUploadsEnabled: mediaState && mediaState.allowsUploads,
|
|
170
|
-
onShowMediaPicker: mediaState && mediaState.showMediaPicker,
|
|
165
|
+
mediaUploadsEnabled: (_ref5 = mediaState && mediaState.allowsUploads) !== null && _ref5 !== void 0 ? _ref5 : undefined,
|
|
166
|
+
onShowMediaPicker: (_ref6 = mediaState && mediaState.showMediaPicker) !== null && _ref6 !== void 0 ? _ref6 : undefined,
|
|
171
167
|
mediaSupported: !!mediaState,
|
|
172
168
|
imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.imageUpload),
|
|
173
169
|
imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
|
|
@@ -21,6 +21,7 @@ var _picker = require("@atlaskit/emoji/picker");
|
|
|
21
21
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
22
22
|
var _ToolbarButton = _interopRequireDefault(require("../../../../ui/ToolbarButton"));
|
|
23
23
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
24
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
24
25
|
var _actions = require("../../../date/actions");
|
|
25
26
|
var _actions2 = require("../../../placeholder-text/actions");
|
|
26
27
|
var _actions3 = require("../../../layout/actions");
|
|
@@ -438,7 +439,8 @@ var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
438
439
|
mountTo: popupsMountPoint,
|
|
439
440
|
boundariesElement: popupsBoundariesElement,
|
|
440
441
|
scrollableElement: popupsScrollableElement,
|
|
441
|
-
focusTrap: true
|
|
442
|
+
focusTrap: true,
|
|
443
|
+
zIndex: _editorSharedStyles.akEditorMenuZIndex
|
|
442
444
|
}, (0, _react2.jsx)(EmojiPickerWithListeners, {
|
|
443
445
|
emojiProvider: emojiProvider,
|
|
444
446
|
onSelection: this.handleSelectedEmoji,
|
|
@@ -10,14 +10,14 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _keymap2 = require("@atlaskit/editor-prosemirror/keymap");
|
|
11
11
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
12
12
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
|
-
var _pluginKey = require("../../plugins/media/pm-plugins/plugin-key");
|
|
14
13
|
var _consts = require("../analytics/consts");
|
|
15
|
-
function createPlugin(eventDispatch, onSave) {
|
|
14
|
+
function createPlugin(eventDispatch, api, onSave) {
|
|
16
15
|
if (!onSave) {
|
|
17
16
|
return;
|
|
18
17
|
}
|
|
19
18
|
return (0, _keymap2.keymap)((0, _defineProperty2.default)({}, "".concat(_keymaps.submit.common), function _(state, _dispatch, editorView) {
|
|
20
|
-
var
|
|
19
|
+
var _api$media, _api$media$sharedStat;
|
|
20
|
+
var mediaState = api === null || api === void 0 ? void 0 : (_api$media = api.media) === null || _api$media === void 0 ? void 0 : (_api$media$sharedStat = _api$media.sharedState) === null || _api$media$sharedStat === void 0 ? void 0 : _api$media$sharedStat.currentState();
|
|
21
21
|
if (mediaState && mediaState.waitForMediaUpload && !mediaState.allUploadsFinished) {
|
|
22
22
|
return true;
|
|
23
23
|
}
|
|
@@ -46,7 +46,8 @@ var analyticsPayload = function analyticsPayload(state) {
|
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
var submitEditorPlugin = function submitEditorPlugin(_ref) {
|
|
49
|
-
var onSave = _ref.config
|
|
49
|
+
var onSave = _ref.config,
|
|
50
|
+
api = _ref.api;
|
|
50
51
|
return {
|
|
51
52
|
name: 'submitEditor',
|
|
52
53
|
pmPlugins: function pmPlugins() {
|
|
@@ -54,7 +55,7 @@ var submitEditorPlugin = function submitEditorPlugin(_ref) {
|
|
|
54
55
|
name: 'submitEditor',
|
|
55
56
|
plugin: function plugin(_ref2) {
|
|
56
57
|
var dispatch = _ref2.dispatch;
|
|
57
|
-
return createPlugin(dispatch, onSave);
|
|
58
|
+
return createPlugin(dispatch, api, onSave);
|
|
58
59
|
}
|
|
59
60
|
}];
|
|
60
61
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -13,7 +14,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
16
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
16
|
-
var _react =
|
|
17
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
18
|
var _react2 = require("@emotion/react");
|
|
18
19
|
var _buttonGroup = _interopRequireDefault(require("@atlaskit/button/button-group"));
|
|
19
20
|
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
@@ -21,9 +22,6 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
21
22
|
var _colors = require("@atlaskit/theme/colors");
|
|
22
23
|
var _Toolbar = _interopRequireDefault(require("../../Toolbar"));
|
|
23
24
|
var _PluginSlot = _interopRequireDefault(require("../../PluginSlot"));
|
|
24
|
-
var _WithPluginState = _interopRequireDefault(require("../../WithPluginState"));
|
|
25
|
-
var _maxContentSize = require("../../../plugins/max-content-size");
|
|
26
|
-
var _pluginKey = require("../../../plugins/media/pm-plugins/plugin-key");
|
|
27
25
|
var _Addon = require("../../Addon");
|
|
28
26
|
var _commonStyles = require("@atlaskit/editor-plugin-table/ui/common-styles");
|
|
29
27
|
var _WithFlash = _interopRequireDefault(require("../../WithFlash"));
|
|
@@ -34,11 +32,15 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
34
32
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
35
33
|
var _reactIntlNext = require("react-intl-next");
|
|
36
34
|
var _messages = _interopRequireDefault(require("../../../messages"));
|
|
35
|
+
var _context = require("../../../presets/context");
|
|
37
36
|
var _Toolbar2 = require("./Toolbar");
|
|
38
37
|
var _ContentStyles = require("../../ContentStyles");
|
|
39
38
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
39
|
+
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
40
40
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
41
41
|
/** @jsx jsx */
|
|
42
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
43
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
42
44
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
43
45
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
44
46
|
var CommentEditorMargin = 14;
|
|
@@ -195,17 +197,24 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
195
197
|
(0, _createClass2.default)(Editor, [{
|
|
196
198
|
key: "render",
|
|
197
199
|
value: function render() {
|
|
198
|
-
return (0, _react2.jsx)(
|
|
199
|
-
|
|
200
|
-
maxContentSize: _maxContentSize.pluginKey,
|
|
201
|
-
mediaState: _pluginKey.stateKey
|
|
202
|
-
},
|
|
203
|
-
render: this.renderChrome
|
|
200
|
+
return (0, _react2.jsx)(RenderWithPluginState, {
|
|
201
|
+
renderChrome: this.renderChrome
|
|
204
202
|
});
|
|
205
203
|
}
|
|
206
204
|
}]);
|
|
207
205
|
return Editor;
|
|
208
206
|
}(_react.default.Component);
|
|
209
207
|
(0, _defineProperty2.default)(Editor, "displayName", 'CommentEditorAppearance');
|
|
208
|
+
function RenderWithPluginState(_ref4) {
|
|
209
|
+
var renderChrome = _ref4.renderChrome;
|
|
210
|
+
var api = (0, _context.usePresetContext)();
|
|
211
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['media', 'maxContentSize']),
|
|
212
|
+
mediaState = _useSharedPluginState.mediaState,
|
|
213
|
+
maxContentSizeState = _useSharedPluginState.maxContentSizeState;
|
|
214
|
+
return (0, _react2.jsx)(_react.Fragment, null, renderChrome({
|
|
215
|
+
maxContentSize: maxContentSizeState,
|
|
216
|
+
mediaState: mediaState
|
|
217
|
+
}));
|
|
218
|
+
}
|
|
210
219
|
var CommentEditorWithIntl = (0, _reactIntlNext.injectIntl)(Editor);
|
|
211
220
|
exports.CommentEditorWithIntl = CommentEditorWithIntl;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "187.48.
|
|
9
|
+
var version = "187.48.5";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import { stateKey as mediaStateKey } from '../media/pm-plugins/plugin-key';
|
|
4
3
|
import { isTypeAheadAllowed } from '../type-ahead/utils';
|
|
5
4
|
import { pluginKey as layoutStateKey } from '../layout';
|
|
6
5
|
import { insertMacroFromMacroBrowser } from '../macro';
|
|
@@ -71,13 +70,11 @@ const insertBlockPlugin = ({
|
|
|
71
70
|
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
72
71
|
plugins: {
|
|
73
72
|
typeAheadState: typeAheadPluginKey,
|
|
74
|
-
mediaState: mediaStateKey,
|
|
75
73
|
macroState: macroStateKey,
|
|
76
74
|
placeholderTextState: placeholderTextStateKey,
|
|
77
75
|
layoutState: layoutStateKey
|
|
78
76
|
},
|
|
79
77
|
render: ({
|
|
80
|
-
mediaState,
|
|
81
78
|
macroState = {},
|
|
82
79
|
placeholderTextState,
|
|
83
80
|
layoutState
|
|
@@ -96,7 +93,6 @@ const insertBlockPlugin = ({
|
|
|
96
93
|
isToolbarReducedSpacing: isToolbarReducedSpacing,
|
|
97
94
|
isLastItem: isLastItem,
|
|
98
95
|
featureFlags: featureFlags,
|
|
99
|
-
mediaState: mediaState,
|
|
100
96
|
macroState: macroState,
|
|
101
97
|
placeholderTextState: placeholderTextState,
|
|
102
98
|
layoutState: layoutState,
|
|
@@ -128,13 +124,12 @@ function ToolbarInsertBlockWithInjectionApi({
|
|
|
128
124
|
providers,
|
|
129
125
|
pluginInjectionApi,
|
|
130
126
|
options,
|
|
131
|
-
mediaState,
|
|
132
127
|
macroState,
|
|
133
128
|
placeholderTextState,
|
|
134
129
|
layoutState,
|
|
135
130
|
featureFlags
|
|
136
131
|
}) {
|
|
137
|
-
var _pluginInjectionApi$i, _pluginInjectionApi$c, _pluginInjectionApi$p, _pluginInjectionApi$b;
|
|
132
|
+
var _ref, _ref2, _pluginInjectionApi$i, _pluginInjectionApi$c, _pluginInjectionApi$p, _pluginInjectionApi$b;
|
|
138
133
|
const buttons = toolbarSizeToButtons(toolbarSize);
|
|
139
134
|
const {
|
|
140
135
|
dateState,
|
|
@@ -142,8 +137,9 @@ function ToolbarInsertBlockWithInjectionApi({
|
|
|
142
137
|
imageUploadState,
|
|
143
138
|
mentionState,
|
|
144
139
|
emojiState,
|
|
145
|
-
blockTypeState
|
|
146
|
-
|
|
140
|
+
blockTypeState,
|
|
141
|
+
mediaState
|
|
142
|
+
} = useSharedPluginState(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media']);
|
|
147
143
|
return /*#__PURE__*/React.createElement(ToolbarInsertBlock, {
|
|
148
144
|
pluginInjectionApi: pluginInjectionApi,
|
|
149
145
|
buttons: buttons,
|
|
@@ -160,8 +156,8 @@ function ToolbarInsertBlockWithInjectionApi({
|
|
|
160
156
|
placeholderTextEnabled: placeholderTextState && placeholderTextState.allowInserting,
|
|
161
157
|
layoutSectionEnabled: !!layoutState,
|
|
162
158
|
expandEnabled: !!options.allowExpand,
|
|
163
|
-
mediaUploadsEnabled: mediaState && mediaState.allowsUploads,
|
|
164
|
-
onShowMediaPicker: mediaState && mediaState.showMediaPicker,
|
|
159
|
+
mediaUploadsEnabled: (_ref = mediaState && mediaState.allowsUploads) !== null && _ref !== void 0 ? _ref : undefined,
|
|
160
|
+
onShowMediaPicker: (_ref2 = mediaState && mediaState.showMediaPicker) !== null && _ref2 !== void 0 ? _ref2 : undefined,
|
|
165
161
|
mediaSupported: !!mediaState,
|
|
166
162
|
imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.imageUpload),
|
|
167
163
|
imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
|
|
@@ -8,6 +8,7 @@ import { EmojiPicker as AkEmojiPicker } from '@atlaskit/emoji/picker';
|
|
|
8
8
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
9
9
|
import ToolbarButton from '../../../../ui/ToolbarButton';
|
|
10
10
|
import { separatorStyles, buttonGroupStyle, wrapperStyle } from '@atlaskit/editor-common/styles';
|
|
11
|
+
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
11
12
|
import { insertDate } from '../../../date/actions';
|
|
12
13
|
import { showPlaceholderFloatingToolbar } from '../../../placeholder-text/actions';
|
|
13
14
|
import { insertLayoutColumnsWithAnalytics } from '../../../layout/actions';
|
|
@@ -481,7 +482,8 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
481
482
|
mountTo: popupsMountPoint,
|
|
482
483
|
boundariesElement: popupsBoundariesElement,
|
|
483
484
|
scrollableElement: popupsScrollableElement,
|
|
484
|
-
focusTrap: true
|
|
485
|
+
focusTrap: true,
|
|
486
|
+
zIndex: akEditorMenuZIndex
|
|
485
487
|
}, jsx(EmojiPickerWithListeners, {
|
|
486
488
|
emojiProvider: emojiProvider,
|
|
487
489
|
onSelection: this.handleSelectedEmoji,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
2
2
|
import { submit } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { stateKey as mediaPluginKey } from '../../plugins/media/pm-plugins/plugin-key';
|
|
5
4
|
import { analyticsEventKey } from '../analytics/consts';
|
|
6
|
-
export function createPlugin(eventDispatch, onSave) {
|
|
5
|
+
export function createPlugin(eventDispatch, api, onSave) {
|
|
7
6
|
if (!onSave) {
|
|
8
7
|
return;
|
|
9
8
|
}
|
|
10
9
|
return keymap({
|
|
11
10
|
[`${submit.common}`]: (state, _dispatch, editorView) => {
|
|
12
|
-
|
|
11
|
+
var _api$media, _api$media$sharedStat;
|
|
12
|
+
const mediaState = api === null || api === void 0 ? void 0 : (_api$media = api.media) === null || _api$media === void 0 ? void 0 : (_api$media$sharedStat = _api$media.sharedState) === null || _api$media$sharedStat === void 0 ? void 0 : _api$media$sharedStat.currentState();
|
|
13
13
|
if (mediaState && mediaState.waitForMediaUpload && !mediaState.allUploadsFinished) {
|
|
14
14
|
return true;
|
|
15
15
|
}
|
|
@@ -37,7 +37,8 @@ const analyticsPayload = state => ({
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
const submitEditorPlugin = ({
|
|
40
|
-
config: onSave
|
|
40
|
+
config: onSave,
|
|
41
|
+
api
|
|
41
42
|
}) => ({
|
|
42
43
|
name: 'submitEditor',
|
|
43
44
|
pmPlugins() {
|
|
@@ -45,7 +46,7 @@ const submitEditorPlugin = ({
|
|
|
45
46
|
name: 'submitEditor',
|
|
46
47
|
plugin: ({
|
|
47
48
|
dispatch
|
|
48
|
-
}) => createPlugin(dispatch, onSave)
|
|
49
|
+
}) => createPlugin(dispatch, api, onSave)
|
|
49
50
|
}];
|
|
50
51
|
}
|
|
51
52
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { Fragment } from 'react';
|
|
4
4
|
import { css, jsx } from '@emotion/react';
|
|
5
5
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
6
6
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
@@ -8,9 +8,6 @@ import { borderRadius } from '@atlaskit/theme/constants';
|
|
|
8
8
|
import { N40 } from '@atlaskit/theme/colors';
|
|
9
9
|
import Toolbar from '../../Toolbar';
|
|
10
10
|
import PluginSlot from '../../PluginSlot';
|
|
11
|
-
import WithPluginState from '../../WithPluginState';
|
|
12
|
-
import { pluginKey as maxContentSizePluginKey } from '../../../plugins/max-content-size';
|
|
13
|
-
import { stateKey as mediaPluginKey } from '../../../plugins/media/pm-plugins/plugin-key';
|
|
14
11
|
import { ClickAreaBlock } from '../../Addon';
|
|
15
12
|
import { tableCommentEditorStyles } from '@atlaskit/editor-plugin-table/ui/common-styles';
|
|
16
13
|
import WithFlash from '../../WithFlash';
|
|
@@ -21,9 +18,11 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
21
18
|
import classnames from 'classnames';
|
|
22
19
|
import { injectIntl } from 'react-intl-next';
|
|
23
20
|
import messages from '../../../messages';
|
|
21
|
+
import { usePresetContext } from '../../../presets/context';
|
|
24
22
|
import { TableControlsPadding, MainToolbar, mainToolbarCustomComponentsSlotStyle } from './Toolbar';
|
|
25
23
|
import { createEditorContentStyle } from '../../ContentStyles';
|
|
26
24
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
25
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
27
26
|
const CommentEditorMargin = 14;
|
|
28
27
|
const commentEditorStyle = css`
|
|
29
28
|
display: flex;
|
|
@@ -223,14 +222,23 @@ class Editor extends React.Component {
|
|
|
223
222
|
}
|
|
224
223
|
}
|
|
225
224
|
render() {
|
|
226
|
-
return jsx(
|
|
227
|
-
|
|
228
|
-
maxContentSize: maxContentSizePluginKey,
|
|
229
|
-
mediaState: mediaPluginKey
|
|
230
|
-
},
|
|
231
|
-
render: this.renderChrome
|
|
225
|
+
return jsx(RenderWithPluginState, {
|
|
226
|
+
renderChrome: this.renderChrome
|
|
232
227
|
});
|
|
233
228
|
}
|
|
234
229
|
}
|
|
235
230
|
_defineProperty(Editor, "displayName", 'CommentEditorAppearance');
|
|
231
|
+
function RenderWithPluginState({
|
|
232
|
+
renderChrome
|
|
233
|
+
}) {
|
|
234
|
+
const api = usePresetContext();
|
|
235
|
+
const {
|
|
236
|
+
mediaState,
|
|
237
|
+
maxContentSizeState
|
|
238
|
+
} = useSharedPluginState(api, ['media', 'maxContentSize']);
|
|
239
|
+
return jsx(Fragment, null, renderChrome({
|
|
240
|
+
maxContentSize: maxContentSizeState,
|
|
241
|
+
mediaState
|
|
242
|
+
}));
|
|
243
|
+
}
|
|
236
244
|
export const CommentEditorWithIntl = injectIntl(Editor);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import { stateKey as mediaStateKey } from '../media/pm-plugins/plugin-key';
|
|
4
3
|
import { isTypeAheadAllowed } from '../type-ahead/utils';
|
|
5
4
|
import { pluginKey as layoutStateKey } from '../layout';
|
|
6
5
|
import { insertMacroFromMacroBrowser } from '../macro';
|
|
@@ -72,14 +71,12 @@ var insertBlockPlugin = function insertBlockPlugin(_ref) {
|
|
|
72
71
|
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
73
72
|
plugins: {
|
|
74
73
|
typeAheadState: typeAheadPluginKey,
|
|
75
|
-
mediaState: mediaStateKey,
|
|
76
74
|
macroState: macroStateKey,
|
|
77
75
|
placeholderTextState: placeholderTextStateKey,
|
|
78
76
|
layoutState: layoutStateKey
|
|
79
77
|
},
|
|
80
78
|
render: function render(_ref3) {
|
|
81
|
-
var
|
|
82
|
-
_ref3$macroState = _ref3.macroState,
|
|
79
|
+
var _ref3$macroState = _ref3.macroState,
|
|
83
80
|
macroState = _ref3$macroState === void 0 ? {} : _ref3$macroState,
|
|
84
81
|
placeholderTextState = _ref3.placeholderTextState,
|
|
85
82
|
layoutState = _ref3.layoutState;
|
|
@@ -97,7 +94,6 @@ var insertBlockPlugin = function insertBlockPlugin(_ref) {
|
|
|
97
94
|
isToolbarReducedSpacing: isToolbarReducedSpacing,
|
|
98
95
|
isLastItem: isLastItem,
|
|
99
96
|
featureFlags: featureFlags,
|
|
100
|
-
mediaState: mediaState,
|
|
101
97
|
macroState: macroState,
|
|
102
98
|
placeholderTextState: placeholderTextState,
|
|
103
99
|
layoutState: layoutState,
|
|
@@ -116,7 +112,7 @@ var insertBlockPlugin = function insertBlockPlugin(_ref) {
|
|
|
116
112
|
};
|
|
117
113
|
};
|
|
118
114
|
function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
119
|
-
var _pluginInjectionApi$i, _pluginInjectionApi$c, _pluginInjectionApi$p, _pluginInjectionApi$b;
|
|
115
|
+
var _ref5, _ref6, _pluginInjectionApi$i, _pluginInjectionApi$c, _pluginInjectionApi$p, _pluginInjectionApi$b;
|
|
120
116
|
var editorView = _ref4.editorView,
|
|
121
117
|
editorActions = _ref4.editorActions,
|
|
122
118
|
dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent,
|
|
@@ -130,19 +126,19 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
|
130
126
|
providers = _ref4.providers,
|
|
131
127
|
pluginInjectionApi = _ref4.pluginInjectionApi,
|
|
132
128
|
options = _ref4.options,
|
|
133
|
-
mediaState = _ref4.mediaState,
|
|
134
129
|
macroState = _ref4.macroState,
|
|
135
130
|
placeholderTextState = _ref4.placeholderTextState,
|
|
136
131
|
layoutState = _ref4.layoutState,
|
|
137
132
|
featureFlags = _ref4.featureFlags;
|
|
138
133
|
var buttons = toolbarSizeToButtons(toolbarSize);
|
|
139
|
-
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType']),
|
|
134
|
+
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media']),
|
|
140
135
|
dateState = _useSharedPluginState.dateState,
|
|
141
136
|
hyperlinkState = _useSharedPluginState.hyperlinkState,
|
|
142
137
|
imageUploadState = _useSharedPluginState.imageUploadState,
|
|
143
138
|
mentionState = _useSharedPluginState.mentionState,
|
|
144
139
|
emojiState = _useSharedPluginState.emojiState,
|
|
145
|
-
blockTypeState = _useSharedPluginState.blockTypeState
|
|
140
|
+
blockTypeState = _useSharedPluginState.blockTypeState,
|
|
141
|
+
mediaState = _useSharedPluginState.mediaState;
|
|
146
142
|
return /*#__PURE__*/React.createElement(ToolbarInsertBlock, {
|
|
147
143
|
pluginInjectionApi: pluginInjectionApi,
|
|
148
144
|
buttons: buttons,
|
|
@@ -159,8 +155,8 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
|
159
155
|
placeholderTextEnabled: placeholderTextState && placeholderTextState.allowInserting,
|
|
160
156
|
layoutSectionEnabled: !!layoutState,
|
|
161
157
|
expandEnabled: !!options.allowExpand,
|
|
162
|
-
mediaUploadsEnabled: mediaState && mediaState.allowsUploads,
|
|
163
|
-
onShowMediaPicker: mediaState && mediaState.showMediaPicker,
|
|
158
|
+
mediaUploadsEnabled: (_ref5 = mediaState && mediaState.allowsUploads) !== null && _ref5 !== void 0 ? _ref5 : undefined,
|
|
159
|
+
onShowMediaPicker: (_ref6 = mediaState && mediaState.showMediaPicker) !== null && _ref6 !== void 0 ? _ref6 : undefined,
|
|
164
160
|
mediaSupported: !!mediaState,
|
|
165
161
|
imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.imageUpload),
|
|
166
162
|
imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
|
|
@@ -19,6 +19,7 @@ import { EmojiPicker as AkEmojiPicker } from '@atlaskit/emoji/picker';
|
|
|
19
19
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
20
20
|
import ToolbarButton from '../../../../ui/ToolbarButton';
|
|
21
21
|
import { separatorStyles, buttonGroupStyle, wrapperStyle } from '@atlaskit/editor-common/styles';
|
|
22
|
+
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
22
23
|
import { insertDate } from '../../../date/actions';
|
|
23
24
|
import { showPlaceholderFloatingToolbar } from '../../../placeholder-text/actions';
|
|
24
25
|
import { insertLayoutColumnsWithAnalytics } from '../../../layout/actions';
|
|
@@ -433,7 +434,8 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
433
434
|
mountTo: popupsMountPoint,
|
|
434
435
|
boundariesElement: popupsBoundariesElement,
|
|
435
436
|
scrollableElement: popupsScrollableElement,
|
|
436
|
-
focusTrap: true
|
|
437
|
+
focusTrap: true,
|
|
438
|
+
zIndex: akEditorMenuZIndex
|
|
437
439
|
}, jsx(EmojiPickerWithListeners, {
|
|
438
440
|
emojiProvider: emojiProvider,
|
|
439
441
|
onSelection: this.handleSelectedEmoji,
|
|
@@ -2,14 +2,14 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
3
3
|
import { submit } from '@atlaskit/editor-common/keymaps';
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
|
-
import { stateKey as mediaPluginKey } from '../../plugins/media/pm-plugins/plugin-key';
|
|
6
5
|
import { analyticsEventKey } from '../analytics/consts';
|
|
7
|
-
export function createPlugin(eventDispatch, onSave) {
|
|
6
|
+
export function createPlugin(eventDispatch, api, onSave) {
|
|
8
7
|
if (!onSave) {
|
|
9
8
|
return;
|
|
10
9
|
}
|
|
11
10
|
return keymap(_defineProperty({}, "".concat(submit.common), function _(state, _dispatch, editorView) {
|
|
12
|
-
var
|
|
11
|
+
var _api$media, _api$media$sharedStat;
|
|
12
|
+
var mediaState = api === null || api === void 0 ? void 0 : (_api$media = api.media) === null || _api$media === void 0 ? void 0 : (_api$media$sharedStat = _api$media.sharedState) === null || _api$media$sharedStat === void 0 ? void 0 : _api$media$sharedStat.currentState();
|
|
13
13
|
if (mediaState && mediaState.waitForMediaUpload && !mediaState.allUploadsFinished) {
|
|
14
14
|
return true;
|
|
15
15
|
}
|
|
@@ -38,7 +38,8 @@ var analyticsPayload = function analyticsPayload(state) {
|
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
var submitEditorPlugin = function submitEditorPlugin(_ref) {
|
|
41
|
-
var onSave = _ref.config
|
|
41
|
+
var onSave = _ref.config,
|
|
42
|
+
api = _ref.api;
|
|
42
43
|
return {
|
|
43
44
|
name: 'submitEditor',
|
|
44
45
|
pmPlugins: function pmPlugins() {
|
|
@@ -46,7 +47,7 @@ var submitEditorPlugin = function submitEditorPlugin(_ref) {
|
|
|
46
47
|
name: 'submitEditor',
|
|
47
48
|
plugin: function plugin(_ref2) {
|
|
48
49
|
var dispatch = _ref2.dispatch;
|
|
49
|
-
return createPlugin(dispatch, onSave);
|
|
50
|
+
return createPlugin(dispatch, api, onSave);
|
|
50
51
|
}
|
|
51
52
|
}];
|
|
52
53
|
}
|
|
@@ -10,7 +10,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
10
10
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
12
|
/** @jsx jsx */
|
|
13
|
-
import React from 'react';
|
|
13
|
+
import React, { Fragment } from 'react';
|
|
14
14
|
import { css, jsx } from '@emotion/react';
|
|
15
15
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
16
16
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
@@ -18,9 +18,6 @@ import { borderRadius } from '@atlaskit/theme/constants';
|
|
|
18
18
|
import { N40 } from '@atlaskit/theme/colors';
|
|
19
19
|
import Toolbar from '../../Toolbar';
|
|
20
20
|
import PluginSlot from '../../PluginSlot';
|
|
21
|
-
import WithPluginState from '../../WithPluginState';
|
|
22
|
-
import { pluginKey as maxContentSizePluginKey } from '../../../plugins/max-content-size';
|
|
23
|
-
import { stateKey as mediaPluginKey } from '../../../plugins/media/pm-plugins/plugin-key';
|
|
24
21
|
import { ClickAreaBlock } from '../../Addon';
|
|
25
22
|
import { tableCommentEditorStyles } from '@atlaskit/editor-plugin-table/ui/common-styles';
|
|
26
23
|
import WithFlash from '../../WithFlash';
|
|
@@ -31,9 +28,11 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
31
28
|
import classnames from 'classnames';
|
|
32
29
|
import { injectIntl } from 'react-intl-next';
|
|
33
30
|
import messages from '../../../messages';
|
|
31
|
+
import { usePresetContext } from '../../../presets/context';
|
|
34
32
|
import { TableControlsPadding, MainToolbar, mainToolbarCustomComponentsSlotStyle } from './Toolbar';
|
|
35
33
|
import { createEditorContentStyle } from '../../ContentStyles';
|
|
36
34
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
35
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
37
36
|
var CommentEditorMargin = 14;
|
|
38
37
|
var commentEditorStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n\n .less-margin .ProseMirror {\n margin: ", " ", "\n ", ";\n }\n\n min-width: 272px;\n /* Border + Toolbar + Footer + (Paragraph + ((Paragraph + Margin) * (DefaultLines - 1)) */\n /* calc(2px + 40px + 24px + ( 20px + (32px * 2))) */\n\n height: auto;\n background-color: ", ";\n border: 1px solid ", ";\n box-sizing: border-box;\n border-radius: ", "px;\n\n max-width: inherit;\n word-wrap: break-word;\n"])), "var(--ds-space-150, 12px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-background-input, white)", "var(--ds-border, ".concat(N40, ")"), borderRadius());
|
|
39
38
|
var ContentArea = createEditorContentStyle(css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-grow: 1;\n overflow-x: ", ";\n line-height: 24px;\n\n /** Hack for Bitbucket to ensure entire editorView gets drop event; see ED-3294 **/\n /** Hack for table controls. Otherwise margin collapse and controls are misplaced. **/\n .ProseMirror {\n margin: ", " ", "px\n ", "px;\n }\n\n .gridParent {\n margin-left: ", "px;\n margin-right: ", "px;\n width: calc(100% + ", "px);\n }\n\n padding: ", "px;\n\n ", ";\n"])), getBooleanFF('platform.editor.table-sticky-scrollbar') ? 'clip' : 'hidden', "var(--ds-space-150, 12px)", CommentEditorMargin, CommentEditorMargin, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, TableControlsPadding, tableCommentEditorStyles));
|
|
@@ -188,16 +187,23 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
188
187
|
_createClass(Editor, [{
|
|
189
188
|
key: "render",
|
|
190
189
|
value: function render() {
|
|
191
|
-
return jsx(
|
|
192
|
-
|
|
193
|
-
maxContentSize: maxContentSizePluginKey,
|
|
194
|
-
mediaState: mediaPluginKey
|
|
195
|
-
},
|
|
196
|
-
render: this.renderChrome
|
|
190
|
+
return jsx(RenderWithPluginState, {
|
|
191
|
+
renderChrome: this.renderChrome
|
|
197
192
|
});
|
|
198
193
|
}
|
|
199
194
|
}]);
|
|
200
195
|
return Editor;
|
|
201
196
|
}(React.Component);
|
|
202
197
|
_defineProperty(Editor, "displayName", 'CommentEditorAppearance');
|
|
198
|
+
function RenderWithPluginState(_ref4) {
|
|
199
|
+
var renderChrome = _ref4.renderChrome;
|
|
200
|
+
var api = usePresetContext();
|
|
201
|
+
var _useSharedPluginState = useSharedPluginState(api, ['media', 'maxContentSize']),
|
|
202
|
+
mediaState = _useSharedPluginState.mediaState,
|
|
203
|
+
maxContentSizeState = _useSharedPluginState.maxContentSizeState;
|
|
204
|
+
return jsx(Fragment, null, renderChrome({
|
|
205
|
+
maxContentSize: maxContentSizeState,
|
|
206
|
+
mediaState: mediaState
|
|
207
|
+
}));
|
|
208
|
+
}
|
|
203
209
|
export var CommentEditorWithIntl = injectIntl(Editor);
|