@atlaskit/editor-plugin-status 7.1.3 → 7.1.4

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-plugin-status
2
2
 
3
+ ## 7.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e727490d9f62f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e727490d9f62f) -
8
+ [ux] EDITOR-2572 Hide floating toolbar when status picker is open
9
+ - Updated dependencies
10
+
3
11
  ## 7.1.3
4
12
 
5
13
  ### Patch Changes
@@ -69,6 +69,7 @@ function ContentComponent(_ref) {
69
69
  onTextChanged: onTextChanged,
70
70
  closeStatusPicker: closeStatusPicker,
71
71
  onEnter: onEnter,
72
- editorView: editorView
72
+ editorView: editorView,
73
+ api: api
73
74
  });
74
75
  }
@@ -18,10 +18,12 @@ var _analyticsNext = require("@atlaskit/analytics-next");
18
18
  var _messages = require("@atlaskit/editor-common/messages");
19
19
  var _ui = require("@atlaskit/editor-common/ui");
20
20
  var _uiReact = require("@atlaskit/editor-common/ui-react");
21
+ var _userIntent = require("@atlaskit/editor-common/user-intent");
21
22
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
22
23
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
24
  var _picker = require("@atlaskit/status/picker");
24
25
  var _colors = require("@atlaskit/theme/colors");
26
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
25
27
  var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
26
28
  var _actions = require("../pm-plugins/actions");
27
29
  var _analytics = require("./analytics");
@@ -289,30 +291,41 @@ var StatusPickerWithIntl = /*#__PURE__*/function (_React$Component) {
289
291
  }, {
290
292
  key: "renderWithSetOutsideClickTargetRef",
291
293
  value: function renderWithSetOutsideClickTargetRef(setOutsideClickTargetRef) {
294
+ var _this3 = this;
292
295
  var _this$props = this.props,
293
296
  isNew = _this$props.isNew,
294
- focusStatusInput = _this$props.focusStatusInput;
297
+ focusStatusInput = _this$props.focusStatusInput,
298
+ api = _this$props.api;
295
299
  var _this$state3 = this.state,
296
300
  color = _this$state3.color,
297
301
  text = _this$state3.text;
298
- return (
299
- // eslint-disable-next-line @atlassian/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
- autoFocus: isNew || focusStatusInput,
308
- selectedColor: color,
309
- text: text,
310
- onColorClick: this.onColorClick,
311
- onColorHover: this.onColorHover,
312
- onTextChanged: this.onTextChanged,
313
- onEnter: this.onEnter
314
- }))
315
- );
302
+ var renderPicker = function renderPicker() {
303
+ return (
304
+ // eslint-disable-next-line @atlassian/a11y/no-static-element-interactions
305
+ (0, _react2.jsx)("div", {
306
+ css: pickerContainerStyles,
307
+ tabIndex: -1,
308
+ ref: _this3.setRef(setOutsideClickTargetRef),
309
+ onClick: _this3.handlePopupClick,
310
+ onKeyDown: _this3.onKeyDown
311
+ }, (0, _react2.jsx)(_picker.StatusPicker, {
312
+ autoFocus: isNew || focusStatusInput,
313
+ selectedColor: color,
314
+ text: text,
315
+ onColorClick: _this3.onColorClick,
316
+ onColorHover: _this3.onColorHover,
317
+ onTextChanged: _this3.onTextChanged,
318
+ onEnter: _this3.onEnter
319
+ }))
320
+ );
321
+ };
322
+ if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_lovability_user_intent', 'isEnabled', true)) {
323
+ return (0, _react2.jsx)(_userIntent.UserIntentPopupWrapper, {
324
+ api: api,
325
+ userIntent: "statusPickerOpen"
326
+ }, renderPicker());
327
+ }
328
+ return renderPicker();
316
329
  }
317
330
  }, {
318
331
  key: "render",
@@ -59,6 +59,7 @@ export function ContentComponent({
59
59
  onTextChanged: onTextChanged,
60
60
  closeStatusPicker: closeStatusPicker,
61
61
  onEnter: onEnter,
62
- editorView: editorView
62
+ editorView: editorView,
63
+ api: api
63
64
  });
64
65
  }
@@ -13,10 +13,12 @@ import { withAnalyticsEvents } from '@atlaskit/analytics-next';
13
13
  import { statusMessages as messages } from '@atlaskit/editor-common/messages';
14
14
  import { Popup } from '@atlaskit/editor-common/ui';
15
15
  import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
