@atlaskit/editor-plugin-text-formatting 0.2.0 → 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 +13 -0
- package/dist/cjs/pm-plugins/clear-formatting-keymap.js +2 -5
- package/dist/cjs/pm-plugins/keymap.js +7 -7
- package/dist/cjs/ui/Toolbar/hooks/formatting-icons.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/pm-plugins/clear-formatting-keymap.js +2 -2
- package/dist/es2019/pm-plugins/keymap.js +8 -8
- package/dist/es2019/ui/Toolbar/hooks/formatting-icons.js +2 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/pm-plugins/clear-formatting-keymap.js +2 -2
- package/dist/esm/pm-plugins/keymap.js +8 -8
- package/dist/esm/ui/Toolbar/hooks/formatting-icons.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/commands.d.ts +17 -17
- package/dist/types/index.d.ts +1 -1
- package/dist/types/plugin.d.ts +8 -8
- package/dist/types-ts4.5/commands.d.ts +17 -17
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/plugin.d.ts +8 -8
- package/package.json +3 -3
- package/report.api.md +10 -10
- package/tmp/api-report-tmp.d.ts +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
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
|
+
|
|
10
|
+
## 0.2.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`5365e42ef97`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5365e42ef97) - cleaned up more of the \* as keymaps imports to enable better tree-shaking
|
|
15
|
+
|
|
3
16
|
## 0.2.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
7
|
exports.keymapPlugin = keymapPlugin;
|
|
9
8
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
|
-
var
|
|
9
|
+
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
11
10
|
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
12
11
|
var _clearFormatting = require("../commands/clear-formatting");
|
|
13
|
-
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); }
|
|
14
|
-
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; }
|
|
15
12
|
function keymapPlugin(editorAnalyticsAPI) {
|
|
16
13
|
var list = {};
|
|
17
|
-
|
|
14
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.clearFormatting.common, (0, _clearFormatting.clearFormattingWithAnalytics)(_analytics.INPUT_METHOD.SHORTCUT, editorAnalyticsAPI), list);
|
|
18
15
|
return (0, _keymap.keymap)(list);
|
|
19
16
|
}
|
|
20
17
|
var _default = keymapPlugin;
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
27
|
+
return (0, _preset.editorCommandToPMCommand)(func(_analytics.INPUT_METHOD.TOOLBAR));
|
|
28
28
|
};
|
|
29
29
|
var IconButtons = function IconButtons(editorAnalyticsAPI) {
|
|
30
30
|
return {
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import
|
|
2
|
+
import { bindKeymapWithCommand, clearFormatting } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
4
|
import { clearFormattingWithAnalytics } from '../commands/clear-formatting';
|
|
5
5
|
export function keymapPlugin(editorAnalyticsAPI) {
|
|
6
6
|
const list = {};
|
|
7
|
-
|
|
7
|
+
bindKeymapWithCommand(clearFormatting.common, clearFormattingWithAnalytics(INPUT_METHOD.SHORTCUT, editorAnalyticsAPI), list);
|
|
8
8
|
return keymap(list);
|
|
9
9
|
}
|
|
10
10
|
export default keymapPlugin;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import {
|
|
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
|
-
|
|
8
|
+
bindKeymapWithEditorCommand(toggleBold.common, toggleStrongWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
|
|
9
9
|
}
|
|
10
10
|
if (schema.marks.em) {
|
|
11
|
-
|
|
11
|
+
bindKeymapWithEditorCommand(toggleItalic.common, toggleEmWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
|
|
12
12
|
}
|
|
13
13
|
if (schema.marks.code) {
|
|
14
|
-
|
|
14
|
+
bindKeymapWithEditorCommand(toggleCode.common, toggleCodeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
|
|
15
15
|
}
|
|
16
16
|
if (schema.marks.strike) {
|
|
17
|
-
|
|
17
|
+
bindKeymapWithEditorCommand(toggleStrikethrough.common, toggleStrikeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
|
|
18
18
|
}
|
|
19
19
|
if (schema.marks.subsup) {
|
|
20
|
-
|
|
20
|
+
bindKeymapWithEditorCommand(toggleSubscript.common, toggleSubscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
|
|
21
21
|
}
|
|
22
22
|
if (schema.marks.subsup) {
|
|
23
|
-
|
|
23
|
+
bindKeymapWithEditorCommand(toggleSuperscript.common, toggleSuperscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
|
|
24
24
|
}
|
|
25
25
|
if (schema.marks.underline) {
|
|
26
|
-
|
|
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 {
|
|
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 =>
|
|
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,
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import
|
|
2
|
+
import { bindKeymapWithCommand, clearFormatting } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
4
|
import { clearFormattingWithAnalytics } from '../commands/clear-formatting';
|
|
5
5
|
export function keymapPlugin(editorAnalyticsAPI) {
|
|
6
6
|
var list = {};
|
|
7
|
-
|
|
7
|
+
bindKeymapWithCommand(clearFormatting.common, clearFormattingWithAnalytics(INPUT_METHOD.SHORTCUT, editorAnalyticsAPI), list);
|
|
8
8
|
return keymap(list);
|
|
9
9
|
}
|
|
10
10
|
export default keymapPlugin;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import {
|
|
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
|
-
|
|
8
|
+
bindKeymapWithEditorCommand(toggleBold.common, toggleStrongWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
|
|
9
9
|
}
|
|
10
10
|
if (schema.marks.em) {
|
|
11
|
-
|
|
11
|
+
bindKeymapWithEditorCommand(toggleItalic.common, toggleEmWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
|
|
12
12
|
}
|
|
13
13
|
if (schema.marks.code) {
|
|
14
|
-
|
|
14
|
+
bindKeymapWithEditorCommand(toggleCode.common, toggleCodeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
|
|
15
15
|
}
|
|
16
16
|
if (schema.marks.strike) {
|
|
17
|
-
|
|
17
|
+
bindKeymapWithEditorCommand(toggleStrikethrough.common, toggleStrikeWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
|
|
18
18
|
}
|
|
19
19
|
if (schema.marks.subsup) {
|
|
20
|
-
|
|
20
|
+
bindKeymapWithEditorCommand(toggleSubscript.common, toggleSubscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
|
|
21
21
|
}
|
|
22
22
|
if (schema.marks.subsup) {
|
|
23
|
-
|
|
23
|
+
bindKeymapWithEditorCommand(toggleSuperscript.common, toggleSuperscriptWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT), list);
|
|
24
24
|
}
|
|
25
25
|
if (schema.marks.underline) {
|
|
26
|
-
|
|
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 {
|
|
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
|
|
17
|
+
return editorCommandToPMCommand(func(INPUT_METHOD.TOOLBAR));
|
|
18
18
|
};
|
|
19
19
|
var IconButtons = function IconButtons(editorAnalyticsAPI) {
|
|
20
20
|
return {
|
package/dist/esm/version.json
CHANGED
package/dist/types/commands.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type {
|
|
3
|
-
type
|
|
4
|
-
export type
|
|
5
|
-
export declare const toggleEm:
|
|
6
|
-
export declare const toggleEmWithAnalytics:
|
|
7
|
-
export declare const toggleStrike:
|
|
8
|
-
export declare const toggleStrikeWithAnalytics:
|
|
9
|
-
export declare const toggleStrong:
|
|
10
|
-
export declare const toggleStrongWithAnalytics:
|
|
11
|
-
export declare const toggleUnderline:
|
|
12
|
-
export declare const toggleUnderlineWithAnalytics:
|
|
13
|
-
export declare const toggleSuperscript:
|
|
14
|
-
export declare const toggleSuperscriptWithAnalytics:
|
|
15
|
-
export declare const toggleSubscript:
|
|
16
|
-
export declare const toggleSubscriptWithAnalytics:
|
|
17
|
-
export declare const toggleCode:
|
|
18
|
-
export declare const toggleCodeWithAnalytics:
|
|
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 {};
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/plugin.d.ts
CHANGED
|
@@ -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 {
|
|
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:
|
|
9
|
-
toggleSubscript:
|
|
10
|
-
toggleStrike:
|
|
11
|
-
toggleCode:
|
|
12
|
-
toggleUnderline:
|
|
13
|
-
toggleEm:
|
|
14
|
-
toggleStrong:
|
|
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 {
|
|
3
|
-
type
|
|
4
|
-
export type
|
|
5
|
-
export declare const toggleEm:
|
|
6
|
-
export declare const toggleEmWithAnalytics:
|
|
7
|
-
export declare const toggleStrike:
|
|
8
|
-
export declare const toggleStrikeWithAnalytics:
|
|
9
|
-
export declare const toggleStrong:
|
|
10
|
-
export declare const toggleStrongWithAnalytics:
|
|
11
|
-
export declare const toggleUnderline:
|
|
12
|
-
export declare const toggleUnderlineWithAnalytics:
|
|
13
|
-
export declare const toggleSuperscript:
|
|
14
|
-
export declare const toggleSuperscriptWithAnalytics:
|
|
15
|
-
export declare const toggleSubscript:
|
|
16
|
-
export declare const toggleSubscriptWithAnalytics:
|
|
17
|
-
export declare const toggleCode:
|
|
18
|
-
export declare const toggleCodeWithAnalytics:
|
|
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,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 {
|
|
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:
|
|
11
|
-
toggleSubscript:
|
|
12
|
-
toggleStrike:
|
|
13
|
-
toggleCode:
|
|
14
|
-
toggleUnderline:
|
|
15
|
-
toggleEm:
|
|
16
|
-
toggleStrong:
|
|
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.
|
|
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.
|
|
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",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@atlaskit/editor-plugin-decorations": "^0.1.0",
|
|
51
51
|
"@atlaskit/editor-plugin-feature-flags": "^0.1.0",
|
|
52
|
-
"@atlaskit/editor-test-helpers": "^18.
|
|
52
|
+
"@atlaskit/editor-test-helpers": "^18.11.0",
|
|
53
53
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
54
54
|
"@testing-library/react": "^12.1.5",
|
|
55
55
|
"typescript": "~4.9.5"
|
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:
|
|
33
|
-
toggleSubscript:
|
|
34
|
-
toggleStrike:
|
|
35
|
-
toggleCode:
|
|
36
|
-
toggleUnderline:
|
|
37
|
-
toggleEm:
|
|
38
|
-
toggleStrong:
|
|
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
|
|
47
|
+
export type ToggleMarkEditorCommand = (
|
|
48
48
|
inputMethod: InputMethodBasic,
|
|
49
|
-
) =>
|
|
49
|
+
) => EditorCommand;
|
|
50
50
|
|
|
51
51
|
// (No @packageDocumentation comment for this package)
|
|
52
52
|
```
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -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:
|
|
20
|
-
toggleSubscript:
|
|
21
|
-
toggleStrike:
|
|
22
|
-
toggleCode:
|
|
23
|
-
toggleUnderline:
|
|
24
|
-
toggleEm:
|
|
25
|
-
toggleStrong:
|
|
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
|
|
33
|
+
export type ToggleMarkEditorCommand = (inputMethod: InputMethodBasic) => EditorCommand;
|
|
34
34
|
|
|
35
35
|
// (No @packageDocumentation comment for this package)
|
|
36
36
|
|