@atlaskit/editor-plugin-help-dialog 0.3.7 → 0.3.8

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-plugin-help-dialog
2
2
 
3
+ ## 0.3.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#65334](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65334) [`089979f0308f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/089979f0308f) - [ux] ECA11Y-111/ECA11Y-86 Help dialog - resize table and media information
8
+
3
9
  ## 0.3.7
4
10
 
5
11
  ### Patch Changes
@@ -71,6 +71,21 @@ var messages = (0, _reactIntlNext.defineMessages)({
71
71
  defaultMessage: 'Select table column',
72
72
  description: 'Hint for selecting a table column using a shortcut'
73
73
  },
74
+ increaseSize: {
75
+ id: 'fabric.editor.increaseSize',
76
+ defaultMessage: 'Increase size',
77
+ description: 'The text is shown as an shortcut description in help dialog modal, when the user uses the described shortcut, he is able to increase the width of the selected element. Optimal characters less than 21.'
78
+ },
79
+ decreaseSize: {
80
+ id: 'fabric.editor.decreaseSize',
81
+ defaultMessage: 'Decrease size',
82
+ description: 'The text is shown as an shortcut description in help dialog modal, when the user uses the described shortcut, he is able to decrease the width of the selected element. Optimal characters less than 21.'
83
+ },
84
+ focusTableResizeHandle: {
85
+ id: 'fabric.editor.focusTableResizeHandle',
86
+ defaultMessage: 'Focus table resize handle',
87
+ description: 'Focus table resize handle'
88
+ },
74
89
  closeHelpDialog: {
75
90
  id: 'fabric.editor.closeHelpDialog',
76
91
  defaultMessage: 'Close help dialog',
@@ -452,6 +467,32 @@ var otherFormatting = function otherFormatting(_ref3) {
452
467
  }
453
468
  }] : []));
454
469
  };
470
+ var resizeInformationFormatting = function resizeInformationFormatting(_ref4) {
471
+ var formatMessage = _ref4.formatMessage;
472
+ return [{
473
+ name: formatMessage(messages.increaseSize),
474
+ type: 'media',
475
+ keymap: function keymap() {
476
+ return _keymaps.increaseMediaSize;
477
+ }
478
+ }, {
479
+ name: formatMessage(messages.decreaseSize),
480
+ type: 'media',
481
+ keymap: function keymap() {
482
+ return _keymaps.decreaseMediaSize;
483
+ }
484
+ }];
485
+ };
486
+ var focusTableResizeHandleFormatting = function focusTableResizeHandleFormatting(_ref5) {
487
+ var formatMessage = _ref5.formatMessage;
488
+ return [{
489
+ name: formatMessage(messages.focusTableResizeHandle),
490
+ type: 'navigation',
491
+ keymap: function keymap() {
492
+ return _keymaps.focusTableResizer;
493
+ }
494
+ }];
495
+ };
455
496
  var imageAutoFormat = {
456
497
  name: 'Image',
457
498
  type: 'image',
@@ -461,8 +502,8 @@ var imageAutoFormat = {
461
502
  }, "![", (0, _react2.jsx)(_reactIntlNext.FormattedMessage, messages.altText), "](http://www.image.com)"));
462
503
  }
463
504
  };
464
- var quickInsertAutoFormat = function quickInsertAutoFormat(_ref4) {
465
- var formatMessage = _ref4.formatMessage;
505
+ var quickInsertAutoFormat = function quickInsertAutoFormat(_ref6) {
506
+ var formatMessage = _ref6.formatMessage;
466
507
  return {
467
508
  name: formatMessage(messages.quickInsert),
468
509
  type: 'quickInsert',
@@ -480,15 +521,18 @@ var getKeyParts = function getKeyParts(keymap) {
480
521
  }
481
522
  return shortcut.replace(/\-(?=.)/g, ' + ').split(' ');
482
523
  };
524
+ var isAnyA11yResizeFeatureFlagEnabled = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-media-resizing_b5v0o') || (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-resizing_uapcv');
483
525
  var getSupportedFormatting = exports.getSupportedFormatting = function getSupportedFormatting(schema, intl, imageEnabled, quickInsertEnabled) {
484
526
  var supportedBySchema = formatting(intl).filter(function (format) {
485
527
  return schema.nodes[format.type] || schema.marks[format.type];
486
528
  });
487
- 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)));
529
+ 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) : []));
488
530
  };
