@atlaskit/editor-plugin-alignment 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/editor-plugin-alignment
2
2
 
3
+ ## 1.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#114806](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114806)
8
+ [`d3310bbf372ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d3310bbf372ec) -
9
+ [ux] The keyboard navigation for the main toolbar
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 1.5.1
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 1.5.0
4
22
 
5
23
  ### Minor Changes
@@ -19,6 +19,7 @@ var _messages = require("@atlaskit/editor-common/messages");
19
19
  var _styles = require("@atlaskit/editor-common/styles");
20
20
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
21
21
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
22
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
23
  var _Alignment = _interopRequireDefault(require("../Alignment"));
23
24
  var _iconMap = require("./icon-map");
24
25
  var _styles2 = require("./styles");
@@ -74,6 +75,13 @@ var AlignmentToolbar = exports.AlignmentToolbar = /*#__PURE__*/function (_React$
74
75
  _this.hide();
75
76
  (_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 || (_this$toolbarItemRef2 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef2 === void 0 || _this$toolbarItemRef2.focus();
76
77
  });
78
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOpenChange", function () {
79
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-main-toolbar-navigation_osrty')) {
80
+ _this.setState({
81
+ isOpen: false
82
+ });
83
+ }
84
+ });
77
85
  return _this;
78
86
  }
79
87
  (0, _createClass2.default)(AlignmentToolbar, [{
@@ -110,6 +118,7 @@ var AlignmentToolbar = exports.AlignmentToolbar = /*#__PURE__*/function (_React$
110
118
  });
111
119
  }
112
120
  },
121
+ onOpenChange: this.onOpenChange,
113
122
  handleEscapeKeydown: this.hideOnEscape,
114
123
  arrowKeyNavigationProviderOptions: {
115
124
  type: _uiMenu.ArrowKeyNavigationType.MENU
@@ -9,6 +9,7 @@ import { alignmentMessages as messages } from '@atlaskit/editor-common/messages'
9
9
  import { separatorStyles } from '@atlaskit/editor-common/styles';
10
10
  import { ArrowKeyNavigationType, DropdownContainer as Dropdown, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
11
11
  import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
12
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
12
13
  import Alignment from '../Alignment';
13
14
  import { IconMap } from './icon-map';
14
15
  import { expandIconWrapper, triggerWrapper, wrapper } from './styles';
@@ -55,6 +56,13 @@ export class AlignmentToolbar extends React.Component {
55
56
  this.hide();
56
57
  (_this$toolbarItemRef2 = this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 ? void 0 : (_this$toolbarItemRef3 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef3 === void 0 ? void 0 : _this$toolbarItemRef3.focus();
57
58
  });
59
+ _defineProperty(this, "onOpenChange", () => {
60
+ if (getBooleanFF('platform.editor.a11y-main-toolbar-navigation_osrty')) {
61
+ this.setState({
62
+ isOpen: false
63
+ });
64
+ }
65
+ });
58
66
  }
59
67
  render() {
60
68
  var _pluginState$align;
@@ -90,6 +98,7 @@ export class AlignmentToolbar extends React.Component {
90
98
  });
91
99
  }
92
100
  },
101
+ onOpenChange: this.onOpenChange,
93
102
  handleEscapeKeydown: this.hideOnEscape,
94
103
  arrowKeyNavigationProviderOptions: {
95
104
  type: ArrowKeyNavigationType.MENU
@@ -17,6 +17,7 @@ import { alignmentMessages as messages } from '@atlaskit/editor-common/messages'
17
17
  import { separatorStyles } from '@atlaskit/editor-common/styles';
18
18
  import { ArrowKeyNavigationType, DropdownContainer as Dropdown, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
19
19
  import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
20
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
20
21
  import Alignment from '../Alignment';
21
22
  import { IconMap } from './icon-map';
22
23
  import { expandIconWrapper, triggerWrapper, wrapper } from './styles';
@@ -70,6 +71,13 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
70
71
  _this.hide();
71
72
  (_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 || (_this$toolbarItemRef2 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef2 === void 0 || _this$toolbarItemRef2.focus();
72
73
  });
74
+ _defineProperty(_assertThisInitialized(_this), "onOpenChange", function () {
75
+ if (getBooleanFF('platform.editor.a11y-main-toolbar-navigation_osrty')) {
76
+ _this.setState({
77
+ isOpen: false
78
+ });
79
+ }
80
+ });
73
81
  return _this;
74
82
  }
75
83
  _createClass(AlignmentToolbar, [{
@@ -106,6 +114,7 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
106
114
  });
107
115
  }
108
116
  },
117
+ onOpenChange: this.onOpenChange,
109
118
  handleEscapeKeydown: this.hideOnEscape,
110
119
  arrowKeyNavigationProviderOptions: {
111
120
  type: ArrowKeyNavigationType.MENU
@@ -29,6 +29,7 @@ export declare class AlignmentToolbar extends React.Component<Props & WrappedCom
29
29
  private toggleOpenByKeyboard;
30
30
  private hide;
31
31
  private hideOnEscape;
32
+ private onOpenChange;
32
33
  }
33
34
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
34
35
  WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
@@ -29,6 +29,7 @@ export declare class AlignmentToolbar extends React.Component<Props & WrappedCom
29
29
  private toggleOpenByKeyboard;
30
30
  private hide;
31
31
  private hideOnEscape;
32
+ private onOpenChange;
32
33
  }
33
34
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
34
35
  WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-alignment",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Alignment plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -22,11 +22,11 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@atlaskit/adf-schema": "^37.0.0",
25
- "@atlaskit/editor-common": "^82.12.0",
25
+ "@atlaskit/editor-common": "^83.1.0",
26
26
  "@atlaskit/editor-plugin-primary-toolbar": "^1.1.0",
27
27
  "@atlaskit/editor-prosemirror": "4.0.1",
28
28
  "@atlaskit/editor-tables": "^2.7.0",
29
- "@atlaskit/icon": "^22.4.0",
29
+ "@atlaskit/icon": "^22.5.0",
30
30
  "@atlaskit/platform-feature-flags": "^0.2.0",
31
31
  "@atlaskit/tokens": "^1.53.0",
32
32
  "@babel/runtime": "^7.0.0",
@@ -95,6 +95,9 @@
95
95
  "platform-feature-flags": {
96
96
  "platform.editor.text-alignment-keyboard-shortcuts": {
97
97
  "type": "boolean"
98
+ },
99
+ "platform.editor.a11y-main-toolbar-navigation_osrty": {
100
+ "type": "boolean"
98
101
  }
99
102
  }
100
103
  }