@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.
Files changed (67) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/plugins/list/commands/indent-list.js +48 -45
  3. package/dist/cjs/plugins/list/commands/index.js +120 -109
  4. package/dist/cjs/plugins/list/commands/join-list-item-forward.js +47 -45
  5. package/dist/cjs/plugins/list/commands/listBackspace.js +33 -31
  6. package/dist/cjs/plugins/list/commands/outdent-list.js +51 -49
  7. package/dist/cjs/plugins/list/index.js +10 -5
  8. package/dist/cjs/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -4
  9. package/dist/cjs/plugins/list/pm-plugins/keymap.js +10 -11
  10. package/dist/cjs/plugins/toolbar-lists-indentation/index.js +4 -1
  11. package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +4 -3
  12. package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +44 -41
  13. package/dist/cjs/version-wrapper.js +1 -1
  14. package/dist/cjs/version.json +1 -1
  15. package/dist/es2019/plugins/list/commands/indent-list.js +5 -5
  16. package/dist/es2019/plugins/list/commands/index.js +22 -22
  17. package/dist/es2019/plugins/list/commands/join-list-item-forward.js +4 -4
  18. package/dist/es2019/plugins/list/commands/listBackspace.js +4 -4
  19. package/dist/es2019/plugins/list/commands/outdent-list.js +5 -6
  20. package/dist/es2019/plugins/list/index.js +13 -6
  21. package/dist/es2019/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +1 -1
  22. package/dist/es2019/plugins/list/pm-plugins/keymap.js +11 -11
  23. package/dist/es2019/plugins/toolbar-lists-indentation/index.js +4 -1
  24. package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +4 -3
  25. package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +7 -7
  26. package/dist/es2019/version-wrapper.js +1 -1
  27. package/dist/es2019/version.json +1 -1
  28. package/dist/esm/plugins/list/commands/indent-list.js +46 -44
  29. package/dist/esm/plugins/list/commands/index.js +115 -103
  30. package/dist/esm/plugins/list/commands/join-list-item-forward.js +47 -45
  31. package/dist/esm/plugins/list/commands/listBackspace.js +33 -31
  32. package/dist/esm/plugins/list/commands/outdent-list.js +49 -48
  33. package/dist/esm/plugins/list/index.js +11 -6
  34. package/dist/esm/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +1 -1
  35. package/dist/esm/plugins/list/pm-plugins/keymap.js +11 -11
  36. package/dist/esm/plugins/toolbar-lists-indentation/index.js +4 -1
  37. package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +4 -3
  38. package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +42 -40
  39. package/dist/esm/version-wrapper.js +1 -1
  40. package/dist/esm/version.json +1 -1
  41. package/dist/types/plugins/list/commands/indent-list.d.ts +2 -2
  42. package/dist/types/plugins/list/commands/index.d.ts +7 -7
  43. package/dist/types/plugins/list/commands/join-list-item-forward.d.ts +2 -1
  44. package/dist/types/plugins/list/commands/listBackspace.d.ts +7 -6
  45. package/dist/types/plugins/list/commands/outdent-list.d.ts +2 -2
  46. package/dist/types/plugins/list/index.d.ts +7 -2
  47. package/dist/types/plugins/list/pm-plugins/keymap.d.ts +2 -1
  48. package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +7 -2
  49. package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +1 -1
  50. package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +3 -1
  51. package/dist/types/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +5 -4
  52. package/dist/types/utils/list-commands.d.ts +5 -5
  53. package/dist/types-ts4.5/plugins/list/commands/indent-list.d.ts +2 -2
  54. package/dist/types-ts4.5/plugins/list/commands/index.d.ts +7 -7
  55. package/dist/types-ts4.5/plugins/list/commands/join-list-item-forward.d.ts +2 -1
  56. package/dist/types-ts4.5/plugins/list/commands/listBackspace.d.ts +7 -6
  57. package/dist/types-ts4.5/plugins/list/commands/outdent-list.d.ts +2 -2
  58. package/dist/types-ts4.5/plugins/list/index.d.ts +5 -2
  59. package/dist/types-ts4.5/plugins/list/pm-plugins/keymap.d.ts +2 -1
  60. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/index.d.ts +5 -2
  61. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/types.d.ts +1 -1
  62. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/index.d.ts +3 -1
  63. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +5 -4
  64. package/dist/types-ts4.5/utils/list-commands.d.ts +5 -5
  65. package/package.json +1 -1
  66. package/report.api.md +15 -31
  67. 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/outdent-list';
