@atlaskit/editor-core 194.0.0 → 194.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 194.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#117063](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117063)
8
+ [`dbb832d0b1929`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dbb832d0b1929) -
9
+ clean up FF platform.editor.media.alluploadsfinished-dispatch-update_ivtow
10
+
3
11
  ## 194.0.0
4
12
 
5
13
  ### Major Changes
@@ -7,13 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.CommentEditorWithIntl = void 0;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
13
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
15
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
16
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
10
  var _react = _interopRequireWildcard(require("react"));
18
11
  var _react2 = require("@emotion/react");
19
12
  var _classnames = _interopRequireDefault(require("classnames"));
@@ -39,8 +32,10 @@ var _WithFlash = _interopRequireDefault(require("../../WithFlash"));
39
32
  var _Toolbar2 = require("./Toolbar");
40
33
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
41
34
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
42
- 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
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
35
+ /** @jsx jsx */
36
+
37
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
38
+
44
39
  var CommentEditorMargin = 14;
45
40
  var commentEditorStyles = (0, _react2.css)({
46
41
  display: 'flex',
@@ -62,7 +57,7 @@ var commentEditorStyles = (0, _react2.css)({
62
57
  var ContentArea = (0, _ContentStyles.createEditorContentStyle)((0, _react2.css)({
63
58
  flexGrow: 1,
64
59
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
65
- overflowX: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table-sticky-scrollbar') ? 'clip' : 'hidden',
60
+ overflowX: (0, _platformFeatureFlags.fg)('platform.editor.table-sticky-scrollbar') ? 'clip' : 'hidden',
66
61
  lineHeight: '24px',
67
62
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
68
63
  '.ProseMirror': {
@@ -88,204 +83,12 @@ var secondaryToolbarStyles = (0, _react2.css)({
88
83
  padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-025, 2px)")
89
84
  });
90
85
  var appearance = 'comment';
91
- var Editor = /*#__PURE__*/function (_React$Component) {
92
- (0, _inherits2.default)(Editor, _React$Component);
93
- var _super = _createSuper(Editor);
94
- function Editor(props) {
95
- var _this;
96
- (0, _classCallCheck2.default)(this, Editor);
97
- _this = _super.call(this, props);
98
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "appearance", 'comment');
99
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "containerElement", null);
100
- // Wrapper container for toolbar and content area
101
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "wrapperElementRef", /*#__PURE__*/_react.default.createRef());
102
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleSave", function () {
103
- if (_this.props.editorView && _this.props.onSave) {
104
- _this.props.onSave(_this.props.editorView);
105
- }
106
- });
107
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleCancel", function () {
108
- if (_this.props.editorView && _this.props.onCancel) {
109
- _this.props.onCancel(_this.props.editorView);
110
- }
111
- });
112
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderChrome", function (_ref) {
113
- var maxContentSize = _ref.maxContentSize,
114
- mediaState = _ref.mediaState,
115
- primaryToolbarState = _ref.primaryToolbarState;
116
- var _this$props = _this.props,
117
- editorDOMElement = _this$props.editorDOMElement,
118
- editorView = _this$props.editorView,
119
- editorActions = _this$props.editorActions,
120
- eventDispatcher = _this$props.eventDispatcher,
121
- providerFactory = _this$props.providerFactory,
122
- contentComponents = _this$props.contentComponents,
123
- customContentComponents = _this$props.customContentComponents,
124
- customPrimaryToolbarComponents = _this$props.customPrimaryToolbarComponents,
125
- primaryToolbarComponentsProp = _this$props.primaryToolbarComponents,
126
- customSecondaryToolbarComponents = _this$props.customSecondaryToolbarComponents,
127
- popupsMountPoint = _this$props.popupsMountPoint,
128
- popupsBoundariesElement = _this$props.popupsBoundariesElement,
129
- popupsScrollableElement = _this$props.popupsScrollableElement,
130
- maxHeight = _this$props.maxHeight,
131
- _this$props$minHeight = _this$props.minHeight,
132
- minHeight = _this$props$minHeight === void 0 ? 150 : _this$props$minHeight,
133
- onSave = _this$props.onSave,
134
- onCancel = _this$props.onCancel,
135
- disabled = _this$props.disabled,
136
- dispatchAnalyticsEvent = _this$props.dispatchAnalyticsEvent,
137
- intl = _this$props.intl,
138
- useStickyToolbar = _this$props.useStickyToolbar,
139
- pluginHooks = _this$props.pluginHooks,
140
- featureFlags = _this$props.featureFlags;
141
- var maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
142
- var showSecondaryToolbar = !!onSave || !!onCancel || !!customSecondaryToolbarComponents;
143
- var isShortcutToFocusToolbar = function isShortcutToFocusToolbar(event) {
144
- //Alt + F9 to reach first element in this main toolbar
145
- return event.altKey && (event.key === 'F9' || event.keyCode === 120);
146
- };
147
- var isTwoLineToolbarEnabled = !!customPrimaryToolbarComponents && !!(featureFlags !== null && featureFlags !== void 0 && featureFlags.twoLineEditorToolbar);
148
- var handleEscape = function handleEscape(event) {
149
- if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
150
- editorView === null || editorView === void 0 || editorView.focus();
151
- }
152
- event.preventDefault();
153
- event.stopPropagation();
154
- };
155
- var primaryToolbarComponents = primaryToolbarComponentsProp;
156
- if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
157
- primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
158
- }
159
- return (0, _react2.jsx)(_WithFlash.default, {
160
- animate: maxContentSizeReached
161
- }, (0, _react2.jsx)("div", {
162
- css: [commentEditorStyles,
163
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
164
- (0, _react2.css)({
165
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
166
- minHeight: "".concat(minHeight, "px")
167
- })]
168
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
169
- ,
170
- className: "akEditor",
171
- ref: _this.wrapperElementRef
172
- }, (0, _react2.jsx)(_Toolbar2.MainToolbar, {
173
- useStickyToolbar: useStickyToolbar,
174
- twoLineEditorToolbar: isTwoLineToolbarEnabled
175
- }, (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
176
- editorView: editorView,
177
- childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
178
- isShortcutToFocusToolbar: isShortcutToFocusToolbar,
179
- handleEscape: handleEscape,
180
- editorAppearance: _this.appearance,
181
- useStickyToolbar: useStickyToolbar,
182
- intl: intl
183
- }, (0, _react2.jsx)(_Toolbar.default, {
184
- editorView: editorView,
185
- editorActions: editorActions,
186
- eventDispatcher: eventDispatcher,
187
- providerFactory: providerFactory,
188
- appearance: _this.appearance,
189
- items: primaryToolbarComponents,
190
- popupsMountPoint: popupsMountPoint,
191
- popupsBoundariesElement: popupsBoundariesElement,
192
- popupsScrollableElement: popupsScrollableElement,
193
- disabled: !!disabled,
194
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
195
- containerElement: _this.containerElement,
196
- twoLineEditorToolbar: isTwoLineToolbarEnabled
197
- }), (0, _react2.jsx)("div", {
198
- css: (0, _Toolbar2.mainToolbarCustomComponentsSlotStyle)(isTwoLineToolbarEnabled)
199
- }, customPrimaryToolbarComponents))), (0, _react2.jsx)(_Addon.ClickAreaBlock, {
200
- editorView: editorView,
201
- editorDisabled: disabled
202
- }, (0, _react2.jsx)(_ui.WidthConsumer, null, function (_ref2) {
203
- var width = _ref2.width;
204
- return (0, _react2.jsx)(ContentArea, {
205
- ref: function ref(_ref3) {
206
- return _this.containerElement = _ref3;
207
- },
208
- css: maxHeight ?
209
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
210
- (0, _react2.css)({
211
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
212
- maxHeight: "".concat(maxHeight, "px")
213
- }) : null
214
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
215
- ,
216
- className: (0, _classnames.default)('ak-editor-content-area', {
217
- 'less-margin': width < _editorSharedStyles.akEditorMobileBreakoutPoint
218
- }),
219
- featureFlags: featureFlags
220
- }, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, (0, _react2.jsx)(_PluginSlot.default, {
221
- editorView: editorView,
222
- editorActions: editorActions,
223
- eventDispatcher: eventDispatcher,
224
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
225
- providerFactory: providerFactory,
226
- appearance: _this.appearance,
227
- items: contentComponents,
228
- popupsMountPoint: popupsMountPoint,
229
- popupsBoundariesElement: popupsBoundariesElement,
230
- popupsScrollableElement: popupsScrollableElement,
231
- containerElement: _this.containerElement,
232
- disabled: !!disabled,
233
- wrapperElement: _this.wrapperElementRef.current,
234
- pluginHooks: pluginHooks
235
- }), editorDOMElement, customContentComponents && 'after' in customContentComponents ? customContentComponents.after : null);
236
- }))), showSecondaryToolbar && (0, _react2.jsx)("div", {
237
- css: secondaryToolbarStyles,
238
- "data-testid": "ak-editor-secondary-toolbar"
239
- }, (0, _react2.jsx)(_buttonGroup.default, null, !!onSave && (0, _react2.jsx)(_new.default, {
240
- appearance: "primary",
241
- onClick: _this.handleSave,
242
- testId: "comment-save-button",
243
- isDisabled: disabled || mediaState && !mediaState.allUploadsFinished
244
- }, intl.formatMessage(_messages.default.saveButton)), !!onCancel && (0, _react2.jsx)(_new.default, {
245
- appearance: "subtle",
246
- onClick: _this.handleCancel,
247
- isDisabled: disabled
248
- }, intl.formatMessage(_messages.default.cancelButton))), (0, _react2.jsx)("span", {
249
- style: {
250
- flexGrow: 1
251
- }
252
- }), customSecondaryToolbarComponents));
253
- });
254
- if (props.innerRef) {
255
- _this.wrapperElementRef = props.innerRef;
256
- }
257
- return _this;
258
- }
259
- (0, _createClass2.default)(Editor, [{
260
- key: "render",
261
- value: function render() {
262
- return (0, _react2.jsx)(RenderWithPluginState, {
263
- renderChrome: this.renderChrome
264
- });
265
- }
266
- }]);
267
- return Editor;
268
- }(_react.default.Component);
269
- (0, _defineProperty2.default)(Editor, "displayName", 'CommentEditorAppearance');
270
- function RenderWithPluginState(_ref4) {
271
- var renderChrome = _ref4.renderChrome;
86
+ var Editor = function Editor(props) {
272
87
  var api = (0, _context.usePresetContext)();
273
88
  var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['media', 'maxContentSize', 'primaryToolbar']),
274
89
  mediaState = _useSharedPluginState.mediaState,
275
90
  maxContentSizeState = _useSharedPluginState.maxContentSizeState,
276
91
  primaryToolbarState = _useSharedPluginState.primaryToolbarState;
277
- return (0, _react2.jsx)(_react.Fragment, null, renderChrome({
278
- maxContentSize: maxContentSizeState,
279
- mediaState: mediaState !== null && mediaState !== void 0 ? mediaState : undefined,
280
- primaryToolbarState: primaryToolbarState
281
- }));
282
- }
283
- var EditorNext = function EditorNext(props) {
284
- var api = (0, _context.usePresetContext)();
285
- var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['media', 'maxContentSize', 'primaryToolbar']),
286
- mediaState = _useSharedPluginState2.mediaState,
287
- maxContentSizeState = _useSharedPluginState2.maxContentSizeState,
288
- primaryToolbarState = _useSharedPluginState2.primaryToolbarState;
289
92
  var editorDOMElement = props.editorDOMElement,
