@atlaskit/editor-plugin-help-dialog 1.1.1 → 1.2.0
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 +16 -0
- package/dist/cjs/ui/Format.js +5 -0
- package/dist/cjs/ui/Modal.js +21 -0
- package/dist/cjs/ui/ModalContent.js +67 -0
- package/dist/cjs/ui/ModalFooter.js +26 -0
- package/dist/cjs/ui/ModalHeader.js +35 -0
- package/dist/cjs/ui/formatting.js +492 -0
- package/dist/cjs/ui/index.js +12 -561
- package/dist/cjs/ui/styles.js +90 -14
- package/dist/cjs/ui/utils.js +55 -0
- package/dist/es2019/ui/Format.js +1 -0
- package/dist/es2019/ui/Modal.js +16 -0
- package/dist/es2019/ui/ModalContent.js +48 -0
- package/dist/es2019/ui/ModalFooter.js +16 -0
- package/dist/es2019/ui/ModalHeader.js +30 -0
- package/dist/es2019/ui/formatting.js +355 -0
- package/dist/es2019/ui/index.js +7 -423
- package/dist/es2019/ui/styles.js +90 -90
- package/dist/es2019/ui/utils.js +48 -0
- package/dist/esm/ui/Format.js +1 -0
- package/dist/esm/ui/Modal.js +14 -0
- package/dist/esm/ui/ModalContent.js +59 -0
- package/dist/esm/ui/ModalFooter.js +18 -0
- package/dist/esm/ui/ModalHeader.js +27 -0
- package/dist/esm/ui/formatting.js +484 -0
- package/dist/esm/ui/index.js +12 -561
- package/dist/esm/ui/styles.js +90 -13
- package/dist/esm/ui/utils.js +48 -0
- package/dist/types/ui/Format.d.ts +8 -0
- package/dist/types/ui/Modal.d.ts +8 -0
- package/dist/types/ui/ModalContent.d.ts +9 -0
- package/dist/types/ui/ModalFooter.d.ts +4 -0
- package/dist/types/ui/ModalHeader.d.ts +10 -0
- package/dist/types/ui/formatting.d.ts +5 -0
- package/dist/types/ui/index.d.ts +3 -16
- package/dist/types/ui/utils.d.ts +5 -0
- package/dist/types-ts4.5/ui/Format.d.ts +8 -0
- package/dist/types-ts4.5/ui/Modal.d.ts +8 -0
- package/dist/types-ts4.5/ui/ModalContent.d.ts +9 -0
- package/dist/types-ts4.5/ui/ModalFooter.d.ts +4 -0
- package/dist/types-ts4.5/ui/ModalHeader.d.ts +10 -0
- package/dist/types-ts4.5/ui/formatting.d.ts +5 -0
- package/dist/types-ts4.5/ui/index.d.ts +3 -16
- package/dist/types-ts4.5/ui/utils.d.ts +5 -0
- package/package.json +14 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-help-dialog
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#91934](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91934) [`b76a78c6a199`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b76a78c6a199) - bumped editor-prosemirror version to 4.0.0
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 1.1.2
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#91571](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91571) [`984cb24fae77`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/984cb24fae77) - refactored help dialog
|
|
18
|
+
|
|
3
19
|
## 1.1.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
9
|
+
var _ModalContent = require("./ModalContent");
|
|
10
|
+
/** @jsx jsx */
|
|
11
|
+
|
|
12
|
+
var Modal = function Modal(_ref) {
|
|
13
|
+
var formatting = _ref.formatting;
|
|
14
|
+
var _useModal = (0, _modalDialog.useModal)(),
|
|
15
|
+
onClose = _useModal.onClose;
|
|
16
|
+
return (0, _react.jsx)(_ModalContent.ModalContent, {
|
|
17
|
+
formatting: formatting,
|
|
18
|
+
onClose: onClose
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var _default = exports.default = Modal;
|
|
@@ -0,0 +1,67 @@
|
|
|
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.ModalContent = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _react2 = require("@emotion/react");
|
|
10
|
+
var _reactIntlNext = require("react-intl-next");
|
|
11
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
12
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
|
+
var _ModalFooter = _interopRequireDefault(require("./ModalFooter"));
|
|
14
|
+
var _ModalHeader = _interopRequireDefault(require("./ModalHeader"));
|
|
15
|
+
var _styles = require("./styles");
|
|
16
|
+
var _utils2 = require("./utils");
|
|
17
|
+
/** @jsx jsx */
|
|
18
|
+
/** @jsxFrag */
|
|
19
|
+
|
|
20
|
+
var ModalContent = exports.ModalContent = function ModalContent(_ref) {
|
|
21
|
+
var formatting = _ref.formatting,
|
|
22
|
+
onClose = _ref.onClose;
|
|
23
|
+
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_ModalHeader.default, {
|
|
24
|
+
onClose: onClose
|
|
25
|
+
}), (0, _react2.jsx)("div", {
|
|
26
|
+
css: _styles.contentWrapper
|
|
27
|
+
}, (0, _react2.jsx)("div", {
|
|
28
|
+
css: _styles.line
|
|
29
|
+
}), (0, _react2.jsx)("div", {
|
|
30
|
+
css: _styles.content
|
|
31
|
+
}, (0, _react2.jsx)("div", {
|
|
32
|
+
css: _styles.column
|
|
33
|
+
}, (0, _react2.jsx)("h2", {
|
|
34
|
+
css: _styles.title
|
|
35
|
+
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.helpDialogMessages.keyboardShortcuts)), (0, _react2.jsx)("ul", null, formatting.filter(function (form) {
|
|
36
|
+
var keymap = form.keymap && form.keymap();
|
|
37
|
+
return keymap && keymap[_utils.browser.mac ? 'mac' : 'windows'];
|
|
38
|
+
}).map(function (form) {
|
|
39
|
+
return (0, _react2.jsx)("li", {
|
|
40
|
+
css: _styles.row,
|
|
41
|
+
key: "textFormatting-".concat(form.name)
|
|
42
|
+
}, (0, _react2.jsx)("span", null, form.name), (0, _utils2.getComponentFromKeymap)(form.keymap()));
|
|
43
|
+
}), formatting.filter(function (form) {
|
|
44
|
+
return _utils2.shortcutNamesWithoutKeymap.indexOf(form.type) !== -1;
|
|
45
|
+
}).filter(function (form) {
|
|
46
|
+
return form.autoFormatting;
|
|
47
|
+
}).map(function (form) {
|
|
48
|
+
return (0, _react2.jsx)("li", {
|
|
49
|
+
css: _styles.row,
|
|
50
|
+
key: "autoFormatting-".concat(form.name)
|
|
51
|
+
}, (0, _react2.jsx)("span", null, form.name), form.autoFormatting());
|
|
52
|
+
}))), (0, _react2.jsx)("div", {
|
|
53
|
+
css: _styles.line
|
|
54
|
+
}), (0, _react2.jsx)("div", {
|
|
55
|
+
css: _styles.column
|
|
56
|
+
}, (0, _react2.jsx)("h2", {
|
|
57
|
+
css: _styles.title
|
|
58
|
+
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.helpDialogMessages.markdown)), (0, _react2.jsx)("ul", null, formatting.filter(function (form) {
|
|
59
|
+
return _utils2.shortcutNamesWithoutKeymap.indexOf(form.type) === -1;
|
|
60
|
+
}).map(function (form) {
|
|
61
|
+
return form.autoFormatting && (0, _react2.jsx)("li", {
|
|
62
|
+
key: "autoFormatting-".concat(form.name),
|
|
63
|
+
css: _styles.row
|
|
64
|
+
}, (0, _react2.jsx)("span", null, form.name), form.autoFormatting());
|
|
65
|
+
}))))), (0, _react2.jsx)(_ModalFooter.default, null));
|
|
66
|
+
};
|
|
67
|
+
var _default = exports.default = ModalContent;
|
|
@@ -0,0 +1,26 @@
|
|
|
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 _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
|
+
var _reactIntlNext = require("react-intl-next");
|
|
11
|
+
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
12
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
|
+
var _styles = require("./styles");
|
|
14
|
+
var _utils = require("./utils");
|
|
15
|
+
/** @jsx jsx */
|
|
16
|
+
|
|
17
|
+
var ModalFooter = function ModalFooter() {
|
|
18
|
+
return (0, _react.jsx)("div", {
|
|
19
|
+
css: _styles.footer
|
|
20
|
+
}, (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.helpDialogMessages.helpDialogTips, {
|
|
21
|
+
values: {
|
|
22
|
+
keyMap: (0, _utils.getComponentFromKeymap)(_keymaps.openHelp)
|
|
23
|
+
}
|
|
24
|
+
})));
|
|
25
|
+
};
|
|
26
|
+
var _default = exports.default = ModalFooter;
|
|
@@ -0,0 +1,35 @@
|
|
|
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 _react = require("@emotion/react");
|
|
9
|
+
var _reactIntlNext = require("react-intl-next");
|
|
10
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
11
|
+
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
12
|
+
var _cross = _interopRequireDefault(require("@atlaskit/icon/glyph/cross"));
|
|
13
|
+
var _styles = require("./styles");
|
|
14
|
+
/** @jsx jsx */
|
|
15
|
+
|
|
16
|
+
var ModalHeader = (0, _reactIntlNext.injectIntl)(function (_ref) {
|
|
17
|
+
var formatMessage = _ref.intl.formatMessage,
|
|
18
|
+
onClose = _ref.onClose;
|
|
19
|
+
return (0, _react.jsx)("div", {
|
|
20
|
+
css: _styles.header
|
|
21
|
+
}, (0, _react.jsx)("h1", {
|
|
22
|
+
css: _styles.dialogHeader
|
|
23
|
+
}, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.helpDialogMessages.editorHelp)), (0, _react.jsx)("div", null, (0, _react.jsx)(_uiMenu.ToolbarButton
|
|
24
|
+
// @ts-expect-error modal onClose handler requires second parameter of UIAnalyticsEvent, which we don't want to pass
|
|
25
|
+
, {
|
|
26
|
+
onClick: onClose,
|
|
27
|
+
title: formatMessage(_messages.helpDialogMessages.closeHelpDialog),
|
|
28
|
+
spacing: "compact",
|
|
29
|
+
iconBefore: (0, _react.jsx)(_cross.default, {
|
|
30
|
+
label: formatMessage(_messages.helpDialogMessages.closeHelpDialog),
|
|
31
|
+
size: "medium"
|
|
32
|
+
})
|
|
33
|
+
})));
|
|
34
|
+
});
|
|
35
|
+
var _default = exports.default = ModalHeader;
|
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getSupportedFormatting = exports.formatting = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
|
+
var _reactIntlNext = require("react-intl-next");
|
|
11
|
+
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
12
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
|
+
var _styles = require("./styles");
|
|
16
|
+
/** @jsx jsx */
|
|
17
|
+
|
|
18
|
+
var navigationKeymaps = function navigationKeymaps(_ref) {
|
|
19
|
+
var formatMessage = _ref.formatMessage;
|
|
20
|
+
return [{
|
|
21
|
+
name: formatMessage(_messages.toolbarMessages.navigateToEditorToolbar),
|
|
22
|
+
type: 'navigation',
|
|
23
|
+
keymap: function keymap() {
|
|
24
|
+
return _keymaps.navToEditorToolbar;
|
|
25
|
+
}
|
|
26
|
+
}, {
|
|
27
|
+
name: formatMessage(_messages.toolbarMessages.navigateToFloatingToolbar),
|
|
28
|
+
type: 'navigation',
|
|
29
|
+
keymap: function keymap() {
|
|
30
|
+
return _keymaps.navToFloatingToolbar;
|
|
31
|
+
}
|
|
32
|
+
}];
|
|
33
|
+
};
|
|
34
|
+
var formatting = exports.formatting = function formatting(_ref2) {
|
|
35
|
+
var formatMessage = _ref2.formatMessage;
|
|
36
|
+
return [{
|
|
37
|
+
name: formatMessage(_messages.toolbarMessages.bold),
|
|
38
|
+
type: 'strong',
|
|
39
|
+
keymap: function keymap() {
|
|
40
|
+
return _keymaps.toggleBold;
|
|
41
|
+
},
|
|
42
|
+
autoFormatting: function autoFormatting() {
|
|
43
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
44
|
+
css: _styles.codeLg
|
|
45
|
+
}, "**", (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.toolbarMessages.bold), "**"));
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
name: formatMessage(_messages.toolbarMessages.italic),
|
|
49
|
+
type: 'em',
|
|
50
|
+
keymap: function keymap() {
|
|
51
|
+
return _keymaps.toggleItalic;
|
|
52
|
+
},
|
|
53
|
+
autoFormatting: function autoFormatting() {
|
|
54
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
55
|
+
css: _styles.codeLg
|
|
56
|
+
}, "*", (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.toolbarMessages.italic), "*"));
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
name: formatMessage(_messages.toolbarMessages.underline),
|
|
60
|
+
type: 'underline',
|
|
61
|
+
keymap: function keymap() {
|
|
62
|
+
return _keymaps.toggleUnderline;
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
name: formatMessage(_messages.toolbarMessages.strike),
|
|
66
|
+
type: 'strike',
|
|
67
|
+
keymap: function keymap() {
|
|
68
|
+
return _keymaps.toggleStrikethrough;
|
|
69
|
+
},
|
|
70
|
+
autoFormatting: function autoFormatting() {
|
|
71
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
72
|
+
css: _styles.codeLg
|
|
73
|
+
}, "~~", (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.toolbarMessages.strike), "~~"));
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
name: formatMessage(_messages.toolbarMessages.subscript),
|
|
77
|
+
type: 'subsup',
|
|
78
|
+
keymap: function keymap() {
|
|
79
|
+
return _keymaps.toggleSubscript;
|
|
80
|
+
}
|
|
81
|
+
}, {
|
|
82
|
+
name: formatMessage(_messages.toolbarMessages.superscript),
|
|
83
|
+
type: 'subsup',
|
|
84
|
+
keymap: function keymap() {
|
|
85
|
+
return _keymaps.toggleSuperscript;
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
name: formatMessage(_messages.blockTypeMessages.heading1),
|
|
89
|
+
type: 'heading',
|
|
90
|
+
keymap: function keymap() {
|
|
91
|
+
return _keymaps.toggleHeading1;
|
|
92
|
+
},
|
|
93
|
+
autoFormatting: function autoFormatting() {
|
|
94
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
95
|
+
css: _styles.codeSm
|
|
96
|
+
}, "#"), " ", (0, _react.jsx)("span", {
|
|
97
|
+
css: _styles.codeLg
|
|
98
|
+
}, "Space"));
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
name: formatMessage(_messages.blockTypeMessages.heading2),
|
|
102
|
+
type: 'heading',
|
|
103
|
+
keymap: function keymap() {
|
|
104
|
+
return _keymaps.toggleHeading2;
|
|
105
|
+
},
|
|
106
|
+
autoFormatting: function autoFormatting() {
|
|
107
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
108
|
+
css: _styles.codeLg
|
|
109
|
+
}, "##"), " ", (0, _react.jsx)("span", {
|
|
110
|
+
css: _styles.codeLg
|
|
111
|
+
}, "Space"));
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
name: formatMessage(_messages.blockTypeMessages.heading3),
|
|
115
|
+
type: 'heading',
|
|
116
|
+
keymap: function keymap() {
|
|
117
|
+
return _keymaps.toggleHeading3;
|
|
118
|
+
},
|
|
119
|
+
autoFormatting: function autoFormatting() {
|
|
120
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
121
|
+
css: _styles.codeLg
|
|
122
|
+
}, "###"), " ", (0, _react.jsx)("span", {
|
|
123
|
+
css: _styles.codeLg
|
|
124
|
+
}, "Space"));
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
name: formatMessage(_messages.blockTypeMessages.heading4),
|
|
128
|
+
type: 'heading',
|
|
129
|
+
keymap: function keymap() {
|
|
130
|
+
return _keymaps.toggleHeading4;
|
|
131
|
+
},
|
|
132
|
+
autoFormatting: function autoFormatting() {
|
|
133
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
134
|
+
css: _styles.codeLg
|
|
135
|
+
}, "####"), " ", (0, _react.jsx)("span", {
|
|
136
|
+
css: _styles.codeLg
|
|
137
|
+
}, "Space"));
|
|
138
|
+
}
|
|
139
|
+
}, {
|
|
140
|
+
name: formatMessage(_messages.blockTypeMessages.heading5),
|
|
141
|
+
type: 'heading',
|
|
142
|
+
keymap: function keymap() {
|
|
143
|
+
return _keymaps.toggleHeading5;
|
|
144
|
+
},
|
|
145
|
+
autoFormatting: function autoFormatting() {
|
|
146
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
147
|
+
css: _styles.codeLg
|
|
148
|
+
}, "#####"), " ", (0, _react.jsx)("span", {
|
|
149
|
+
css: _styles.codeLg
|
|
150
|
+
}, "Space"));
|
|
151
|
+
}
|
|
152
|
+
}, {
|
|
153
|
+
name: formatMessage(_messages.blockTypeMessages.heading6),
|
|
154
|
+
type: 'heading',
|
|
155
|
+
keymap: function keymap() {
|
|
156
|
+
return _keymaps.toggleHeading6;
|
|
157
|
+
},
|
|
158
|
+
autoFormatting: function autoFormatting() {
|
|
159
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
160
|
+
css: _styles.codeLg
|
|
161
|
+
}, "######"), " ", (0, _react.jsx)("span", {
|
|
162
|
+
css: _styles.codeLg
|
|
163
|
+
}, "Space"));
|
|
164
|
+
}
|
|
165
|
+
}, {
|
|
166
|
+
name: formatMessage(_messages.blockTypeMessages.normal),
|
|
167
|
+
type: 'paragraph',
|
|
168
|
+
keymap: function keymap() {
|
|
169
|
+
return _keymaps.setNormalText;
|
|
170
|
+
}
|
|
171
|
+
}, {
|
|
172
|
+
name: formatMessage(_messages.listMessages.orderedList),
|
|
173
|
+
type: 'orderedList',
|
|
174
|
+
keymap: function keymap() {
|
|
175
|
+
return _keymaps.toggleOrderedList;
|
|
176
|
+
},
|
|
177
|
+
autoFormatting: function autoFormatting() {
|
|
178
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
179
|
+
css: _styles.codeSm
|
|
180
|
+
}, "1."), " ", (0, _react.jsx)("span", {
|
|
181
|
+
css: _styles.codeLg
|
|
182
|
+
}, "Space"));
|
|
183
|
+
}
|
|
184
|
+
}, {
|
|
185
|
+
name: formatMessage(_messages.listMessages.unorderedList),
|
|
186
|
+
type: 'bulletList',
|
|
187
|
+
keymap: function keymap() {
|
|
188
|
+
return _keymaps.toggleBulletList;
|
|
189
|
+
},
|
|
190
|
+
autoFormatting: function autoFormatting() {
|
|
191
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
192
|
+
css: _styles.codeSm
|
|
193
|
+
}, "*"), " ", (0, _react.jsx)("span", {
|
|
194
|
+
css: _styles.codeLg
|
|
195
|
+
}, "Space"));
|
|
196
|
+
}
|
|
197
|
+
}, {
|
|
198
|
+
name: formatMessage(_messages.blockTypeMessages.blockquote),
|
|
199
|
+
type: 'blockquote',
|
|
200
|
+
keymap: function keymap() {
|
|
201
|
+
return _keymaps.toggleBlockQuote;
|
|
202
|
+
},
|
|
203
|
+
autoFormatting: function autoFormatting() {
|
|
204
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
205
|
+
css: _styles.codeLg
|
|
206
|
+
}, '>'), " ", (0, _react.jsx)("span", {
|
|
207
|
+
css: _styles.codeLg
|
|
208
|
+
}, "Space"));
|
|
209
|
+
}
|
|
210
|
+
}, {
|
|
211
|
+
name: formatMessage(_messages.blockTypeMessages.codeblock),
|
|
212
|
+
type: 'codeBlock',
|
|
213
|
+
autoFormatting: function autoFormatting() {
|
|
214
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
215
|
+
css: _styles.codeLg
|
|
216
|
+
}, "```"));
|
|
217
|
+
}
|
|
218
|
+
}, {
|
|
219
|
+
name: formatMessage(_messages.toolbarInsertBlockMessages.horizontalRule),
|
|
220
|
+
type: 'rule',
|
|
221
|
+
keymap: function keymap() {
|
|
222
|
+
return _keymaps.insertRule;
|
|
223
|
+
},
|
|
224
|
+
autoFormatting: function autoFormatting() {
|
|
225
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
226
|
+
css: _styles.codeLg
|
|
227
|
+
}, "---"));
|
|
228
|
+
}
|
|
229
|
+
}, {
|
|
230
|
+
name: formatMessage(_messages.toolbarInsertBlockMessages.link),
|
|
231
|
+
type: 'link',
|
|
232
|
+
keymap: function keymap() {
|
|
233
|
+
return _keymaps.addLink;
|
|
234
|
+
},
|
|
235
|
+
autoFormatting: function autoFormatting() {
|
|
236
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
237
|
+
css: _styles.codeLg
|
|
238
|
+
}, "[", (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.toolbarInsertBlockMessages.link), "](http://a.com)"));
|
|
239
|
+
}
|
|
240
|
+
}, {
|
|
241
|
+
name: formatMessage(_messages.toolbarMessages.code),
|
|
242
|
+
type: 'code',
|
|
243
|
+
keymap: function keymap() {
|
|
244
|
+
return _keymaps.toggleCode;
|
|
245
|
+
},
|
|
246
|
+
autoFormatting: function autoFormatting() {
|
|
247
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
248
|
+
css: _styles.codeLg
|
|
249
|
+
}, "`", (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.toolbarMessages.code), "`"));
|
|
250
|
+
}
|
|
251
|
+
}, {
|
|
252
|
+
name: formatMessage(_messages.toolbarInsertBlockMessages.action),
|
|
253
|
+
type: 'taskItem',
|
|
254
|
+
autoFormatting: function autoFormatting() {
|
|
255
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
256
|
+
css: _styles.codeSm
|
|
257
|
+
}, "[]"), " ", (0, _react.jsx)("span", {
|
|
258
|
+
css: _styles.codeLg
|
|
259
|
+
}, "Space"));
|
|
260
|
+
}
|
|
261
|
+
}, {
|
|
262
|
+
name: formatMessage(_messages.toolbarInsertBlockMessages.decision),
|
|
263
|
+
type: 'decisionItem',
|
|
264
|
+
autoFormatting: function autoFormatting() {
|
|
265
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
266
|
+
css: _styles.codeSm
|
|
267
|
+
}, "<>"), " ", (0, _react.jsx)("span", {
|
|
268
|
+
css: _styles.codeLg
|
|
269
|
+
}, "Space"));
|
|
270
|
+
}
|
|
271
|
+
}, {
|
|
272
|
+
name: formatMessage(_messages.toolbarInsertBlockMessages.emoji),
|
|
273
|
+
type: 'emoji',
|
|
274
|
+
autoFormatting: function autoFormatting() {
|
|
275
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
276
|
+
css: _styles.codeLg
|
|
277
|
+
}, ":"));
|
|
278
|
+
}
|
|
279
|
+
}, {
|
|
280
|
+
name: formatMessage(_messages.toolbarInsertBlockMessages.mention),
|
|
281
|
+
type: 'mention',
|
|
282
|
+
autoFormatting: function autoFormatting() {
|
|
283
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
284
|
+
css: _styles.codeLg
|
|
285
|
+
}, "@"));
|
|
286
|
+
}
|
|
287
|
+
}, {
|
|
288
|
+
name: formatMessage(_messages.alignmentMessages.alignLeft),
|
|
289
|
+
type: 'alignment',
|
|
290
|
+
keymap: function keymap() {
|
|
291
|
+
return _keymaps.alignLeft;
|
|
292
|
+
}
|
|
293
|
+
}].concat((0, _toConsumableArray2.default)((0, _platformFeatureFlags.getBooleanFF)('platform.editor.text-alignment-keyboard-shortcuts') ? [{
|
|
294
|
+
name: formatMessage(_messages.alignmentMessages.alignCenter),
|
|
295
|
+
type: 'alignment',
|
|
296
|
+
keymap: function keymap() {
|
|
297
|
+
return _keymaps.alignCenter;
|
|
298
|
+
}
|
|
299
|
+
}, {
|
|
300
|
+
name: formatMessage(_messages.alignmentMessages.alignRight),
|
|
301
|
+
type: 'alignment',
|
|
302
|
+
keymap: function keymap() {
|
|
303
|
+
return _keymaps.alignRight;
|
|
304
|
+
}
|
|
305
|
+
}] : []));
|
|
306
|
+
};
|
|
307
|
+
var otherFormatting = function otherFormatting(_ref3) {
|
|
308
|
+
var formatMessage = _ref3.formatMessage;
|
|
309
|
+
return [{
|
|
310
|
+
name: formatMessage(_messages.toolbarMessages.clearFormatting),
|
|
311
|
+
type: 'clearFormatting',
|
|
312
|
+
keymap: function keymap() {
|
|
313
|
+
return _keymaps.clearFormatting;
|
|
314
|
+
}
|
|
315
|
+
}, {
|
|
316
|
+
name: formatMessage(_messages.undoRedoMessages.undo),
|
|
317
|
+
type: 'undo',
|
|
318
|
+
keymap: function keymap() {
|
|
319
|
+
return _keymaps.undo;
|
|
320
|
+
}
|
|
321
|
+
}, {
|
|
322
|
+
name: formatMessage(_messages.undoRedoMessages.redo),
|
|
323
|
+
type: 'redo',
|
|
324
|
+
keymap: function keymap() {
|
|
325
|
+
return _keymaps.redo;
|
|
326
|
+
}
|
|
327
|
+
}, {
|
|
328
|
+
name: formatMessage(_messages.helpDialogMessages.pastePlainText),
|
|
329
|
+
type: 'paste',
|
|
330
|
+
keymap: function keymap() {
|
|
331
|
+
return _keymaps.pastePlainText;
|
|
332
|
+
}
|
|
333
|
+
}, {
|
|
334
|
+
name: formatMessage(_messages.annotationMessages.createComment),
|
|
335
|
+
type: 'annotation',
|
|
336
|
+
keymap: function keymap() {
|
|
337
|
+
return _keymaps.addInlineComment;
|
|
338
|
+
}
|
|
339
|
+
}, {
|
|
340
|
+
name: formatMessage(_messages.helpDialogMessages.CheckUncheckActionItem),
|
|
341
|
+
type: 'checkbox',
|
|
342
|
+
keymap: function keymap() {
|
|
343
|
+
return _keymaps.toggleTaskItemCheckbox;
|
|
344
|
+
}
|
|
345
|
+
}, {
|
|
346
|
+
name: formatMessage(_messages.helpDialogMessages.selectTableRow),
|
|
347
|
+
type: 'table',
|
|
348
|
+
autoFormatting: function autoFormatting() {
|
|
349
|
+
return (0, _react.jsx)("span", {
|
|
350
|
+
css: _styles.shortcutsArray
|
|
351
|
+
}, (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
352
|
+
css: _utils.browser.mac ? _styles.codeSm : _styles.codeMd
|
|
353
|
+
}, _utils.browser.mac ? '⌘' : 'Ctrl'), ' + ', (0, _react.jsx)("span", {
|
|
354
|
+
css: _styles.codeMd
|
|
355
|
+
}, _utils.browser.mac ? 'Opt' : 'Alt'), ' + ', (0, _react.jsx)("span", {
|
|
356
|
+
css: _styles.codeMd
|
|
357
|
+
}, "Shift"), ' + ', (0, _react.jsx)("span", {
|
|
358
|
+
css: _styles.codeSm
|
|
359
|
+
}, "\u2190")), (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
360
|
+
css: _utils.browser.mac ? _styles.codeSm : _styles.codeMd
|
|
361
|
+
}, _utils.browser.mac ? '⌘' : 'Ctrl'), ' + ', (0, _react.jsx)("span", {
|
|
362
|
+
css: _styles.codeMd
|
|
363
|
+
}, _utils.browser.mac ? 'Opt' : 'Alt'), ' + ', (0, _react.jsx)("span", {
|
|
364
|
+
css: _styles.codeMd
|
|
365
|
+
}, "Shift"), ' + ', (0, _react.jsx)("span", {
|
|
366
|
+
css: _styles.codeSm
|
|
367
|
+
}, "\u2192")));
|
|
368
|
+
}
|
|
369
|
+
}, {
|
|
370
|
+
name: formatMessage(_messages.helpDialogMessages.selectTableColumn),
|
|
371
|
+
type: 'table',
|
|
372
|
+
autoFormatting: function autoFormatting() {
|
|
373
|
+
return (0, _react.jsx)("span", {
|
|
374
|
+
css: _styles.shortcutsArray
|
|
375
|
+
}, (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
376
|
+
css: _utils.browser.mac ? _styles.codeSm : _styles.codeMd
|
|
377
|
+
}, _utils.browser.mac ? '⌘' : 'Ctrl'), ' + ', (0, _react.jsx)("span", {
|
|
378
|
+
css: _styles.codeMd
|
|
379
|
+
}, _utils.browser.mac ? 'Opt' : 'Alt'), ' + ', (0, _react.jsx)("span", {
|
|
380
|
+
css: _styles.codeMd
|
|
381
|
+
}, "Shift"), ' + ', (0, _react.jsx)("span", {
|
|
382
|
+
css: _styles.codeSm
|
|
383
|
+
}, "\u2191")), (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
384
|
+
css: _utils.browser.mac ? _styles.codeSm : _styles.codeMd
|
|
385
|
+
}, _utils.browser.mac ? '⌘' : 'Ctrl'), ' + ', (0, _react.jsx)("span", {
|
|
386
|
+
css: _styles.codeMd
|
|
387
|
+
}, _utils.browser.mac ? 'Opt' : 'Alt'), ' + ', (0, _react.jsx)("span", {
|
|
388
|
+
css: _styles.codeMd
|
|
389
|
+
}, "Shift"), ' + ', (0, _react.jsx)("span", {
|
|
390
|
+
css: _styles.codeSm
|
|
391
|
+
}, "\u2193")));
|
|
392
|
+
}
|
|
393
|
+
}].concat((0, _toConsumableArray2.default)((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-column-resizing_emcvz') ? [{
|
|
394
|
+
name: formatMessage(_messages.helpDialogMessages.selectColumnResize),
|
|
395
|
+
type: 'table',
|
|
396
|
+
autoFormatting: function autoFormatting() {
|
|
397
|
+
return (0, _react.jsx)("span", {
|
|
398
|
+
css: _styles.shortcutsArray
|
|
399
|
+
}, (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
400
|
+
css: _utils.browser.mac ? _styles.codeSm : _styles.codeMd
|
|
401
|
+
}, _utils.browser.mac ? '⌘' : 'Ctrl'), ' + ', (0, _react.jsx)("span", {
|
|
402
|
+
css: _styles.codeMd
|
|
403
|
+
}, _utils.browser.mac ? 'Opt' : 'Alt'), ' + ', (0, _react.jsx)("span", {
|
|
404
|
+
css: _styles.codeMd
|
|
405
|
+
}, "Shift"), ' + ', (0, _react.jsx)("span", {
|
|
406
|
+
css: _styles.codeSm
|
|
407
|
+
}, "C")));
|
|
408
|
+
}
|
|
409
|
+
}, {
|
|
410
|
+
name: formatMessage(_messages.helpDialogMessages.increaseColumnSize),
|
|
411
|
+
type: 'table',
|
|
412
|
+
autoFormatting: function autoFormatting() {
|
|
413
|
+
return (0, _react.jsx)("span", {
|
|
414
|
+
css: _styles.shortcutsArray
|
|
415
|
+
}, (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
416
|
+
css: _utils.browser.mac ? _styles.codeSm : _styles.codeMd
|
|
417
|
+
}, _utils.browser.mac ? '⌘' : 'Ctrl'), ' + ', (0, _react.jsx)("span", {
|
|
418
|
+
css: _styles.codeMd
|
|
419
|
+
}, _utils.browser.mac ? 'Opt' : 'Alt'), ' + ', (0, _react.jsx)("span", {
|
|
420
|
+
css: _styles.codeMd
|
|
421
|
+
}, "[")));
|
|
422
|
+
}
|
|
423
|
+
}, {
|
|
424
|
+
name: formatMessage(_messages.helpDialogMessages.decreaseColumnSize),
|
|
425
|
+
type: 'table',
|
|
426
|
+
autoFormatting: function autoFormatting() {
|
|
427
|
+
return (0, _react.jsx)("span", {
|
|
428
|
+
css: _styles.shortcutsArray
|
|
429
|
+
}, (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
430
|
+
css: _utils.browser.mac ? _styles.codeSm : _styles.codeMd
|
|
431
|
+
}, _utils.browser.mac ? '⌘' : 'Ctrl'), ' + ', (0, _react.jsx)("span", {
|
|
432
|
+
css: _styles.codeMd
|
|
433
|
+
}, _utils.browser.mac ? 'Opt' : 'Alt'), ' + ', (0, _react.jsx)("span", {
|
|
434
|
+
css: _styles.codeMd
|
|
435
|
+
}, "]")));
|
|
436
|
+
}
|
|
437
|
+
}] : []));
|
|
438
|
+
};
|
|
439
|
+
var resizeInformationFormatting = function resizeInformationFormatting(_ref4) {
|
|
440
|
+
var formatMessage = _ref4.formatMessage;
|
|
441
|
+
return [{
|
|
442
|
+
name: formatMessage(_messages.helpDialogMessages.increaseSize),
|
|
443
|
+
type: 'media',
|
|
444
|
+
keymap: function keymap() {
|
|
445
|
+
return _keymaps.increaseMediaSize;
|
|
446
|
+
}
|
|
447
|
+
}, {
|
|
448
|
+
name: formatMessage(_messages.helpDialogMessages.decreaseSize),
|
|
449
|
+
type: 'media',
|
|
450
|
+
keymap: function keymap() {
|
|
451
|
+
return _keymaps.decreaseMediaSize;
|
|
452
|
+
}
|
|
453
|
+
}];
|
|
454
|
+
};
|
|
455
|
+
var focusTableResizeHandleFormatting = function focusTableResizeHandleFormatting(_ref5) {
|
|
456
|
+
var formatMessage = _ref5.formatMessage;
|
|
457
|
+
return [{
|
|
458
|
+
name: formatMessage(_messages.helpDialogMessages.focusTableResizeHandle),
|
|
459
|
+
type: 'navigation',
|
|
460
|
+
keymap: function keymap() {
|
|
461
|
+
return _keymaps.focusTableResizer;
|
|
462
|
+
}
|
|
463
|
+
}];
|
|
464
|
+
};
|
|
465
|
+
var imageAutoFormat = {
|
|
466
|
+
name: 'Image',
|
|
467
|
+
type: 'image',
|
|
468
|
+
autoFormatting: function autoFormatting() {
|
|
469
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
470
|
+
css: _styles.codeLg
|
|
471
|
+
}, ""));
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
var quickInsertAutoFormat = function quickInsertAutoFormat(_ref6) {
|
|
475
|
+
var formatMessage = _ref6.formatMessage;
|
|
476
|
+
return {
|
|
477
|
+
name: formatMessage(_messages.helpDialogMessages.quickInsert),
|
|
478
|
+
type: 'quickInsert',
|
|
479
|
+
autoFormatting: function autoFormatting() {
|
|
480
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)("span", {
|
|
481
|
+
css: _styles.codeLg
|
|
482
|
+
}, "/"));
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
};
|
|
486
|
+
var isAnyA11yResizeFeatureFlagEnabled = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-media-resizing_b5v0o') || (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-resizing_uapcv');
|
|
487
|
+
var getSupportedFormatting = exports.getSupportedFormatting = function getSupportedFormatting(schema, intl, imageEnabled, quickInsertEnabled) {
|
|
488
|
+
var supportedBySchema = formatting(intl).filter(function (format) {
|
|
489
|
+
return schema.nodes[format.type] || schema.marks[format.type];
|
|
490
|
+
});
|
|
491
|
+
return [].concat((0, _toConsumableArray2.default)(navigationKeymaps(intl)), (0, _toConsumableArray2.default)(supportedBySchema), (0, _toConsumableArray2.default)(imageEnabled ? [imageAutoFormat] : []), (0, _toConsumableArray2.default)(quickInsertEnabled ? [quickInsertAutoFormat(intl)] : []), (0, _toConsumableArray2.default)(otherFormatting(intl)), (0, _toConsumableArray2.default)(isAnyA11yResizeFeatureFlagEnabled ? resizeInformationFormatting(intl) : []), (0, _toConsumableArray2.default)((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-resizing_uapcv') ? focusTableResizeHandleFormatting(intl) : []));
|
|
492
|
+
};
|