@atlaskit/editor-core 150.0.3 → 151.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/cjs/actions/index.js +5 -23
  3. package/dist/cjs/create-editor/ErrorBoundary.js +113 -79
  4. package/dist/cjs/create-editor/ReactEditorView.js +145 -31
  5. package/dist/cjs/create-editor/create-plugins-list.js +8 -2
  6. package/dist/cjs/editor.js +101 -40
  7. package/dist/cjs/labs/next/presets/cxhtml.js +2 -1
  8. package/dist/cjs/plugins/analytics/types/enums.js +3 -1
  9. package/dist/cjs/plugins/base/index.js +4 -3
  10. package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +66 -36
  11. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -1
  12. package/dist/cjs/plugins/card/index.js +13 -2
  13. package/dist/cjs/plugins/card/nodeviews/embedCard.js +1 -0
  14. package/dist/cjs/plugins/card/pm-plugins/main.js +7 -2
  15. package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +10 -3
  16. package/dist/cjs/plugins/code-bidi-warning/index.js +25 -0
  17. package/dist/cjs/plugins/code-bidi-warning/plugin-key.js +11 -0
  18. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/main.js +43 -0
  19. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +118 -0
  20. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/reducer.js +12 -0
  21. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/types.js +5 -0
  22. package/dist/cjs/plugins/code-block/index.js +10 -6
  23. package/dist/cjs/plugins/code-block/nodeviews/highlighting-code-block.js +16 -5
  24. package/dist/cjs/plugins/code-block/pm-plugins/main.js +12 -3
  25. package/dist/cjs/plugins/code-block/toolbar.js +1 -1
  26. package/dist/cjs/plugins/emoji/styles.js +1 -1
  27. package/dist/cjs/plugins/extension/pm-plugins/main.js +1 -4
  28. package/dist/cjs/plugins/extension/toolbar.js +28 -23
  29. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +9 -3
  30. package/dist/cjs/plugins/find-replace/ui/Find.js +27 -7
  31. package/dist/cjs/plugins/hyperlink/HyperlinkToolbarAppearance.js +2 -2
  32. package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +3 -3
  33. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
  34. package/dist/cjs/plugins/hyperlink/utils.js +6 -69
  35. package/dist/cjs/plugins/index.js +8 -0
  36. package/dist/cjs/plugins/media/index.js +14 -3
  37. package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +24 -10
  38. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +179 -0
  39. package/dist/cjs/plugins/media/pm-plugins/main.js +18 -9
  40. package/dist/cjs/plugins/media/toolbar/index.js +49 -17
  41. package/dist/cjs/plugins/media/toolbar/utils.js +20 -2
  42. package/dist/cjs/plugins/media/utils/media-files.js +67 -1
  43. package/dist/cjs/plugins/panel/index.js +2 -3
  44. package/dist/cjs/plugins/panel/message.js +47 -0
  45. package/dist/cjs/plugins/panel/toolbar.js +64 -84
  46. package/dist/cjs/plugins/panel/utils.js +2 -2
  47. package/dist/cjs/plugins/paste/linkify-md-plugin.js +3 -3
  48. package/dist/cjs/plugins/rank.js +1 -1
  49. package/dist/cjs/plugins/status/styles.js +1 -1
  50. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
  51. package/dist/cjs/profiler/render-count.js +82 -0
  52. package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -5
  53. package/dist/cjs/utils/react-hooks/use-component-renderer-tracking/index.js +55 -19
  54. package/dist/cjs/version-wrapper.js +1 -1
  55. package/dist/cjs/version.json +1 -1
  56. package/dist/es2019/actions/index.js +6 -28
  57. package/dist/es2019/create-editor/ErrorBoundary.js +73 -60
  58. package/dist/es2019/create-editor/ReactEditorView.js +130 -23
  59. package/dist/es2019/create-editor/create-plugins-list.js +9 -3
  60. package/dist/es2019/editor.js +74 -35
  61. package/dist/es2019/labs/next/presets/cxhtml.js +2 -1
  62. package/dist/es2019/plugins/analytics/types/enums.js +3 -1
  63. package/dist/es2019/plugins/base/index.js +4 -3
  64. package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +63 -35
  65. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +2 -1
  66. package/dist/es2019/plugins/card/index.js +7 -2
  67. package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -0
  68. package/dist/es2019/plugins/card/pm-plugins/main.js +9 -2
  69. package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +12 -5
  70. package/dist/es2019/plugins/code-bidi-warning/index.js +15 -0
  71. package/dist/es2019/plugins/code-bidi-warning/plugin-key.js +2 -0
  72. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/main.js +31 -0
  73. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +88 -0
  74. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/reducer.js +3 -0
  75. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/types.js +1 -0
  76. package/dist/es2019/plugins/code-block/index.js +6 -1
  77. package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +16 -4
  78. package/dist/es2019/plugins/code-block/pm-plugins/main.js +50 -39
  79. package/dist/es2019/plugins/code-block/toolbar.js +1 -1
  80. package/dist/es2019/plugins/emoji/styles.js +2 -0
  81. package/dist/es2019/plugins/extension/pm-plugins/main.js +1 -4
  82. package/dist/es2019/plugins/extension/toolbar.js +30 -25
  83. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +9 -4
  84. package/dist/es2019/plugins/find-replace/ui/Find.js +27 -6
  85. package/dist/es2019/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -1
  86. package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +1 -1
  87. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
  88. package/dist/es2019/plugins/hyperlink/utils.js +3 -59
  89. package/dist/es2019/plugins/index.js +2 -1
  90. package/dist/es2019/plugins/media/index.js +13 -4
  91. package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +16 -7
  92. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +88 -0
  93. package/dist/es2019/plugins/media/pm-plugins/main.js +20 -11
  94. package/dist/es2019/plugins/media/toolbar/index.js +44 -15
  95. package/dist/es2019/plugins/media/toolbar/utils.js +16 -0
  96. package/dist/es2019/plugins/media/utils/media-files.js +68 -2
  97. package/dist/es2019/plugins/panel/index.js +3 -4
  98. package/dist/es2019/plugins/panel/message.js +38 -0
  99. package/dist/es2019/plugins/panel/toolbar.js +52 -71
  100. package/dist/es2019/plugins/panel/utils.js +2 -2
  101. package/dist/es2019/plugins/paste/linkify-md-plugin.js +2 -2
  102. package/dist/es2019/plugins/rank.js +1 -1
  103. package/dist/es2019/plugins/status/styles.js +5 -0
  104. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
  105. package/dist/es2019/profiler/render-count.js +60 -0
  106. package/dist/es2019/ui/Appearance/Comment/Comment.js +4 -2
  107. package/dist/es2019/utils/react-hooks/use-component-renderer-tracking/index.js +51 -18
  108. package/dist/es2019/version-wrapper.js +1 -1
  109. package/dist/es2019/version.json +1 -1
  110. package/dist/esm/actions/index.js +6 -24
  111. package/dist/esm/create-editor/ErrorBoundary.js +113 -78
  112. package/dist/esm/create-editor/ReactEditorView.js +146 -31
  113. package/dist/esm/create-editor/create-plugins-list.js +9 -3
  114. package/dist/esm/editor.js +100 -40
  115. package/dist/esm/labs/next/presets/cxhtml.js +2 -1
  116. package/dist/esm/plugins/analytics/types/enums.js +3 -1
  117. package/dist/esm/plugins/base/index.js +4 -3
  118. package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +64 -36
  119. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -1
  120. package/dist/esm/plugins/card/index.js +13 -2
  121. package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -0
  122. package/dist/esm/plugins/card/pm-plugins/main.js +7 -2
  123. package/dist/esm/plugins/card/pm-plugins/util/resolve.js +12 -5
  124. package/dist/esm/plugins/code-bidi-warning/index.js +17 -0
  125. package/dist/esm/plugins/code-bidi-warning/plugin-key.js +2 -0
  126. package/dist/esm/plugins/code-bidi-warning/pm-plugins/main.js +30 -0
  127. package/dist/esm/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +96 -0
  128. package/dist/esm/plugins/code-bidi-warning/pm-plugins/reducer.js +3 -0
  129. package/dist/esm/plugins/code-bidi-warning/pm-plugins/types.js +1 -0
  130. package/dist/esm/plugins/code-block/index.js +10 -6
  131. package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +16 -5
  132. package/dist/esm/plugins/code-block/pm-plugins/main.js +11 -3
  133. package/dist/esm/plugins/code-block/toolbar.js +1 -1
  134. package/dist/esm/plugins/emoji/styles.js +1 -1
  135. package/dist/esm/plugins/extension/pm-plugins/main.js +1 -4
  136. package/dist/esm/plugins/extension/toolbar.js +28 -23
  137. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +9 -4
  138. package/dist/esm/plugins/find-replace/ui/Find.js +27 -7
  139. package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +2 -2
  140. package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +1 -1
  141. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
  142. package/dist/esm/plugins/hyperlink/utils.js +3 -59
  143. package/dist/esm/plugins/index.js +2 -1
  144. package/dist/esm/plugins/media/index.js +14 -4
  145. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +24 -10
  146. package/dist/esm/plugins/media/nodeviews/mediaInline.js +147 -0
  147. package/dist/esm/plugins/media/pm-plugins/main.js +19 -11
  148. package/dist/esm/plugins/media/toolbar/index.js +47 -19
  149. package/dist/esm/plugins/media/toolbar/utils.js +15 -1
  150. package/dist/esm/plugins/media/utils/media-files.js +60 -2
  151. package/dist/esm/plugins/panel/index.js +3 -4
  152. package/dist/esm/plugins/panel/message.js +38 -0
  153. package/dist/esm/plugins/panel/toolbar.js +57 -77
  154. package/dist/esm/plugins/panel/utils.js +2 -2
  155. package/dist/esm/plugins/paste/linkify-md-plugin.js +2 -2
  156. package/dist/esm/plugins/rank.js +1 -1
  157. package/dist/esm/plugins/status/styles.js +1 -1
  158. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
  159. package/dist/esm/profiler/render-count.js +57 -0
  160. package/dist/esm/ui/Appearance/Comment/Comment.js +6 -5
  161. package/dist/esm/utils/react-hooks/use-component-renderer-tracking/index.js +53 -20
  162. package/dist/esm/version-wrapper.js +1 -1
  163. package/dist/esm/version.json +1 -1
  164. package/dist/types/create-editor/ErrorBoundary.d.ts +6 -6
  165. package/dist/types/create-editor/ReactEditorView.d.ts +15 -3
  166. package/dist/types/editor.d.ts +2 -0
  167. package/dist/types/plugins/analytics/index.d.ts +1 -1
  168. package/dist/types/plugins/analytics/types/enums.d.ts +4 -2
  169. package/dist/types/plugins/analytics/types/events.d.ts +7 -2
  170. package/dist/types/plugins/analytics/types/general-events.d.ts +4 -1
  171. package/dist/types/plugins/analytics/types/index.d.ts +1 -1
  172. package/dist/types/plugins/analytics/types/insert-events.d.ts +6 -1
  173. package/dist/types/plugins/analytics/types/link-tool-bar-events.d.ts +1 -0
  174. package/dist/types/plugins/base/index.d.ts +1 -0
  175. package/dist/types/plugins/base/pm-plugins/frozen-editor.d.ts +3 -2
  176. package/dist/types/plugins/card/pm-plugins/main.d.ts +2 -3
  177. package/dist/types/plugins/card/pm-plugins/util/resolve.d.ts +2 -1
  178. package/dist/types/plugins/card/types.d.ts +6 -0
  179. package/dist/types/plugins/code-bidi-warning/index.d.ts +3 -0
  180. package/dist/types/plugins/code-bidi-warning/plugin-key.d.ts +2 -0
  181. package/dist/types/plugins/code-bidi-warning/pm-plugins/main.d.ts +3 -0
  182. package/dist/types/plugins/code-bidi-warning/pm-plugins/plugin-factory.d.ts +7 -0
  183. package/dist/types/plugins/code-bidi-warning/pm-plugins/reducer.d.ts +3 -0
  184. package/dist/types/plugins/code-bidi-warning/pm-plugins/types.d.ts +5 -0
  185. package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +11 -2
  186. package/dist/types/plugins/code-block/pm-plugins/main.d.ts +5 -1
  187. package/dist/types/plugins/extension/types.d.ts +0 -2
  188. package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
  189. package/dist/types/plugins/floating-toolbar/types.d.ts +1 -1
  190. package/dist/types/plugins/floating-toolbar/ui/Select.d.ts +1 -1
  191. package/dist/types/plugins/hyperlink/HyperlinkToolbarAppearance.d.ts +1 -1
  192. package/dist/types/plugins/hyperlink/utils.d.ts +0 -21
  193. package/dist/types/plugins/index.d.ts +1 -0
  194. package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +27 -0
  195. package/dist/types/plugins/media/pm-plugins/main.d.ts +2 -2
  196. package/dist/types/plugins/media/toolbar/utils.d.ts +2 -0
  197. package/dist/types/plugins/media/utils/media-files.d.ts +8 -0
  198. package/dist/types/plugins/panel/message.d.ts +37 -0
  199. package/dist/types/plugins/panel/toolbar.d.ts +4 -37
  200. package/dist/types/plugins/panel/types.d.ts +1 -0
  201. package/dist/types/profiler/render-count.d.ts +14 -0
  202. package/dist/types/types/feature-flags.d.ts +17 -0
  203. package/dist/types/ui/LinkSearch/types.d.ts +1 -0
  204. package/dist/types/utils/react-hooks/use-component-renderer-tracking/index.d.ts +17 -1
  205. package/package.json +21 -18
  206. package/dist/cjs/plugins/caption/nodeviews/index.test.js +0 -135
  207. package/dist/cjs/plugins/caption/pm-plugins/keymap.test.js +0 -203
  208. package/dist/cjs/plugins/caption/pm-plugins/main.test.js +0 -141
  209. package/dist/cjs/plugins/code-block/language-list.test.js +0 -74
  210. package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -101
  211. package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -98
  212. package/dist/cjs/plugins/media/commands/captions.test.js +0 -149
  213. package/dist/cjs/plugins/media/commands/linking.test.js +0 -296
  214. package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -50
  215. package/dist/cjs/plugins/panel/toolbar.test.js +0 -250
  216. package/dist/cjs/ui/ColorPickerButton/index.test.js +0 -123
  217. package/dist/cjs/ui/PortalProvider/index.test.js +0 -139
  218. package/dist/es2019/plugins/caption/nodeviews/index.test.js +0 -122
  219. package/dist/es2019/plugins/caption/pm-plugins/keymap.test.js +0 -193
  220. package/dist/es2019/plugins/caption/pm-plugins/main.test.js +0 -132
  221. package/dist/es2019/plugins/code-block/language-list.test.js +0 -69
  222. package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -83
  223. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -85
  224. package/dist/es2019/plugins/media/commands/captions.test.js +0 -126
  225. package/dist/es2019/plugins/media/commands/linking.test.js +0 -208
  226. package/dist/es2019/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -41
  227. package/dist/es2019/plugins/panel/toolbar.test.js +0 -200
  228. package/dist/es2019/ui/ColorPickerButton/index.test.js +0 -88
  229. package/dist/es2019/ui/PortalProvider/index.test.js +0 -115
  230. package/dist/esm/plugins/caption/nodeviews/index.test.js +0 -125
  231. package/dist/esm/plugins/caption/pm-plugins/keymap.test.js +0 -195
  232. package/dist/esm/plugins/caption/pm-plugins/main.test.js +0 -124
  233. package/dist/esm/plugins/code-block/language-list.test.js +0 -71
  234. package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -92
  235. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -85
  236. package/dist/esm/plugins/media/commands/captions.test.js +0 -135
  237. package/dist/esm/plugins/media/commands/linking.test.js +0 -268
  238. package/dist/esm/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -41
  239. package/dist/esm/plugins/panel/toolbar.test.js +0 -230
  240. package/dist/esm/ui/ColorPickerButton/index.test.js +0 -107
  241. package/dist/esm/ui/PortalProvider/index.test.js +0 -129
