@atlaskit/editor-plugin-highlight 2.4.0 → 2.5.1

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,23 @@
1
1
  # @atlaskit/editor-plugin-highlight
2
2
 
3
+ ## 2.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 2.5.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#140315](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/140315)
14
+ [`e9258b34b7063`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e9258b34b7063) -
15
+ MODES-6284 Add CMD+OPT+Y as yellow text highlight shortcut
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 2.4.0
4
22
 
5
23
  ### Minor Changes
@@ -6,6 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.keymapPlugin = keymapPlugin;
7
7
  var _analytics = require("@atlaskit/editor-common/analytics");
8
8
  var _keymaps = require("@atlaskit/editor-common/keymaps");
9
+ var _preset = require("@atlaskit/editor-common/preset");
10
+ var _uiColor = require("@atlaskit/editor-common/ui-color");
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
+ var _changeColor = require("../editor-commands/change-color");
9
13
  var _palette = require("../editor-commands/palette");
10
14
  function keymapPlugin(_ref) {
11
15
  var api = _ref.api;
@@ -19,5 +23,23 @@ function keymapPlugin(_ref) {
19
23
  (0, _palette.togglePalette)(api)({
20
24
  inputMethod: _analytics.INPUT_METHOD.SHORTCUT
21
25
  }), list);
26
+ if ((0, _platformFeatureFlags.fg)('platform_editor_yellow_text_highlight_shortcut')) {
27
+ var _api$analytics;
28
+ var analyticsApi = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
29
+ // NOTE: This will work with fallback until we clean up `editor_text_highlight_orange_to_yellow`
30
+ var color = _uiColor.highlightColorPalette.find(function (_ref2) {
31
+ var label = _ref2.label;
32
+ return label === 'Yellow';
33
+ }) || {
34
+ value: '#fedec8'
35
+ };
36
+ (0, _keymaps.bindKeymapWithCommand)(
37
+ // Ignored via go/ees005
38
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
39
+ _keymaps.applyYellowHighlight.common, (0, _preset.editorCommandToPMCommand)((0, _changeColor.changeColor)(analyticsApi)({
40
+ color: color.value,
41
+ inputMethod: _analytics.INPUT_METHOD.SHORTCUT
42
+ })), list);
43
+ }
22
44
  return (0, _keymaps.keymap)(list);
23
45
  }
@@ -1,5 +1,9 @@
1
1
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import { bindKeymapWithCommand, keymap, toggleHighlightPalette } from '@atlaskit/editor-common/keymaps';
2
+ import { bindKeymapWithCommand, keymap, toggleHighlightPalette, applyYellowHighlight } from '@atlaskit/editor-common/keymaps';
3
+ import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
4
+ import { highlightColorPalette } from '@atlaskit/editor-common/ui-color';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
6
+ import { changeColor } from '../editor-commands/change-color';
3
7
  import { togglePalette } from '../editor-commands/palette';
4
8
  export function keymapPlugin({
5
9
  api
@@ -14,5 +18,22 @@ export function keymapPlugin({
14
18
  togglePalette(api)({
15
19
  inputMethod: INPUT_METHOD.SHORTCUT
16
20
  }), list);
21
+ if (fg('platform_editor_yellow_text_highlight_shortcut')) {
22
+ var _api$analytics;
23
+ const analyticsApi = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
24
+ // NOTE: This will work with fallback until we clean up `editor_text_highlight_orange_to_yellow`
25
+ const color = highlightColorPalette.find(({
26
+ label
27
+ }) => label === 'Yellow') || {
28
+ value: '#fedec8'
29
+ };
30
+ bindKeymapWithCommand(
31
+ // Ignored via go/ees005
32
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
33
+ applyYellowHighlight.common, editorCommandToPMCommand(changeColor(analyticsApi)({
34
+ color: color.value,
35
+ inputMethod: INPUT_METHOD.SHORTCUT
36
+ })), list);
37
+ }
17
38
  return keymap(list);
18
39
  }
@@ -1,5 +1,9 @@
1
1
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import { bindKeymapWithCommand, keymap, toggleHighlightPalette } from '@atlaskit/editor-common/keymaps';
2
+ import { bindKeymapWithCommand, keymap, toggleHighlightPalette, applyYellowHighlight } from '@atlaskit/editor-common/keymaps';
3
+ import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
4
+ import { highlightColorPalette } from '@atlaskit/editor-common/ui-color';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
6
+ import { changeColor } from '../editor-commands/change-color';
3
7
  import { togglePalette } from '../editor-commands/palette';
4
8
  export function keymapPlugin(_ref) {
5
9
  var api = _ref.api;
@@ -13,5 +17,23 @@ export function keymapPlugin(_ref) {
13
17
  togglePalette(api)({
14
18
  inputMethod: INPUT_METHOD.SHORTCUT
15
19
  }), list);
20
+ if (fg('platform_editor_yellow_text_highlight_shortcut')) {
21
+ var _api$analytics;
22
+ var analyticsApi = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
23
+ // NOTE: This will work with fallback until we clean up `editor_text_highlight_orange_to_yellow`
24
+ var color = highlightColorPalette.find(function (_ref2) {
25
+ var label = _ref2.label;
26
+ return label === 'Yellow';
27
+ }) || {
28
+ value: '#fedec8'
29
+ };
30
+ bindKeymapWithCommand(
31
+ // Ignored via go/ees005
32
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
33
+ applyYellowHighlight.common, editorCommandToPMCommand(changeColor(analyticsApi)({
34
+ color: color.value,
35
+ inputMethod: INPUT_METHOD.SHORTCUT
36
+ })), list);
37
+ }
16
38
  return keymap(list);
17
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-highlight",
3
- "version": "2.4.0",
3
+ "version": "2.5.1",
4
4
  "description": "Highlight plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@atlaskit/adf-schema": "^47.6.0",
40
- "@atlaskit/editor-common": "^103.15.0",
40
+ "@atlaskit/editor-common": "^104.0.0",
41
41
  "@atlaskit/editor-palette": "^2.1.0",
42
42
  "@atlaskit/editor-plugin-analytics": "^2.2.0",
43
43
  "@atlaskit/editor-plugin-primary-toolbar": "^3.2.0",
@@ -48,8 +48,8 @@
48
48
  "@atlaskit/editor-tables": "^2.9.0",
49
49
  "@atlaskit/icon": "^25.6.0",
50
50
  "@atlaskit/platform-feature-flags": "^1.1.0",
51
- "@atlaskit/primitives": "^14.4.0",
52
- "@atlaskit/tmp-editor-statsig": "^4.13.0",
51
+ "@atlaskit/primitives": "^14.7.0",
52
+ "@atlaskit/tmp-editor-statsig": "^4.16.0",
53
53
  "@atlaskit/tokens": "^4.8.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "@emotion/react": "^11.7.1"
@@ -110,6 +110,9 @@
110
110
  "type": "boolean",
111
111
  "referenceOnly": "true"
112
112
  },
113
+ "platform_editor_yellow_text_highlight_shortcut": {
114
+ "type": "boolean"
115
+ },
113
116
  "platform-visual-refresh-icons": {
114
117
  "type": "boolean"
115
118
  }