@atlaskit/editor-plugin-text-formatting 0.2.1 → 0.2.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,12 @@
1
1
  # @atlaskit/editor-plugin-text-formatting
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`24fc3925d73`](https://bitbucket.org/atlassian/atlassian-frontend/commits/24fc3925d73) - Add a new hook called `usePreset` accesed via `@atlaskit/editor-core/use-preset`. This hook can be used to safely access state and commands from outside the editor using `EditorContext`.
8
+ - Updated dependencies
9
+
3
10
  ## 0.2.1
4
11
 
5
12
  ### Patch Changes
@@ -11,25 +11,25 @@ var _commands = require("../commands");
11
11
  function keymapPlugin(schema, editorAnalyticsAPI) {
12
12
  var list = {};
13
13
  if (schema.marks.strong) {
14
- (0, _keymaps.bindKeymapWithPluginCommand)(_keymaps.toggleBold.common, (0, _commands.toggleStrongWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
14
+ (0, _keymaps.bindKeymapWithEditorCommand)(_keymaps.toggleBold.common, (0, _commands.toggleStrongWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
15
15
  }
16
16
  if (schema.marks.em) {
17
- (0, _keymaps.bindKeymapWithPluginCommand)(_keymaps.toggleItalic.common, (0, _commands.toggleEmWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
17
+ (0, _keymaps.bindKeymapWithEditorCommand)(_keymaps.toggleItalic.common, (0, _commands.toggleEmWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
18
18
  }
19
19
  if (schema.marks.code) {
20
- (0, _keymaps.bindKeymapWithPluginCommand)(_keymaps.toggleCode.common, (0, _commands.toggleCodeWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
20
+ (0, _keymaps.bindKeymapWithEditorCommand)(_keymaps.toggleCode.common, (0, _commands.toggleCodeWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
21
21
  }
22
22
  if (schema.marks.strike) {
23
- (0, _keymaps.bindKeymapWithPluginCommand)(_keymaps.toggleStrikethrough.common, (0, _commands.toggleStrikeWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
23
+ (0, _keymaps.bindKeymapWithEditorCommand)(_keymaps.toggleStrikethrough.common, (0, _commands.toggleStrikeWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
24
24
  }
25
25
  if (schema.marks.subsup) {
26
- (0, _keymaps.bindKeymapWithPluginCommand)(_keymaps.toggleSubscript.common, (0, _commands.toggleSubscriptWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
26
+ (0, _keymaps.bindKeymapWithEditorCommand)(_keymaps.toggleSubscript.common, (0, _commands.toggleSubscriptWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
27
27
  }
28
28
  if (schema.marks.subsup) {
29
- (0, _keymaps.bindKeymapWithPluginCommand)(_keymaps.toggleSuperscript.common, (0, _commands.toggleSuperscriptWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
29
+ (0, _keymaps.bindKeymapWithEditorCommand)(_keymaps.toggleSuperscript.common, (0, _commands.toggleSuperscriptWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
30
30
  }
31
31
  if (schema.marks.underline) {
32
- (0, _keymaps.bindKeymapWithPluginCommand)(_keymaps.toggleUnderline.common, (0, _commands.toggleUnderlineWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
32
+ (0, _keymaps.bindKeymapWithEditorCommand)(_keymaps.toggleUnderline.common, (0, _commands.toggleUnderlineWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
33
33
  }
34
34
  return (0, _keymap.keymap)(list);
35
35
  }
@@ -24,7 +24,7 @@ var _IconsMarkSchema;
24
24
  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); }
25
25
  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; }
26
26
  var withToolbarInputMethod = function withToolbarInputMethod(func) {
27
- return (0, _preset.pluginCommandToPMCommand)(func(_analytics.INPUT_METHOD.TOOLBAR));
27
+ return (0, _preset.editorCommandToPMCommand)(func(_analytics.INPUT_METHOD.TOOLBAR));
28
28
  };
29
29
  var IconButtons = function IconButtons(editorAnalyticsAPI) {
30
30
  return {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-text-formatting",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,29 +1,29 @@
1
1
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import { bindKeymapWithPluginCommand, toggleBold, toggleCode, toggleItalic, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleUnderline } from '@atlaskit/editor-common/keymaps';
2
+ import { bindKeymapWithEditorCommand, toggleBold, toggleCode, toggleItalic, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleUnderline } from '@atlaskit/editor-common/keymaps';
3
3
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
4
4
  import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from '../commands';
5
5
  export default function keymapPlugin(schema, editorAnalyticsAPI) {
6
6
  const list = {};
7
7
  if (schema.marks.strong) {
8
- bindKeymapWithPluginCommand(toggleBold.common, toggleStrongWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
8
+ bindKeymapWithEditorCommand(toggleBold.common, toggleStrongWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
9
9
  }
10
10
  if (schema.marks.em) {
11
- bindKeymapWithPluginCommand(toggleItalic.common, toggleEmWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
11
+ bindKeymapWithEditorCommand(toggleItalic.common, toggleEmWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
12
12
  }
13
13
  if (schema.marks.code) {
14
- bindKeymapWithPluginCommand(toggleCode.common, toggleCodeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
14
+ bindKeymapWithEditorCommand(toggleCode.common, toggleCodeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
15
15
  }
16
16
  if (schema.marks.strike) {
17
- bindKeymapWithPluginCommand(toggleStrikethrough.common, toggleStrikeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
17
+ bindKeymapWithEditorCommand(toggleStrikethrough.common, toggleStrikeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
18
18
  }
19
19
  if (schema.marks.subsup) {
20
- bindKeymapWithPluginCommand(toggleSubscript.common, toggleSubscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
20
+ bindKeymapWithEditorCommand(toggleSubscript.common, toggleSubscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
21
21
  }
22
22
  if (schema.marks.subsup) {
23
- bindKeymapWithPluginCommand(toggleSuperscript.common, toggleSuperscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
23
+ bindKeymapWithEditorCommand(toggleSuperscript.common, toggleSuperscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
24
24
  }
25
25
  if (schema.marks.underline) {
26
- bindKeymapWithPluginCommand(toggleUnderline.common, toggleUnderlineWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
26
+ bindKeymapWithEditorCommand(toggleUnderline.common, toggleUnderlineWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
27
27
  }
28
28
  return keymap(list);
29
29
  }
@@ -4,14 +4,14 @@ import { jsx } from '@emotion/react';
4
4
  import { INPUT_METHOD, TOOLBAR_ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
5
5
  import { getAriaKeyshortcuts, toggleBold, toggleCode, toggleItalic, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleUnderline, tooltip, ToolTipContent } from '@atlaskit/editor-common/keymaps';
6
6
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
7
- import { pluginCommandToPMCommand } from '@atlaskit/editor-common/preset';
7
+ import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
8
8
  import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
9
9
  import BoldIcon from '@atlaskit/icon/glyph/editor/bold';
10
10
  import ItalicIcon from '@atlaskit/icon/glyph/editor/italic';
11
11
  import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from '../../../commands';
12
12
  import { pluginKey as textFormattingPluginKey } from '../../../pm-plugins/plugin-key';
13
13
  import { IconTypes } from '../types';
14
- const withToolbarInputMethod = func => pluginCommandToPMCommand(func(INPUT_METHOD.TOOLBAR));
14
+ const withToolbarInputMethod = func => editorCommandToPMCommand(func(INPUT_METHOD.TOOLBAR));
15
15
  const IconButtons = editorAnalyticsAPI => ({
16
16
  strong: {
17
17
  buttonId: TOOLBAR_ACTION_SUBJECT_ID.TEXT_FORMATTING_STRONG,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-text-formatting",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,29 +1,29 @@
1
1
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import { bindKeymapWithPluginCommand, toggleBold, toggleCode, toggleItalic, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleUnderline } from '@atlaskit/editor-common/keymaps';
2
+ import { bindKeymapWithEditorCommand, toggleBold, toggleCode, toggleItalic, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleUnderline } from '@atlaskit/editor-common/keymaps';
3
3
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
4
4
  import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from '../commands';
5
5
  export default function keymapPlugin(schema, editorAnalyticsAPI) {
6
6
  var list = {};
7
7
  if (schema.marks.strong) {
8
- bindKeymapWithPluginCommand(toggleBold.common, toggleStrongWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
8
+ bindKeymapWithEditorCommand(toggleBold.common, toggleStrongWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
9
9
  }
10
10
  if (schema.marks.em) {
11
- bindKeymapWithPluginCommand(toggleItalic.common, toggleEmWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
11
+ bindKeymapWithEditorCommand(toggleItalic.common, toggleEmWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
12
12
  }
13
13
  if (schema.marks.code) {
14
- bindKeymapWithPluginCommand(toggleCode.common, toggleCodeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
14
+ bindKeymapWithEditorCommand(toggleCode.common, toggleCodeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
15
15
  }
16
16
  if (schema.marks.strike) {
17
- bindKeymapWithPluginCommand(toggleStrikethrough.common, toggleStrikeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
17
+ bindKeymapWithEditorCommand(toggleStrikethrough.common, toggleStrikeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
18
18
  }
19
19
  if (schema.marks.subsup) {
20
- bindKeymapWithPluginCommand(toggleSubscript.common, toggleSubscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
20
+ bindKeymapWithEditorCommand(toggleSubscript.common, toggleSubscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
21
21
  }
22
22
  if (schema.marks.subsup) {
23
- bindKeymapWithPluginCommand(toggleSuperscript.common, toggleSuperscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
23
+ bindKeymapWithEditorCommand(toggleSuperscript.common, toggleSuperscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
24
24
  }
25
25
  if (schema.marks.underline) {
26
- bindKeymapWithPluginCommand(toggleUnderline.common, toggleUnderlineWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
26
+ bindKeymapWithEditorCommand(toggleUnderline.common, toggleUnderlineWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
27
27
  }
28
28
  return keymap(list);
29
29
  }
@@ -6,7 +6,7 @@ import { jsx } from '@emotion/react';
6
6
  import { INPUT_METHOD, TOOLBAR_ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
7
7
  import { getAriaKeyshortcuts, toggleBold, toggleCode, toggleItalic, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleUnderline, tooltip, ToolTipContent } from '@atlaskit/editor-common/keymaps';
8
8
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
9
- import { pluginCommandToPMCommand } from '@atlaskit/editor-common/preset';
9
+ import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
10
10
  import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
11
11
  import BoldIcon from '@atlaskit/icon/glyph/editor/bold';
12
12
  import ItalicIcon from '@atlaskit/icon/glyph/editor/italic';
@@ -14,7 +14,7 @@ import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalyti
14
14
  import { pluginKey as textFormattingPluginKey } from '../../../pm-plugins/plugin-key';
15
15
  import { IconTypes } from '../types';
16
16
  var withToolbarInputMethod = function withToolbarInputMethod(func) {
17
- return pluginCommandToPMCommand(func(INPUT_METHOD.TOOLBAR));
17
+ return editorCommandToPMCommand(func(INPUT_METHOD.TOOLBAR));
18
18
  };
19
19
  var IconButtons = function IconButtons(editorAnalyticsAPI) {
20
20
  return {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-text-formatting",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,19 +1,19 @@
1
1
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
- import type { InputMethodBasic, PluginCommand } from '@atlaskit/editor-common/types';
3
- type ToggleMarkWithAnalyticsPluginCommand = (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => ToggleMarkPluginCommand;
4
- export type ToggleMarkPluginCommand = (inputMethod: InputMethodBasic) => PluginCommand;
5
- export declare const toggleEm: PluginCommand;
6
- export declare const toggleEmWithAnalytics: ToggleMarkWithAnalyticsPluginCommand;
7
- export declare const toggleStrike: PluginCommand;
8
- export declare const toggleStrikeWithAnalytics: ToggleMarkWithAnalyticsPluginCommand;
9
- export declare const toggleStrong: PluginCommand;
10
- export declare const toggleStrongWithAnalytics: ToggleMarkWithAnalyticsPluginCommand;
11
- export declare const toggleUnderline: PluginCommand;
12
- export declare const toggleUnderlineWithAnalytics: ToggleMarkWithAnalyticsPluginCommand;
13
- export declare const toggleSuperscript: PluginCommand;
14
- export declare const toggleSuperscriptWithAnalytics: ToggleMarkWithAnalyticsPluginCommand;
15
- export declare const toggleSubscript: PluginCommand;
16
- export declare const toggleSubscriptWithAnalytics: ToggleMarkWithAnalyticsPluginCommand;
17
- export declare const toggleCode: PluginCommand;
18
- export declare const toggleCodeWithAnalytics: ToggleMarkWithAnalyticsPluginCommand;
2
+ import type { EditorCommand, InputMethodBasic } from '@atlaskit/editor-common/types';
3
+ type ToggleMarkWithAnalyticsEditorCommand = (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => ToggleMarkEditorCommand;
4
+ export type ToggleMarkEditorCommand = (inputMethod: InputMethodBasic) => EditorCommand;
5
+ export declare const toggleEm: EditorCommand;
6
+ export declare const toggleEmWithAnalytics: ToggleMarkWithAnalyticsEditorCommand;
7
+ export declare const toggleStrike: EditorCommand;
8
+ export declare const toggleStrikeWithAnalytics: ToggleMarkWithAnalyticsEditorCommand;
9
+ export declare const toggleStrong: EditorCommand;
10
+ export declare const toggleStrongWithAnalytics: ToggleMarkWithAnalyticsEditorCommand;
11
+ export declare const toggleUnderline: EditorCommand;
12
+ export declare const toggleUnderlineWithAnalytics: ToggleMarkWithAnalyticsEditorCommand;
13
+ export declare const toggleSuperscript: EditorCommand;
14
+ export declare const toggleSuperscriptWithAnalytics: ToggleMarkWithAnalyticsEditorCommand;
15
+ export declare const toggleSubscript: EditorCommand;
16
+ export declare const toggleSubscriptWithAnalytics: ToggleMarkWithAnalyticsEditorCommand;
17
+ export declare const toggleCode: EditorCommand;
18
+ export declare const toggleCodeWithAnalytics: ToggleMarkWithAnalyticsEditorCommand;
19
19
  export {};
@@ -1,3 +1,3 @@
1
1
  export { textFormattingPlugin } from './plugin';
2
2
  export type { TextFormattingPlugin } from './plugin';
3
- export type { ToggleMarkPluginCommand } from './commands';
3
+ export type { ToggleMarkEditorCommand } from './commands';
@@ -1,17 +1,17 @@
1
1
  import type { NextEditorPlugin, OptionalPlugin, TextFormattingOptions } from '@atlaskit/editor-common/types';
2
2
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
- import type { ToggleMarkPluginCommand } from './commands';
3
+ import type { ToggleMarkEditorCommand } from './commands';
4
4
  export type TextFormattingPlugin = NextEditorPlugin<'textFormatting', {
5
5
  pluginConfiguration: TextFormattingOptions | undefined;
6
6
  dependencies: [OptionalPlugin<typeof analyticsPlugin>];
7
7
  commands: {
8
- toggleSuperscript: ToggleMarkPluginCommand;
9
- toggleSubscript: ToggleMarkPluginCommand;
10
- toggleStrike: ToggleMarkPluginCommand;
11
- toggleCode: ToggleMarkPluginCommand;
12
- toggleUnderline: ToggleMarkPluginCommand;
13
- toggleEm: ToggleMarkPluginCommand;
14
- toggleStrong: ToggleMarkPluginCommand;
8
+ toggleSuperscript: ToggleMarkEditorCommand;
9
+ toggleSubscript: ToggleMarkEditorCommand;
10
+ toggleStrike: ToggleMarkEditorCommand;
11
+ toggleCode: ToggleMarkEditorCommand;
12
+ toggleUnderline: ToggleMarkEditorCommand;
13
+ toggleEm: ToggleMarkEditorCommand;
14
+ toggleStrong: ToggleMarkEditorCommand;
15
15
  };
16
16
  }>;
17
17
  export declare const textFormattingPlugin: TextFormattingPlugin;
@@ -1,19 +1,19 @@
1
1
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
- import type { InputMethodBasic, PluginCommand } from '@atlaskit/editor-common/types';
3
- type ToggleMarkWithAnalyticsPluginCommand = (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => ToggleMarkPluginCommand;
4
- export type ToggleMarkPluginCommand = (inputMethod: InputMethodBasic) => PluginCommand;
5
- export declare const toggleEm: PluginCommand;
6
- export declare const toggleEmWithAnalytics: ToggleMarkWithAnalyticsPluginCommand;
7
- export declare const toggleStrike: PluginCommand;
8
- export declare const toggleStrikeWithAnalytics: ToggleMarkWithAnalyticsPluginCommand;
9
- export declare const toggleStrong: PluginCommand;
10
- export declare const toggleStrongWithAnalytics: ToggleMarkWithAnalyticsPluginCommand;
11
- export declare const toggleUnderline: PluginCommand;
12
- export declare const toggleUnderlineWithAnalytics: ToggleMarkWithAnalyticsPluginCommand;
13
- export declare const toggleSuperscript: PluginCommand;
14
- export declare const toggleSuperscriptWithAnalytics: ToggleMarkWithAnalyticsPluginCommand;
15
- export declare const toggleSubscript: PluginCommand;
16
- export declare const toggleSubscriptWithAnalytics: ToggleMarkWithAnalyticsPluginCommand;
17
- export declare const toggleCode: PluginCommand;
18
- export declare const toggleCodeWithAnalytics: ToggleMarkWithAnalyticsPluginCommand;
2
+ import type { EditorCommand, InputMethodBasic } from '@atlaskit/editor-common/types';
3
+ type ToggleMarkWithAnalyticsEditorCommand = (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => ToggleMarkEditorCommand;
4
+ export type ToggleMarkEditorCommand = (inputMethod: InputMethodBasic) => EditorCommand;
5
+ export declare const toggleEm: EditorCommand;
6
+ export declare const toggleEmWithAnalytics: ToggleMarkWithAnalyticsEditorCommand;
7
+ export declare const toggleStrike: EditorCommand;
8
+ export declare const toggleStrikeWithAnalytics: ToggleMarkWithAnalyticsEditorCommand;
9
+ export declare const toggleStrong: EditorCommand;
10
+ export declare const toggleStrongWithAnalytics: ToggleMarkWithAnalyticsEditorCommand;
11
+ export declare const toggleUnderline: EditorCommand;
12
+ export declare const toggleUnderlineWithAnalytics: ToggleMarkWithAnalyticsEditorCommand;
13
+ export declare const toggleSuperscript: EditorCommand;
14
+ export declare const toggleSuperscriptWithAnalytics: ToggleMarkWithAnalyticsEditorCommand;
15
+ export declare const toggleSubscript: EditorCommand;
16
+ export declare const toggleSubscriptWithAnalytics: ToggleMarkWithAnalyticsEditorCommand;
17
+ export declare const toggleCode: EditorCommand;
18
+ export declare const toggleCodeWithAnalytics: ToggleMarkWithAnalyticsEditorCommand;
19
19
  export {};
@@ -1,3 +1,3 @@
1
1
  export { textFormattingPlugin } from './plugin';
2
2
  export type { TextFormattingPlugin } from './plugin';
3
- export type { ToggleMarkPluginCommand } from './commands';
3
+ export type { ToggleMarkEditorCommand } from './commands';
@@ -1,19 +1,19 @@
1
1
  import type { NextEditorPlugin, OptionalPlugin, TextFormattingOptions } from '@atlaskit/editor-common/types';
2
2
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
- import type { ToggleMarkPluginCommand } from './commands';
3
+ import type { ToggleMarkEditorCommand } from './commands';
4
4
  export type TextFormattingPlugin = NextEditorPlugin<'textFormatting', {
5
5
  pluginConfiguration: TextFormattingOptions | undefined;
6
6
  dependencies: [
7
7
  OptionalPlugin<typeof analyticsPlugin>
8
8
  ];
9
9
  commands: {
10
- toggleSuperscript: ToggleMarkPluginCommand;
11
- toggleSubscript: ToggleMarkPluginCommand;
12
- toggleStrike: ToggleMarkPluginCommand;
13
- toggleCode: ToggleMarkPluginCommand;
14
- toggleUnderline: ToggleMarkPluginCommand;
15
- toggleEm: ToggleMarkPluginCommand;
16
- toggleStrong: ToggleMarkPluginCommand;
10
+ toggleSuperscript: ToggleMarkEditorCommand;
11
+ toggleSubscript: ToggleMarkEditorCommand;
12
+ toggleStrike: ToggleMarkEditorCommand;
13
+ toggleCode: ToggleMarkEditorCommand;
14
+ toggleUnderline: ToggleMarkEditorCommand;
15
+ toggleEm: ToggleMarkEditorCommand;
16
+ toggleStrong: ToggleMarkEditorCommand;
17
17
  };
18
18
  }>;
19
19
  export declare const textFormattingPlugin: TextFormattingPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-text-formatting",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Text-formatting plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^28.0.0",
35
- "@atlaskit/editor-common": "^74.45.0",
35
+ "@atlaskit/editor-common": "^74.46.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^0.1.0",
37
37
  "@atlaskit/editor-prosemirror": "1.1.0",
38
38
  "@atlaskit/editor-shared-styles": "^2.5.0",
package/report.api.md CHANGED
@@ -16,10 +16,10 @@
16
16
 
17
17
  ```ts
18
18
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
19
+ import type { EditorCommand } from '@atlaskit/editor-common/types';
19
20
  import type { InputMethodBasic } from '@atlaskit/editor-common/types';
20
21
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
21
22
  import type { OptionalPlugin } from '@atlaskit/editor-common/types';
22
- import type { PluginCommand } from '@atlaskit/editor-common/types';
23
23
  import type { TextFormattingOptions } from '@atlaskit/editor-common/types';
24
24
 
25
25
  // @public (undocumented)
@@ -29,13 +29,13 @@ export type TextFormattingPlugin = NextEditorPlugin<
29
29
  pluginConfiguration: TextFormattingOptions | undefined;
30
30
  dependencies: [OptionalPlugin<typeof analyticsPlugin>];
31
31
  commands: {
32
- toggleSuperscript: ToggleMarkPluginCommand;
33
- toggleSubscript: ToggleMarkPluginCommand;
34
- toggleStrike: ToggleMarkPluginCommand;
35
- toggleCode: ToggleMarkPluginCommand;
36
- toggleUnderline: ToggleMarkPluginCommand;
37
- toggleEm: ToggleMarkPluginCommand;
38
- toggleStrong: ToggleMarkPluginCommand;
32
+ toggleSuperscript: ToggleMarkEditorCommand;
33
+ toggleSubscript: ToggleMarkEditorCommand;
34
+ toggleStrike: ToggleMarkEditorCommand;
35
+ toggleCode: ToggleMarkEditorCommand;
36
+ toggleUnderline: ToggleMarkEditorCommand;
37
+ toggleEm: ToggleMarkEditorCommand;
38
+ toggleStrong: ToggleMarkEditorCommand;
39
39
  };
40
40
  }
41
41
  >;
@@ -44,9 +44,9 @@ export type TextFormattingPlugin = NextEditorPlugin<
44
44
  export const textFormattingPlugin: TextFormattingPlugin;
45
45
 
46
46
  // @public (undocumented)
47
- export type ToggleMarkPluginCommand = (
47
+ export type ToggleMarkEditorCommand = (
48
48
  inputMethod: InputMethodBasic,
49
- ) => PluginCommand;
49
+ ) => EditorCommand;
50
50
 
51
51
  // (No @packageDocumentation comment for this package)
52
52
  ```
@@ -5,10 +5,10 @@
5
5
  ```ts
6
6
 
7
7
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
8
+ import type { EditorCommand } from '@atlaskit/editor-common/types';
8
9
  import type { InputMethodBasic } from '@atlaskit/editor-common/types';
9
10
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
10
11
  import type { OptionalPlugin } from '@atlaskit/editor-common/types';
11
- import type { PluginCommand } from '@atlaskit/editor-common/types';
12
12
  import type { TextFormattingOptions } from '@atlaskit/editor-common/types';
13
13
 
14
14
  // @public (undocumented)
@@ -16,13 +16,13 @@ export type TextFormattingPlugin = NextEditorPlugin<'textFormatting', {
16
16
  pluginConfiguration: TextFormattingOptions | undefined;
17
17
  dependencies: [OptionalPlugin<typeof analyticsPlugin>];
18
18
  commands: {
19
- toggleSuperscript: ToggleMarkPluginCommand;
20
- toggleSubscript: ToggleMarkPluginCommand;
21
- toggleStrike: ToggleMarkPluginCommand;
22
- toggleCode: ToggleMarkPluginCommand;
23
- toggleUnderline: ToggleMarkPluginCommand;
24
- toggleEm: ToggleMarkPluginCommand;
25
- toggleStrong: ToggleMarkPluginCommand;
19
+ toggleSuperscript: ToggleMarkEditorCommand;
20
+ toggleSubscript: ToggleMarkEditorCommand;
21
+ toggleStrike: ToggleMarkEditorCommand;
22
+ toggleCode: ToggleMarkEditorCommand;
23
+ toggleUnderline: ToggleMarkEditorCommand;
24
+ toggleEm: ToggleMarkEditorCommand;
25
+ toggleStrong: ToggleMarkEditorCommand;
26
26
  };
27
27
  }>;
28
28
 
@@ -30,7 +30,7 @@ export type TextFormattingPlugin = NextEditorPlugin<'textFormatting', {
30
30
  export const textFormattingPlugin: TextFormattingPlugin;
31
31
 
32
32
  // @public (undocumented)
33
- export type ToggleMarkPluginCommand = (inputMethod: InputMethodBasic) => PluginCommand;
33
+ export type ToggleMarkEditorCommand = (inputMethod: InputMethodBasic) => EditorCommand;
34
34
 
35
35
  // (No @packageDocumentation comment for this package)
36
36