489
531
  var getComponentFromKeymap = exports.getComponentFromKeymap = function getComponentFromKeymap(keymap) {
490
532
  var keyParts = getKeyParts(keymap);
491
- return (0, _react2.jsx)("span", null, keyParts.map(function (part, index) {
533
+ return (0, _react2.jsx)("span", {
534
+ css: _styles.componentFromKeymapWrapperStyles
535
+ }, keyParts.map(function (part, index) {
492
536
  if (part === '+') {
493
537
  return (0, _react2.jsx)("span", {
494
538
  key: "".concat(keyParts, "-").concat(index)
@@ -520,8 +564,8 @@ var getComponentFromKeymap = exports.getComponentFromKeymap = function getCompon
520
564
  }, part.toUpperCase());
521
565
  }));
522
566
  };
523
- var ModalHeader = (0, _reactIntlNext.injectIntl)(function (_ref5) {
524
- var formatMessage = _ref5.intl.formatMessage;
567
+ var ModalHeader = (0, _reactIntlNext.injectIntl)(function (_ref7) {
568
+ var formatMessage = _ref7.intl.formatMessage;
525
569
  var _useModal = (0, _modalDialog.useModal)(),
526
570
  onClose = _useModal.onClose;
527
571
  return (0, _react2.jsx)("div", {
@@ -549,11 +593,11 @@ var ModalFooter = function ModalFooter() {
549
593
  }
550
594
  })));
551
595
  };
552
- var HelpDialog = function HelpDialog(_ref6) {
553
- var pluginInjectionApi = _ref6.pluginInjectionApi,
554
- editorView = _ref6.editorView,
555
- quickInsertEnabled = _ref6.quickInsertEnabled,
556
- intl = _ref6.intl;
596
+ var HelpDialog = function HelpDialog(_ref8) {
597
+ var pluginInjectionApi = _ref8.pluginInjectionApi,
598
+ editorView = _ref8.editorView,
599
+ quickInsertEnabled = _ref8.quickInsertEnabled,
600
+ intl = _ref8.intl;
557
601
  var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['helpDialog']),
558
602
  helpDialogState = _useSharedPluginState.helpDialogState;
559
603
  var closeDialog = (0, _react.useCallback)(function () {
@@ -5,14 +5,14 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.title = exports.shortcutsArray = exports.row = exports.line = exports.header = exports.footer = exports.dialogHeader = exports.contentWrapper = exports.content = exports.column = exports.codeSm = exports.codeMd = exports.codeLg = void 0;
8
+ exports.title = exports.shortcutsArray = exports.row = exports.line = exports.header = exports.footer = exports.dialogHeader = exports.contentWrapper = exports.content = exports.componentFromKeymapWrapperStyles = exports.column = exports.codeSm = exports.codeMd = exports.codeLg = void 0;
9
9
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
10
  var _react = require("@emotion/react");
11
11
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
12
12
  var _colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
13
13
  var colors = _colors;
14
14
  var _constants = require("@atlaskit/theme/constants");
15
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
15
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
16
16
  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); }
17
17
  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; }
18
18
  var header = exports.header = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n z-index: ", ";\n min-height: 24px;\n padding: ", " ", ";\n font-size: ", ";\n display: flex;\n justify-content: space-between;\n align-items: center;\n box-shadow: 'none';\n color: ", ";\n background-color: ", ";\n border-radius: ", "px;\n"])), _editorSharedStyles.akEditorUnitZIndex, "var(--ds-space-250, 20px)", "var(--ds-space-500, 40px)", (0, _editorSharedStyles.relativeFontSizeToBase16)(24), "var(--ds-text, ".concat(colors.N400, ")"), "var(--ds-background-neutral-subtle, ".concat(colors.N0, ")"), (0, _constants.borderRadius)());
@@ -48,4 +48,5 @@ var title = exports.title = {
48
48
  var codeSm = exports.codeSm = (0, _react.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n border-radius: ", "px;\n width: 24px;\n display: inline-block;\n height: 24px;\n line-height: 24px;\n text-align: center;\n"])), "var(--ds-background-neutral, ".concat(colors.N20, ")"), (0, _constants.borderRadius)());
49
49
  var codeMd = exports.codeMd = (0, _react.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n border-radius: ", "px;\n display: inline-block;\n height: 24px;\n line-height: 24px;\n width: 50px;\n text-align: center;\n"])), "var(--ds-background-neutral, ".concat(colors.N20, ")"), (0, _constants.borderRadius)());
50
50
  var codeLg = exports.codeLg = (0, _react.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n border-radius: ", "px;\n display: inline-block;\n height: 24px;\n line-height: 24px;\n padding: 0 10px;\n text-align: center;\n"])), "var(--ds-background-neutral, ".concat(colors.N20, ")"), (0, _constants.borderRadius)());
51
- var shortcutsArray = exports.shortcutsArray = (0, _react.css)(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n gap: ", ";\n"])), "var(--ds-space-150, 12px)");
51
+ var shortcutsArray = exports.shortcutsArray = (0, _react.css)(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n gap: ", ";\n"])), "var(--ds-space-150, 12px)");
52
+ var componentFromKeymapWrapperStyles = exports.componentFromKeymapWrapperStyles = (0, _react.css)(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n flex-shrink: 0;\n"])));
@@ -4,7 +4,7 @@ import { useCallback, useEffect } from 'react';
4
4
  import { jsx } from '@emotion/react';
5
5
  import { defineMessages, FormattedMessage, injectIntl } from 'react-intl-next';
6
6
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
7
- import { addInlineComment, addLink, alignLeft, clearFormatting, insertRule, navToEditorToolbar, navToFloatingToolbar, openHelp, pastePlainText, redo, setNormalText, toggleBlockQuote, toggleBold, toggleBulletList, toggleCode, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleItalic, toggleOrderedList, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleTaskItemCheckbox, toggleUnderline, undo } from '@atlaskit/editor-common/keymaps';
7
+ import { addInlineComment, addLink, alignLeft, clearFormatting, decreaseMediaSize, focusTableResizer, increaseMediaSize, insertRule, navToEditorToolbar, navToFloatingToolbar, openHelp, pastePlainText, redo, setNormalText, toggleBlockQuote, toggleBold, toggleBulletList, toggleCode, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleItalic, toggleOrderedList, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleTaskItemCheckbox, toggleUnderline, undo } from '@atlaskit/editor-common/keymaps';
8
8
  import { alignmentMessages, annotationMessages, blockTypeMessages, listMessages, toolbarInsertBlockMessages, toolbarMessages, undoRedoMessages } from '@atlaskit/editor-common/messages';
9
9
  import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
10
10
  import { browser } from '@atlaskit/editor-common/utils';
@@ -12,7 +12,7 @@ import CrossIcon from '@atlaskit/icon/glyph/cross';
12
12
  import AkModalDialog, { ModalTransition, useModal } from '@atlaskit/modal-dialog';
13
13
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
14
14
  import { closeHelpCommand } from '../commands';
15
- import { codeLg, codeMd, codeSm, column, content, contentWrapper, dialogHeader, footer, header, line, row, shortcutsArray, title } from './styles';
15
+ import { codeLg, codeMd, codeSm, column, componentFromKeymapWrapperStyles, content, contentWrapper, dialogHeader, footer, header, line, row, shortcutsArray, title } from './styles';
16
16
  const messages = defineMessages({
17
17
  editorHelp: {
18
18
  id: 'fabric.editor.editorHelp',
@@ -59,6 +59,21 @@ const messages = defineMessages({
59
59
  defaultMessage: 'Select table column',
60
60
  description: 'Hint for selecting a table column using a shortcut'
61
61
  },
62
+ increaseSize: {
63
+ id: 'fabric.editor.increaseSize',
64
+ defaultMessage: 'Increase size',
65
+ description: 'The text is shown as an shortcut description in help dialog modal, when the user uses the described shortcut, he is able to increase the width of the selected element. Optimal characters less than 21.'
66
+ },
67
+ decreaseSize: {
68
+ id: 'fabric.editor.decreaseSize',
69
+ defaultMessage: 'Decrease size',
70
+ description: 'The text is shown as an shortcut description in help dialog modal, when the user uses the described shortcut, he is able to decrease the width of the selected element. Optimal characters less than 21.'
71
+ },
72
+ focusTableResizeHandle: {
73
+ id: 'fabric.editor.focusTableResizeHandle',
74
+ defaultMessage: 'Focus table resize handle',
75
+ description: 'Focus table resize handle'
76
+ },
62
77
  closeHelpDialog: {
63
78
  id: 'fabric.editor.closeHelpDialog',
64
79
  defaultMessage: 'Close help dialog',
@@ -337,6 +352,24 @@ const otherFormatting = ({
337
352
  css: codeSm
338
353
  }, "\u2193")))
339
354
  }] : [])];
355
+ const resizeInformationFormatting = ({
356
+ formatMessage
357
+ }) => [{
358
+ name: formatMessage(messages.increaseSize),
359
+ type: 'media',
360
+ keymap: () => increaseMediaSize
361
+ }, {
362
+ name: formatMessage(messages.decreaseSize),
363
+ type: 'media',
364
+ keymap: () => decreaseMediaSize
365
+ }];
366
+ const focusTableResizeHandleFormatting = ({
367
+ formatMessage
368
+ }) => [{
369
+ name: formatMessage(messages.focusTableResizeHandle),
370
+ type: 'navigation',
371
+ keymap: () => focusTableResizer
372
+ }];
340
373
  const imageAutoFormat = {
341
374
  name: 'Image',
342
375
  type: 'image',
@@ -360,13 +393,16 @@ const getKeyParts = keymap => {
360
393
  }
361
394
  return shortcut.replace(/\-(?=.)/g, ' + ').split(' ');
362
395
  };
396
+ const isAnyA11yResizeFeatureFlagEnabled = getBooleanFF('platform.editor.a11y-media-resizing_b5v0o') || getBooleanFF('platform.editor.a11y-table-resizing_uapcv');
363
397
  export const getSupportedFormatting = (schema, intl, imageEnabled, quickInsertEnabled) => {
364
398
  const supportedBySchema = formatting(intl).filter(format => schema.nodes[format.type] || schema.marks[format.type]);
365
- return [...navigationKeymaps(intl), ...supportedBySchema, ...(imageEnabled ? [imageAutoFormat] : []), ...(quickInsertEnabled ? [quickInsertAutoFormat(intl)] : []), ...otherFormatting(intl)];
399
+ return [...navigationKeymaps(intl), ...supportedBySchema, ...(imageEnabled ? [imageAutoFormat] : []), ...(quickInsertEnabled ? [quickInsertAutoFormat(intl)] : []), ...otherFormatting(intl), ...(isAnyA11yResizeFeatureFlagEnabled ? resizeInformationFormatting(intl) : []), ...(getBooleanFF('platform.editor.a11y-table-resizing_uapcv') ? focusTableResizeHandleFormatting(intl) : [])];
366
400
  };
367
401
  export const getComponentFromKeymap = keymap => {
368
402
  const keyParts = getKeyParts(keymap);
369
- return jsx("span", null, keyParts.map((part, index) => {
403
+ return jsx("span", {
404
+ css: componentFromKeymapWrapperStyles
405
+ }, keyParts.map((part, index) => {
370
406
  if (part === '+') {
371
407
  return jsx("span", {
372
408
  key: `${keyParts}-${index}`
@@ -113,4 +113,7 @@ export const shortcutsArray = css`
113
113
  flex-direction: column;
114
114
  flex-shrink: 0;
115
115
  gap: ${"var(--ds-space-150, 12px)"};
116
+ `;
117
+ export const componentFromKeymapWrapperStyles = css`
118
+ flex-shrink: 0;
116
119
  `;
@@ -5,7 +5,7 @@ import { useCallback, useEffect } from 'react';
5
5
  import { jsx } from '@emotion/react';
6
6
  import { defineMessages, FormattedMessage, injectIntl } from 'react-intl-next';
7
7
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
8
- import { addInlineComment, addLink, alignLeft, clearFormatting, insertRule, navToEditorToolbar, navToFloatingToolbar, openHelp, pastePlainText, redo, setNormalText, toggleBlockQuote, toggleBold, toggleBulletList, toggleCode, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleItalic, toggleOrderedList, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleTaskItemCheckbox, toggleUnderline, undo } from '@atlaskit/editor-common/keymaps';
8
+ import { addInlineComment, addLink, alignLeft, clearFormatting, decreaseMediaSize, focusTableResizer, increaseMediaSize, insertRule, navToEditorToolbar, navToFloatingToolbar, openHelp, pastePlainText, redo, setNormalText, toggleBlockQuote, toggleBold, toggleBulletList, toggleCode, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleItalic, toggleOrderedList, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleTaskItemCheckbox, toggleUnderline, undo } from '@atlaskit/editor-common/keymaps';
9
9
  import { alignmentMessages, annotationMessages, blockTypeMessages, listMessages, toolbarInsertBlockMessages, toolbarMessages, undoRedoMessages } from '@atlaskit/editor-common/messages';
10
10
  import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
11
11
  import { browser } from '@atlaskit/editor-common/utils';
@@ -13,7 +13,7 @@ import CrossIcon from '@atlaskit/icon/glyph/cross';
13
13
  import AkModalDialog, { ModalTransition, useModal } from '@atlaskit/modal-dialog';
14
14
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
15
15
  import { closeHelpCommand } from '../commands';
16
- import { codeLg, codeMd, codeSm, column, content, contentWrapper, dialogHeader, footer, header, line, row, shortcutsArray, title } from './styles';
16
+ import { codeLg, codeMd, codeSm, column, componentFromKeymapWrapperStyles, content, contentWrapper, dialogHeader, footer, header, line, row, shortcutsArray, title } from './styles';
17
17
  var messages = defineMessages({
18
18
  editorHelp: {
19
19
  id: 'fabric.editor.editorHelp',
@@ -60,6 +60,21 @@ var messages = defineMessages({
60
60
  defaultMessage: 'Select table column',
61
61
  description: 'Hint for selecting a table column using a shortcut'
62
62
  },
63
+ increaseSize: {
64
+ id: 'fabric.editor.increaseSize',
65
+ defaultMessage: 'Increase size',
66
+ description: 'The text is shown as an shortcut description in help dialog modal, when the user uses the described shortcut, he is able to increase the width of the selected element. Optimal characters less than 21.'
67
+ },
68
+ decreaseSize: {
69
+ id: 'fabric.editor.decreaseSize',
70
+ defaultMessage: 'Decrease size',
71
+ description: 'The text is shown as an shortcut description in help dialog modal, when the user uses the described shortcut, he is able to decrease the width of the selected element. Optimal characters less than 21.'
72
+ },
73
+ focusTableResizeHandle: {
74
+ id: 'fabric.editor.focusTableResizeHandle',
75
+ defaultMessage: 'Focus table resize handle',
76
+ description: 'Focus table resize handle'
77
+ },
63
78
  closeHelpDialog: {
64
79
  id: 'fabric.editor.closeHelpDialog',
65
80
  defaultMessage: 'Close help dialog',
@@ -441,6 +456,32 @@ var otherFormatting = function otherFormatting(_ref3) {
441
456
  }
442
457
  }] : []));
443
458
  };
459
+ var resizeInformationFormatting = function resizeInformationFormatting(_ref4) {
460
+ var formatMessage = _ref4.formatMessage;
461
+ return [{
462
+ name: formatMessage(messages.increaseSize),
463
+ type: 'media',
464
+ keymap: function keymap() {
465
+ return increaseMediaSize;
466
+ }
467
+ }, {
468
+ name: formatMessage(messages.decreaseSize),
469
+ type: 'media',
470
+ keymap: function keymap() {
471
+ return decreaseMediaSize;
472
+ }
473
+ }];
474
+ };
475
+ var focusTableResizeHandleFormatting = function focusTableResizeHandleFormatting(_ref5) {
476
+ var formatMessage = _ref5.formatMessage;
477
+ return [{
478
+ name: formatMessage(messages.focusTableResizeHandle),
479
+ type: 'navigation',
480
+ keymap: function keymap() {
481
+ return focusTableResizer;
482
+ }
483
+ }];
484
+ };
444
485
  var imageAutoFormat = {
445
486
  name: 'Image',
446
487
  type: 'image',
@@ -450,8 +491,8 @@ var imageAutoFormat = {
450
491
  }, "![", jsx(FormattedMessage, messages.altText), "](http://www.image.com)"));
451
492
  }
452
493
  };
453
- var quickInsertAutoFormat = function quickInsertAutoFormat(_ref4) {
454
- var formatMessage = _ref4.formatMessage;
494
+ var quickInsertAutoFormat = function quickInsertAutoFormat(_ref6) {
495
+ var formatMessage = _ref6.formatMessage;
455
496
  return {
456
497
  name: formatMessage(messages.quickInsert),
457
498
  type: 'quickInsert',
@@ -469,15 +510,18 @@ var getKeyParts = function getKeyParts(keymap) {
469
510
  }
470
511
  return shortcut.replace(/\-(?=.)/g, ' + ').split(' ');
471
512
  };
513
+ var isAnyA11yResizeFeatureFlagEnabled = getBooleanFF('platform.editor.a11y-media-resizing_b5v0o') || getBooleanFF('platform.editor.a11y-table-resizing_uapcv');
472
514
  export var getSupportedFormatting = function getSupportedFormatting(schema, intl, imageEnabled, quickInsertEnabled) {
473
515
  var supportedBySchema = formatting(intl).filter(function (format) {
474
516
  return schema.nodes[format.type] || schema.marks[format.type];
475
517
  });
476
- return [].concat(_toConsumableArray(navigationKeymaps(intl)), _toConsumableArray(supportedBySchema), _toConsumableArray(imageEnabled ? [imageAutoFormat] : []), _toConsumableArray(quickInsertEnabled ? [quickInsertAutoFormat(intl)] : []), _toConsumableArray(otherFormatting(intl)));
518
+ return [].concat(_toConsumableArray(navigationKeymaps(intl)), _toConsumableArray(supportedBySchema), _toConsumableArray(imageEnabled ? [imageAutoFormat] : []), _toConsumableArray(quickInsertEnabled ? [quickInsertAutoFormat(intl)] : []), _toConsumableArray(otherFormatting(intl)), _toConsumableArray(isAnyA11yResizeFeatureFlagEnabled ? resizeInformationFormatting(intl) : []), _toConsumableArray(getBooleanFF('platform.editor.a11y-table-resizing_uapcv') ? focusTableResizeHandleFormatting(intl) : []));
477
519
  };
478
520
  export var getComponentFromKeymap = function getComponentFromKeymap(keymap) {
479
521
  var keyParts = getKeyParts(keymap);
480
- return jsx("span", null, keyParts.map(function (part, index) {
522
+ return jsx("span", {
523
+ css: componentFromKeymapWrapperStyles
524
+ }, keyParts.map(function (part, index) {
481
525
  if (part === '+') {
482
526
  return jsx("span", {
483
527
  key: "".concat(keyParts, "-").concat(index)
@@ -509,8 +553,8 @@ export var getComponentFromKeymap = function getComponentFromKeymap(keymap) {
509
553
  }, part.toUpperCase());
510
554
  }));
511
555
  };
512
- var ModalHeader = injectIntl(function (_ref5) {
513
- var formatMessage = _ref5.intl.formatMessage;
556
+ var ModalHeader = injectIntl(function (_ref7) {
557
+ var formatMessage = _ref7.intl.formatMessage;
514
558
  var _useModal = useModal(),
515
559
  onClose = _useModal.onClose;
516
560
  return jsx("div", {
@@ -538,11 +582,11 @@ var ModalFooter = function ModalFooter() {
538
582
  }
539
583
  })));
540
584
  };
541
- var HelpDialog = function HelpDialog(_ref6) {
542
- var pluginInjectionApi = _ref6.pluginInjectionApi,
543
- editorView = _ref6.editorView,
544
- quickInsertEnabled = _ref6.quickInsertEnabled,
545
- intl = _ref6.intl;
585
+ var HelpDialog = function HelpDialog(_ref8) {
586
+ var pluginInjectionApi = _ref8.pluginInjectionApi,
587
+ editorView = _ref8.editorView,
588
+ quickInsertEnabled = _ref8.quickInsertEnabled,
589
+ intl = _ref8.intl;
546
590
  var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['helpDialog']),
547
591
  helpDialogState = _useSharedPluginState.helpDialogState;
548
592
  var closeDialog = useCallback(function () {
@@ -1,5 +1,5 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
3
3
  import { css } from '@emotion/react';
4
4
  import { akEditorUnitZIndex, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
5
5
  import * as colors from '@atlaskit/theme/colors';
@@ -38,4 +38,5 @@ export var title = {
38
38
  export var codeSm = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n background-color: ", ";\n border-radius: ", "px;\n width: 24px;\n display: inline-block;\n height: 24px;\n line-height: 24px;\n text-align: center;\n"])), "var(--ds-background-neutral, ".concat(colors.N20, ")"), borderRadius());
39
39
  export var codeMd = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n background-color: ", ";\n border-radius: ", "px;\n display: inline-block;\n height: 24px;\n line-height: 24px;\n width: 50px;\n text-align: center;\n"])), "var(--ds-background-neutral, ".concat(colors.N20, ")"), borderRadius());
40
40
  export var codeLg = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n background-color: ", ";\n border-radius: ", "px;\n display: inline-block;\n height: 24px;\n line-height: 24px;\n padding: 0 10px;\n text-align: center;\n"])), "var(--ds-background-neutral, ".concat(colors.N20, ")"), borderRadius());
41
- export var shortcutsArray = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n gap: ", ";\n"])), "var(--ds-space-150, 12px)");
41
+ export var shortcutsArray = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n gap: ", ";\n"])), "var(--ds-space-150, 12px)");
42
+ export var componentFromKeymapWrapperStyles = css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n flex-shrink: 0;\n"])));
@@ -32,3 +32,4 @@ export declare const codeSm: import("@emotion/react").SerializedStyles;
32
32
  export declare const codeMd: import("@emotion/react").SerializedStyles;
33
33
  export declare const codeLg: import("@emotion/react").SerializedStyles;
34
34
  export declare const shortcutsArray: import("@emotion/react").SerializedStyles;
35
+ export declare const componentFromKeymapWrapperStyles: import("@emotion/react").SerializedStyles;
@@ -32,3 +32,4 @@ export declare const codeSm: import("@emotion/react").SerializedStyles;
32
32
  export declare const codeMd: import("@emotion/react").SerializedStyles;
33
33
  export declare const codeLg: import("@emotion/react").SerializedStyles;
34
34
  export declare const shortcutsArray: import("@emotion/react").SerializedStyles;
35
+ export declare const componentFromKeymapWrapperStyles: import("@emotion/react").SerializedStyles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-help-dialog",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "Help Dialog plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  ".": "./src/index.ts"
33
33
  },
34
34
  "dependencies": {
35
- "@atlaskit/editor-common": "^77.0.0",
35
+ "@atlaskit/editor-common": "^77.1.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^0.4.0",
37
37
  "@atlaskit/editor-plugin-quick-insert": "^0.2.0",
38
38
  "@atlaskit/editor-prosemirror": "1.1.0",
@@ -41,7 +41,7 @@
41
41
  "@atlaskit/modal-dialog": "^12.10.0",
42
42
  "@atlaskit/platform-feature-flags": "^0.2.5",
43
43
  "@atlaskit/theme": "^12.6.0",
44
- "@atlaskit/tokens": "^1.34.0",
44
+ "@atlaskit/tokens": "^1.35.0",
45
45
  "@babel/runtime": "^7.0.0",
46
46
  "@emotion/react": "^11.7.1",
47
47
  "react-intl-next": "npm:react-intl@^5.18.1",
@@ -90,6 +90,12 @@
90
90
  "platform-feature-flags": {
91
91
  "platform.editor.a11y.table-selection_9uv33": {
92
92
  "type": "boolean"
93
+ },
94
+ "platform.editor.a11y-media-resizing_b5v0o": {
95
+ "type": "boolean"
96
+ },
97
+ "platform.editor.a11y-table-resizing_uapcv": {
98
+ "type": "boolean"
93
99
  }
94
100
  }
95
101
  }