@atlaskit/editor-plugin-alignment 3.3.0 → 3.3.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 +12 -0
- package/dist/cjs/alignmentPlugin.js +2 -4
- package/dist/cjs/ui/PrimaryToolbarComponent.js +3 -7
- package/dist/cjs/ui/ToolbarAlignment/index.js +4 -20
- package/dist/es2019/alignmentPlugin.js +2 -4
- package/dist/es2019/ui/PrimaryToolbarComponent.js +2 -5
- package/dist/es2019/ui/ToolbarAlignment/index.js +2 -16
- package/dist/esm/alignmentPlugin.js +2 -4
- package/dist/esm/ui/PrimaryToolbarComponent.js +2 -6
- package/dist/esm/ui/ToolbarAlignment/index.js +2 -18
- package/dist/types/ui/PrimaryToolbarComponent.d.ts +2 -3
- package/dist/types/ui/ToolbarAlignment/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/PrimaryToolbarComponent.d.ts +2 -3
- package/dist/types-ts4.5/ui/ToolbarAlignment/index.d.ts +1 -2
- package/package.json +4 -7
- package/dist/cjs/ui/ToolbarAlignment/index.compiled.css +0 -4
- package/dist/es2019/ui/ToolbarAlignment/index.compiled.css +0 -4
- package/dist/esm/ui/ToolbarAlignment/index.compiled.css +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -25,8 +25,7 @@ var alignmentPlugin = exports.alignmentPlugin = function alignmentPlugin(_ref) {
|
|
|
25
25
|
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
26
26
|
popupsScrollableElement = _ref2.popupsScrollableElement,
|
|
27
27
|
disabled = _ref2.disabled,
|
|
28
|
-
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing
|
|
29
|
-
toolbarSize = _ref2.toolbarSize;
|
|
28
|
+
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing;
|
|
30
29
|
return /*#__PURE__*/_react.default.createElement(_PrimaryToolbarComponent.PrimaryToolbarComponent, {
|
|
31
30
|
api: api,
|
|
32
31
|
editorView: editorView,
|
|
@@ -34,8 +33,7 @@ var alignmentPlugin = exports.alignmentPlugin = function alignmentPlugin(_ref) {
|
|
|
34
33
|
popupsMountPoint: popupsMountPoint,
|
|
35
34
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
36
35
|
popupsScrollableElement: popupsScrollableElement,
|
|
37
|
-
isToolbarReducedSpacing: isToolbarReducedSpacing
|
|
38
|
-
toolbarSize: toolbarSize
|
|
36
|
+
isToolbarReducedSpacing: isToolbarReducedSpacing
|
|
39
37
|
});
|
|
40
38
|
};
|
|
41
39
|
api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 || _api$primaryToolbar.actions.registerComponent({
|
|
@@ -9,10 +9,9 @@ exports.PrimaryToolbarComponent = PrimaryToolbarComponent;
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
11
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
12
|
-
var _types = require("@atlaskit/editor-common/types");
|
|
13
12
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
14
13
|
var _editorCommands = require("../editor-commands");
|
|
15
|
-
var
|
|
14
|
+
var _types = require("../pm-plugins/types");
|
|
16
15
|
var _ToolbarAlignment = _interopRequireDefault(require("./ToolbarAlignment"));
|
|
17
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
17
|
var usePrimaryToolbarComponentPluginState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
@@ -37,9 +36,7 @@ function PrimaryToolbarComponent(_ref) {
|
|
|
37
36
|
popupsMountPoint = _ref.popupsMountPoint,
|
|
38
37
|
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
39
38
|
popupsScrollableElement = _ref.popupsScrollableElement,
|
|
40
|
-
isToolbarReducedSpacing = _ref.isToolbarReducedSpacing
|
|
41
|
-
_ref$toolbarSize = _ref.toolbarSize,
|
|
42
|
-
toolbarSize = _ref$toolbarSize === void 0 ? _types.ToolbarSize.XXL : _ref$toolbarSize;
|
|
39
|
+
isToolbarReducedSpacing = _ref.isToolbarReducedSpacing;
|
|
43
40
|
var _usePrimaryToolbarCom = usePrimaryToolbarComponentPluginState(api),
|
|
44
41
|
align = _usePrimaryToolbarCom.align,
|
|
45
42
|
isEnabled = _usePrimaryToolbarCom.isEnabled;
|
|
@@ -55,7 +52,6 @@ function PrimaryToolbarComponent(_ref) {
|
|
|
55
52
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
56
53
|
popupsScrollableElement: popupsScrollableElement,
|
|
57
54
|
api: api,
|
|
58
|
-
toolbarType:
|
|
59
|
-
toolbarSize: toolbarSize
|
|
55
|
+
toolbarType: _types.ToolbarType.PRIMARY
|
|
60
56
|
});
|
|
61
57
|
}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.AlignmentToolbar = void 0;
|
|
9
|
-
require("./index.compiled.css");
|
|
10
9
|
var _runtime = require("@compiled/react/runtime");
|
|
11
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -18,15 +17,13 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
18
17
|
var _reactIntlNext = require("react-intl-next");
|
|
19
18
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
20
19
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
21
|
-
var _types = require("@atlaskit/editor-common/types");
|
|
22
20
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
23
21
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
24
22
|
var _alignTextCenter = _interopRequireDefault(require("@atlaskit/icon/core/align-text-center"));
|
|
25
23
|
var _alignTextLeft = _interopRequireDefault(require("@atlaskit/icon/core/align-text-left"));
|
|
26
24
|
var _alignTextRight = _interopRequireDefault(require("@atlaskit/icon/core/align-text-right"));
|
|
27
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
28
25
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
29
|
-
var
|
|
26
|
+
var _types = require("../../pm-plugins/types");
|
|
30
27
|
var _Alignment = _interopRequireDefault(require("../Alignment"));
|
|
31
28
|
var _iconMap = require("./icon-map");
|
|
32
29
|
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)); }
|
|
@@ -101,24 +98,12 @@ var AlignmentToolbar = exports.AlignmentToolbar = /*#__PURE__*/function (_React$
|
|
|
101
98
|
align = _this$props.align,
|
|
102
99
|
disabled = _this$props.disabled,
|
|
103
100
|
intl = _this$props.intl,
|
|
104
|
-
api = _this$props.api
|
|
105
|
-
toolbarType = _this$props.toolbarType,
|
|
106
|
-
toolbarSize = _this$props.toolbarSize;
|
|
101
|
+
api = _this$props.api;
|
|
107
102
|
var alignment = align !== null && align !== void 0 ? align : 'start';
|
|
108
103
|
var title = intl.formatMessage(_messages.alignmentMessages.alignment);
|
|
109
104
|
var reducedSpacing = (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
|
|
110
105
|
exposure: true
|
|
111
106
|
}) ? 'compact' : 'none';
|
|
112
|
-
if (toolbarType === _types2.ToolbarType.PRIMARY && toolbarSize && toolbarSize > _types.ToolbarSize.XL && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
|
|
113
|
-
exposure: true
|
|
114
|
-
}) && !(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6')) {
|
|
115
|
-
return /*#__PURE__*/_react.default.createElement(_Alignment.default, {
|
|
116
|
-
onClick: function onClick(align) {
|
|
117
|
-
return _this2.changeAlignment(align, false);
|
|
118
|
-
},
|
|
119
|
-
className: (0, _runtime.ax)(["_ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t"])
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
107
|
var items = [{
|
|
123
108
|
key: 'alignmentLeft',
|
|
124
109
|
content: intl.formatMessage(_messages.alignmentMessages.alignLeft),
|
|
@@ -153,7 +138,7 @@ var AlignmentToolbar = exports.AlignmentToolbar = /*#__PURE__*/function (_React$
|
|
|
153
138
|
label: ""
|
|
154
139
|
})
|
|
155
140
|
}];
|
|
156
|
-
return /*#__PURE__*/_react.default.createElement(_ui.ToolbarDropdownWrapper, null, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')
|
|
141
|
+
return /*#__PURE__*/_react.default.createElement(_ui.ToolbarDropdownWrapper, null, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? /*#__PURE__*/_react.default.createElement(_uiMenu.DropdownMenuWithKeyboardNavigation, {
|
|
157
142
|
arrowKeyNavigationProviderOptions: {
|
|
158
143
|
type: _uiMenu.ArrowKeyNavigationType.MENU
|
|
159
144
|
},
|
|
@@ -233,7 +218,7 @@ var AlignmentToolbar = exports.AlignmentToolbar = /*#__PURE__*/function (_React$
|
|
|
233
218
|
key: "componentDidUpdate",
|
|
234
219
|
value: function componentDidUpdate(prevProps) {
|
|
235
220
|
var _this3 = this;
|
|
236
|
-
if (this.props.toolbarType !==
|
|
221
|
+
if (this.props.toolbarType !== _types.ToolbarType.FLOATING && this.state.isOpen) {
|
|
237
222
|
// by triggering the keyboard event with a setTimeout, we ensure that the tooltip
|
|
238
223
|
// associated with the alignment button doesn't render until the next render cycle
|
|
239
224
|
// where the popup will be correctly positioned and the relative position of the tooltip
|
|
@@ -251,5 +236,4 @@ var AlignmentToolbar = exports.AlignmentToolbar = /*#__PURE__*/function (_React$
|
|
|
251
236
|
}]);
|
|
252
237
|
}(_react.default.Component);
|
|
253
238
|
(0, _defineProperty2.default)(AlignmentToolbar, "displayName", 'AlignmentToolbar');
|
|
254
|
-
var alignmentToolbarStyles = null;
|
|
255
239
|
var _default = exports.default = (0, _reactIntlNext.injectIntl)(AlignmentToolbar);
|
|
@@ -19,8 +19,7 @@ export const alignmentPlugin = ({
|
|
|
19
19
|
popupsBoundariesElement,
|
|
20
20
|
popupsScrollableElement,
|
|
21
21
|
disabled,
|
|
22
|
-
isToolbarReducedSpacing
|
|
23
|
-
toolbarSize
|
|
22
|
+
isToolbarReducedSpacing
|
|
24
23
|
}) => {
|
|
25
24
|
return /*#__PURE__*/React.createElement(PrimaryToolbarComponent, {
|
|
26
25
|
api: api,
|
|
@@ -29,8 +28,7 @@ export const alignmentPlugin = ({
|
|
|
29
28
|
popupsMountPoint: popupsMountPoint,
|
|
30
29
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
31
30
|
popupsScrollableElement: popupsScrollableElement,
|
|
32
|
-
isToolbarReducedSpacing: isToolbarReducedSpacing
|
|
33
|
-
toolbarSize: toolbarSize
|
|
31
|
+
isToolbarReducedSpacing: isToolbarReducedSpacing
|
|
34
32
|
});
|
|
35
33
|
};
|
|
36
34
|
api === null || api === void 0 ? void 0 : (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.actions.registerComponent({
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
4
|
-
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
5
4
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
6
5
|
import { changeAlignment } from '../editor-commands';
|
|
7
6
|
import { ToolbarType } from '../pm-plugins/types';
|
|
@@ -29,8 +28,7 @@ export function PrimaryToolbarComponent({
|
|
|
29
28
|
popupsMountPoint,
|
|
30
29
|
popupsBoundariesElement,
|
|
31
30
|
popupsScrollableElement,
|
|
32
|
-
isToolbarReducedSpacing
|
|
33
|
-
toolbarSize = ToolbarSize.XXL
|
|
31
|
+
isToolbarReducedSpacing
|
|
34
32
|
}) {
|
|
35
33
|
const {
|
|
36
34
|
align,
|
|
@@ -46,7 +44,6 @@ export function PrimaryToolbarComponent({
|
|
|
46
44
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
47
45
|
popupsScrollableElement: popupsScrollableElement,
|
|
48
46
|
api: api,
|
|
49
|
-
toolbarType: ToolbarType.PRIMARY
|
|
50
|
-
toolbarSize: toolbarSize
|
|
47
|
+
toolbarType: ToolbarType.PRIMARY
|
|
51
48
|
});
|
|
52
49
|
}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import "./index.compiled.css";
|
|
4
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
4
|
import React from 'react';
|
|
6
5
|
import { injectIntl } from 'react-intl-next';
|
|
7
6
|
import { alignCenter, alignLeft, alignRight, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
8
7
|
import { alignmentMessages as messages } from '@atlaskit/editor-common/messages';
|
|
9
|
-
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
10
8
|
import { Shortcut, ToolbarDropdownTriggerWrapper, ToolbarDropdownWrapper, ToolbarExpandIcon, ToolbarSeparator } from '@atlaskit/editor-common/ui';
|
|
11
9
|
import { ArrowKeyNavigationType, DropdownContainer as Dropdown, DropdownMenuWithKeyboardNavigation as DropdownMenu, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
12
10
|
import AlignTextCenterIcon from '@atlaskit/icon/core/align-text-center';
|
|
13
11
|
import AlignTextLeftIcon from '@atlaskit/icon/core/align-text-left';
|
|
14
12
|
import AlignTextRightIcon from '@atlaskit/icon/core/align-text-right';
|
|
15
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
13
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
17
14
|
import { ToolbarType } from '../../pm-plugins/types';
|
|
18
15
|
import Alignment from '../Alignment';
|
|
@@ -77,23 +74,13 @@ export class AlignmentToolbar extends React.Component {
|
|
|
77
74
|
align,
|
|
78
75
|
disabled,
|
|
79
76
|
intl,
|
|
80
|
-
api
|
|
81
|
-
toolbarType,
|
|
82
|
-
toolbarSize
|
|
77
|
+
api
|
|
83
78
|
} = this.props;
|
|
84
79
|
const alignment = align !== null && align !== void 0 ? align : 'start';
|
|
85
80
|
const title = intl.formatMessage(messages.alignment);
|
|
86
81
|
const reducedSpacing = editorExperiment('platform_editor_controls', 'variant1', {
|
|
87
82
|
exposure: true
|
|
88
83
|
}) ? 'compact' : 'none';
|
|
89
|
-
if (toolbarType === ToolbarType.PRIMARY && toolbarSize && toolbarSize > ToolbarSize.XL && editorExperiment('platform_editor_controls', 'variant1', {
|
|
90
|
-
exposure: true
|
|
91
|
-
}) && !fg('platform_editor_controls_patch_6')) {
|
|
92
|
-
return /*#__PURE__*/React.createElement(Alignment, {
|
|
93
|
-
onClick: align => this.changeAlignment(align, false),
|
|
94
|
-
className: ax(["_ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t"])
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
84
|
const items = [{
|
|
98
85
|
key: 'alignmentLeft',
|
|
99
86
|
content: intl.formatMessage(messages.alignLeft),
|
|
@@ -128,7 +115,7 @@ export class AlignmentToolbar extends React.Component {
|
|
|
128
115
|
label: ""
|
|
129
116
|
})
|
|
130
117
|
}];
|
|
131
|
-
return /*#__PURE__*/React.createElement(ToolbarDropdownWrapper, null, editorExperiment('platform_editor_controls', 'variant1')
|
|
118
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownWrapper, null, editorExperiment('platform_editor_controls', 'variant1') ? /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
132
119
|
arrowKeyNavigationProviderOptions: {
|
|
133
120
|
type: ArrowKeyNavigationType.MENU
|
|
134
121
|
},
|
|
@@ -218,5 +205,4 @@ export class AlignmentToolbar extends React.Component {
|
|
|
218
205
|
}
|
|
219
206
|
}
|
|
220
207
|
_defineProperty(AlignmentToolbar, "displayName", 'AlignmentToolbar');
|
|
221
|
-
const alignmentToolbarStyles = null;
|
|
222
208
|
export default injectIntl(AlignmentToolbar);
|
|
@@ -18,8 +18,7 @@ export var alignmentPlugin = function alignmentPlugin(_ref) {
|
|
|
18
18
|
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
19
19
|
popupsScrollableElement = _ref2.popupsScrollableElement,
|
|
20
20
|
disabled = _ref2.disabled,
|
|
21
|
-
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing
|
|
22
|
-
toolbarSize = _ref2.toolbarSize;
|
|
21
|
+
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing;
|
|
23
22
|
return /*#__PURE__*/React.createElement(PrimaryToolbarComponent, {
|
|
24
23
|
api: api,
|
|
25
24
|
editorView: editorView,
|
|
@@ -27,8 +26,7 @@ export var alignmentPlugin = function alignmentPlugin(_ref) {
|
|
|
27
26
|
popupsMountPoint: popupsMountPoint,
|
|
28
27
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
29
28
|
popupsScrollableElement: popupsScrollableElement,
|
|
30
|
-
isToolbarReducedSpacing: isToolbarReducedSpacing
|
|
31
|
-
toolbarSize: toolbarSize
|
|
29
|
+
isToolbarReducedSpacing: isToolbarReducedSpacing
|
|
32
30
|
});
|
|
33
31
|
};
|
|
34
32
|
api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 || _api$primaryToolbar.actions.registerComponent({
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
4
|
-
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
5
4
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
6
5
|
import { changeAlignment } from '../editor-commands';
|
|
7
6
|
import { ToolbarType } from '../pm-plugins/types';
|
|
@@ -28,9 +27,7 @@ export function PrimaryToolbarComponent(_ref) {
|
|
|
28
27
|
popupsMountPoint = _ref.popupsMountPoint,
|
|
29
28
|
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
30
29
|
popupsScrollableElement = _ref.popupsScrollableElement,
|
|
31
|
-
isToolbarReducedSpacing = _ref.isToolbarReducedSpacing
|
|
32
|
-
_ref$toolbarSize = _ref.toolbarSize,
|
|
33
|
-
toolbarSize = _ref$toolbarSize === void 0 ? ToolbarSize.XXL : _ref$toolbarSize;
|
|
30
|
+
isToolbarReducedSpacing = _ref.isToolbarReducedSpacing;
|
|
34
31
|
var _usePrimaryToolbarCom = usePrimaryToolbarComponentPluginState(api),
|
|
35
32
|
align = _usePrimaryToolbarCom.align,
|
|
36
33
|
isEnabled = _usePrimaryToolbarCom.isEnabled;
|
|
@@ -46,7 +43,6 @@ export function PrimaryToolbarComponent(_ref) {
|
|
|
46
43
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
47
44
|
popupsScrollableElement: popupsScrollableElement,
|
|
48
45
|
api: api,
|
|
49
|
-
toolbarType: ToolbarType.PRIMARY
|
|
50
|
-
toolbarSize: toolbarSize
|
|
46
|
+
toolbarType: ToolbarType.PRIMARY
|
|
51
47
|
});
|
|
52
48
|
}
|
|
@@ -5,7 +5,6 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
import "./index.compiled.css";
|
|
9
8
|
import { ax, ix } from "@compiled/react/runtime";
|
|
10
9
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
@@ -13,13 +12,11 @@ import React from 'react';
|
|
|
13
12
|
import { injectIntl } from 'react-intl-next';
|
|
14
13
|
import { alignCenter, alignLeft, alignRight, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
15
14
|
import { alignmentMessages as messages } from '@atlaskit/editor-common/messages';
|
|
16
|
-
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
17
15
|
import { Shortcut, ToolbarDropdownTriggerWrapper, ToolbarDropdownWrapper, ToolbarExpandIcon, ToolbarSeparator } from '@atlaskit/editor-common/ui';
|
|
18
16
|
import { ArrowKeyNavigationType, DropdownContainer as Dropdown, DropdownMenuWithKeyboardNavigation as DropdownMenu, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
19
17
|
import AlignTextCenterIcon from '@atlaskit/icon/core/align-text-center';
|
|
20
18
|
import AlignTextLeftIcon from '@atlaskit/icon/core/align-text-left';
|
|
21
19
|
import AlignTextRightIcon from '@atlaskit/icon/core/align-text-right';
|
|
22
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
23
20
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
24
21
|
import { ToolbarType } from '../../pm-plugins/types';
|
|
25
22
|
import Alignment from '../Alignment';
|
|
@@ -94,24 +91,12 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
94
91
|
align = _this$props.align,
|
|
95
92
|
disabled = _this$props.disabled,
|
|
96
93
|
intl = _this$props.intl,
|
|
97
|
-
api = _this$props.api
|
|
98
|
-
toolbarType = _this$props.toolbarType,
|
|
99
|
-
toolbarSize = _this$props.toolbarSize;
|
|
94
|
+
api = _this$props.api;
|
|
100
95
|
var alignment = align !== null && align !== void 0 ? align : 'start';
|
|
101
96
|
var title = intl.formatMessage(messages.alignment);
|
|
102
97
|
var reducedSpacing = editorExperiment('platform_editor_controls', 'variant1', {
|
|
103
98
|
exposure: true
|
|
104
99
|
}) ? 'compact' : 'none';
|
|
105
|
-
if (toolbarType === ToolbarType.PRIMARY && toolbarSize && toolbarSize > ToolbarSize.XL && editorExperiment('platform_editor_controls', 'variant1', {
|
|
106
|
-
exposure: true
|
|
107
|
-
}) && !fg('platform_editor_controls_patch_6')) {
|
|
108
|
-
return /*#__PURE__*/React.createElement(Alignment, {
|
|
109
|
-
onClick: function onClick(align) {
|
|
110
|
-
return _this2.changeAlignment(align, false);
|
|
111
|
-
},
|
|
112
|
-
className: ax(["_ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t"])
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
100
|
var items = [{
|
|
116
101
|
key: 'alignmentLeft',
|
|
117
102
|
content: intl.formatMessage(messages.alignLeft),
|
|
@@ -146,7 +131,7 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
146
131
|
label: ""
|
|
147
132
|
})
|
|
148
133
|
}];
|
|
149
|
-
return /*#__PURE__*/React.createElement(ToolbarDropdownWrapper, null, editorExperiment('platform_editor_controls', 'variant1')
|
|
134
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownWrapper, null, editorExperiment('platform_editor_controls', 'variant1') ? /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
150
135
|
arrowKeyNavigationProviderOptions: {
|
|
151
136
|
type: ArrowKeyNavigationType.MENU
|
|
152
137
|
},
|
|
@@ -244,5 +229,4 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
244
229
|
}]);
|
|
245
230
|
}(React.Component);
|
|
246
231
|
_defineProperty(AlignmentToolbar, "displayName", 'AlignmentToolbar');
|
|
247
|
-
var alignmentToolbarStyles = null;
|
|
248
232
|
export default injectIntl(AlignmentToolbar);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { AlignmentPlugin } from '../alignmentPluginType';
|
|
5
5
|
interface PrimaryToolbarComponentProps {
|
|
@@ -10,7 +10,6 @@ interface PrimaryToolbarComponentProps {
|
|
|
10
10
|
popupsBoundariesElement?: HTMLElement;
|
|
11
11
|
popupsScrollableElement?: HTMLElement;
|
|
12
12
|
isToolbarReducedSpacing: boolean;
|
|
13
|
-
toolbarSize?: ToolbarSize;
|
|
14
13
|
}
|
|
15
|
-
export declare function PrimaryToolbarComponent({ api, editorView, disabled, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, isToolbarReducedSpacing,
|
|
14
|
+
export declare function PrimaryToolbarComponent({ api, editorView, disabled, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, isToolbarReducedSpacing, }: PrimaryToolbarComponentProps): React.JSX.Element;
|
|
16
15
|
export {};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
7
|
-
import {
|
|
7
|
+
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
8
8
|
import type { AlignmentPlugin } from '../../alignmentPluginType';
|
|
9
9
|
import { ToolbarType, type AlignmentState } from '../../pm-plugins/types';
|
|
10
10
|
export interface State {
|
|
@@ -20,7 +20,6 @@ export interface Props {
|
|
|
20
20
|
disabled?: boolean;
|
|
21
21
|
api: ExtractInjectionAPI<AlignmentPlugin> | undefined;
|
|
22
22
|
toolbarType: ToolbarType;
|
|
23
|
-
toolbarSize?: ToolbarSize;
|
|
24
23
|
}
|
|
25
24
|
export declare class AlignmentToolbar extends React.Component<Props & WrappedComponentProps, State> {
|
|
26
25
|
static displayName: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { AlignmentPlugin } from '../alignmentPluginType';
|
|
5
5
|
interface PrimaryToolbarComponentProps {
|
|
@@ -10,7 +10,6 @@ interface PrimaryToolbarComponentProps {
|
|
|
10
10
|
popupsBoundariesElement?: HTMLElement;
|
|
11
11
|
popupsScrollableElement?: HTMLElement;
|
|
12
12
|
isToolbarReducedSpacing: boolean;
|
|
13
|
-
toolbarSize?: ToolbarSize;
|
|
14
13
|
}
|
|
15
|
-
export declare function PrimaryToolbarComponent({ api, editorView, disabled, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, isToolbarReducedSpacing,
|
|
14
|
+
export declare function PrimaryToolbarComponent({ api, editorView, disabled, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, isToolbarReducedSpacing, }: PrimaryToolbarComponentProps): React.JSX.Element;
|
|
16
15
|
export {};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
7
|
-
import {
|
|
7
|
+
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
8
8
|
import type { AlignmentPlugin } from '../../alignmentPluginType';
|
|
9
9
|
import { ToolbarType, type AlignmentState } from '../../pm-plugins/types';
|
|
10
10
|
export interface State {
|
|
@@ -20,7 +20,6 @@ export interface Props {
|
|
|
20
20
|
disabled?: boolean;
|
|
21
21
|
api: ExtractInjectionAPI<AlignmentPlugin> | undefined;
|
|
22
22
|
toolbarType: ToolbarType;
|
|
23
|
-
toolbarSize?: ToolbarSize;
|
|
24
23
|
}
|
|
25
24
|
export declare class AlignmentToolbar extends React.Component<Props & WrappedComponentProps, State> {
|
|
26
25
|
static displayName: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-alignment",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"description": "Alignment plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,23 +28,20 @@
|
|
|
28
28
|
},
|
|
29
29
|
"platform_editor_use_preferences_plugin": {
|
|
30
30
|
"type": "boolean"
|
|
31
|
-
},
|
|
32
|
-
"platform_editor_controls_patch_6": {
|
|
33
|
-
"type": "boolean"
|
|
34
31
|
}
|
|
35
32
|
},
|
|
36
33
|
"dependencies": {
|
|
37
34
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
38
35
|
"@atlaskit/css": "^0.10.0",
|
|
39
|
-
"@atlaskit/editor-common": "^
|
|
36
|
+
"@atlaskit/editor-common": "^107.0.0",
|
|
40
37
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
41
38
|
"@atlaskit/editor-plugin-primary-toolbar": "^3.2.0",
|
|
42
39
|
"@atlaskit/editor-plugin-selection-toolbar": "^3.7.0",
|
|
43
40
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
44
41
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
45
|
-
"@atlaskit/icon": "^
|
|
42
|
+
"@atlaskit/icon": "^27.0.0",
|
|
46
43
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
|
-
"@atlaskit/tmp-editor-statsig": "^7.
|
|
44
|
+
"@atlaskit/tmp-editor-statsig": "^7.1.0",
|
|
48
45
|
"@atlaskit/tokens": "^5.2.0",
|
|
49
46
|
"@babel/runtime": "^7.0.0",
|
|
50
47
|
"@compiled/react": "^0.18.3"
|