@atlaskit/editor-plugin-alignment 27.0.4 → 27.0.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 +6 -0
- package/dist/cjs/editor-commands/index.js +20 -20
- package/dist/cjs/pm-plugins/keymap.js +6 -5
- package/dist/cjs/ui/Alignment/AlignmentButton/index.js +2 -2
- package/dist/cjs/ui/Alignment/index.js +4 -4
- package/dist/cjs/ui/FloatingToolbarComponent.js +4 -4
- package/dist/cjs/ui/PrimaryToolbarComponent.js +4 -4
- package/dist/cjs/ui/Toolbar/AlignmentMenu.js +8 -7
- package/dist/cjs/ui/Toolbar/AlignmentMenuItem.js +6 -5
- package/dist/cjs/ui/Toolbar/MenuSection.js +4 -4
- package/dist/cjs/ui/Toolbar/options.js +21 -18
- package/dist/cjs/ui/ToolbarAlignment/icon-map.js +4 -4
- package/dist/cjs/ui/ToolbarAlignment/index.js +33 -26
- package/dist/cjs/ui/toolbar-components.js +25 -24
- package/dist/es2019/editor-commands/index.js +2 -2
- package/dist/es2019/pm-plugins/keymap.js +3 -2
- package/dist/es2019/ui/Alignment/AlignmentButton/index.js +1 -1
- package/dist/es2019/ui/Alignment/index.js +1 -1
- package/dist/es2019/ui/FloatingToolbarComponent.js +2 -2
- package/dist/es2019/ui/PrimaryToolbarComponent.js +2 -2
- package/dist/es2019/ui/Toolbar/AlignmentMenu.js +4 -3
- package/dist/es2019/ui/Toolbar/AlignmentMenuItem.js +3 -2
- package/dist/es2019/ui/Toolbar/MenuSection.js +2 -2
- package/dist/es2019/ui/Toolbar/options.js +6 -3
- package/dist/es2019/ui/ToolbarAlignment/icon-map.js +1 -1
- package/dist/es2019/ui/ToolbarAlignment/index.js +10 -3
- package/dist/es2019/ui/toolbar-components.js +2 -1
- package/dist/esm/editor-commands/index.js +2 -2
- package/dist/esm/pm-plugins/keymap.js +3 -2
- package/dist/esm/ui/Alignment/AlignmentButton/index.js +1 -1
- package/dist/esm/ui/Alignment/index.js +1 -1
- package/dist/esm/ui/FloatingToolbarComponent.js +2 -2
- package/dist/esm/ui/PrimaryToolbarComponent.js +2 -2
- package/dist/esm/ui/Toolbar/AlignmentMenu.js +4 -3
- package/dist/esm/ui/Toolbar/AlignmentMenuItem.js +3 -2
- package/dist/esm/ui/Toolbar/MenuSection.js +2 -2
- package/dist/esm/ui/Toolbar/options.js +6 -3
- package/dist/esm/ui/ToolbarAlignment/icon-map.js +1 -1
- package/dist/esm/ui/ToolbarAlignment/index.js +10 -3
- package/dist/esm/ui/toolbar-components.js +2 -1
- package/dist/types/alignmentPluginType.d.ts +8 -8
- package/dist/types/editor-commands/index.d.ts +3 -1
- package/dist/types/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/ui/FloatingToolbarComponent.d.ts +1 -1
- package/dist/types/ui/PrimaryToolbarComponent.d.ts +1 -1
- package/dist/types/ui/Toolbar/AlignmentMenu.d.ts +1 -1
- package/dist/types/ui/Toolbar/AlignmentMenuItem.d.ts +2 -2
- package/dist/types/ui/Toolbar/MenuSection.d.ts +1 -1
- package/dist/types/ui/Toolbar/types.d.ts +1 -1
- package/dist/types/ui/ToolbarAlignment/index.d.ts +1 -1
- package/dist/types/ui/toolbar-components.d.ts +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.isAlignable = exports.changeAlignmentTr = exports.changeAlignment = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
8
8
|
var _commands = require("@atlaskit/editor-common/commands");
|
|
9
|
-
var
|
|
9
|
+
var _withAnalytics = require("@atlaskit/editor-common/withAnalytics");
|
|
10
10
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
11
|
/**
|
|
12
12
|
* Iterates over the commands one after the other,
|
|
@@ -55,11 +55,11 @@ var changeBlockAlignmentWithAnalytics = function changeBlockAlignmentWithAnalyti
|
|
|
55
55
|
paragraph = _state$schema2$nodes.paragraph,
|
|
56
56
|
heading = _state$schema2$nodes.heading,
|
|
57
57
|
alignment = _state$schema2.marks.alignment;
|
|
58
|
-
return (0,
|
|
59
|
-
eventType:
|
|
60
|
-
actionSubject:
|
|
61
|
-
action:
|
|
62
|
-
actionSubjectId:
|
|
58
|
+
return (0, _withAnalytics.withAnalytics)(editorAnalyticsApi, {
|
|
59
|
+
eventType: _enums.EVENT_TYPE.TRACK,
|
|
60
|
+
actionSubject: _enums.ACTION_SUBJECT.ALIGNMENT,
|
|
61
|
+
action: _enums.ACTION.UPDATED,
|
|
62
|
+
actionSubjectId: _enums.ACTION_SUBJECT_ID.TEXT,
|
|
63
63
|
attributes: {
|
|
64
64
|
alignmentType: align,
|
|
65
65
|
inputMethod: inputMethod
|
|
@@ -87,10 +87,10 @@ var changeBlockAlignmentWithAnalyticsTr = function changeBlockAlignmentWithAnaly
|
|
|
87
87
|
if (alignmentApplied) {
|
|
88
88
|
var _api$analytics;
|
|
89
89
|
api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.attachAnalyticsEvent({
|
|
90
|
-
eventType:
|
|
91
|
-
actionSubject:
|
|
92
|
-
action:
|
|
93
|
-
actionSubjectId:
|
|
90
|
+
eventType: _enums.EVENT_TYPE.TRACK,
|
|
91
|
+
actionSubject: _enums.ACTION_SUBJECT.ALIGNMENT,
|
|
92
|
+
action: _enums.ACTION.UPDATED,
|
|
93
|
+
actionSubjectId: _enums.ACTION_SUBJECT_ID.TEXT,
|
|
94
94
|
attributes: {
|
|
95
95
|
alignmentType: align,
|
|
96
96
|
inputMethod: inputMethod
|
|
@@ -102,11 +102,11 @@ var changeBlockAlignmentWithAnalyticsTr = function changeBlockAlignmentWithAnaly
|
|
|
102
102
|
};
|
|
103
103
|
var changeImageAlignmentWithAnalytics = function changeImageAlignmentWithAnalytics(editorAnalyticsApi, align, inputMethod) {
|
|
104
104
|
return function (state, dispatch) {
|
|
105
|
-
return (0,
|
|
106
|
-
eventType:
|
|
107
|
-
actionSubject:
|
|
108
|
-
action:
|
|
109
|
-
actionSubjectId:
|
|
105
|
+
return (0, _withAnalytics.withAnalytics)(editorAnalyticsApi, {
|
|
106
|
+
eventType: _enums.EVENT_TYPE.TRACK,
|
|
107
|
+
actionSubject: _enums.ACTION_SUBJECT.ALIGNMENT,
|
|
108
|
+
action: _enums.ACTION.UPDATED,
|
|
109
|
+
actionSubjectId: _enums.ACTION_SUBJECT_ID.MEDIA_SINGLE,
|
|
110
110
|
attributes: {
|
|
111
111
|
alignmentType: align,
|
|
112
112
|
inputMethod: inputMethod
|
|
@@ -121,10 +121,10 @@ var changeImageAlignmentWithAnalyticsTr = function changeImageAlignmentWithAnaly
|
|
|
121
121
|
if (alignmentApplied) {
|
|
122
122
|
var _api$analytics2;
|
|
123
123
|
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
|
|
124
|
-
eventType:
|
|
125
|
-
actionSubject:
|
|
126
|
-
action:
|
|
127
|
-
actionSubjectId:
|
|
124
|
+
eventType: _enums.EVENT_TYPE.TRACK,
|
|
125
|
+
actionSubject: _enums.ACTION_SUBJECT.ALIGNMENT,
|
|
126
|
+
action: _enums.ACTION.UPDATED,
|
|
127
|
+
actionSubjectId: _enums.ACTION_SUBJECT_ID.MEDIA_SINGLE,
|
|
128
128
|
attributes: {
|
|
129
129
|
alignmentType: align,
|
|
130
130
|
inputMethod: inputMethod
|
|
@@ -4,7 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.keymapPlugin = keymapPlugin;
|
|
7
|
-
var
|
|
7
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
8
|
+
var _keymap = require("@atlaskit/editor-common/keymap");
|
|
8
9
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
9
10
|
var _editorCommands = require("../editor-commands");
|
|
10
11
|
function keymapPlugin(api) {
|
|
@@ -13,14 +14,14 @@ function keymapPlugin(api) {
|
|
|
13
14
|
// Ignored via go/ees005
|
|
14
15
|
(0, _keymaps.bindKeymapWithCommand)(
|
|
15
16
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
16
|
-
_keymaps.alignLeft.common, (0, _editorCommands.changeAlignment)('start', api,
|
|
17
|
+
_keymaps.alignLeft.common, (0, _editorCommands.changeAlignment)('start', api, _enums.INPUT_METHOD.SHORTCUT), list);
|
|
17
18
|
// Ignored via go/ees005
|
|
18
19
|
(0, _keymaps.bindKeymapWithCommand)(
|
|
19
20
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
20
|
-
_keymaps.alignCenter.common, (0, _editorCommands.changeAlignment)('center', api,
|
|
21
|
+
_keymaps.alignCenter.common, (0, _editorCommands.changeAlignment)('center', api, _enums.INPUT_METHOD.SHORTCUT), list);
|
|
21
22
|
// Ignored via go/ees005
|
|
22
23
|
(0, _keymaps.bindKeymapWithCommand)(
|
|
23
24
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
24
|
-
_keymaps.alignRight.common, (0, _editorCommands.changeAlignment)('end', api,
|
|
25
|
-
return (0,
|
|
25
|
+
_keymaps.alignRight.common, (0, _editorCommands.changeAlignment)('end', api, _enums.INPUT_METHOD.SHORTCUT), list);
|
|
26
|
+
return (0, _keymap.keymap)(list);
|
|
26
27
|
}
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
10
|
-
var
|
|
10
|
+
var _ToolbarButton = _interopRequireDefault(require("@atlaskit/editor-common/ui-menu/ToolbarButton"));
|
|
11
11
|
function AlignmentButton(_ref) {
|
|
12
12
|
var label = _ref.label,
|
|
13
13
|
isSelected = _ref.isSelected,
|
|
@@ -21,7 +21,7 @@ function AlignmentButton(_ref) {
|
|
|
21
21
|
e.preventDefault();
|
|
22
22
|
onClick(value, isMouseEvent);
|
|
23
23
|
};
|
|
24
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_ToolbarButton.default, {
|
|
25
25
|
disabled: false,
|
|
26
26
|
selected: isSelected,
|
|
27
27
|
title: /*#__PURE__*/_react.default.createElement(_keymaps.ToolTipContent, {
|
|
@@ -11,8 +11,8 @@ require("./index.compiled.css");
|
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
13
|
var _reactIntl = require("react-intl");
|
|
14
|
+
var _alignment = require("@atlaskit/editor-common/alignment");
|
|
14
15
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
15
|
-
var _messages = require("@atlaskit/editor-common/messages");
|
|
16
16
|
var _iconMap = require("../ToolbarAlignment/icon-map");
|
|
17
17
|
var _AlignmentButton = _interopRequireDefault(require("./AlignmentButton"));
|
|
18
18
|
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); }
|
|
@@ -23,15 +23,15 @@ var alignmentWrapperStylesUnbounded = null;
|
|
|
23
23
|
var alignCenterKeyboardShortcut = _keymaps.alignCenter;
|
|
24
24
|
var alignRightKeyboardShortcut = _keymaps.alignRight;
|
|
25
25
|
var alignmentOptions = [{
|
|
26
|
-
title:
|
|
26
|
+
title: _alignment.alignmentMessages.alignLeft,
|
|
27
27
|
shortcut: _keymaps.alignLeft,
|
|
28
28
|
value: 'start'
|
|
29
29
|
}, {
|
|
30
|
-
title:
|
|
30
|
+
title: _alignment.alignmentMessages.alignCenter,
|
|
31
31
|
shortcut: alignCenterKeyboardShortcut,
|
|
32
32
|
value: 'center'
|
|
33
33
|
}, {
|
|
34
|
-
title:
|
|
34
|
+
title: _alignment.alignmentMessages.alignRight,
|
|
35
35
|
shortcut: alignRightKeyboardShortcut,
|
|
36
36
|
value: 'end'
|
|
37
37
|
}];
|
|
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.FloatingToolbarComponent = FloatingToolbarComponent;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
11
|
+
var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useSharedPluginStateWithSelector");
|
|
12
12
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
13
13
|
var _editorCommands = require("../editor-commands");
|
|
14
14
|
var _types = require("../pm-plugins/types");
|
|
@@ -21,7 +21,7 @@ var FloatingToolbarSettings = {
|
|
|
21
21
|
function FloatingToolbarComponent(_ref) {
|
|
22
22
|
var api = _ref.api,
|
|
23
23
|
editorView = _ref.editorView;
|
|
24
|
-
var _useSharedPluginState = (0,
|
|
24
|
+
var _useSharedPluginState = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(api, ['alignment'], function (states) {
|
|
25
25
|
var _states$alignmentStat, _states$alignmentStat2;
|
|
26
26
|
return {
|
|
27
27
|
align: (_states$alignmentStat = states.alignmentState) === null || _states$alignmentStat === void 0 ? void 0 : _states$alignmentStat.align,
|
|
@@ -31,7 +31,7 @@ function FloatingToolbarComponent(_ref) {
|
|
|
31
31
|
align = _useSharedPluginState.align,
|
|
32
32
|
isEnabled = _useSharedPluginState.isEnabled;
|
|
33
33
|
var changeAlignmentCallback = (0, _react.useCallback)(function (align) {
|
|
34
|
-
return (0, _editorCommands.changeAlignment)(align, api,
|
|
34
|
+
return (0, _editorCommands.changeAlignment)(align, api, _enums.INPUT_METHOD.FLOATING_TB)(editorView.state, editorView.dispatch);
|
|
35
35
|
}, [editorView, api]);
|
|
36
36
|
return /*#__PURE__*/_react.default.createElement(_ToolbarAlignment.default, {
|
|
37
37
|
align: align,
|
|
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.PrimaryToolbarComponent = PrimaryToolbarComponent;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
11
|
+
var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useSharedPluginStateWithSelector");
|
|
12
12
|
var _editorCommands = require("../editor-commands");
|
|
13
13
|
var _types = require("../pm-plugins/types");
|
|
14
14
|
var _ToolbarAlignment = _interopRequireDefault(require("./ToolbarAlignment"));
|
|
@@ -21,7 +21,7 @@ function PrimaryToolbarComponent(_ref) {
|
|
|
21
21
|
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
22
22
|
popupsScrollableElement = _ref.popupsScrollableElement,
|
|
23
23
|
isToolbarReducedSpacing = _ref.isToolbarReducedSpacing;
|
|
24
|
-
var _useSharedPluginState = (0,
|
|
24
|
+
var _useSharedPluginState = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(api, ['alignment'], function (states) {
|
|
25
25
|
var _states$alignmentStat, _states$alignmentStat2;
|
|
26
26
|
return {
|
|
27
27
|
align: (_states$alignmentStat = states.alignmentState) === null || _states$alignmentStat === void 0 ? void 0 : _states$alignmentStat.align,
|
|
@@ -31,7 +31,7 @@ function PrimaryToolbarComponent(_ref) {
|
|
|
31
31
|
align = _useSharedPluginState.align,
|
|
32
32
|
isEnabled = _useSharedPluginState.isEnabled;
|
|
33
33
|
var changeAlignmentCallback = (0, _react.useCallback)(function (align) {
|
|
34
|
-
return (0, _editorCommands.changeAlignment)(align, api,
|
|
34
|
+
return (0, _editorCommands.changeAlignment)(align, api, _enums.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
35
35
|
}, [editorView, api]);
|
|
36
36
|
return /*#__PURE__*/_react.default.createElement(_ToolbarAlignment.default, {
|
|
37
37
|
align: align,
|
|
@@ -7,14 +7,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.AlignmentMenu = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactIntl = require("react-intl");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
10
|
+
var _alignment = require("@atlaskit/editor-common/alignment");
|
|
11
|
+
var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useSharedPluginStateWithSelector");
|
|
12
|
+
var _toolbarDropdownMenu = require("@atlaskit/editor-toolbar/toolbar-dropdown-menu");
|
|
13
|
+
var _toolbarTooltip = require("@atlaskit/editor-toolbar/toolbar-tooltip");
|
|
13
14
|
var _options = require("./options");
|
|
14
15
|
var AlignmentMenu = exports.AlignmentMenu = function AlignmentMenu(_ref) {
|
|
15
16
|
var children = _ref.children,
|
|
16
17
|
api = _ref.api;
|
|
17
|
-
var _useSharedPluginState = (0,
|
|
18
|
+
var _useSharedPluginState = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(api, ['alignment'], function (states) {
|
|
18
19
|
var _states$alignmentStat, _states$alignmentStat2;
|
|
19
20
|
return {
|
|
20
21
|
align: (_states$alignmentStat = states.alignmentState) === null || _states$alignmentStat === void 0 ? void 0 : _states$alignmentStat.align,
|
|
@@ -27,8 +28,8 @@ var AlignmentMenu = exports.AlignmentMenu = function AlignmentMenu(_ref) {
|
|
|
27
28
|
var Icon = (0, _options.alignmentOptions)()[align].icon;
|
|
28
29
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
29
30
|
formatMessage = _useIntl.formatMessage;
|
|
30
|
-
var title = formatMessage(
|
|
31
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
31
|
+
var title = formatMessage(_alignment.alignmentMessages.alignment);
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement(_toolbarDropdownMenu.ToolbarDropdownMenu, {
|
|
32
33
|
iconBefore: /*#__PURE__*/_react.default.createElement(Icon, {
|
|
33
34
|
label: "",
|
|
34
35
|
size: "small",
|
|
@@ -37,7 +38,7 @@ var AlignmentMenu = exports.AlignmentMenu = function AlignmentMenu(_ref) {
|
|
|
37
38
|
isDisabled: !isEnabled,
|
|
38
39
|
testId: "text-alignment-menu",
|
|
39
40
|
label: title,
|
|
40
|
-
tooltipComponent: /*#__PURE__*/_react.default.createElement(
|
|
41
|
+
tooltipComponent: /*#__PURE__*/_react.default.createElement(_toolbarTooltip.ToolbarTooltip, {
|
|
41
42
|
content: title
|
|
42
43
|
})
|
|
43
44
|
}, children);
|
|
@@ -7,10 +7,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.AlignmentMenuItem = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactIntl = require("react-intl");
|
|
10
|
-
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
11
10
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
12
11
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
13
|
-
var
|
|
12
|
+
var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useSharedPluginStateWithSelector");
|
|
13
|
+
var _toolbarDropdownItem = require("@atlaskit/editor-toolbar/toolbar-dropdown-item");
|
|
14
|
+
var _toolbarKeyboardShortcutHint = require("@atlaskit/editor-toolbar/toolbar-keyboard-shortcut-hint");
|
|
14
15
|
var _editorCommands = require("../../editor-commands");
|
|
15
16
|
var AlignmentMenuItem = exports.AlignmentMenuItem = function AlignmentMenuItem(_ref) {
|
|
16
17
|
var _ref$option = _ref.option,
|
|
@@ -20,7 +21,7 @@ var AlignmentMenuItem = exports.AlignmentMenuItem = function AlignmentMenuItem(_
|
|
|
20
21
|
api = _ref.api,
|
|
21
22
|
alignment = _ref.alignment,
|
|
22
23
|
parents = _ref.parents;
|
|
23
|
-
var _useSharedPluginState = (0,
|
|
24
|
+
var _useSharedPluginState = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(api, ['alignment'], function (states) {
|
|
24
25
|
var _states$alignmentStat;
|
|
25
26
|
return {
|
|
26
27
|
align: (_states$alignmentStat = states.alignmentState) === null || _states$alignmentStat === void 0 ? void 0 : _states$alignmentStat.align
|
|
@@ -30,13 +31,13 @@ var AlignmentMenuItem = exports.AlignmentMenuItem = function AlignmentMenuItem(_
|
|
|
30
31
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
31
32
|
formatMessage = _useIntl.formatMessage;
|
|
32
33
|
var shortcut = (0, _keymaps.tooltip)(keymap);
|
|
33
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement(_toolbarDropdownItem.ToolbarDropdownItem, {
|
|
34
35
|
isSelected: align === alignment,
|
|
35
36
|
elemBefore: /*#__PURE__*/_react.default.createElement(Icon, {
|
|
36
37
|
size: "small",
|
|
37
38
|
label: ""
|
|
38
39
|
}),
|
|
39
|
-
elemAfter: shortcut && /*#__PURE__*/_react.default.createElement(
|
|
40
|
+
elemAfter: shortcut && /*#__PURE__*/_react.default.createElement(_toolbarKeyboardShortcutHint.ToolbarKeyboardShortcutHint, {
|
|
40
41
|
shortcut: shortcut
|
|
41
42
|
}),
|
|
42
43
|
ariaKeyshortcuts: (0, _keymaps.getAriaKeyshortcuts)(keymap)
|
|
@@ -6,16 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.MenuSection = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var _keys = require("@atlaskit/editor-common/toolbar/keys");
|
|
10
|
+
var _toolbarDropdownItemSection = require("@atlaskit/editor-toolbar/toolbar-dropdown-item-section");
|
|
11
11
|
var MenuSection = exports.MenuSection = function MenuSection(_ref) {
|
|
12
12
|
var children = _ref.children,
|
|
13
13
|
title = _ref.title,
|
|
14
14
|
parents = _ref.parents;
|
|
15
15
|
var hasSeparator = parents.some(function (parent) {
|
|
16
|
-
return parent.key ===
|
|
16
|
+
return parent.key === _keys.TEXT_COLLAPSED_MENU.key;
|
|
17
17
|
});
|
|
18
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_toolbarDropdownItemSection.ToolbarDropdownItemSection, {
|
|
19
19
|
hasSeparator: hasSeparator,
|
|
20
20
|
title: title
|
|
21
21
|
}, children);
|
|
@@ -4,34 +4,37 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.alignmentOptions = void 0;
|
|
7
|
+
var _alignment = require("@atlaskit/editor-common/alignment");
|
|
7
8
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var _keys = require("@atlaskit/editor-common/toolbar/keys");
|
|
10
|
+
var _rank = require("@atlaskit/editor-common/toolbar/rank");
|
|
11
|
+
var _alignTextCenterIcon = require("@atlaskit/editor-toolbar/align-text-center-icon");
|
|
12
|
+
var _alignTextLeftIcon = require("@atlaskit/editor-toolbar/align-text-left-icon");
|
|
13
|
+
var _alignTextRightIcon = require("@atlaskit/editor-toolbar/align-text-right-icon");
|
|
11
14
|
var alignmentOptions = exports.alignmentOptions = function alignmentOptions() {
|
|
12
15
|
return {
|
|
13
16
|
start: {
|
|
14
|
-
key:
|
|
15
|
-
type:
|
|
16
|
-
rank:
|
|
17
|
-
label:
|
|
18
|
-
icon:
|
|
17
|
+
key: _keys.ALIGN_LEFT_MENU_ITEM.key,
|
|
18
|
+
type: _keys.ALIGN_LEFT_MENU_ITEM.type,
|
|
19
|
+
rank: _rank.ALIGNMENT_MENU_SECTION_RANK[_keys.ALIGN_LEFT_MENU_ITEM.key],
|
|
20
|
+
label: _alignment.alignmentMessages.alignLeft,
|
|
21
|
+
icon: _alignTextLeftIcon.AlignTextLeftIcon,
|
|
19
22
|
keymap: _keymaps.alignLeft
|
|
20
23
|
},
|
|
21
24
|
center: {
|
|
22
|
-
key:
|
|
23
|
-
type:
|
|
24
|
-
rank:
|
|
25
|
-
label:
|
|
26
|
-
icon:
|
|
25
|
+
key: _keys.ALIGN_CENTER_MENU_ITEM.key,
|
|
26
|
+
type: _keys.ALIGN_CENTER_MENU_ITEM.type,
|
|
27
|
+
rank: _rank.ALIGNMENT_MENU_SECTION_RANK[_keys.ALIGN_CENTER_MENU_ITEM.key],
|
|
28
|
+
label: _alignment.alignmentMessages.alignCenter,
|
|
29
|
+
icon: _alignTextCenterIcon.AlignTextCenterIcon,
|
|
27
30
|
keymap: _keymaps.alignCenter
|
|
28
31
|
},
|
|
29
32
|
end: {
|
|
30
|
-
key:
|
|
31
|
-
type:
|
|
32
|
-
rank:
|
|
33
|
-
label:
|
|
34
|
-
icon:
|
|
33
|
+
key: _keys.ALIGN_RIGHT_MENU_ITEM.key,
|
|
34
|
+
type: _keys.ALIGN_RIGHT_MENU_ITEM.type,
|
|
35
|
+
rank: _rank.ALIGNMENT_MENU_SECTION_RANK[_keys.ALIGN_RIGHT_MENU_ITEM.key],
|
|
36
|
+
label: _alignment.alignmentMessages.alignRight,
|
|
37
|
+
icon: _alignTextRightIcon.AlignTextRightIcon,
|
|
35
38
|
keymap: _keymaps.alignRight
|
|
36
39
|
}
|
|
37
40
|
};
|
|
@@ -7,22 +7,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.IconMap = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactIntl = require("react-intl");
|
|
10
|
-
var
|
|
10
|
+
var _alignment = require("@atlaskit/editor-common/alignment");
|
|
11
11
|
var _alignTextCenter = _interopRequireDefault(require("@atlaskit/icon/core/align-text-center"));
|
|
12
12
|
var _alignTextLeft = _interopRequireDefault(require("@atlaskit/icon/core/align-text-left"));
|
|
13
13
|
var _alignTextRight = _interopRequireDefault(require("@atlaskit/icon/core/align-text-right"));
|
|
14
14
|
var iconAndMessageMap = {
|
|
15
15
|
start: {
|
|
16
16
|
Component: _alignTextLeft.default,
|
|
17
|
-
label:
|
|
17
|
+
label: _alignment.alignmentMessages.alignLeft
|
|
18
18
|
},
|
|
19
19
|
end: {
|
|
20
20
|
Component: _alignTextRight.default,
|
|
21
|
-
label:
|
|
21
|
+
label: _alignment.alignmentMessages.alignRight
|
|
22
22
|
},
|
|
23
23
|
center: {
|
|
24
24
|
Component: _alignTextCenter.default,
|
|
25
|
-
label:
|
|
25
|
+
label: _alignment.alignmentMessages.alignCenter
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
var IconMap = exports.IconMap = function IconMap(props) {
|
|
@@ -15,15 +15,22 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
17
|
var _reactIntl = require("react-intl");
|
|
18
|
+
var _alignment = require("@atlaskit/editor-common/alignment");
|
|
18
19
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
20
|
+
var _Shortcut = require("@atlaskit/editor-common/Shortcut");
|
|
21
|
+
var _types = require("@atlaskit/editor-common/ui-menu/ArrowKeyNavigationProvider/types");
|
|
22
|
+
var _DropdownContainer = require("@atlaskit/editor-common/ui-menu/DropdownContainer");
|
|
23
|
+
var _DropdownMenu = require("@atlaskit/editor-common/ui-menu/DropdownMenu");
|
|
24
|
+
var _ToolbarButton = _interopRequireDefault(require("@atlaskit/editor-common/ui-menu/ToolbarButton"));
|
|
25
|
+
var _DropdownTriggerWrapper = require("@atlaskit/editor-common/ui-toolbar/DropdownTriggerWrapper");
|
|
26
|
+
var _DropdownWrapper = require("@atlaskit/editor-common/ui-toolbar/DropdownWrapper");
|
|
27
|
+
var _ExpandIcon = require("@atlaskit/editor-common/ui-toolbar/ExpandIcon");
|
|
28
|
+
var _Separator = require("@atlaskit/editor-common/ui-toolbar/Separator");
|
|
22
29
|
var _alignTextCenter = _interopRequireDefault(require("@atlaskit/icon/core/align-text-center"));
|
|
23
30
|
var _alignTextLeft = _interopRequireDefault(require("@atlaskit/icon/core/align-text-left"));
|
|
24
31
|
var _alignTextRight = _interopRequireDefault(require("@atlaskit/icon/core/align-text-right"));
|
|
25
32
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
26
|
-
var
|
|
33
|
+
var _types2 = require("../../pm-plugins/types");
|
|
27
34
|
var _Alignment = _interopRequireDefault(require("../Alignment"));
|
|
28
35
|
var _iconMap = require("./icon-map");
|
|
29
36
|
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,11 +108,11 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
101
108
|
intl = _this$props.intl,
|
|
102
109
|
api = _this$props.api;
|
|
103
110
|
var alignment = align !== null && align !== void 0 ? align : 'start';
|
|
104
|
-
var title = intl.formatMessage(
|
|
111
|
+
var title = intl.formatMessage(_alignment.alignmentMessages.alignment);
|
|
105
112
|
var alignmentLabelMap = {
|
|
106
|
-
start: intl.formatMessage(
|
|
107
|
-
center: intl.formatMessage(
|
|
108
|
-
end: intl.formatMessage(
|
|
113
|
+
start: intl.formatMessage(_alignment.alignmentMessages.alignLeft),
|
|
114
|
+
center: intl.formatMessage(_alignment.alignmentMessages.alignCenter),
|
|
115
|
+
end: intl.formatMessage(_alignment.alignmentMessages.alignRight)
|
|
109
116
|
};
|
|
110
117
|
var ariaLabel = "".concat(title, ", ").concat((_alignmentLabelMap$al = alignmentLabelMap[alignment]) !== null && _alignmentLabelMap$al !== void 0 ? _alignmentLabelMap$al : '');
|
|
111
118
|
var reducedSpacing = (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1', {
|
|
@@ -113,43 +120,43 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
113
120
|
}) ? 'compact' : 'none';
|
|
114
121
|
var items = [{
|
|
115
122
|
key: 'alignmentLeft',
|
|
116
|
-
content: intl.formatMessage(
|
|
123
|
+
content: intl.formatMessage(_alignment.alignmentMessages.alignLeft),
|
|
117
124
|
value: {
|
|
118
125
|
name: 'start'
|
|
119
126
|
},
|
|
120
127
|
isActive: align === 'start',
|
|
121
|
-
elemAfter: /*#__PURE__*/_react.default.createElement(
|
|
128
|
+
elemAfter: /*#__PURE__*/_react.default.createElement(_Shortcut.Shortcut, null, (0, _keymaps.tooltip)(_keymaps.alignLeft)),
|
|
122
129
|
elemBefore: /*#__PURE__*/_react.default.createElement(_alignTextLeft.default, {
|
|
123
130
|
label: ""
|
|
124
131
|
})
|
|
125
132
|
}, {
|
|
126
133
|
key: 'alignmentCenter',
|
|
127
|
-
content: intl.formatMessage(
|
|
134
|
+
content: intl.formatMessage(_alignment.alignmentMessages.alignCenter),
|
|
128
135
|
value: {
|
|
129
136
|
name: 'center'
|
|
130
137
|
},
|
|
131
138
|
isActive: align === 'center',
|
|
132
|
-
elemAfter: /*#__PURE__*/_react.default.createElement(
|
|
139
|
+
elemAfter: /*#__PURE__*/_react.default.createElement(_Shortcut.Shortcut, null, (0, _keymaps.tooltip)(_keymaps.alignCenter)),
|
|
133
140
|
elemBefore: /*#__PURE__*/_react.default.createElement(_alignTextCenter.default, {
|
|
134
141
|
label: ""
|
|
135
142
|
})
|
|
136
143
|
}, {
|
|
137
144
|
key: 'alignmentRight',
|
|
138
|
-
content: intl.formatMessage(
|
|
145
|
+
content: intl.formatMessage(_alignment.alignmentMessages.alignRight),
|
|
139
146
|
value: {
|
|
140
147
|
name: 'end'
|
|
141
148
|
},
|
|
142
149
|
isActive: align === 'end',
|
|
143
|
-
elemAfter: /*#__PURE__*/_react.default.createElement(
|
|
150
|
+
elemAfter: /*#__PURE__*/_react.default.createElement(_Shortcut.Shortcut, null, (0, _keymaps.tooltip)(_keymaps.alignRight)),
|
|
144
151
|
elemBefore: /*#__PURE__*/_react.default.createElement(_alignTextRight.default, {
|
|
145
152
|
label: ""
|
|
146
153
|
})
|
|
147
154
|
}];
|
|
148
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
155
|
+
return /*#__PURE__*/_react.default.createElement(_DropdownWrapper.ToolbarDropdownWrapper, null, (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') ? /*#__PURE__*/_react.default.createElement(_DropdownMenu.DropdownMenuWithKeyboardNavigation
|
|
149
156
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
150
157
|
, {
|
|
151
158
|
arrowKeyNavigationProviderOptions: {
|
|
152
|
-
type:
|
|
159
|
+
type: _types.ArrowKeyNavigationType.MENU
|
|
153
160
|
}
|
|
154
161
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
155
162
|
,
|
|
@@ -169,7 +176,7 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
169
176
|
boundariesElement: popupsBoundariesElement,
|
|
170
177
|
scrollableElement: popupsScrollableElement,
|
|
171
178
|
fitWidth: 200
|
|
172
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
179
|
+
}, /*#__PURE__*/_react.default.createElement(_ToolbarButton.default, {
|
|
173
180
|
spacing: isReducedSpacing ? reducedSpacing : 'default',
|
|
174
181
|
disabled: disabled,
|
|
175
182
|
selected: isOpen,
|
|
@@ -179,10 +186,10 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
179
186
|
"aria-haspopup": true,
|
|
180
187
|
onClick: this.toggleOpen,
|
|
181
188
|
onKeyDown: this.toggleOpenByKeyboard,
|
|
182
|
-
iconBefore: /*#__PURE__*/_react.default.createElement(
|
|
189
|
+
iconBefore: /*#__PURE__*/_react.default.createElement(_DropdownTriggerWrapper.ToolbarDropdownTriggerWrapper, null, /*#__PURE__*/_react.default.createElement(_iconMap.IconMap, {
|
|
183
190
|
alignment: alignment
|
|
184
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
185
|
-
})) : /*#__PURE__*/_react.default.createElement(
|
|
191
|
+
}), /*#__PURE__*/_react.default.createElement(_ExpandIcon.ToolbarExpandIcon, null))
|
|
192
|
+
})) : /*#__PURE__*/_react.default.createElement(_DropdownContainer.DropdownContainer, {
|
|
186
193
|
mountTo: popupsMountPoint,
|
|
187
194
|
boundariesElement: popupsBoundariesElement,
|
|
188
195
|
scrollableElement: popupsScrollableElement,
|
|
@@ -201,12 +208,12 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
201
208
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
202
209
|
,
|
|
203
210
|
arrowKeyNavigationProviderOptions: {
|
|
204
|
-
type:
|
|
211
|
+
type: _types.ArrowKeyNavigationType.MENU
|
|
205
212
|
},
|
|
206
213
|
fitWidth: 112,
|
|
207
214
|
fitHeight: 80,
|
|
208
215
|
closeOnTab: true,
|
|
209
|
-
trigger: /*#__PURE__*/_react.default.createElement(
|
|
216
|
+
trigger: /*#__PURE__*/_react.default.createElement(_ToolbarButton.default, {
|
|
210
217
|
spacing: isReducedSpacing ? reducedSpacing : 'default',
|
|
211
218
|
disabled: disabled,
|
|
212
219
|
selected: isOpen,
|
|
@@ -219,9 +226,9 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
219
226
|
"aria-haspopup": true,
|
|
220
227
|
onClick: this.toggleOpen,
|
|
221
228
|
onKeyDown: this.toggleOpenByKeyboard,
|
|
222
|
-
iconBefore: /*#__PURE__*/_react.default.createElement(
|
|
229
|
+
iconBefore: /*#__PURE__*/_react.default.createElement(_DropdownTriggerWrapper.ToolbarDropdownTriggerWrapper, null, /*#__PURE__*/_react.default.createElement(_iconMap.IconMap, {
|
|
223
230
|
alignment: alignment
|
|
224
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
231
|
+
}), /*#__PURE__*/_react.default.createElement(_ExpandIcon.ToolbarExpandIcon, null)),
|
|
225
232
|
ref: this.toolbarItemRef
|
|
226
233
|
})
|
|
227
234
|
}, /*#__PURE__*/_react.default.createElement(_Alignment.default
|
|
@@ -231,13 +238,13 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
231
238
|
return _this2.changeAlignment(align, false);
|
|
232
239
|
},
|
|
233
240
|
selectedAlignment: alignment
|
|
234
|
-
})), !(api !== null && api !== void 0 && api.primaryToolbar) && /*#__PURE__*/_react.default.createElement(
|
|
241
|
+
})), !(api !== null && api !== void 0 && api.primaryToolbar) && /*#__PURE__*/_react.default.createElement(_Separator.ToolbarSeparator, null));
|
|
235
242
|
}
|
|
236
243
|
}, {
|
|
237
244
|
key: "componentDidUpdate",
|
|
238
245
|
value: function componentDidUpdate(_prevProps) {
|
|
239
246
|
var _this3 = this;
|
|
240
|
-
if (this.props.toolbarType !==
|
|
247
|
+
if (this.props.toolbarType !== _types2.ToolbarType.FLOATING && this.state.isOpen) {
|
|
241
248
|
// by triggering the keyboard event with a setTimeout, we ensure that the tooltip
|
|
242
249
|
// associated with the alignment button doesn't render until the next render cycle
|
|
243
250
|
// where the popup will be correctly positioned and the relative position of the tooltip
|
|
@@ -8,7 +8,8 @@ exports.getToolbarComponents = void 0;
|
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var
|
|
11
|
+
var _keys = require("@atlaskit/editor-common/toolbar/keys");
|
|
12
|
+
var _rank = require("@atlaskit/editor-common/toolbar/rank");
|
|
12
13
|
var _AlignmentMenu = require("./Toolbar/AlignmentMenu");
|
|
13
14
|
var _AlignmentMenuItem = require("./Toolbar/AlignmentMenuItem");
|
|
14
15
|
var _MenuSection = require("./Toolbar/MenuSection");
|
|
@@ -25,8 +26,8 @@ var getAlignmentMenuItems = function getAlignmentMenuItems(api) {
|
|
|
25
26
|
type: type,
|
|
26
27
|
key: key,
|
|
27
28
|
parents: [{
|
|
28
|
-
type:
|
|
29
|
-
key:
|
|
29
|
+
type: _keys.ALIGNMENT_MENU_SECTION.type,
|
|
30
|
+
key: _keys.ALIGNMENT_MENU_SECTION.key,
|
|
30
31
|
rank: rank
|
|
31
32
|
}],
|
|
32
33
|
component: function component(_ref3) {
|
|
@@ -43,24 +44,24 @@ var getAlignmentMenuItems = function getAlignmentMenuItems(api) {
|
|
|
43
44
|
};
|
|
44
45
|
var getToolbarComponents = exports.getToolbarComponents = function getToolbarComponents(api) {
|
|
45
46
|
return [{
|
|
46
|
-
type:
|
|
47
|
-
key:
|
|
47
|
+
type: _keys.ALIGNMENT_GROUP.type,
|
|
48
|
+
key: _keys.ALIGNMENT_GROUP.key,
|
|
48
49
|
parents: [{
|
|
49
|
-
type:
|
|
50
|
-
key:
|
|
51
|
-
rank:
|
|
50
|
+
type: _keys.TEXT_SECTION.type,
|
|
51
|
+
key: _keys.TEXT_SECTION.key,
|
|
52
|
+
rank: _rank.TEXT_SECTION_RANK[_keys.ALIGNMENT_GROUP.key]
|
|
52
53
|
}, {
|
|
53
|
-
type:
|
|
54
|
-
key:
|
|
55
|
-
rank:
|
|
54
|
+
type: _keys.TEXT_SECTION_PRIMARY_TOOLBAR.type,
|
|
55
|
+
key: _keys.TEXT_SECTION_PRIMARY_TOOLBAR.key,
|
|
56
|
+
rank: _rank.TEXT_SECTION_PRIMARY_TOOLBAR_RANK[_keys.ALIGNMENT_GROUP.key]
|
|
56
57
|
}]
|
|
57
58
|
}, {
|
|
58
|
-
type:
|
|
59
|
-
key:
|
|
59
|
+
type: _keys.ALIGNMENT_MENU.type,
|
|
60
|
+
key: _keys.ALIGNMENT_MENU.key,
|
|
60
61
|
parents: [{
|
|
61
|
-
type:
|
|
62
|
-
key:
|
|
63
|
-
rank:
|
|
62
|
+
type: _keys.ALIGNMENT_GROUP.type,
|
|
63
|
+
key: _keys.ALIGNMENT_GROUP.key,
|
|
64
|
+
rank: _rank.ALIGNMENT_GROUP_RANK[_keys.ALIGNMENT_MENU.key]
|
|
64
65
|
}],
|
|
65
66
|
component: function component(_ref4) {
|
|
66
67
|
var children = _ref4.children;
|
|
@@ -69,16 +70,16 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
69
70
|
}, children);
|
|
70
71
|
}
|
|
71
72
|
}, {
|
|
72
|
-
type:
|
|
73
|
-
key:
|
|
73
|
+
type: _keys.ALIGNMENT_MENU_SECTION.type,
|
|
74
|
+
key: _keys.ALIGNMENT_MENU_SECTION.key,
|
|
74
75
|
parents: [{
|
|
75
|
-
type:
|
|
76
|
-
key:
|
|
77
|
-
rank:
|
|
76
|
+
type: _keys.ALIGNMENT_MENU.type,
|
|
77
|
+
key: _keys.ALIGNMENT_MENU.key,
|
|
78
|
+
rank: _rank.ALIGNMENT_MENU_RANK[_keys.ALIGNMENT_MENU_SECTION.key]
|
|
78
79
|
}, {
|
|
79
|
-
type:
|
|
80
|
-
key:
|
|
81
|
-
rank:
|
|
80
|
+
type: _keys.TEXT_COLLAPSED_MENU.type,
|
|
81
|
+
key: _keys.TEXT_COLLAPSED_MENU.key,
|
|
82
|
+
rank: _rank.TEXT_COLLAPSED_MENU_RANK[_keys.ALIGNMENT_MENU_SECTION.key]
|
|
82
83
|
}],
|
|
83
84
|
component: _MenuSection.MenuSection
|
|
84
85
|
}].concat((0, _toConsumableArray2.default)(getAlignmentMenuItems(api)));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
2
|
import { changeImageAlignment, changeImageAlignmentNext, toggleBlockMark, toggleBlockMarkNext } from '@atlaskit/editor-common/commands';
|
|
3
|
-
import { withAnalytics } from '@atlaskit/editor-common/
|
|
3
|
+
import { withAnalytics } from '@atlaskit/editor-common/withAnalytics';
|
|
4
4
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
/**
|
|
6
6
|
* Iterates over the commands one after the other,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import {
|
|
1
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
|
+
import { keymap } from '@atlaskit/editor-common/keymap';
|
|
3
|
+
import { alignCenter, alignLeft, alignRight, bindKeymapWithCommand } from '@atlaskit/editor-common/keymaps';
|
|
3
4
|
import { changeAlignment } from '../editor-commands';
|
|
4
5
|
export function keymapPlugin(api) {
|
|
5
6
|
const list = {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { getAriaKeyshortcuts, tooltip, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
3
|
-
import
|
|
3
|
+
import ToolbarButton from '@atlaskit/editor-common/ui-menu/ToolbarButton';
|
|
4
4
|
function AlignmentButton({
|
|
5
5
|
label,
|
|
6
6
|
isSelected,
|
|
@@ -3,8 +3,8 @@ import "./index.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { injectIntl } from 'react-intl';
|
|
6
|
+
import { alignmentMessages } from '@atlaskit/editor-common/alignment';
|
|
6
7
|
import { alignCenter, alignLeft, alignRight } from '@atlaskit/editor-common/keymaps';
|
|
7
|
-
import { alignmentMessages } from '@atlaskit/editor-common/messages';
|
|
8
8
|
import { IconMap } from '../ToolbarAlignment/icon-map';
|
|
9
9
|
import AlignmentButton from './AlignmentButton';
|
|
10
10
|
const alignmentWrapper = null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
4
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
5
5
|
import { changeAlignment } from '../editor-commands';
|
|
6
6
|
import { ToolbarType } from '../pm-plugins/types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
4
4
|
import { changeAlignment } from '../editor-commands';
|
|
5
5
|
import { ToolbarType } from '../pm-plugins/types';
|
|
6
6
|
import ToolbarAlignment from './ToolbarAlignment';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ToolbarDropdownMenu
|
|
3
|
+
import { alignmentMessages as messages } from '@atlaskit/editor-common/alignment';
|
|
4
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
5
|
+
import { ToolbarDropdownMenu } from '@atlaskit/editor-toolbar/toolbar-dropdown-menu';
|
|
6
|
+
import { ToolbarTooltip } from '@atlaskit/editor-toolbar/toolbar-tooltip';
|
|
6
7
|
import { alignmentOptions } from './options';
|
|
7
8
|
export const AlignmentMenu = ({
|
|
8
9
|
children,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
3
|
import { getAriaKeyshortcuts, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
4
|
import { getInputMethodFromParentKeys } from '@atlaskit/editor-common/toolbar';
|
|
6
|
-
import {
|
|
5
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
6
|
+
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar/toolbar-dropdown-item';
|
|
7
|
+
import { ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar/toolbar-keyboard-shortcut-hint';
|
|
7
8
|
import { changeAlignmentTr } from '../../editor-commands';
|
|
8
9
|
export const AlignmentMenuItem = ({
|
|
9
10
|
option: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TEXT_COLLAPSED_MENU } from '@atlaskit/editor-common/toolbar';
|
|
3
|
-
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
2
|
+
import { TEXT_COLLAPSED_MENU } from '@atlaskit/editor-common/toolbar/keys';
|
|
3
|
+
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar/toolbar-dropdown-item-section';
|
|
4
4
|
export const MenuSection = ({
|
|
5
5
|
children,
|
|
6
6
|
title,
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { alignmentMessages as messages } from '@atlaskit/editor-common/alignment';
|
|
1
2
|
import { alignCenter, alignLeft, alignRight } from '@atlaskit/editor-common/keymaps';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ALIGN_LEFT_MENU_ITEM, ALIGN_CENTER_MENU_ITEM, ALIGN_RIGHT_MENU_ITEM } from '@atlaskit/editor-common/toolbar/keys';
|
|
4
|
+
import { ALIGNMENT_MENU_SECTION_RANK } from '@atlaskit/editor-common/toolbar/rank';
|
|
5
|
+
import { AlignTextCenterIcon } from '@atlaskit/editor-toolbar/align-text-center-icon';
|
|
6
|
+
import { AlignTextLeftIcon } from '@atlaskit/editor-toolbar/align-text-left-icon';
|
|
7
|
+
import { AlignTextRightIcon } from '@atlaskit/editor-toolbar/align-text-right-icon';
|
|
5
8
|
export const alignmentOptions = () => ({
|
|
6
9
|
start: {
|
|
7
10
|
key: ALIGN_LEFT_MENU_ITEM.key,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { alignmentMessages as messages } from '@atlaskit/editor-common/
|
|
3
|
+
import { alignmentMessages as messages } from '@atlaskit/editor-common/alignment';
|
|
4
4
|
import AlignTextCenterIcon from '@atlaskit/icon/core/align-text-center';
|
|
5
5
|
import AlignTextLeftIcon from '@atlaskit/icon/core/align-text-left';
|
|
6
6
|
import AlignTextRightIcon from '@atlaskit/icon/core/align-text-right';
|
|
@@ -3,10 +3,17 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { injectIntl } from 'react-intl';
|
|
6
|
+
import { alignmentMessages as messages } from '@atlaskit/editor-common/alignment';
|
|
6
7
|
import { alignCenter, alignLeft, alignRight, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { Shortcut } from '@atlaskit/editor-common/Shortcut';
|
|
9
|
+
import { ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu/ArrowKeyNavigationProvider/types';
|
|
10
|
+
import { DropdownContainer as Dropdown } from '@atlaskit/editor-common/ui-menu/DropdownContainer';
|
|
11
|
+
import { DropdownMenuWithKeyboardNavigation as DropdownMenu } from '@atlaskit/editor-common/ui-menu/DropdownMenu';
|
|
12
|
+
import ToolbarButton from '@atlaskit/editor-common/ui-menu/ToolbarButton';
|
|
13
|
+
import { ToolbarDropdownTriggerWrapper } from '@atlaskit/editor-common/ui-toolbar/DropdownTriggerWrapper';
|
|
14
|
+
import { ToolbarDropdownWrapper } from '@atlaskit/editor-common/ui-toolbar/DropdownWrapper';
|
|
15
|
+
import { ToolbarExpandIcon } from '@atlaskit/editor-common/ui-toolbar/ExpandIcon';
|
|
16
|
+
import { ToolbarSeparator } from '@atlaskit/editor-common/ui-toolbar/Separator';
|
|
10
17
|
import AlignTextCenterIcon from '@atlaskit/icon/core/align-text-center';
|
|
11
18
|
import AlignTextLeftIcon from '@atlaskit/icon/core/align-text-left';
|
|
12
19
|
import AlignTextRightIcon from '@atlaskit/icon/core/align-text-right';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ALIGNMENT_GROUP,
|
|
2
|
+
import { ALIGNMENT_GROUP, ALIGNMENT_MENU, ALIGNMENT_MENU_SECTION, TEXT_SECTION, TEXT_COLLAPSED_MENU, TEXT_SECTION_PRIMARY_TOOLBAR } from '@atlaskit/editor-common/toolbar/keys';
|
|
3
|
+
import { ALIGNMENT_GROUP_RANK, TEXT_SECTION_RANK, ALIGNMENT_MENU_RANK, TEXT_COLLAPSED_MENU_RANK, TEXT_SECTION_PRIMARY_TOOLBAR_RANK } from '@atlaskit/editor-common/toolbar/rank';
|
|
3
4
|
import { AlignmentMenu } from './Toolbar/AlignmentMenu';
|
|
4
5
|
import { AlignmentMenuItem } from './Toolbar/AlignmentMenuItem';
|
|
5
6
|
import { MenuSection } from './Toolbar/MenuSection';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
2
|
import { changeImageAlignment, changeImageAlignmentNext, toggleBlockMark, toggleBlockMarkNext } from '@atlaskit/editor-common/commands';
|
|
3
|
-
import { withAnalytics } from '@atlaskit/editor-common/
|
|
3
|
+
import { withAnalytics } from '@atlaskit/editor-common/withAnalytics';
|
|
4
4
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
/**
|
|
6
6
|
* Iterates over the commands one after the other,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import {
|
|
1
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
|
+
import { keymap } from '@atlaskit/editor-common/keymap';
|
|
3
|
+
import { alignCenter, alignLeft, alignRight, bindKeymapWithCommand } from '@atlaskit/editor-common/keymaps';
|
|
3
4
|
import { changeAlignment } from '../editor-commands';
|
|
4
5
|
export function keymapPlugin(api) {
|
|
5
6
|
var list = {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { getAriaKeyshortcuts, tooltip, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
3
|
-
import
|
|
3
|
+
import ToolbarButton from '@atlaskit/editor-common/ui-menu/ToolbarButton';
|
|
4
4
|
function AlignmentButton(_ref) {
|
|
5
5
|
var label = _ref.label,
|
|
6
6
|
isSelected = _ref.isSelected,
|
|
@@ -3,8 +3,8 @@ import "./index.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { injectIntl } from 'react-intl';
|
|
6
|
+
import { alignmentMessages } from '@atlaskit/editor-common/alignment';
|
|
6
7
|
import { alignCenter, alignLeft, alignRight } from '@atlaskit/editor-common/keymaps';
|
|
7
|
-
import { alignmentMessages } from '@atlaskit/editor-common/messages';
|
|
8
8
|
import { IconMap } from '../ToolbarAlignment/icon-map';
|
|
9
9
|
import AlignmentButton from './AlignmentButton';
|
|
10
10
|
var alignmentWrapper = null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
4
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
5
5
|
import { changeAlignment } from '../editor-commands';
|
|
6
6
|
import { ToolbarType } from '../pm-plugins/types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
4
4
|
import { changeAlignment } from '../editor-commands';
|
|
5
5
|
import { ToolbarType } from '../pm-plugins/types';
|
|
6
6
|
import ToolbarAlignment from './ToolbarAlignment';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ToolbarDropdownMenu
|
|
3
|
+
import { alignmentMessages as messages } from '@atlaskit/editor-common/alignment';
|
|
4
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
5
|
+
import { ToolbarDropdownMenu } from '@atlaskit/editor-toolbar/toolbar-dropdown-menu';
|
|
6
|
+
import { ToolbarTooltip } from '@atlaskit/editor-toolbar/toolbar-tooltip';
|
|
6
7
|
import { alignmentOptions } from './options';
|
|
7
8
|
export var AlignmentMenu = function AlignmentMenu(_ref) {
|
|
8
9
|
var children = _ref.children,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
3
|
import { getAriaKeyshortcuts, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
4
|
import { getInputMethodFromParentKeys } from '@atlaskit/editor-common/toolbar';
|
|
6
|
-
import {
|
|
5
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
6
|
+
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar/toolbar-dropdown-item';
|
|
7
|
+
import { ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar/toolbar-keyboard-shortcut-hint';
|
|
7
8
|
import { changeAlignmentTr } from '../../editor-commands';
|
|
8
9
|
export var AlignmentMenuItem = function AlignmentMenuItem(_ref) {
|
|
9
10
|
var _ref$option = _ref.option,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TEXT_COLLAPSED_MENU } from '@atlaskit/editor-common/toolbar';
|
|
3
|
-
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
2
|
+
import { TEXT_COLLAPSED_MENU } from '@atlaskit/editor-common/toolbar/keys';
|
|
3
|
+
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar/toolbar-dropdown-item-section';
|
|
4
4
|
export var MenuSection = function MenuSection(_ref) {
|
|
5
5
|
var children = _ref.children,
|
|
6
6
|
title = _ref.title,
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { alignmentMessages as messages } from '@atlaskit/editor-common/alignment';
|
|
1
2
|
import { alignCenter, alignLeft, alignRight } from '@atlaskit/editor-common/keymaps';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ALIGN_LEFT_MENU_ITEM, ALIGN_CENTER_MENU_ITEM, ALIGN_RIGHT_MENU_ITEM } from '@atlaskit/editor-common/toolbar/keys';
|
|
4
|
+
import { ALIGNMENT_MENU_SECTION_RANK } from '@atlaskit/editor-common/toolbar/rank';
|
|
5
|
+
import { AlignTextCenterIcon } from '@atlaskit/editor-toolbar/align-text-center-icon';
|
|
6
|
+
import { AlignTextLeftIcon } from '@atlaskit/editor-toolbar/align-text-left-icon';
|
|
7
|
+
import { AlignTextRightIcon } from '@atlaskit/editor-toolbar/align-text-right-icon';
|
|
5
8
|
export var alignmentOptions = function alignmentOptions() {
|
|
6
9
|
return {
|
|
7
10
|
start: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { alignmentMessages as messages } from '@atlaskit/editor-common/
|
|
3
|
+
import { alignmentMessages as messages } from '@atlaskit/editor-common/alignment';
|
|
4
4
|
import AlignTextCenterIcon from '@atlaskit/icon/core/align-text-center';
|
|
5
5
|
import AlignTextLeftIcon from '@atlaskit/icon/core/align-text-left';
|
|
6
6
|
import AlignTextRightIcon from '@atlaskit/icon/core/align-text-right';
|
|
@@ -10,10 +10,17 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
|
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import { injectIntl } from 'react-intl';
|
|
13
|
+
import { alignmentMessages as messages } from '@atlaskit/editor-common/alignment';
|
|
13
14
|
import { alignCenter, alignLeft, alignRight, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { Shortcut } from '@atlaskit/editor-common/Shortcut';
|
|
16
|
+
import { ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu/ArrowKeyNavigationProvider/types';
|
|
17
|
+
import { DropdownContainer as Dropdown } from '@atlaskit/editor-common/ui-menu/DropdownContainer';
|
|
18
|
+
import { DropdownMenuWithKeyboardNavigation as DropdownMenu } from '@atlaskit/editor-common/ui-menu/DropdownMenu';
|
|
19
|
+
import ToolbarButton from '@atlaskit/editor-common/ui-menu/ToolbarButton';
|
|
20
|
+
import { ToolbarDropdownTriggerWrapper } from '@atlaskit/editor-common/ui-toolbar/DropdownTriggerWrapper';
|
|
21
|
+
import { ToolbarDropdownWrapper } from '@atlaskit/editor-common/ui-toolbar/DropdownWrapper';
|
|
22
|
+
import { ToolbarExpandIcon } from '@atlaskit/editor-common/ui-toolbar/ExpandIcon';
|
|
23
|
+
import { ToolbarSeparator } from '@atlaskit/editor-common/ui-toolbar/Separator';
|
|
17
24
|
import AlignTextCenterIcon from '@atlaskit/icon/core/align-text-center';
|
|
18
25
|
import AlignTextLeftIcon from '@atlaskit/icon/core/align-text-left';
|
|
19
26
|
import AlignTextRightIcon from '@atlaskit/icon/core/align-text-right';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { ALIGNMENT_GROUP,
|
|
4
|
+
import { ALIGNMENT_GROUP, ALIGNMENT_MENU, ALIGNMENT_MENU_SECTION, TEXT_SECTION, TEXT_COLLAPSED_MENU, TEXT_SECTION_PRIMARY_TOOLBAR } from '@atlaskit/editor-common/toolbar/keys';
|
|
5
|
+
import { ALIGNMENT_GROUP_RANK, TEXT_SECTION_RANK, ALIGNMENT_MENU_RANK, TEXT_COLLAPSED_MENU_RANK, TEXT_SECTION_PRIMARY_TOOLBAR_RANK } from '@atlaskit/editor-common/toolbar/rank';
|
|
5
6
|
import { AlignmentMenu } from './Toolbar/AlignmentMenu';
|
|
6
7
|
import { AlignmentMenuItem } from './Toolbar/AlignmentMenuItem';
|
|
7
8
|
import { MenuSection } from './Toolbar/MenuSection';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
-
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
5
|
-
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
6
|
-
import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
|
|
7
|
-
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
8
|
-
import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
|
|
1
|
+
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
3
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics/analyticsPluginType';
|
|
4
|
+
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction/interaction-plugin-type';
|
|
5
|
+
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar/primary-toolbar-plugin-type';
|
|
6
|
+
import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar/selection-toolbar-plugin-type';
|
|
7
|
+
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar/toolbar-plugin-type';
|
|
8
|
+
import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences/user-preferences-plugin-type';
|
|
9
9
|
import type { AlignmentPluginState } from './pm-plugins/types';
|
|
10
10
|
export type AlignmentPluginDependencies = [
|
|
11
11
|
OptionalPlugin<PrimaryToolbarPlugin>,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { Command
|
|
1
|
+
import type { Command } from '@atlaskit/editor-common/types/command';
|
|
2
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types/editor-command';
|
|
3
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
2
4
|
import type { AlignmentPlugin, InputMethod } from '../alignmentPluginType';
|
|
3
5
|
import type { AlignmentState } from '../pm-plugins/types';
|
|
4
6
|
export declare const isAlignable: (align?: AlignmentState) => Command;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
3
3
|
import type { AlignmentPlugin } from '../alignmentPluginType';
|
|
4
4
|
export declare function keymapPlugin(api?: ExtractInjectionAPI<AlignmentPlugin>): SafePlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { AlignmentPlugin } from '../alignmentPluginType';
|
|
5
5
|
interface FloatingToolbarComponentProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { AlignmentPlugin } from '../alignmentPluginType';
|
|
5
5
|
interface PrimaryToolbarComponentProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
3
3
|
import type { AlignmentPlugin } from '../../alignmentPluginType';
|
|
4
4
|
export declare const AlignmentMenu: ({ children, api, }: {
|
|
5
5
|
api: ExtractInjectionAPI<AlignmentPlugin> | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { ToolbarComponentTypes } from '@atlaskit/editor-toolbar-model';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
3
|
+
import type { ToolbarComponentTypes } from '@atlaskit/editor-toolbar-model/types';
|
|
4
4
|
import type { AlignmentPlugin } from '../../alignmentPluginType';
|
|
5
5
|
import type { AlignmentState } from '../../pm-plugins/types';
|
|
6
6
|
import type { OptionInfo } from './types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
import type { CommonComponentProps } from '@atlaskit/editor-toolbar-model';
|
|
3
|
+
import type { CommonComponentProps } from '@atlaskit/editor-toolbar-model/types';
|
|
4
4
|
export declare const MenuSection: ({ children, title, parents, }: {
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
parents: CommonComponentProps['parents'];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MessageDescriptor } from 'react-intl';
|
|
2
2
|
import type { Keymap } from '@atlaskit/editor-common/keymaps';
|
|
3
|
-
import type { IconComponent } from '@atlaskit/editor-toolbar';
|
|
3
|
+
import type { IconComponent } from '@atlaskit/editor-toolbar/types';
|
|
4
4
|
export type OptionInfo = {
|
|
5
5
|
icon: IconComponent;
|
|
6
6
|
key: string;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
7
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
8
8
|
import type { AlignmentPlugin } from '../../alignmentPluginType';
|
|
9
9
|
import { ToolbarType } from '../../pm-plugins/types';
|
|
10
10
|
import type { AlignmentState } from '../../pm-plugins/types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
|
|
1
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
2
|
+
import type { RegisterComponent } from '@atlaskit/editor-toolbar-model/types';
|
|
3
3
|
import type { AlignmentPlugin } from '../alignmentPluginType';
|
|
4
4
|
export declare const getToolbarComponents: (api: ExtractInjectionAPI<AlignmentPlugin> | undefined) => RegisterComponent[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-alignment",
|
|
3
|
-
"version": "27.0.
|
|
3
|
+
"version": "27.0.5",
|
|
4
4
|
"description": "Alignment plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@atlaskit/editor-toolbar": "^2.8.0",
|
|
34
34
|
"@atlaskit/icon": "^38.0.0",
|
|
35
35
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
36
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
36
|
+
"@atlaskit/tmp-editor-statsig": "^232.0.0",
|
|
37
37
|
"@atlaskit/tokens": "^20.4.0",
|
|
38
38
|
"@babel/runtime": "^7.0.0",
|
|
39
39
|
"@compiled/react": "^1.0.2"
|