@atlaskit/editor-core 189.3.14 → 189.3.16

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 (229) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  3. package/dist/cjs/plugins/analytics/index.js +0 -6
  4. package/dist/cjs/plugins/analytics/utils.js +0 -29
  5. package/dist/cjs/plugins/breakout/index.js +3 -3
  6. package/dist/cjs/plugins/breakout/ui/LayoutButton.js +4 -4
  7. package/dist/cjs/plugins/extension/extension-api.js +3 -3
  8. package/dist/cjs/plugins/extension/index.js +14 -3
  9. package/dist/cjs/plugins/{macro → extension/pm-plugins/macro}/actions.js +3 -4
  10. package/dist/cjs/plugins/{macro → extension/pm-plugins/macro}/index.js +2 -18
  11. package/dist/cjs/plugins/extension/toolbar.js +1 -1
  12. package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +32 -30
  13. package/dist/cjs/plugins/find-replace/commands-with-analytics.js +85 -71
  14. package/dist/cjs/plugins/find-replace/index.js +5 -2
  15. package/dist/cjs/plugins/find-replace/keymap.js +4 -4
  16. package/dist/cjs/plugins/index.js +1 -24
  17. package/dist/cjs/plugins/insert-block/index.js +36 -53
  18. package/dist/cjs/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.js +3 -9
  19. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
  20. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
  21. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +3 -3
  22. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +4 -5
  23. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/item.js +7 -8
  24. package/dist/cjs/plugins/paste/handlers.js +3 -3
  25. package/dist/cjs/plugins/paste/pm-plugins/main.js +4 -4
  26. package/dist/cjs/presets/context.js +5 -3
  27. package/dist/cjs/presets/universal.js +12 -8
  28. package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
  29. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
  30. package/dist/cjs/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +11 -8
  31. package/dist/cjs/ui/ContentStyles/index.js +4 -4
  32. package/dist/cjs/ui/ToolbarFeedback/index.js +1 -1
  33. package/dist/cjs/use-preset.js +0 -1
  34. package/dist/cjs/version-wrapper.js +1 -1
  35. package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  36. package/dist/es2019/plugins/analytics/index.js +1 -1
  37. package/dist/es2019/plugins/analytics/utils.js +0 -24
  38. package/dist/es2019/plugins/breakout/index.js +1 -1
  39. package/dist/es2019/plugins/breakout/ui/LayoutButton.js +1 -1
  40. package/dist/es2019/plugins/extension/extension-api.js +2 -2
  41. package/dist/es2019/plugins/extension/index.js +13 -3
  42. package/dist/es2019/plugins/{macro → extension/pm-plugins/macro}/actions.js +2 -2
  43. package/dist/es2019/plugins/{macro → extension/pm-plugins/macro}/index.js +1 -14
  44. package/dist/es2019/plugins/extension/toolbar.js +1 -1
  45. package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +20 -19
  46. package/dist/es2019/plugins/find-replace/commands-with-analytics.js +15 -15
  47. package/dist/es2019/plugins/find-replace/index.js +7 -2
  48. package/dist/es2019/plugins/find-replace/keymap.js +4 -4
  49. package/dist/es2019/plugins/index.js +0 -2
  50. package/dist/es2019/plugins/insert-block/index.js +19 -36
  51. package/dist/es2019/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.js +4 -8
  52. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
  53. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
  54. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -2
  55. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -3
  56. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/item.js +2 -2
  57. package/dist/es2019/plugins/paste/handlers.js +4 -3
  58. package/dist/es2019/plugins/paste/pm-plugins/main.js +4 -4
  59. package/dist/es2019/presets/context.js +2 -2
  60. package/dist/es2019/presets/universal.js +10 -6
  61. package/dist/es2019/ui/Appearance/Comment/Comment.js +1 -1
  62. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
  63. package/dist/es2019/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +9 -4
  64. package/dist/es2019/ui/ContentStyles/index.js +1 -1
  65. package/dist/es2019/ui/ToolbarFeedback/index.js +2 -2
  66. package/dist/es2019/use-preset.js +0 -1
  67. package/dist/es2019/version-wrapper.js +1 -1
  68. package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  69. package/dist/esm/plugins/analytics/index.js +1 -1
  70. package/dist/esm/plugins/analytics/utils.js +0 -28
  71. package/dist/esm/plugins/breakout/index.js +1 -1
  72. package/dist/esm/plugins/breakout/ui/LayoutButton.js +1 -1
  73. package/dist/esm/plugins/extension/extension-api.js +2 -2
  74. package/dist/esm/plugins/extension/index.js +14 -3
  75. package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/actions.js +2 -2
  76. package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/index.js +1 -17
  77. package/dist/esm/plugins/extension/toolbar.js +1 -1
  78. package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +32 -30
  79. package/dist/esm/plugins/find-replace/commands-with-analytics.js +84 -70
  80. package/dist/esm/plugins/find-replace/index.js +5 -2
  81. package/dist/esm/plugins/find-replace/keymap.js +4 -4
  82. package/dist/esm/plugins/index.js +0 -2
  83. package/dist/esm/plugins/insert-block/index.js +36 -53
  84. package/dist/esm/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.js +4 -10
  85. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
  86. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
  87. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -2
  88. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -3
  89. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/item.js +2 -2
  90. package/dist/esm/plugins/paste/handlers.js +4 -3
  91. package/dist/esm/plugins/paste/pm-plugins/main.js +4 -4
  92. package/dist/esm/presets/context.js +2 -2
  93. package/dist/esm/presets/universal.js +9 -6
  94. package/dist/esm/ui/Appearance/Comment/Comment.js +1 -1
  95. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
  96. package/dist/esm/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +9 -4
  97. package/dist/esm/ui/ContentStyles/index.js +1 -1
  98. package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
  99. package/dist/esm/use-preset.js +0 -1
  100. package/dist/esm/version-wrapper.js +1 -1
  101. package/dist/types/plugins/analytics/index.d.ts +1 -1
  102. package/dist/types/plugins/analytics/utils.d.ts +0 -11
  103. package/dist/types/plugins/extension/extension-api.d.ts +1 -1
  104. package/dist/{types-ts4.5/plugins → types/plugins/extension/pm-plugins}/macro/index.d.ts +1 -4
  105. package/dist/types/plugins/extension/pm-plugins/macro/types.d.ts +4 -0
  106. package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -2
  107. package/dist/types/plugins/find-replace/commands-with-analytics.d.ts +9 -9
  108. package/dist/types/plugins/find-replace/index.d.ts +5 -3
  109. package/dist/types/plugins/find-replace/keymap.d.ts +2 -1
  110. package/dist/types/plugins/index.d.ts +0 -2
  111. package/dist/types/plugins/insert-block/types.d.ts +4 -2
  112. package/dist/{types-ts4.5 → types/plugins/insert-block}/ui/ElementBrowser/types.d.ts +2 -2
  113. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +1 -1
  114. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +1 -1
  115. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -2
  116. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -1
  117. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -1
  118. package/dist/types/plugins/mobile-dimensions/index.d.ts +2 -1
  119. package/dist/types/plugins/paste/handlers.d.ts +2 -1
  120. package/dist/types/presets/context.d.ts +2 -2
  121. package/dist/types/presets/default.d.ts +8 -0
  122. package/dist/types/presets/universal.d.ts +5 -0
  123. package/dist/types/{plugins/expand/ui/styles.d.ts → ui/ContentStyles/expand.d.ts} +1 -1
  124. package/dist/types-ts4.5/plugins/analytics/index.d.ts +1 -1
  125. package/dist/types-ts4.5/plugins/analytics/utils.d.ts +0 -11
  126. package/dist/types-ts4.5/plugins/extension/extension-api.d.ts +1 -1
  127. package/dist/{types/plugins → types-ts4.5/plugins/extension/pm-plugins}/macro/index.d.ts +1 -4
  128. package/dist/types-ts4.5/plugins/extension/pm-plugins/macro/types.d.ts +4 -0
  129. package/dist/types-ts4.5/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -2
  130. package/dist/types-ts4.5/plugins/find-replace/commands-with-analytics.d.ts +9 -9
  131. package/dist/types-ts4.5/plugins/find-replace/index.d.ts +6 -3
  132. package/dist/types-ts4.5/plugins/find-replace/keymap.d.ts +2 -1
  133. package/dist/types-ts4.5/plugins/index.d.ts +0 -2
  134. package/dist/types-ts4.5/plugins/insert-block/types.d.ts +4 -2
  135. package/dist/{types → types-ts4.5/plugins/insert-block}/ui/ElementBrowser/types.d.ts +2 -2
  136. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +1 -1
  137. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +1 -1
  138. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -2
  139. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -1
  140. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -1
  141. package/dist/types-ts4.5/plugins/mobile-dimensions/index.d.ts +2 -1
  142. package/dist/types-ts4.5/plugins/paste/handlers.d.ts +2 -1
  143. package/dist/types-ts4.5/presets/context.d.ts +2 -2
  144. package/dist/types-ts4.5/presets/default.d.ts +8 -0
  145. package/dist/types-ts4.5/presets/universal.d.ts +5 -0
  146. package/dist/types-ts4.5/{plugins/expand/ui/styles.d.ts → ui/ContentStyles/expand.d.ts} +1 -1
  147. package/package.json +5 -9
  148. package/dist/cjs/plugins/breakout/constants.js +0 -10
  149. package/dist/cjs/plugins/expand/commands.js +0 -184
  150. package/dist/cjs/plugins/expand/index.js +0 -111
  151. package/dist/cjs/plugins/expand/nodeviews/index.js +0 -485
  152. package/dist/cjs/plugins/expand/pm-plugins/keymap.js +0 -171
  153. package/dist/cjs/plugins/expand/pm-plugins/main.js +0 -85
  154. package/dist/cjs/plugins/expand/pm-plugins/plugin-factory.js +0 -15
  155. package/dist/cjs/plugins/expand/reducer.js +0 -20
  156. package/dist/cjs/plugins/expand/toolbar.js +0 -59
  157. package/dist/cjs/plugins/expand/ui/ExpandIconButton.js +0 -104
  158. package/dist/cjs/plugins/expand/ui/class-names.js +0 -20
  159. package/dist/cjs/plugins/expand/utils.js +0 -24
  160. package/dist/cjs/ui/ElementBrowser/types.js +0 -5
  161. package/dist/es2019/plugins/breakout/constants.js +0 -4
  162. package/dist/es2019/plugins/expand/commands.js +0 -161
  163. package/dist/es2019/plugins/expand/index.js +0 -95
  164. package/dist/es2019/plugins/expand/nodeviews/index.js +0 -475
  165. package/dist/es2019/plugins/expand/pm-plugins/keymap.js +0 -197
  166. package/dist/es2019/plugins/expand/pm-plugins/main.js +0 -73
  167. package/dist/es2019/plugins/expand/pm-plugins/plugin-factory.js +0 -9
  168. package/dist/es2019/plugins/expand/reducer.js +0 -11
  169. package/dist/es2019/plugins/expand/toolbar.js +0 -52
  170. package/dist/es2019/plugins/expand/ui/ExpandIconButton.js +0 -85
  171. package/dist/es2019/plugins/expand/ui/class-names.js +0 -12
  172. package/dist/es2019/plugins/expand/utils.js +0 -1
  173. package/dist/esm/plugins/breakout/constants.js +0 -4
  174. package/dist/esm/plugins/expand/commands.js +0 -177
  175. package/dist/esm/plugins/expand/index.js +0 -97
  176. package/dist/esm/plugins/expand/nodeviews/index.js +0 -477
  177. package/dist/esm/plugins/expand/pm-plugins/keymap.js +0 -165
  178. package/dist/esm/plugins/expand/pm-plugins/main.js +0 -77
  179. package/dist/esm/plugins/expand/pm-plugins/plugin-factory.js +0 -9
  180. package/dist/esm/plugins/expand/reducer.js +0 -13
  181. package/dist/esm/plugins/expand/toolbar.js +0 -52
  182. package/dist/esm/plugins/expand/ui/ExpandIconButton.js +0 -95
  183. package/dist/esm/plugins/expand/ui/class-names.js +0 -14
  184. package/dist/esm/plugins/expand/utils.js +0 -1
  185. package/dist/esm/plugins/macro/types.js +0 -1
  186. package/dist/esm/ui/ElementBrowser/types.js +0 -1
  187. package/dist/types/plugins/breakout/constants.d.ts +0 -4
  188. package/dist/types/plugins/expand/commands.d.ts +0 -13
  189. package/dist/types/plugins/expand/index.d.ts +0 -31
  190. package/dist/types/plugins/expand/nodeviews/index.d.ts +0 -55
  191. package/dist/types/plugins/expand/pm-plugins/keymap.d.ts +0 -4
  192. package/dist/types/plugins/expand/pm-plugins/main.d.ts +0 -8
  193. package/dist/types/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -3
  194. package/dist/types/plugins/expand/reducer.d.ts +0 -3
  195. package/dist/types/plugins/expand/toolbar.d.ts +0 -3
  196. package/dist/types/plugins/expand/types.d.ts +0 -9
  197. package/dist/types/plugins/expand/ui/ExpandIconButton.d.ts +0 -43
  198. package/dist/types/plugins/expand/ui/class-names.d.ts +0 -11
  199. package/dist/types/plugins/expand/utils.d.ts +0 -1
  200. package/dist/types/plugins/macro/types.d.ts +0 -4
  201. package/dist/types-ts4.5/plugins/breakout/constants.d.ts +0 -4
  202. package/dist/types-ts4.5/plugins/expand/commands.d.ts +0 -13
  203. package/dist/types-ts4.5/plugins/expand/index.d.ts +0 -31
  204. package/dist/types-ts4.5/plugins/expand/nodeviews/index.d.ts +0 -55
  205. package/dist/types-ts4.5/plugins/expand/pm-plugins/keymap.d.ts +0 -4
  206. package/dist/types-ts4.5/plugins/expand/pm-plugins/main.d.ts +0 -8
  207. package/dist/types-ts4.5/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -3
  208. package/dist/types-ts4.5/plugins/expand/reducer.d.ts +0 -3
  209. package/dist/types-ts4.5/plugins/expand/toolbar.d.ts +0 -3
  210. package/dist/types-ts4.5/plugins/expand/types.d.ts +0 -9
  211. package/dist/types-ts4.5/plugins/expand/ui/ExpandIconButton.d.ts +0 -43
  212. package/dist/types-ts4.5/plugins/expand/ui/class-names.d.ts +0 -11
  213. package/dist/types-ts4.5/plugins/expand/utils.d.ts +0 -1
  214. package/dist/types-ts4.5/plugins/macro/types.d.ts +0 -4
  215. /package/dist/cjs/plugins/{macro → extension/pm-plugins/macro}/plugin-key.js +0 -0
  216. /package/dist/cjs/plugins/{expand → extension/pm-plugins/macro}/types.js +0 -0
  217. /package/dist/cjs/plugins/{macro → insert-block/ui/ElementBrowser}/types.js +0 -0
  218. /package/dist/es2019/plugins/{macro → extension/pm-plugins/macro}/plugin-key.js +0 -0
  219. /package/dist/es2019/plugins/{expand → extension/pm-plugins/macro}/types.js +0 -0
  220. /package/dist/es2019/plugins/{macro → insert-block/ui/ElementBrowser}/types.js +0 -0
  221. /package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/plugin-key.js +0 -0
  222. /package/dist/{es2019/ui/ElementBrowser → esm/plugins/extension/pm-plugins/macro}/types.js +0 -0
  223. /package/dist/esm/plugins/{expand → insert-block/ui/ElementBrowser}/types.js +0 -0
  224. /package/dist/types/plugins/{macro → extension/pm-plugins/macro}/actions.d.ts +0 -0
  225. /package/dist/types/plugins/{macro → extension/pm-plugins/macro}/plugin-key.d.ts +0 -0
  226. /package/dist/types/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.d.ts +0 -0
  227. /package/dist/types-ts4.5/plugins/{macro → extension/pm-plugins/macro}/actions.d.ts +0 -0
  228. /package/dist/types-ts4.5/plugins/{macro → extension/pm-plugins/macro}/plugin-key.d.ts +0 -0
  229. /package/dist/types-ts4.5/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.d.ts +0 -0
