@atlaskit/editor-plugin-alignment 1.14.5 → 1.14.6
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/pm-plugins/keymap.js +7 -0
- package/dist/cjs/pm-plugins/main.js +4 -0
- package/dist/cjs/pm-plugins/utils/index.js +2 -0
- package/dist/cjs/ui/Alignment/index.js +2 -4
- package/dist/cjs/ui/FloatingToolbarComponent.js +4 -1
- package/dist/cjs/ui/PrimaryToolbarComponent.js +4 -1
- package/dist/es2019/editor-commands/index.js +1 -1
- package/dist/es2019/pm-plugins/keymap.js +7 -0
- package/dist/es2019/pm-plugins/main.js +4 -0
- package/dist/es2019/pm-plugins/utils/index.js +2 -0
- package/dist/es2019/ui/Alignment/index.js +2 -4
- package/dist/es2019/ui/FloatingToolbarComponent.js +4 -1
- package/dist/es2019/ui/PrimaryToolbarComponent.js +4 -1
- package/dist/esm/pm-plugins/keymap.js +7 -0
- package/dist/esm/pm-plugins/main.js +4 -0
- package/dist/esm/pm-plugins/utils/index.js +2 -0
- package/dist/esm/ui/Alignment/index.js +2 -4
- package/dist/esm/ui/FloatingToolbarComponent.js +4 -1
- package/dist/esm/ui/PrimaryToolbarComponent.js +4 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -8,8 +8,15 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
|
8
8
|
var _editorCommands = require("../editor-commands");
|
|
9
9
|
function keymapPlugin() {
|
|
10
10
|
var list = {};
|
|
11
|
+
|
|
12
|
+
// Ignored via go/ees005
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11
14
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.alignLeft.common, (0, _editorCommands.changeAlignment)('start'), list);
|
|
15
|
+
// Ignored via go/ees005
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
12
17
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.alignCenter.common, (0, _editorCommands.changeAlignment)('center'), list);
|
|
18
|
+
// Ignored via go/ees005
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
13
20
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.alignRight.common, (0, _editorCommands.changeAlignment)('end'), list);
|
|
14
21
|
return (0, _keymaps.keymap)(list);
|
|
15
22
|
}
|
|
@@ -28,7 +28,11 @@ function createPlugin(dispatch, pluginConfig) {
|
|
|
28
28
|
init: function init(_, editorState) {
|
|
29
29
|
return createInitialPluginState(editorState, pluginConfig);
|
|
30
30
|
},
|
|
31
|
+
// Ignored via go/ees005
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
31
33
|
apply: function apply(_tr, state, _prevState, nextState) {
|
|
34
|
+
// Ignored via go/ees005
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
32
36
|
var nextPluginState = (0, _utils.getActiveAlignment)(nextState);
|
|
33
37
|
var isEnabled = (0, _editorCommands.isAlignable)(nextPluginState)(nextState);
|
|
34
38
|
var newState = _objectSpread(_objectSpread({}, state), {}, {
|
|
@@ -10,6 +10,8 @@ var getActiveAlignment = exports.getActiveAlignment = function getActiveAlignmen
|
|
|
10
10
|
if (state.selection instanceof _cellSelection.CellSelection) {
|
|
11
11
|
var marks = [];
|
|
12
12
|
state.selection.forEachCell(function (cell) {
|
|
13
|
+
// Ignored via go/ees005
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
13
15
|
var mark = cell.firstChild.marks.filter(function (mark) {
|
|
14
16
|
return mark.type === state.schema.marks.alignment;
|
|
15
17
|
})[0];
|
|
@@ -18,10 +18,8 @@ var _styles = require("./styles");
|
|
|
18
18
|
*/
|
|
19
19
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
20
20
|
|
|
21
|
-
var alignCenterKeyboardShortcut;
|
|
22
|
-
var alignRightKeyboardShortcut;
|
|
23
|
-
alignCenterKeyboardShortcut = _keymaps.alignCenter;
|
|
24
|
-
alignRightKeyboardShortcut = _keymaps.alignRight;
|
|
21
|
+
var alignCenterKeyboardShortcut = _keymaps.alignCenter;
|
|
22
|
+
var alignRightKeyboardShortcut = _keymaps.alignRight;
|
|
25
23
|
var alignmentOptions = [{
|
|
26
24
|
title: _messages.alignmentMessages.alignLeft,
|
|
27
25
|
shortcut: _keymaps.alignLeft,
|
|
@@ -28,7 +28,10 @@ function FloatingToolbarComponent(_ref) {
|
|
|
28
28
|
return /*#__PURE__*/_react.default.createElement(_ToolbarAlignment.default, {
|
|
29
29
|
pluginState: alignmentState,
|
|
30
30
|
isReducedSpacing: FloatingToolbarSettings.isToolbarReducedSpacing,
|
|
31
|
-
changeAlignment: changeAlignmentCallback
|
|
31
|
+
changeAlignment: changeAlignmentCallback
|
|
32
|
+
// Ignored via go/ees005
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
34
|
+
,
|
|
32
35
|
disabled: FloatingToolbarSettings.disabled || !alignmentState.isEnabled,
|
|
33
36
|
toolbarType: _types.ToolbarType.FLOATING,
|
|
34
37
|
api: api
|
|
@@ -29,7 +29,10 @@ function PrimaryToolbarComponent(_ref) {
|
|
|
29
29
|
return /*#__PURE__*/_react.default.createElement(_ToolbarAlignment.default, {
|
|
30
30
|
pluginState: alignmentState,
|
|
31
31
|
isReducedSpacing: isToolbarReducedSpacing,
|
|
32
|
-
changeAlignment: changeAlignmentCallback
|
|
32
|
+
changeAlignment: changeAlignmentCallback
|
|
33
|
+
// Ignored via go/ees005
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
35
|
+
,
|
|
33
36
|
disabled: disabled || !alignmentState.isEnabled,
|
|
34
37
|
popupsMountPoint: popupsMountPoint,
|
|
35
38
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
@@ -2,8 +2,15 @@ import { alignCenter, alignLeft, alignRight, bindKeymapWithCommand, keymap } fro
|
|
|
2
2
|
import { changeAlignment } from '../editor-commands';
|
|
3
3
|
export function keymapPlugin() {
|
|
4
4
|
const list = {};
|
|
5
|
+
|
|
6
|
+
// Ignored via go/ees005
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
5
8
|
bindKeymapWithCommand(alignLeft.common, changeAlignment('start'), list);
|
|
9
|
+
// Ignored via go/ees005
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
6
11
|
bindKeymapWithCommand(alignCenter.common, changeAlignment('center'), list);
|
|
12
|
+
// Ignored via go/ees005
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
7
14
|
bindKeymapWithCommand(alignRight.common, changeAlignment('end'), list);
|
|
8
15
|
return keymap(list);
|
|
9
16
|
}
|
|
@@ -16,7 +16,11 @@ export function createPlugin(dispatch, pluginConfig) {
|
|
|
16
16
|
init(_, editorState) {
|
|
17
17
|
return createInitialPluginState(editorState, pluginConfig);
|
|
18
18
|
},
|
|
19
|
+
// Ignored via go/ees005
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
19
21
|
apply(_tr, state, _prevState, nextState) {
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
20
24
|
const nextPluginState = getActiveAlignment(nextState);
|
|
21
25
|
const isEnabled = isAlignable(nextPluginState)(nextState);
|
|
22
26
|
const newState = {
|
|
@@ -4,6 +4,8 @@ export const getActiveAlignment = state => {
|
|
|
4
4
|
if (state.selection instanceof CellSelection) {
|
|
5
5
|
const marks = [];
|
|
6
6
|
state.selection.forEachCell(cell => {
|
|
7
|
+
// Ignored via go/ees005
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
7
9
|
const mark = cell.firstChild.marks.filter(mark => mark.type === state.schema.marks.alignment)[0];
|
|
8
10
|
marks.push(mark ? mark.attrs.align : 'start');
|
|
9
11
|
});
|
|
@@ -10,10 +10,8 @@ import { alignmentMessages } from '@atlaskit/editor-common/messages';
|
|
|
10
10
|
import { IconMap } from '../ToolbarAlignment/icon-map';
|
|
11
11
|
import AlignmentButton from './AlignmentButton';
|
|
12
12
|
import { alignmentWrapper } from './styles';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
alignCenterKeyboardShortcut = alignCenter;
|
|
16
|
-
alignRightKeyboardShortcut = alignRight;
|
|
13
|
+
const alignCenterKeyboardShortcut = alignCenter;
|
|
14
|
+
const alignRightKeyboardShortcut = alignRight;
|
|
17
15
|
const alignmentOptions = [{
|
|
18
16
|
title: alignmentMessages.alignLeft,
|
|
19
17
|
shortcut: alignLeft,
|
|
@@ -20,7 +20,10 @@ export function FloatingToolbarComponent({
|
|
|
20
20
|
return /*#__PURE__*/React.createElement(ToolbarAlignment, {
|
|
21
21
|
pluginState: alignmentState,
|
|
22
22
|
isReducedSpacing: FloatingToolbarSettings.isToolbarReducedSpacing,
|
|
23
|
-
changeAlignment: changeAlignmentCallback
|
|
23
|
+
changeAlignment: changeAlignmentCallback
|
|
24
|
+
// Ignored via go/ees005
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
26
|
+
,
|
|
24
27
|
disabled: FloatingToolbarSettings.disabled || !alignmentState.isEnabled,
|
|
25
28
|
toolbarType: ToolbarType.FLOATING,
|
|
26
29
|
api: api
|
|
@@ -19,7 +19,10 @@ export function PrimaryToolbarComponent({
|
|
|
19
19
|
return /*#__PURE__*/React.createElement(ToolbarAlignment, {
|
|
20
20
|
pluginState: alignmentState,
|
|
21
21
|
isReducedSpacing: isToolbarReducedSpacing,
|
|
22
|
-
changeAlignment: changeAlignmentCallback
|
|
22
|
+
changeAlignment: changeAlignmentCallback
|
|
23
|
+
// Ignored via go/ees005
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
25
|
+
,
|
|
23
26
|
disabled: disabled || !alignmentState.isEnabled,
|
|
24
27
|
popupsMountPoint: popupsMountPoint,
|
|
25
28
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
@@ -2,8 +2,15 @@ import { alignCenter, alignLeft, alignRight, bindKeymapWithCommand, keymap } fro
|
|
|
2
2
|
import { changeAlignment } from '../editor-commands';
|
|
3
3
|
export function keymapPlugin() {
|
|
4
4
|
var list = {};
|
|
5
|
+
|
|
6
|
+
// Ignored via go/ees005
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
5
8
|
bindKeymapWithCommand(alignLeft.common, changeAlignment('start'), list);
|
|
9
|
+
// Ignored via go/ees005
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
6
11
|
bindKeymapWithCommand(alignCenter.common, changeAlignment('center'), list);
|
|
12
|
+
// Ignored via go/ees005
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
7
14
|
bindKeymapWithCommand(alignRight.common, changeAlignment('end'), list);
|
|
8
15
|
return keymap(list);
|
|
9
16
|
}
|
|
@@ -19,7 +19,11 @@ export function createPlugin(dispatch, pluginConfig) {
|
|
|
19
19
|
init: function init(_, editorState) {
|
|
20
20
|
return createInitialPluginState(editorState, pluginConfig);
|
|
21
21
|
},
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
22
24
|
apply: function apply(_tr, state, _prevState, nextState) {
|
|
25
|
+
// Ignored via go/ees005
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
23
27
|
var nextPluginState = getActiveAlignment(nextState);
|
|
24
28
|
var isEnabled = isAlignable(nextPluginState)(nextState);
|
|
25
29
|
var newState = _objectSpread(_objectSpread({}, state), {}, {
|
|
@@ -4,6 +4,8 @@ export var getActiveAlignment = function getActiveAlignment(state) {
|
|
|
4
4
|
if (state.selection instanceof CellSelection) {
|
|
5
5
|
var marks = [];
|
|
6
6
|
state.selection.forEachCell(function (cell) {
|
|
7
|
+
// Ignored via go/ees005
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
7
9
|
var mark = cell.firstChild.marks.filter(function (mark) {
|
|
8
10
|
return mark.type === state.schema.marks.alignment;
|
|
9
11
|
})[0];
|
|
@@ -10,10 +10,8 @@ import { alignmentMessages } from '@atlaskit/editor-common/messages';
|
|
|
10
10
|
import { IconMap } from '../ToolbarAlignment/icon-map';
|
|
11
11
|
import AlignmentButton from './AlignmentButton';
|
|
12
12
|
import { alignmentWrapper } from './styles';
|
|
13
|
-
var alignCenterKeyboardShortcut;
|
|
14
|
-
var alignRightKeyboardShortcut;
|
|
15
|
-
alignCenterKeyboardShortcut = alignCenter;
|
|
16
|
-
alignRightKeyboardShortcut = alignRight;
|
|
13
|
+
var alignCenterKeyboardShortcut = alignCenter;
|
|
14
|
+
var alignRightKeyboardShortcut = alignRight;
|
|
17
15
|
var alignmentOptions = [{
|
|
18
16
|
title: alignmentMessages.alignLeft,
|
|
19
17
|
shortcut: alignLeft,
|
|
@@ -18,7 +18,10 @@ export function FloatingToolbarComponent(_ref) {
|
|
|
18
18
|
return /*#__PURE__*/React.createElement(ToolbarAlignment, {
|
|
19
19
|
pluginState: alignmentState,
|
|
20
20
|
isReducedSpacing: FloatingToolbarSettings.isToolbarReducedSpacing,
|
|
21
|
-
changeAlignment: changeAlignmentCallback
|
|
21
|
+
changeAlignment: changeAlignmentCallback
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
24
|
+
,
|
|
22
25
|
disabled: FloatingToolbarSettings.disabled || !alignmentState.isEnabled,
|
|
23
26
|
toolbarType: ToolbarType.FLOATING,
|
|
24
27
|
api: api
|
|
@@ -19,7 +19,10 @@ export function PrimaryToolbarComponent(_ref) {
|
|
|
19
19
|
return /*#__PURE__*/React.createElement(ToolbarAlignment, {
|
|
20
20
|
pluginState: alignmentState,
|
|
21
21
|
isReducedSpacing: isToolbarReducedSpacing,
|
|
22
|
-
changeAlignment: changeAlignmentCallback
|
|
22
|
+
changeAlignment: changeAlignmentCallback
|
|
23
|
+
// Ignored via go/ees005
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
25
|
+
,
|
|
23
26
|
disabled: disabled || !alignmentState.isEnabled,
|
|
24
27
|
popupsMountPoint: popupsMountPoint,
|
|
25
28
|
popupsBoundariesElement: popupsBoundariesElement,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-alignment",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.6",
|
|
4
4
|
"description": "Alignment plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
24
|
-
"@atlaskit/editor-common": "^
|
|
24
|
+
"@atlaskit/editor-common": "^98.0.0",
|
|
25
25
|
"@atlaskit/editor-plugin-primary-toolbar": "^2.1.0",
|
|
26
26
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
27
27
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
28
28
|
"@atlaskit/icon": "^23.1.0",
|
|
29
29
|
"@atlaskit/platform-feature-flags": "0.3.0",
|
|
30
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
30
|
+
"@atlaskit/tmp-editor-statsig": "^2.31.0",
|
|
31
31
|
"@atlaskit/tokens": "^2.5.0",
|
|
32
32
|
"@babel/runtime": "^7.0.0",
|
|
33
33
|
"@emotion/react": "^11.7.1"
|