16
+ import { UserIntentPopupWrapper } from '@atlaskit/editor-common/user-intent';
16
17
  import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
17
18
  import { fg } from '@atlaskit/platform-feature-flags';
18
19
  import { StatusPicker as AkStatusPicker } from '@atlaskit/status/picker';
19
20
  import { N0 } from '@atlaskit/theme/colors';
21
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
20
22
  import VisuallyHidden from '@atlaskit/visually-hidden';
21
23
  import { DEFAULT_STATUS } from '../pm-plugins/actions';
22
24
  import { analyticsState, createStatusAnalyticsAndFire } from './analytics';
@@ -264,30 +266,37 @@ class StatusPickerWithIntl extends React.Component {
264
266
  renderWithSetOutsideClickTargetRef(setOutsideClickTargetRef) {
265
267
  const {
266
268
  isNew,
267
- focusStatusInput
269
+ focusStatusInput,
270
+ api
268
271
  } = this.props;
269
272
  const {
270
273
  color,
271
274
  text
272
275
  } = this.state;
273
- return (
274
- // eslint-disable-next-line @atlassian/a11y/no-static-element-interactions
275
- jsx("div", {
276
- css: pickerContainerStyles,
277
- tabIndex: -1,
278
- ref: this.setRef(setOutsideClickTargetRef),
279
- onClick: this.handlePopupClick,
280
- onKeyDown: this.onKeyDown
281
- }, jsx(AkStatusPicker, {
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
- );
276
+ const renderPicker = () =>
277
+ // eslint-disable-next-line @atlassian/a11y/no-static-element-interactions
278
+ jsx("div", {
279
+ css: pickerContainerStyles,
280
+ tabIndex: -1,
281
+ ref: this.setRef(setOutsideClickTargetRef),
282
+ onClick: this.handlePopupClick,
283
+ onKeyDown: this.onKeyDown
284
+ }, jsx(AkStatusPicker, {
285
+ autoFocus: isNew || focusStatusInput,
286
+ selectedColor: color,
287
+ text: text,
288
+ onColorClick: this.onColorClick,
289
+ onColorHover: this.onColorHover,
290
+ onTextChanged: this.onTextChanged,
291
+ onEnter: this.onEnter
292
+ }));
293
+ if (expValEqualsNoExposure('platform_editor_lovability_user_intent', 'isEnabled', true)) {
294
+ return jsx(UserIntentPopupWrapper, {
295
+ api: api,
296
+ userIntent: "statusPickerOpen"
297
+ }, renderPicker());
298
+ }
299
+ return renderPicker();
291
300
  }
292
301
  render() {
293
302
  const {
@@ -60,6 +60,7 @@ export function ContentComponent(_ref) {
60
60
  onTextChanged: onTextChanged,
61
61
  closeStatusPicker: closeStatusPicker,
62
62
  onEnter: onEnter,
63
- editorView: editorView
63
+ editorView: editorView,
64
+ api: api
64
65
  });
65
66
  }
@@ -20,10 +20,12 @@ import { withAnalyticsEvents } from '@atlaskit/analytics-next';
20
20
  import { statusMessages as messages } from '@atlaskit/editor-common/messages';
21
21
  import { Popup } from '@atlaskit/editor-common/ui';
22
22
  import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
23
+ import { UserIntentPopupWrapper } from '@atlaskit/editor-common/user-intent';
23
24
  import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
24
25
  import { fg } from '@atlaskit/platform-feature-flags';
25
26
  import { StatusPicker as AkStatusPicker } from '@atlaskit/status/picker';
26
27
  import { N0 } from '@atlaskit/theme/colors';
28
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
27
29
  import VisuallyHidden from '@atlaskit/visually-hidden';
28
30
  import { DEFAULT_STATUS } from '../pm-plugins/actions';
29
31
  import { analyticsState, createStatusAnalyticsAndFire } from './analytics';
@@ -286,30 +288,41 @@ var StatusPickerWithIntl = /*#__PURE__*/function (_React$Component) {
286
288
  }, {
287
289
  key: "renderWithSetOutsideClickTargetRef",
288
290
  value: function renderWithSetOutsideClickTargetRef(setOutsideClickTargetRef) {
291
+ var _this3 = this;
289
292
  var _this$props = this.props,
290
293
  isNew = _this$props.isNew,
291
- focusStatusInput = _this$props.focusStatusInput;
294
+ focusStatusInput = _this$props.focusStatusInput,
295
+ api = _this$props.api;
292
296
  var _this$state3 = this.state,
293
297
  color = _this$state3.color,
294
298
  text = _this$state3.text;
295
- return (
296
- // eslint-disable-next-line @atlassian/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
- autoFocus: isNew || focusStatusInput,
305
- selectedColor: color,
306
- text: text,
307
- onColorClick: this.onColorClick,
308
- onColorHover: this.onColorHover,
309
- onTextChanged: this.onTextChanged,
310
- onEnter: this.onEnter
311
- }))
312
- );
299
+ var renderPicker = function renderPicker() {
300
+ return (
301
+ // eslint-disable-next-line @atlassian/a11y/no-static-element-interactions
302
+ jsx("div", {
303
+ css: pickerContainerStyles,
304
+ tabIndex: -1,
305
+ ref: _this3.setRef(setOutsideClickTargetRef),
306
+ onClick: _this3.handlePopupClick,
307
+ onKeyDown: _this3.onKeyDown
308
+ }, jsx(AkStatusPicker, {
309
+ autoFocus: isNew || focusStatusInput,
310
+ selectedColor: color,
311
+ text: text,
312
+ onColorClick: _this3.onColorClick,
313
+ onColorHover: _this3.onColorHover,
314
+ onTextChanged: _this3.onTextChanged,
315
+ onEnter: _this3.onEnter
316
+ }))
317
+ );
318
+ };
319
+ if (expValEqualsNoExposure('platform_editor_lovability_user_intent', 'isEnabled', true)) {
320
+ return jsx(UserIntentPopupWrapper, {
321
+ api: api,
322
+ userIntent: "statusPickerOpen"
323
+ }, renderPicker());
324
+ }
325
+ return renderPicker();
313
326
  }
314
327
  }, {
315
328
  key: "render",
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import { type WrappedComponentProps } from 'react-intl-next';
3
3
  import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
4
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
6
  import type { ColorType as Color } from '@atlaskit/status/picker';
7
+ import type { StatusPlugin } from '../statusPluginType';
6
8
  import type { ClosingPayload, StatusType } from '../types';
7
9
  export declare enum InputMethod {
8
10
  blur = "blur",
@@ -14,6 +16,7 @@ export declare enum closingMethods {
14
16
  ArrowRight = "arrowRight"
15
17
  }
16
18
  export interface Props {
19
+ api?: ExtractInjectionAPI<StatusPlugin>;
17
20
  boundariesElement?: HTMLElement;
18
21
  closeStatusPicker: (closingPayload?: ClosingPayload) => void;
19
22
  createAnalyticsEvent?: CreateUIAnalyticsEvent;
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import { type WrappedComponentProps } from 'react-intl-next';
3
3
  import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
4
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
6
  import type { ColorType as Color } from '@atlaskit/status/picker';
7
+ import type { StatusPlugin } from '../statusPluginType';
6
8
  import type { ClosingPayload, StatusType } from '../types';
7
9
  export declare enum InputMethod {
8
10
  blur = "blur",
@@ -14,6 +16,7 @@ export declare enum closingMethods {
14
16
  ArrowRight = "arrowRight"
15
17
  }
16
18
  export interface Props {
19
+ api?: ExtractInjectionAPI<StatusPlugin>;
17
20
  boundariesElement?: HTMLElement;
18
21
  closeStatusPicker: (closingPayload?: ClosingPayload) => void;
19
22
  createAnalyticsEvent?: CreateUIAnalyticsEvent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-status",
3
- "version": "7.1.3",
3
+ "version": "7.1.4",
4
4
  "description": "Status plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,14 +38,14 @@
38
38
  "@atlaskit/platform-feature-flags": "^1.1.0",
39
39
  "@atlaskit/status": "^3.0.0",
40
40
  "@atlaskit/theme": "^21.0.0",
41
- "@atlaskit/tmp-editor-statsig": "^13.18.0",
41
+ "@atlaskit/tmp-editor-statsig": "^13.22.0",
42
42
  "@atlaskit/tokens": "^7.0.0",
43
43
  "@atlaskit/visually-hidden": "^3.0.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@emotion/react": "^11.7.1"
46
46
  },
47
47
  "peerDependencies": {
48
- "@atlaskit/editor-common": "^110.18.0",
48
+ "@atlaskit/editor-common": "^110.19.0",
49
49
  "react": "^18.2.0",
50
50
  "react-dom": "^18.2.0",
51
51
  "react-intl-next": "npm:react-intl@^5.18.1"