290
93
  editorView = props.editorView,
291
94
  editorActions = props.editorActions,
@@ -400,8 +203,8 @@ var EditorNext = function EditorNext(props) {
400
203
  }, customPrimaryToolbarComponents))), (0, _react2.jsx)(_Addon.ClickAreaBlock, {
401
204
  editorView: editorView,
402
205
  editorDisabled: disabled
403
- }, (0, _react2.jsx)(_ui.WidthConsumer, null, function (_ref5) {
404
- var width = _ref5.width;
206
+ }, (0, _react2.jsx)(_ui.WidthConsumer, null, function (_ref) {
207
+ var width = _ref.width;
405
208
  return (0, _react2.jsx)(ContentArea, {
406
209
  ref: containerElement,
407
210
  css: maxHeight ?
@@ -450,8 +253,5 @@ var EditorNext = function EditorNext(props) {
450
253
  }
451
254
  }), customSecondaryToolbarComponents));
452
255
  };
453
- EditorNext.displayName = 'CommentEditorAppearance';
454
- var CommentEditorNextWithIntl = (0, _reactIntlNext.injectIntl)(EditorNext);
455
- var CommentEditorOldWithIntl = (0, _reactIntlNext.injectIntl)(Editor);
456
- var ExportComp = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.media.alluploadsfinished-dispatch-update_ivtow') ? CommentEditorNextWithIntl : CommentEditorOldWithIntl;
457
- var CommentEditorWithIntl = exports.CommentEditorWithIntl = ExportComp;
256
+ Editor.displayName = 'CommentEditorAppearance';
257
+ var CommentEditorWithIntl = exports.CommentEditorWithIntl = (0, _reactIntlNext.injectIntl)(Editor);
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "194.0.0";
8
+ var version = exports.version = "194.0.1";
@@ -1,6 +1,5 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
1
  /** @jsx jsx */
3
- import React, { Fragment, useCallback, useEffect, useMemo, useState } from 'react';
2
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
4
3
 
5
4
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
5
  import { css, jsx } from '@emotion/react';
@@ -14,7 +13,7 @@ import { WidthConsumer } from '@atlaskit/editor-common/ui';
14
13
  import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
15
14
  import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
16
15
  import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
17
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
18
17
  import { N100 } from '@atlaskit/theme/colors';
19
18
  import { borderRadius } from '@atlaskit/theme/constants';
20
19
  import messages from '../../../messages';
@@ -46,7 +45,7 @@ const commentEditorStyles = css({
46
45
  const ContentArea = createEditorContentStyle(css({
47
46
  flexGrow: 1,
48
47
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
49
- overflowX: getBooleanFF('platform.editor.table-sticky-scrollbar') ? 'clip' : 'hidden',
48
+ overflowX: fg('platform.editor.table-sticky-scrollbar') ? 'clip' : 'hidden',
50
49
  lineHeight: '24px',
51
50
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
52
51
  '.ProseMirror': {
@@ -72,192 +71,7 @@ const secondaryToolbarStyles = css({
72
71
  padding: `${"var(--ds-space-150, 12px)"} ${"var(--ds-space-025, 2px)"}`
73
72
  });
74
73
  const appearance = 'comment';
75
- class Editor extends React.Component {
76
- constructor(props) {
77
- super(props);
78
- _defineProperty(this, "appearance", 'comment');
79
- _defineProperty(this, "containerElement", null);
80
- // Wrapper container for toolbar and content area
81
- _defineProperty(this, "wrapperElementRef", /*#__PURE__*/React.createRef());
82
- _defineProperty(this, "handleSave", () => {
83
- if (this.props.editorView && this.props.onSave) {
84
- this.props.onSave(this.props.editorView);
85
- }
86
- });
87
- _defineProperty(this, "handleCancel", () => {
88
- if (this.props.editorView && this.props.onCancel) {
89
- this.props.onCancel(this.props.editorView);
90
- }
91
- });
92
- _defineProperty(this, "renderChrome", ({
93
- maxContentSize,
94
- mediaState,
95
- primaryToolbarState
96
- }) => {
97
- const {
98
- editorDOMElement,
99
- editorView,
100
- editorActions,
101
- eventDispatcher,
102
- providerFactory,
103
- contentComponents,
104
- customContentComponents,
105
- customPrimaryToolbarComponents,
106
- primaryToolbarComponents: primaryToolbarComponentsProp,
107
- customSecondaryToolbarComponents,
108
- popupsMountPoint,
109
- popupsBoundariesElement,
110
- popupsScrollableElement,
111
- maxHeight,
112
- minHeight = 150,
113
- onSave,
114
- onCancel,
115
- disabled,
116
- dispatchAnalyticsEvent,
117
- intl,
118
- useStickyToolbar,
119
- pluginHooks,
120
- featureFlags
121
- } = this.props;
122
- const maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
123
- const showSecondaryToolbar = !!onSave || !!onCancel || !!customSecondaryToolbarComponents;
124
- const isShortcutToFocusToolbar = event => {
125
- //Alt + F9 to reach first element in this main toolbar
126
- return event.altKey && (event.key === 'F9' || event.keyCode === 120);
127
- };
128
- const isTwoLineToolbarEnabled = !!customPrimaryToolbarComponents && !!(featureFlags !== null && featureFlags !== void 0 && featureFlags.twoLineEditorToolbar);
129
- const handleEscape = event => {
130
- if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
131
- editorView === null || editorView === void 0 ? void 0 : editorView.focus();
132
- }
133
- event.preventDefault();
134
- event.stopPropagation();
135
- };
136
- let primaryToolbarComponents = primaryToolbarComponentsProp;
137
- if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
138
- primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
139
- }
140
- return jsx(WithFlash, {
141
- animate: maxContentSizeReached
142
- }, jsx("div", {
143
- css: [commentEditorStyles,
144
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
145
- css({
146
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
147
- minHeight: `${minHeight}px`
148
- })]
149
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
150
- ,
151
- className: "akEditor",
152
- ref: this.wrapperElementRef
153
- }, jsx(MainToolbar, {
154
- useStickyToolbar: useStickyToolbar,
155
- twoLineEditorToolbar: isTwoLineToolbarEnabled
156
- }, jsx(ToolbarArrowKeyNavigationProvider, {
157
- editorView: editorView,
158
- childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
159
- isShortcutToFocusToolbar: isShortcutToFocusToolbar,
160
- handleEscape: handleEscape,
161
- editorAppearance: this.appearance,
162
- useStickyToolbar: useStickyToolbar,
163
- intl: intl
164
- }, jsx(Toolbar, {
165
- editorView: editorView,
166
- editorActions: editorActions,
167
- eventDispatcher: eventDispatcher,
168
- providerFactory: providerFactory,
169
- appearance: this.appearance,
170
- items: primaryToolbarComponents,
171
- popupsMountPoint: popupsMountPoint,
172
- popupsBoundariesElement: popupsBoundariesElement,
173
- popupsScrollableElement: popupsScrollableElement,
174
- disabled: !!disabled,
175
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
176
- containerElement: this.containerElement,
177
- twoLineEditorToolbar: isTwoLineToolbarEnabled
178
- }), jsx("div", {
179
- css: mainToolbarCustomComponentsSlotStyle(isTwoLineToolbarEnabled)
180
- }, customPrimaryToolbarComponents))), jsx(ClickAreaBlock, {
181
- editorView: editorView,
182
- editorDisabled: disabled
183
- }, jsx(WidthConsumer, null, ({
184
- width
185
- }) => {
186
- return jsx(ContentArea, {
187
- ref: ref => this.containerElement = ref,
188
- css: maxHeight ?
189
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
190
- css({
191
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
192
- maxHeight: `${maxHeight}px`
193
- }) : null
194
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
195
- ,
196
- className: classnames('ak-editor-content-area', {
197
- 'less-margin': width < akEditorMobileBreakoutPoint
198
- }),
199
- featureFlags: featureFlags
200
- }, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, jsx(PluginSlot, {
201
- editorView: editorView,
202
- editorActions: editorActions,
203
- eventDispatcher: eventDispatcher,
204
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
205
- providerFactory: providerFactory,
206
- appearance: this.appearance,
207
- items: contentComponents,
208
- popupsMountPoint: popupsMountPoint,
209
- popupsBoundariesElement: popupsBoundariesElement,
210
- popupsScrollableElement: popupsScrollableElement,
211
- containerElement: this.containerElement,
212
- disabled: !!disabled,
213
- wrapperElement: this.wrapperElementRef.current,
214
- pluginHooks: pluginHooks
215
- }), editorDOMElement, customContentComponents && 'after' in customContentComponents ? customContentComponents.after : null);
216
- }))), showSecondaryToolbar && jsx("div", {
217
- css: secondaryToolbarStyles,
218
- "data-testid": "ak-editor-secondary-toolbar"
219
- }, jsx(ButtonGroup, null, !!onSave && jsx(Button, {
220
- appearance: "primary",
221
- onClick: this.handleSave,
222
- testId: "comment-save-button",
223
- isDisabled: disabled || mediaState && !mediaState.allUploadsFinished
224
- }, intl.formatMessage(messages.saveButton)), !!onCancel && jsx(Button, {
225
- appearance: "subtle",
226
- onClick: this.handleCancel,
227
- isDisabled: disabled
228
- }, intl.formatMessage(messages.cancelButton))), jsx("span", {
229
- style: {
230
- flexGrow: 1
231
- }
232
- }), customSecondaryToolbarComponents));
233
- });
234
- if (props.innerRef) {
235
- this.wrapperElementRef = props.innerRef;
236
- }
237
- }
238
- render() {
239
- return jsx(RenderWithPluginState, {
240
- renderChrome: this.renderChrome
241
- });
242
- }
243
- }
244
- _defineProperty(Editor, "displayName", 'CommentEditorAppearance');
245
- function RenderWithPluginState({
246
- renderChrome
247
- }) {
248
- const api = usePresetContext();
249
- const {
250
- mediaState,
251
- maxContentSizeState,
252
- primaryToolbarState
253
- } = useSharedPluginState(api, ['media', 'maxContentSize', 'primaryToolbar']);
254
- return jsx(Fragment, null, renderChrome({
255
- maxContentSize: maxContentSizeState,
256
- mediaState: mediaState !== null && mediaState !== void 0 ? mediaState : undefined,
257
- primaryToolbarState
258
- }));
259
- }
260
- const EditorNext = props => {
74
+ const Editor = props => {
261
75
  const api = usePresetContext();
262
76
  const {
263
77
  mediaState,
@@ -423,8 +237,5 @@ const EditorNext = props => {
423
237
  }
424
238
  }), customSecondaryToolbarComponents));
425
239
  };
426
- EditorNext.displayName = 'CommentEditorAppearance';
427
- const CommentEditorNextWithIntl = injectIntl(EditorNext);
428
- const CommentEditorOldWithIntl = injectIntl(Editor);
429
- const ExportComp = getBooleanFF('platform.editor.media.alluploadsfinished-dispatch-update_ivtow') ? CommentEditorNextWithIntl : CommentEditorOldWithIntl;
430
- export const CommentEditorWithIntl = ExportComp;
240
+ Editor.displayName = 'CommentEditorAppearance';
241
+ export const CommentEditorWithIntl = injectIntl(Editor);
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "194.0.0";
2
+ export const version = "194.0.1";
@@ -1,15 +1,6 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- 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); }; }
10
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
2
  /** @jsx jsx */
