@atlaskit/editor-core 190.1.7 → 190.1.9
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 +15 -0
- package/afm-cc/tsconfig.json +6 -0
- package/dist/cjs/plugins/index.js +0 -14
- package/dist/cjs/presets/universal.js +4 -2
- package/dist/cjs/ui/Addon/ClickAreaInline/index.js +1 -1
- package/dist/cjs/ui/ContentStyles/index.js +1 -1
- package/dist/cjs/utils/action.js +0 -28
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/index.js +0 -2
- package/dist/es2019/presets/universal.js +4 -2
- package/dist/es2019/ui/Addon/ClickAreaInline/index.js +1 -1
- package/dist/es2019/ui/ContentStyles/index.js +1 -1
- package/dist/es2019/utils/action.js +0 -28
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/index.js +0 -2
- package/dist/esm/presets/universal.js +4 -2
- package/dist/esm/ui/Addon/ClickAreaInline/index.js +1 -1
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/utils/action.js +0 -28
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/index.d.ts +0 -2
- package/dist/types/utils/action.d.ts +0 -6
- package/dist/types-ts4.5/plugins/index.d.ts +0 -2
- package/dist/types-ts4.5/utils/action.d.ts +0 -6
- package/package.json +4 -2
- package/tsconfig.json +1 -1
- package/dist/cjs/commands/index.js +0 -42
- package/dist/cjs/plugins/alignment/commands/index.js +0 -36
- package/dist/cjs/plugins/alignment/index.js +0 -70
- package/dist/cjs/plugins/alignment/pm-plugins/keymap.js +0 -14
- package/dist/cjs/plugins/alignment/pm-plugins/main.js +0 -45
- package/dist/cjs/plugins/alignment/pm-plugins/types.js +0 -5
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/icon-map.js +0 -36
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +0 -169
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/messages.js +0 -29
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -13
- package/dist/cjs/plugins/alignment/utils/index.js +0 -27
- package/dist/cjs/plugins/data-consumer/index.js +0 -19
- package/dist/cjs/ui/Alignment/AlignmentButton/index.js +0 -71
- package/dist/cjs/ui/Alignment/index.js +0 -74
- package/dist/cjs/ui/Alignment/styles.js +0 -11
- package/dist/es2019/commands/index.js +0 -1
- package/dist/es2019/plugins/alignment/commands/index.js +0 -30
- package/dist/es2019/plugins/alignment/index.js +0 -58
- package/dist/es2019/plugins/alignment/pm-plugins/keymap.js +0 -8
- package/dist/es2019/plugins/alignment/pm-plugins/main.js +0 -34
- package/dist/es2019/plugins/alignment/pm-plugins/types.js +0 -1
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/icon-map.js +0 -30
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +0 -140
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/messages.js +0 -23
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -14
- package/dist/es2019/plugins/alignment/utils/index.js +0 -15
- package/dist/es2019/plugins/data-consumer/index.js +0 -11
- package/dist/es2019/ui/Alignment/AlignmentButton/index.js +0 -44
- package/dist/es2019/ui/Alignment/index.js +0 -54
- package/dist/es2019/ui/Alignment/styles.js +0 -7
- package/dist/esm/commands/index.js +0 -1
- package/dist/esm/plugins/alignment/commands/index.js +0 -30
- package/dist/esm/plugins/alignment/index.js +0 -63
- package/dist/esm/plugins/alignment/pm-plugins/keymap.js +0 -8
- package/dist/esm/plugins/alignment/pm-plugins/main.js +0 -36
- package/dist/esm/plugins/alignment/pm-plugins/types.js +0 -1
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/icon-map.js +0 -29
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +0 -163
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/messages.js +0 -23
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -6
- package/dist/esm/plugins/alignment/utils/index.js +0 -21
- package/dist/esm/plugins/data-consumer/index.js +0 -13
- package/dist/esm/ui/Alignment/AlignmentButton/index.js +0 -62
- package/dist/esm/ui/Alignment/index.js +0 -68
- package/dist/esm/ui/Alignment/styles.js +0 -4
- package/dist/types/commands/index.d.ts +0 -1
- package/dist/types/plugins/alignment/commands/index.d.ts +0 -4
- package/dist/types/plugins/alignment/index.d.ts +0 -5
- package/dist/types/plugins/alignment/pm-plugins/keymap.d.ts +0 -2
- package/dist/types/plugins/alignment/pm-plugins/main.d.ts +0 -8
- package/dist/types/plugins/alignment/pm-plugins/types.d.ts +0 -5
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/icon-map.d.ts +0 -6
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/index.d.ts +0 -33
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/messages.d.ts +0 -22
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/styles.d.ts +0 -3
- package/dist/types/plugins/alignment/utils/index.d.ts +0 -3
- package/dist/types/plugins/data-consumer/index.d.ts +0 -3
- package/dist/types/ui/Alignment/AlignmentButton/index.d.ts +0 -17
- package/dist/types/ui/Alignment/index.d.ts +0 -12
- package/dist/types/ui/Alignment/styles.d.ts +0 -1
- package/dist/types-ts4.5/commands/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/alignment/commands/index.d.ts +0 -4
- package/dist/types-ts4.5/plugins/alignment/index.d.ts +0 -5
- package/dist/types-ts4.5/plugins/alignment/pm-plugins/keymap.d.ts +0 -2
- package/dist/types-ts4.5/plugins/alignment/pm-plugins/main.d.ts +0 -8
- package/dist/types-ts4.5/plugins/alignment/pm-plugins/types.d.ts +0 -5
- package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/icon-map.d.ts +0 -6
- package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/index.d.ts +0 -33
- package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/messages.d.ts +0 -22
- package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/styles.d.ts +0 -3
- package/dist/types-ts4.5/plugins/alignment/utils/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/data-consumer/index.d.ts +0 -3
- package/dist/types-ts4.5/ui/Alignment/AlignmentButton/index.d.ts +0 -17
- package/dist/types-ts4.5/ui/Alignment/index.d.ts +0 -12
- package/dist/types-ts4.5/ui/Alignment/styles.d.ts +0 -1
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.keymapPlugin = keymapPlugin;
|
|
7
|
-
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
8
|
-
var _keymaps = require("../../../keymaps");
|
|
9
|
-
var _commands = require("../commands");
|
|
10
|
-
function keymapPlugin() {
|
|
11
|
-
var list = {};
|
|
12
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.alignLeft.common, (0, _commands.changeAlignment)('start'), list);
|
|
13
|
-
return (0, _keymap.keymap)(list);
|
|
14
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.createInitialPluginState = createInitialPluginState;
|
|
8
|
-
exports.createPlugin = createPlugin;
|
|
9
|
-
exports.pluginKey = void 0;
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
12
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
13
|
-
var _commands = require("../commands");
|
|
14
|
-
var _utils = require("../utils");
|
|
15
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
-
function createInitialPluginState(editorState, pluginConfig) {
|
|
18
|
-
return {
|
|
19
|
-
align: (0, _utils.getActiveAlignment)(editorState) || pluginConfig.align,
|
|
20
|
-
isEnabled: true
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
var pluginKey = exports.pluginKey = new _state.PluginKey('alignmentPlugin');
|
|
24
|
-
function createPlugin(dispatch, pluginConfig) {
|
|
25
|
-
return new _safePlugin.SafePlugin({
|
|
26
|
-
key: pluginKey,
|
|
27
|
-
state: {
|
|
28
|
-
init: function init(_config, editorState) {
|
|
29
|
-
return createInitialPluginState(editorState, pluginConfig);
|
|
30
|
-
},
|
|
31
|
-
apply: function apply(_tr, state, _prevState, nextState) {
|
|
32
|
-
var nextPluginState = (0, _utils.getActiveAlignment)(nextState);
|
|
33
|
-
var isEnabled = (0, _commands.isAlignable)(nextPluginState)(nextState);
|
|
34
|
-
var newState = _objectSpread(_objectSpread({}, state), {}, {
|
|
35
|
-
align: nextPluginState,
|
|
36
|
-
isEnabled: isEnabled
|
|
37
|
-
});
|
|
38
|
-
if (nextPluginState !== state.align || isEnabled !== state.isEnabled) {
|
|
39
|
-
dispatch(pluginKey, newState);
|
|
40
|
-
}
|
|
41
|
-
return newState;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.IconMap = void 0;
|
|
8
|
-
var _alignLeft = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-left"));
|
|
9
|
-
var _alignRight = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-right"));
|
|
10
|
-
var _alignCenter = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-center"));
|
|
11
|
-
var _reactIntlNext = require("react-intl-next");
|
|
12
|
-
var _messages = require("./messages");
|
|
13
|
-
var _react = _interopRequireDefault(require("react"));
|
|
14
|
-
var iconAndMessageMap = {
|
|
15
|
-
start: {
|
|
16
|
-
Component: _alignLeft.default,
|
|
17
|
-
label: _messages.messages.alignLeft
|
|
18
|
-
},
|
|
19
|
-
end: {
|
|
20
|
-
Component: _alignRight.default,
|
|
21
|
-
label: _messages.messages.alignRight
|
|
22
|
-
},
|
|
23
|
-
center: {
|
|
24
|
-
Component: _alignCenter.default,
|
|
25
|
-
label: _messages.messages.alignCenter
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
var IconMap = exports.IconMap = function IconMap(props) {
|
|
29
|
-
var _iconAndMessageMap$pr = iconAndMessageMap[props.alignment],
|
|
30
|
-
Component = _iconAndMessageMap$pr.Component,
|
|
31
|
-
label = _iconAndMessageMap$pr.label;
|
|
32
|
-
var intl = (0, _reactIntlNext.useIntl)();
|
|
33
|
-
return /*#__PURE__*/_react.default.createElement(Component, {
|
|
34
|
-
label: intl.formatMessage(label)
|
|
35
|
-
});
|
|
36
|
-
};
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = exports.AlignmentToolbar = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
var _react = _interopRequireDefault(require("react"));
|
|
16
|
-
var _react2 = require("@emotion/react");
|
|
17
|
-
var _reactIntlNext = require("react-intl-next");
|
|
18
|
-
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
19
|
-
var _ToolbarButton = _interopRequireDefault(require("../../../../ui/ToolbarButton"));
|
|
20
|
-
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
21
|
-
var _Alignment = _interopRequireDefault(require("../../../../ui/Alignment"));
|
|
22
|
-
var _styles = require("./styles");
|
|
23
|
-
var _styles2 = require("@atlaskit/editor-common/styles");
|
|
24
|
-
var _iconMap = require("./icon-map");
|
|
25
|
-
var _messages = require("./messages");
|
|
26
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
27
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
28
|
-
var AlignmentToolbar = exports.AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
29
|
-
(0, _inherits2.default)(AlignmentToolbar, _React$Component);
|
|
30
|
-
var _super = _createSuper(AlignmentToolbar);
|
|
31
|
-
function AlignmentToolbar() {
|
|
32
|
-
var _this;
|
|
33
|
-
(0, _classCallCheck2.default)(this, AlignmentToolbar);
|
|
34
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
35
|
-
args[_key] = arguments[_key];
|
|
36
|
-
}
|
|
37
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
38
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toolbarItemRef", /*#__PURE__*/_react.default.createRef());
|
|
39
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
40
|
-
isOpen: false
|
|
41
|
-
});
|
|
42
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeAlignment", function (align, togglePopup) {
|
|
43
|
-
if (togglePopup) {
|
|
44
|
-
_this.toggleOpen();
|
|
45
|
-
}
|
|
46
|
-
return _this.props.changeAlignment(align);
|
|
47
|
-
});
|
|
48
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toggleOpen", function () {
|
|
49
|
-
_this.setState({
|
|
50
|
-
isOpen: !_this.state.isOpen
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toggleOpenByKeyboard", function (event) {
|
|
54
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
55
|
-
event.preventDefault();
|
|
56
|
-
_this.setState({
|
|
57
|
-
isOpen: !_this.state.isOpen
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hide", function (attrs) {
|
|
62
|
-
if (_this.state.isOpen) {
|
|
63
|
-
_this.setState({
|
|
64
|
-
isOpen: false
|
|
65
|
-
});
|
|
66
|
-
if ((attrs === null || attrs === void 0 ? void 0 : attrs.event) instanceof KeyboardEvent && attrs.event.key === 'Escape') {
|
|
67
|
-
var _this$toolbarItemRef;
|
|
68
|
-
(_this$toolbarItemRef = _this.toolbarItemRef) === null || _this$toolbarItemRef === void 0 || (_this$toolbarItemRef = _this$toolbarItemRef.current) === null || _this$toolbarItemRef === void 0 || _this$toolbarItemRef.focus();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hideOnEscape", function () {
|
|
73
|
-
var _this$toolbarItemRef2;
|
|
74
|
-
_this.hide();
|
|
75
|
-
(_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 || (_this$toolbarItemRef2 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef2 === void 0 || _this$toolbarItemRef2.focus();
|
|
76
|
-
});
|
|
77
|
-
return _this;
|
|
78
|
-
}
|
|
79
|
-
(0, _createClass2.default)(AlignmentToolbar, [{
|
|
80
|
-
key: "render",
|
|
81
|
-
value: function render() {
|
|
82
|
-
var _this2 = this;
|
|
83
|
-
var isOpen = this.state.isOpen;
|
|
84
|
-
var _this$props = this.props,
|
|
85
|
-
popupsMountPoint = _this$props.popupsMountPoint,
|
|
86
|
-
popupsBoundariesElement = _this$props.popupsBoundariesElement,
|
|
87
|
-
popupsScrollableElement = _this$props.popupsScrollableElement,
|
|
88
|
-
isReducedSpacing = _this$props.isReducedSpacing,
|
|
89
|
-
pluginState = _this$props.pluginState,
|
|
90
|
-
disabled = _this$props.disabled,
|
|
91
|
-
intl = _this$props.intl;
|
|
92
|
-
var title = intl.formatMessage(_messages.messages.alignment);
|
|
93
|
-
return (0, _react2.jsx)("span", {
|
|
94
|
-
css: _styles.wrapper
|
|
95
|
-
}, (0, _react2.jsx)(_uiMenu.DropdownContainer, {
|
|
96
|
-
mountTo: popupsMountPoint,
|
|
97
|
-
boundariesElement: popupsBoundariesElement,
|
|
98
|
-
scrollableElement: popupsScrollableElement,
|
|
99
|
-
isOpen: isOpen,
|
|
100
|
-
handleClickOutside: function handleClickOutside(event) {
|
|
101
|
-
if (event instanceof MouseEvent) {
|
|
102
|
-
_this2.hide({
|
|
103
|
-
isOpen: false,
|
|
104
|
-
event: event
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
handleEscapeKeydown: this.hideOnEscape,
|
|
109
|
-
arrowKeyNavigationProviderOptions: {
|
|
110
|
-
type: _uiMenu.ArrowKeyNavigationType.MENU
|
|
111
|
-
},
|
|
112
|
-
fitWidth: 112,
|
|
113
|
-
fitHeight: 80,
|
|
114
|
-
closeOnTab: true,
|
|
115
|
-
trigger: (0, _react2.jsx)(_ToolbarButton.default, {
|
|
116
|
-
spacing: isReducedSpacing ? 'none' : 'default',
|
|
117
|
-
disabled: disabled,
|
|
118
|
-
selected: isOpen,
|
|
119
|
-
title: title,
|
|
120
|
-
className: "align-btn",
|
|
121
|
-
"aria-label": title,
|
|
122
|
-
"aria-expanded": isOpen,
|
|
123
|
-
"aria-haspopup": true,
|
|
124
|
-
onClick: this.toggleOpen,
|
|
125
|
-
onKeyDown: this.toggleOpenByKeyboard,
|
|
126
|
-
iconBefore: (0, _react2.jsx)("div", {
|
|
127
|
-
css: _styles.triggerWrapper
|
|
128
|
-
}, (0, _react2.jsx)(_iconMap.IconMap, {
|
|
129
|
-
alignment: pluginState.align
|
|
130
|
-
}), (0, _react2.jsx)("span", {
|
|
131
|
-
css: _styles.expandIconWrapper
|
|
132
|
-
}, (0, _react2.jsx)(_chevronDown.default, {
|
|
133
|
-
label: ""
|
|
134
|
-
}))),
|
|
135
|
-
ref: this.toolbarItemRef
|
|
136
|
-
})
|
|
137
|
-
}, (0, _react2.jsx)(_Alignment.default, {
|
|
138
|
-
onClick: function onClick(align) {
|
|
139
|
-
return _this2.changeAlignment(align, false);
|
|
140
|
-
},
|
|
141
|
-
selectedAlignment: pluginState.align
|
|
142
|
-
})), (0, _react2.jsx)("span", {
|
|
143
|
-
css: _styles2.separatorStyles
|
|
144
|
-
}));
|
|
145
|
-
}
|
|
146
|
-
}, {
|
|
147
|
-
key: "componentDidUpdate",
|
|
148
|
-
value: function componentDidUpdate(prevProps) {
|
|
149
|
-
var _this3 = this;
|
|
150
|
-
if (this.state.isOpen) {
|
|
151
|
-
// by triggering the keyboard event with a setTimeout, we ensure that the tooltip
|
|
152
|
-
// associated with the alignment button doesn't render until the next render cycle
|
|
153
|
-
// where the popup will be correctly positioned and the relative position of the tooltip
|
|
154
|
-
// will not overlap with the button.
|
|
155
|
-
setTimeout(function () {
|
|
156
|
-
var _this3$toolbarItemRef;
|
|
157
|
-
var keyboardEvent = new KeyboardEvent('keydown', {
|
|
158
|
-
bubbles: true,
|
|
159
|
-
key: 'ArrowDown'
|
|
160
|
-
});
|
|
161
|
-
(_this3$toolbarItemRef = _this3.toolbarItemRef.current) === null || _this3$toolbarItemRef === void 0 || _this3$toolbarItemRef.dispatchEvent(keyboardEvent);
|
|
162
|
-
}, 0);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}]);
|
|
166
|
-
return AlignmentToolbar;
|
|
167
|
-
}(_react.default.Component);
|
|
168
|
-
(0, _defineProperty2.default)(AlignmentToolbar, "displayName", 'AlignmentToolbar');
|
|
169
|
-
var _default = exports.default = (0, _reactIntlNext.injectIntl)(AlignmentToolbar);
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.messages = void 0;
|
|
7
|
-
var _reactIntlNext = require("react-intl-next");
|
|
8
|
-
var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
9
|
-
alignment: {
|
|
10
|
-
id: 'fabric.editor.alignment',
|
|
11
|
-
defaultMessage: 'Text alignment',
|
|
12
|
-
description: 'Opens drop down menu of options to configure text alignment'
|
|
13
|
-
},
|
|
14
|
-
alignLeft: {
|
|
15
|
-
id: 'fabric.editor.alignLeft',
|
|
16
|
-
defaultMessage: 'Align left',
|
|
17
|
-
description: 'label stating that text is aligned left'
|
|
18
|
-
},
|
|
19
|
-
alignRight: {
|
|
20
|
-
id: 'fabric.editor.alignRight',
|
|
21
|
-
defaultMessage: 'Align Right',
|
|
22
|
-
description: 'label stating that text is aligned right'
|
|
23
|
-
},
|
|
24
|
-
alignCenter: {
|
|
25
|
-
id: 'fabric.editor.alignCenter',
|
|
26
|
-
defaultMessage: 'Align Center',
|
|
27
|
-
description: 'label stating that text is aligned center'
|
|
28
|
-
}
|
|
29
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.wrapper = exports.triggerWrapper = exports.expandIconWrapper = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _react = require("@emotion/react");
|
|
10
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
11
|
-
var triggerWrapper = exports.triggerWrapper = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n"])));
|
|
12
|
-
var wrapper = exports.wrapper = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n div {\n display: flex;\n }\n"])));
|
|
13
|
-
var expandIconWrapper = exports.expandIconWrapper = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: ", ";\n"])), "var(--ds-space-negative-100, -8px)");
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getActiveAlignment = void 0;
|
|
7
|
-
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
8
|
-
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
9
|
-
var getActiveAlignment = exports.getActiveAlignment = function getActiveAlignment(state) {
|
|
10
|
-
if (state.selection instanceof _cellSelection.CellSelection) {
|
|
11
|
-
var marks = [];
|
|
12
|
-
state.selection.forEachCell(function (cell) {
|
|
13
|
-
var mark = cell.firstChild.marks.filter(function (mark) {
|
|
14
|
-
return mark.type === state.schema.marks.alignment;
|
|
15
|
-
})[0];
|
|
16
|
-
marks.push(mark ? mark.attrs.align : 'start');
|
|
17
|
-
});
|
|
18
|
-
return marks.every(function (mark) {
|
|
19
|
-
return mark === marks[0];
|
|
20
|
-
}) ? marks[0] : 'start';
|
|
21
|
-
}
|
|
22
|
-
var node = (0, _utils.findParentNodeOfType)([state.schema.nodes.paragraph, state.schema.nodes.heading])(state.selection);
|
|
23
|
-
var getMark = node && node.node.marks.filter(function (mark) {
|
|
24
|
-
return mark.type === state.schema.marks.alignment;
|
|
25
|
-
})[0];
|
|
26
|
-
return getMark && getMark.attrs.align || 'start';
|
|
27
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _adfSchema = require("@atlaskit/adf-schema");
|
|
8
|
-
var dataConsumerMarkPlugin = function dataConsumerMarkPlugin() {
|
|
9
|
-
return {
|
|
10
|
-
name: 'dataConsumerPlugin',
|
|
11
|
-
marks: function marks() {
|
|
12
|
-
return [{
|
|
13
|
-
name: 'dataConsumer',
|
|
14
|
-
mark: _adfSchema.dataConsumer
|
|
15
|
-
}];
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
var _default = exports.default = dataConsumerMarkPlugin;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
var _ToolbarButton = _interopRequireDefault(require("../../ToolbarButton"));
|
|
18
|
-
var _keymaps = require("../../../keymaps");
|
|
19
|
-
var _keymaps2 = require("@atlaskit/editor-common/keymaps");
|
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
23
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
var AlignmentButton = /*#__PURE__*/function (_PureComponent) {
|
|
25
|
-
(0, _inherits2.default)(AlignmentButton, _PureComponent);
|
|
26
|
-
var _super = _createSuper(AlignmentButton);
|
|
27
|
-
function AlignmentButton() {
|
|
28
|
-
var _this;
|
|
29
|
-
(0, _classCallCheck2.default)(this, AlignmentButton);
|
|
30
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
31
|
-
args[_key] = arguments[_key];
|
|
32
|
-
}
|
|
33
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
34
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onClick", function (e) {
|
|
35
|
-
var _this$props = _this.props,
|
|
36
|
-
onClick = _this$props.onClick,
|
|
37
|
-
value = _this$props.value;
|
|
38
|
-
|
|
39
|
-
// detect if the click event comes from keyboard where screenX and screenY are 0
|
|
40
|
-
var isMouseEvent = e instanceof MouseEvent;
|
|
41
|
-
e.preventDefault();
|
|
42
|
-
onClick(value, isMouseEvent);
|
|
43
|
-
});
|
|
44
|
-
return _this;
|
|
45
|
-
}
|
|
46
|
-
(0, _createClass2.default)(AlignmentButton, [{
|
|
47
|
-
key: "render",
|
|
48
|
-
value: function render() {
|
|
49
|
-
var _this$props2 = this.props,
|
|
50
|
-
label = _this$props2.label,
|
|
51
|
-
isSelected = _this$props2.isSelected,
|
|
52
|
-
content = _this$props2.content,
|
|
53
|
-
shortcut = _this$props2.shortcut;
|
|
54
|
-
return /*#__PURE__*/_react.default.createElement(_ToolbarButton.default, {
|
|
55
|
-
disabled: false,
|
|
56
|
-
selected: isSelected,
|
|
57
|
-
title: /*#__PURE__*/_react.default.createElement(_keymaps.ToolTipContent, {
|
|
58
|
-
description: label,
|
|
59
|
-
keymap: shortcut
|
|
60
|
-
}),
|
|
61
|
-
"aria-label": shortcut ? (0, _keymaps.tooltip)(shortcut, label) : label,
|
|
62
|
-
"aria-pressed": isSelected,
|
|
63
|
-
"aria-keyshortcuts": (0, _keymaps2.getAriaKeyshortcuts)(shortcut),
|
|
64
|
-
onClick: this.onClick,
|
|
65
|
-
iconBefore: content
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}]);
|
|
69
|
-
return AlignmentButton;
|
|
70
|
-
}(_react.PureComponent);
|
|
71
|
-
var _default = exports.default = AlignmentButton;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
11
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
-
var _react = require("@emotion/react");
|
|
14
|
-
var _react2 = require("react");
|
|
15
|
-
var _reactIntlNext = require("react-intl-next");
|
|
16
|
-
var _iconMap = require("../../plugins/alignment/ui/ToolbarAlignment/icon-map");
|
|
17
|
-
var _AlignmentButton = _interopRequireDefault(require("./AlignmentButton"));
|
|
18
|
-
var _messages = require("@atlaskit/editor-common/messages");
|
|
19
|
-
var _styles = require("./styles");
|
|
20
|
-
var _keymaps = require("../../keymaps");
|
|
21
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
22
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
23
|
-
var alignmentOptions = [{
|
|
24
|
-
title: _messages.alignmentMessages.alignLeft,
|
|
25
|
-
shortcut: _keymaps.alignLeft,
|
|
26
|
-
value: 'start'
|
|
27
|
-
}, {
|
|
28
|
-
title: _messages.alignmentMessages.alignCenter,
|
|
29
|
-
value: 'center'
|
|
30
|
-
}, {
|
|
31
|
-
title: _messages.alignmentMessages.alignRight,
|
|
32
|
-
value: 'end'
|
|
33
|
-
}];
|
|
34
|
-
var Alignment = /*#__PURE__*/function (_PureComponent) {
|
|
35
|
-
(0, _inherits2.default)(Alignment, _PureComponent);
|
|
36
|
-
var _super = _createSuper(Alignment);
|
|
37
|
-
function Alignment() {
|
|
38
|
-
(0, _classCallCheck2.default)(this, Alignment);
|
|
39
|
-
return _super.apply(this, arguments);
|
|
40
|
-
}
|
|
41
|
-
(0, _createClass2.default)(Alignment, [{
|
|
42
|
-
key: "render",
|
|
43
|
-
value: function render() {
|
|
44
|
-
var _this$props = this.props,
|
|
45
|
-
onClick = _this$props.onClick,
|
|
46
|
-
selectedAlignment = _this$props.selectedAlignment,
|
|
47
|
-
className = _this$props.className,
|
|
48
|
-
intl = _this$props.intl;
|
|
49
|
-
return (0, _react.jsx)("div", {
|
|
50
|
-
"data-testid": "alignment-buttons",
|
|
51
|
-
css: _styles.alignmentWrapper,
|
|
52
|
-
className: className
|
|
53
|
-
}, alignmentOptions.map(function (alignment) {
|
|
54
|
-
var value = alignment.value,
|
|
55
|
-
title = alignment.title,
|
|
56
|
-
shortcut = alignment.shortcut;
|
|
57
|
-
var message = intl.formatMessage(title);
|
|
58
|
-
return (0, _react.jsx)(_AlignmentButton.default, {
|
|
59
|
-
content: (0, _react.jsx)(_iconMap.IconMap, {
|
|
60
|
-
alignment: value
|
|
61
|
-
}),
|
|
62
|
-
key: value,
|
|
63
|
-
value: value,
|
|
64
|
-
label: message,
|
|
65
|
-
shortcut: shortcut,
|
|
66
|
-
onClick: onClick,
|
|
67
|
-
isSelected: value === selectedAlignment
|
|
68
|
-
});
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
-
}]);
|
|
72
|
-
return Alignment;
|
|
73
|
-
}(_react2.PureComponent);
|
|
74
|
-
var _default = exports.default = (0, _reactIntlNext.injectIntl)(Alignment);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.alignmentWrapper = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _react = require("@emotion/react");
|
|
10
|
-
var _templateObject;
|
|
11
|
-
var alignmentWrapper = exports.alignmentWrapper = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n padding: 0 ", ";\n display: flex;\n flex-wrap: wrap;\n max-width: ", "px;\n"])), "var(--ds-space-100, 8px)", 3 * 32);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { addParagraphAtEnd, createParagraphAtEnd, changeImageAlignment, createToggleBlockMarkOnRange, toggleBlockMark, clearEditorContent } from '@atlaskit/editor-common/commands';
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { toggleBlockMark, changeImageAlignment } from '../../../commands';
|
|
2
|
-
import { cascadeCommands } from '../../../utils/action';
|
|
3
|
-
export const isAlignable = align => (state, dispatch) => {
|
|
4
|
-
const {
|
|
5
|
-
nodes: {
|
|
6
|
-
paragraph,
|
|
7
|
-
heading
|
|
8
|
-
},
|
|
9
|
-
marks: {
|
|
10
|
-
alignment
|
|
11
|
-
}
|
|
12
|
-
} = state.schema;
|
|
13
|
-
return toggleBlockMark(alignment, () => !align ? undefined : align === 'start' ? false : {
|
|
14
|
-
align
|
|
15
|
-
}, [paragraph, heading])(state, dispatch);
|
|
16
|
-
};
|
|
17
|
-
export const changeAlignment = align => (state, dispatch) => {
|
|
18
|
-
const {
|
|
19
|
-
nodes: {
|
|
20
|
-
paragraph,
|
|
21
|
-
heading
|
|
22
|
-
},
|
|
23
|
-
marks: {
|
|
24
|
-
alignment
|
|
25
|
-
}
|
|
26
|
-
} = state.schema;
|
|
27
|
-
return cascadeCommands([changeImageAlignment(align), toggleBlockMark(alignment, () => !align ? undefined : align === 'start' ? false : {
|
|
28
|
-
align
|
|
29
|
-
}, [paragraph, heading])])(state, dispatch);
|
|
30
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { alignment } from '@atlaskit/adf-schema';
|
|
3
|
-
import WithPluginState from '../../ui/WithPluginState';
|
|
4
|
-
import { pluginKey, createPlugin } from './pm-plugins/main';
|
|
5
|
-
import { changeAlignment } from './commands';
|
|
6
|
-
import ToolbarAlignment from './ui/ToolbarAlignment';
|
|
7
|
-
import { keymapPlugin } from './pm-plugins/keymap';
|
|
8
|
-
export const defaultConfig = {
|
|
9
|
-
align: 'start'
|
|
10
|
-
};
|
|
11
|
-
const alignmentPlugin = () => ({
|
|
12
|
-
name: 'alignment',
|
|
13
|
-
marks() {
|
|
14
|
-
return [{
|
|
15
|
-
name: 'alignment',
|
|
16
|
-
mark: alignment
|
|
17
|
-
}];
|
|
18
|
-
},
|
|
19
|
-
pmPlugins() {
|
|
20
|
-
return [{
|
|
21
|
-
name: 'alignmentPlugin',
|
|
22
|
-
plugin: ({
|
|
23
|
-
dispatch
|
|
24
|
-
}) => createPlugin(dispatch, defaultConfig)
|
|
25
|
-
}, {
|
|
26
|
-
name: 'annotationKeymap',
|
|
27
|
-
plugin: () => keymapPlugin()
|
|
28
|
-
}];
|
|
29
|
-
},
|
|
30
|
-
primaryToolbarComponent({
|
|
31
|
-
editorView,
|
|
32
|
-
popupsMountPoint,
|
|
33
|
-
popupsBoundariesElement,
|
|
34
|
-
popupsScrollableElement,
|
|
35
|
-
disabled,
|
|
36
|
-
isToolbarReducedSpacing
|
|
37
|
-
}) {
|
|
38
|
-
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
39
|
-
plugins: {
|
|
40
|
-
align: pluginKey
|
|
41
|
-
},
|
|
42
|
-
render: ({
|
|
43
|
-
align
|
|
44
|
-
}) => {
|
|
45
|
-
return /*#__PURE__*/React.createElement(ToolbarAlignment, {
|
|
46
|
-
pluginState: align,
|
|
47
|
-
isReducedSpacing: isToolbarReducedSpacing,
|
|
48
|
-
changeAlignment: align => changeAlignment(align)(editorView.state, editorView.dispatch),
|
|
49
|
-
disabled: disabled || !align.isEnabled,
|
|
50
|
-
popupsMountPoint: popupsMountPoint,
|
|
51
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
52
|
-
popupsScrollableElement: popupsScrollableElement
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
export default alignmentPlugin;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
2
|
-
import { bindKeymapWithCommand, alignLeft } from '../../../keymaps';
|
|
3
|
-
import { changeAlignment } from '../commands';
|
|
4
|
-
export function keymapPlugin() {
|
|
5
|
-
const list = {};
|
|
6
|
-
bindKeymapWithCommand(alignLeft.common, changeAlignment('start'), list);
|
|
7
|
-
return keymap(list);
|
|
8
|
-
}
|