@@ -1,4 +1,11 @@
1
- import { defineMessages } from 'react-intl';
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ var _panelIconMap;
4
+
5
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
6
+
7
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
8
+
2
9
  import SuccessIcon from '@atlaskit/icon/glyph/editor/success';
3
10
  import InfoIcon from '@atlaskit/icon/glyph/editor/info';
4
11
  import NoteIcon from '@atlaskit/icon/glyph/editor/note';
@@ -16,44 +23,9 @@ import { findDomRefAtPos } from 'prosemirror-utils';
16
23
  import { DEFAULT_BORDER_COLOR } from '../../ui/ColorPalette/Palettes';
17
24
  import { PanelType } from '@atlaskit/adf-schema';
18
25
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID, withAnalytics } from '../analytics';
19
- export var messages = defineMessages({
20
- info: {
21
- id: 'fabric.editor.info',
22
- defaultMessage: 'Info',
23
- description: 'Panels provide a way to highlight text. The info panel has a blue background.'
24
- },
25
- note: {
26
- id: 'fabric.editor.note',
27
- defaultMessage: 'Note',
28
- description: 'Panels provide a way to highlight text. The note panel has a purple background.'
29
- },
30
- success: {
31
- id: 'fabric.editor.success',
32
- defaultMessage: 'Success',
33
- description: 'Panels provide a way to highlight text. The success panel has a green background.'
34
- },
35
- warning: {
36
- id: 'fabric.editor.warning',
37
- defaultMessage: 'Warning',
38
- description: 'Panels provide a way to highlight text. The warning panel has a yellow background.'
39
- },
40
- error: {
41
- id: 'fabric.editor.error',
42
- defaultMessage: 'Error',
43
- description: 'Panels provide a way to highlight text. The error panel has a red background.'
44
- },
45
- emoji: {
46
- id: 'fabric.editor.panel.emoji',
47
- defaultMessage: 'Add emoji',
48
- description: 'Select the panel icon'
49
- },
50
- backgroundColor: {
51
- id: 'fabric.editor.panel.backgroundColor',
52
- defaultMessage: 'Background color',
53
- description: 'Select the panel background color.'
54
- }
55
- });
56
- export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isCustomPanelEnabled, providerFactory, activePanelType, activePanelColor, activePanelIcon) {
26
+ import { messages } from './message';
27
+ export var panelIconMap = (_panelIconMap = {}, _defineProperty(_panelIconMap, PanelType.INFO, ':info:'), _defineProperty(_panelIconMap, PanelType.NOTE, ':note:'), _defineProperty(_panelIconMap, PanelType.WARNING, ':warning:'), _defineProperty(_panelIconMap, PanelType.ERROR, ':error:'), _defineProperty(_panelIconMap, PanelType.SUCCESS, ':success:'), _defineProperty(_panelIconMap, PanelType.TIP, ':tip:'), _panelIconMap);
28
+ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, activePanelType, activePanelColor, activePanelIcon) {
57
29
  var items = [{
58
30
  id: 'editor.panel.info',
59
31
  type: 'button',
@@ -101,11 +73,16 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
101
73
  }
102
74
 
103
75
  var previousColor = panelNode.node.attrs.panelColor || getPanelTypeBackground(panelNode.node.attrs.panelType);
76
+ var emojiInfo = panelNode.node.attrs.panelType;
77
+ var panelInfo = panelIconMap[emojiInfo];
78
+ var previousEmoji = panelInfo ? {
79
+ emoji: panelInfo
80
+ } : {};
104
81
 
105
82
  if (previousColor === color) {
106
- changePanelType(PanelType.CUSTOM, {
83
+ changePanelType(PanelType.CUSTOM, _objectSpread({
107
84
  color: color
108
- }, isCustomPanelEnabled)(state, dispatch);
85
+ }, previousEmoji), isCustomPanelEnabled)(state, dispatch);
109
86
  return false;
110
87
  }
111
88
 
@@ -119,9 +96,9 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
119
96
  },
120
97
  eventType: EVENT_TYPE.TRACK
121
98
  };
