@atlaskit/editor-plugin-alignment 1.9.0 → 1.9.2

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,20 @@
1
1
  # @atlaskit/editor-plugin-alignment
2
2
 
3
+ ## 1.9.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#125353](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/125353)
8
+ [`77847728bf617`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77847728bf617) -
9
+ Migrate icons in Editor primary toolbar
10
+ - Updated dependencies
11
+
12
+ ## 1.9.1
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 1.9.0
4
19
 
5
20
  ### Minor Changes
@@ -8,20 +8,24 @@ exports.IconMap = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _reactIntlNext = require("react-intl-next");
10
10
  var _messages = require("@atlaskit/editor-common/messages");
11
+ var _alignCenterEditorAlignCenter = _interopRequireDefault(require("@atlaskit/icon/core/migration/align-center--editor-align-center"));
12
+ var _alignLeftEditorAlignLeft = _interopRequireDefault(require("@atlaskit/icon/core/migration/align-left--editor-align-left"));
13
+ var _alignRightEditorAlignRight = _interopRequireDefault(require("@atlaskit/icon/core/migration/align-right--editor-align-right"));
11
14
  var _alignCenter = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-center"));
12
15
  var _alignLeft = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-left"));
13
16
  var _alignRight = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-right"));
17
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
18
  var iconAndMessageMap = {
15
19
  start: {
16
- Component: _alignLeft.default,
20
+ Component: (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? _alignLeftEditorAlignLeft.default : _alignLeft.default,
17
21
  label: _messages.alignmentMessages.alignLeft
18
22
  },
19
23
  end: {
20
- Component: _alignRight.default,
24
+ Component: (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? _alignRightEditorAlignRight.default : _alignRight.default,
21
25
  label: _messages.alignmentMessages.alignRight
22
26
  },
23
27
  center: {
24
- Component: _alignCenter.default,
28
+ Component: (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? _alignCenterEditorAlignCenter.default : _alignCenter.default,
25
29
  label: _messages.alignmentMessages.alignCenter
26
30
  }
27
31
  };
@@ -30,7 +34,11 @@ var IconMap = exports.IconMap = function IconMap(props) {
30
34
  Component = _iconAndMessageMap$pr.Component,
31
35
  label = _iconAndMessageMap$pr.label;
32
36
  var intl = (0, _reactIntlNext.useIntl)();
33
- return /*#__PURE__*/_react.default.createElement(Component, {
37
+ return (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? /*#__PURE__*/_react.default.createElement(Component, {
38
+ label: intl.formatMessage(label),
39
+ color: "currentColor",
40
+ spacing: "spacious"
41
+ }) : /*#__PURE__*/_react.default.createElement(Component, {
34
42
  label: intl.formatMessage(label)
35
43
  });
36
44
  };
@@ -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 _chevronDown2 = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down"));
22
23
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
24
  var _Alignment = _interopRequireDefault(require("../Alignment"));
24
25
  var _iconMap = require("./icon-map");
@@ -79,7 +80,7 @@ var AlignmentToolbar = exports.AlignmentToolbar = /*#__PURE__*/function (_React$
79
80
  (_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 || (_this$toolbarItemRef2 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef2 === void 0 || _this$toolbarItemRef2.focus();
80
81
  });
81
82
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOpenChange", function () {
82
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-main-toolbar-navigation_osrty')) {
83
+ if ((0, _platformFeatureFlags.fg)('platform.editor.a11y-main-toolbar-navigation_osrty')) {
83
84
  _this.setState({
84
85
  isOpen: false
85
86
  });
@@ -148,7 +149,16 @@ var AlignmentToolbar = exports.AlignmentToolbar = /*#__PURE__*/function (_React$
148
149
  css: _styles2.triggerWrapper
149
150
  }, (0, _react2.jsx)(_iconMap.IconMap, {
150
151
  alignment: alignment
151
- }), (0, _react2.jsx)("span", {
152
+ }), (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ?
153
+ //eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
154
+ (0, _react2.jsx)("span", {
155
+ css: _styles.expandIconContainerStyle
156
+ }, (0, _react2.jsx)(_chevronDown2.default, {
157
+ label: "",
158
+ color: "currentColor"
159
+ })) :
160
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
161
+ (0, _react2.jsx)("span", {
152
162
  css: _styles2.expandIconWrapper
153
163
  }, (0, _react2.jsx)(_chevronDown.default, {
154
164
  label: ""
@@ -1,20 +1,24 @@
1
1
  import React from 'react';
2
2
  import { useIntl } from 'react-intl-next';
3
3
  import { alignmentMessages as messages } from '@atlaskit/editor-common/messages';
4
+ import AlignCenterIcon from '@atlaskit/icon/core/migration/align-center--editor-align-center';
5
+ import AlignLeftIcon from '@atlaskit/icon/core/migration/align-left--editor-align-left';
6
+ import AlignRightIcon from '@atlaskit/icon/core/migration/align-right--editor-align-right';
4
7
  import EditorAlignCenterIcon from '@atlaskit/icon/glyph/editor/align-center';
5
8
  import EditorAlignLeftIcon from '@atlaskit/icon/glyph/editor/align-left';
6
9
  import EditorAlignRightIcon from '@atlaskit/icon/glyph/editor/align-right';
10
+ import { fg } from '@atlaskit/platform-feature-flags';
7
11
  const iconAndMessageMap = {
8
12
  start: {
9
- Component: EditorAlignLeftIcon,
13
+ Component: fg('platform_editor_migration_icon_and_typography') ? AlignLeftIcon : EditorAlignLeftIcon,
10
14
  label: messages.alignLeft
11
15
  },
12
16
  end: {
13
- Component: EditorAlignRightIcon,
17
+ Component: fg('platform_editor_migration_icon_and_typography') ? AlignRightIcon : EditorAlignRightIcon,
14
18
  label: messages.alignRight
15
19
  },
16
20
  center: {
17
- Component: EditorAlignCenterIcon,
21
+ Component: fg('platform_editor_migration_icon_and_typography') ? AlignCenterIcon : EditorAlignCenterIcon,
18
22
  label: messages.alignCenter
19
23
  }
20
24
  };
@@ -24,7 +28,11 @@ export const IconMap = props => {
24
28
  label
25
29
  } = iconAndMessageMap[props.alignment];
26
30
  const intl = useIntl();
27
- return /*#__PURE__*/React.createElement(Component, {
31
+ return fg('platform_editor_migration_icon_and_typography') ? /*#__PURE__*/React.createElement(Component, {
32
+ label: intl.formatMessage(label),
33
+ color: "currentColor",
34
+ spacing: "spacious"
35
+ }) : /*#__PURE__*/React.createElement(Component, {
28
36
  label: intl.formatMessage(label)
29
37
  });
30
38
  };
@@ -9,10 +9,11 @@ import React from 'react';
9
9
  import { jsx } from '@emotion/react';
10
10
  import { injectIntl } from 'react-intl-next';
11
11
  import { alignmentMessages as messages } from '@atlaskit/editor-common/messages';
12
- import { separatorStyles } from '@atlaskit/editor-common/styles';
12
+ import { expandIconContainerStyle, separatorStyles } from '@atlaskit/editor-common/styles';
13
13
  import { ArrowKeyNavigationType, DropdownContainer as Dropdown, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
14
14
  import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
15
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
15
+ import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
16
17
  import Alignment from '../Alignment';
17
18
  import { IconMap } from './icon-map';
18
19
  import { expandIconWrapper, triggerWrapper, wrapper } from './styles';
@@ -60,7 +61,7 @@ export class AlignmentToolbar extends React.Component {
60
61
  (_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();
61
62
  });
62
63
  _defineProperty(this, "onOpenChange", () => {
63
- if (getBooleanFF('platform.editor.a11y-main-toolbar-navigation_osrty')) {
64
+ if (fg('platform.editor.a11y-main-toolbar-navigation_osrty')) {
64
65
  this.setState({
65
66
  isOpen: false
66
67
  });
@@ -128,7 +129,16 @@ export class AlignmentToolbar extends React.Component {
128
129
  css: triggerWrapper
129
130
  }, jsx(IconMap, {
130
131
  alignment: alignment
131
- }), jsx("span", {
132
+ }), fg('platform_editor_migration_icon_and_typography') ?
133
+ //eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
134
+ jsx("span", {
135
+ css: expandIconContainerStyle
136
+ }, jsx(ChevronDownIcon, {
137
+ label: "",
138
+ color: "currentColor"
139
+ })) :
140
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
141
+ jsx("span", {
132
142
  css: expandIconWrapper
133
143
  }, jsx(ExpandIcon, {
134
144
  label: ""
@@ -1,20 +1,24 @@
1
1
  import React from 'react';
2
2
  import { useIntl } from 'react-intl-next';
3
3
  import { alignmentMessages as messages } from '@atlaskit/editor-common/messages';
4
+ import AlignCenterIcon from '@atlaskit/icon/core/migration/align-center--editor-align-center';
5
+ import AlignLeftIcon from '@atlaskit/icon/core/migration/align-left--editor-align-left';
6
+ import AlignRightIcon from '@atlaskit/icon/core/migration/align-right--editor-align-right';
4
7
  import EditorAlignCenterIcon from '@atlaskit/icon/glyph/editor/align-center';
5
8
  import EditorAlignLeftIcon from '@atlaskit/icon/glyph/editor/align-left';
6
9
  import EditorAlignRightIcon from '@atlaskit/icon/glyph/editor/align-right';
10
+ import { fg } from '@atlaskit/platform-feature-flags';
7
11
  var iconAndMessageMap = {
8
12
  start: {
9
- Component: EditorAlignLeftIcon,
13
+ Component: fg('platform_editor_migration_icon_and_typography') ? AlignLeftIcon : EditorAlignLeftIcon,
10
14
  label: messages.alignLeft
11
15
  },
12
16
  end: {
13
- Component: EditorAlignRightIcon,
17
+ Component: fg('platform_editor_migration_icon_and_typography') ? AlignRightIcon : EditorAlignRightIcon,
14
18
  label: messages.alignRight
15
19
  },
16
20
  center: {
17
- Component: EditorAlignCenterIcon,
21
+ Component: fg('platform_editor_migration_icon_and_typography') ? AlignCenterIcon : EditorAlignCenterIcon,
18
22
  label: messages.alignCenter
19
23
  }
20
24
  };
@@ -23,7 +27,11 @@ export var IconMap = function IconMap(props) {
23
27
  Component = _iconAndMessageMap$pr.Component,
24
28
  label = _iconAndMessageMap$pr.label;
25
29
  var intl = useIntl();
26
- return /*#__PURE__*/React.createElement(Component, {
30
+ return fg('platform_editor_migration_icon_and_typography') ? /*#__PURE__*/React.createElement(Component, {
31
+ label: intl.formatMessage(label),
32
+ color: "currentColor",
33
+ spacing: "spacious"
34
+ }) : /*#__PURE__*/React.createElement(Component, {
27
35
  label: intl.formatMessage(label)
28
36
  });
29
37
  };
@@ -17,10 +17,11 @@ import React from 'react';
17
17
  import { jsx } from '@emotion/react';
18
18
  import { injectIntl } from 'react-intl-next';
19
19
  import { alignmentMessages as messages } from '@atlaskit/editor-common/messages';
20
- import { separatorStyles } from '@atlaskit/editor-common/styles';
20
+ import { expandIconContainerStyle, separatorStyles } from '@atlaskit/editor-common/styles';
21
21
  import { ArrowKeyNavigationType, DropdownContainer as Dropdown, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
22
22
  import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
23
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
23
+ import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
24
+ import { fg } from '@atlaskit/platform-feature-flags';
24
25
  import Alignment from '../Alignment';
25
26
  import { IconMap } from './icon-map';
26
27
  import { expandIconWrapper, triggerWrapper, wrapper } from './styles';
@@ -75,7 +76,7 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
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
  });
77
78
  _defineProperty(_assertThisInitialized(_this), "onOpenChange", function () {
78
- if (getBooleanFF('platform.editor.a11y-main-toolbar-navigation_osrty')) {
79
+ if (fg('platform.editor.a11y-main-toolbar-navigation_osrty')) {
79
80
  _this.setState({
80
81
  isOpen: false
81
82
  });
@@ -144,7 +145,16 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
144
145
  css: triggerWrapper
145
146
  }, jsx(IconMap, {
146
147
  alignment: alignment
147
- }), jsx("span", {
148
+ }), fg('platform_editor_migration_icon_and_typography') ?
149
+ //eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
150
+ jsx("span", {
151
+ css: expandIconContainerStyle
152
+ }, jsx(ChevronDownIcon, {
153
+ label: "",
154
+ color: "currentColor"
155
+ })) :
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
+ jsx("span", {
148
158
  css: expandIconWrapper
149
159
  }, jsx(ExpandIcon, {
150
160
  label: ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-alignment",
3
- "version": "1.9.0",
3
+ "version": "1.9.2",
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": "^40.3.0",
25
- "@atlaskit/editor-common": "^86.8.0",
25
+ "@atlaskit/editor-common": "^87.1.0",
26
26
  "@atlaskit/editor-plugin-primary-toolbar": "^1.3.0",
27
27
  "@atlaskit/editor-prosemirror": "5.0.1",
28
28
  "@atlaskit/editor-tables": "^2.8.0",
29
- "@atlaskit/icon": "^22.7.0",
29
+ "@atlaskit/icon": "^22.8.0",
30
30
  "@atlaskit/platform-feature-flags": "^0.3.0",
31
31
  "@atlaskit/tokens": "^1.56.0",
32
32
  "@babel/runtime": "^7.0.0",
@@ -95,6 +95,9 @@
95
95
  "platform-feature-flags": {
96
96
  "platform.editor.a11y-main-toolbar-navigation_osrty": {
97
97
  "type": "boolean"
98
+ },
99
+ "platform_editor_migration_icon_and_typography": {
100
+ "type": "boolean"
98
101
  }
99
102
  }
100
103
  }