@atlaskit/editor-plugin-text-formatting 6.1.0 → 6.1.2

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,19 @@
1
1
  # @atlaskit/editor-plugin-text-formatting
2
2
 
3
+ ## 6.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`cce679578db3d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cce679578db3d) -
8
+ upgrade browser util, and improve formatting keymaps
9
+ - Updated dependencies
10
+
11
+ ## 6.1.1
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 6.1.0
4
18
 
5
19
  ### Minor Changes
@@ -8,11 +8,13 @@ exports.keymapPlugin = keymapPlugin;
8
8
  var _analytics = require("@atlaskit/editor-common/analytics");
9
9
  var _keymaps = require("@atlaskit/editor-common/keymaps");
10
10
  var _keymap = require("@atlaskit/editor-prosemirror/keymap");
11
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
11
12
  var _clearFormatting = require("../editor-commands/clear-formatting");
12
13
  function keymapPlugin(editorAnalyticsAPI) {
13
14
  var list = {};
14
- (0, _keymaps.bindKeymapWithEditorCommand)(
15
- // Ignored via go/ees005
15
+ (0, _keymaps.bindKeymapWithEditorCommand)((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ?
16
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
17
+ (0, _keymaps.findShortcutByKeymap)(_keymaps.clearFormatting) :
16
18
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
17
19
  _keymaps.clearFormatting.common, (0, _clearFormatting.clearFormattingWithAnalyticsNext)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
18
20
  return (0, _keymap.keymap)(list);
@@ -8,50 +8,58 @@ var _analytics = require("@atlaskit/editor-common/analytics");
8
8
  var _keymaps = require("@atlaskit/editor-common/keymaps");
9
9
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
10
10
  var _keymap = require("@atlaskit/editor-prosemirror/keymap");
11
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
11
12
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
12
13
  var _toggleMark = require("../editor-commands/toggle-mark");
13
14
  var _pluginKey = require("./plugin-key");
14
15
  function keymapPlugin(schema, editorAnalyticsAPI) {
15
16
  var list = {};
16
17
  if (schema.marks.strong) {
17
- (0, _keymaps.bindKeymapWithEditorCommand)(
18
- // Ignored via go/ees005
18
+ (0, _keymaps.bindKeymapWithEditorCommand)((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ?
19
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
20
+ (0, _keymaps.findShortcutByKeymap)(_keymaps.toggleBold) :
19
21
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
20
22
  _keymaps.toggleBold.common, (0, _toggleMark.toggleStrongWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
21
23
  }
22
24
  if (schema.marks.em) {
23
- (0, _keymaps.bindKeymapWithEditorCommand)(
24
- // Ignored via go/ees005
25
+ (0, _keymaps.bindKeymapWithEditorCommand)((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ?
26
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
27
+ (0, _keymaps.findShortcutByKeymap)(_keymaps.toggleItalic) :
25
28
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
26
29
  _keymaps.toggleItalic.common, (0, _toggleMark.toggleEmWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
27
30
  }
28
31
  if (schema.marks.code) {
29
- (0, _keymaps.bindKeymapWithEditorCommand)(
30
- // Ignored via go/ees005
32
+ (0, _keymaps.bindKeymapWithEditorCommand)((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ?
33
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
34
+ (0, _keymaps.findShortcutByKeymap)(_keymaps.toggleCode) :
31
35
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
32
36
  _keymaps.toggleCode.common, (0, _toggleMark.toggleCodeWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
33
37
  }
34
38
  if (schema.marks.strike) {
35
- (0, _keymaps.bindKeymapWithEditorCommand)(
36
- // Ignored via go/ees005
39
+ (0, _keymaps.bindKeymapWithEditorCommand)((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ?
40
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
41
+ (0, _keymaps.findShortcutByKeymap)(_keymaps.toggleStrikethrough) :
37
42
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
38
43
  _keymaps.toggleStrikethrough.common, (0, _toggleMark.toggleStrikeWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
39
44
  }
40
45
  if (schema.marks.subsup) {
41
- (0, _keymaps.bindKeymapWithEditorCommand)(
42
- // Ignored via go/ees005
46
+ (0, _keymaps.bindKeymapWithEditorCommand)((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ?
47
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
48
+ (0, _keymaps.findShortcutByKeymap)(_keymaps.toggleSubscript) :
43
49
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
44
50
  _keymaps.toggleSubscript.common, (0, _toggleMark.toggleSubscriptWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
45
51
  }
46
52
  if (schema.marks.subsup) {
47
- (0, _keymaps.bindKeymapWithEditorCommand)(
48
- // Ignored via go/ees005
53
+ (0, _keymaps.bindKeymapWithEditorCommand)((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ?
54
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
55
+ (0, _keymaps.findShortcutByKeymap)(_keymaps.toggleSuperscript) :
49
56
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
50
57
  _keymaps.toggleSuperscript.common, (0, _toggleMark.toggleSuperscriptWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
51
58
  }
52
59
  if (schema.marks.underline) {
53
- (0, _keymaps.bindKeymapWithEditorCommand)(
54
- // Ignored via go/ees005
60
+ (0, _keymaps.bindKeymapWithEditorCommand)((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ?
61
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
62
+ (0, _keymaps.findShortcutByKeymap)(_keymaps.toggleUnderline) :
55
63
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
56
64
  _keymaps.toggleUnderline.common, (0, _toggleMark.toggleUnderlineWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
57
65
  }
@@ -59,44 +67,51 @@ function keymapPlugin(schema, editorAnalyticsAPI) {
59
67
  var textFormattingState = _pluginKey.pluginKey.getState(view.state);
60
68
  var list = {};
61
69
  if (schema.marks.strong && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.strongDisabled)) {
62
- (0, _keymaps.bindKeymapWithEditorCommand)(
63
- // Ignored via go/ees005
70
+ (0, _keymaps.bindKeymapWithEditorCommand)((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ?
71
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
72
+ (0, _keymaps.findShortcutByKeymap)(_keymaps.toggleBold) :
64
73
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
65
74
  _keymaps.toggleBold.common, (0, _toggleMark.toggleStrongWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
66
75
  }
67
76
  if (schema.marks.em && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.emDisabled)) {
68
- (0, _keymaps.bindKeymapWithEditorCommand)(
69
- // Ignored via go/ees005
77
+ (0, _keymaps.bindKeymapWithEditorCommand)((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ?
78
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
79
+ (0, _keymaps.findShortcutByKeymap)(_keymaps.toggleItalic) :
70
80
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
71
81
  _keymaps.toggleItalic.common, (0, _toggleMark.toggleEmWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
72
82
  }
73
83
  if (schema.marks.code && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.codeDisabled)) {
74
- (0, _keymaps.bindKeymapWithEditorCommand)(
75
- // Ignored via go/ees005
84
+ (0, _keymaps.bindKeymapWithEditorCommand)((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ?
85
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
86
+ (0, _keymaps.findShortcutByKeymap)(_keymaps.toggleCode) :
76
87
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
77
88
  _keymaps.toggleCode.common, (0, _toggleMark.toggleCodeWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
78
89
  }
79
90
  if (schema.marks.strike && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.strikeDisabled)) {
80
- (0, _keymaps.bindKeymapWithEditorCommand)(
81
- // Ignored via go/ees005
91
+ (0, _keymaps.bindKeymapWithEditorCommand)((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ?
92
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
93
+ (0, _keymaps.findShortcutByKeymap)(_keymaps.toggleStrikethrough) :
82
94
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
83
95
  _keymaps.toggleStrikethrough.common, (0, _toggleMark.toggleStrikeWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
84
96
  }
85
97
  if (schema.marks.subsup && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.subscriptDisabled)) {
86
- (0, _keymaps.bindKeymapWithEditorCommand)(
87
- // Ignored via go/ees005
98
+ (0, _keymaps.bindKeymapWithEditorCommand)((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ?
99
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
100
+ (0, _keymaps.findShortcutByKeymap)(_keymaps.toggleSubscript) :
88
101
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
89
102
  _keymaps.toggleSubscript.common, (0, _toggleMark.toggleSubscriptWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
90
103
  }
91
104
  if (schema.marks.subsup && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.superscriptDisabled)) {
92
- (0, _keymaps.bindKeymapWithEditorCommand)(
93
- // Ignored via go/ees005
105
+ (0, _keymaps.bindKeymapWithEditorCommand)((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ?
106
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
107
+ (0, _keymaps.findShortcutByKeymap)(_keymaps.toggleSuperscript) :
94
108
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
95
109
  _keymaps.toggleSuperscript.common, (0, _toggleMark.toggleSuperscriptWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
96
110
  }
97
111
  if (schema.marks.underline && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.underlineDisabled)) {
98
- (0, _keymaps.bindKeymapWithEditorCommand)(
99
- // Ignored via go/ees005
112
+ (0, _keymaps.bindKeymapWithEditorCommand)((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ?
113
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
114
+ (0, _keymaps.findShortcutByKeymap)(_keymaps.toggleUnderline) :
100
115
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
101
116
  _keymaps.toggleUnderline.common, (0, _toggleMark.toggleUnderlineWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
102
117
  }
@@ -1,11 +1,13 @@
1
1
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import { bindKeymapWithEditorCommand, clearFormatting } from '@atlaskit/editor-common/keymaps';
2
+ import { bindKeymapWithEditorCommand, clearFormatting, findShortcutByKeymap } from '@atlaskit/editor-common/keymaps';
3
3
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  import { clearFormattingWithAnalyticsNext } from '../editor-commands/clear-formatting';
5
6
  export function keymapPlugin(editorAnalyticsAPI) {
6
7
  const list = {};
7
- bindKeymapWithEditorCommand(
8
- // Ignored via go/ees005
8
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
9
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
10
+ findShortcutByKeymap(clearFormatting) :
9
11
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
10
12
  clearFormatting.common, clearFormattingWithAnalyticsNext(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
11
13
  return keymap(list);
@@ -1,51 +1,59 @@
1
1
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import { bindKeymapWithEditorCommand, isCapsLockOnAndModifyKeyboardEvent, toggleBold, toggleCode, toggleItalic, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleUnderline } from '@atlaskit/editor-common/keymaps';
2
+ import { bindKeymapWithEditorCommand, findShortcutByKeymap, isCapsLockOnAndModifyKeyboardEvent, toggleBold, toggleCode, toggleItalic, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleUnderline } from '@atlaskit/editor-common/keymaps';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
4
  import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
5
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
6
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
6
7
  import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from '../editor-commands/toggle-mark';
7
8
  import { pluginKey } from './plugin-key';
8
9
  export default function keymapPlugin(schema, editorAnalyticsAPI) {
9
10
  const list = {};
10
11
  if (schema.marks.strong) {
11
- bindKeymapWithEditorCommand(
12
- // Ignored via go/ees005
12
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
13
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
14
+ findShortcutByKeymap(toggleBold) :
13
15
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
14
16
  toggleBold.common, toggleStrongWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
15
17
  }
16
18
  if (schema.marks.em) {
17
- bindKeymapWithEditorCommand(
18
- // Ignored via go/ees005
19
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
20
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
21
+ findShortcutByKeymap(toggleItalic) :
19
22
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
20
23
  toggleItalic.common, toggleEmWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
21
24
  }
22
25
  if (schema.marks.code) {
23
- bindKeymapWithEditorCommand(
24
- // Ignored via go/ees005
26
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
27
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
28
+ findShortcutByKeymap(toggleCode) :
25
29
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
26
30
  toggleCode.common, toggleCodeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
27
31
  }
28
32
  if (schema.marks.strike) {
29
- bindKeymapWithEditorCommand(
30
- // Ignored via go/ees005
33
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
34
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
35
+ findShortcutByKeymap(toggleStrikethrough) :
31
36
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
32
37
  toggleStrikethrough.common, toggleStrikeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
33
38
  }
34
39
  if (schema.marks.subsup) {
35
- bindKeymapWithEditorCommand(
36
- // Ignored via go/ees005
40
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
41
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
42
+ findShortcutByKeymap(toggleSubscript) :
37
43
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
38
44
  toggleSubscript.common, toggleSubscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
39
45
  }
40
46
  if (schema.marks.subsup) {
41
- bindKeymapWithEditorCommand(
42
- // Ignored via go/ees005
47
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
48
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
49
+ findShortcutByKeymap(toggleSuperscript) :
43
50
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
44
51
  toggleSuperscript.common, toggleSuperscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
45
52
  }
46
53
  if (schema.marks.underline) {
47
- bindKeymapWithEditorCommand(
48
- // Ignored via go/ees005
54
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
55
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
56
+ findShortcutByKeymap(toggleUnderline) :
49
57
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
50
58
  toggleUnderline.common, toggleUnderlineWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
51
59
  }
@@ -53,44 +61,51 @@ export default function keymapPlugin(schema, editorAnalyticsAPI) {
53
61
  const textFormattingState = pluginKey.getState(view.state);
54
62
  const list = {};
55
63
  if (schema.marks.strong && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.strongDisabled)) {
56
- bindKeymapWithEditorCommand(
57
- // Ignored via go/ees005
64
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
65
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
66
+ findShortcutByKeymap(toggleBold) :
58
67
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
59
68
  toggleBold.common, toggleStrongWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
60
69
  }
61
70
  if (schema.marks.em && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.emDisabled)) {
62
- bindKeymapWithEditorCommand(
63
- // Ignored via go/ees005
71
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
72
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
73
+ findShortcutByKeymap(toggleItalic) :
64
74
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
65
75
  toggleItalic.common, toggleEmWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
66
76
  }
67
77
  if (schema.marks.code && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.codeDisabled)) {
68
- bindKeymapWithEditorCommand(
69
- // Ignored via go/ees005
78
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
79
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
80
+ findShortcutByKeymap(toggleCode) :
70
81
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
71
82
  toggleCode.common, toggleCodeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
72
83
  }
73
84
  if (schema.marks.strike && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.strikeDisabled)) {
74
- bindKeymapWithEditorCommand(
75
- // Ignored via go/ees005
85
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
86
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
87
+ findShortcutByKeymap(toggleStrikethrough) :
76
88
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
77
89
  toggleStrikethrough.common, toggleStrikeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
78
90
  }
79
91
  if (schema.marks.subsup && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.subscriptDisabled)) {
80
- bindKeymapWithEditorCommand(
81
- // Ignored via go/ees005
92
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
93
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
94
+ findShortcutByKeymap(toggleSubscript) :
82
95
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
83
96
  toggleSubscript.common, toggleSubscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
84
97
  }
85
98
  if (schema.marks.subsup && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.superscriptDisabled)) {
86
- bindKeymapWithEditorCommand(
87
- // Ignored via go/ees005
99
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
100
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
101
+ findShortcutByKeymap(toggleSuperscript) :
88
102
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
89
103
  toggleSuperscript.common, toggleSuperscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
90
104
  }
91
105
  if (schema.marks.underline && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.underlineDisabled)) {
92
- bindKeymapWithEditorCommand(
93
- // Ignored via go/ees005
106
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
107
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
108
+ findShortcutByKeymap(toggleUnderline) :
94
109
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
95
110
  toggleUnderline.common, toggleUnderlineWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
96
111
  }
@@ -1,11 +1,13 @@
1
1
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import { bindKeymapWithEditorCommand, clearFormatting } from '@atlaskit/editor-common/keymaps';
2
+ import { bindKeymapWithEditorCommand, clearFormatting, findShortcutByKeymap } from '@atlaskit/editor-common/keymaps';
3
3
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  import { clearFormattingWithAnalyticsNext } from '../editor-commands/clear-formatting';
5
6
  export function keymapPlugin(editorAnalyticsAPI) {
6
7
  var list = {};
7
- bindKeymapWithEditorCommand(
8
- // Ignored via go/ees005
8
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
9
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
10
+ findShortcutByKeymap(clearFormatting) :
9
11
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
10
12
  clearFormatting.common, clearFormattingWithAnalyticsNext(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
11
13
  return keymap(list);
@@ -1,51 +1,59 @@
1
1
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import { bindKeymapWithEditorCommand, isCapsLockOnAndModifyKeyboardEvent, toggleBold, toggleCode, toggleItalic, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleUnderline } from '@atlaskit/editor-common/keymaps';
2
+ import { bindKeymapWithEditorCommand, findShortcutByKeymap, isCapsLockOnAndModifyKeyboardEvent, toggleBold, toggleCode, toggleItalic, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleUnderline } from '@atlaskit/editor-common/keymaps';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
4
  import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
5
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
6
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
6
7
  import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from '../editor-commands/toggle-mark';
7
8
  import { pluginKey } from './plugin-key';
8
9
  export default function keymapPlugin(schema, editorAnalyticsAPI) {
9
10
  var list = {};
10
11
  if (schema.marks.strong) {
11
- bindKeymapWithEditorCommand(
12
- // Ignored via go/ees005
12
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
13
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
14
+ findShortcutByKeymap(toggleBold) :
13
15
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
14
16
  toggleBold.common, toggleStrongWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
15
17
  }
16
18
  if (schema.marks.em) {
17
- bindKeymapWithEditorCommand(
18
- // Ignored via go/ees005
19
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
20
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
21
+ findShortcutByKeymap(toggleItalic) :
19
22
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
20
23
  toggleItalic.common, toggleEmWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
21
24
  }
22
25
  if (schema.marks.code) {
23
- bindKeymapWithEditorCommand(
24
- // Ignored via go/ees005
26
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
27
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
28
+ findShortcutByKeymap(toggleCode) :
25
29
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
26
30
  toggleCode.common, toggleCodeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
27
31
  }
28
32
  if (schema.marks.strike) {
29
- bindKeymapWithEditorCommand(
30
- // Ignored via go/ees005
33
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
34
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
35
+ findShortcutByKeymap(toggleStrikethrough) :
31
36
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
32
37
  toggleStrikethrough.common, toggleStrikeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
33
38
  }
34
39
  if (schema.marks.subsup) {
35
- bindKeymapWithEditorCommand(
36
- // Ignored via go/ees005
40
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
41
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
42
+ findShortcutByKeymap(toggleSubscript) :
37
43
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
38
44
  toggleSubscript.common, toggleSubscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
39
45
  }
40
46
  if (schema.marks.subsup) {
41
- bindKeymapWithEditorCommand(
42
- // Ignored via go/ees005
47
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
48
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
49
+ findShortcutByKeymap(toggleSuperscript) :
43
50
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
44
51
  toggleSuperscript.common, toggleSuperscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
45
52
  }
46
53
  if (schema.marks.underline) {
47
- bindKeymapWithEditorCommand(
48
- // Ignored via go/ees005
54
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
55
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
56
+ findShortcutByKeymap(toggleUnderline) :
49
57
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
50
58
  toggleUnderline.common, toggleUnderlineWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
51
59
  }
@@ -53,44 +61,51 @@ export default function keymapPlugin(schema, editorAnalyticsAPI) {
53
61
  var textFormattingState = pluginKey.getState(view.state);
54
62
  var list = {};
55
63
  if (schema.marks.strong && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.strongDisabled)) {
56
- bindKeymapWithEditorCommand(
57
- // Ignored via go/ees005
64
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
65
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
66
+ findShortcutByKeymap(toggleBold) :
58
67
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
59
68
  toggleBold.common, toggleStrongWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
60
69
  }
61
70
  if (schema.marks.em && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.emDisabled)) {
62
- bindKeymapWithEditorCommand(
63
- // Ignored via go/ees005
71
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
72
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
73
+ findShortcutByKeymap(toggleItalic) :
64
74
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
65
75
  toggleItalic.common, toggleEmWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
66
76
  }
67
77
  if (schema.marks.code && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.codeDisabled)) {
68
- bindKeymapWithEditorCommand(
69
- // Ignored via go/ees005
78
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
79
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
80
+ findShortcutByKeymap(toggleCode) :
70
81
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
71
82
  toggleCode.common, toggleCodeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
72
83
  }
73
84
  if (schema.marks.strike && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.strikeDisabled)) {
74
- bindKeymapWithEditorCommand(
75
- // Ignored via go/ees005
85
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
86
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
87
+ findShortcutByKeymap(toggleStrikethrough) :
76
88
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
77
89
  toggleStrikethrough.common, toggleStrikeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
78
90
  }
79
91
  if (schema.marks.subsup && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.subscriptDisabled)) {
80
- bindKeymapWithEditorCommand(
81
- // Ignored via go/ees005
92
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
93
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
94
+ findShortcutByKeymap(toggleSubscript) :
82
95
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
83
96
  toggleSubscript.common, toggleSubscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
84
97
  }
85
98
  if (schema.marks.subsup && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.superscriptDisabled)) {
86
- bindKeymapWithEditorCommand(
87
- // Ignored via go/ees005
99
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
100
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
101
+ findShortcutByKeymap(toggleSuperscript) :
88
102
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
89
103
  toggleSuperscript.common, toggleSuperscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
90
104
  }
91
105
  if (schema.marks.underline && !(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.underlineDisabled)) {
92
- bindKeymapWithEditorCommand(
93
- // Ignored via go/ees005
106
+ bindKeymapWithEditorCommand(expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ?
107
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
108
+ findShortcutByKeymap(toggleUnderline) :
94
109
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
95
110
  toggleUnderline.common, toggleUnderlineWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
96
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-text-formatting",
3
- "version": "6.1.0",
3
+ "version": "6.1.2",
4
4
  "description": "Text-formatting plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,21 +36,21 @@
36
36
  "@atlaskit/editor-plugin-selection-toolbar": "^7.0.0",
37
37
  "@atlaskit/editor-plugin-toolbar": "^3.3.0",
38
38
  "@atlaskit/editor-prosemirror": "7.0.0",
39
- "@atlaskit/editor-shared-styles": "^3.7.0",
39
+ "@atlaskit/editor-shared-styles": "^3.8.0",
40
40
  "@atlaskit/editor-tables": "^2.9.0",
41
- "@atlaskit/editor-toolbar": "^0.15.0",
41
+ "@atlaskit/editor-toolbar": "^0.16.0",
42
42
  "@atlaskit/editor-toolbar-model": "^0.2.0",
43
43
  "@atlaskit/icon": "^28.5.0",
44
44
  "@atlaskit/platform-feature-flags": "^1.1.0",
45
45
  "@atlaskit/prosemirror-input-rules": "^3.5.0",
46
- "@atlaskit/tmp-editor-statsig": "^13.13.0",
46
+ "@atlaskit/tmp-editor-statsig": "^13.18.0",
47
47
  "@atlaskit/tokens": "^7.0.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@emotion/react": "^11.7.1",
50
50
  "react-intl-next": "npm:react-intl@^5.18.1"
51
51
  },
52
52
  "peerDependencies": {
53
- "@atlaskit/editor-common": "^110.14.0",
53
+ "@atlaskit/editor-common": "^110.17.0",
54
54
  "react": "^18.2.0"
55
55
  },
56
56
  "devDependencies": {