@atlaskit/editor-core 189.1.2 → 189.1.5

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 (141) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/create-editor/ErrorBoundary.js +2 -3
  3. package/dist/cjs/plugins/analytics/index.js +1 -160
  4. package/dist/cjs/plugins/annotation/commands/index.js +1 -1
  5. package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +2 -2
  6. package/dist/cjs/plugins/annotation/pm-plugins/keymap.js +1 -1
  7. package/dist/cjs/plugins/annotation/ui/InlineCommentView.js +3 -5
  8. package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +1 -1
  9. package/dist/cjs/plugins/collab-edit/utils.js +4 -4
  10. package/dist/cjs/plugins/extension/actions.js +3 -2
  11. package/dist/cjs/plugins/extension/extension-api.js +6 -5
  12. package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +1 -1
  13. package/dist/cjs/plugins/find-replace/commands-with-analytics.js +23 -22
  14. package/dist/cjs/plugins/find-replace/keymap.js +1 -1
  15. package/dist/cjs/plugins/find-replace/ui/Find.js +6 -6
  16. package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +3 -3
  17. package/dist/cjs/plugins/find-replace/ui/Replace.js +6 -6
  18. package/dist/cjs/plugins/indentation/commands/index.js +24 -16
  19. package/dist/cjs/plugins/indentation/commands/utils.js +4 -3
  20. package/dist/cjs/plugins/indentation/index.js +4 -2
  21. package/dist/cjs/plugins/indentation/pm-plugins/keymap.js +4 -4
  22. package/dist/cjs/plugins/insert-block/index.js +1 -1
  23. package/dist/cjs/plugins/layout/actions.js +6 -7
  24. package/dist/cjs/plugins/macro/actions.js +3 -2
  25. package/dist/cjs/plugins/paste/pm-plugins/main.js +2 -5
  26. package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +9 -7
  27. package/dist/cjs/plugins/undo-redo/enums.js +3 -3
  28. package/dist/cjs/ui/ConfigPanel/FormErrorBoundary.js +3 -4
  29. package/dist/cjs/ui/ErrorBoundary/index.js +1 -1
  30. package/dist/cjs/ui/ToolbarFeedback/index.js +1 -1
  31. package/dist/cjs/ui/WithHelpTrigger/index.js +1 -1
  32. package/dist/cjs/version-wrapper.js +1 -1
  33. package/dist/es2019/create-editor/ErrorBoundary.js +1 -2
  34. package/dist/es2019/plugins/analytics/index.js +0 -3
  35. package/dist/es2019/plugins/annotation/commands/index.js +1 -1
  36. package/dist/es2019/plugins/annotation/pm-plugins/inline-comment.js +1 -1
  37. package/dist/es2019/plugins/annotation/pm-plugins/keymap.js +1 -1
  38. package/dist/es2019/plugins/annotation/ui/InlineCommentView.js +3 -3
  39. package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +1 -1
  40. package/dist/es2019/plugins/collab-edit/utils.js +1 -1
  41. package/dist/es2019/plugins/extension/actions.js +2 -1
  42. package/dist/es2019/plugins/extension/extension-api.js +2 -1
  43. package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +1 -1
  44. package/dist/es2019/plugins/find-replace/commands-with-analytics.js +2 -1
  45. package/dist/es2019/plugins/find-replace/keymap.js +1 -1
  46. package/dist/es2019/plugins/find-replace/ui/Find.js +1 -1
  47. package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +1 -1
  48. package/dist/es2019/plugins/find-replace/ui/Replace.js +1 -1
  49. package/dist/es2019/plugins/indentation/commands/index.js +10 -6
  50. package/dist/es2019/plugins/indentation/commands/utils.js +4 -3
  51. package/dist/es2019/plugins/indentation/index.js +7 -2
  52. package/dist/es2019/plugins/indentation/pm-plugins/keymap.js +4 -4
  53. package/dist/es2019/plugins/insert-block/index.js +1 -1
  54. package/dist/es2019/plugins/layout/actions.js +1 -2
  55. package/dist/es2019/plugins/macro/actions.js +2 -1
  56. package/dist/es2019/plugins/paste/pm-plugins/main.js +2 -4
  57. package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +9 -7
  58. package/dist/es2019/plugins/undo-redo/enums.js +1 -1
  59. package/dist/es2019/ui/ConfigPanel/FormErrorBoundary.js +1 -2
  60. package/dist/es2019/ui/ErrorBoundary/index.js +1 -1
  61. package/dist/es2019/ui/ToolbarFeedback/index.js +1 -1
  62. package/dist/es2019/ui/WithHelpTrigger/index.js +1 -1
  63. package/dist/es2019/version-wrapper.js +1 -1
  64. package/dist/esm/create-editor/ErrorBoundary.js +1 -2
  65. package/dist/esm/plugins/analytics/index.js +0 -3
  66. package/dist/esm/plugins/annotation/commands/index.js +1 -1
  67. package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +1 -1
  68. package/dist/esm/plugins/annotation/pm-plugins/keymap.js +1 -1
  69. package/dist/esm/plugins/annotation/ui/InlineCommentView.js +3 -3
  70. package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +1 -1
  71. package/dist/esm/plugins/collab-edit/utils.js +1 -1
  72. package/dist/esm/plugins/extension/actions.js +2 -1
  73. package/dist/esm/plugins/extension/extension-api.js +2 -1
  74. package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +1 -1
  75. package/dist/esm/plugins/find-replace/commands-with-analytics.js +2 -1
  76. package/dist/esm/plugins/find-replace/keymap.js +1 -1
  77. package/dist/esm/plugins/find-replace/ui/Find.js +1 -1
  78. package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +1 -1
  79. package/dist/esm/plugins/find-replace/ui/Replace.js +1 -1
  80. package/dist/esm/plugins/indentation/commands/index.js +24 -16
  81. package/dist/esm/plugins/indentation/commands/utils.js +4 -3
  82. package/dist/esm/plugins/indentation/index.js +4 -2
  83. package/dist/esm/plugins/indentation/pm-plugins/keymap.js +4 -4
  84. package/dist/esm/plugins/insert-block/index.js +1 -1
  85. package/dist/esm/plugins/layout/actions.js +1 -2
  86. package/dist/esm/plugins/macro/actions.js +2 -1
  87. package/dist/esm/plugins/paste/pm-plugins/main.js +2 -4
  88. package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +9 -7
  89. package/dist/esm/plugins/undo-redo/enums.js +1 -1
  90. package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +1 -2
  91. package/dist/esm/ui/ErrorBoundary/index.js +1 -1
  92. package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
  93. package/dist/esm/ui/WithHelpTrigger/index.js +1 -1
  94. package/dist/esm/version-wrapper.js +1 -1
  95. package/dist/types/plugins/analytics/index.d.ts +0 -5
  96. package/dist/types/plugins/annotation/commands/index.d.ts +2 -3
  97. package/dist/types/plugins/annotation/commands/transform.d.ts +1 -2
  98. package/dist/types/plugins/annotation/ui/InlineCommentView.d.ts +1 -1
  99. package/dist/types/plugins/annotation/utils.d.ts +1 -1
  100. package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +1 -1
  101. package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +1 -1
  102. package/dist/types/plugins/find-replace/commands-with-analytics.d.ts +1 -1
  103. package/dist/types/plugins/find-replace/ui/Find.d.ts +1 -1
  104. package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +2 -2
  105. package/dist/types/plugins/find-replace/ui/FindReplaceToolbarButton.d.ts +1 -1
  106. package/dist/types/plugins/find-replace/ui/Replace.d.ts +3 -2
  107. package/dist/types/plugins/indentation/commands/index.d.ts +3 -2
  108. package/dist/types/plugins/indentation/commands/utils.d.ts +3 -2
  109. package/dist/types/plugins/indentation/index.d.ts +5 -2
  110. package/dist/types/plugins/indentation/pm-plugins/keymap.d.ts +2 -1
  111. package/dist/types/plugins/macro/actions.d.ts +1 -1
  112. package/dist/types/plugins/paste/util/index.d.ts +1 -2
  113. package/dist/types/presets/default.d.ts +20 -0
  114. package/dist/types/ui/Appearance/FullPage/FullPageToolbar.d.ts +2 -2
  115. package/dist/types/ui/ConfigPanel/FormErrorBoundary.d.ts +3 -3
  116. package/dist/types/ui/ErrorBoundary/index.d.ts +2 -3
  117. package/dist/types/ui/Toolbar/toolbar-types.d.ts +2 -2
  118. package/dist/types-ts4.5/plugins/analytics/index.d.ts +0 -5
  119. package/dist/types-ts4.5/plugins/annotation/commands/index.d.ts +2 -3
  120. package/dist/types-ts4.5/plugins/annotation/commands/transform.d.ts +1 -2
  121. package/dist/types-ts4.5/plugins/annotation/ui/InlineCommentView.d.ts +1 -1
  122. package/dist/types-ts4.5/plugins/annotation/utils.d.ts +1 -1
  123. package/dist/types-ts4.5/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +1 -1
  124. package/dist/types-ts4.5/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +1 -1
  125. package/dist/types-ts4.5/plugins/find-replace/commands-with-analytics.d.ts +1 -1
  126. package/dist/types-ts4.5/plugins/find-replace/ui/Find.d.ts +1 -1
  127. package/dist/types-ts4.5/plugins/find-replace/ui/FindReplace.d.ts +2 -2
  128. package/dist/types-ts4.5/plugins/find-replace/ui/FindReplaceToolbarButton.d.ts +1 -1
  129. package/dist/types-ts4.5/plugins/find-replace/ui/Replace.d.ts +3 -2
  130. package/dist/types-ts4.5/plugins/indentation/commands/index.d.ts +3 -2
  131. package/dist/types-ts4.5/plugins/indentation/commands/utils.d.ts +3 -2
  132. package/dist/types-ts4.5/plugins/indentation/index.d.ts +7 -2
  133. package/dist/types-ts4.5/plugins/indentation/pm-plugins/keymap.d.ts +2 -1
  134. package/dist/types-ts4.5/plugins/macro/actions.d.ts +1 -1
  135. package/dist/types-ts4.5/plugins/paste/util/index.d.ts +1 -2
  136. package/dist/types-ts4.5/presets/default.d.ts +20 -0
  137. package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageToolbar.d.ts +2 -2
  138. package/dist/types-ts4.5/ui/ConfigPanel/FormErrorBoundary.d.ts +3 -3
  139. package/dist/types-ts4.5/ui/ErrorBoundary/index.d.ts +2 -3
  140. package/dist/types-ts4.5/ui/Toolbar/toolbar-types.d.ts +2 -2
  141. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import { addAnalytics, INDENT_TYPE, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics';
1
+ import { INDENT_TYPE, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
2
2
 
3
3
  // Analytics GAS v3 Utils
4
4
 
@@ -44,6 +44,7 @@ export function getPrevIndentLevel(prevAttrs) {
44
44
  export function createAnalyticsDispatch({
45
45
  getAttrsChanges,
46
46
  inputMethod,
47
+ editorAnalyticsAPI,
47
48
  state,
48
49
  dispatch
49
50
  }) {
@@ -65,7 +66,7 @@ export function createAnalyticsDispatch({
65
66
  return; // If no valid indent type continue
66
67
  }
67
68
 
68
- currentTr = addAnalytics(state, currentTr, {
69
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
69
70
  action: ACTION.FORMATTED,
70
71
  actionSubject: ACTION_SUBJECT.TEXT,
71
72
  actionSubjectId: ACTION_SUBJECT_ID.FORMAT_INDENT,
@@ -77,7 +78,7 @@ export function createAnalyticsDispatch({
77
78
  direction,
78
79
  indentType
79
80
  }
80
- });
81
+ })(currentTr);
81
82
  });
82
83
 
83
84
  // Dispatch analytics if exist
@@ -1,6 +1,8 @@
1
1
  import { indentation } from '@atlaskit/adf-schema';
2
2
  import { keymapPlugin } from './pm-plugins/keymap';
3
- const indentationPlugin = () => ({
3
+ const indentationPlugin = ({
4
+ api
5
+ }) => ({
4
6
  name: 'indentation',
5
7
  marks() {
6
8
  return [{
@@ -11,7 +13,10 @@ const indentationPlugin = () => ({
11
13
  pmPlugins() {
12
14
  return [{
13
15
  name: 'indentationKeymap',
14
- plugin: () => keymapPlugin()
16
+ plugin: () => {
17
+ var _api$analytics;
18
+ return keymapPlugin(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
19
+ }
15
20
  }];
16
21
  }
17
22
  });
@@ -3,16 +3,16 @@ import { bindKeymapWithCommand, findShortcutByKeymap, outdent, indent, backspace
3
3
  import { isTextSelection } from '../../../utils';
4
4
  import { getIndentCommand, getOutdentCommand } from '../commands';
5
5
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
6
- export function keymapPlugin() {
6
+ export function keymapPlugin(editorAnalyticsAPI) {
7
7
  const list = {};
8
- bindKeymapWithCommand(findShortcutByKeymap(indent), getIndentCommand(INPUT_METHOD.KEYBOARD), list);
9
- bindKeymapWithCommand(findShortcutByKeymap(outdent), getOutdentCommand(INPUT_METHOD.KEYBOARD), list);
8
+ bindKeymapWithCommand(findShortcutByKeymap(indent), getIndentCommand(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), list);
9
+ bindKeymapWithCommand(findShortcutByKeymap(outdent), getOutdentCommand(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), list);
10
10
  bindKeymapWithCommand(findShortcutByKeymap(backspace), (state, dispatch) => {
11
11
  const {
12
12
  selection
13
13
  } = state;
14
14
  if (isTextSelection(selection) && selection.$cursor && selection.$cursor.parentOffset === 0) {
15
- return dispatch ? getOutdentCommand(INPUT_METHOD.KEYBOARD)(state, dispatch) : false;
15
+ return dispatch ? getOutdentCommand(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD)(state, dispatch) : false;
16
16
  }
17
17
  return false;
18
18
  }, list);
@@ -5,7 +5,7 @@ import { insertMacroFromMacroBrowser } from '../macro';
5
5
  import WithPluginState from '../../ui/WithPluginState';
6
6
  import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
7
7
  import { BLOCK_QUOTE, CODE_BLOCK, PANEL } from '@atlaskit/editor-plugin-block-type/consts';
8
- import { INPUT_METHOD } from '../analytics';
8
+ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
9
9
  import { pluginKey as placeholderTextStateKey } from '../placeholder-text/plugin-key';
10
10
  import { pluginKey as macroStateKey } from '../macro/plugin-key';
11
11
  import { ToolbarSize } from '../../ui/Toolbar/types';
@@ -3,9 +3,8 @@ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
3
3
  import { TextSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
4
4
  import { flatmap, mapChildren } from '../../utils/slice';
5
5
  import { getStepRange, isEmptyDocument } from '@atlaskit/editor-common/utils';
6
- import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
6
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, LAYOUT_TYPE } from '@atlaskit/editor-common/analytics';
7
7
  import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
8
- import { LAYOUT_TYPE } from '../analytics/types/node-events';
9
8
  import { pluginKey } from './pm-plugins/plugin-key';
10
9
  export const ONE_COL_LAYOUTS = ['single'];
11
10
  export const TWO_COL_LAYOUTS = ['two_equal', 'two_left_sidebar', 'two_right_sidebar'];
@@ -4,7 +4,8 @@ import { safeInsert, replaceSelectedNode, findSelectedNodeOfType, replaceParentN
4
4
  import { getValidNode } from '@atlaskit/editor-common/validator';
5
5
  import { normaliseNestedLayout } from '@atlaskit/editor-common/insert';
6
6
  import { getPluginState as getExtensionPluginState } from '../extension/plugin-factory';
7
- import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, addAnalytics } from '../analytics';
7
+ import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
8
+ import { addAnalytics } from '../analytics';
8
9
  import { TARGET_SELECTION_SOURCE } from '../analytics/types/extension-events';
9
10
  import { pluginKey } from './plugin-key';
10
11
  export const insertMacroFromMacroBrowser = (macroProvider, macroNode, isEditing) => async view => {
@@ -13,8 +13,6 @@ import { escapeLinks, htmlContainsSingleFile, isPastedFromWord, isPastedFromExce
13
13
  import { transformSliceNestedExpandToExpand, transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark, transformSliceToDecisionList } from '@atlaskit/editor-common/transforms';
14
14
  import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks } from '../handlers';
15
15
  import { createPasteMeasurePayload, getContentNodeTypes, handlePasteAsPlainTextWithAnalytics, handlePasteIntoTaskAndDecisionWithAnalytics, handleCodeBlockWithAnalytics, handleMediaSingleWithAnalytics, handlePastePreservingMarksWithAnalytics, handleMarkdownWithAnalytics, handleRichTextWithAnalytics, handleExpandWithAnalytics, handleSelectedTableWithAnalytics, handlePasteLinkOnSelectedTextWithAnalytics, sendPasteAnalyticsEvent, handlePasteIntoCaptionWithAnalytics, handlePastePanelOrDecisionIntoListWithAnalytics, handlePasteNonNestableBlockNodesIntoListWithAnalytics } from './analytics';
16
- // TODO: ED-20519 It requires full analytics extraction to use the plugin injection API
17
- import { analyticsPluginKey } from '../../analytics';
18
16
  import { isInsideBlockQuote, insideTable, measurements } from '../../../utils';
19
17
  import { upgradeTextToLists, splitParagraphs } from '../commands';
20
18
  // TODO: ED-20519 It requires annotation extraction to use the plugin injection API
@@ -77,7 +75,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
77
75
  }
78
76
  },
79
77
  handlePaste(view, rawEvent, slice) {
80
- var _text, _analyticsPlugin$perf, _analyticsPlugin$perf2, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$m;
78
+ var _text, _pluginInjectionApi$a2, _pluginInjectionApi$a3, _analyticsPlugin$perf, _analyticsPlugin$perf2, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$m;
81
79
  const event = rawEvent;
82
80
  if (!event.clipboardData) {
83
81
  return false;
@@ -125,7 +123,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
125
123
  const {
126
124
  state
127
125
  } = view;
128
- const analyticsPlugin = analyticsPluginKey.getState(state);
126
+ const analyticsPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : (_pluginInjectionApi$a3 = _pluginInjectionApi$a2.sharedState) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.currentState();
129
127
  const pasteTrackingEnabled = analyticsPlugin === null || analyticsPlugin === void 0 ? void 0 : (_analyticsPlugin$perf = analyticsPlugin.performanceTracking) === null || _analyticsPlugin$perf === void 0 ? void 0 : (_analyticsPlugin$perf2 = _analyticsPlugin$perf.pasteTracking) === null || _analyticsPlugin$perf2 === void 0 ? void 0 : _analyticsPlugin$perf2.enabled;
130
128
  if (pasteTrackingEnabled) {
131
129
  const content = getContentNodeTypes(slice.content);
@@ -1,6 +1,6 @@
1
1
  import { getIndentCommand as indentParagraphOrHeading, getOutdentCommand as outdentParagraphOrHeading } from '../../indentation/commands';
2
2
  import { getIndentCommand as indentTaskList, getUnindentCommand as outdentTaskList } from '../../tasks-and-decisions/pm-plugins/keymaps';
3
- import { INPUT_METHOD } from '../../analytics';
3
+ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import { pluginKey as indentationButtonsPluginKey } from '../pm-plugins/indentation-buttons';
5
5
  export const onItemActivated = pluginInjectionApi => ({
6
6
  buttonName,
@@ -18,14 +18,15 @@ export const onItemActivated = pluginInjectionApi => ({
18
18
  var _indentationButtonsPl;
19
19
  const node = (_indentationButtonsPl = indentationButtonsPluginKey.getState(editorView.state)) === null || _indentationButtonsPl === void 0 ? void 0 : _indentationButtonsPl.node;
20
20
  if (node === 'paragraph_heading') {
21
- indentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
21
+ var _pluginInjectionApi$a;
22
+ indentParagraphOrHeading(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
22
23
  }
23
24
  if (node === 'list') {
24
25
  pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.indentList(INPUT_METHOD.TOOLBAR));
25
26
  }
26
27
  if (node === 'taskList') {
27
- var _pluginInjectionApi$a;
28
- indentTaskList(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
28
+ var _pluginInjectionApi$a2;
29
+ indentTaskList(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
29
30
  }
30
31
  break;
31
32
  }
@@ -34,14 +35,15 @@ export const onItemActivated = pluginInjectionApi => ({
34
35
  var _indentationButtonsPl2;
35
36
  const node = (_indentationButtonsPl2 = indentationButtonsPluginKey.getState(editorView.state)) === null || _indentationButtonsPl2 === void 0 ? void 0 : _indentationButtonsPl2.node;
36
37
  if (node === 'paragraph_heading') {
37
- outdentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
38
+ var _pluginInjectionApi$a3;
39
+ outdentParagraphOrHeading(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions)(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
38
40
  }
39
41
  if (node === 'list') {
40
42
  pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.outdentList(INPUT_METHOD.TOOLBAR));
41
43
  }
42
44
  if (node === 'taskList') {
43
- var _pluginInjectionApi$a2;
44
- outdentTaskList(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
45
+ var _pluginInjectionApi$a4;
46
+ outdentTaskList(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions)(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
45
47
  }
46
48
  break;
47
49
  }
@@ -1,4 +1,4 @@
1
- import { INPUT_METHOD } from '../analytics/types/enums';
1
+ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  export let InputSource = function (InputSource) {
3
3
  InputSource[InputSource["TOOLBAR"] = INPUT_METHOD.TOOLBAR] = "TOOLBAR";
4
4
  InputSource[InputSource["KEYBOARD"] = INPUT_METHOD.KEYBOARD] = "KEYBOARD";
@@ -3,8 +3,7 @@ import React from 'react';
3
3
  import { injectIntl } from 'react-intl-next';
4
4
  import SectionMessage from '@atlaskit/section-message';
5
5
  import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
6
- import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../plugins/analytics';
7
- import { editorAnalyticsChannel } from '../../plugins/analytics/consts';
6
+ import { ACTION, ACTION_SUBJECT, EVENT_TYPE, editorAnalyticsChannel } from '@atlaskit/editor-common/analytics';
8
7
  import { messages } from './messages';
9
8
  class FormErrorBoundaryInner extends React.Component {
10
9
  constructor(...args) {
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import React from 'react';
3
3
  import { logException } from '@atlaskit/editor-common/monitoring';
4
- import { ACTION, EVENT_TYPE } from '../../plugins/analytics';
4
+ import { ACTION, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
5
5
  export class ErrorBoundary extends React.Component {
6
6
  constructor(...args) {
7
7
  super(...args);
@@ -12,7 +12,7 @@ import Button from '@atlaskit/button/custom-theme-button';
12
12
  import ToolbarButton from '../ToolbarButton';
13
13
  import withOuterListeners from '../with-outer-listeners';
14
14
  import { wrapper, buttonContent, confirmationPopup, confirmationText, confirmationHeader, confirmationImg } from './styles';
15
- import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '../../plugins/analytics';
15
+ import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
16
16
  import { createDispatch } from '../../event-dispatcher';
17
17
  import { openFeedbackDialog } from '../../plugins/feedback-dialog';
18
18
  import deprecationWarnings from '../../utils/deprecation-warnings';
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT_ID } from '../../plugins/analytics';
4
+ import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
5
5
  import { createDispatch } from '../../event-dispatcher';
6
6
  import { analyticsEventKey } from '../../plugins/analytics/consts';
7
7
  import { deprecatedOpenHelpCommand } from '@atlaskit/editor-plugin-help-dialog';
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "189.1.2";
2
+ export const version = "189.1.5";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -16,8 +16,7 @@ import uuid from 'uuid';
16
16
  import { ExperienceStore } from '@atlaskit/editor-common/ufo';
17
17
  import { IntlErrorBoundary } from '@atlaskit/editor-common/ui';
18
18
  import { sniffUserBrowserExtensions } from '@atlaskit/editor-common/utils';
19
- import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../plugins/analytics';
20
- import { editorAnalyticsChannel } from '../plugins/analytics/consts';
19
+ import { ACTION, ACTION_SUBJECT, EVENT_TYPE, editorAnalyticsChannel } from '@atlaskit/editor-common/analytics';
21
20
  import { getDocStructure } from '../utils/document-logger';
22
21
  import { WithEditorView } from './WithEditorView';
23
22
  import { isOutdatedBrowser } from '@atlaskit/editor-common/utils';
@@ -1,6 +1,3 @@
1
1
  import analyticsPlugin from './plugin';
2
- import { analyticsPluginKey as pluginKey } from './plugin-key';
3
- export { ACTION_SUBJECT_ID, ACTION_SUBJECT, ACTION, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE, FULL_WIDTH_MODE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, MODE, PasteContents, PasteSources, PasteTypes, PLATFORMS, PUNC, SYMBOL, TABLE_ACTION, TABLE_BREAKOUT, TRIGGER_METHOD, USER_CONTEXT, DELETE_DIRECTION, fireAnalyticsEvent, getAnalyticsEventsFromTransaction } from '@atlaskit/editor-common/analytics';
4
2
  export { withAnalytics, addAnalytics } from './utils';
5
- export var analyticsPluginKey = pluginKey;
6
3
  export default analyticsPlugin;
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { AnnotationTypes } from '@atlaskit/adf-schema';
3
3
  import { createCommand } from '../pm-plugins/plugin-factory';
4
- import { INPUT_METHOD } from '../../analytics';
4
+ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
5
5
  import { isSelectionValid, getPluginState } from '../utils';
6
6
  import { ACTIONS } from '../pm-plugins/types';
7
7
  import transform from './transform';
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
- import { RESOLVE_METHOD } from './../../analytics/types/inline-comment-events';
4
+ import { RESOLVE_METHOD } from '@atlaskit/editor-common/analytics';
5
5
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
6
6
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
7
7
  import { AnnotationTypes } from '@atlaskit/adf-schema';
@@ -1,7 +1,7 @@
1
1
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
2
2
  import { bindKeymapWithCommand, addInlineComment } from '../../../keymaps';
3
3
  import { setInlineCommentDraftState } from '../commands';
4
- import { INPUT_METHOD } from '../../analytics';
4
+ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
5
5
  export function keymapPlugin(editorAnalyticsAPI) {
6
6
  var list = {};
7
7
  bindKeymapWithCommand(addInlineComment.common, setInlineCommentDraftState(editorAnalyticsAPI)(true, INPUT_METHOD.SHORTCUT), list);
@@ -5,9 +5,9 @@ import { AnnotationViewWrapper } from './AnnotationViewWrapper';
5
5
  import { AnnotationTestIds } from '../types';
6
6
  import { getAnnotationViewKey, getSelectionPositions, getPluginState, getAllAnnotations } from '../utils';
7
7
  import { removeInlineCommentNearSelection, updateInlineCommentResolvedState, setInlineCommentDraftState, createAnnotation, closeComponent } from '../commands';
8
- import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '../../analytics';
9
- import { CONTENT_COMPONENT } from '../../analytics/types';
10
- import { RESOLVE_METHOD } from '../../analytics/types/inline-comment-events';
8
+ import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
9
+ import { CONTENT_COMPONENT } from '@atlaskit/editor-common/analytics';
10
+ import { RESOLVE_METHOD } from '@atlaskit/editor-common/analytics';
11
11
  var findPosForDOM = function findPosForDOM(sel) {
12
12
  var $from = sel.$from,
13
13
  from = sel.from;
@@ -6,7 +6,7 @@ import { css, jsx } from '@emotion/react';
6
6
  import AvatarsWithPluginState from '../../collab-edit/ui/avatars-with-plugin-state';
7
7
  import { useIntl } from 'react-intl-next';
8
8
  import { avatarGroupMessages } from '../messages';
9
- import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '../../analytics';
9
+ import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
10
10
  var toolbarButtonWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: flex-end;\n flex-grow: 0;\n align-items: center;\n & > div {\n margin-right: 0;\n }\n"])));
11
11
  var toolbarButtonWrapperFullWidth = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n flex-grow: 1;\n"])), toolbarButtonWrapper);
12
12
  var AvatarGroupPluginWrapper = function AvatarGroupPluginWrapper(props) {
@@ -5,7 +5,7 @@ import * as themeColors from '@atlaskit/theme/colors';
5
5
  import { hexToRgba } from '@atlaskit/adf-schema';
6
6
  import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/utils';
7
7
  import { addAnalytics } from '../analytics/utils';
8
- import { EVENT_TYPE, ACTION, ACTION_SUBJECT } from '../analytics/types';
8
+ import { EVENT_TYPE, ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
9
9
  // TODO: https://product-fabric.atlassian.net/browse/DSP-7269
10
10
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
11
11
  export var colors = [themeColors.R100, themeColors.R300, themeColors.R500, themeColors.Y100, themeColors.Y300, themeColors.Y500, themeColors.G100, themeColors.G300, themeColors.G500, themeColors.T100, themeColors.T300, themeColors.T500, themeColors.B100, themeColors.B300, themeColors.B500, themeColors.P100, themeColors.P300, themeColors.P500, themeColors.N70, themeColors.N200, themeColors.N800].map(function (solid) {
@@ -6,7 +6,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
6
6
  import { Selection, NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { replaceSelectedNode, findSelectedNodeOfType, replaceParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
8
8
  export { transformSliceToRemoveOpenBodiedExtension } from '@atlaskit/editor-common/transforms';
9
- import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, addAnalytics } from '../analytics';
9
+ import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
10
+ import { addAnalytics } from '../analytics';
10
11
  import { TARGET_SELECTION_SOURCE } from '../analytics/types/extension-events';
11
12
  import { findExtensionWithLocalId } from './utils';
12
13
  import { getPluginState } from './pm-plugins/main';
@@ -8,7 +8,8 @@ import { pluginKey as macroPluginKey } from '../macro/plugin-key';
8
8
  import { nodeToJSON } from '../../utils';
9
9
  import { setEditingContextToContextPanel } from './commands';
10
10
  import { findNodePosWithLocalId, getDataConsumerMark, getNodeTypesReferenced, getSelectedExtension } from './utils';
11
- import { addAnalytics, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '../analytics';
11
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
12
+ import { addAnalytics } from '../analytics';
12
13
  import { setTextSelection } from '@atlaskit/editor-prosemirror/utils';
13
14
  export var getEditInLegacyMacroBrowser = function getEditInLegacyMacroBrowser(_ref) {
14
15
  var view = _ref.view,
@@ -4,7 +4,7 @@ import WithPluginState from '../../ui/WithPluginState';
4
4
  import { cancelSearchWithAnalytics, replaceWithAnalytics, replaceAllWithAnalytics, findWithAnalytics, findNextWithAnalytics, findPrevWithAnalytics, activateWithAnalytics } from './commands-with-analytics';
5
5
  import { blur, toggleMatchCase } from './commands';
6
6
  import FindReplaceToolbarButton from './ui/FindReplaceToolbarButton';
7
- import { TRIGGER_METHOD } from '../analytics';
7
+ import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
8
8
  var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithState(props) {
9
9
  var popupsBoundariesElement = props.popupsBoundariesElement,
10
10
  popupsMountPoint = props.popupsMountPoint,
@@ -1,5 +1,6 @@
1
1
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
2
- import { withAnalytics, ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '../analytics';
2
+ import { withAnalytics } from '../analytics';
3
+ import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
4
  import { activate, find, findNext, findPrevious, replace, replaceAll, cancelSearch } from './commands';
4
5
  export var activateWithAnalytics = function activateWithAnalytics(_ref) {
5
6
  var triggerMethod = _ref.triggerMethod;
@@ -1,7 +1,7 @@
1
1
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
2
2
  import { bindKeymapWithCommand, find as findKeymap } from '../../keymaps';
3
3
  import { activateWithAnalytics } from './commands-with-analytics';
4
- import { TRIGGER_METHOD } from '../analytics';
4
+ import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
5
5
  var activateFindReplace = function activateFindReplace() {
6
6
  return function (state, dispatch) {
7
7
  activateWithAnalytics({
@@ -18,7 +18,7 @@ import ChevronUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-up';
18
18
  import MatchCaseIcon from '@atlaskit/icon/glyph/emoji/keyboard';
19
19
  import Textfield from '@atlaskit/textfield';
20
20
  import { countStyles, sectionWrapperStyles } from './styles';
21
- import { TRIGGER_METHOD } from '../../analytics/types';
21
+ import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
22
22
  import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
23
23
  import rafSchd from 'raf-schd';
24
24
  export var FIND_DEBOUNCE_MS = 100;
@@ -19,7 +19,7 @@ import ToolbarButton, { TOOLBAR_BUTTON } from '../../../ui/ToolbarButton';
19
19
  import { Dropdown, ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu';
20
20
  import EditorSearchIcon from '@atlaskit/icon/glyph/editor/search';
21
21
  import FindReplace from './FindReplace';
22
- import { TRIGGER_METHOD } from '../../analytics/types';
22
+ import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
23
23
  import { ToolTipContent, findKeymapByDescription, tooltip } from '../../../keymaps';
24
24
  import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
25
25
  var toolbarButtonWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex: 1 1 auto;\n flex-grow: 0;\n justify-content: flex-end;\n align-items: center;\n padding: 0 ", ";\n @media (max-width: ", "px) {\n justify-content: center;\n padding: 0;\n }\n"])), "var(--ds-space-100, 8px)", akEditorMobileMaxWidth);
@@ -14,7 +14,7 @@ import Button from '@atlaskit/button/standard-button';
14
14
  import { defineMessages, injectIntl } from 'react-intl-next';
15
15
  import Textfield from '@atlaskit/textfield';
16
16
  import { sectionWrapperStyles, replaceSectionButtonStyles } from './styles';
17
- import { EVENT_TYPE, ACTION, ACTION_SUBJECT, TRIGGER_METHOD } from '../../analytics/types';
17
+ import { EVENT_TYPE, ACTION, ACTION_SUBJECT, TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
18
18
  var messages = defineMessages({
19
19
  replaceWith: {
20
20
  id: 'fabric.editor.replaceWith',
@@ -1,6 +1,6 @@
1
1
  import { toggleBlockMark } from '../../../commands';
2
2
  import { createAnalyticsDispatch } from './utils';
3
- import { INDENT_DIRECTION, INPUT_METHOD } from '../../analytics';
3
+ import { INDENT_DIRECTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import getAttrsWithChangesRecorder from '../../../utils/getAttrsWithChangesRecorder';
5
5
  export var MAX_INDENTATION_LEVEL = 6;
6
6
  export var isIndentationAllowed = function isIndentationAllowed(schema, node) {
@@ -33,7 +33,8 @@ function createIndentationCommand(getNewIndentationAttrs) {
33
33
  function createIndentationCommandWithAnalytics(_ref) {
34
34
  var getNewIndentationAttrs = _ref.getNewIndentationAttrs,
35
35
  direction = _ref.direction,
36
- inputMethod = _ref.inputMethod;
36
+ inputMethod = _ref.inputMethod,
37
+ editorAnalyticsAPI = _ref.editorAnalyticsAPI;
37
38
  // Create a new getAttrs function to record the changes
38
39
  var _getAttrsWithChangesR = getAttrsWithChangesRecorder(getNewIndentationAttrs, {
39
40
  direction: direction
@@ -49,6 +50,7 @@ function createIndentationCommandWithAnalytics(_ref) {
49
50
  return indentationCommand(state, createAnalyticsDispatch({
50
51
  getAttrsChanges: getAndResetAttrsChanges,
51
52
  inputMethod: inputMethod,
53
+ editorAnalyticsAPI: editorAnalyticsAPI,
52
54
  state: state,
53
55
  dispatch: dispatch
54
56
  }));
@@ -79,13 +81,16 @@ var getIndentAttrs = function getIndentAttrs(oldAttr) {
79
81
  }; // Otherwise, increase the level by one
80
82
  };
81
83
 
82
- export var getIndentCommand = function getIndentCommand() {
83
- var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.KEYBOARD;
84
- return createIndentationCommandWithAnalytics({
85
- getNewIndentationAttrs: getIndentAttrs,
86
- direction: INDENT_DIRECTION.INDENT,
87
- inputMethod: inputMethod
88
- });
84
+ export var getIndentCommand = function getIndentCommand(editorAnalyticsAPI) {
85
+ return function () {
86
+ var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.KEYBOARD;
87
+ return createIndentationCommandWithAnalytics({
88
+ getNewIndentationAttrs: getIndentAttrs,
89
+ direction: INDENT_DIRECTION.INDENT,
90
+ inputMethod: inputMethod,
91
+ editorAnalyticsAPI: editorAnalyticsAPI
92
+ });
93
+ };
89
94
  };
90
95
 
91
96
  /**
@@ -110,13 +115,16 @@ var getOutdentAttrs = function getOutdentAttrs(oldAttr) {
110
115
  }; // Decrease the level on other cases
111
116
  };
112
117
 
113
- export var getOutdentCommand = function getOutdentCommand() {
114
- var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.KEYBOARD;
115
- return createIndentationCommandWithAnalytics({
116
- getNewIndentationAttrs: getOutdentAttrs,
117
- direction: INDENT_DIRECTION.OUTDENT,
118
- inputMethod: inputMethod
119
- });
118
+ export var getOutdentCommand = function getOutdentCommand(editorAnalyticsAPI) {
119
+ return function () {
120
+ var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.KEYBOARD;
121
+ return createIndentationCommandWithAnalytics({
122
+ getNewIndentationAttrs: getOutdentAttrs,
123
+ direction: INDENT_DIRECTION.OUTDENT,
124
+ inputMethod: inputMethod,
125
+ editorAnalyticsAPI: editorAnalyticsAPI
126
+ });
127
+ };
120
128
  };
121
129
  export var removeIndentation = function removeIndentation(state, dispatch) {
122
130
  return toggleBlockMark(state.schema.marks.indentation, function () {
@@ -1,4 +1,4 @@
1
- import { addAnalytics, INDENT_TYPE, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics';
1
+ import { INDENT_TYPE, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
2
2
 
3
3
  // Analytics GAS v3 Utils
4
4
 
@@ -44,6 +44,7 @@ export function getPrevIndentLevel(prevAttrs) {
44
44
  export function createAnalyticsDispatch(_ref) {
45
45
  var getAttrsChanges = _ref.getAttrsChanges,
46
46
  inputMethod = _ref.inputMethod,
47
+ editorAnalyticsAPI = _ref.editorAnalyticsAPI,
47
48
  state = _ref.state,
48
49
  dispatch = _ref.dispatch;
49
50
  return function (tr) {
@@ -61,7 +62,7 @@ export function createAnalyticsDispatch(_ref) {
61
62
  return; // If no valid indent type continue
62
63
  }
63
64
 
64
- currentTr = addAnalytics(state, currentTr, {
65
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
65
66
  action: ACTION.FORMATTED,
66
67
  actionSubject: ACTION_SUBJECT.TEXT,
67
68
  actionSubjectId: ACTION_SUBJECT_ID.FORMAT_INDENT,
@@ -73,7 +74,7 @@ export function createAnalyticsDispatch(_ref) {
73
74
  direction: direction,
74
75
  indentType: indentType
75
76
  }
76
- });
77
+ })(currentTr);
77
78
  });
78
79
 
79
80
  // Dispatch analytics if exist
@@ -1,6 +1,7 @@
1
1
  import { indentation } from '@atlaskit/adf-schema';
2
2
  import { keymapPlugin } from './pm-plugins/keymap';
3
- var indentationPlugin = function indentationPlugin() {
3
+ var indentationPlugin = function indentationPlugin(_ref) {
4
+ var api = _ref.api;
4
5
  return {
5
6
  name: 'indentation',
6
7
  marks: function marks() {
@@ -13,7 +14,8 @@ var indentationPlugin = function indentationPlugin() {
13
14
  return [{
14
15
  name: 'indentationKeymap',
15
16
  plugin: function plugin() {
16
- return keymapPlugin();
17
+ var _api$analytics;
18
+ return keymapPlugin(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
17
19
  }
18
20
  }];
19
21
  }
@@ -3,14 +3,14 @@ import { bindKeymapWithCommand, findShortcutByKeymap, outdent, indent, backspace
3
3
  import { isTextSelection } from '../../../utils';
4
4
  import { getIndentCommand, getOutdentCommand } from '../commands';
5
5
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
6
- export function keymapPlugin() {
6
+ export function keymapPlugin(editorAnalyticsAPI) {
7
7
  var list = {};
8
- bindKeymapWithCommand(findShortcutByKeymap(indent), getIndentCommand(INPUT_METHOD.KEYBOARD), list);
9
- bindKeymapWithCommand(findShortcutByKeymap(outdent), getOutdentCommand(INPUT_METHOD.KEYBOARD), list);
8
+ bindKeymapWithCommand(findShortcutByKeymap(indent), getIndentCommand(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), list);
9
+ bindKeymapWithCommand(findShortcutByKeymap(outdent), getOutdentCommand(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), list);
10
10
  bindKeymapWithCommand(findShortcutByKeymap(backspace), function (state, dispatch) {
11
11
  var selection = state.selection;
12
12
  if (isTextSelection(selection) && selection.$cursor && selection.$cursor.parentOffset === 0) {
13
- return dispatch ? getOutdentCommand(INPUT_METHOD.KEYBOARD)(state, dispatch) : false;
13
+ return dispatch ? getOutdentCommand(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD)(state, dispatch) : false;
14
14
  }
15
15
  return false;
16
16
  }, list);
@@ -5,7 +5,7 @@ import { insertMacroFromMacroBrowser } from '../macro';
5
5
  import WithPluginState from '../../ui/WithPluginState';
6
6
  import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
7
7
  import { BLOCK_QUOTE, CODE_BLOCK, PANEL } from '@atlaskit/editor-plugin-block-type/consts';
8
- import { INPUT_METHOD } from '../analytics';
8
+ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
9
9
  import { pluginKey as placeholderTextStateKey } from '../placeholder-text/plugin-key';
10
10
  import { pluginKey as macroStateKey } from '../macro/plugin-key';
11
11
  import { ToolbarSize } from '../../ui/Toolbar/types';
@@ -6,9 +6,8 @@ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
6
6
  import { TextSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { flatmap, mapChildren } from '../../utils/slice';
8
8
  import { getStepRange, isEmptyDocument } from '@atlaskit/editor-common/utils';
9
- import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
9
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, LAYOUT_TYPE } from '@atlaskit/editor-common/analytics';
10
10
  import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
11
- import { LAYOUT_TYPE } from '../analytics/types/node-events';
12
11
  import { pluginKey } from './pm-plugins/plugin-key';
13
12
  export var ONE_COL_LAYOUTS = ['single'];
14
13
  export var TWO_COL_LAYOUTS = ['two_equal', 'two_left_sidebar', 'two_right_sidebar'];
@@ -9,7 +9,8 @@ import { safeInsert, replaceSelectedNode, findSelectedNodeOfType, replaceParentN
9
9
  import { getValidNode } from '@atlaskit/editor-common/validator';
10
10
  import { normaliseNestedLayout } from '@atlaskit/editor-common/insert';
11
11
  import { getPluginState as getExtensionPluginState } from '../extension/plugin-factory';
12
- import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, addAnalytics } from '../analytics';
12
+ import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
13
+ import { addAnalytics } from '../analytics';
13
14
  import { TARGET_SELECTION_SOURCE } from '../analytics/types/extension-events';
14
15
  import { pluginKey } from './plugin-key';
15
16
  export var insertMacroFromMacroBrowser = function insertMacroFromMacroBrowser(macroProvider, macroNode, isEditing) {