@atlaskit/editor-plugin-help-dialog 8.0.32 → 9.0.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 +18 -0
- package/dist/cjs/ui/ModalContent.js +1 -1
- package/dist/cjs/ui/formatting.js +45 -7
- package/dist/cjs/ui/utils.js +17 -2
- package/dist/es2019/ui/ModalContent.js +2 -2
- package/dist/es2019/ui/formatting.js +31 -4
- package/dist/es2019/ui/utils.js +18 -3
- package/dist/esm/ui/ModalContent.js +2 -2
- package/dist/esm/ui/formatting.js +47 -9
- package/dist/esm/ui/utils.js +18 -3
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-help-dialog
|
|
2
2
|
|
|
3
|
+
## 9.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d15da1c489b34`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d15da1c489b34) -
|
|
8
|
+
Add drag handle and move selection keyboard shortcuts to the editor help dialog, gated behind the
|
|
9
|
+
platform_editor_drag_handle_keyboard_a11y experiment
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 8.0.33
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`73b2fc243f544`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/73b2fc243f544) -
|
|
17
|
+
Cleaning up getBrowserInfo which was behind experiment platform_editor_hydratable_ui and is now
|
|
18
|
+
rolled out
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 8.0.32
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -28,7 +28,7 @@ var _utils = require("./utils");
|
|
|
28
28
|
var ModalContent = exports.ModalContent = function ModalContent(_ref) {
|
|
29
29
|
var formatting = _ref.formatting,
|
|
30
30
|
onClose = _ref.onClose;
|
|
31
|
-
var browser = (0,
|
|
31
|
+
var browser = (0, _browser.getBrowserInfo)();
|
|
32
32
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
33
33
|
var isA11yFixEnabled = (0, _expValEquals.expValEquals)('platform_editor_a11y_eslint_fix', 'isEnabled', true);
|
|
34
34
|
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_ModalHeader.default, {
|
|
@@ -403,7 +403,7 @@ var quickInsertAskAI = function quickInsertAskAI(_ref3) {
|
|
|
403
403
|
};
|
|
404
404
|
var otherFormatting = function otherFormatting(_ref4) {
|
|
405
405
|
var formatMessage = _ref4.formatMessage;
|
|
406
|
-
var browser = (0,
|
|
406
|
+
var browser = (0, _browser.getBrowserInfo)();
|
|
407
407
|
return [{
|
|
408
408
|
name: formatMessage(_messages.toolbarMessages.clearFormatting),
|
|
409
409
|
type: 'clearFormatting',
|
|
@@ -641,8 +641,46 @@ var focusTableResizeHandleFormatting = function focusTableResizeHandleFormatting
|
|
|
641
641
|
}
|
|
642
642
|
}];
|
|
643
643
|
};
|
|
644
|
-
|
|
644
|
+
|
|
645
|
+
// 'navigation' is used as the type for these entries because Format.type is designed to match ADF
|
|
646
|
+
// schema node/mark names — these shortcuts have no corresponding ADF type, so 'navigation' acts as
|
|
647
|
+
// a catch-all that passes the schema filter and routes entries to the keyboard shortcuts column in the UI.
|
|
648
|
+
var blockControlsShortcutsFormatting = function blockControlsShortcutsFormatting(_ref8) {
|
|
645
649
|
var formatMessage = _ref8.formatMessage;
|
|
650
|
+
return [{
|
|
651
|
+
name: formatMessage(_messages.helpDialogMessages.selectDragHandle),
|
|
652
|
+
type: 'navigation',
|
|
653
|
+
keymap: function keymap() {
|
|
654
|
+
return _keymaps.showElementDragHandle;
|
|
655
|
+
}
|
|
656
|
+
}, {
|
|
657
|
+
name: formatMessage(_messages.helpDialogMessages.moveSelectionUp),
|
|
658
|
+
type: 'navigation',
|
|
659
|
+
keymap: function keymap() {
|
|
660
|
+
return _keymaps.dragToMoveUp;
|
|
661
|
+
}
|
|
662
|
+
}, {
|
|
663
|
+
name: formatMessage(_messages.helpDialogMessages.moveSelectionDown),
|
|
664
|
+
type: 'navigation',
|
|
665
|
+
keymap: function keymap() {
|
|
666
|
+
return _keymaps.dragToMoveDown;
|
|
667
|
+
}
|
|
668
|
+
}, {
|
|
669
|
+
name: formatMessage(_messages.helpDialogMessages.moveSelectionLeft),
|
|
670
|
+
type: 'navigation',
|
|
671
|
+
keymap: function keymap() {
|
|
672
|
+
return _keymaps.dragToMoveLeft;
|
|
673
|
+
}
|
|
674
|
+
}, {
|
|
675
|
+
name: formatMessage(_messages.helpDialogMessages.moveSelectionRight),
|
|
676
|
+
type: 'navigation',
|
|
677
|
+
keymap: function keymap() {
|
|
678
|
+
return _keymaps.dragToMoveRight;
|
|
679
|
+
}
|
|
680
|
+
}];
|
|
681
|
+
};
|
|
682
|
+
var moveTableRowColumnFormatting = function moveTableRowColumnFormatting(_ref9) {
|
|
683
|
+
var formatMessage = _ref9.formatMessage;
|
|
646
684
|
return [{
|
|
647
685
|
name: formatMessage(_messages.tableMessages.moveColumnLeftHelpDialogLabel),
|
|
648
686
|
type: 'table',
|
|
@@ -669,8 +707,8 @@ var moveTableRowColumnFormatting = function moveTableRowColumnFormatting(_ref8)
|
|
|
669
707
|
}
|
|
670
708
|
}];
|
|
671
709
|
};
|
|
672
|
-
var openCellOptionsFormattingtoFormat = function openCellOptionsFormattingtoFormat(
|
|
673
|
-
var formatMessage =
|
|
710
|
+
var openCellOptionsFormattingtoFormat = function openCellOptionsFormattingtoFormat(_ref0) {
|
|
711
|
+
var formatMessage = _ref0.formatMessage;
|
|
674
712
|
return [{
|
|
675
713
|
name: formatMessage(_messages.helpDialogMessages.openCellOptions),
|
|
676
714
|
type: 'image',
|
|
@@ -692,8 +730,8 @@ var imageAutoFormat = {
|
|
|
692
730
|
, _messages.helpDialogMessages.altText), "](http://www.image.com)"));
|
|
693
731
|
}
|
|
694
732
|
};
|
|
695
|
-
var quickInsertAutoFormat = function quickInsertAutoFormat(
|
|
696
|
-
var formatMessage =
|
|
733
|
+
var quickInsertAutoFormat = function quickInsertAutoFormat(_ref1) {
|
|
734
|
+
var formatMessage = _ref1.formatMessage;
|
|
697
735
|
return {
|
|
698
736
|
name: formatMessage(_messages.helpDialogMessages.quickInsert),
|
|
699
737
|
type: 'quickInsert',
|
|
@@ -709,5 +747,5 @@ var getSupportedFormatting = exports.getSupportedFormatting = function getSuppor
|
|
|
709
747
|
var supportedBySchema = formatting(intl).filter(function (format) {
|
|
710
748
|
return schema.nodes[format.type] || schema.marks[format.type];
|
|
711
749
|
});
|
|
712
|
-
return [].concat((0, _toConsumableArray2.default)(aiEnabled && (0, _experiments.editorExperiment)('platform_editor_ai_quickstart_command', true) ? [quickInsertAskAI(intl)] : []), (0, _toConsumableArray2.default)(navigationKeymaps(intl)), (0, _toConsumableArray2.default)(otherFormatting(intl)), (0, _toConsumableArray2.default)(supportedBySchema), (0, _toConsumableArray2.default)(imageEnabled ? [imageAutoFormat] : []), (0, _toConsumableArray2.default)(quickInsertEnabled ? [quickInsertAutoFormat(intl)] : []), (0, _toConsumableArray2.default)(focusTableResizeHandleFormatting(intl)), (0, _toConsumableArray2.default)((0, _experiments.editorExperiment)('platform_editor_breakout_resizing', true) ? newResizeInformationFormatting(intl) : resizeInformationFormatting(intl)), (0, _toConsumableArray2.default)(openCellOptionsFormattingtoFormat(intl)), (0, _toConsumableArray2.default)((0, _expValEquals.expValEquals)('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true) ? moveTableRowColumnFormatting(intl) : []));
|
|
750
|
+
return [].concat((0, _toConsumableArray2.default)(aiEnabled && (0, _experiments.editorExperiment)('platform_editor_ai_quickstart_command', true) ? [quickInsertAskAI(intl)] : []), (0, _toConsumableArray2.default)(navigationKeymaps(intl)), (0, _toConsumableArray2.default)(otherFormatting(intl)), (0, _toConsumableArray2.default)(supportedBySchema), (0, _toConsumableArray2.default)((0, _expValEquals.expValEquals)('platform_editor_drag_handle_keyboard_a11y', 'isEnabled', true) ? blockControlsShortcutsFormatting(intl) : []), (0, _toConsumableArray2.default)(imageEnabled ? [imageAutoFormat] : []), (0, _toConsumableArray2.default)(quickInsertEnabled ? [quickInsertAutoFormat(intl)] : []), (0, _toConsumableArray2.default)(focusTableResizeHandleFormatting(intl)), (0, _toConsumableArray2.default)((0, _experiments.editorExperiment)('platform_editor_breakout_resizing', true) ? newResizeInformationFormatting(intl) : resizeInformationFormatting(intl)), (0, _toConsumableArray2.default)(openCellOptionsFormattingtoFormat(intl)), (0, _toConsumableArray2.default)((0, _expValEquals.expValEquals)('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true) ? moveTableRowColumnFormatting(intl) : []));
|
|
713
751
|
};
|
package/dist/cjs/ui/utils.js
CHANGED
|
@@ -7,7 +7,6 @@ exports.shortcutNamesWithoutKeymap = exports.getComponentFromKeymap = void 0;
|
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _browser = require("@atlaskit/editor-common/browser");
|
|
9
9
|
var _primitives = require("@atlaskit/primitives");
|
|
10
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
10
|
var _styles = require("./styles");
|
|
12
11
|
/**
|
|
13
12
|
* @jsxRuntime classic
|
|
@@ -44,8 +43,14 @@ var codeSm = (0, _primitives.xcss)({
|
|
|
44
43
|
lineHeight: "var(--ds-space-300, 24px)",
|
|
45
44
|
textAlign: 'center'
|
|
46
45
|
});
|
|
46
|
+
var arrowSymbols = {
|
|
47
|
+
arrowup: '↑',
|
|
48
|
+
arrowdown: '↓',
|
|
49
|
+
arrowleft: '←',
|
|
50
|
+
arrowright: '→'
|
|
51
|
+
};
|
|
47
52
|
var getKeyParts = function getKeyParts(keymap) {
|
|
48
|
-
var browser = (0,
|
|
53
|
+
var browser = (0, _browser.getBrowserInfo)();
|
|
49
54
|
var shortcut = keymap[browser.mac ? 'mac' : 'windows'];
|
|
50
55
|
if (browser.mac) {
|
|
51
56
|
shortcut = shortcut.replace('Alt', 'Opt');
|
|
@@ -113,6 +118,16 @@ var getComponentFromKeymap = exports.getComponentFromKeymap = function getCompon
|
|
|
113
118
|
,
|
|
114
119
|
key: "".concat(keyParts, "-").concat(index)
|
|
115
120
|
}, '⏎');
|
|
121
|
+
} else if (['arrowup', 'arrowdown', 'arrowleft', 'arrowright'].indexOf(part.toLowerCase()) >= 0) {
|
|
122
|
+
return (
|
|
123
|
+
// Ignored via go/ees005
|
|
124
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
125
|
+
(0, _react.jsx)(_primitives.Box, {
|
|
126
|
+
as: "span",
|
|
127
|
+
xcss: codeSm,
|
|
128
|
+
key: "".concat(keyParts, "-").concat(index)
|
|
129
|
+
}, arrowSymbols[part.toLowerCase()])
|
|
130
|
+
);
|
|
116
131
|
}
|
|
117
132
|
return (
|
|
118
133
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
@@ -8,7 +8,7 @@ import { Fragment } from 'react';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
10
10
|
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
11
|
-
import {
|
|
11
|
+
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
12
12
|
import { helpDialogMessages as messages } from '@atlaskit/editor-common/messages';
|
|
13
13
|
import Heading from '@atlaskit/heading';
|
|
14
14
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
@@ -21,7 +21,7 @@ export const ModalContent = ({
|
|
|
21
21
|
formatting,
|
|
22
22
|
onClose
|
|
23
23
|
}) => {
|
|
24
|
-
const browser =
|
|
24
|
+
const browser = getBrowserInfo();
|
|
25
25
|
const intl = useIntl();
|
|
26
26
|
const isA11yFixEnabled = expValEquals('platform_editor_a11y_eslint_fix', 'isEnabled', true);
|
|
27
27
|
return jsx(Fragment, null, jsx(ModalHeader, {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
|
-
import {
|
|
9
|
-
import { addInlineComment, addLink, alignCenter, alignLeft, alignRight, askAIQuickInsert, clearFormatting, decreaseMediaSize, focusTableResizer, focusToContextMenuTrigger, increaseMediaSize, insertRule, moveColumnLeft, moveColumnRight, moveRowDown, moveRowUp, navToEditorToolbar, navToFloatingToolbar, pastePlainText, redoAlt, setNormalText, toggleBlockQuote, toggleBold, toggleBulletList, toggleCode, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleSmallText, toggleHighlightPalette, toggleItalic, toggleOrderedList, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleTaskItemCheckbox, toggleUnderline, undo } from '@atlaskit/editor-common/keymaps';
|
|
8
|
+
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
9
|
+
import { addInlineComment, addLink, alignCenter, alignLeft, alignRight, askAIQuickInsert, clearFormatting, decreaseMediaSize, dragToMoveDown, dragToMoveLeft, dragToMoveRight, dragToMoveUp, focusTableResizer, showElementDragHandle, focusToContextMenuTrigger, increaseMediaSize, insertRule, moveColumnLeft, moveColumnRight, moveRowDown, moveRowUp, navToEditorToolbar, navToFloatingToolbar, pastePlainText, redoAlt, setNormalText, toggleBlockQuote, toggleBold, toggleBulletList, toggleCode, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleSmallText, toggleHighlightPalette, toggleItalic, toggleOrderedList, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleTaskItemCheckbox, toggleUnderline, undo } from '@atlaskit/editor-common/keymaps';
|
|
10
10
|
import { alignmentMessages, annotationMessages, blockTypeMessages, listMessages, helpDialogMessages as messages, tableMessages, toolbarInsertBlockMessages, toolbarMessages, undoRedoMessages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
12
12
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
@@ -299,7 +299,7 @@ const quickInsertAskAI = ({
|
|
|
299
299
|
const otherFormatting = ({
|
|
300
300
|
formatMessage
|
|
301
301
|
}) => {
|
|
302
|
-
const browser =
|
|
302
|
+
const browser = getBrowserInfo();
|
|
303
303
|
return [{
|
|
304
304
|
name: formatMessage(toolbarMessages.clearFormatting),
|
|
305
305
|
type: 'clearFormatting',
|
|
@@ -495,6 +495,33 @@ const focusTableResizeHandleFormatting = ({
|
|
|
495
495
|
type: 'navigation',
|
|
496
496
|
keymap: () => focusTableResizer
|
|
497
497
|
}];
|
|
498
|
+
|
|
499
|
+
// 'navigation' is used as the type for these entries because Format.type is designed to match ADF
|
|
500
|
+
// schema node/mark names — these shortcuts have no corresponding ADF type, so 'navigation' acts as
|
|
501
|
+
// a catch-all that passes the schema filter and routes entries to the keyboard shortcuts column in the UI.
|
|
502
|
+
const blockControlsShortcutsFormatting = ({
|
|
503
|
+
formatMessage
|
|
504
|
+
}) => [{
|
|
505
|
+
name: formatMessage(messages.selectDragHandle),
|
|
506
|
+
type: 'navigation',
|
|
507
|
+
keymap: () => showElementDragHandle
|
|
508
|
+
}, {
|
|
509
|
+
name: formatMessage(messages.moveSelectionUp),
|
|
510
|
+
type: 'navigation',
|
|
511
|
+
keymap: () => dragToMoveUp
|
|
512
|
+
}, {
|
|
513
|
+
name: formatMessage(messages.moveSelectionDown),
|
|
514
|
+
type: 'navigation',
|
|
515
|
+
keymap: () => dragToMoveDown
|
|
516
|
+
}, {
|
|
517
|
+
name: formatMessage(messages.moveSelectionLeft),
|
|
518
|
+
type: 'navigation',
|
|
519
|
+
keymap: () => dragToMoveLeft
|
|
520
|
+
}, {
|
|
521
|
+
name: formatMessage(messages.moveSelectionRight),
|
|
522
|
+
type: 'navigation',
|
|
523
|
+
keymap: () => dragToMoveRight
|
|
524
|
+
}];
|
|
498
525
|
const moveTableRowColumnFormatting = ({
|
|
499
526
|
formatMessage
|
|
500
527
|
}) => [{
|
|
@@ -544,5 +571,5 @@ const quickInsertAutoFormat = ({
|
|
|
544
571
|
});
|
|
545
572
|
export const getSupportedFormatting = (schema, intl, imageEnabled, quickInsertEnabled, aiEnabled) => {
|
|
546
573
|
const supportedBySchema = formatting(intl).filter(format => schema.nodes[format.type] || schema.marks[format.type]);
|
|
547
|
-
return [...(aiEnabled && editorExperiment('platform_editor_ai_quickstart_command', true) ? [quickInsertAskAI(intl)] : []), ...navigationKeymaps(intl), ...otherFormatting(intl), ...supportedBySchema, ...(imageEnabled ? [imageAutoFormat] : []), ...(quickInsertEnabled ? [quickInsertAutoFormat(intl)] : []), ...focusTableResizeHandleFormatting(intl), ...(editorExperiment('platform_editor_breakout_resizing', true) ? newResizeInformationFormatting(intl) : resizeInformationFormatting(intl)), ...openCellOptionsFormattingtoFormat(intl), ...(expValEquals('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true) ? moveTableRowColumnFormatting(intl) : [])];
|
|
574
|
+
return [...(aiEnabled && editorExperiment('platform_editor_ai_quickstart_command', true) ? [quickInsertAskAI(intl)] : []), ...navigationKeymaps(intl), ...otherFormatting(intl), ...supportedBySchema, ...(expValEquals('platform_editor_drag_handle_keyboard_a11y', 'isEnabled', true) ? blockControlsShortcutsFormatting(intl) : []), ...(imageEnabled ? [imageAutoFormat] : []), ...(quickInsertEnabled ? [quickInsertAutoFormat(intl)] : []), ...focusTableResizeHandleFormatting(intl), ...(editorExperiment('platform_editor_breakout_resizing', true) ? newResizeInformationFormatting(intl) : resizeInformationFormatting(intl)), ...openCellOptionsFormattingtoFormat(intl), ...(expValEquals('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true) ? moveTableRowColumnFormatting(intl) : [])];
|
|
548
575
|
};
|
package/dist/es2019/ui/utils.js
CHANGED
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
|
-
import {
|
|
7
|
+
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
8
8
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
9
9
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
10
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
10
|
import { componentFromKeymapWrapperStyles } from './styles';
|
|
12
11
|
const codeLg = xcss({
|
|
13
12
|
borderRadius: 'radius.small',
|
|
@@ -36,8 +35,14 @@ const codeSm = xcss({
|
|
|
36
35
|
lineHeight: "var(--ds-space-300, 24px)",
|
|
37
36
|
textAlign: 'center'
|
|
38
37
|
});
|
|
38
|
+
const arrowSymbols = {
|
|
39
|
+
arrowup: '↑',
|
|
40
|
+
arrowdown: '↓',
|
|
41
|
+
arrowleft: '←',
|
|
42
|
+
arrowright: '→'
|
|
43
|
+
};
|
|
39
44
|
const getKeyParts = keymap => {
|
|
40
|
-
const browser =
|
|
45
|
+
const browser = getBrowserInfo();
|
|
41
46
|
let shortcut = keymap[browser.mac ? 'mac' : 'windows'];
|
|
42
47
|
if (browser.mac) {
|
|
43
48
|
shortcut = shortcut.replace('Alt', 'Opt');
|
|
@@ -105,6 +110,16 @@ export const getComponentFromKeymap = keymap => {
|
|
|
105
110
|
,
|
|
106
111
|
key: `${keyParts}-${index}`
|
|
107
112
|
}, '⏎');
|
|
113
|
+
} else if (['arrowup', 'arrowdown', 'arrowleft', 'arrowright'].indexOf(part.toLowerCase()) >= 0) {
|
|
114
|
+
return (
|
|
115
|
+
// Ignored via go/ees005
|
|
116
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
117
|
+
jsx(Box, {
|
|
118
|
+
as: "span",
|
|
119
|
+
xcss: codeSm,
|
|
120
|
+
key: `${keyParts}-${index}`
|
|
121
|
+
}, arrowSymbols[part.toLowerCase()])
|
|
122
|
+
);
|
|
108
123
|
}
|
|
109
124
|
return (
|
|
110
125
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
@@ -8,7 +8,7 @@ import { Fragment } from 'react';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
10
10
|
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
11
|
-
import {
|
|
11
|
+
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
12
12
|
import { helpDialogMessages as messages } from '@atlaskit/editor-common/messages';
|
|
13
13
|
import Heading from '@atlaskit/heading';
|
|
14
14
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
@@ -20,7 +20,7 @@ import { getComponentFromKeymap, shortcutNamesWithoutKeymap } from './utils';
|
|
|
20
20
|
export var ModalContent = function ModalContent(_ref) {
|
|
21
21
|
var formatting = _ref.formatting,
|
|
22
22
|
onClose = _ref.onClose;
|
|
23
|
-
var browser =
|
|
23
|
+
var browser = getBrowserInfo();
|
|
24
24
|
var intl = useIntl();
|
|
25
25
|
var isA11yFixEnabled = expValEquals('platform_editor_a11y_eslint_fix', 'isEnabled', true);
|
|
26
26
|
return jsx(Fragment, null, jsx(ModalHeader, {
|
|
@@ -6,8 +6,8 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
8
|
import { FormattedMessage } from 'react-intl-next';
|
|
9
|
-
import {
|
|
10
|
-
import { addInlineComment, addLink, alignCenter, alignLeft, alignRight, askAIQuickInsert, clearFormatting, decreaseMediaSize, focusTableResizer, focusToContextMenuTrigger, increaseMediaSize, insertRule, moveColumnLeft, moveColumnRight, moveRowDown, moveRowUp, navToEditorToolbar, navToFloatingToolbar, pastePlainText, redoAlt, setNormalText, toggleBlockQuote, toggleBold, toggleBulletList, toggleCode, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleSmallText, toggleHighlightPalette, toggleItalic, toggleOrderedList, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleTaskItemCheckbox, toggleUnderline, undo } from '@atlaskit/editor-common/keymaps';
|
|
9
|
+
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
10
|
+
import { addInlineComment, addLink, alignCenter, alignLeft, alignRight, askAIQuickInsert, clearFormatting, decreaseMediaSize, dragToMoveDown, dragToMoveLeft, dragToMoveRight, dragToMoveUp, focusTableResizer, showElementDragHandle, focusToContextMenuTrigger, increaseMediaSize, insertRule, moveColumnLeft, moveColumnRight, moveRowDown, moveRowUp, navToEditorToolbar, navToFloatingToolbar, pastePlainText, redoAlt, setNormalText, toggleBlockQuote, toggleBold, toggleBulletList, toggleCode, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleSmallText, toggleHighlightPalette, toggleItalic, toggleOrderedList, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleTaskItemCheckbox, toggleUnderline, undo } from '@atlaskit/editor-common/keymaps';
|
|
11
11
|
import { alignmentMessages, annotationMessages, blockTypeMessages, listMessages, helpDialogMessages as messages, tableMessages, toolbarInsertBlockMessages, toolbarMessages, undoRedoMessages } from '@atlaskit/editor-common/messages';
|
|
12
12
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
13
13
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
@@ -394,7 +394,7 @@ var quickInsertAskAI = function quickInsertAskAI(_ref3) {
|
|
|
394
394
|
};
|
|
395
395
|
var otherFormatting = function otherFormatting(_ref4) {
|
|
396
396
|
var formatMessage = _ref4.formatMessage;
|
|
397
|
-
var browser =
|
|
397
|
+
var browser = getBrowserInfo();
|
|
398
398
|
return [{
|
|
399
399
|
name: formatMessage(toolbarMessages.clearFormatting),
|
|
400
400
|
type: 'clearFormatting',
|
|
@@ -632,8 +632,46 @@ var focusTableResizeHandleFormatting = function focusTableResizeHandleFormatting
|
|
|
632
632
|
}
|
|
633
633
|
}];
|
|
634
634
|
};
|
|
635
|
-
|
|
635
|
+
|
|
636
|
+
// 'navigation' is used as the type for these entries because Format.type is designed to match ADF
|
|
637
|
+
// schema node/mark names — these shortcuts have no corresponding ADF type, so 'navigation' acts as
|
|
638
|
+
// a catch-all that passes the schema filter and routes entries to the keyboard shortcuts column in the UI.
|
|
639
|
+
var blockControlsShortcutsFormatting = function blockControlsShortcutsFormatting(_ref8) {
|
|
636
640
|
var formatMessage = _ref8.formatMessage;
|
|
641
|
+
return [{
|
|
642
|
+
name: formatMessage(messages.selectDragHandle),
|
|
643
|
+
type: 'navigation',
|
|
644
|
+
keymap: function keymap() {
|
|
645
|
+
return showElementDragHandle;
|
|
646
|
+
}
|
|
647
|
+
}, {
|
|
648
|
+
name: formatMessage(messages.moveSelectionUp),
|
|
649
|
+
type: 'navigation',
|
|
650
|
+
keymap: function keymap() {
|
|
651
|
+
return dragToMoveUp;
|
|
652
|
+
}
|
|
653
|
+
}, {
|
|
654
|
+
name: formatMessage(messages.moveSelectionDown),
|
|
655
|
+
type: 'navigation',
|
|
656
|
+
keymap: function keymap() {
|
|
657
|
+
return dragToMoveDown;
|
|
658
|
+
}
|
|
659
|
+
}, {
|
|
660
|
+
name: formatMessage(messages.moveSelectionLeft),
|
|
661
|
+
type: 'navigation',
|
|
662
|
+
keymap: function keymap() {
|
|
663
|
+
return dragToMoveLeft;
|
|
664
|
+
}
|
|
665
|
+
}, {
|
|
666
|
+
name: formatMessage(messages.moveSelectionRight),
|
|
667
|
+
type: 'navigation',
|
|
668
|
+
keymap: function keymap() {
|
|
669
|
+
return dragToMoveRight;
|
|
670
|
+
}
|
|
671
|
+
}];
|
|
672
|
+
};
|
|
673
|
+
var moveTableRowColumnFormatting = function moveTableRowColumnFormatting(_ref9) {
|
|
674
|
+
var formatMessage = _ref9.formatMessage;
|
|
637
675
|
return [{
|
|
638
676
|
name: formatMessage(tableMessages.moveColumnLeftHelpDialogLabel),
|
|
639
677
|
type: 'table',
|
|
@@ -660,8 +698,8 @@ var moveTableRowColumnFormatting = function moveTableRowColumnFormatting(_ref8)
|
|
|
660
698
|
}
|
|
661
699
|
}];
|
|
662
700
|
};
|
|
663
|
-
var openCellOptionsFormattingtoFormat = function openCellOptionsFormattingtoFormat(
|
|
664
|
-
var formatMessage =
|
|
701
|
+
var openCellOptionsFormattingtoFormat = function openCellOptionsFormattingtoFormat(_ref0) {
|
|
702
|
+
var formatMessage = _ref0.formatMessage;
|
|
665
703
|
return [{
|
|
666
704
|
name: formatMessage(messages.openCellOptions),
|
|
667
705
|
type: 'image',
|
|
@@ -683,8 +721,8 @@ var imageAutoFormat = {
|
|
|
683
721
|
, messages.altText), "](http://www.image.com)"));
|
|
684
722
|
}
|
|
685
723
|
};
|
|
686
|
-
var quickInsertAutoFormat = function quickInsertAutoFormat(
|
|
687
|
-
var formatMessage =
|
|
724
|
+
var quickInsertAutoFormat = function quickInsertAutoFormat(_ref1) {
|
|
725
|
+
var formatMessage = _ref1.formatMessage;
|
|
688
726
|
return {
|
|
689
727
|
name: formatMessage(messages.quickInsert),
|
|
690
728
|
type: 'quickInsert',
|
|
@@ -700,5 +738,5 @@ export var getSupportedFormatting = function getSupportedFormatting(schema, intl
|
|
|
700
738
|
var supportedBySchema = formatting(intl).filter(function (format) {
|
|
701
739
|
return schema.nodes[format.type] || schema.marks[format.type];
|
|
702
740
|
});
|
|
703
|
-
return [].concat(_toConsumableArray(aiEnabled && editorExperiment('platform_editor_ai_quickstart_command', true) ? [quickInsertAskAI(intl)] : []), _toConsumableArray(navigationKeymaps(intl)), _toConsumableArray(otherFormatting(intl)), _toConsumableArray(supportedBySchema), _toConsumableArray(imageEnabled ? [imageAutoFormat] : []), _toConsumableArray(quickInsertEnabled ? [quickInsertAutoFormat(intl)] : []), _toConsumableArray(focusTableResizeHandleFormatting(intl)), _toConsumableArray(editorExperiment('platform_editor_breakout_resizing', true) ? newResizeInformationFormatting(intl) : resizeInformationFormatting(intl)), _toConsumableArray(openCellOptionsFormattingtoFormat(intl)), _toConsumableArray(expValEquals('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true) ? moveTableRowColumnFormatting(intl) : []));
|
|
741
|
+
return [].concat(_toConsumableArray(aiEnabled && editorExperiment('platform_editor_ai_quickstart_command', true) ? [quickInsertAskAI(intl)] : []), _toConsumableArray(navigationKeymaps(intl)), _toConsumableArray(otherFormatting(intl)), _toConsumableArray(supportedBySchema), _toConsumableArray(expValEquals('platform_editor_drag_handle_keyboard_a11y', 'isEnabled', true) ? blockControlsShortcutsFormatting(intl) : []), _toConsumableArray(imageEnabled ? [imageAutoFormat] : []), _toConsumableArray(quickInsertEnabled ? [quickInsertAutoFormat(intl)] : []), _toConsumableArray(focusTableResizeHandleFormatting(intl)), _toConsumableArray(editorExperiment('platform_editor_breakout_resizing', true) ? newResizeInformationFormatting(intl) : resizeInformationFormatting(intl)), _toConsumableArray(openCellOptionsFormattingtoFormat(intl)), _toConsumableArray(expValEquals('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true) ? moveTableRowColumnFormatting(intl) : []));
|
|
704
742
|
};
|
package/dist/esm/ui/utils.js
CHANGED
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
|
-
import {
|
|
7
|
+
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
8
8
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
9
9
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
10
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
10
|
import { componentFromKeymapWrapperStyles } from './styles';
|
|
12
11
|
var codeLg = xcss({
|
|
13
12
|
borderRadius: 'radius.small',
|
|
@@ -36,8 +35,14 @@ var codeSm = xcss({
|
|
|
36
35
|
lineHeight: "var(--ds-space-300, 24px)",
|
|
37
36
|
textAlign: 'center'
|
|
38
37
|
});
|
|
38
|
+
var arrowSymbols = {
|
|
39
|
+
arrowup: '↑',
|
|
40
|
+
arrowdown: '↓',
|
|
41
|
+
arrowleft: '←',
|
|
42
|
+
arrowright: '→'
|
|
43
|
+
};
|
|
39
44
|
var getKeyParts = function getKeyParts(keymap) {
|
|
40
|
-
var browser =
|
|
45
|
+
var browser = getBrowserInfo();
|
|
41
46
|
var shortcut = keymap[browser.mac ? 'mac' : 'windows'];
|
|
42
47
|
if (browser.mac) {
|
|
43
48
|
shortcut = shortcut.replace('Alt', 'Opt');
|
|
@@ -105,6 +110,16 @@ export var getComponentFromKeymap = function getComponentFromKeymap(keymap) {
|
|
|
105
110
|
,
|
|
106
111
|
key: "".concat(keyParts, "-").concat(index)
|
|
107
112
|
}, '⏎');
|
|
113
|
+
} else if (['arrowup', 'arrowdown', 'arrowleft', 'arrowright'].indexOf(part.toLowerCase()) >= 0) {
|
|
114
|
+
return (
|
|
115
|
+
// Ignored via go/ees005
|
|
116
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
117
|
+
jsx(Box, {
|
|
118
|
+
as: "span",
|
|
119
|
+
xcss: codeSm,
|
|
120
|
+
key: "".concat(keyParts, "-").concat(index)
|
|
121
|
+
}, arrowSymbols[part.toLowerCase()])
|
|
122
|
+
);
|
|
108
123
|
}
|
|
109
124
|
return (
|
|
110
125
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-help-dialog",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "Help Dialog plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
],
|
|
30
30
|
"atlaskit:src": "src/index.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/editor-plugin-analytics": "^
|
|
33
|
-
"@atlaskit/editor-plugin-quick-insert": "^
|
|
32
|
+
"@atlaskit/editor-plugin-analytics": "^9.0.0",
|
|
33
|
+
"@atlaskit/editor-plugin-quick-insert": "^9.0.0",
|
|
34
34
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
35
35
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
36
36
|
"@atlaskit/heading": "^5.4.0",
|
|
37
|
-
"@atlaskit/icon": "^34.
|
|
37
|
+
"@atlaskit/icon": "^34.2.0",
|
|
38
38
|
"@atlaskit/modal-dialog": "^14.15.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
40
40
|
"@atlaskit/primitives": "^19.0.0",
|
|
41
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
41
|
+
"@atlaskit/tmp-editor-statsig": "^62.4.0",
|
|
42
42
|
"@atlaskit/tokens": "^13.0.0",
|
|
43
43
|
"@atlaskit/tooltip": "^21.1.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@testing-library/react": "^16.3.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@atlaskit/editor-common": "^
|
|
53
|
+
"@atlaskit/editor-common": "^113.0.0",
|
|
54
54
|
"react": "^18.2.0"
|
|
55
55
|
},
|
|
56
56
|
"techstack": {
|