@atlaskit/editor-core 150.0.3 → 151.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/CHANGELOG.md +47 -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 +4 -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-block/toolbar.js +1 -1
  17. package/dist/cjs/plugins/emoji/styles.js +1 -1
  18. package/dist/cjs/plugins/extension/pm-plugins/main.js +1 -4
  19. package/dist/cjs/plugins/extension/toolbar.js +28 -23
  20. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +8 -3
  21. package/dist/cjs/plugins/find-replace/ui/Find.js +27 -7
  22. package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +3 -3
  23. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
  24. package/dist/cjs/plugins/hyperlink/utils.js +6 -69
  25. package/dist/cjs/plugins/media/index.js +14 -3
  26. package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +24 -10
  27. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +179 -0
  28. package/dist/cjs/plugins/media/pm-plugins/main.js +18 -9
  29. package/dist/cjs/plugins/media/toolbar/index.js +49 -17
  30. package/dist/cjs/plugins/media/toolbar/utils.js +20 -2
  31. package/dist/cjs/plugins/media/utils/media-files.js +67 -1
  32. package/dist/cjs/plugins/panel/index.js +2 -3
  33. package/dist/cjs/plugins/panel/message.js +47 -0
  34. package/dist/cjs/plugins/panel/toolbar.js +64 -84
  35. package/dist/cjs/plugins/panel/utils.js +2 -2
  36. package/dist/cjs/plugins/paste/linkify-md-plugin.js +3 -3
  37. package/dist/cjs/plugins/status/styles.js +1 -1
  38. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
  39. package/dist/cjs/profiler/render-count.js +82 -0
  40. package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -5
  41. package/dist/cjs/utils/react-hooks/use-component-renderer-tracking/index.js +55 -19
  42. package/dist/cjs/version-wrapper.js +1 -1
  43. package/dist/cjs/version.json +1 -1
  44. package/dist/es2019/actions/index.js +6 -28
  45. package/dist/es2019/create-editor/ErrorBoundary.js +73 -60
  46. package/dist/es2019/create-editor/ReactEditorView.js +130 -23
  47. package/dist/es2019/create-editor/create-plugins-list.js +4 -2
  48. package/dist/es2019/editor.js +74 -35
  49. package/dist/es2019/labs/next/presets/cxhtml.js +2 -1
  50. package/dist/es2019/plugins/analytics/types/enums.js +3 -1
  51. package/dist/es2019/plugins/base/index.js +4 -3
  52. package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +63 -35
  53. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +2 -1
  54. package/dist/es2019/plugins/card/index.js +7 -2
  55. package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -0
  56. package/dist/es2019/plugins/card/pm-plugins/main.js +9 -2
  57. package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +12 -5
  58. package/dist/es2019/plugins/code-block/toolbar.js +1 -1
  59. package/dist/es2019/plugins/emoji/styles.js +2 -0
  60. package/dist/es2019/plugins/extension/pm-plugins/main.js +1 -4
  61. package/dist/es2019/plugins/extension/toolbar.js +30 -25
  62. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +8 -4
  63. package/dist/es2019/plugins/find-replace/ui/Find.js +27 -6
  64. package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +1 -1
  65. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
  66. package/dist/es2019/plugins/hyperlink/utils.js +3 -59
  67. package/dist/es2019/plugins/media/index.js +13 -4
  68. package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +16 -7
  69. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +88 -0
  70. package/dist/es2019/plugins/media/pm-plugins/main.js +20 -11
  71. package/dist/es2019/plugins/media/toolbar/index.js +44 -15
  72. package/dist/es2019/plugins/media/toolbar/utils.js +16 -0
  73. package/dist/es2019/plugins/media/utils/media-files.js +68 -2
  74. package/dist/es2019/plugins/panel/index.js +3 -4
  75. package/dist/es2019/plugins/panel/message.js +38 -0
  76. package/dist/es2019/plugins/panel/toolbar.js +52 -71
  77. package/dist/es2019/plugins/panel/utils.js +2 -2
  78. package/dist/es2019/plugins/paste/linkify-md-plugin.js +2 -2
  79. package/dist/es2019/plugins/status/styles.js +2 -0
  80. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
  81. package/dist/es2019/profiler/render-count.js +60 -0
  82. package/dist/es2019/ui/Appearance/Comment/Comment.js +4 -2
  83. package/dist/es2019/utils/react-hooks/use-component-renderer-tracking/index.js +51 -18
  84. package/dist/es2019/version-wrapper.js +1 -1
  85. package/dist/es2019/version.json +1 -1
  86. package/dist/esm/actions/index.js +6 -24
  87. package/dist/esm/create-editor/ErrorBoundary.js +113 -78
  88. package/dist/esm/create-editor/ReactEditorView.js +146 -31
  89. package/dist/esm/create-editor/create-plugins-list.js +4 -2
  90. package/dist/esm/editor.js +100 -40
  91. package/dist/esm/labs/next/presets/cxhtml.js +2 -1
  92. package/dist/esm/plugins/analytics/types/enums.js +3 -1
  93. package/dist/esm/plugins/base/index.js +4 -3
  94. package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +64 -36
  95. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -1
  96. package/dist/esm/plugins/card/index.js +13 -2
  97. package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -0
  98. package/dist/esm/plugins/card/pm-plugins/main.js +7 -2
  99. package/dist/esm/plugins/card/pm-plugins/util/resolve.js +12 -5
  100. package/dist/esm/plugins/code-block/toolbar.js +1 -1
  101. package/dist/esm/plugins/emoji/styles.js +1 -1
  102. package/dist/esm/plugins/extension/pm-plugins/main.js +1 -4
  103. package/dist/esm/plugins/extension/toolbar.js +28 -23
  104. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +8 -4
  105. package/dist/esm/plugins/find-replace/ui/Find.js +27 -7
  106. package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +1 -1
  107. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
  108. package/dist/esm/plugins/hyperlink/utils.js +3 -59
  109. package/dist/esm/plugins/media/index.js +14 -4
  110. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +24 -10
  111. package/dist/esm/plugins/media/nodeviews/mediaInline.js +147 -0
  112. package/dist/esm/plugins/media/pm-plugins/main.js +19 -11
  113. package/dist/esm/plugins/media/toolbar/index.js +47 -19
  114. package/dist/esm/plugins/media/toolbar/utils.js +15 -1
  115. package/dist/esm/plugins/media/utils/media-files.js +60 -2
  116. package/dist/esm/plugins/panel/index.js +3 -4
  117. package/dist/esm/plugins/panel/message.js +38 -0
  118. package/dist/esm/plugins/panel/toolbar.js +57 -77
  119. package/dist/esm/plugins/panel/utils.js +2 -2
  120. package/dist/esm/plugins/paste/linkify-md-plugin.js +2 -2
  121. package/dist/esm/plugins/status/styles.js +1 -1
  122. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
  123. package/dist/esm/profiler/render-count.js +57 -0
  124. package/dist/esm/ui/Appearance/Comment/Comment.js +6 -5
  125. package/dist/esm/utils/react-hooks/use-component-renderer-tracking/index.js +53 -20
  126. package/dist/esm/version-wrapper.js +1 -1
  127. package/dist/esm/version.json +1 -1
  128. package/dist/types/create-editor/ErrorBoundary.d.ts +6 -6
  129. package/dist/types/create-editor/ReactEditorView.d.ts +15 -3
  130. package/dist/types/editor.d.ts +2 -0
  131. package/dist/types/plugins/analytics/index.d.ts +1 -1
  132. package/dist/types/plugins/analytics/types/enums.d.ts +4 -2
  133. package/dist/types/plugins/analytics/types/events.d.ts +7 -2
  134. package/dist/types/plugins/analytics/types/general-events.d.ts +4 -1
  135. package/dist/types/plugins/analytics/types/index.d.ts +1 -1
  136. package/dist/types/plugins/analytics/types/insert-events.d.ts +6 -1
  137. package/dist/types/plugins/analytics/types/link-tool-bar-events.d.ts +1 -0
  138. package/dist/types/plugins/base/index.d.ts +1 -0
  139. package/dist/types/plugins/base/pm-plugins/frozen-editor.d.ts +3 -2
  140. package/dist/types/plugins/card/pm-plugins/main.d.ts +2 -3
  141. package/dist/types/plugins/card/pm-plugins/util/resolve.d.ts +2 -1
  142. package/dist/types/plugins/card/types.d.ts +6 -0
  143. package/dist/types/plugins/extension/types.d.ts +0 -2
  144. package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
  145. package/dist/types/plugins/floating-toolbar/types.d.ts +1 -1
  146. package/dist/types/plugins/floating-toolbar/ui/Select.d.ts +1 -1
  147. package/dist/types/plugins/hyperlink/utils.d.ts +0 -21
  148. package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +27 -0
  149. package/dist/types/plugins/media/pm-plugins/main.d.ts +2 -2
  150. package/dist/types/plugins/media/toolbar/utils.d.ts +2 -0
  151. package/dist/types/plugins/media/utils/media-files.d.ts +8 -0
  152. package/dist/types/plugins/panel/message.d.ts +37 -0
  153. package/dist/types/plugins/panel/toolbar.d.ts +4 -37
  154. package/dist/types/plugins/panel/types.d.ts +1 -0
  155. package/dist/types/profiler/render-count.d.ts +14 -0
  156. package/dist/types/types/feature-flags.d.ts +8 -0
  157. package/dist/types/ui/LinkSearch/types.d.ts +1 -0
  158. package/dist/types/utils/react-hooks/use-component-renderer-tracking/index.d.ts +17 -1
  159. package/package.json +19 -16
  160. package/dist/cjs/plugins/caption/nodeviews/index.test.js +0 -135
  161. package/dist/cjs/plugins/caption/pm-plugins/keymap.test.js +0 -203
  162. package/dist/cjs/plugins/caption/pm-plugins/main.test.js +0 -141
  163. package/dist/cjs/plugins/code-block/language-list.test.js +0 -74
  164. package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -101
  165. package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -98
  166. package/dist/cjs/plugins/media/commands/captions.test.js +0 -149
  167. package/dist/cjs/plugins/media/commands/linking.test.js +0 -296
  168. package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -50
  169. package/dist/cjs/plugins/panel/toolbar.test.js +0 -250
  170. package/dist/cjs/ui/ColorPickerButton/index.test.js +0 -123
  171. package/dist/cjs/ui/PortalProvider/index.test.js +0 -139
  172. package/dist/es2019/plugins/caption/nodeviews/index.test.js +0 -122
  173. package/dist/es2019/plugins/caption/pm-plugins/keymap.test.js +0 -193
  174. package/dist/es2019/plugins/caption/pm-plugins/main.test.js +0 -132
  175. package/dist/es2019/plugins/code-block/language-list.test.js +0 -69
  176. package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -83
  177. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -85
  178. package/dist/es2019/plugins/media/commands/captions.test.js +0 -126
  179. package/dist/es2019/plugins/media/commands/linking.test.js +0 -208
  180. package/dist/es2019/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -41
  181. package/dist/es2019/plugins/panel/toolbar.test.js +0 -200
  182. package/dist/es2019/ui/ColorPickerButton/index.test.js +0 -88
  183. package/dist/es2019/ui/PortalProvider/index.test.js +0 -115
  184. package/dist/esm/plugins/caption/nodeviews/index.test.js +0 -125
  185. package/dist/esm/plugins/caption/pm-plugins/keymap.test.js +0 -195
  186. package/dist/esm/plugins/caption/pm-plugins/main.test.js +0 -124
  187. package/dist/esm/plugins/code-block/language-list.test.js +0 -71
  188. package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -92
  189. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -85
  190. package/dist/esm/plugins/media/commands/captions.test.js +0 -135
  191. package/dist/esm/plugins/media/commands/linking.test.js +0 -268
  192. package/dist/esm/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -41
  193. package/dist/esm/plugins/panel/toolbar.test.js +0 -230
  194. package/dist/esm/ui/ColorPickerButton/index.test.js +0 -107
  195. package/dist/esm/ui/PortalProvider/index.test.js +0 -129