122
- withAnalytics(payload)(changePanelType(PanelType.CUSTOM, {
99
+ withAnalytics(payload)(changePanelType(PanelType.CUSTOM, _objectSpread({
123
100
  color: color
124
- }, isCustomPanelEnabled))(state, dispatch);
101
+ }, previousEmoji), isCustomPanelEnabled))(state, dispatch);
125
102
  return false;
126
103
  };
127
104
  };
@@ -196,39 +173,42 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
196
173
  value: panelColor,
197
174
  border: DEFAULT_BORDER_COLOR
198
175
  };
199
- var colorPicker = {
200
- id: 'editor.panel.colorPicker',
201
- title: formatMessage(messages.backgroundColor),
202
- type: 'select',
203
- selectType: 'color',
204
- defaultValue: defaultPalette,
205
- options: panelBackgroundPalette,
206
- onChange: function onChange(option) {
207
- return changeColor(option.value);
208
- }
209
- };
210
- var emojiPicker = {
211
- id: 'editor.panel.emojiPicker',
212
- title: formatMessage(messages.emoji),
213
- type: 'select',
214
- selectType: 'emoji',
215
- options: [],
216
- selected: activePanelType === PanelType.CUSTOM && !!activePanelIcon,
217
- onChange: function onChange(emojiShortName) {
218
- return changeEmoji(emojiShortName);
219
- }
220
- };
221
- var removeEmojiButton = {
222
- id: 'editor.panel.removeEmoji',
223
- type: 'button',
224
- icon: RemoveEmojiIcon,
225
- onClick: removeEmoji(),
226
- title: formatMessage(commonMessages.removeEmoji),
227
- disabled: activePanelIcon ? false : true
228
- };
229
- items.push(emojiPicker, removeEmojiButton, {
230
- type: 'separator'
231
- }, colorPicker);
176
+
177
+ if (isCustomPanelEditable) {
178
+ var colorPicker = {
179
+ id: 'editor.panel.colorPicker',
180
+ title: formatMessage(messages.backgroundColor),
181
+ type: 'select',
182
+ selectType: 'color',
183
+ defaultValue: defaultPalette,
184
+ options: panelBackgroundPalette,
185
+ onChange: function onChange(option) {
186
+ return changeColor(option.value);
187
+ }
188
+ };
189
+ var emojiPicker = {
190
+ id: 'editor.panel.emojiPicker',
191
+ title: formatMessage(messages.emoji),
192
+ type: 'select',
193
+ selectType: 'emoji',
194
+ options: [],
195
+ selected: activePanelType === PanelType.CUSTOM && !!activePanelIcon,
196
+ onChange: function onChange(emojiShortName) {
197
+ return changeEmoji(emojiShortName);
198
+ }
199
+ };
200
+ var removeEmojiButton = {
201
+ id: 'editor.panel.removeEmoji',
202
+ type: 'button',
203
+ icon: RemoveEmojiIcon,
204
+ onClick: removeEmoji(),
205
+ title: formatMessage(commonMessages.removeEmoji),
206
+ disabled: activePanelIcon ? false : true
207
+ };
208
+ items.push(emojiPicker, removeEmojiButton, {
209
+ type: 'separator'
210
+ }, colorPicker);
211
+ }
232
212
  }
