@atlaskit/editor-plugin-alignment 1.14.3 → 1.14.5
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 +14 -0
- package/dist/cjs/ui/ToolbarAlignment/index.js +12 -21
- package/dist/es2019/ui/ToolbarAlignment/index.js +0 -6
- package/dist/esm/ui/ToolbarAlignment/index.js +12 -21
- package/dist/types/ui/ToolbarAlignment/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/ToolbarAlignment/index.d.ts +0 -1
- package/package.json +5 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-alignment
|
|
2
2
|
|
|
3
|
+
## 1.14.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#181001](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/181001)
|
|
8
|
+
[`48d0c93c00dcf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/48d0c93c00dcf) -
|
|
9
|
+
Cleanup fix for the alignment toolbar not closing on click while open.
|
|
10
|
+
|
|
11
|
+
## 1.14.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 1.14.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -7,10 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = exports.AlignmentToolbar = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
10
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
14
|
var _react = _interopRequireDefault(require("react"));
|
|
16
15
|
var _react2 = require("@emotion/react");
|
|
@@ -25,38 +24,36 @@ var _types = require("../../pm-plugins/types");
|
|
|
25
24
|
var _Alignment = _interopRequireDefault(require("../Alignment"));
|
|
26
25
|
var _iconMap = require("./icon-map");
|
|
27
26
|
var _styles2 = require("./styles");
|
|
28
|
-
function
|
|
27
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
29
28
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
|
30
29
|
* @jsxRuntime classic
|
|
31
30
|
* @jsx jsx
|
|
32
31
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
33
32
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
34
33
|
var AlignmentToolbar = exports.AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
35
|
-
(0, _inherits2.default)(AlignmentToolbar, _React$Component);
|
|
36
|
-
var _super = _createSuper(AlignmentToolbar);
|
|
37
34
|
function AlignmentToolbar() {
|
|
38
35
|
var _this;
|
|
39
36
|
(0, _classCallCheck2.default)(this, AlignmentToolbar);
|
|
40
37
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
41
38
|
args[_key] = arguments[_key];
|
|
42
39
|
}
|
|
43
|
-
_this =
|
|
44
|
-
(0, _defineProperty2.default)(
|
|
45
|
-
(0, _defineProperty2.default)(
|
|
40
|
+
_this = _callSuper(this, AlignmentToolbar, [].concat(args));
|
|
41
|
+
(0, _defineProperty2.default)(_this, "toolbarItemRef", /*#__PURE__*/_react.default.createRef());
|
|
42
|
+
(0, _defineProperty2.default)(_this, "state", {
|
|
46
43
|
isOpen: false
|
|
47
44
|
});
|
|
48
|
-
(0, _defineProperty2.default)(
|
|
45
|
+
(0, _defineProperty2.default)(_this, "changeAlignment", function (align, togglePopup) {
|
|
49
46
|
if (togglePopup) {
|
|
50
47
|
_this.toggleOpen();
|
|
51
48
|
}
|
|
52
49
|
return _this.props.changeAlignment(align);
|
|
53
50
|
});
|
|
54
|
-
(0, _defineProperty2.default)(
|
|
51
|
+
(0, _defineProperty2.default)(_this, "toggleOpen", function () {
|
|
55
52
|
_this.setState({
|
|
56
53
|
isOpen: !_this.state.isOpen
|
|
57
54
|
});
|
|
58
55
|
});
|
|
59
|
-
(0, _defineProperty2.default)(
|
|
56
|
+
(0, _defineProperty2.default)(_this, "toggleOpenByKeyboard", function (event) {
|
|
60
57
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
61
58
|
event.preventDefault();
|
|
62
59
|
_this.setState({
|
|
@@ -64,7 +61,7 @@ var AlignmentToolbar = exports.AlignmentToolbar = /*#__PURE__*/function (_React$
|
|
|
64
61
|
});
|
|
65
62
|
}
|
|
66
63
|
});
|
|
67
|
-
(0, _defineProperty2.default)(
|
|
64
|
+
(0, _defineProperty2.default)(_this, "hide", function (attrs) {
|
|
68
65
|
if (_this.state.isOpen) {
|
|
69
66
|
_this.setState({
|
|
70
67
|
isOpen: false
|
|
@@ -75,19 +72,15 @@ var AlignmentToolbar = exports.AlignmentToolbar = /*#__PURE__*/function (_React$
|
|
|
75
72
|
}
|
|
76
73
|
}
|
|
77
74
|
});
|
|
78
|
-
(0, _defineProperty2.default)(
|
|
75
|
+
(0, _defineProperty2.default)(_this, "hideOnEscape", function () {
|
|
79
76
|
var _this$toolbarItemRef2;
|
|
80
77
|
_this.hide();
|
|
81
78
|
(_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 || (_this$toolbarItemRef2 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef2 === void 0 || _this$toolbarItemRef2.focus();
|
|
82
79
|
});
|
|
83
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOpenChange", function () {
|
|
84
|
-
_this.setState({
|
|
85
|
-
isOpen: false
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
80
|
return _this;
|
|
89
81
|
}
|
|
90
|
-
(0,
|
|
82
|
+
(0, _inherits2.default)(AlignmentToolbar, _React$Component);
|
|
83
|
+
return (0, _createClass2.default)(AlignmentToolbar, [{
|
|
91
84
|
key: "render",
|
|
92
85
|
value: function render() {
|
|
93
86
|
var _pluginState$align,
|
|
@@ -122,7 +115,6 @@ var AlignmentToolbar = exports.AlignmentToolbar = /*#__PURE__*/function (_React$
|
|
|
122
115
|
});
|
|
123
116
|
}
|
|
124
117
|
},
|
|
125
|
-
onOpenChange: (0, _platformFeatureFlags.fg)('platform_editor_fix_toolbar_alignment_item') ? undefined : this.onOpenChange,
|
|
126
118
|
handleEscapeKeydown: this.hideOnEscape,
|
|
127
119
|
arrowKeyNavigationProviderOptions: {
|
|
128
120
|
type: _uiMenu.ArrowKeyNavigationType.MENU
|
|
@@ -198,7 +190,6 @@ var AlignmentToolbar = exports.AlignmentToolbar = /*#__PURE__*/function (_React$
|
|
|
198
190
|
}
|
|
199
191
|
}
|
|
200
192
|
}]);
|
|
201
|
-
return AlignmentToolbar;
|
|
202
193
|
}(_react.default.Component);
|
|
203
194
|
(0, _defineProperty2.default)(AlignmentToolbar, "displayName", 'AlignmentToolbar');
|
|
204
195
|
var _default = exports.default = (0, _reactIntlNext.injectIntl)(AlignmentToolbar);
|
|
@@ -61,11 +61,6 @@ export class AlignmentToolbar extends React.Component {
|
|
|
61
61
|
this.hide();
|
|
62
62
|
(_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();
|
|
63
63
|
});
|
|
64
|
-
_defineProperty(this, "onOpenChange", () => {
|
|
65
|
-
this.setState({
|
|
66
|
-
isOpen: false
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
64
|
}
|
|
70
65
|
render() {
|
|
71
66
|
var _pluginState$align;
|
|
@@ -102,7 +97,6 @@ export class AlignmentToolbar extends React.Component {
|
|
|
102
97
|
});
|
|
103
98
|
}
|
|
104
99
|
},
|
|
105
|
-
onOpenChange: fg('platform_editor_fix_toolbar_alignment_item') ? undefined : this.onOpenChange,
|
|
106
100
|
handleEscapeKeydown: this.hideOnEscape,
|
|
107
101
|
arrowKeyNavigationProviderOptions: {
|
|
108
102
|
type: ArrowKeyNavigationType.MENU
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
9
|
/**
|
|
11
10
|
* @jsxRuntime classic
|
|
@@ -28,31 +27,29 @@ import { IconMap } from './icon-map';
|
|
|
28
27
|
import { triggerWrapper, wrapper } from './styles';
|
|
29
28
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
30
29
|
export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
31
|
-
_inherits(AlignmentToolbar, _React$Component);
|
|
32
|
-
var _super = _createSuper(AlignmentToolbar);
|
|
33
30
|
function AlignmentToolbar() {
|
|
34
31
|
var _this;
|
|
35
32
|
_classCallCheck(this, AlignmentToolbar);
|
|
36
33
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
37
34
|
args[_key] = arguments[_key];
|
|
38
35
|
}
|
|
39
|
-
_this =
|
|
40
|
-
_defineProperty(
|
|
41
|
-
_defineProperty(
|
|
36
|
+
_this = _callSuper(this, AlignmentToolbar, [].concat(args));
|
|
37
|
+
_defineProperty(_this, "toolbarItemRef", /*#__PURE__*/React.createRef());
|
|
38
|
+
_defineProperty(_this, "state", {
|
|
42
39
|
isOpen: false
|
|
43
40
|
});
|
|
44
|
-
_defineProperty(
|
|
41
|
+
_defineProperty(_this, "changeAlignment", function (align, togglePopup) {
|
|
45
42
|
if (togglePopup) {
|
|
46
43
|
_this.toggleOpen();
|
|
47
44
|
}
|
|
48
45
|
return _this.props.changeAlignment(align);
|
|
49
46
|
});
|
|
50
|
-
_defineProperty(
|
|
47
|
+
_defineProperty(_this, "toggleOpen", function () {
|
|
51
48
|
_this.setState({
|
|
52
49
|
isOpen: !_this.state.isOpen
|
|
53
50
|
});
|
|
54
51
|
});
|
|
55
|
-
_defineProperty(
|
|
52
|
+
_defineProperty(_this, "toggleOpenByKeyboard", function (event) {
|
|
56
53
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
57
54
|
event.preventDefault();
|
|
58
55
|
_this.setState({
|
|
@@ -60,7 +57,7 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
60
57
|
});
|
|
61
58
|
}
|
|
62
59
|
});
|
|
63
|
-
_defineProperty(
|
|
60
|
+
_defineProperty(_this, "hide", function (attrs) {
|
|
64
61
|
if (_this.state.isOpen) {
|
|
65
62
|
_this.setState({
|
|
66
63
|
isOpen: false
|
|
@@ -71,19 +68,15 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
70
|
});
|
|
74
|
-
_defineProperty(
|
|
71
|
+
_defineProperty(_this, "hideOnEscape", function () {
|
|
75
72
|
var _this$toolbarItemRef2;
|
|
76
73
|
_this.hide();
|
|
77
74
|
(_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 || (_this$toolbarItemRef2 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef2 === void 0 || _this$toolbarItemRef2.focus();
|
|
78
75
|
});
|
|
79
|
-
_defineProperty(_assertThisInitialized(_this), "onOpenChange", function () {
|
|
80
|
-
_this.setState({
|
|
81
|
-
isOpen: false
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
76
|
return _this;
|
|
85
77
|
}
|
|
86
|
-
|
|
78
|
+
_inherits(AlignmentToolbar, _React$Component);
|
|
79
|
+
return _createClass(AlignmentToolbar, [{
|
|
87
80
|
key: "render",
|
|
88
81
|
value: function render() {
|
|
89
82
|
var _pluginState$align,
|
|
@@ -118,7 +111,6 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
118
111
|
});
|
|
119
112
|
}
|
|
120
113
|
},
|
|
121
|
-
onOpenChange: fg('platform_editor_fix_toolbar_alignment_item') ? undefined : this.onOpenChange,
|
|
122
114
|
handleEscapeKeydown: this.hideOnEscape,
|
|
123
115
|
arrowKeyNavigationProviderOptions: {
|
|
124
116
|
type: ArrowKeyNavigationType.MENU
|
|
@@ -194,7 +186,6 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
194
186
|
}
|
|
195
187
|
}
|
|
196
188
|
}]);
|
|
197
|
-
return AlignmentToolbar;
|
|
198
189
|
}(React.Component);
|
|
199
190
|
_defineProperty(AlignmentToolbar, "displayName", 'AlignmentToolbar');
|
|
200
191
|
export default injectIntl(AlignmentToolbar);
|
|
@@ -33,7 +33,6 @@ export declare class AlignmentToolbar extends React.Component<Props & WrappedCom
|
|
|
33
33
|
private toggleOpenByKeyboard;
|
|
34
34
|
private hide;
|
|
35
35
|
private hideOnEscape;
|
|
36
|
-
private onOpenChange;
|
|
37
36
|
}
|
|
38
37
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
39
38
|
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
@@ -33,7 +33,6 @@ export declare class AlignmentToolbar extends React.Component<Props & WrappedCom
|
|
|
33
33
|
private toggleOpenByKeyboard;
|
|
34
34
|
private hide;
|
|
35
35
|
private hideOnEscape;
|
|
36
|
-
private onOpenChange;
|
|
37
36
|
}
|
|
38
37
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
39
38
|
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.14.
|
|
3
|
+
"version": "1.14.5",
|
|
4
4
|
"description": "Alignment plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
24
|
-
"@atlaskit/editor-common": "^
|
|
25
|
-
"@atlaskit/editor-plugin-primary-toolbar": "^2.
|
|
24
|
+
"@atlaskit/editor-common": "^97.0.0",
|
|
25
|
+
"@atlaskit/editor-plugin-primary-toolbar": "^2.1.0",
|
|
26
26
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
27
27
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
28
28
|
"@atlaskit/icon": "^23.1.0",
|
|
29
29
|
"@atlaskit/platform-feature-flags": "0.3.0",
|
|
30
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
31
|
-
"@atlaskit/tokens": "^2.
|
|
30
|
+
"@atlaskit/tmp-editor-statsig": "^2.29.0",
|
|
31
|
+
"@atlaskit/tokens": "^2.5.0",
|
|
32
32
|
"@babel/runtime": "^7.0.0",
|
|
33
33
|
"@emotion/react": "^11.7.1"
|
|
34
34
|
},
|
|
@@ -94,10 +94,5 @@
|
|
|
94
94
|
},
|
|
95
95
|
"af:exports": {
|
|
96
96
|
".": "./src/index.ts"
|
|
97
|
-
},
|
|
98
|
-
"platform-feature-flags": {
|
|
99
|
-
"platform_editor_fix_toolbar_alignment_item": {
|
|
100
|
-
"type": "boolean"
|
|
101
|
-
}
|
|
102
97
|
}
|
|
103
98
|
}
|