12
- import React, { Fragment, useCallback, useEffect, useMemo, useState } from 'react';
3
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
13
4
 
14
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
15
6
  import { css, jsx } from '@emotion/react';
@@ -23,7 +14,7 @@ import { WidthConsumer } from '@atlaskit/editor-common/ui';
23
14
  import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
24
15
  import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
25
16
  import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
26
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
17
+ import { fg } from '@atlaskit/platform-feature-flags';
27
18
  import { N100 } from '@atlaskit/theme/colors';
28
19
  import { borderRadius } from '@atlaskit/theme/constants';
29
20
  import messages from '../../../messages';
@@ -55,7 +46,7 @@ var commentEditorStyles = css({
55
46
  var ContentArea = createEditorContentStyle(css({
56
47
  flexGrow: 1,
57
48
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
58
- overflowX: getBooleanFF('platform.editor.table-sticky-scrollbar') ? 'clip' : 'hidden',
49
+ overflowX: fg('platform.editor.table-sticky-scrollbar') ? 'clip' : 'hidden',
59
50
  lineHeight: '24px',
60
51
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
61
52
  '.ProseMirror': {
@@ -81,204 +72,12 @@ var secondaryToolbarStyles = css({
81
72
  padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-025, 2px)")
82
73
  });
83
74
  var appearance = 'comment';
84
- var Editor = /*#__PURE__*/function (_React$Component) {
85
- _inherits(Editor, _React$Component);
86
- var _super = _createSuper(Editor);
87
- function Editor(props) {
88
- var _this;
89
- _classCallCheck(this, Editor);
90
- _this = _super.call(this, props);
91
- _defineProperty(_assertThisInitialized(_this), "appearance", 'comment');
92
- _defineProperty(_assertThisInitialized(_this), "containerElement", null);
93
- // Wrapper container for toolbar and content area
94
- _defineProperty(_assertThisInitialized(_this), "wrapperElementRef", /*#__PURE__*/React.createRef());
95
- _defineProperty(_assertThisInitialized(_this), "handleSave", function () {
96
- if (_this.props.editorView && _this.props.onSave) {
97
- _this.props.onSave(_this.props.editorView);
98
- }
99
- });
100
- _defineProperty(_assertThisInitialized(_this), "handleCancel", function () {
101
- if (_this.props.editorView && _this.props.onCancel) {
102
- _this.props.onCancel(_this.props.editorView);
103
- }
104
- });
105
- _defineProperty(_assertThisInitialized(_this), "renderChrome", function (_ref) {
106
- var maxContentSize = _ref.maxContentSize,
107
- mediaState = _ref.mediaState,
108
- primaryToolbarState = _ref.primaryToolbarState;
109
- var _this$props = _this.props,
110
- editorDOMElement = _this$props.editorDOMElement,
111
- editorView = _this$props.editorView,
112
- editorActions = _this$props.editorActions,
113
- eventDispatcher = _this$props.eventDispatcher,
114
- providerFactory = _this$props.providerFactory,
115
- contentComponents = _this$props.contentComponents,
116
- customContentComponents = _this$props.customContentComponents,
117
- customPrimaryToolbarComponents = _this$props.customPrimaryToolbarComponents,
118
- primaryToolbarComponentsProp = _this$props.primaryToolbarComponents,
119
- customSecondaryToolbarComponents = _this$props.customSecondaryToolbarComponents,
120
- popupsMountPoint = _this$props.popupsMountPoint,
121
- popupsBoundariesElement = _this$props.popupsBoundariesElement,
122
- popupsScrollableElement = _this$props.popupsScrollableElement,
123
- maxHeight = _this$props.maxHeight,
124
- _this$props$minHeight = _this$props.minHeight,
125
- minHeight = _this$props$minHeight === void 0 ? 150 : _this$props$minHeight,
126
- onSave = _this$props.onSave,
127
- onCancel = _this$props.onCancel,
128
- disabled = _this$props.disabled,
129
- dispatchAnalyticsEvent = _this$props.dispatchAnalyticsEvent,
130
- intl = _this$props.intl,
131
- useStickyToolbar = _this$props.useStickyToolbar,
132
- pluginHooks = _this$props.pluginHooks,
133
- featureFlags = _this$props.featureFlags;
134
- var maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
135
- var showSecondaryToolbar = !!onSave || !!onCancel || !!customSecondaryToolbarComponents;
136
- var isShortcutToFocusToolbar = function isShortcutToFocusToolbar(event) {
137
- //Alt + F9 to reach first element in this main toolbar
138
- return event.altKey && (event.key === 'F9' || event.keyCode === 120);
139
- };
140
- var isTwoLineToolbarEnabled = !!customPrimaryToolbarComponents && !!(featureFlags !== null && featureFlags !== void 0 && featureFlags.twoLineEditorToolbar);
141
- var handleEscape = function handleEscape(event) {
142
- if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
143
- editorView === null || editorView === void 0 || editorView.focus();
144
- }
145
- event.preventDefault();
146
- event.stopPropagation();
147
- };
148
- var primaryToolbarComponents = primaryToolbarComponentsProp;
149
- if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
150
- primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
151
- }
152
- return jsx(WithFlash, {
153
- animate: maxContentSizeReached
154
- }, jsx("div", {
155
- css: [commentEditorStyles,
156
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
157
- css({
158
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
159
- minHeight: "".concat(minHeight, "px")
160
- })]
161
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
162
- ,
163
- className: "akEditor",
164
- ref: _this.wrapperElementRef
165
- }, jsx(MainToolbar, {
166
- useStickyToolbar: useStickyToolbar,
167
- twoLineEditorToolbar: isTwoLineToolbarEnabled
168
- }, jsx(ToolbarArrowKeyNavigationProvider, {
169
- editorView: editorView,
170
- childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
171
- isShortcutToFocusToolbar: isShortcutToFocusToolbar,
172
- handleEscape: handleEscape,
173
- editorAppearance: _this.appearance,
174
- useStickyToolbar: useStickyToolbar,
175
- intl: intl
176
- }, jsx(Toolbar, {
177
- editorView: editorView,
178
- editorActions: editorActions,
179
- eventDispatcher: eventDispatcher,
180
- providerFactory: providerFactory,
181
- appearance: _this.appearance,
182
- items: primaryToolbarComponents,
183
- popupsMountPoint: popupsMountPoint,
184
- popupsBoundariesElement: popupsBoundariesElement,
185
- popupsScrollableElement: popupsScrollableElement,
186
- disabled: !!disabled,
187
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
188
- containerElement: _this.containerElement,
189
- twoLineEditorToolbar: isTwoLineToolbarEnabled
190
- }), jsx("div", {
191
- css: mainToolbarCustomComponentsSlotStyle(isTwoLineToolbarEnabled)
192
- }, customPrimaryToolbarComponents))), jsx(ClickAreaBlock, {
193
- editorView: editorView,
194
- editorDisabled: disabled
195
- }, jsx(WidthConsumer, null, function (_ref2) {
196
- var width = _ref2.width;
197
- return jsx(ContentArea, {
198
- ref: function ref(_ref3) {
199
- return _this.containerElement = _ref3;
200
- },
201
- css: maxHeight ?
202
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
203
- css({
204
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
205
- maxHeight: "".concat(maxHeight, "px")
206
- }) : null
207
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
208
- ,
209
- className: classnames('ak-editor-content-area', {
210
- 'less-margin': width < akEditorMobileBreakoutPoint
211
- }),
212
- featureFlags: featureFlags
213
- }, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, jsx(PluginSlot, {
214
- editorView: editorView,
215
- editorActions: editorActions,
216
- eventDispatcher: eventDispatcher,
217
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
218
- providerFactory: providerFactory,
219
- appearance: _this.appearance,
220
- items: contentComponents,
221
- popupsMountPoint: popupsMountPoint,
222
- popupsBoundariesElement: popupsBoundariesElement,
223
- popupsScrollableElement: popupsScrollableElement,
224
- containerElement: _this.containerElement,
225
- disabled: !!disabled,
226
- wrapperElement: _this.wrapperElementRef.current,
227
- pluginHooks: pluginHooks
228
- }), editorDOMElement, customContentComponents && 'after' in customContentComponents ? customContentComponents.after : null);
229
- }))), showSecondaryToolbar && jsx("div", {
230
- css: secondaryToolbarStyles,
231
- "data-testid": "ak-editor-secondary-toolbar"
232
- }, jsx(ButtonGroup, null, !!onSave && jsx(Button, {
233
- appearance: "primary",
234
- onClick: _this.handleSave,
235
- testId: "comment-save-button",
236
- isDisabled: disabled || mediaState && !mediaState.allUploadsFinished
237
- }, intl.formatMessage(messages.saveButton)), !!onCancel && jsx(Button, {
238
- appearance: "subtle",
239
- onClick: _this.handleCancel,
240
- isDisabled: disabled
241
- }, intl.formatMessage(messages.cancelButton))), jsx("span", {
242
- style: {
243
- flexGrow: 1
244
- }
245
- }), customSecondaryToolbarComponents));
246
- });
247
- if (props.innerRef) {
248
- _this.wrapperElementRef = props.innerRef;
249
- }
250
- return _this;
251
- }
252
- _createClass(Editor, [{
253
- key: "render",
254
- value: function render() {
255
- return jsx(RenderWithPluginState, {
256
- renderChrome: this.renderChrome
257
- });
258
- }
259
- }]);
260
- return Editor;
261
- }(React.Component);
262
- _defineProperty(Editor, "displayName", 'CommentEditorAppearance');
263
- function RenderWithPluginState(_ref4) {
264
- var renderChrome = _ref4.renderChrome;
75
+ var Editor = function Editor(props) {
265
76
  var api = usePresetContext();
266
77
  var _useSharedPluginState = useSharedPluginState(api, ['media', 'maxContentSize', 'primaryToolbar']),
267
78
  mediaState = _useSharedPluginState.mediaState,
268
79
  maxContentSizeState = _useSharedPluginState.maxContentSizeState,
269
80
  primaryToolbarState = _useSharedPluginState.primaryToolbarState;
270
- return jsx(Fragment, null, renderChrome({
271
- maxContentSize: maxContentSizeState,
272
- mediaState: mediaState !== null && mediaState !== void 0 ? mediaState : undefined,
273
- primaryToolbarState: primaryToolbarState
274
- }));
275
- }
276
- var EditorNext = function EditorNext(props) {
277
- var api = usePresetContext();
278
- var _useSharedPluginState2 = useSharedPluginState(api, ['media', 'maxContentSize', 'primaryToolbar']),
279
- mediaState = _useSharedPluginState2.mediaState,
280
- maxContentSizeState = _useSharedPluginState2.maxContentSizeState,
281
- primaryToolbarState = _useSharedPluginState2.primaryToolbarState;
282
81
  var editorDOMElement = props.editorDOMElement,
283
82
  editorView = props.editorView,
284
83
  editorActions = props.editorActions,
@@ -393,8 +192,8 @@ var EditorNext = function EditorNext(props) {
393
192
  }, customPrimaryToolbarComponents))), jsx(ClickAreaBlock, {
394
193
  editorView: editorView,
395
194
  editorDisabled: disabled
396
- }, jsx(WidthConsumer, null, function (_ref5) {
397
- var width = _ref5.width;
195
+ }, jsx(WidthConsumer, null, function (_ref) {
196
+ var width = _ref.width;
398
197
  return jsx(ContentArea, {
399
198
  ref: containerElement,
400
199
  css: maxHeight ?
@@ -443,8 +242,5 @@ var EditorNext = function EditorNext(props) {
443
242
  }
444
243
  }), customSecondaryToolbarComponents));
445
244
  };
446
- EditorNext.displayName = 'CommentEditorAppearance';
447
- var CommentEditorNextWithIntl = injectIntl(EditorNext);
448
- var CommentEditorOldWithIntl = injectIntl(Editor);
449
- var ExportComp = getBooleanFF('platform.editor.media.alluploadsfinished-dispatch-update_ivtow') ? CommentEditorNextWithIntl : CommentEditorOldWithIntl;
450
- export var CommentEditorWithIntl = ExportComp;
245
+ Editor.displayName = 'CommentEditorAppearance';
246
+ export var CommentEditorWithIntl = injectIntl(Editor);
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "194.0.0";
2
+ export var version = "194.0.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "194.0.0",
3
+ "version": "194.0.1",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -217,9 +217,6 @@
217
217
  "platform.editor.media.preview-in-full-page": {
218
218
  "type": "boolean"
219
219
  },
220
- "platform.editor.media.alluploadsfinished-dispatch-update_ivtow": {
221
- "type": "boolean"
222
- },
223
220
  "platform.editor.inline_extension.extended_lcqdn": {
224
221
  "type": "boolean",
225
222
  "referenceOnly": "true"