233
213
 
234
214
  items.push({
@@ -260,7 +240,7 @@ export var getToolbarConfig = function getToolbarConfig(state, intl) {
260
240
  panelColor = _panelObject$node$att.panelColor,
261
241
  panelIcon = _panelObject$node$att.panelIcon; // force toolbar to be turned on
262
242
 
263
- var items = getToolbarItems(formatMessage, nodeType, options.UNSAFE_allowCustomPanel || false, providerFactory, panelType, options.UNSAFE_allowCustomPanel ? panelColor : undefined, options.UNSAFE_allowCustomPanel ? panelIcon : undefined);
243
+ var items = getToolbarItems(formatMessage, nodeType, options.UNSAFE_allowCustomPanel || false, options.UNSAFE_allowCustomPanel && options.UNSAFE_allowCustomPanelEdit || false, providerFactory, panelType, options.UNSAFE_allowCustomPanel ? panelColor : undefined, options.UNSAFE_allowCustomPanel ? panelIcon : undefined);
264
244
 
265
245
  var getDomRef = function getDomRef(editorView) {
266
246
  var domAtPos = editorView.domAtPos.bind(editorView);
@@ -17,7 +17,7 @@ export var panelAttrsToDom = function panelAttrsToDom(attrs, allowCustomPanel) {
17
17
  'data-panel-type': panelType || PanelType.INFO,
18
18
  style: style
19
19
  };
20
- var iconSpan = ['span', {
20
+ var iconDiv = ['div', {
21
21
  class: PanelSharedCssClassName.icon
22
22
  }];
23
23
  var contentDiv = ['div', {
@@ -25,7 +25,7 @@ export var panelAttrsToDom = function panelAttrsToDom(attrs, allowCustomPanel) {
25
25
  }, 0];
26
26
 
27
27
  if (hasIcon) {
28
- return ['div', panelAttrs, iconSpan, contentDiv];
28
+ return ['div', panelAttrs, iconDiv, contentDiv];
29
29
  } else {
30
30
  return ['div', panelAttrs, contentDiv];
31
31
  }
@@ -1,5 +1,5 @@
1
- import LinkifyIt from 'linkify-it';
2
- import { linkifyMatch } from '../hyperlink/utils'; // modified version of the original Linkify plugin
1
+ import { linkifyMatch } from '@atlaskit/adf-schema';
2
+ import LinkifyIt from 'linkify-it'; // modified version of the original Linkify plugin
3
3
  // https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js
4
4
 
5
5
  var arrayReplaceAt = function arrayReplaceAt(src, pos, newElements) {
@@ -6,7 +6,7 @@ export default {
6
6
  // https://product-fabric.atlassian.net/wiki/spaces/E/pages/1113098008/Selection+Guide#Special-Cases
7
7
  'expandKeymap', 'tableSelectionKeymap', 'tableKeymap', 'captionKeymap', // selection keymap needs to be above gap cursor keymap so it can set node selections from
8
8
  // left/right arrows
9
- 'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaKeymap', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'fakeTextCursor', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription'],
9
+ 'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaKeymap', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'fakeTextCursor', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription', 'inlineCode'],
10
10
  nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'rule', 'panel', 'mention', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'unsupportedBlock', 'unsupportedInline', 'confluenceJiraIssue', 'hardBreak', 'emoji', 'placeholder', 'mediaSingle', 'mediaGroup', 'table', 'expand', 'nestedExpand', 'media', 'tableHeader', 'decisionList', 'tableRow', 'decisionItem', 'tableCell', 'taskList', 'taskItem', 'extension', 'bodiedExtension', 'inlineExtension', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard'],
11
11
  marks: [// Inline marks
12
12
  'link', 'em', 'strong', 'textColor', 'strike', 'subsup', 'underline', 'code', 'typeAheadQuery', // Block marks
@@ -5,4 +5,4 @@ var _templateObject;
5
5
  import { css } from 'styled-components';
6
6
  import { StatusSharedCssClassName } from '@atlaskit/editor-common';
7
7
  import { SelectionStyle, getSelectionStyles, akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
8
- export var statusStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n > span {\n display: inline-block;\n cursor: pointer;\n line-height: 0; /* Prevent responsive layouts increasing height of container. */\n }\n\n &.", "\n .", "\n > span {\n ", "\n }\n }\n\n .danger {\n .", " > span {\n background-color: ", ";\n }\n\n .", ".", "\n .", "\n > span {\n box-shadow: 0 0 0 ", "px ", ";\n }\n }\n"])), StatusSharedCssClassName.STATUS_CONTAINER, akEditorSelectedNodeClassName, StatusSharedCssClassName.STATUS_LOZENGE, getSelectionStyles([SelectionStyle.BoxShadow]), StatusSharedCssClassName.STATUS_LOZENGE, akEditorDeleteBackgroundWithOpacity, StatusSharedCssClassName.STATUS_CONTAINER, akEditorSelectedNodeClassName, StatusSharedCssClassName.STATUS_LOZENGE, akEditorSelectedBorderSize, akEditorDeleteBorder);
8
+ export var statusStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n // these two styles can be removed when displayInlineBlockForInlineNodes is enabled by default\n // as it will make all inline nodes inline-block by default\n display: inline-block;\n user-select: all;\n\n > span {\n display: inline-block;\n cursor: pointer;\n line-height: 0; /* Prevent responsive layouts increasing height of container. */\n }\n\n &.", "\n .", "\n > span {\n ", "\n }\n }\n\n .danger {\n .", " > span {\n background-color: ", ";\n }\n\n .", ".", "\n .", "\n > span {\n box-shadow: 0 0 0 ", "px ", ";\n }\n }\n"])), StatusSharedCssClassName.STATUS_CONTAINER, akEditorSelectedNodeClassName, StatusSharedCssClassName.STATUS_LOZENGE, getSelectionStyles([SelectionStyle.BoxShadow]), StatusSharedCssClassName.STATUS_LOZENGE, akEditorDeleteBackgroundWithOpacity, StatusSharedCssClassName.STATUS_CONTAINER, akEditorSelectedNodeClassName, StatusSharedCssClassName.STATUS_LOZENGE, akEditorSelectedBorderSize, akEditorDeleteBorder);
@@ -497,10 +497,26 @@ export var TableRowNodeView = /*#__PURE__*/function () {
497
497
  * so it should be safe to ignore mutations that we cause
498
498
  * by updating styles and classnames on this DOM element
499
499
  *
500
- * Update: should allow mutations for row selection to avoid known issue with table selection highlight in firefox
500
+ * Update: should not ignore mutations for row selection to avoid known issue with table selection highlight in firefox
501
501
  * Related bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1289673
502
502
  * */
503
- return !(mutationRecord.type === 'selection' && mutationRecord.target.tagName === 'TR');
503
+ var isTableSelection = mutationRecord.type === 'selection' && mutationRecord.target.nodeName === 'TR';
504
+ /**
505
+ * Update: should not ignore mutations when an node is added, as this interferes with
506
+ * prosemirrors handling of some language inputs in Safari (ie. Pinyin, Hiragana).
507
+ *
508
+ * In paticular, when a composition occurs at the start of the first node inside a table cell, if the resulting mutation
509
+ * from the composition end is ignored than prosemirror will end up with; invalid table markup nesting and a misplaced
510
+ * selection and insertion.
511
+ */
512
+
513
+ var isNodeInsertion = mutationRecord.type === 'childList' && mutationRecord.target.nodeName === 'TR' && mutationRecord.addedNodes.length;
514
+
515
+ if (isTableSelection || isNodeInsertion) {
516
+ return false;
517
+ }
518
+
519
+ return true;
504
520
  }
505
521
  /* receive external events */
506
522
 
@@ -0,0 +1,57 @@
1
+ import React, { useRef } from 'react';
2
+ import uuid from 'uuid';
3
+ import { useComponentRenderTracking } from '../utils/react-hooks/use-component-renderer-tracking';
4
+ import { RenderCountProfiler as RenderCountProfilerClass } from '@atlaskit/editor-common';
5
+ export var ProfiledComponentIds;
6
+
7
+ (function (ProfiledComponentIds) {
8
+ ProfiledComponentIds["editor"] = "Editor";
9
+ ProfiledComponentIds["appearance"] = "FullPageEditor";
10
+ ProfiledComponentIds["reactEditorView"] = "ReactEditorView";
11
+ ProfiledComponentIds["contentArea"] = "FullPageContentArea";
12
+ ProfiledComponentIds["toolbar"] = "FullPageToolbar";
13
+ ProfiledComponentIds["mention"] = "MentionNodeView";
14
+ })(ProfiledComponentIds || (ProfiledComponentIds = {}));
15
+
16
+ var CoreRenderCountProfiler = function CoreRenderCountProfiler(_ref) {
17
+ var componentId = _ref.componentId;
18
+
19
+ var _useRef = useRef(uuid()),
20
+ instanceId = _useRef.current;
21
+
22
+ var onRender = function onRender(_ref2) {
23
+ var renderCount = _ref2.renderCount;
24
+ var profiler = RenderCountProfilerClass.getInstance({
25
+ store: window
26
+ });
27
+ profiler.setRenderCount({
28
+ componentId: componentId,
29
+ instanceId: instanceId,
30
+ renderCount: renderCount
31
+ });
32
+ };
33
+
34
+ useComponentRenderTracking({
35
+ onRender: onRender,
36
+ propsDiffingOptions: {
37
+ enabled: false
38
+ },
39
+ zeroBasedCount: false
40
+ });
41
+ return null;
42
+ };
43
+
44
+ export var RenderCountProfiler = function RenderCountProfiler(_ref3) {
45
+ var componentId = _ref3.componentId;
46
+ var profiler = RenderCountProfilerClass.getInstance({
47
+ store: window
48
+ });
49
+
50
+ if (profiler.isEnabled()) {
51
+ return /*#__PURE__*/React.createElement(CoreRenderCountProfiler, {
52
+ componentId: componentId
53
+ });
54
+ }
55
+
56
+ return null;
57
+ };
@@ -38,11 +38,11 @@ import messages from '../../../messages';
38
38
  import { TableControlsPadding, MainToolbar, MainToolbarCustomComponentsSlot } from './Toolbar';
39
39
  var CommentEditorMargin = 14;
40
40
  var CommentEditorSmallerMargin = 8;
41
- var CommentEditor = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n\n .less-margin .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n min-width: 272px;\n /* Border + Toolbar + Footer + (Paragraph + ((Parahraph + Margin) * (DefaultLines - 1)) */\n /* calc(2px + 40px + 24px + ( 20px + (32px * 2))) */\n min-height: 150px;\n height: auto;\n ", " background-color: white;\n border: 1px solid ", ";\n box-sizing: border-box;\n border-radius: ", "px;\n\n max-width: inherit;\n word-wrap: break-word;\n"])), CommentEditorSmallerMargin, CommentEditorSmallerMargin, function (props) {
42
- return props.maxHeight ? 'max-height: ' + props.maxHeight + 'px;' : '';
43
- }, N40, borderRadius());
41
+ var CommentEditor = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n\n .less-margin .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n min-width: 272px;\n /* Border + Toolbar + Footer + (Paragraph + ((Parahraph + Margin) * (DefaultLines - 1)) */\n /* calc(2px + 40px + 24px + ( 20px + (32px * 2))) */\n min-height: 150px;\n height: auto;\n background-color: white;\n border: 1px solid ", ";\n box-sizing: border-box;\n border-radius: ", "px;\n\n max-width: inherit;\n word-wrap: break-word;\n"])), CommentEditorSmallerMargin, CommentEditorSmallerMargin, N40, borderRadius());
44
42
  CommentEditor.displayName = 'CommentEditor';
45
- var ContentArea = styled(ContentStyles)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-grow: 1;\n overflow-x: hidden;\n overflow-y: auto;\n line-height: 24px;\n\n /** Hack for Bitbucket to ensure entire editorView gets drop event; see ED-3294 **/\n /** Hack for tables controlls. Otherwise marging collapse and controlls are misplaced. **/\n .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n .gridParent {\n margin-left: ", "px;\n margin-right: ", "px;\n width: calc(100% + ", "px);\n }\n\n padding: ", "px;\n\n ", ";\n"])), CommentEditorMargin, CommentEditorMargin, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, TableControlsPadding, tableCommentEditorStyles);
43
+ var ContentArea = styled(ContentStyles)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-grow: 1;\n overflow-x: hidden;\n overflow-y: auto;\n line-height: 24px;\n ", ";\n\n /** Hack for Bitbucket to ensure entire editorView gets drop event; see ED-3294 **/\n /** Hack for tables controlls. Otherwise marging collapse and controlls are misplaced. **/\n .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n .gridParent {\n margin-left: ", "px;\n margin-right: ", "px;\n width: calc(100% + ", "px);\n }\n\n padding: ", "px;\n\n ", ";\n"])), function (props) {
44
+ return props.maxHeight ? 'max-height: ' + props.maxHeight + 'px;' : '';
45
+ }, CommentEditorMargin, CommentEditorMargin, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, TableControlsPadding, tableCommentEditorStyles);
46
46
  ContentArea.displayName = 'ContentArea';
47
47
  var SecondaryToolbar = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n justify-content: flex-end;\n align-items: center;\n display: flex;\n padding: 12px 1px;\n"])));
48
48
  SecondaryToolbar.displayName = 'SecondaryToolbar';
@@ -135,7 +135,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
135
135
  },
136
136
  className: classnames('ak-editor-content-area', {
137
137
  'less-margin': width < akEditorMobileBreakoutPoint
138
- })
138
+ }),
139
+ maxHeight: maxHeight
139
140
  }, customContentComponents, /*#__PURE__*/React.createElement(PluginSlot, {
140
141
  editorView: editorView,
141
142
  editorActions: editorActions,
@@ -1,35 +1,68 @@
1
- import { useEffect, useRef } from 'react';
1
+ import { useMemo, useEffect, useRef } from 'react';
2
+ import debounce from 'lodash/debounce';
2
3
  import { getShallowPropsDifference, getPropsDifference } from '../../compare';
3
4
  import { EVENT_TYPE } from '../../../plugins/analytics';
4
- export function useComponentRenderTracking(props, action, actionSubject, handleAnalyticsEvent) {
5
- var propsToIgnore = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
6
- var useShallow = arguments.length > 5 ? arguments[5] : undefined;
5
+ export function useComponentRenderTracking(_ref) {
6
+ var onRender = _ref.onRender,
7
+ propsDiffingOptions = _ref.propsDiffingOptions,
8
+ _ref$zeroBasedCount = _ref.zeroBasedCount,
9
+ zeroBasedCount = _ref$zeroBasedCount === void 0 ? true : _ref$zeroBasedCount;
7
10
  var propsRef = useRef();
8
- var renderCountRef = useRef(0);
11
+ var renderCountRef = useRef(zeroBasedCount ? 0 : 1);
9
12
  useEffect(function () {
10
13
  var lastProps = propsRef.current;
11
14
  var renderCount = renderCountRef.current;
15
+ var propsDifference;
12
16
 
13
- if (lastProps) {
14
- var difference = useShallow ? getShallowPropsDifference(lastProps, props) : getPropsDifference(lastProps, props, 0, 2, propsToIgnore);
15
- handleAnalyticsEvent({
16
- payload: {
17
- action: action,
18
- actionSubject: actionSubject,
19
- attributes: {
20
- propsDifference: difference,
21
- count: renderCount
22
- },
23
- eventType: EVENT_TYPE.OPERATIONAL
24
- }
25
- });
17
+ if (propsDiffingOptions !== null && propsDiffingOptions !== void 0 && propsDiffingOptions.enabled && lastProps) {
18
+ propsDifference = propsDiffingOptions !== null && propsDiffingOptions !== void 0 && propsDiffingOptions.useShallow ? getShallowPropsDifference(lastProps, propsDiffingOptions.props) : getPropsDifference(lastProps, propsDiffingOptions.props, 0, 2, propsDiffingOptions === null || propsDiffingOptions === void 0 ? void 0 : propsDiffingOptions.propsToIgnore);
19
+ }
20
+
21
+ var result = {
22
+ renderCount: renderCount,
23
+ propsDifference: propsDifference
24
+ };
25
+ onRender(result);
26
+
27
+ if (propsDiffingOptions !== null && propsDiffingOptions !== void 0 && propsDiffingOptions.enabled) {
28
+ propsRef.current = propsDiffingOptions.props;
26
29
  }
27
30
 
28
- propsRef.current = props;
29
31
  renderCountRef.current = renderCountRef.current + 1;
30
32
  }); // No dependencies run on each render
31
33
  }
32
34
  export function RenderTracking(props) {
33
- useComponentRenderTracking(props.componentProps, props.action, props.actionSubject, props.handleAnalyticsEvent, props.propsToIgnore, props.useShallow);
35
+ var debouncedHandleAnalyticsEvent = useMemo(function () {
36
+ return debounce(props.handleAnalyticsEvent, 500);
37
+ }, [props.handleAnalyticsEvent]);
38
+ useComponentRenderTracking({
39
+ onRender: function onRender(_ref2) {
40
+ var renderCount = _ref2.renderCount,
41
+ propsDifference = _ref2.propsDifference;
42
+
43
+ if (!renderCount) {
44
+ return;
45
+ }
46
+
47
+ debouncedHandleAnalyticsEvent({
48
+ payload: {
49
+ action: props.action,
50
+ actionSubject: props.actionSubject,
51
+ attributes: {
52
+ count: renderCount,
53
+ propsDifference: propsDifference
54
+ },
55
+ eventType: EVENT_TYPE.OPERATIONAL
56
+ }
57
+ });
58
+ },
59
+ propsDiffingOptions: {
60
+ enabled: true,
61
+ props: props.componentProps,
62
+ propsToIgnore: props.propsToIgnore,
63
+ useShallow: props.useShallow
64
+ },
65
+ zeroBasedCount: true
66
+ });
34
67
  return null;
35
68
  }
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "150.0.3";
2
+ export var version = "151.1.2";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "150.0.3",
3
+ "version": "151.1.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { EditorView } from 'prosemirror-view';
3
3
  import { ContextIdentifierProvider, UserBrowserExtensionResults } from '@atlaskit/editor-common';
4
+ import { ExperienceStore } from '@atlaskit/editor-common/ufo';
4
5
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
5
6
  import { FeatureFlags } from '../types/feature-flags';
6
7
  export declare type ErrorBoundaryProps = {
@@ -16,13 +17,9 @@ export declare type ErrorBoundaryState = {
16
17
  declare type AnalyticsErrorBoundaryErrorInfo = {
17
18
  componentStack: string;
18
19
  };
19
- declare type AnalyticsErrorBoundaryAttributes = {
20
- error: string;
21
- info?: AnalyticsErrorBoundaryErrorInfo;
22
- [key: string]: any;
23
- };
24
20
  export declare class ErrorBoundaryWithEditorView extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
25
21
  browserExtensions?: UserBrowserExtensionResults;
22
+ experienceStore?: ExperienceStore;
26
23
  static defaultProps: {
27
24
  rethrow: boolean;
28
25
  };
@@ -31,8 +28,11 @@ export declare class ErrorBoundaryWithEditorView extends React.Component<ErrorBo
31
28
  };
32
29
  private getFeatureFlags;
33
30
  get featureFlags(): FeatureFlags;
34
- fireAnalytics: (analyticsErrorPayload: AnalyticsErrorBoundaryAttributes) => void;
31
+ constructor(props: ErrorBoundaryProps);
32
+ private sendErrorData;
35
33
  private getProductName;
34
+ private fireAnalyticsEvent;
35
+ private getExperienceMetadata;
36
36
  componentDidCatch(error: Error, errorInfo: AnalyticsErrorBoundaryErrorInfo): void;
37
37
  componentDidMount(): Promise<void>;
38
38
  render(): React.ReactNode;
@@ -3,8 +3,10 @@ import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { EditorState } from 'prosemirror-state';
5
5
  import { DirectEditorProps, EditorView } from 'prosemirror-view';
6
+ import { Node as PMNode } from 'prosemirror-model';
6
7
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
7
8
  import { ErrorReporter, ProviderFactory, Transformer } from '@atlaskit/editor-common';
9
+ import { ExperienceStore } from '@atlaskit/editor-common/ufo';
8
10
  import { Dispatch, EventDispatcher } from '../event-dispatcher';
9
11
  import { AnalyticsEventPayload, DispatchAnalyticsEvent, FULL_WIDTH_MODE } from '../plugins/analytics';
10
12
  import { EditorAppearance, EditorConfig, EditorReactContext, EditorPlugin, EditorProps } from '../types';
@@ -19,6 +21,7 @@ export interface EditorViewProps {
19
21
  portalProviderAPI: PortalProviderAPI;
20
22
  allowAnalyticsGASV3?: boolean;
21
23
  disabled?: boolean;
24
+ experienceStore?: ExperienceStore;
22
25
  render?: (props: {
23
26
  editor: JSX.Element;
24
27
  view?: EditorView;
@@ -52,12 +55,14 @@ export default class ReactEditorView<T = {}> extends React.Component<EditorViewP
52
55
  proseMirrorRenderedSeverity?: SEVERITY;
53
56
  transactionTracker: TransactionTracker;
54
57
  validTransactionCount: number;
58
+ experienceStore?: ExperienceStore;
55
59
  static contextTypes: {
56
60
  getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<any>;
57
61
  intl: ReactIntl.IntlShape;
58
62
  };
59
63
  private canDispatchTransactions;
60
- private focusTimeoutId;
64
+ private focusTimeoutId?;
65
+ private reliabilityInterval?;
61
66
  private pluginPerformanceObserver;
62
67
  private featureFlags;
63
68
  private onPluginObservation;
@@ -67,6 +72,11 @@ export default class ReactEditorView<T = {}> extends React.Component<EditorViewP
67
72
  constructor(props: EditorViewProps & T, context: EditorReactContext);
68
73
  UNSAFE_componentWillReceiveProps(nextProps: EditorViewProps): void;
69
74
  formatFullWidthAppearance: (appearance: EditorAppearance | undefined) => FULL_WIDTH_MODE;
75
+ resetEditorState: ({ doc, shouldScrollToBottom, }: {
76
+ doc: string;
77
+ shouldScrollToBottom: boolean;
78
+ }) => void;
79
+ blur: () => void;
70
80
  reconfigureState: (props: EditorViewProps) => void;
71
81
  handleAnalyticsEvent: FireAnalyticsCallback;
72
82
  componentDidMount(): void;
@@ -78,13 +88,15 @@ export default class ReactEditorView<T = {}> extends React.Component<EditorViewP
78
88
  createEditorState: (options: {
79
89
  props: EditorViewProps;
80
90
  context: EditorReactContext;
81
- replaceDoc?: boolean;
91
+ doc?: string | Object | PMNode<any> | undefined;
92
+ resetting?: boolean | undefined;
93
+ selectionAtStart?: boolean | undefined;
82
94
  }) => EditorState<any>;
83
95
  private onEditorViewStateUpdated;
84
96
  private trackValidTransactions;
85
97
  private dispatchTransaction;
86
98
  getDirectEditorProps: (state?: EditorState<any> | undefined) => DirectEditorProps;
87
- createEditorView: (node: HTMLDivElement) => void;
99
+ private createEditorView;
88
100
  handleEditorViewRef: (node: HTMLDivElement) => void;
89
101
  dispatchAnalyticsEvent: (payload: AnalyticsEventPayload) => void;
90
102
  private editor;
@@ -27,6 +27,8 @@ export default class Editor extends React.Component<EditorProps, State> {
27
27
  private editorActions;
28
28
  private createAnalyticsEvent?;
29
29
  private editorSessionId;
30
+ private experienceStore?;
31
+ private startTime?;
30
32
  constructor(props: EditorProps, context: Context);
31
33
  componentDidMount(): void;
32
34
  componentDidUpdate(prevProps: EditorProps): void;
@@ -1,6 +1,6 @@
1
1
  import analyticsPlugin from './plugin';
2
2
  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, LIST_TEXT_SCENARIOS, } from './types';
3
- export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadWithChannel, CommonListAnalyticsAttributes, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, ErrorEventPayload, FormatEventPayload, GeneralEventPayload, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, SubstituteEventPayload, TableEventPayload, } from './types';
3
+ export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadWithChannel, CommonListAnalyticsAttributes, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, ErrorEventPayload, ErrorEventAttributes, FormatEventPayload, GeneralEventPayload, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, SubstituteEventPayload, TableEventPayload, } from './types';
4
4
  export { withAnalytics, addAnalytics, findInsertLocation, getAnalyticsEventsFromTransaction, getSelectionType, getStateContext, mapActionSubjectIdToAttributes, } from './utils';
5
5
  export declare const analyticsPluginKey: import("prosemirror-state").PluginKey<any, any>;
6
6
  export default analyticsPlugin;
@@ -88,7 +88,8 @@ export declare enum ACTION {
88
88
  RENDERED = "rendered",
89
89
  ON_EDITOR_READY_CALLBACK = "onEditorReadyCallback",
90
90
  ON_CHANGE_CALLBACK = "onChangeCalled",
91
- REMOVE_ICON = "removedIcon"
91
+ REMOVE_ICON = "removedIcon",
92
+ UFO_SESSION_COMPLETE = "ufoSessionComplete"
92
93
  }
93
94
  export declare enum INPUT_METHOD {
94
95
  ASCII = "ascii",
@@ -217,8 +218,9 @@ export declare enum ACTION_SUBJECT_ID {
217
218
  LINK = "link",
218
219
  LINK_PREVIEW = "linkPreview",
219
220
  MEDIA = "media",
220
- MEDIA_SINGLE = "mediaSingle",
221
221
  MEDIA_GROUP = "mediaGroup",
222
+ MEDIA_INLINE = "mediaInline",
223
+ MEDIA_SINGLE = "mediaSingle",
222
224
  MEDIA_LINK = "mediaLink",
223
225
  MENTION = "mention",
224
226
  NESTED_EXPAND = "nestedExpand",
@@ -77,7 +77,7 @@ declare type ContentComponentErrorAEP = OperationalAEP<ACTION.ERRORED, ACTION_SU
77
77
  position: number;
78
78
  docSize: number;
79
79
  }, undefined>;
80
- declare type ComponentCrashErrorAEP = OperationalAEP<ACTION.EDITOR_CRASHED, ACTION_SUBJECT.FLOATING_CONTEXTUAL_BUTTON | ACTION_SUBJECT.PLUGIN_SLOT | ACTION_SUBJECT.REACT_NODE_VIEW | ACTION_SUBJECT.TABLES_PLUGIN | ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN | ACTION_SUBJECT.EDITOR, ACTION_SUBJECT_ID | FLOATING_CONTROLS_TITLE, {
80
+ export declare type ErrorEventAttributes = {
81
81
  error: Error;
82
82
  errorInfo: React.ErrorInfo;
83
83
  product?: string;
@@ -85,6 +85,11 @@ declare type ComponentCrashErrorAEP = OperationalAEP<ACTION.EDITOR_CRASHED, ACTI
85
85
  errorId?: string;
86
86
  docStructure?: string | SimplifiedNode;
87
87
  browserExtensions?: UserBrowserExtensionResults;
88
+ };
89
+ declare type ComponentCrashErrorAEP = OperationalAEP<ACTION.EDITOR_CRASHED, ACTION_SUBJECT.FLOATING_CONTEXTUAL_BUTTON | ACTION_SUBJECT.PLUGIN_SLOT | ACTION_SUBJECT.REACT_NODE_VIEW | ACTION_SUBJECT.TABLES_PLUGIN | ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN | ACTION_SUBJECT.EDITOR, ACTION_SUBJECT_ID | FLOATING_CONTROLS_TITLE, ErrorEventAttributes, undefined>;
90
+ declare type ComponentCrashAdditionalInfoErrorAEP = OperationalAEP<ACTION.EDITOR_CRASHED_ADDITIONAL_INFORMATION, ACTION_SUBJECT.EDITOR, undefined, {
91
+ errorStack: string;
92
+ errorId: string;
88
93
  }, undefined>;
89
- export declare type ErrorEventPayload = InvalidTransactionErrorAEP | InvalidTransactionStepErrorAEP | FailedToUnmountErrorAEP | SynchronyErrorAEP | SynchronyEntityErrorAEP | ContentComponentErrorAEP | ComponentCrashErrorAEP;
94
+ export declare type ErrorEventPayload = InvalidTransactionErrorAEP | InvalidTransactionStepErrorAEP | FailedToUnmountErrorAEP | SynchronyErrorAEP | SynchronyEntityErrorAEP | ContentComponentErrorAEP | ComponentCrashErrorAEP | ComponentCrashAdditionalInfoErrorAEP;
90
95
  export {};