@@ -3,8 +3,8 @@ import React from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  import AddIcon from '@atlaskit/icon/glyph/editor/add';
5
5
  import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
6
- import { ToolTipContent } from '../../../../keymaps';
7
- import ToolbarButton from '../../../../ui/ToolbarButton';
6
+ import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
7
+ import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
8
8
  import { expandIconWrapperStyle } from '@atlaskit/editor-common/styles';
9
9
  import { triggerWrapper } from './styles';
10
10
  const DropDownButtonIcon = /*#__PURE__*/React.memo(props => jsx("span", {
@@ -6,7 +6,7 @@ import ReactDOM from 'react-dom';
6
6
  import { injectIntl } from 'react-intl-next';
7
7
  import { EmojiPicker as AkEmojiPicker } from '@atlaskit/emoji/picker';
8
8
  import { Popup } from '@atlaskit/editor-common/ui';
9
- import ToolbarButton from '../../../../ui/ToolbarButton';
9
+ import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
10
10
  import { separatorStyles, buttonGroupStyle, wrapperStyle } from '@atlaskit/editor-common/styles';
11
11
  import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
12
12
  import { insertTaskDecisionCommand } from '../../../tasks-and-decisions/commands';
@@ -14,7 +14,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
14
14
  import { messages } from './messages';
15
15
  import { createItems } from './create-items';
16
16
  import { BlockInsertMenu } from './block-insert-menu';
17
- import withOuterListeners from '../../../../ui/with-outer-listeners';
17
+ import { withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
18
18
 
19
19
  /**
20
20
  * Checks if an element is detached (i.e. not in the current document)
@@ -423,7 +423,6 @@ export class ToolbarInsertBlock extends React.PureComponent {
423
423
  horizontalRuleEnabled: props.horizontalRuleEnabled,
424
424
  layoutSectionEnabled: props.layoutSectionEnabled,
425
425
  expandEnabled: props.expandEnabled,
426
- macroProvider: props.macroProvider,
427
426
  showElementBrowserLink: props.showElementBrowserLink,
428
427
  emojiProvider: props.emojiProvider,
429
428
  availableWrapperBlockTypes: props.availableWrapperBlockTypes,
@@ -19,8 +19,8 @@ import HorizontalRuleIcon from '@atlaskit/icon/glyph/editor/horizontal-rule';
19
19
  import CodeIcon from '@atlaskit/icon/glyph/editor/code';
20
20
  import InfoIcon from '@atlaskit/icon/glyph/editor/info';
21
21
  import QuoteIcon from '@atlaskit/icon/glyph/quote';
22
- import { shortcutStyle } from '../../../../ui/styles';
23
- import { tooltip, addLink, toggleTable } from '../../../../keymaps';
22
+ import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
23
+ import { tooltip, addLink, toggleTable } from '@atlaskit/editor-common/keymaps';
24
24
  import { shallowEquals } from './shallow-equals';
25
25
  import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
26
26
  const from = init => ({
@@ -9,7 +9,7 @@ import { insideTable } from '@atlaskit/editor-common/core-utils';
9
9
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
10
10
  import { GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
11
11
  // TODO: ED-20519 Needs Macro extraction
12
- import { runMacroAutoConvert } from '../macro';
12
+
13
13
  import { addReplaceSelectedTableAnalytics, applyTextMarksToSlice, hasOnlyNodesOfType } from './util';
14
14
  import { insertSliceForLists } from './edge-cases';
15
15
  import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from './commands';
@@ -483,7 +483,7 @@ function insertAutoMacro(slice, macro, view, from, to) {
483
483
  }
484
484
  return false;
485
485
  }
486
- export function handleMacroAutoConvert(text, slice, queueCardsFromChangedTr, cardsOptions, extensionAutoConverter) {
486
+ export function handleMacroAutoConvert(text, slice, queueCardsFromChangedTr, runMacroAutoConvert, cardsOptions, extensionAutoConverter) {
487
487
  return (state, dispatch, view) => {
488
488
  let macro = null;
489
489
 
@@ -497,7 +497,8 @@ export function handleMacroAutoConvert(text, slice, queueCardsFromChangedTr, car
497
497
 
498
498
  // then try from macro provider (which will be removed some time in the future)
499
499
  if (!macro) {
500
- macro = runMacroAutoConvert(state, text);
500
+ var _runMacroAutoConvert;
501
+ macro = (_runMacroAutoConvert = runMacroAutoConvert === null || runMacroAutoConvert === void 0 ? void 0 : runMacroAutoConvert(state, text)) !== null && _runMacroAutoConvert !== void 0 ? _runMacroAutoConvert : null;
501
502
  }
502
503
  if (macro) {
503
504
  /**
@@ -221,14 +221,14 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
221
221
  // force a "paste as plain text" action by clearing the markdownSlice.
222
222
  markdownSlice = !((_markdownSlice = markdownSlice) !== null && _markdownSlice !== void 0 && _markdownSlice.size) ? undefined : markdownSlice;
223
223
  if (markdownSlice) {
224
- var _pluginInjectionApi$c, _pluginInjectionApi$c2;
224
+ var _pluginInjectionApi$c, _pluginInjectionApi$c2, _pluginInjectionApi$e, _pluginInjectionApi$e2;
225
225
  // linkify text prior to converting to macro
226
226
  if (handlePasteLinkOnSelectedTextWithAnalytics(editorAnalyticsAPI)(view, event, markdownSlice, PasteTypes.markdown)(state, dispatch)) {
227
227
  return true;
228
228
  }
229
229
 
230
230
  // run macro autoconvert prior to other conversions
231
- if (handleMacroAutoConvert(text, markdownSlice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.card) === null || _pluginInjectionApi$c === void 0 ? void 0 : (_pluginInjectionApi$c2 = _pluginInjectionApi$c.actions) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
231
+ if (handleMacroAutoConvert(text, markdownSlice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.card) === null || _pluginInjectionApi$c === void 0 ? void 0 : (_pluginInjectionApi$c2 = _pluginInjectionApi$c.actions) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.queueCardsFromChangedTr, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$e = pluginInjectionApi.extension) === null || _pluginInjectionApi$e === void 0 ? void 0 : (_pluginInjectionApi$e2 = _pluginInjectionApi$e.actions) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : _pluginInjectionApi$e2.runMacroAutoConvert, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
232
232
  // TODO: handleMacroAutoConvert dispatch twice, so we can't use the helper
233
233
  sendPasteAnalyticsEvent(editorAnalyticsAPI)(view, event, markdownSlice, {
234
234
  type: PasteTypes.markdown
@@ -295,7 +295,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
295
295
 
296
296
  // finally, handle rich-text copy-paste
297
297
  if (isRichText) {
298
- var _pluginInjectionApi$c3, _pluginInjectionApi$c4, _pluginInjectionApi$l;
298
+ var _pluginInjectionApi$c3, _pluginInjectionApi$c4, _pluginInjectionApi$e3, _pluginInjectionApi$e4, _pluginInjectionApi$l;
299
299
  // linkify the text where possible
300
300
  slice = linkifyContent(state.schema)(slice);
301
301
  if (handlePasteLinkOnSelectedTextWithAnalytics(editorAnalyticsAPI)(view, event, slice, PasteTypes.richText)(state, dispatch)) {
@@ -303,7 +303,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
303
303
  }
304
304
 
305
305
  // run macro autoconvert prior to other conversions
306
- if (handleMacroAutoConvert(text, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c3 = pluginInjectionApi.card) === null || _pluginInjectionApi$c3 === void 0 ? void 0 : (_pluginInjectionApi$c4 = _pluginInjectionApi$c3.actions) === null || _pluginInjectionApi$c4 === void 0 ? void 0 : _pluginInjectionApi$c4.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
306
+ if (handleMacroAutoConvert(text, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c3 = pluginInjectionApi.card) === null || _pluginInjectionApi$c3 === void 0 ? void 0 : (_pluginInjectionApi$c4 = _pluginInjectionApi$c3.actions) === null || _pluginInjectionApi$c4 === void 0 ? void 0 : _pluginInjectionApi$c4.queueCardsFromChangedTr, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$e3 = pluginInjectionApi.extension) === null || _pluginInjectionApi$e3 === void 0 ? void 0 : (_pluginInjectionApi$e4 = _pluginInjectionApi$e3.actions) === null || _pluginInjectionApi$e4 === void 0 ? void 0 : _pluginInjectionApi$e4.runMacroAutoConvert, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
307
307
  // TODO: handleMacroAutoConvert dispatch twice, so we can't use the helper
308
308
  sendPasteAnalyticsEvent(editorAnalyticsAPI)(view, event, slice, {
309
309
  type: PasteTypes.richText
@@ -11,12 +11,12 @@ export const PresetContextProvider = ({
11
11
  }
12
12
  }, children);
13
13
  };
14
- export const usePresetContext = () => {
14
+ export function usePresetContext() {
15
15
  const {
16
16
  editorApi
17
17
  } = useContext(EditorAPIContext);
18
18
  return editorApi;
19
- };
19
+ }
20
20
  export const useSetPresetContext = () => {
21
21
  const {
22
22
  setEditorApi
@@ -1,4 +1,4 @@
1
- import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, insertBlockPlugin, jiraIssuePlugin, toolbarListsIndentationPlugin, macroPlugin, tasksAndDecisionsPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, expandPlugin, isExpandInsertionEnabled, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin } from '../plugins';
1
+ import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, insertBlockPlugin, jiraIssuePlugin, toolbarListsIndentationPlugin, tasksAndDecisionsPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin } from '../plugins';
2
2
  import { panelPlugin } from '@atlaskit/editor-plugin-panel';
3
3
  import { textColorPlugin } from '@atlaskit/editor-plugin-text-color';
4
4
  import { historyPlugin } from '@atlaskit/editor-plugin-history';
@@ -27,6 +27,7 @@ import { saveOnEnterPlugin } from '@atlaskit/editor-plugin-save-on-enter';
27
27
  import { scrollIntoViewPlugin } from '@atlaskit/editor-plugin-scroll-into-view';
28
28
  import { mentionsPlugin } from '@atlaskit/editor-plugin-mentions';
29
29
  import { placeholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
30
+ import { expandPlugin } from '@atlaskit/editor-plugin-expand';
30
31
  import { isFullPage as fullPageCheck } from '../utils/is-full-page';
31
32
  import { getMediaFeatureFlag } from '@atlaskit/media-common';
32
33
  import { createDefaultPreset } from './default';
@@ -265,11 +266,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
265
266
  }]);
266
267
  }
267
268
  return builder;
268
- }).maybeAdd(macroPlugin, (plugin, builder) => {
269
- if (props.macroProvider) {
270
- return builder.add(plugin);
271
- }
272
- return builder;
273
269
  }).maybeAdd(annotationPlugin, (plugin, builder) => {
274
270
  // See default list for when adding annotations with a provider
275
271
  if (!props.annotationProviders && props.allowConfluenceInlineComment) {
@@ -416,4 +412,12 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
416
412
  appearance
417
413
  }]);
418
414
  return finalPreset;
415
+ }
416
+ export function isExpandInsertionEnabled({
417
+ allowExpand
418
+ }) {
419
+ if (allowExpand && typeof allowExpand === 'object') {
420
+ return !!allowExpand.allowInsertion;
421
+ }
422
+ return false;
419
423
  }
@@ -238,7 +238,7 @@ function RenderWithPluginState({
238
238
  } = useSharedPluginState(api, ['media', 'maxContentSize']);
239
239
  return jsx(Fragment, null, renderChrome({
240
240
  maxContentSize: maxContentSizeState,
241
- mediaState
241
+ mediaState: mediaState !== null && mediaState !== void 0 ? mediaState : undefined
242
242
  }));
243
243
  }
244
244
  export const CommentEditorWithIntl = injectIntl(Editor);
@@ -13,7 +13,7 @@ import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
13
13
  import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
14
14
  import { usePresetContext } from '../../../presets/context';
15
15
  export const EditorToolbar = /*#__PURE__*/React.memo(props => {
16
- var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3;
16
+ var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _editorAPI$analytics;
17
17
  const [shouldSplitToolbar, setShouldSplitToolbar] = useState(false);
18
18
  const editorAPI = usePresetContext();
19
19
 
@@ -62,7 +62,8 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
62
62
  editorView: props.editorView,
63
63
  containerElement: props.containerElement,
64
64
  dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
65
- featureFlags: props.featureFlags
65
+ featureFlags: props.featureFlags,
66
+ editorAnalyticsAPI: editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions
66
67
  }) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
67
68
  useEffect(() => {
68
69
  if (twoLineEditorToolbar) {
@@ -1,14 +1,17 @@
1
1
  import { css } from '@emotion/react';
2
+ import { DN50, N40A, N50A, N80A, R200, R300, R50 } from '@atlaskit/theme/colors';
3
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
2
4
  import { themed } from '@atlaskit/theme/components';
3
- import { R50, R300, N40A, N50A, N80A, DN50, R200 } from '@atlaskit/theme/colors';
5
+ import { BreakoutCssClassName } from '@atlaskit/editor-common/styles';
4
6
  import { sharedExpandStyles } from '@atlaskit/editor-common/ui';
5
- import { SelectionStyle, getSelectionStyles, akLayoutGutterOffset, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
6
- import { BreakoutCssClassName } from '../../breakout/constants';
7
- import { expandClassNames } from './class-names';
7
+ import { akEditorSelectedNodeClassName, akLayoutGutterOffset, getSelectionStyles, SelectionStyle } from '@atlaskit/editor-shared-styles';
8
+ import { expandClassNames } from '@atlaskit/editor-common/styles';
8
9
  const EXPAND_SELECTED_BACKGROUND = themed({
9
10
  light: "var(--ds-background-neutral-subtle, rgba(255, 255, 255, 0.6))",
10
11
  dark: "var(--ds-background-neutral-subtle, rgba(9, 10, 11, 0.29))"
11
12
  });
13
+
14
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
12
15
  const EXPAND_ICON_COLOR = props => css`
13
16
  color: ${themed({
14
17
  light: `var(--ds-icon-subtle, ${N80A})`,
@@ -37,6 +40,8 @@ const DANGER_STATE_BORDER_COLOR = themed({
37
40
  const DANGER_STATE_BORDER_RADIUS = themed({
38
41
  dark: '3px'
39
42
  });
43
+
44
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
40
45
  export const expandStyles = props => css`
41
46
  .${expandClassNames.icon} > div {
42
47
  display: flex;
@@ -14,7 +14,7 @@ import { layoutStyles } from './layout';
14
14
  import { panelStyles } from './panel';
15
15
  import { placeholderTextStyles } from '@atlaskit/editor-plugin-placeholder-text/styles';
16
16
  import { extensionStyles } from '../../plugins/extension/ui/styles';
17
- import { expandStyles } from '../../plugins/expand/ui/styles';
17
+ import { expandStyles } from './expand';
18
18
  import { MediaSharedClassNames } from '@atlaskit/editor-common/styles';
19
19
  import { findReplaceStyles } from '../../plugins/find-replace/styles';
20
20
  import { taskDecisionStyles } from '../../plugins/tasks-and-decisions/styles';
@@ -71,12 +71,12 @@ class ToolbarFeedbackInternal extends PureComponent {
71
71
  });
72
72
  });
73
73
  _defineProperty(this, "openJiraIssueCollector", async () => {
74
- var _this$props$api, _window$localStorage$, _basePluginState$cont;
74
+ var _this$props$api, _this$props$api$base, _window$localStorage$, _basePluginState$cont;
75
75
  this.setState({
76
76
  jiraIssueCollectorScriptLoading: true,
77
77
  showOptOutOption: false
78
78
  });
79
- const basePluginState = (_this$props$api = this.props.api) === null || _this$props$api === void 0 ? void 0 : _this$props$api.base.sharedState.currentState();
79
+ const basePluginState = (_this$props$api = this.props.api) === null || _this$props$api === void 0 ? void 0 : (_this$props$api$base = _this$props$api.base) === null || _this$props$api$base === void 0 ? void 0 : _this$props$api$base.sharedState.currentState();
80
80
  const sessionId = (_window$localStorage$ = window.localStorage.getItem('awc.session.id')) === null || _window$localStorage$ === void 0 ? void 0 : _window$localStorage$.toString();
81
81
  const contentId = basePluginState === null || basePluginState === void 0 ? void 0 : (_basePluginState$cont = basePluginState.contextIdentifier) === null || _basePluginState$cont === void 0 ? void 0 : _basePluginState$cont.objectId;
82
82
  const tabId = window.sessionStorage['awc.tab.id'];
@@ -35,7 +35,6 @@ import { usePresetContext } from './presets/context';
35
35
  */
36
36
  export function usePreset(createPreset, dependencies) {
37
37
  const editorApi = usePresetContext();
38
-
39
38
  // eslint-disable-next-line react-hooks/exhaustive-deps
40
39
  const preset = useMemo(createPreset, dependencies);
41
40
  return {
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "189.3.14";
2
+ export const version = "189.3.16";
@@ -7,4 +7,4 @@ import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
7
7
  // For reasoning behind styles, see comments in:
8
8
  // ./getInlineNodeViewProducer -> portalChildren()
9
9
 
10
- export var InlineNodeViewSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n display: inline;\n user-select: all;\n /* Collapses zero width spaces inside the inline node view\n to prevent the node from line breaking too early.\n */\n white-space: nowrap;\n /* Then reset to the Editor default so we don't interfere\n with any component styling. */\n & > *:not(span[aria-hidden='true'].zeroWidthSpaceContainer) {\n white-space: pre-wrap;\n }\n // Prevent visually hidden assistive text from being selected.\n & > .assistive {\n user-select: none;\n }\n }\n /** Remove browser deafult selections style. This prevents\n unexpected visual artefacts in Safari when navigating\n with the keyboard or making range selections. */\n &.ua-safari {\n .", " {\n ::selection,\n *::selection {\n background: transparent;\n }\n }\n }\n\n &.ua-chrome .", " > span {\n user-select: none;\n }\n\n .", "AddZeroWidthSpace {\n ::after {\n content: '", "';\n }\n }\n"])), inlineNodeViewClassname, inlineNodeViewClassname, inlineNodeViewClassname, inlineNodeViewClassname, ZERO_WIDTH_SPACE);
10
+ export var InlineNodeViewSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n display: inline;\n user-select: all;\n /* Collapses zero width spaces inside the inline node view\n to prevent the node from line breaking too early.\n */\n white-space: nowrap;\n /* Then reset to the Editor default so we don't interfere\n with any component styling. */\n & > *:not(.zeroWidthSpaceContainer) {\n white-space: pre-wrap;\n }\n // Prevent visually hidden assistive text from being selected.\n & > .assistive {\n user-select: none;\n }\n }\n /** Remove browser deafult selections style. This prevents\n unexpected visual artefacts in Safari when navigating\n with the keyboard or making range selections. */\n &.ua-safari {\n .", " {\n ::selection,\n *::selection {\n background: transparent;\n }\n }\n }\n\n &.ua-chrome .", " > span {\n user-select: none;\n }\n\n .", "AddZeroWidthSpace {\n ::after {\n content: '", "';\n }\n }\n"])), inlineNodeViewClassname, inlineNodeViewClassname, inlineNodeViewClassname, inlineNodeViewClassname, ZERO_WIDTH_SPACE);
@@ -1,3 +1,3 @@
1
1
  import analyticsPlugin from './plugin';
2
- export { withAnalytics, addAnalytics } from './utils';
2
+ export { addAnalytics } from './utils';
3
3
  export default analyticsPlugin;
@@ -26,32 +26,4 @@ export function addAnalytics(state, tr, payload) {
26
26
  }
27
27
  editorAnalyticsApi === null || editorAnalyticsApi === void 0 || editorAnalyticsApi.attachAnalyticsEvent(payload, channel)(tr);
28
28
  return tr;
29
- }
30
- // Below function has been copied to packages/editor/editor-plugin-ai/src/utils/analytics.ts
31
- // If changes are made to this function, please make the same update in the linked file.
32
- /**
33
- *
34
- * @private
35
- * @deprecated
36
- *
37
- * Do not use this anymore. Please use @atlaskit/editor-plugin-analytics
38
- *
39
- */
40
- export function withAnalytics(payload, channel) {
41
- return function (command) {
42
- return function (state, dispatch, view) {
43
- return command(state, function (tr) {
44
- if (dispatch) {
45
- if (payload instanceof Function) {
46
- var dynamicPayload = payload(state);
47
- if (dynamicPayload) {
48
- dispatch(addAnalytics(state, tr, dynamicPayload, channel));
49
- }
50
- } else {
51
- dispatch(addAnalytics(state, tr, payload, channel));
52
- }
53
- }
54
- }, view);
55
- };
56
- };
57
29
  }
@@ -8,10 +8,10 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
8
8
  import { breakout } from '@atlaskit/adf-schema';
9
9
  import { calcBreakoutWidthPx } from '@atlaskit/editor-common/utils';
10
10
  import LayoutButton from './ui/LayoutButton';
11
- import { BreakoutCssClassName } from './constants';
12
11
  import { pluginKey } from './plugin-key';
13
12
  import { findSupportedNodeForBreakout } from './utils/find-breakout-node';
14
13
  import { akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
14
+ import { BreakoutCssClassName } from '@atlaskit/editor-common/styles';
15
15
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
16
16
  var BreakoutView = /*#__PURE__*/function () {
17
17
  function BreakoutView(
@@ -22,7 +22,7 @@ import ToolbarButton from '../../../ui/ToolbarButton';
22
22
  import { getBreakoutMode } from '../utils/get-breakout-mode';
23
23
  import { setBreakoutMode } from '../commands/set-breakout-mode';
24
24
  import { removeBreakout } from '../commands/remove-breakout';
25
- import { BreakoutCssClassName } from '../constants';
25
+ import { BreakoutCssClassName } from '@atlaskit/editor-common/styles';
26
26
  import { isBreakoutMarkAllowed } from '../utils/is-breakout-mark-allowed';
27
27
  import { getPluginState } from '../plugin-key';
28
28
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
@@ -3,8 +3,8 @@ import { validator } from '@atlaskit/adf-utils/validator';
3
3
  import { JSONTransformer } from '@atlaskit/editor-json-transformer';
4
4
  import { Fragment, Mark } from '@atlaskit/editor-prosemirror/model';
5
5
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
6
- import { insertMacroFromMacroBrowser } from '../macro';
7
- import { pluginKey as macroPluginKey } from '../macro/plugin-key';
6
+ import { insertMacroFromMacroBrowser } from './pm-plugins/macro/actions';
7
+ import { pluginKey as macroPluginKey } from './pm-plugins/macro/plugin-key';
8
8
  import { nodeToJSON } from '../../utils';
9
9
  import { setEditingContextToContextPanel } from './commands';
10
10
  import { findNodePosWithLocalId, getDataConsumerMark, getNodeTypesReferenced, getSelectedExtension } from './utils';
@@ -1,13 +1,15 @@
1
1
  import { extension, bodiedExtension, inlineExtension } from '@atlaskit/adf-schema';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import { createPlugin } from './pm-plugins/main';
4
+ import { createPlugin as createMacroPlugin } from './pm-plugins/macro';
5
+ import { insertMacroFromMacroBrowser, runMacroAutoConvert } from './pm-plugins/macro/actions';
4
6
  import keymapPlugin from './pm-plugins/keymap';
5
7
  import { createPlugin as createUniqueIdPlugin } from './pm-plugins/unique-id';
6
8
  import { getToolbarConfig } from './toolbar';
7
9
  import { getContextPanel } from './context-panel';
8
10
  import { createExtensionAPI } from './extension-api';
9
11
  var extensionPlugin = function extensionPlugin(_ref) {
10
- var _api$featureFlags, _api$contextPanel3, _api$analytics2, _api$contextPanel4;
12
+ var _api$featureFlags, _api$analytics2, _api$contextPanel3, _api$analytics3, _api$contextPanel4;
11
13
  var _ref$config = _ref.config,
12
14
  options = _ref$config === void 0 ? {} : _ref$config,
13
15
  _api = _ref.api;
@@ -69,6 +71,13 @@ var extensionPlugin = function extensionPlugin(_ref) {
69
71
  }
70
72
  });
71
73
  }
74
+ }, {
75
+ name: 'macro',
76
+ plugin: function plugin(_ref3) {
77
+ var dispatch = _ref3.dispatch,
78
+ providerFactory = _ref3.providerFactory;
79
+ return createMacroPlugin(dispatch, providerFactory);
80
+ }
72
81
  }];
73
82
  },
74
83
  actions: {
@@ -79,14 +88,16 @@ var extensionPlugin = function extensionPlugin(_ref) {
79
88
  applyChange: _api === null || _api === void 0 || (_api$contextPanel2 = _api.contextPanel) === null || _api$contextPanel2 === void 0 ? void 0 : _api$contextPanel2.actions.applyChange,
80
89
  editorAnalyticsAPI: _api === null || _api === void 0 || (_api$analytics = _api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions
81
90
  });
82
- }
91
+ },
92
+ insertMacroFromMacroBrowser: insertMacroFromMacroBrowser(_api === null || _api === void 0 || (_api$analytics2 = _api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions),
93
+ runMacroAutoConvert: runMacroAutoConvert
83
94
  },
84
95
  pluginsOptions: {
85
96
  floatingToolbar: getToolbarConfig({
86
97
  breakoutEnabled: options.breakoutEnabled,
87
98
  hoverDecoration: _api === null || _api === void 0 ? void 0 : _api.decorations.actions.hoverDecoration,
88
99
  applyChangeToContextPanel: _api === null || _api === void 0 || (_api$contextPanel3 = _api.contextPanel) === null || _api$contextPanel3 === void 0 ? void 0 : _api$contextPanel3.actions.applyChange,
89
- editorAnalyticsAPI: _api === null || _api === void 0 || (_api$analytics2 = _api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions
100
+ editorAnalyticsAPI: _api === null || _api === void 0 || (_api$analytics3 = _api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions
90
101
  }),
91
102
  contextPanel: getContextPanel(options.allowAutoSave, featureFlags, _api === null || _api === void 0 || (_api$contextPanel4 = _api.contextPanel) === null || _api$contextPanel4 === void 0 ? void 0 : _api$contextPanel4.actions.applyChange)
92
103
  }
@@ -8,9 +8,9 @@ import { Selection, NodeSelection, TextSelection } from '@atlaskit/editor-prosem
8
8
  import { safeInsert, replaceSelectedNode, findSelectedNodeOfType, replaceParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
9
9
  import { getValidNode } from '@atlaskit/editor-common/validator';
10
10
  import { normaliseNestedLayout } from '@atlaskit/editor-common/insert';
11
- import { getPluginState as getExtensionPluginState } from '../extension/plugin-factory';
11
+ import { getPluginState as getExtensionPluginState } from '../../plugin-factory';
12
12
  import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
13
- import { TARGET_SELECTION_SOURCE } from '../analytics/types/extension-events';
13
+ import { TARGET_SELECTION_SOURCE } from '@atlaskit/editor-common/analytics';
14
14
  import { pluginKey } from './plugin-key';
15
15
  export var insertMacroFromMacroBrowser = function insertMacroFromMacroBrowser(editorAnalyticsAPI) {
16
16
  return function (macroProvider, macroNode, isEditing) {
@@ -39,20 +39,4 @@ export var createPlugin = function createPlugin(dispatch, providerFactory) {
39
39
  };
40
40
  }
41
41
  });
42
- };
43
- var macroPlugin = function macroPlugin() {
44
- return {
45
- name: 'macro',
46
- pmPlugins: function pmPlugins() {
47
- return [{
48
- name: 'macro',
49
- plugin: function plugin(_ref) {
50
- var dispatch = _ref.dispatch,
51
- providerFactory = _ref.providerFactory;
52
- return createPlugin(dispatch, providerFactory);
53
- }
54
- }];
55
- }
56
- };
57
- };
58
- export default macroPlugin;
42
+ };
@@ -11,7 +11,7 @@ import { editExtension } from './actions';
11
11
  import { getPluginState } from './pm-plugins/main';
12
12
  import { getSelectedExtension } from './utils';
13
13
  import { updateExtensionLayout, removeExtension, removeDescendantNodes } from './commands';
14
- import { pluginKey as macroPluginKey } from '../macro/plugin-key';
14
+ import { pluginKey as macroPluginKey } from './pm-plugins/macro/plugin-key';
15
15
  import { isReferencedSource, getChildrenInfo as _getChildrenInfo, getNodeName } from '@atlaskit/editor-common/utils';
16
16
  export var messages = defineMessages({
17
17
  edit: {
@@ -5,15 +5,17 @@ import { cancelSearchWithAnalytics, replaceWithAnalytics, replaceAllWithAnalytic
5
5
  import { blur, toggleMatchCase } from './commands';
6
6
  import FindReplaceToolbarButton from './ui/FindReplaceToolbarButton';
7
7
  import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
8
- var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithState(props) {
9
- var popupsBoundariesElement = props.popupsBoundariesElement,
10
- popupsMountPoint = props.popupsMountPoint,
11
- popupsScrollableElement = props.popupsScrollableElement,
12
- isToolbarReducedSpacing = props.isToolbarReducedSpacing,
13
- editorView = props.editorView,
14
- containerElement = props.containerElement,
15
- dispatchAnalyticsEvent = props.dispatchAnalyticsEvent,
16
- featureFlags = props.featureFlags;
8
+ var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithState(_ref) {
9
+ var popupsBoundariesElement = _ref.popupsBoundariesElement,
10
+ popupsMountPoint = _ref.popupsMountPoint,
11
+ popupsScrollableElement = _ref.popupsScrollableElement,
12
+ isToolbarReducedSpacing = _ref.isToolbarReducedSpacing,
13
+ editorView = _ref.editorView,
14
+ containerElement = _ref.containerElement,
15
+ dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
16
+ featureFlags = _ref.featureFlags,
17
+ editorAnalyticsAPI = _ref.editorAnalyticsAPI,
18
+ takeFullWidth = _ref.takeFullWidth;
17
19
  if (!editorView) {
18
20
  return null;
19
21
  }
@@ -34,50 +36,50 @@ var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithSta
34
36
  };
35
37
  var handleActivate = function handleActivate() {
36
38
  runWithEditorFocused(function () {
37
- return dispatchCommand(activateWithAnalytics({
39
+ return dispatchCommand(activateWithAnalytics(editorAnalyticsAPI)({
38
40
  triggerMethod: TRIGGER_METHOD.TOOLBAR
39
41
  }));
40
42
  });
41
43
  };
42
44
  var handleFind = function handleFind(keyword) {
43
45
  runWithEditorFocused(function () {
44
- return dispatchCommand(findWithAnalytics({
46
+ return dispatchCommand(findWithAnalytics(editorAnalyticsAPI)({
45
47
  editorView: editorView,
46
48
  containerElement: containerElement,
47
49
  keyword: keyword
48
50
  }));
49
51
  });
50
52
  };
51
- var handleFindNext = function handleFindNext(_ref) {
52
- var triggerMethod = _ref.triggerMethod;
53
+ var handleFindNext = function handleFindNext(_ref2) {
54
+ var triggerMethod = _ref2.triggerMethod;
53
55
  runWithEditorFocused(function () {
54
- return dispatchCommand(findNextWithAnalytics({
56
+ return dispatchCommand(findNextWithAnalytics(editorAnalyticsAPI)({
55
57
  triggerMethod: triggerMethod
56
58
  }));
57
59
  });
58
60
  };
59
- var handleFindPrev = function handleFindPrev(_ref2) {
60
- var triggerMethod = _ref2.triggerMethod;
61
+ var handleFindPrev = function handleFindPrev(_ref3) {
62
+ var triggerMethod = _ref3.triggerMethod;
61
63
  runWithEditorFocused(function () {
62
- return dispatchCommand(findPrevWithAnalytics({
64
+ return dispatchCommand(findPrevWithAnalytics(editorAnalyticsAPI)({
63
65
  triggerMethod: triggerMethod
64
66
  }));
65
67
  });
66
68
  };
67
- var handleReplace = function handleReplace(_ref3) {
68
- var triggerMethod = _ref3.triggerMethod,
69
- replaceText = _ref3.replaceText;
69
+ var handleReplace = function handleReplace(_ref4) {
70
+ var triggerMethod = _ref4.triggerMethod,
71
+ replaceText = _ref4.replaceText;
70
72
  runWithEditorFocused(function () {
71
- return dispatchCommand(replaceWithAnalytics({
73
+ return dispatchCommand(replaceWithAnalytics(editorAnalyticsAPI)({
72
74
  triggerMethod: triggerMethod,
73
75
  replaceText: replaceText
74
76
  }));
75
77
  });
76
78
  };
77
- var handleReplaceAll = function handleReplaceAll(_ref4) {
78
- var replaceText = _ref4.replaceText;
79
+ var handleReplaceAll = function handleReplaceAll(_ref5) {
80
+ var replaceText = _ref5.replaceText;
79
81
  runWithEditorFocused(function () {
80
- return dispatchCommand(replaceAllWithAnalytics({
82
+ return dispatchCommand(replaceAllWithAnalytics(editorAnalyticsAPI)({
81
83
  replaceText: replaceText
82
84
  }));
83
85
  });
@@ -85,9 +87,9 @@ var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithSta
85
87
  var handleFindBlur = function handleFindBlur() {
86
88
  dispatchCommand(blur());
87
89
  };
88
- var handleCancel = function handleCancel(_ref5) {
89
- var triggerMethod = _ref5.triggerMethod;
90
- dispatchCommand(cancelSearchWithAnalytics({
90
+ var handleCancel = function handleCancel(_ref6) {
91
+ var triggerMethod = _ref6.triggerMethod;
92
+ dispatchCommand(cancelSearchWithAnalytics(editorAnalyticsAPI)({
91
93
  triggerMethod: triggerMethod
92
94
  }));
93
95
  editorView.focus();
@@ -101,8 +103,8 @@ var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithSta
101
103
  plugins: {
102
104
  findReplaceState: findReplacePluginKey
103
105
  },
104
- render: function render(_ref6) {
105
- var findReplaceState = _ref6.findReplaceState;
106
+ render: function render(_ref7) {
107
+ var findReplaceState = _ref7.findReplaceState;
106
108
  if (!findReplaceState) {
107
109
  return null;
108
110
  }
@@ -129,7 +131,7 @@ var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithSta
129
131
  onFindPrev: handleFindPrev,
130
132
  onReplace: handleReplace,
131
133
  onReplaceAll: handleReplaceAll,
132
- takeFullWidth: !!props.takeFullWidth
134
+ takeFullWidth: !!takeFullWidth
133
135
  });
134
136
  }
135
137
  });