@atlaskit/editor-plugin-alignment 1.9.1 → 1.9.3
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 +19 -0
- package/dist/cjs/ui/ToolbarAlignment/icon-map.js +12 -4
- package/dist/cjs/ui/ToolbarAlignment/index.js +14 -6
- package/dist/es2019/ui/ToolbarAlignment/icon-map.js +12 -4
- package/dist/es2019/ui/ToolbarAlignment/index.js +16 -8
- package/dist/esm/ui/ToolbarAlignment/icon-map.js +12 -4
- package/dist/esm/ui/ToolbarAlignment/index.js +16 -8
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-alignment
|
|
2
2
|
|
|
3
|
+
## 1.9.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#125082](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/125082)
|
|
8
|
+
[`ba605ab4da0e1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ba605ab4da0e1) -
|
|
9
|
+
[ED-23977] This change cleans up the use of the feature flag
|
|
10
|
+
'platform.editor.a11y-main-toolbar-navigation_osrty'.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 1.9.2
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#125353](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/125353)
|
|
18
|
+
[`77847728bf617`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77847728bf617) -
|
|
19
|
+
Migrate icons in Editor primary toolbar
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 1.9.1
|
|
4
23
|
|
|
5
24
|
### Patch 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,11 +80,9 @@ 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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
});
|
|
86
|
-
}
|
|
83
|
+
_this.setState({
|
|
84
|
+
isOpen: false
|
|
85
|
+
});
|
|
87
86
|
});
|
|
88
87
|
return _this;
|
|
89
88
|
}
|
|
@@ -148,7 +147,16 @@ var AlignmentToolbar = exports.AlignmentToolbar = /*#__PURE__*/function (_React$
|
|
|
148
147
|
css: _styles2.triggerWrapper
|
|
149
148
|
}, (0, _react2.jsx)(_iconMap.IconMap, {
|
|
150
149
|
alignment: alignment
|
|
151
|
-
}), (0,
|
|
150
|
+
}), (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ?
|
|
151
|
+
//eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
152
|
+
(0, _react2.jsx)("span", {
|
|
153
|
+
css: _styles.expandIconContainerStyle
|
|
154
|
+
}, (0, _react2.jsx)(_chevronDown2.default, {
|
|
155
|
+
label: "",
|
|
156
|
+
color: "currentColor"
|
|
157
|
+
})) :
|
|
158
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
159
|
+
(0, _react2.jsx)("span", {
|
|
152
160
|
css: _styles2.expandIconWrapper
|
|
153
161
|
}, (0, _react2.jsx)(_chevronDown.default, {
|
|
154
162
|
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
|
|
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,11 +61,9 @@ 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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
});
|
|
67
|
-
}
|
|
64
|
+
this.setState({
|
|
65
|
+
isOpen: false
|
|
66
|
+
});
|
|
68
67
|
});
|
|
69
68
|
}
|
|
70
69
|
render() {
|
|
@@ -128,7 +127,16 @@ export class AlignmentToolbar extends React.Component {
|
|
|
128
127
|
css: triggerWrapper
|
|
129
128
|
}, jsx(IconMap, {
|
|
130
129
|
alignment: alignment
|
|
131
|
-
}),
|
|
130
|
+
}), fg('platform_editor_migration_icon_and_typography') ?
|
|
131
|
+
//eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
132
|
+
jsx("span", {
|
|
133
|
+
css: expandIconContainerStyle
|
|
134
|
+
}, jsx(ChevronDownIcon, {
|
|
135
|
+
label: "",
|
|
136
|
+
color: "currentColor"
|
|
137
|
+
})) :
|
|
138
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
139
|
+
jsx("span", {
|
|
132
140
|
css: expandIconWrapper
|
|
133
141
|
}, jsx(ExpandIcon, {
|
|
134
142
|
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
|
|
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,11 +76,9 @@ 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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
});
|
|
82
|
-
}
|
|
79
|
+
_this.setState({
|
|
80
|
+
isOpen: false
|
|
81
|
+
});
|
|
83
82
|
});
|
|
84
83
|
return _this;
|
|
85
84
|
}
|
|
@@ -144,7 +143,16 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
144
143
|
css: triggerWrapper
|
|
145
144
|
}, jsx(IconMap, {
|
|
146
145
|
alignment: alignment
|
|
147
|
-
}),
|
|
146
|
+
}), fg('platform_editor_migration_icon_and_typography') ?
|
|
147
|
+
//eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
148
|
+
jsx("span", {
|
|
149
|
+
css: expandIconContainerStyle
|
|
150
|
+
}, jsx(ChevronDownIcon, {
|
|
151
|
+
label: "",
|
|
152
|
+
color: "currentColor"
|
|
153
|
+
})) :
|
|
154
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
155
|
+
jsx("span", {
|
|
148
156
|
css: expandIconWrapper
|
|
149
157
|
}, jsx(ExpandIcon, {
|
|
150
158
|
label: ""
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-alignment",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.3",
|
|
4
4
|
"description": "Alignment plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@atlaskit/adf-schema": "^40.3.0",
|
|
25
|
-
"@atlaskit/editor-common": "^87.
|
|
25
|
+
"@atlaskit/editor-common": "^87.2.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.
|
|
30
|
-
"@atlaskit/platform-feature-flags": "
|
|
29
|
+
"@atlaskit/icon": "^22.9.0",
|
|
30
|
+
"@atlaskit/platform-feature-flags": "0.3.0",
|
|
31
31
|
"@atlaskit/tokens": "^1.56.0",
|
|
32
32
|
"@babel/runtime": "^7.0.0",
|
|
33
33
|
"@emotion/react": "^11.7.1"
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
".": "./src/index.ts"
|
|
94
94
|
},
|
|
95
95
|
"platform-feature-flags": {
|
|
96
|
-
"
|
|
96
|
+
"platform_editor_migration_icon_and_typography": {
|
|
97
97
|
"type": "boolean"
|
|
98
98
|
}
|
|
99
99
|
}
|