@@ -57,7 +57,8 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
57
57
  allowInlineCursorTarget: !isMobile,
58
58
  allowScrollGutter: getScrollGutterOptions(props),
59
59
  inputTracking,
60
- browserFreezeTracking: (_props$performanceTra2 = props.performanceTracking) === null || _props$performanceTra2 === void 0 ? void 0 : _props$performanceTra2.bFreezeTracking
60
+ browserFreezeTracking: (_props$performanceTra2 = props.performanceTracking) === null || _props$performanceTra2 === void 0 ? void 0 : _props$performanceTra2.bFreezeTracking,
61
+ ufo: createFeatureFlagsFromProps(props).ufo
61
62
  },
62
63
  blockType: {
63
64
  lastNodeMustBeParagraph: appearance === 'comment' || appearance === 'chromeless',
@@ -271,7 +272,8 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
271
272
  if (props.allowPanel) {
272
273
  preset.add([panelPlugin, {
273
274
  useLongPressSelection: false,
274
- UNSAFE_allowCustomPanel: props.allowPanel.UNSAFE_allowCustomPanel
275
+ UNSAFE_allowCustomPanel: props.allowPanel.UNSAFE_allowCustomPanel,
276
+ UNSAFE_allowCustomPanelEdit: props.allowPanel.UNSAFE_allowCustomPanelEdit
275
277
  }]);
276
278
  }
277
279
 
@@ -7,6 +7,7 @@ import memoizeOne from 'memoize-one';
7
7
  import uuid from 'uuid/v4';
8
8
  import { name, version } from './version-wrapper';
9
9
  import { ProviderFactory, BaseTheme, getAnalyticsAppearance, WithCreateAnalyticsEvent, startMeasure, stopMeasure, clearMeasure, measureTTI, getTTISeverity, combineExtensionProviders, WidthProvider } from '@atlaskit/editor-common';
10
+ import { EditorExperience, ExperienceStore } from '@atlaskit/editor-common/ufo';
10
11
  import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
11
12
  import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
12
13
  import { getUiComponent } from './create-editor';
@@ -27,6 +28,8 @@ const WidthProviderFullHeight = styled(WidthProvider)`
27
28
  `;
28
29
  export default class Editor extends React.Component {
29
30
  constructor(props, context) {
31
+ var _props$performanceTra, _props$performanceTra2, _props$featureFlags;
32
+
30
33
  super(props);
31
34
 
32
35
  _defineProperty(this, "prepareExtensionProvider", memoizeOne(extensionProviders => {
@@ -64,11 +67,16 @@ export default class Editor extends React.Component {
64
67
  this.editorActions = (context || {}).editorActions || new EditorActions();
65
68
  this.trackEditorActions(this.editorActions, props);
66
69
  this.editorSessionId = uuid();
70
+ this.startTime = performance.now();
67
71
  startMeasure(measurements.EDITOR_MOUNTED);
68
72
 
69
- if (props.performanceTracking && props.performanceTracking.ttiTracking && props.performanceTracking.ttiTracking.enabled) {
73
+ if ((_props$performanceTra = props.performanceTracking) !== null && _props$performanceTra !== void 0 && (_props$performanceTra2 = _props$performanceTra.ttiTracking) !== null && _props$performanceTra2 !== void 0 && _props$performanceTra2.enabled || (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.ufo) {
74
+ var _props$performanceTra5, _props$performanceTra6, _props$performanceTra7, _props$performanceTra8;
75
+
70
76
  measureTTI((tti, ttiFromInvocation, canceled) => {
71
- if (this.createAnalyticsEvent) {
77
+ var _props$performanceTra3, _props$performanceTra4, _props$featureFlags2;
78
+
79
+ if ((_props$performanceTra3 = props.performanceTracking) !== null && _props$performanceTra3 !== void 0 && (_props$performanceTra4 = _props$performanceTra3.ttiTracking) !== null && _props$performanceTra4 !== void 0 && _props$performanceTra4.enabled && this.createAnalyticsEvent) {
72
80
  var _ttiTracking;
73
81
 
74
82
  const ttiEvent = {
@@ -101,7 +109,14 @@ export default class Editor extends React.Component {
101
109
 
102
110
  fireAnalyticsEvent(this.createAnalyticsEvent)(ttiEvent);
103
111
  }
104
- }, props.performanceTracking.ttiTracking.ttiIdleThreshold, props.performanceTracking.ttiTracking.ttiCancelTimeout);
112
+
113
+ if ((_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.ufo) {
114
+ var _this$experienceStore, _this$experienceStore2;
115
+
116
+ (_this$experienceStore = this.experienceStore) === null || _this$experienceStore === void 0 ? void 0 : _this$experienceStore.mark(EditorExperience.loadEditor, ACTION.EDITOR_TTI, tti);
117
+ (_this$experienceStore2 = this.experienceStore) === null || _this$experienceStore2 === void 0 ? void 0 : _this$experienceStore2.success(EditorExperience.loadEditor);
118
+ }
119
+ }, (_props$performanceTra5 = props.performanceTracking) === null || _props$performanceTra5 === void 0 ? void 0 : (_props$performanceTra6 = _props$performanceTra5.ttiTracking) === null || _props$performanceTra6 === void 0 ? void 0 : _props$performanceTra6.ttiIdleThreshold, (_props$performanceTra7 = props.performanceTracking) === null || _props$performanceTra7 === void 0 ? void 0 : (_props$performanceTra8 = _props$performanceTra7.ttiTracking) === null || _props$performanceTra8 === void 0 ? void 0 : _props$performanceTra8.ttiCancelTimeout);
105
120
  }
106
121
 
107
122
  const _extensionProvider = this.prepareExtensionProvider(props.extensionProviders);
@@ -139,18 +154,26 @@ export default class Editor extends React.Component {
139
154
  }
140
155
 
141
156
  componentWillUnmount() {
142
- var _this$props, _this$props$performan, _this$props$performan2;
157
+ var _this$props, _this$props$performan, _this$props$performan2, _this$props$featureFl;
143
158
 
144
159
  this.unregisterEditorFromActions();
145
160
  this.providerFactory.destroy();
146
161
  clearMeasure(measurements.EDITOR_MOUNTED);
147
162
  ((_this$props = this.props) === null || _this$props === void 0 ? void 0 : (_this$props$performan = _this$props.performanceTracking) === null || _this$props$performan === void 0 ? void 0 : (_this$props$performan2 = _this$props$performan.onEditorReadyCallbackTracking) === null || _this$props$performan2 === void 0 ? void 0 : _this$props$performan2.enabled) && clearMeasure(measurements.ON_EDITOR_READY_CALLBACK);
163
+
164
+ if ((_this$props$featureFl = this.props.featureFlags) !== null && _this$props$featureFl !== void 0 && _this$props$featureFl.ufo) {
165
+ var _this$experienceStore3;
166
+
167
+ (_this$experienceStore3 = this.experienceStore) === null || _this$experienceStore3 === void 0 ? void 0 : _this$experienceStore3.abortAll({
168
+ reason: 'editor component unmounted'
169
+ });
170
+ }
148
171
  }
149
172
 
150
173
  trackEditorActions(editorActions, props) {
151
- var _props$performanceTra, _props$performanceTra2;
174
+ var _props$performanceTra9, _props$performanceTra10;
152
175
 
153
- if (props !== null && props !== void 0 && (_props$performanceTra = props.performanceTracking) !== null && _props$performanceTra !== void 0 && (_props$performanceTra2 = _props$performanceTra.contentRetrievalTracking) !== null && _props$performanceTra2 !== void 0 && _props$performanceTra2.enabled) {
176
+ if (props !== null && props !== void 0 && (_props$performanceTra9 = props.performanceTracking) !== null && _props$performanceTra9 !== void 0 && (_props$performanceTra10 = _props$performanceTra9.contentRetrievalTracking) !== null && _props$performanceTra10 !== void 0 && _props$performanceTra10.enabled) {
154
177
  const DEFAULT_SAMPLING_RATE = 100;
155
178
  const getValue = editorActions.getValue.bind(editorActions);
156
179
 
@@ -174,11 +197,11 @@ export default class Editor extends React.Component {
174
197
  if (!getValueTracked) {
175
198
  const getValueWithTracking = async () => {
176
199
  try {
177
- var _props$performanceTra3, _props$performanceTra4, _props$performanceTra5;
200
+ var _props$performanceTra11, _props$performanceTra12, _props$performanceTra13;
178
201
 
179
202
  const value = await getValue();
180
203
 
181
- if (samplingCounters.success === ((_props$performanceTra3 = props === null || props === void 0 ? void 0 : (_props$performanceTra4 = props.performanceTracking) === null || _props$performanceTra4 === void 0 ? void 0 : (_props$performanceTra5 = _props$performanceTra4.contentRetrievalTracking) === null || _props$performanceTra5 === void 0 ? void 0 : _props$performanceTra5.successSamplingRate) !== null && _props$performanceTra3 !== void 0 ? _props$performanceTra3 : DEFAULT_SAMPLING_RATE)) {
204
+ if (samplingCounters.success === ((_props$performanceTra11 = props === null || props === void 0 ? void 0 : (_props$performanceTra12 = props.performanceTracking) === null || _props$performanceTra12 === void 0 ? void 0 : (_props$performanceTra13 = _props$performanceTra12.contentRetrievalTracking) === null || _props$performanceTra13 === void 0 ? void 0 : _props$performanceTra13.successSamplingRate) !== null && _props$performanceTra11 !== void 0 ? _props$performanceTra11 : DEFAULT_SAMPLING_RATE)) {
182
205
  this.handleAnalyticsEvent({
183
206
  payload: {
184
207
  action: ACTION.EDITOR_CONTENT_RETRIEVAL_PERFORMED,
@@ -195,10 +218,10 @@ export default class Editor extends React.Component {
195
218
  samplingCounters.success++;
196
219
  return value;
197
220
  } catch (err) {
198
- var _props$performanceTra6, _props$performanceTra7, _props$performanceTra8;
221
+ var _props$performanceTra14, _props$performanceTra15, _props$performanceTra16;
199
222
 
200
- if (samplingCounters.failure === ((_props$performanceTra6 = props === null || props === void 0 ? void 0 : (_props$performanceTra7 = props.performanceTracking) === null || _props$performanceTra7 === void 0 ? void 0 : (_props$performanceTra8 = _props$performanceTra7.contentRetrievalTracking) === null || _props$performanceTra8 === void 0 ? void 0 : _props$performanceTra8.failureSamplingRate) !== null && _props$performanceTra6 !== void 0 ? _props$performanceTra6 : DEFAULT_SAMPLING_RATE)) {
201
- var _props$performanceTra9, _props$performanceTra10;
223
+ if (samplingCounters.failure === ((_props$performanceTra14 = props === null || props === void 0 ? void 0 : (_props$performanceTra15 = props.performanceTracking) === null || _props$performanceTra15 === void 0 ? void 0 : (_props$performanceTra16 = _props$performanceTra15.contentRetrievalTracking) === null || _props$performanceTra16 === void 0 ? void 0 : _props$performanceTra16.failureSamplingRate) !== null && _props$performanceTra14 !== void 0 ? _props$performanceTra14 : DEFAULT_SAMPLING_RATE)) {
224
+ var _props$performanceTra17, _props$performanceTra18;
202
225
 
203
226
  this.handleAnalyticsEvent({
204
227
  payload: {
@@ -207,7 +230,7 @@ export default class Editor extends React.Component {
207
230
  attributes: {
208
231
  success: false,
209
232
  errorInfo: err.toString(),
210
- errorStack: props !== null && props !== void 0 && (_props$performanceTra9 = props.performanceTracking) !== null && _props$performanceTra9 !== void 0 && (_props$performanceTra10 = _props$performanceTra9.contentRetrievalTracking) !== null && _props$performanceTra10 !== void 0 && _props$performanceTra10.reportErrorStack ? err.stack : undefined
233
+ errorStack: props !== null && props !== void 0 && (_props$performanceTra17 = props.performanceTracking) !== null && _props$performanceTra17 !== void 0 && (_props$performanceTra18 = _props$performanceTra17.contentRetrievalTracking) !== null && _props$performanceTra18 !== void 0 && _props$performanceTra18.reportErrorStack ? err.stack : undefined
211
234
  },
212
235
  eventType: EVENT_TYPE.OPERATIONAL
213
236
  }
@@ -229,38 +252,54 @@ export default class Editor extends React.Component {
229
252
  }
230
253
 
231
254
  onEditorCreated(instance) {
255
+ var _this$props$featureFl2;
256
+
232
257
  this.registerEditorForActions(instance.view, instance.eventDispatcher, instance.transformer);
233
258
 
259
+ if ((_this$props$featureFl2 = this.props.featureFlags) !== null && _this$props$featureFl2 !== void 0 && _this$props$featureFl2.ufo) {
260
+ this.experienceStore = ExperienceStore.getInstance(instance.view);
261
+ this.experienceStore.start(EditorExperience.loadEditor, this.startTime);
262
+ }
263
+
234
264
  if (this.props.onEditorReady) {
235
- var _this$props2, _this$props2$performa, _this$props2$performa2, _this$props3, _this$props3$performa, _this$props3$performa2;
265
+ var _this$props2, _this$props2$performa, _this$props2$performa2, _this$props$featureFl3;
236
266
 
237
- ((_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : (_this$props2$performa = _this$props2.performanceTracking) === null || _this$props2$performa === void 0 ? void 0 : (_this$props2$performa2 = _this$props2$performa.onEditorReadyCallbackTracking) === null || _this$props2$performa2 === void 0 ? void 0 : _this$props2$performa2.enabled) && startMeasure(measurements.ON_EDITOR_READY_CALLBACK);
267
+ const measureEditorReady = ((_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : (_this$props2$performa = _this$props2.performanceTracking) === null || _this$props2$performa === void 0 ? void 0 : (_this$props2$performa2 = _this$props2$performa.onEditorReadyCallbackTracking) === null || _this$props2$performa2 === void 0 ? void 0 : _this$props2$performa2.enabled) || ((_this$props$featureFl3 = this.props.featureFlags) === null || _this$props$featureFl3 === void 0 ? void 0 : _this$props$featureFl3.ufo);
268
+ measureEditorReady && startMeasure(measurements.ON_EDITOR_READY_CALLBACK);
238
269
  this.props.onEditorReady(this.editorActions);
239
- ((_this$props3 = this.props) === null || _this$props3 === void 0 ? void 0 : (_this$props3$performa = _this$props3.performanceTracking) === null || _this$props3$performa === void 0 ? void 0 : (_this$props3$performa2 = _this$props3$performa.onEditorReadyCallbackTracking) === null || _this$props3$performa2 === void 0 ? void 0 : _this$props3$performa2.enabled) && stopMeasure(measurements.ON_EDITOR_READY_CALLBACK, this.sendDurationAnalytics(ACTION.ON_EDITOR_READY_CALLBACK));
270
+ measureEditorReady && stopMeasure(measurements.ON_EDITOR_READY_CALLBACK, this.sendDurationAnalytics(ACTION.ON_EDITOR_READY_CALLBACK));
240
271
  }
241
272
  }
242
273
 
243
274
  sendDurationAnalytics(action) {
244
- return (duration, startTime) => {
275
+ return async (duration, startTime) => {
276
+ var _this$props$featureFl4;
277
+
278
+ const contextIdentifier = await this.props.contextIdentifierProvider;
279
+ const objectId = contextIdentifier === null || contextIdentifier === void 0 ? void 0 : contextIdentifier.objectId;
280
+
245
281
  if (this.createAnalyticsEvent) {
246
- const fireMounted = objectId => {
247
- fireAnalyticsEvent(this.createAnalyticsEvent)({
248
- payload: {
249
- action,
250
- actionSubject: ACTION_SUBJECT.EDITOR,
251
- attributes: {
252
- duration,
253
- startTime,
254
- objectId
255
- },
256
- eventType: EVENT_TYPE.OPERATIONAL
257
- }
258
- });
259
- };
282
+ fireAnalyticsEvent(this.createAnalyticsEvent)({
283
+ payload: {
284
+ action,
285
+ actionSubject: ACTION_SUBJECT.EDITOR,
286
+ attributes: {
287
+ duration,
288
+ startTime,
289
+ objectId
290
+ },
291
+ eventType: EVENT_TYPE.OPERATIONAL
292
+ }
293
+ });
294
+ }
295
+
296
+ if ((_this$props$featureFl4 = this.props.featureFlags) !== null && _this$props$featureFl4 !== void 0 && _this$props$featureFl4.ufo) {
297
+ var _this$experienceStore4, _this$experienceStore5;
260
298
 
261
- Promise.resolve(this.props.contextIdentifierProvider).then(p => {
262
- fireMounted(p === null || p === void 0 ? void 0 : p.objectId);
263
- }, fireMounted);
299
+ (_this$experienceStore4 = this.experienceStore) === null || _this$experienceStore4 === void 0 ? void 0 : _this$experienceStore4.mark(EditorExperience.loadEditor, action, startTime + duration);
300
+ (_this$experienceStore5 = this.experienceStore) === null || _this$experienceStore5 === void 0 ? void 0 : _this$experienceStore5.addMetadata(EditorExperience.loadEditor, {
301
+ objectId
302
+ });
264
303
  }
265
304
  };
266
305
  }
@@ -417,7 +456,7 @@ export default class Editor extends React.Component {
417
456
  config,
418
457
  dispatchAnalyticsEvent
419
458
  }) => {
420
- var _this$props$featureFl, _this$props$featureFl2;
459
+ var _this$props$featureFl5, _this$props$featureFl6;
421
460
 
422
461
  return /*#__PURE__*/React.createElement(BaseTheme, {
423
462
  dynamicTextSizing: this.props.allowDynamicTextSizing && this.props.appearance !== 'full-width',
@@ -449,7 +488,7 @@ export default class Editor extends React.Component {
449
488
  collabEdit: this.props.collabEdit,
450
489
  allowAnnotation: !!this.props.annotationProviders,
451
490
  persistScrollGutter: this.props.persistScrollGutter,
452
- enableToolbarMinWidth: ((_this$props$featureFl = this.props.featureFlags) === null || _this$props$featureFl === void 0 ? void 0 : _this$props$featureFl.toolbarMinWidthOverflow) != null ? !!((_this$props$featureFl2 = this.props.featureFlags) !== null && _this$props$featureFl2 !== void 0 && _this$props$featureFl2.toolbarMinWidthOverflow) : this.props.UNSAFE_allowUndoRedoButtons,
491
+ enableToolbarMinWidth: ((_this$props$featureFl5 = this.props.featureFlags) === null || _this$props$featureFl5 === void 0 ? void 0 : _this$props$featureFl5.toolbarMinWidthOverflow) != null ? !!((_this$props$featureFl6 = this.props.featureFlags) !== null && _this$props$featureFl6 !== void 0 && _this$props$featureFl6.toolbarMinWidthOverflow) : this.props.UNSAFE_allowUndoRedoButtons,
453
492
  useStickyToolbar: this.props.useStickyToolbar,
454
493
  featureFlags: featureFlags
455
494
  }));
@@ -26,7 +26,8 @@ export function useCXHTMLPreset({
26
26
  }
27
27
  }]);
28
28
  preset.add([panelPlugin, {
29
- UNSAFE_allowCustomPanel: true
29
+ UNSAFE_allowCustomPanel: true,
30
+ UNSAFE_allowCustomPanelEdit: true
30
31
  }]);
31
32
  preset.add(listPlugin);
32
33
  preset.add(textColorPlugin);
@@ -94,6 +94,7 @@ export let ACTION;
94
94
  ACTION["ON_EDITOR_READY_CALLBACK"] = "onEditorReadyCallback";
95
95
  ACTION["ON_CHANGE_CALLBACK"] = "onChangeCalled";
96
96
  ACTION["REMOVE_ICON"] = "removedIcon";
97
+ ACTION["UFO_SESSION_COMPLETE"] = "ufoSessionComplete";
97
98
  })(ACTION || (ACTION = {}));
98
99
 
99
100
  export let INPUT_METHOD;
@@ -234,8 +235,9 @@ export let ACTION_SUBJECT_ID;
234
235
  ACTION_SUBJECT_ID["LINK"] = "link";
235
236
  ACTION_SUBJECT_ID["LINK_PREVIEW"] = "linkPreview";
236
237
  ACTION_SUBJECT_ID["MEDIA"] = "media";
237
- ACTION_SUBJECT_ID["MEDIA_SINGLE"] = "mediaSingle";
238
238
  ACTION_SUBJECT_ID["MEDIA_GROUP"] = "mediaGroup";
239
+ ACTION_SUBJECT_ID["MEDIA_INLINE"] = "mediaInline";
240
+ ACTION_SUBJECT_ID["MEDIA_SINGLE"] = "mediaSingle";
239
241
  ACTION_SUBJECT_ID["MEDIA_LINK"] = "mediaLink";
240
242
  ACTION_SUBJECT_ID["MENTION"] = "mention";
241
243
  ACTION_SUBJECT_ID["NESTED_EXPAND"] = "nestedExpand";
@@ -43,10 +43,11 @@ const basePlugin = options => ({
43
43
  }, {
44
44
  name: 'frozenEditor',
45
45
  plugin: ({
46
- dispatchAnalyticsEvent,
47
- providerFactory
46
+ dispatchAnalyticsEvent
48
47
  }) => {
49
- return options && options.inputTracking && options.inputTracking.enabled ? frozenEditor(dispatchAnalyticsEvent, options.inputTracking, options.browserFreezeTracking) : undefined;
48
+ var _options$inputTrackin;
49
+
50
+ return options !== null && options !== void 0 && (_options$inputTrackin = options.inputTracking) !== null && _options$inputTrackin !== void 0 && _options$inputTrackin.enabled || options !== null && options !== void 0 && options.ufo ? frozenEditor(dispatchAnalyticsEvent, options.inputTracking, options.browserFreezeTracking, options.ufo) : undefined;
50
51
  }
51
52
  }, {
52
53
  name: 'decorationPlugin',
@@ -1,11 +1,13 @@
1
- import { Plugin } from 'prosemirror-state';
1
+ import { Plugin, PluginKey } from 'prosemirror-state';
2
2
  import { isPerformanceObserverAvailable, isPerformanceAPIAvailable, getAnalyticsEventSeverity } from '@atlaskit/editor-common';
3
+ import { EditorExperience, ExperienceStore } from '@atlaskit/editor-common/ufo';
3
4
  import { ACTION, ACTION_SUBJECT, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE } from '../../analytics';
4
5
  import { getParticipantsCount } from '../../collab-edit/get-participants-count';
5
6
  import { countNodes } from '../../../utils/count-nodes';
6
7
  import { getContextIdentifier } from './context-identifier';
7
8
  import { setInteractionType } from '../utils/frozen-editor';
8
9
  import { getTimeSince } from '../../../utils/performance/get-performance-timing';
10
+ export const frozenEditorPluginKey = new PluginKey('frozenEditor');
9
11
  const DEFAULT_KEYSTROKE_SAMPLING_LIMIT = 100;
10
12
  const DEFAULT_SLOW_THRESHOLD = 300;
11
13
  export const DEFAULT_FREEZE_THRESHOLD = 600;
@@ -38,7 +40,7 @@ const dispatchLongTaskEvent = (dispatchAnalyticsEvent, view, time, allowCountNod
38
40
  });
39
41
  };
40
42
 
41
- export default ((dispatchAnalyticsEvent, inputTracking, browserFreezeTracking) => {
43
+ export default ((dispatchAnalyticsEvent, inputTracking, browserFreezeTracking, ufo) => {
42
44
  let keystrokeCount = 0;
43
45
  let interactionType;
44
46
 
@@ -54,6 +56,7 @@ export default ((dispatchAnalyticsEvent, inputTracking, browserFreezeTracking) =
54
56
  const severityThresholdNormal = (inputTracking === null || inputTracking === void 0 ? void 0 : inputTracking.severityNormalThreshold) || DEFAULT_TRACK_SEVERITY_THRESHOLD_NORMAL;
55
57
  const severityThresholdDegraded = (inputTracking === null || inputTracking === void 0 ? void 0 : inputTracking.severityDegradedThreshold) || DEFAULT_TRACK_SEVERITY_THRESHOLD_DEGRADED;
56
58
  return new Plugin({
59
+ key: frozenEditorPluginKey,
57
60
  props: isPerformanceAPIAvailable() ? {
58
61
  handleTextInput(view) {
59
62
  const {
@@ -65,49 +68,74 @@ export default ((dispatchAnalyticsEvent, inputTracking, browserFreezeTracking) =
65
68
  interactionType = BROWSER_FREEZE_INTERACTION_TYPE.TYPING;
66
69
  }
67
70
 
71
+ const experienceStore = ufo ? ExperienceStore.getInstance(view) : undefined;
72
+ const trackTyping = samplingRate && ++keystrokeCount === samplingRate;
73
+
74
+ if (trackTyping) {
75
+ experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.start(EditorExperience.typing);
76
+ }
77
+
68
78
  requestAnimationFrame(() => {
69
79
  const diff = getTimeSince(now);
70
80
 
71
- if (samplingRate && ++keystrokeCount === samplingRate) {
72
- var _getContextIdentifier2;
73
-
81
+ if (diff > slowThreshold) {
74
82
  const nodesCount = allowCountNodes ? countNodes(view.state) : {};
75
- keystrokeCount = 0;
76
- const payload = {
77
- action: ACTION.INPUT_PERF_SAMPLING,
78
- actionSubject: ACTION_SUBJECT.EDITOR,
79
- attributes: {
80
- time: diff,
81
- nodeSize: state.doc.nodeSize,
82
- ...nodesCount,
83
- participants: getParticipantsCount(state),
84
- objectId: (_getContextIdentifier2 = getContextIdentifier(state)) === null || _getContextIdentifier2 === void 0 ? void 0 : _getContextIdentifier2.objectId
85
- },
86
- eventType: EVENT_TYPE.OPERATIONAL
87
- };
88
-
89
- if (shouldTrackSeverity) {
90
- payload.attributes.severity = getAnalyticsEventSeverity(diff, severityThresholdNormal, severityThresholdDegraded);
83
+
84
+ if (inputTracking !== null && inputTracking !== void 0 && inputTracking.enabled) {
85
+ var _getContextIdentifier2;
86
+
87
+ dispatchAnalyticsEvent({
88
+ action: ACTION.SLOW_INPUT,
89
+ actionSubject: ACTION_SUBJECT.EDITOR,
90
+ attributes: {
91
+ time: diff,
92
+ nodeSize: state.doc.nodeSize,
93
+ ...nodesCount,
94
+ participants: getParticipantsCount(state),
95
+ objectId: (_getContextIdentifier2 = getContextIdentifier(state)) === null || _getContextIdentifier2 === void 0 ? void 0 : _getContextIdentifier2.objectId
96
+ },
97
+ eventType: EVENT_TYPE.OPERATIONAL
98
+ });
91
99
  }
92
100
 
93
- dispatchAnalyticsEvent(payload);
101
+ experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.addMetadata(EditorExperience.typing, {
102
+ slowInput: true
103
+ });
94
104
  }
95
105
 
96
- if (diff > slowThreshold) {
97
- var _getContextIdentifier3;
106
+ if (trackTyping) {
107
+ var _getContextIdentifier4;
98
108
 
99
109
  const nodesCount = allowCountNodes ? countNodes(view.state) : {};
100
- dispatchAnalyticsEvent({
101
- action: ACTION.SLOW_INPUT,
102
- actionSubject: ACTION_SUBJECT.EDITOR,
103
- attributes: {
104
- time: diff,
105
- nodeSize: state.doc.nodeSize,
106
- ...nodesCount,
107
- participants: getParticipantsCount(state),
108
- objectId: (_getContextIdentifier3 = getContextIdentifier(state)) === null || _getContextIdentifier3 === void 0 ? void 0 : _getContextIdentifier3.objectId
109
- },
110
- eventType: EVENT_TYPE.OPERATIONAL
110
+ keystrokeCount = 0;
111
+ const severity = shouldTrackSeverity ? getAnalyticsEventSeverity(diff, severityThresholdNormal, severityThresholdDegraded) : undefined;
112
+
113
+ if (inputTracking !== null && inputTracking !== void 0 && inputTracking.enabled) {
114
+ var _getContextIdentifier3;
115
+
116
+ const payload = {
117
+ action: ACTION.INPUT_PERF_SAMPLING,
118
+ actionSubject: ACTION_SUBJECT.EDITOR,
119
+ attributes: {
120
+ time: diff,
121
+ nodeSize: state.doc.nodeSize,
122
+ ...nodesCount,
123
+ participants: getParticipantsCount(state),
124
+ objectId: (_getContextIdentifier3 = getContextIdentifier(state)) === null || _getContextIdentifier3 === void 0 ? void 0 : _getContextIdentifier3.objectId,
125
+ severity
126
+ },
127
+ eventType: EVENT_TYPE.OPERATIONAL
128
+ };
129
+ dispatchAnalyticsEvent(payload);
130
+ }
131
+
132
+ experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.success(EditorExperience.typing, {
133
+ nodeSize: state.doc.nodeSize,
134
+ ...nodesCount,
135
+ participants: getParticipantsCount(state),
136
+ objectId: (_getContextIdentifier4 = getContextIdentifier(state)) === null || _getContextIdentifier4 === void 0 ? void 0 : _getContextIdentifier4.objectId,
137
+ time: diff,
138
+ severity
111
139
  });
112
140
  }
113
141
  });
@@ -14,7 +14,8 @@ export const BlockTypeMenuItem = styled.div`
14
14
  margin-top: 0;
15
15
  }
16
16
  }
17
- ${props => props.selected ? `${props.tagName} { color: white }` : ''};
17
+ ${props => // TEMP FIX: See https://product-fabric.atlassian.net/browse/ED-13878
18
+ props.selected ? `${props.tagName} { color: white !important; }` : ''};
18
19
  `;
19
20
  export const KeyboardShortcut = styled(Shortcut)`
20
21
  ${props => props.selected ? `color: ${N400};` : ''}
@@ -28,13 +28,18 @@ const cardPlugin = options => {
28
28
  },
29
29
 
30
30
  pmPlugins() {
31
- var _options$allowResizin, _options$useAlternati;
31
+ var _options$allowBlockCa, _options$allowResizin, _options$useAlternati;
32
32
 
33
+ const allowBlockCards = (_options$allowBlockCa = options.allowBlockCards) !== null && _options$allowBlockCa !== void 0 ? _options$allowBlockCa : true;
33
34
  const allowResizing = (_options$allowResizin = options.allowResizing) !== null && _options$allowResizin !== void 0 ? _options$allowResizin : true;
34
35
  const useAlternativePreloader = (_options$useAlternati = options.useAlternativePreloader) !== null && _options$useAlternati !== void 0 ? _options$useAlternati : true;
35
36
  return [{
36
37
  name: 'card',
37
- plugin: createPlugin(options.platform, allowResizing, useAlternativePreloader, options.fullWidthMode, options.createAnalyticsEvent)
38
+ plugin: createPlugin({ ...options,
39
+ allowBlockCards,
40
+ allowResizing,
41
+ useAlternativePreloader
42
+ })
38
43
  }];
39
44
  },
40
45
 
@@ -234,6 +234,7 @@ export class EmbedCardComponent extends React.PureComponent {
234
234
  const lineLength = this.getLineLength(view, pos, widthStateLineLength);
235
235
  const containerWidth = isRichMediaInsideOfBlockNode(view, pos) ? lineLength : widthStateWidth;
236
236
  const smartCard = /*#__PURE__*/React.createElement(SmartCard, {
237
+ key: url,
237
238
  url: url,
238
239
  appearance: "embed",
239
240
  onClick: this.onClick,
@@ -8,12 +8,19 @@ import { EmbedCard } from '../nodeviews/embedCard';
8
8
  import { BlockCard } from '../nodeviews/blockCard';
9
9
  import { InlineCard } from '../nodeviews/inlineCard';
10
10
  export { pluginKey } from './plugin-key';
11
- export const createPlugin = (platform, allowResizing, useAlternativePreloader, fullWidthMode, createAnalyticsEvent) => ({
11
+ export const createPlugin = options => ({
12
12
  portalProviderAPI,
13
13
  eventDispatcher,
14
14
  providerFactory,
15
15
  dispatchAnalyticsEvent
16
16
  }) => {
17
+ const {
18
+ platform,
19
+ allowResizing,
20
+ useAlternativePreloader,
21
+ fullWidthMode,
22
+ createAnalyticsEvent
23
+ } = options;
17
24
  return new Plugin({
18
25
  state: {
19
26
  init() {
@@ -73,7 +80,7 @@ export const createPlugin = (platform, allowResizing, useAlternativePreloader, f
73
80
  * By using this approach, the browser is free to schedule the resolution of the promises below in between rendering/network/
74
81
  * other tasks as per common implementations of the JavaScript event loop in browsers.
75
82
  */
76
- const invoke = rafSchedule(() => resolveWithProvider(view, outstandingRequests, provider, request));
83
+ const invoke = rafSchedule(() => resolveWithProvider(view, outstandingRequests, provider, request, options));
77
84
  rafCancellationCallbacks.push(invoke.cancel);
78
85
  invoke();
79
86
  });
@@ -1,20 +1,27 @@
1
1
  import { setProvider } from '../actions';
2
- import { replaceQueuedUrlWithCard, handleFallbackWithAnalytics } from '../doc'; // ============================================================================ //
2
+ import { replaceQueuedUrlWithCard, handleFallbackWithAnalytics } from '../doc';
3
+ // ============================================================================ //
3
4
  // ============================== PROVIDER UTILS ============================== //
4
5
  // ============================================================================ //
5
6
  // Used for all interactions with the EditorCardProvider.
6
7
  // ============================================================================ //
7
-
8
- export const resolveWithProvider = (view, outstandingRequests, provider, request) => {
8
+ export const resolveWithProvider = (view, outstandingRequests, provider, request, options) => {
9
9
  const handleResolve = provider.resolve(request.url, request.appearance).then(resolvedCard => {
10
10
  delete outstandingRequests[request.url];
11
11
  return resolvedCard;
12
- }).then(handleResolved(view, request), handleRejected(view, request));
12
+ }).then(handleResolved(view, request, options), handleRejected(view, request));
13
13
  outstandingRequests[request.url] = handleResolve;
14
14
  return handleResolve;
15
15
  };
16
16
 
17
- const handleResolved = (view, request) => resolvedCard => {
17
+ const updateCardType = (resolvedCard, options) => {
18
+ if ((resolvedCard === null || resolvedCard === void 0 ? void 0 : resolvedCard.type) === 'blockCard' && !options.allowBlockCards || (resolvedCard === null || resolvedCard === void 0 ? void 0 : resolvedCard.type) === 'embedCard' && !options.allowEmbeds) {
19
+ resolvedCard.type = 'inlineCard';
20
+ }
21
+ };
22
+
23
+ const handleResolved = (view, request, options) => resolvedCard => {
24
+ updateCardType(resolvedCard, options);
18
25
  replaceQueuedUrlWithCard(request.url, resolvedCard, request.analyticsAction)(view.state, view.dispatch);
19
26
  return resolvedCard;
20
27
  };
@@ -41,7 +41,7 @@ export const getToolbarConfig = (allowCopyToClipboard = false) => (state, {
41
41
  alias: lang.alias
42
42
  })); // If language is not undefined search for it in the value and then search in the aliases
43
43
 
44
- const defaultValue = language ? options.find(option => option.value === language) || options.find(option => option.alias.includes(language)) : undefined;
44
+ const defaultValue = language ? options.find(option => option.value === language) || options.find(option => option.alias.includes(language)) : null;
45
45
  const languageSelect = {
46
46
  id: 'editor.codeBlock.languageOptions',
47
47
  type: 'select',
@@ -5,6 +5,8 @@ import { EmojiSharedCssClassName } from '@atlaskit/editor-common';
5
5
  import { SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
6
6
  export const emojiStyles = css`
7
7
  .${EmojiSharedCssClassName.EMOJI_CONTAINER} {
8
+ display: inline-block;
9
+
8
10
  .${EmojiSharedCssClassName.EMOJI_NODE} {
9
11
  cursor: pointer;
10
12
 
@@ -97,7 +97,6 @@ export const createContextIdentifierProviderHandler = view => async (name, provi
97
97
 
98
98
  const createPlugin = (dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher, useLongPressSelection = false, options = {}) => {
99
99
  const state = createPluginState(dispatch, {
100
- layout: 'default',
101
100
  showEditButton: false,
102
101
  showContextPanel: false
103
102
  });
@@ -155,14 +154,12 @@ const createPlugin = (dispatch, providerFactory, extensionHandlers, portalProvid
155
154
  const showEditButton = shouldShowEditButton(extensionHandler, extensionProvider);
156
155
  const updateExtension = getUpdateExtensionPromise(view, extensionHandler, extensionProvider).catch(() => {// do nothing;
157
156
  });
158
- const layout = selectedExtension ? node.attrs.layout : 'default';
159
157
  updateState({
160
158
  localId: node.attrs.localId,
161
159
  showContextPanel: false,
162
160
  element: newElement,
163
161
  showEditButton,
164
- updateExtension,
165
- layout
162
+ updateExtension
166
163
  })(state, dispatch);
167
164
  } // New DOM element doesn't necessarily mean it's a new Node
168
165
  else if (element !== newElement) {