@atlaskit/editor-plugin-status 2.5.4 → 2.5.6

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,23 @@
1
1
  # @atlaskit/editor-plugin-status
2
2
 
3
+ ## 2.5.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#159176](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/159176)
8
+ [`8f1d77592a9dc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8f1d77592a9dc) -
9
+ Bump adf-schema to 44.2.0
10
+
11
+ ## 2.5.5
12
+
13
+ ### Patch Changes
14
+
15
+ - [#155668](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/155668)
16
+ [`f948f63ced742`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f948f63ced742) -
17
+ We are testing replacing findDOMNode with an explicit ref behind a feature flag. If this fix is
18
+ successful it will be available in a later release.
19
+ - Updated dependencies
20
+
3
21
  ## 2.5.4
4
22
 
5
23
  ### Patch Changes
@@ -18,6 +18,7 @@ var _analyticsNext = require("@atlaskit/analytics-next");
18
18
  var _ui = require("@atlaskit/editor-common/ui");
19
19
  var _uiReact = require("@atlaskit/editor-common/ui-react");
20
20
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
21
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
22
  var _picker = require("@atlaskit/status/picker");
22
23
  var _colors = require("@atlaskit/theme/colors");
23
24
  var _constants = require("@atlaskit/theme/constants");
@@ -277,19 +278,58 @@ var StatusPickerWithoutAnalytcs = exports.StatusPickerWithoutAnalytcs = /*#__PUR
277
278
  };
278
279
  }
279
280
  }, {
280
- key: "render",
281
- value: function render() {
281
+ key: "setRef",
282
+ value: function setRef(setOutsideClickTargetRef) {
283
+ var _this2 = this;
284
+ return function (ref) {
285
+ setOutsideClickTargetRef(ref);
286
+ _this2.popupBodyWrapper.current = ref;
287
+ };
288
+ }
289
+ }, {
290
+ key: "renderWithSetOutsideClickTargetRef",
291
+ value: function renderWithSetOutsideClickTargetRef(setOutsideClickTargetRef) {
282
292
  var _this$props = this.props,
283
293
  isNew = _this$props.isNew,
284
- target = _this$props.target,
285
- mountTo = _this$props.mountTo,
286
- boundariesElement = _this$props.boundariesElement,
287
- scrollableElement = _this$props.scrollableElement,
288
- focusStatusInput = _this$props.focusStatusInput,
289
- editorView = _this$props.editorView;
294
+ focusStatusInput = _this$props.focusStatusInput;
290
295
  var _this$state3 = this.state,
291
296
  color = _this$state3.color,
292
297
  text = _this$state3.text;
298
+ return (
299
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
300
+ (0, _react2.jsx)("div", {
301
+ css: pickerContainerStyles,
302
+ tabIndex: -1,
303
+ ref: this.setRef(setOutsideClickTargetRef),
304
+ onClick: this.handlePopupClick,
305
+ onKeyDown: this.onKeyDown
306
+ }, (0, _react2.jsx)(_picker.StatusPicker
307
+ // eslint-disable-next-line jsx-a11y/no-autofocus
308
+ , {
309
+ autoFocus: isNew || focusStatusInput,
310
+ selectedColor: color,
311
+ text: text,
312
+ onColorClick: this.onColorClick,
313
+ onColorHover: this.onColorHover,
314
+ onTextChanged: this.onTextChanged,
315
+ onEnter: this.onEnter
316
+ }))
317
+ );
318
+ }
319
+ }, {
320
+ key: "render",
321
+ value: function render() {
322
+ var _this$props2 = this.props,
323
+ isNew = _this$props2.isNew,
324
+ target = _this$props2.target,
325
+ mountTo = _this$props2.mountTo,
326
+ boundariesElement = _this$props2.boundariesElement,
327
+ scrollableElement = _this$props2.scrollableElement,
328
+ focusStatusInput = _this$props2.focusStatusInput,
329
+ editorView = _this$props2.editorView;
330
+ var _this$state4 = this.state,
331
+ color = _this$state4.color,
332
+ text = _this$state4.text;
293
333
  if (!(editorView !== null && editorView !== void 0 && editorView.editable)) {
294
334
  return null;
295
335
  }
@@ -304,13 +344,16 @@ var StatusPickerWithoutAnalytcs = exports.StatusPickerWithoutAnalytcs = /*#__PUR
304
344
  boundariesElement: boundariesElement,
305
345
  scrollableElement: scrollableElement,
306
346
  closeOnTab: false
307
- }, (0, _react2.jsx)("div", {
347
+ }, (0, _platformFeatureFlags.fg)('platform_editor_replace_finddomnode_in_common') ? (0, _react2.jsx)(_uiReact.OutsideClickTargetRefContext.Consumer, null, this.renderWithSetOutsideClickTargetRef.bind(this)) :
348
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
349
+ (0, _react2.jsx)("div", {
308
350
  css: pickerContainerStyles,
309
351
  tabIndex: -1,
310
- ref: this.popupBodyWrapper,
311
352
  onClick: this.handlePopupClick,
312
353
  onKeyDown: this.onKeyDown
313
- }, (0, _react2.jsx)(_picker.StatusPicker, {
354
+ }, (0, _react2.jsx)(_picker.StatusPicker
355
+ // eslint-disable-next-line jsx-a11y/no-autofocus
356
+ , {
314
357
  autoFocus: isNew || focusStatusInput,
315
358
  selectedColor: color,
316
359
  text: text,
@@ -10,8 +10,9 @@ import React from 'react';
10
10
  import { css, jsx } from '@emotion/react';
11
11
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
12
12
  import { Popup } from '@atlaskit/editor-common/ui';
13
- import { withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
13
+ import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
14
14
  import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
15
+ import { fg } from '@atlaskit/platform-feature-flags';
15
16
  import { StatusPicker as AkStatusPicker } from '@atlaskit/status/picker';
16
17
  import { N0 } from '@atlaskit/theme/colors';
17
18
  import { borderRadius } from '@atlaskit/theme/constants';
@@ -252,6 +253,42 @@ export class StatusPickerWithoutAnalytcs extends React.Component {
252
253
  isNew
253
254
  };
254
255
  }
256
+ setRef(setOutsideClickTargetRef) {
257
+ return ref => {
258
+ setOutsideClickTargetRef(ref);
259
+ this.popupBodyWrapper.current = ref;
260
+ };
261
+ }
262
+ renderWithSetOutsideClickTargetRef(setOutsideClickTargetRef) {
263
+ const {
264
+ isNew,
265
+ focusStatusInput
266
+ } = this.props;
267
+ const {
268
+ color,
269
+ text
270
+ } = this.state;
271
+ return (
272
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
273
+ jsx("div", {
274
+ css: pickerContainerStyles,
275
+ tabIndex: -1,
276
+ ref: this.setRef(setOutsideClickTargetRef),
277
+ onClick: this.handlePopupClick,
278
+ onKeyDown: this.onKeyDown
279
+ }, jsx(AkStatusPicker
280
+ // eslint-disable-next-line jsx-a11y/no-autofocus
281
+ , {
282
+ autoFocus: isNew || focusStatusInput,
283
+ selectedColor: color,
284
+ text: text,
285
+ onColorClick: this.onColorClick,
286
+ onColorHover: this.onColorHover,
287
+ onTextChanged: this.onTextChanged,
288
+ onEnter: this.onEnter
289
+ }))
290
+ );
291
+ }
255
292
  render() {
256
293
  const {
257
294
  isNew,
@@ -280,13 +317,16 @@ export class StatusPickerWithoutAnalytcs extends React.Component {
280
317
  boundariesElement: boundariesElement,
281
318
  scrollableElement: scrollableElement,
282
319
  closeOnTab: false
283
- }, jsx("div", {
320
+ }, fg('platform_editor_replace_finddomnode_in_common') ? jsx(OutsideClickTargetRefContext.Consumer, null, this.renderWithSetOutsideClickTargetRef.bind(this)) :
321
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
322
+ jsx("div", {
284
323
  css: pickerContainerStyles,
285
324
  tabIndex: -1,
286
- ref: this.popupBodyWrapper,
287
325
  onClick: this.handlePopupClick,
288
326
  onKeyDown: this.onKeyDown
289
- }, jsx(AkStatusPicker, {
327
+ }, jsx(AkStatusPicker
328
+ // eslint-disable-next-line jsx-a11y/no-autofocus
329
+ , {
290
330
  autoFocus: isNew || focusStatusInput,
291
331
  selectedColor: color,
292
332
  text: text,
@@ -18,8 +18,9 @@ import React from 'react';
18
18
  import { css, jsx } from '@emotion/react';
19
19
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
20
20
  import { Popup } from '@atlaskit/editor-common/ui';
21
- import { withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
21
+ import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
22
22
  import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
23
+ import { fg } from '@atlaskit/platform-feature-flags';
23
24
  import { StatusPicker as AkStatusPicker } from '@atlaskit/status/picker';
24
25
  import { N0 } from '@atlaskit/theme/colors';
25
26
  import { borderRadius } from '@atlaskit/theme/constants';
@@ -274,19 +275,58 @@ export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component
274
275
  };
275
276
  }
276
277
  }, {
277
- key: "render",
278
- value: function render() {
278
+ key: "setRef",
279
+ value: function setRef(setOutsideClickTargetRef) {
280
+ var _this2 = this;
281
+ return function (ref) {
282
+ setOutsideClickTargetRef(ref);
283
+ _this2.popupBodyWrapper.current = ref;
284
+ };
285
+ }
286
+ }, {
287
+ key: "renderWithSetOutsideClickTargetRef",
288
+ value: function renderWithSetOutsideClickTargetRef(setOutsideClickTargetRef) {
279
289
  var _this$props = this.props,
280
290
  isNew = _this$props.isNew,
281
- target = _this$props.target,
282
- mountTo = _this$props.mountTo,
283
- boundariesElement = _this$props.boundariesElement,
284
- scrollableElement = _this$props.scrollableElement,
285
- focusStatusInput = _this$props.focusStatusInput,
286
- editorView = _this$props.editorView;
291
+ focusStatusInput = _this$props.focusStatusInput;
287
292
  var _this$state3 = this.state,
288
293
  color = _this$state3.color,
289
294
  text = _this$state3.text;
295
+ return (
296
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
297
+ jsx("div", {
298
+ css: pickerContainerStyles,
299
+ tabIndex: -1,
300
+ ref: this.setRef(setOutsideClickTargetRef),
301
+ onClick: this.handlePopupClick,
302
+ onKeyDown: this.onKeyDown
303
+ }, jsx(AkStatusPicker
304
+ // eslint-disable-next-line jsx-a11y/no-autofocus
305
+ , {
306
+ autoFocus: isNew || focusStatusInput,
307
+ selectedColor: color,
308
+ text: text,
309
+ onColorClick: this.onColorClick,
310
+ onColorHover: this.onColorHover,
311
+ onTextChanged: this.onTextChanged,
312
+ onEnter: this.onEnter
313
+ }))
314
+ );
315
+ }
316
+ }, {
317
+ key: "render",
318
+ value: function render() {
319
+ var _this$props2 = this.props,
320
+ isNew = _this$props2.isNew,
321
+ target = _this$props2.target,
322
+ mountTo = _this$props2.mountTo,
323
+ boundariesElement = _this$props2.boundariesElement,
324
+ scrollableElement = _this$props2.scrollableElement,
325
+ focusStatusInput = _this$props2.focusStatusInput,
326
+ editorView = _this$props2.editorView;
327
+ var _this$state4 = this.state,
328
+ color = _this$state4.color,
329
+ text = _this$state4.text;
290
330
  if (!(editorView !== null && editorView !== void 0 && editorView.editable)) {
291
331
  return null;
292
332
  }
@@ -301,13 +341,16 @@ export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component
301
341
  boundariesElement: boundariesElement,
302
342
  scrollableElement: scrollableElement,
303
343
  closeOnTab: false
304
- }, jsx("div", {
344
+ }, fg('platform_editor_replace_finddomnode_in_common') ? jsx(OutsideClickTargetRefContext.Consumer, null, this.renderWithSetOutsideClickTargetRef.bind(this)) :
345
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
346
+ jsx("div", {
305
347
  css: pickerContainerStyles,
306
348
  tabIndex: -1,
307
- ref: this.popupBodyWrapper,
308
349
  onClick: this.handlePopupClick,
309
350
  onKeyDown: this.onKeyDown
310
- }, jsx(AkStatusPicker, {
351
+ }, jsx(AkStatusPicker
352
+ // eslint-disable-next-line jsx-a11y/no-autofocus
353
+ , {
311
354
  autoFocus: isNew || focusStatusInput,
312
355
  selectedColor: color,
313
356
  text: text,
@@ -55,6 +55,8 @@ export declare class StatusPickerWithoutAnalytcs extends React.Component<Props,
55
55
  private handleTabPress;
56
56
  private handleArrow;
57
57
  private onKeyDown;
58
+ private setRef;
59
+ private renderWithSetOutsideClickTargetRef;
58
60
  render(): jsx.JSX.Element | null;
59
61
  private onColorHover;
60
62
  private onColorClick;
@@ -55,6 +55,8 @@ export declare class StatusPickerWithoutAnalytcs extends React.Component<Props,
55
55
  private handleTabPress;
56
56
  private handleArrow;
57
57
  private onKeyDown;
58
+ private setRef;
59
+ private renderWithSetOutsideClickTargetRef;
58
60
  render(): jsx.JSX.Element | null;
59
61
  private onColorHover;
60
62
  private onColorClick;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-status",
3
- "version": "2.5.4",
3
+ "version": "2.5.6",
4
4
  "description": "Status plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,12 +31,12 @@
31
31
  ".": "./src/index.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/adf-schema": "^42.3.1",
34
+ "@atlaskit/adf-schema": "^44.2.0",
35
35
  "@atlaskit/analytics-next": "^10.1.0",
36
- "@atlaskit/editor-common": "^94.2.0",
36
+ "@atlaskit/editor-common": "^94.9.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
38
38
  "@atlaskit/editor-prosemirror": "6.0.0",
39
- "@atlaskit/editor-shared-styles": "^3.0.0",
39
+ "@atlaskit/editor-shared-styles": "^3.1.0",
40
40
  "@atlaskit/platform-feature-flags": "^0.3.0",
41
41
  "@atlaskit/status": "^1.5.0",
42
42
  "@atlaskit/theme": "^14.0.0",
@@ -93,6 +93,9 @@
93
93
  "platform-feature-flags": {
94
94
  "editor_inline_comments_paste_insert_nodes": {
95
95
  "type": "boolean"
96
+ },
97
+ "platform_editor_replace_finddomnode_in_common": {
98
+ "type": "boolean"
96
99
  }
97
100
  }
98
101
  }