@atlaskit/editor-plugin-undo-redo 2.0.8 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-plugin-undo-redo
2
2
 
3
+ ## 2.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 2.0.8
4
10
 
5
11
  ### Patch Changes
@@ -7,6 +7,7 @@ exports.keymapPlugin = keymapPlugin;
7
7
  var _keymaps = require("@atlaskit/editor-common/keymaps");
8
8
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
9
9
  var _keymap = require("@atlaskit/editor-prosemirror/keymap");
10
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
11
  var _commands = require("./commands");
11
12
  function keymapPlugin() {
12
13
  var list = {};
@@ -14,6 +15,10 @@ function keymapPlugin() {
14
15
  // Ignored via go/ees005
15
16
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
16
17
  (0, _keymaps.bindKeymapWithCommand)((0, _keymaps.findKeyMapForBrowser)(_keymaps.redo), _commands.redoFromKeyboard, list);
18
+ if ((0, _platformFeatureFlags.fg)('platform_editor_cmd_y_mac_redo_shortcut')) {
19
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
20
+ (0, _keymaps.bindKeymapWithCommand)((0, _keymaps.findKeyMapForBrowser)(_keymaps.redoAlt), _commands.redoFromKeyboard, list);
21
+ }
17
22
 
18
23
  // Ignored via go/ees005
19
24
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -42,6 +42,7 @@ var ToolbarUndoRedo = exports.ToolbarUndoRedo = function ToolbarUndoRedo(_ref) {
42
42
  var _ref2 = historyState !== null && historyState !== void 0 ? historyState : {},
43
43
  canUndo = _ref2.canUndo,
44
44
  canRedo = _ref2.canRedo;
45
+ var redoKeymap = (0, _platformFeatureFlags.fg)('platform_editor_cmd_y_mac_redo_shortcut') ? _keymaps.redoAlt : _keymaps.redo;
45
46
  return (
46
47
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
47
48
  (0, _react.jsx)("span", {
@@ -76,7 +77,7 @@ var ToolbarUndoRedo = exports.ToolbarUndoRedo = function ToolbarUndoRedo(_ref) {
76
77
  disabled: !canRedo || disabled,
77
78
  title: (0, _react.jsx)(_keymaps.ToolTipContent, {
78
79
  description: labelRedo,
79
- keymap: _keymaps.redo
80
+ keymap: redoKeymap
80
81
  }),
81
82
  iconBefore: (0, _react.jsx)(_redo.default, {
82
83
  label: "",
@@ -84,8 +85,8 @@ var ToolbarUndoRedo = exports.ToolbarUndoRedo = function ToolbarUndoRedo(_ref) {
84
85
  spacing: "spacious"
85
86
  }),
86
87
  testId: "ak-editor-toolbar-button-redo",
87
- "aria-label": (0, _keymaps.tooltip)(_keymaps.redo, labelRedo),
88
- "aria-keyshortcuts": (0, _keymaps.getAriaKeyshortcuts)(_keymaps.redo)
88
+ "aria-label": (0, _keymaps.tooltip)(redoKeymap, labelRedo),
89
+ "aria-keyshortcuts": (0, _keymaps.getAriaKeyshortcuts)(redoKeymap)
89
90
  }), !(api !== null && api !== void 0 && api.primaryToolbar) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
90
91
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
91
92
  (0, _react.jsx)("span", {
@@ -1,6 +1,7 @@
1
- import { bindKeymapWithCommand, findKeyMapForBrowser, isCapsLockOnAndModifyKeyboardEvent, redo, undo } from '@atlaskit/editor-common/keymaps';
1
+ import { bindKeymapWithCommand, findKeyMapForBrowser, isCapsLockOnAndModifyKeyboardEvent, redo, redoAlt, undo } from '@atlaskit/editor-common/keymaps';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  import { redoFromKeyboard, undoFromKeyboard } from './commands';
5
6
  export function keymapPlugin() {
6
7
  const list = {};
@@ -8,6 +9,10 @@ export function keymapPlugin() {
8
9
  // Ignored via go/ees005
9
10
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
10
11
  bindKeymapWithCommand(findKeyMapForBrowser(redo), redoFromKeyboard, list);
12
+ if (fg('platform_editor_cmd_y_mac_redo_shortcut')) {
13
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
14
+ bindKeymapWithCommand(findKeyMapForBrowser(redoAlt), redoFromKeyboard, list);
15
+ }
11
16
 
12
17
  // Ignored via go/ees005
13
18
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -6,7 +6,7 @@
6
6
  import { jsx } from '@emotion/react';
7
7
  import { injectIntl } from 'react-intl-next';
8
8
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
9
- import { getAriaKeyshortcuts, redo as redoKeymap, tooltip, ToolTipContent, undo as undoKeymap } from '@atlaskit/editor-common/keymaps';
9
+ import { getAriaKeyshortcuts, redo, redoAlt, tooltip, ToolTipContent, undo as undoKeymap } from '@atlaskit/editor-common/keymaps';
10
10
  import { undoRedoMessages } from '@atlaskit/editor-common/messages';
11
11
  import { buttonGroupStyle, buttonGroupStyleBeforeVisualRefresh, separatorStyles } from '@atlaskit/editor-common/styles';
12
12
  import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
@@ -39,6 +39,7 @@ export const ToolbarUndoRedo = ({
39
39
  canUndo,
40
40
  canRedo
41
41
  } = historyState !== null && historyState !== void 0 ? historyState : {};
42
+ const redoKeymap = fg('platform_editor_cmd_y_mac_redo_shortcut') ? redoAlt : redo;
42
43
  return (
43
44
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
44
45
  jsx("span", {
@@ -1,6 +1,7 @@
1
- import { bindKeymapWithCommand, findKeyMapForBrowser, isCapsLockOnAndModifyKeyboardEvent, redo, undo } from '@atlaskit/editor-common/keymaps';
1
+ import { bindKeymapWithCommand, findKeyMapForBrowser, isCapsLockOnAndModifyKeyboardEvent, redo, redoAlt, undo } from '@atlaskit/editor-common/keymaps';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  import { redoFromKeyboard, undoFromKeyboard } from './commands';
5
6
  export function keymapPlugin() {
6
7
  var list = {};
@@ -8,6 +9,10 @@ export function keymapPlugin() {
8
9
  // Ignored via go/ees005
9
10
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
10
11
  bindKeymapWithCommand(findKeyMapForBrowser(redo), redoFromKeyboard, list);
12
+ if (fg('platform_editor_cmd_y_mac_redo_shortcut')) {
13
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
14
+ bindKeymapWithCommand(findKeyMapForBrowser(redoAlt), redoFromKeyboard, list);
15
+ }
11
16
 
12
17
  // Ignored via go/ees005
13
18
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -6,7 +6,7 @@
6
6
  import { jsx } from '@emotion/react';
7
7
  import { injectIntl } from 'react-intl-next';
8
8
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
9
- import { getAriaKeyshortcuts, redo as redoKeymap, tooltip, ToolTipContent, undo as undoKeymap } from '@atlaskit/editor-common/keymaps';
9
+ import { getAriaKeyshortcuts, redo, redoAlt, tooltip, ToolTipContent, undo as undoKeymap } from '@atlaskit/editor-common/keymaps';
10
10
  import { undoRedoMessages } from '@atlaskit/editor-common/messages';
11
11
  import { buttonGroupStyle, buttonGroupStyleBeforeVisualRefresh, separatorStyles } from '@atlaskit/editor-common/styles';
12
12
  import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
@@ -34,6 +34,7 @@ export var ToolbarUndoRedo = function ToolbarUndoRedo(_ref) {
34
34
  var _ref2 = historyState !== null && historyState !== void 0 ? historyState : {},
35
35
  canUndo = _ref2.canUndo,
36
36
  canRedo = _ref2.canRedo;
37
+ var redoKeymap = fg('platform_editor_cmd_y_mac_redo_shortcut') ? redoAlt : redo;
37
38
  return (
38
39
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
39
40
  jsx("span", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-undo-redo",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "description": "Undo redo plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,14 +33,14 @@
33
33
  ".": "./src/index.ts"
34
34
  },
35
35
  "dependencies": {
36
- "@atlaskit/editor-common": "^102.13.0",
36
+ "@atlaskit/editor-common": "^103.0.0",
37
37
  "@atlaskit/editor-plugin-history": "^2.0.0",
38
38
  "@atlaskit/editor-plugin-primary-toolbar": "^3.1.0",
39
- "@atlaskit/editor-plugin-type-ahead": "^2.2.0",
39
+ "@atlaskit/editor-plugin-type-ahead": "^2.3.0",
40
40
  "@atlaskit/editor-prosemirror": "7.0.0",
41
- "@atlaskit/icon": "^25.0.0",
41
+ "@atlaskit/icon": "^25.5.0",
42
42
  "@atlaskit/platform-feature-flags": "^1.1.0",
43
- "@atlaskit/tmp-editor-statsig": "^4.2.0",
43
+ "@atlaskit/tmp-editor-statsig": "^4.6.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@emotion/react": "^11.7.1"
46
46
  },
@@ -91,5 +91,10 @@
91
91
  "no-unused-dependencies": {
92
92
  "checkDevDependencies": true
93
93
  }
94
+ },
95
+ "platform-feature-flags": {
96
+ "platform_editor_cmd_y_mac_redo_shortcut": {
97
+ "type": "boolean"
98
+ }
94
99
  }
95
100
  }