@atlaskit/editor-core 187.7.2 → 187.8.0
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 +6 -0
- package/dist/cjs/plugins/list/commands/indent-list.js +48 -45
- package/dist/cjs/plugins/list/commands/index.js +120 -109
- package/dist/cjs/plugins/list/commands/join-list-item-forward.js +47 -45
- package/dist/cjs/plugins/list/commands/listBackspace.js +33 -31
- package/dist/cjs/plugins/list/commands/outdent-list.js +51 -49
- package/dist/cjs/plugins/list/index.js +10 -5
- package/dist/cjs/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -4
- package/dist/cjs/plugins/list/pm-plugins/keymap.js +10 -11
- package/dist/cjs/plugins/toolbar-lists-indentation/index.js +4 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +4 -3
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +44 -41
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/list/commands/indent-list.js +5 -5
- package/dist/es2019/plugins/list/commands/index.js +22 -22
- package/dist/es2019/plugins/list/commands/join-list-item-forward.js +4 -4
- package/dist/es2019/plugins/list/commands/listBackspace.js +4 -4
- package/dist/es2019/plugins/list/commands/outdent-list.js +5 -6
- package/dist/es2019/plugins/list/index.js +13 -6
- package/dist/es2019/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +1 -1
- package/dist/es2019/plugins/list/pm-plugins/keymap.js +11 -11
- package/dist/es2019/plugins/toolbar-lists-indentation/index.js +4 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +4 -3
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +7 -7
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/list/commands/indent-list.js +46 -44
- package/dist/esm/plugins/list/commands/index.js +115 -103
- package/dist/esm/plugins/list/commands/join-list-item-forward.js +47 -45
- package/dist/esm/plugins/list/commands/listBackspace.js +33 -31
- package/dist/esm/plugins/list/commands/outdent-list.js +49 -48
- package/dist/esm/plugins/list/index.js +11 -6
- package/dist/esm/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +1 -1
- package/dist/esm/plugins/list/pm-plugins/keymap.js +11 -11
- package/dist/esm/plugins/toolbar-lists-indentation/index.js +4 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +4 -3
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +42 -40
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/list/commands/indent-list.d.ts +2 -2
- package/dist/types/plugins/list/commands/index.d.ts +7 -7
- package/dist/types/plugins/list/commands/join-list-item-forward.d.ts +2 -1
- package/dist/types/plugins/list/commands/listBackspace.d.ts +7 -6
- package/dist/types/plugins/list/commands/outdent-list.d.ts +2 -2
- package/dist/types/plugins/list/index.d.ts +7 -2
- package/dist/types/plugins/list/pm-plugins/keymap.d.ts +2 -1
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +7 -2
- package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +1 -1
- package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +3 -1
- package/dist/types/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +5 -4
- package/dist/types/utils/list-commands.d.ts +5 -5
- package/dist/types-ts4.5/plugins/list/commands/indent-list.d.ts +2 -2
- package/dist/types-ts4.5/plugins/list/commands/index.d.ts +7 -7
- package/dist/types-ts4.5/plugins/list/commands/join-list-item-forward.d.ts +2 -1
- package/dist/types-ts4.5/plugins/list/commands/listBackspace.d.ts +7 -6
- package/dist/types-ts4.5/plugins/list/commands/outdent-list.d.ts +2 -2
- package/dist/types-ts4.5/plugins/list/index.d.ts +5 -2
- package/dist/types-ts4.5/plugins/list/pm-plugins/keymap.d.ts +2 -1
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/index.d.ts +5 -2
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +5 -4
- package/dist/types-ts4.5/utils/list-commands.d.ts +5 -5
- package/package.json +1 -1
- package/report.api.md +15 -31
- package/tmp/api-report-tmp.d.ts +4 -22
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { keymap } from 'prosemirror-keymap';
|
|
2
2
|
import * as keymaps from '../../../keymaps';
|
|
3
3
|
import { indentList, enterKeyCommand, toggleList, backspaceKeyCommand, deleteKeyCommand } from '../commands';
|
|
4
|
-
import { outdentList } from '../commands
|
|
5
|
-
import { INPUT_METHOD } from '
|
|
6
|
-
export function keymapPlugin(featureFlags) {
|
|
4
|
+
import { outdentList } from '../commands';
|
|
5
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
|
+
export function keymapPlugin(featureFlags, editorAnalyticsAPI) {
|
|
7
7
|
var list = {};
|
|
8
|
-
keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.toggleOrderedList), toggleList(INPUT_METHOD.KEYBOARD, 'orderedList'), list);
|
|
9
|
-
keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.toggleBulletList), toggleList(INPUT_METHOD.KEYBOARD, 'bulletList'), list);
|
|
10
|
-
keymaps.bindKeymapWithCommand(keymaps.indentList.common, indentList(INPUT_METHOD.KEYBOARD), list);
|
|
11
|
-
keymaps.bindKeymapWithCommand(keymaps.outdentList.common, outdentList(INPUT_METHOD.KEYBOARD, featureFlags), list);
|
|
12
|
-
keymaps.bindKeymapWithCommand(keymaps.enter.common, enterKeyCommand(featureFlags), list);
|
|
13
|
-
keymaps.bindKeymapWithCommand(keymaps.backspace.common, backspaceKeyCommand(featureFlags), list);
|
|
14
|
-
keymaps.bindKeymapWithCommand(keymaps.deleteKey.common, deleteKeyCommand, list);
|
|
8
|
+
keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.toggleOrderedList), toggleList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, 'orderedList'), list);
|
|
9
|
+
keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.toggleBulletList), toggleList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, 'bulletList'), list);
|
|
10
|
+
keymaps.bindKeymapWithCommand(keymaps.indentList.common, indentList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), list);
|
|
11
|
+
keymaps.bindKeymapWithCommand(keymaps.outdentList.common, outdentList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, featureFlags), list);
|
|
12
|
+
keymaps.bindKeymapWithCommand(keymaps.enter.common, enterKeyCommand(editorAnalyticsAPI)(featureFlags), list);
|
|
13
|
+
keymaps.bindKeymapWithCommand(keymaps.backspace.common, backspaceKeyCommand(editorAnalyticsAPI)(featureFlags), list);
|
|
14
|
+
keymaps.bindKeymapWithCommand(keymaps.deleteKey.common, deleteKeyCommand(editorAnalyticsAPI), list);
|
|
15
15
|
|
|
16
16
|
// This shortcut is Mac only
|
|
17
|
-
keymaps.bindKeymapWithCommand(keymaps.findKeyMapForBrowser(keymaps.forwardDelete), deleteKeyCommand, list);
|
|
17
|
+
keymaps.bindKeymapWithCommand(keymaps.findKeyMapForBrowser(keymaps.forwardDelete), deleteKeyCommand(editorAnalyticsAPI), list);
|
|
18
18
|
return keymap(list);
|
|
19
19
|
}
|
|
20
20
|
export default keymapPlugin;
|
|
@@ -5,9 +5,11 @@ import { ToolbarSize } from '../../ui/Toolbar/types';
|
|
|
5
5
|
import { pluginKey as listPluginKey } from '../list/pm-plugins/main';
|
|
6
6
|
import { pluginKey as indentationButtonsPluginKey, createPlugin as indentationButtonsPlugin } from './pm-plugins/indentation-buttons';
|
|
7
7
|
var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref, api) {
|
|
8
|
+
var _api$dependencies$ana;
|
|
8
9
|
var showIndentationButtons = _ref.showIndentationButtons,
|
|
9
10
|
allowHeadingAndParagraphIndentation = _ref.allowHeadingAndParagraphIndentation;
|
|
10
11
|
var featureFlags = (api === null || api === void 0 ? void 0 : api.dependencies.featureFlags.sharedState.currentState()) || {};
|
|
12
|
+
var editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$dependencies$ana = api.dependencies.analytics) === null || _api$dependencies$ana === void 0 ? void 0 : _api$dependencies$ana.actions;
|
|
11
13
|
return {
|
|
12
14
|
name: 'toolbarListsIndentation',
|
|
13
15
|
pmPlugins: function pmPlugins() {
|
|
@@ -58,7 +60,8 @@ var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref,
|
|
|
58
60
|
orderedListDisabled: listState.orderedListDisabled,
|
|
59
61
|
showIndentationButtons: !!showIndentationButtons,
|
|
60
62
|
indentDisabled: indentationState.indentDisabled,
|
|
61
|
-
outdentDisabled: indentationState.outdentDisabled
|
|
63
|
+
outdentDisabled: indentationState.outdentDisabled,
|
|
64
|
+
editorAnalyticsAPI: editorAnalyticsAPI
|
|
62
65
|
});
|
|
63
66
|
}
|
|
64
67
|
});
|
|
@@ -17,7 +17,8 @@ export default function ToolbarListsIndentation(props) {
|
|
|
17
17
|
popupsScrollableElement = props.popupsScrollableElement,
|
|
18
18
|
indentDisabled = props.indentDisabled,
|
|
19
19
|
outdentDisabled = props.outdentDisabled,
|
|
20
|
-
featureFlags = props.featureFlags
|
|
20
|
+
featureFlags = props.featureFlags,
|
|
21
|
+
editorAnalyticsAPI = props.editorAnalyticsAPI;
|
|
21
22
|
if (isSmall) {
|
|
22
23
|
return jsx(ToolbarDropdown, {
|
|
23
24
|
editorView: props.editorView,
|
|
@@ -33,7 +34,7 @@ export default function ToolbarListsIndentation(props) {
|
|
|
33
34
|
indentDisabled: indentDisabled,
|
|
34
35
|
outdentDisabled: outdentDisabled,
|
|
35
36
|
disabled: disabled,
|
|
36
|
-
onItemActivated: onItemActivated,
|
|
37
|
+
onItemActivated: onItemActivated(editorAnalyticsAPI),
|
|
37
38
|
featureFlags: featureFlags
|
|
38
39
|
});
|
|
39
40
|
}
|
|
@@ -48,7 +49,7 @@ export default function ToolbarListsIndentation(props) {
|
|
|
48
49
|
indentDisabled: indentDisabled,
|
|
49
50
|
outdentDisabled: outdentDisabled,
|
|
50
51
|
disabled: disabled,
|
|
51
|
-
onItemActivated: onItemActivated,
|
|
52
|
+
onItemActivated: onItemActivated(editorAnalyticsAPI),
|
|
52
53
|
featureFlags: featureFlags
|
|
53
54
|
});
|
|
54
55
|
}
|
|
@@ -3,46 +3,48 @@ import { getIndentCommand as indentParagraphOrHeading, getOutdentCommand as outd
|
|
|
3
3
|
import { getIndentCommand as indentTaskList, getUnindentCommand as outdentTaskList } from '../../tasks-and-decisions/pm-plugins/keymaps';
|
|
4
4
|
import { INPUT_METHOD } from '../../analytics';
|
|
5
5
|
import { pluginKey as indentationButtonsPluginKey } from '../pm-plugins/indentation-buttons';
|
|
6
|
-
export function onItemActivated(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
case 'ordered_list':
|
|
15
|
-
toggleOrderedList(editorView, INPUT_METHOD.TOOLBAR);
|
|
16
|
-
break;
|
|
17
|
-
case 'indent':
|
|
18
|
-
{
|
|
19
|
-
var _indentationButtonsPl;
|
|
20
|
-
var node = (_indentationButtonsPl = indentationButtonsPluginKey.getState(editorView.state)) === null || _indentationButtonsPl === void 0 ? void 0 : _indentationButtonsPl.node;
|
|
21
|
-
if (node === 'paragraph_heading') {
|
|
22
|
-
indentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
23
|
-
}
|
|
24
|
-
if (node === 'list') {
|
|
25
|
-
indentList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
26
|
-
}
|
|
27
|
-
if (node === 'taskList') {
|
|
28
|
-
indentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
29
|
-
}
|
|
6
|
+
export var onItemActivated = function onItemActivated(editorAnalyticsAPI) {
|
|
7
|
+
return function (_ref) {
|
|
8
|
+
var buttonName = _ref.buttonName,
|
|
9
|
+
editorView = _ref.editorView,
|
|
10
|
+
featureFlags = _ref.featureFlags;
|
|
11
|
+
switch (buttonName) {
|
|
12
|
+
case 'bullet_list':
|
|
13
|
+
toggleBulletList(editorAnalyticsAPI)(editorView, INPUT_METHOD.TOOLBAR);
|
|
30
14
|
break;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
15
|
+
case 'ordered_list':
|
|
16
|
+
toggleOrderedList(editorAnalyticsAPI)(editorView, INPUT_METHOD.TOOLBAR);
|
|
17
|
+
break;
|
|
18
|
+
case 'indent':
|
|
19
|
+
{
|
|
20
|
+
var _indentationButtonsPl;
|
|
21
|
+
var node = (_indentationButtonsPl = indentationButtonsPluginKey.getState(editorView.state)) === null || _indentationButtonsPl === void 0 ? void 0 : _indentationButtonsPl.node;
|
|
22
|
+
if (node === 'paragraph_heading') {
|
|
23
|
+
indentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
24
|
+
}
|
|
25
|
+
if (node === 'list') {
|
|
26
|
+
indentList(editorAnalyticsAPI)(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
27
|
+
}
|
|
28
|
+
if (node === 'taskList') {
|
|
29
|
+
indentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
30
|
+
}
|
|
31
|
+
break;
|
|
41
32
|
}
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
case 'outdent':
|
|
34
|
+
{
|
|
35
|
+
var _indentationButtonsPl2;
|
|
36
|
+
var _node = (_indentationButtonsPl2 = indentationButtonsPluginKey.getState(editorView.state)) === null || _indentationButtonsPl2 === void 0 ? void 0 : _indentationButtonsPl2.node;
|
|
37
|
+
if (_node === 'paragraph_heading') {
|
|
38
|
+
outdentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
39
|
+
}
|
|
40
|
+
if (_node === 'list') {
|
|
41
|
+
outdentList(editorAnalyticsAPI)(INPUT_METHOD.TOOLBAR, featureFlags)(editorView.state, editorView.dispatch);
|
|
42
|
+
}
|
|
43
|
+
if (_node === 'taskList') {
|
|
44
|
+
outdentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
45
|
+
}
|
|
46
|
+
break;
|
|
44
47
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
};
|
package/dist/esm/version.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from '../../../types';
|
|
2
|
-
import { INPUT_METHOD } from '
|
|
2
|
+
import { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
4
|
-
export declare
|
|
4
|
+
export declare const indentList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: InputMethod) => Command;
|
|
5
5
|
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ResolvedPos, NodeType } from 'prosemirror-model';
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { Command } from '../../../types';
|
|
4
|
-
import { INPUT_METHOD } from '
|
|
4
|
+
import { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { outdentList } from './outdent-list';
|
|
6
6
|
import { indentList } from './indent-list';
|
|
7
7
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
8
8
|
export { outdentList, indentList };
|
|
9
9
|
export type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
10
|
-
export declare const enterKeyCommand: (featureFlags: FeatureFlags) => Command;
|
|
11
|
-
export declare const backspaceKeyCommand: (featureFlags: FeatureFlags) => Command;
|
|
12
|
-
export declare const deleteKeyCommand: Command;
|
|
10
|
+
export declare const enterKeyCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (featureFlags: FeatureFlags) => Command;
|
|
11
|
+
export declare const backspaceKeyCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (featureFlags: FeatureFlags) => Command;
|
|
12
|
+
export declare const deleteKeyCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
13
13
|
export declare const rootListDepth: (pos: ResolvedPos, nodes: Record<string, NodeType>) => number | undefined;
|
|
14
|
-
export declare
|
|
15
|
-
export declare
|
|
16
|
-
export declare
|
|
14
|
+
export declare const toggleList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: InputMethod, listType: 'bulletList' | 'orderedList') => Command;
|
|
15
|
+
export declare const toggleBulletList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, inputMethod?: InputMethod) => boolean;
|
|
16
|
+
export declare const toggleOrderedList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, inputMethod?: InputMethod) => boolean;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
1
2
|
import { Command } from '../../../types';
|
|
2
|
-
export declare const joinListItemForward: Command;
|
|
3
|
+
export declare const joinListItemForward: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { WalkNode } from '../../../utils/commands';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ResolvedPos } from 'prosemirror-model';
|
|
5
|
-
import { Transaction } from 'prosemirror-state';
|
|
1
|
+
import type { WalkNode } from '../../../utils/commands';
|
|
2
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { LIST_TEXT_SCENARIOS } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import type { ResolvedPos } from 'prosemirror-model';
|
|
5
|
+
import type { EditorState, Transaction } from 'prosemirror-state';
|
|
6
|
+
import type { CommandDispatch } from '../../../types';
|
|
6
7
|
type ScenariosAllowed = LIST_TEXT_SCENARIOS.JOIN_SIBLINGS | LIST_TEXT_SCENARIOS.JOIN_DESCENDANT_TO_PARENT | LIST_TEXT_SCENARIOS.JOIN_TO_SIBLING_DESCENDANT;
|
|
7
8
|
export declare const calcJoinListScenario: (walkNode: WalkNode, $head: ResolvedPos, tr: Transaction) => [ScenariosAllowed, ResolvedPos | null] | false;
|
|
8
|
-
export declare const listBackspace:
|
|
9
|
+
export declare const listBackspace: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (state: EditorState, dispatch?: CommandDispatch) => boolean;
|
|
9
10
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from '../../../types';
|
|
2
|
-
import { INPUT_METHOD } from '
|
|
2
|
+
import { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
4
|
type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
5
|
-
export declare
|
|
5
|
+
export declare const outdentList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: InputMethod | undefined, featureFlags: FeatureFlags) => Command;
|
|
6
6
|
export {};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { NextEditorPlugin } from '../../types';
|
|
1
|
+
import type { NextEditorPlugin } from '../../types';
|
|
2
2
|
import type { ListPluginOptions } from './types';
|
|
3
3
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
4
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
5
|
+
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
4
6
|
declare const listPlugin: NextEditorPlugin<'list', {
|
|
5
7
|
pluginConfiguration: ListPluginOptions | undefined;
|
|
6
|
-
dependencies: [
|
|
8
|
+
dependencies: [
|
|
9
|
+
typeof featureFlagsPlugin,
|
|
10
|
+
OptionalPlugin<typeof analyticsPlugin>
|
|
11
|
+
];
|
|
7
12
|
}>;
|
|
8
13
|
export default listPlugin;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
3
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
|
-
export declare function keymapPlugin(featureFlags: FeatureFlags): SafePlugin | undefined;
|
|
4
|
+
export declare function keymapPlugin(featureFlags: FeatureFlags, editorAnalyticsAPI: EditorAnalyticsAPI | undefined): SafePlugin | undefined;
|
|
4
5
|
export default keymapPlugin;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
3
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
+
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
5
|
type Config = {
|
|
4
6
|
showIndentationButtons: boolean;
|
|
5
7
|
allowHeadingAndParagraphIndentation: boolean;
|
|
6
8
|
};
|
|
7
9
|
declare const toolbarListsIndentationPlugin: NextEditorPlugin<'toolbarListsIndentation', {
|
|
8
10
|
pluginConfiguration: Config;
|
|
9
|
-
dependencies: [
|
|
11
|
+
dependencies: [
|
|
12
|
+
typeof featureFlagsPlugin,
|
|
13
|
+
OptionalPlugin<typeof analyticsPlugin>
|
|
14
|
+
];
|
|
10
15
|
}>;
|
|
11
16
|
export default toolbarListsIndentationPlugin;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { EditorView } from 'prosemirror-view';
|
|
3
|
+
import type { EditorView } from 'prosemirror-view';
|
|
4
4
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
6
|
export interface Props {
|
|
6
7
|
editorView: EditorView;
|
|
7
8
|
featureFlags: FeatureFlags;
|
|
@@ -18,5 +19,6 @@ export interface Props {
|
|
|
18
19
|
showIndentationButtons?: boolean;
|
|
19
20
|
indentDisabled?: boolean;
|
|
20
21
|
outdentDisabled?: boolean;
|
|
22
|
+
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
21
23
|
}
|
|
22
24
|
export default function ToolbarListsIndentation(props: Props): jsx.JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { EditorView } from 'prosemirror-view';
|
|
1
|
+
import type { EditorView } from 'prosemirror-view';
|
|
2
2
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { ButtonName } from '../types';
|
|
4
|
-
|
|
3
|
+
import type { ButtonName } from '../types';
|
|
4
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
export declare const onItemActivated: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ buttonName, editorView, featureFlags, }: {
|
|
5
6
|
featureFlags: FeatureFlags;
|
|
6
7
|
buttonName: ButtonName;
|
|
7
8
|
editorView: EditorView;
|
|
8
|
-
})
|
|
9
|
+
}) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference path="../../../../../../typings/prosemirror.d.ts" />
|
|
2
2
|
export declare const getListCommands: () => {
|
|
3
|
-
indentList:
|
|
4
|
-
outdentList:
|
|
5
|
-
toggleOrderedList:
|
|
6
|
-
toggleBulletList:
|
|
3
|
+
indentList: (editorAnalyticsAPI: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI | undefined) => (inputMethod?: import("@atlaskit/editor-common/analytics").INPUT_METHOD.KEYBOARD | import("@atlaskit/editor-common/analytics").INPUT_METHOD.TOOLBAR) => import("..").Command;
|
|
4
|
+
outdentList: (editorAnalyticsAPI: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI | undefined) => (inputMethod: (import("@atlaskit/editor-common/analytics").INPUT_METHOD.KEYBOARD | import("@atlaskit/editor-common/analytics").INPUT_METHOD.TOOLBAR) | undefined, featureFlags: import("@atlaskit/editor-common/types").FeatureFlags) => import("..").Command;
|
|
5
|
+
toggleOrderedList: (editorAnalyticsAPI: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI | undefined) => (view: import("prosemirror-view").EditorView, inputMethod?: import("../plugins/list/commands").InputMethod) => boolean;
|
|
6
|
+
toggleBulletList: (editorAnalyticsAPI: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI | undefined) => (view: import("prosemirror-view").EditorView, inputMethod?: import("../plugins/list/commands").InputMethod) => boolean;
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from '../../../types';
|
|
2
|
-
import { INPUT_METHOD } from '
|
|
2
|
+
import { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
4
|
-
export declare
|
|
4
|
+
export declare const indentList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: InputMethod) => Command;
|
|
5
5
|
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ResolvedPos, NodeType } from 'prosemirror-model';
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { Command } from '../../../types';
|
|
4
|
-
import { INPUT_METHOD } from '
|
|
4
|
+
import { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { outdentList } from './outdent-list';
|
|
6
6
|
import { indentList } from './indent-list';
|
|
7
7
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
8
8
|
export { outdentList, indentList };
|
|
9
9
|
export type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
10
|
-
export declare const enterKeyCommand: (featureFlags: FeatureFlags) => Command;
|
|
11
|
-
export declare const backspaceKeyCommand: (featureFlags: FeatureFlags) => Command;
|
|
12
|
-
export declare const deleteKeyCommand: Command;
|
|
10
|
+
export declare const enterKeyCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (featureFlags: FeatureFlags) => Command;
|
|
11
|
+
export declare const backspaceKeyCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (featureFlags: FeatureFlags) => Command;
|
|
12
|
+
export declare const deleteKeyCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
13
13
|
export declare const rootListDepth: (pos: ResolvedPos, nodes: Record<string, NodeType>) => number | undefined;
|
|
14
|
-
export declare
|
|
15
|
-
export declare
|
|
16
|
-
export declare
|
|
14
|
+
export declare const toggleList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: InputMethod, listType: 'bulletList' | 'orderedList') => Command;
|
|
15
|
+
export declare const toggleBulletList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, inputMethod?: InputMethod) => boolean;
|
|
16
|
+
export declare const toggleOrderedList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, inputMethod?: InputMethod) => boolean;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
1
2
|
import { Command } from '../../../types';
|
|
2
|
-
export declare const joinListItemForward: Command;
|
|
3
|
+
export declare const joinListItemForward: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { WalkNode } from '../../../utils/commands';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ResolvedPos } from 'prosemirror-model';
|
|
5
|
-
import { Transaction } from 'prosemirror-state';
|
|
1
|
+
import type { WalkNode } from '../../../utils/commands';
|
|
2
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { LIST_TEXT_SCENARIOS } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import type { ResolvedPos } from 'prosemirror-model';
|
|
5
|
+
import type { EditorState, Transaction } from 'prosemirror-state';
|
|
6
|
+
import type { CommandDispatch } from '../../../types';
|
|
6
7
|
type ScenariosAllowed = LIST_TEXT_SCENARIOS.JOIN_SIBLINGS | LIST_TEXT_SCENARIOS.JOIN_DESCENDANT_TO_PARENT | LIST_TEXT_SCENARIOS.JOIN_TO_SIBLING_DESCENDANT;
|
|
7
8
|
export declare const calcJoinListScenario: (walkNode: WalkNode, $head: ResolvedPos, tr: Transaction) => [
|
|
8
9
|
ScenariosAllowed,
|
|
9
10
|
ResolvedPos | null
|
|
10
11
|
] | false;
|
|
11
|
-
export declare const listBackspace:
|
|
12
|
+
export declare const listBackspace: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (state: EditorState, dispatch?: CommandDispatch) => boolean;
|
|
12
13
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from '../../../types';
|
|
2
|
-
import { INPUT_METHOD } from '
|
|
2
|
+
import { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
4
|
type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
5
|
-
export declare
|
|
5
|
+
export declare const outdentList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: InputMethod | undefined, featureFlags: FeatureFlags) => Command;
|
|
6
6
|
export {};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { NextEditorPlugin } from '../../types';
|
|
1
|
+
import type { NextEditorPlugin } from '../../types';
|
|
2
2
|
import type { ListPluginOptions } from './types';
|
|
3
3
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
4
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
5
|
+
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
4
6
|
declare const listPlugin: NextEditorPlugin<'list', {
|
|
5
7
|
pluginConfiguration: ListPluginOptions | undefined;
|
|
6
8
|
dependencies: [
|
|
7
|
-
typeof featureFlagsPlugin
|
|
9
|
+
typeof featureFlagsPlugin,
|
|
10
|
+
OptionalPlugin<typeof analyticsPlugin>
|
|
8
11
|
];
|
|
9
12
|
}>;
|
|
10
13
|
export default listPlugin;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
3
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
|
-
export declare function keymapPlugin(featureFlags: FeatureFlags): SafePlugin | undefined;
|
|
4
|
+
export declare function keymapPlugin(featureFlags: FeatureFlags, editorAnalyticsAPI: EditorAnalyticsAPI | undefined): SafePlugin | undefined;
|
|
4
5
|
export default keymapPlugin;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
3
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
+
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
5
|
type Config = {
|
|
4
6
|
showIndentationButtons: boolean;
|
|
5
7
|
allowHeadingAndParagraphIndentation: boolean;
|
|
@@ -7,7 +9,8 @@ type Config = {
|
|
|
7
9
|
declare const toolbarListsIndentationPlugin: NextEditorPlugin<'toolbarListsIndentation', {
|
|
8
10
|
pluginConfiguration: Config;
|
|
9
11
|
dependencies: [
|
|
10
|
-
typeof featureFlagsPlugin
|
|
12
|
+
typeof featureFlagsPlugin,
|
|
13
|
+
OptionalPlugin<typeof analyticsPlugin>
|
|
11
14
|
];
|
|
12
15
|
}>;
|
|
13
16
|
export default toolbarListsIndentationPlugin;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { EditorView } from 'prosemirror-view';
|
|
3
|
+
import type { EditorView } from 'prosemirror-view';
|
|
4
4
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
6
|
export interface Props {
|
|
6
7
|
editorView: EditorView;
|
|
7
8
|
featureFlags: FeatureFlags;
|
|
@@ -18,5 +19,6 @@ export interface Props {
|
|
|
18
19
|
showIndentationButtons?: boolean;
|
|
19
20
|
indentDisabled?: boolean;
|
|
20
21
|
outdentDisabled?: boolean;
|
|
22
|
+
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
21
23
|
}
|
|
22
24
|
export default function ToolbarListsIndentation(props: Props): jsx.JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { EditorView } from 'prosemirror-view';
|
|
1
|
+
import type { EditorView } from 'prosemirror-view';
|
|
2
2
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { ButtonName } from '../types';
|
|
4
|
-
|
|
3
|
+
import type { ButtonName } from '../types';
|
|
4
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
export declare const onItemActivated: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ buttonName, editorView, featureFlags, }: {
|
|
5
6
|
featureFlags: FeatureFlags;
|
|
6
7
|
buttonName: ButtonName;
|
|
7
8
|
editorView: EditorView;
|
|
8
|
-
})
|
|
9
|
+
}) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference path="../../../../../../typings/prosemirror.d.ts" />
|
|
2
2
|
export declare const getListCommands: () => {
|
|
3
|
-
indentList:
|
|
4
|
-
outdentList:
|
|
5
|
-
toggleOrderedList:
|
|
6
|
-
toggleBulletList:
|
|
3
|
+
indentList: (editorAnalyticsAPI: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI | undefined) => (inputMethod?: import("@atlaskit/editor-common/analytics").INPUT_METHOD.KEYBOARD | import("@atlaskit/editor-common/analytics").INPUT_METHOD.TOOLBAR) => import("..").Command;
|
|
4
|
+
outdentList: (editorAnalyticsAPI: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI | undefined) => (inputMethod: (import("@atlaskit/editor-common/analytics").INPUT_METHOD.KEYBOARD | import("@atlaskit/editor-common/analytics").INPUT_METHOD.TOOLBAR) | undefined, featureFlags: import("@atlaskit/editor-common/types").FeatureFlags) => import("..").Command;
|
|
5
|
+
toggleOrderedList: (editorAnalyticsAPI: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI | undefined) => (view: import("prosemirror-view").EditorView, inputMethod?: import("../plugins/list/commands").InputMethod) => boolean;
|
|
6
|
+
toggleBulletList: (editorAnalyticsAPI: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI | undefined) => (view: import("prosemirror-view").EditorView, inputMethod?: import("../plugins/list/commands").InputMethod) => boolean;
|
|
7
7
|
};
|