5
- import { INPUT_METHOD } from '../../analytics';
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(_ref) {
7
- var buttonName = _ref.buttonName,
8
- editorView = _ref.editorView,
9
- featureFlags = _ref.featureFlags;
10
- switch (buttonName) {
11
- case 'bullet_list':
12
- toggleBulletList(editorView, INPUT_METHOD.TOOLBAR);
13
- break;
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
- case 'outdent':
33
- {
34
- var _indentationButtonsPl2;
35
- var _node = (_indentationButtonsPl2 = indentationButtonsPluginKey.getState(editorView.state)) === null || _indentationButtonsPl2 === void 0 ? void 0 : _indentationButtonsPl2.node;
36
- if (_node === 'paragraph_heading') {
37
- outdentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
38
- }
39
- if (_node === 'list') {
40
- outdentList(INPUT_METHOD.TOOLBAR, featureFlags)(editorView.state, editorView.dispatch);
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
- if (_node === 'taskList') {
43
- outdentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
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
- break;
46
- }
47
- }
48
- }
48
+ }
49
+ };
50
+ };
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "187.7.2";
2
+ export var version = "187.8.0";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.7.2",
3
+ "version": "187.8.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { Command } from '../../../types';
2
- import { INPUT_METHOD } from '../../analytics';
2
+ import { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
4
- export declare function indentList(inputMethod?: InputMethod): Command;
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 '../../analytics';
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 function toggleList(inputMethod: InputMethod, listType: 'bulletList' | 'orderedList'): Command;
15
- export declare function toggleBulletList(view: EditorView, inputMethod?: InputMethod): boolean;
16
- export declare function toggleOrderedList(view: EditorView, inputMethod?: InputMethod): boolean;
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 { LIST_TEXT_SCENARIOS } from '../../analytics';
3
- import { Command } from '../../../types';
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: Command;
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 '../../analytics';
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 function outdentList(inputMethod: InputMethod | undefined, featureFlags: FeatureFlags): Command;
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: [typeof featureFlagsPlugin];
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: [typeof featureFlagsPlugin];
11
+ dependencies: [
12
+ typeof featureFlagsPlugin,
13
+ OptionalPlugin<typeof analyticsPlugin>
14
+ ];
10
15
  }>;
11
16
  export default toolbarListsIndentationPlugin;
@@ -16,5 +16,5 @@ export interface ToolbarProps {
16
16
  showIndentationButtons?: boolean;
17
17
  indentDisabled?: boolean;
18
18
  outdentDisabled?: boolean;
19
- onItemActivated: typeof onItemActivated;
19
+ onItemActivated: ReturnType<typeof onItemActivated>;
20
20
  }
@@ -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
- export declare function onItemActivated({ buttonName, editorView, featureFlags, }: {
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
- }): void;
9
+ }) => void;
@@ -1,7 +1,7 @@
1
- import { indentList, outdentList, toggleOrderedList, toggleBulletList } from '../plugins/list/commands';
1
+ /// <reference path="../../../../../../typings/prosemirror.d.ts" />
2
2
  export declare const getListCommands: () => {
3
- indentList: typeof indentList;
4
- outdentList: typeof outdentList;
5
- toggleOrderedList: typeof toggleOrderedList;
6
- toggleBulletList: typeof 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 '../../analytics';
2
+ import { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
4
- export declare function indentList(inputMethod?: InputMethod): Command;
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 '../../analytics';
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 function toggleList(inputMethod: InputMethod, listType: 'bulletList' | 'orderedList'): Command;
15
- export declare function toggleBulletList(view: EditorView, inputMethod?: InputMethod): boolean;
16
- export declare function toggleOrderedList(view: EditorView, inputMethod?: InputMethod): boolean;
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 { LIST_TEXT_SCENARIOS } from '../../analytics';
3
- import { Command } from '../../../types';
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: Command;
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 '../../analytics';
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 function outdentList(inputMethod: InputMethod | undefined, featureFlags: FeatureFlags): Command;
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;
@@ -16,5 +16,5 @@ export interface ToolbarProps {
16
16
  showIndentationButtons?: boolean;
17
17
  indentDisabled?: boolean;
18
18
  outdentDisabled?: boolean;
19
- onItemActivated: typeof onItemActivated;
19
+ onItemActivated: ReturnType<typeof onItemActivated>;
20
20
  }
@@ -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
- export declare function onItemActivated({ buttonName, editorView, featureFlags, }: {
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
- }): void;
9
+ }) => void;
@@ -1,7 +1,7 @@
1
- import { indentList, outdentList, toggleOrderedList, toggleBulletList } from '../plugins/list/commands';
1
+ /// <reference path="../../../../../../typings/prosemirror.d.ts" />
2
2
  export declare const getListCommands: () => {
3
- indentList: typeof indentList;
4
- outdentList: typeof outdentList;
5
- toggleOrderedList: typeof toggleOrderedList;
6
- toggleBulletList: typeof 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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.7.2",
3
+ "version": "187.8.0",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"