@atlaskit/editor-core 179.1.2 → 180.1.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 (457) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/codemods/180.1.0-update-to-editor-migration-component.ts +8 -0
  3. package/codemods/__tests__/rename-editor-to-editor-migration-component.ts +156 -0
  4. package/codemods/migrates/rename-editor-to-editor-migration-component.ts +34 -0
  5. package/dist/cjs/actions/index.js +1 -1
  6. package/dist/cjs/create-editor/ReactEditorView.js +12 -762
  7. package/dist/cjs/create-editor/ReactEditorViewInternal.js +783 -0
  8. package/dist/cjs/create-editor/ReactEditorViewNext.js +16 -0
  9. package/dist/cjs/create-editor/create-plugins-list.js +1 -0
  10. package/dist/cjs/create-editor/feature-flags-from-props.js +3 -2
  11. package/dist/cjs/editor-next/editor-internal.js +147 -0
  12. package/dist/cjs/editor-next/editor-migration-component.js +35 -0
  13. package/dist/cjs/editor-next/hooks/useEditorMeasuresConstructor.js +36 -0
  14. package/dist/cjs/editor-next/hooks/useMeasureEditorMountTime.js +42 -0
  15. package/dist/cjs/editor-next/hooks/useProviderFactory.js +72 -0
  16. package/dist/cjs/editor-next/index.js +139 -0
  17. package/dist/cjs/editor-next/utils/deprecationWarnings.js +45 -0
  18. package/dist/cjs/editor-next/utils/editorMeasureTTICallback.js +44 -0
  19. package/dist/cjs/editor-next/utils/editorPropTypes.js +36 -0
  20. package/dist/cjs/editor-next/utils/getBaseFontSize.js +17 -0
  21. package/dist/cjs/editor-next/utils/handleProviders.js +56 -0
  22. package/dist/cjs/editor-next/utils/onEditorCreated.js +28 -0
  23. package/dist/cjs/editor-next/utils/sendDurationAnalytics.js +68 -0
  24. package/dist/cjs/editor-next/utils/trackEditorActions.js +101 -0
  25. package/dist/cjs/editor.js +130 -443
  26. package/dist/cjs/index.js +7 -0
  27. package/dist/cjs/labs/next/internal/hooks/use-analytics/index.js +4 -4
  28. package/dist/cjs/labs/next/internal/hooks/use-editor/create-dispatch-transaction.js +6 -6
  29. package/dist/cjs/labs/next/presets/create-stub-internal-apis.js +117 -0
  30. package/dist/cjs/labs/next/presets/preset.js +0 -5
  31. package/dist/cjs/labs/next/presets/universal.js +11 -2
  32. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +48 -13
  33. package/dist/cjs/plugins/analytics/index.js +2 -3
  34. package/dist/cjs/plugins/analytics/plugin.js +5 -6
  35. package/dist/cjs/plugins/analytics/utils.js +0 -11
  36. package/dist/cjs/plugins/base/pm-plugins/filter-steps.js +1 -1
  37. package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +98 -56
  38. package/dist/cjs/plugins/base/utils/input-latency-tracking.js +24 -25
  39. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -0
  40. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +36 -9
  41. package/dist/cjs/plugins/card/nodeviews/blockCard.js +2 -1
  42. package/dist/cjs/plugins/card/nodeviews/genericCard.js +16 -2
  43. package/dist/cjs/plugins/card/pm-plugins/main.js +4 -2
  44. package/dist/cjs/plugins/clipboard/pm-plugins/main.js +4 -1
  45. package/dist/cjs/plugins/collab-edit/plugin.js +2 -3
  46. package/dist/cjs/plugins/extension/toolbar.js +7 -1
  47. package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +5 -1
  48. package/dist/cjs/plugins/floating-toolbar/ui/Button.js +2 -0
  49. package/dist/cjs/plugins/floating-toolbar/ui/CheckboxModal.js +5 -3
  50. package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +38 -9
  51. package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +23 -21
  52. package/dist/cjs/plugins/floating-toolbar/ui/ScrollButtons.js +12 -7
  53. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +11 -0
  54. package/dist/cjs/plugins/fragment/pm-plugins/fragment-consistency.js +1 -0
  55. package/dist/cjs/plugins/hyperlink/analytics.js +5 -5
  56. package/dist/cjs/plugins/hyperlink/index.js +1 -1
  57. package/dist/cjs/plugins/hyperlink/pm-plugins/main.js +9 -5
  58. package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +10 -4
  59. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
  60. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +4 -3
  61. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -0
  62. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -0
  63. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +3 -0
  64. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +1 -0
  65. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +22 -0
  66. package/dist/cjs/plugins/media/commands/helpers.js +12 -40
  67. package/dist/cjs/plugins/media/commands/index.js +4 -4
  68. package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +14 -12
  69. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +1 -1
  70. package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +310 -205
  71. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +1 -1
  72. package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
  73. package/dist/cjs/plugins/media/pm-plugins/main.js +2 -27
  74. package/dist/cjs/plugins/media/toolbar/filePreviewItem.js +1 -4
  75. package/dist/cjs/plugins/panel/utils.js +4 -1
  76. package/dist/cjs/plugins/paste/handlers.js +128 -13
  77. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +15 -6
  78. package/dist/cjs/plugins/paste/pm-plugins/main.js +12 -3
  79. package/dist/cjs/plugins/placeholder-text/index.js +2 -2
  80. package/dist/cjs/plugins/status/index.js +9 -3
  81. package/dist/cjs/plugins/status/ui/statusPicker.js +8 -2
  82. package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +42 -8
  83. package/dist/cjs/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +22 -2
  84. package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +3 -1
  85. package/dist/cjs/plugins/text-formatting/ui/Toolbar/more-button.js +3 -1
  86. package/dist/cjs/plugins/text-formatting/utils.js +1 -10
  87. package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +19 -1
  88. package/dist/cjs/plugins/type-ahead/index.js +1 -1
  89. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +79 -106
  90. package/dist/cjs/types/get-editor-props.js +5 -0
  91. package/dist/cjs/ui/ChromeCollapsed/index.js +1 -0
  92. package/dist/cjs/ui/CollapsedEditor/index.js +7 -13
  93. package/dist/cjs/ui/ColorPickerButton/index.js +68 -6
  94. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +1 -1
  95. package/dist/cjs/ui/ContextPanel/context.js +13 -12
  96. package/dist/cjs/ui/Dropdown/index.js +7 -2
  97. package/dist/cjs/ui/DropdownMenu/index.js +7 -2
  98. package/dist/cjs/ui/ElementBrowser/components/CategoryList.js +1 -1
  99. package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +1 -1
  100. package/dist/cjs/ui/ElementBrowser/components/StatelessElementBrowser.js +1 -1
  101. package/dist/cjs/ui/PanelTextInput/index.js +4 -4
  102. package/dist/cjs/ui/PortalProvider/index.js +5 -5
  103. package/dist/cjs/ui/WidthEmitter/index.js +29 -35
  104. package/dist/cjs/utils/document.js +15 -0
  105. package/dist/cjs/utils/extensions.js +6 -7
  106. package/dist/cjs/utils/get-editor-plugins.js +32 -0
  107. package/dist/cjs/utils/linking-utils.js +1 -1
  108. package/dist/cjs/utils/performance/components/RenderTracking.js +1 -1
  109. package/dist/cjs/utils/performance/safer-transactions.js +1 -1
  110. package/dist/cjs/utils/prepare-extension-provider.js +25 -0
  111. package/dist/cjs/version-wrapper.js +1 -1
  112. package/dist/cjs/version.json +1 -1
  113. package/dist/es2019/actions/index.js +2 -2
  114. package/dist/es2019/create-editor/ReactEditorView.js +6 -708
  115. package/dist/es2019/create-editor/ReactEditorViewInternal.js +712 -0
  116. package/dist/es2019/create-editor/ReactEditorViewNext.js +7 -0
  117. package/dist/es2019/create-editor/create-plugins-list.js +1 -0
  118. package/dist/es2019/create-editor/feature-flags-from-props.js +3 -2
  119. package/dist/es2019/editor-next/editor-internal.js +142 -0
  120. package/dist/es2019/editor-next/editor-migration-component.js +10 -0
  121. package/dist/es2019/editor-next/hooks/useEditorMeasuresConstructor.js +30 -0
  122. package/dist/es2019/editor-next/hooks/useMeasureEditorMountTime.js +35 -0
  123. package/dist/es2019/editor-next/hooks/useProviderFactory.js +61 -0
  124. package/dist/es2019/editor-next/index.js +90 -0
  125. package/dist/es2019/editor-next/utils/deprecationWarnings.js +39 -0
  126. package/dist/es2019/editor-next/utils/editorMeasureTTICallback.js +40 -0
  127. package/dist/es2019/editor-next/utils/editorPropTypes.js +29 -0
  128. package/dist/es2019/editor-next/utils/getBaseFontSize.js +11 -0
  129. package/dist/es2019/editor-next/utils/handleProviders.js +52 -0
  130. package/dist/es2019/editor-next/utils/onEditorCreated.js +21 -0
  131. package/dist/es2019/editor-next/utils/sendDurationAnalytics.js +40 -0
  132. package/dist/es2019/editor-next/utils/trackEditorActions.js +78 -0
  133. package/dist/es2019/editor.js +111 -396
  134. package/dist/es2019/index.js +2 -1
  135. package/dist/es2019/labs/next/internal/hooks/use-analytics/index.js +2 -2
  136. package/dist/es2019/labs/next/internal/hooks/use-editor/create-dispatch-transaction.js +2 -3
  137. package/dist/es2019/labs/next/presets/create-stub-internal-apis.js +105 -0
  138. package/dist/es2019/labs/next/presets/preset.js +0 -3
  139. package/dist/es2019/labs/next/presets/universal.js +13 -2
  140. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +41 -12
  141. package/dist/es2019/plugins/analytics/index.js +3 -4
  142. package/dist/es2019/plugins/analytics/plugin.js +1 -2
  143. package/dist/es2019/plugins/analytics/utils.js +0 -4
  144. package/dist/es2019/plugins/base/pm-plugins/filter-steps.js +1 -1
  145. package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +96 -58
  146. package/dist/es2019/plugins/base/utils/input-latency-tracking.js +23 -23
  147. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -0
  148. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +31 -5
  149. package/dist/es2019/plugins/card/nodeviews/blockCard.js +4 -1
  150. package/dist/es2019/plugins/card/nodeviews/genericCard.js +16 -2
  151. package/dist/es2019/plugins/card/pm-plugins/main.js +3 -1
  152. package/dist/es2019/plugins/clipboard/pm-plugins/main.js +3 -1
  153. package/dist/es2019/plugins/collab-edit/plugin.js +1 -2
  154. package/dist/es2019/plugins/extension/toolbar.js +7 -1
  155. package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +5 -1
  156. package/dist/es2019/plugins/floating-toolbar/ui/Button.js +2 -0
  157. package/dist/es2019/plugins/floating-toolbar/ui/CheckboxModal.js +5 -3
  158. package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +35 -7
  159. package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +2 -2
  160. package/dist/es2019/plugins/floating-toolbar/ui/ScrollButtons.js +12 -7
  161. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +11 -0
  162. package/dist/es2019/plugins/fragment/pm-plugins/fragment-consistency.js +1 -0
  163. package/dist/es2019/plugins/hyperlink/analytics.js +1 -1
  164. package/dist/es2019/plugins/hyperlink/index.js +1 -1
  165. package/dist/es2019/plugins/hyperlink/pm-plugins/main.js +8 -4
  166. package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +9 -3
  167. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
  168. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -2
  169. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -0
  170. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -0
  171. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +3 -0
  172. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +1 -0
  173. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +24 -0
  174. package/dist/es2019/plugins/media/commands/helpers.js +9 -35
  175. package/dist/es2019/plugins/media/commands/index.js +1 -1
  176. package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +3 -3
  177. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +1 -1
  178. package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +70 -37
  179. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +1 -1
  180. package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
  181. package/dist/es2019/plugins/media/pm-plugins/main.js +3 -30
  182. package/dist/es2019/plugins/media/toolbar/filePreviewItem.js +1 -4
  183. package/dist/es2019/plugins/panel/utils.js +4 -1
  184. package/dist/es2019/plugins/paste/handlers.js +127 -5
  185. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +10 -4
  186. package/dist/es2019/plugins/paste/pm-plugins/main.js +13 -4
  187. package/dist/es2019/plugins/placeholder-text/index.js +1 -1
  188. package/dist/es2019/plugins/status/index.js +8 -2
  189. package/dist/es2019/plugins/status/ui/statusPicker.js +8 -2
  190. package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +42 -8
  191. package/dist/es2019/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +20 -3
  192. package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +4 -2
  193. package/dist/es2019/plugins/text-formatting/ui/Toolbar/more-button.js +3 -1
  194. package/dist/es2019/plugins/text-formatting/utils.js +0 -8
  195. package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +16 -1
  196. package/dist/es2019/plugins/type-ahead/index.js +1 -1
  197. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +73 -92
  198. package/dist/es2019/types/get-editor-props.js +1 -0
  199. package/dist/es2019/ui/ChromeCollapsed/index.js +1 -0
  200. package/dist/es2019/ui/CollapsedEditor/index.js +7 -11
  201. package/dist/es2019/ui/ColorPickerButton/index.js +61 -8
  202. package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +1 -1
  203. package/dist/es2019/ui/ContextPanel/context.js +5 -4
  204. package/dist/es2019/ui/Dropdown/index.js +5 -2
  205. package/dist/es2019/ui/DropdownMenu/index.js +5 -2
  206. package/dist/es2019/ui/ElementBrowser/components/CategoryList.js +1 -1
  207. package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +1 -1
  208. package/dist/es2019/ui/ElementBrowser/components/StatelessElementBrowser.js +1 -1
  209. package/dist/es2019/ui/PanelTextInput/index.js +3 -3
  210. package/dist/es2019/ui/PortalProvider/index.js +1 -1
  211. package/dist/es2019/ui/WidthEmitter/index.js +25 -29
  212. package/dist/es2019/utils/document.js +11 -1
  213. package/dist/es2019/utils/extensions.js +1 -3
  214. package/dist/es2019/utils/get-editor-plugins.js +25 -0
  215. package/dist/es2019/utils/linking-utils.js +1 -1
  216. package/dist/es2019/utils/performance/components/RenderTracking.js +1 -1
  217. package/dist/es2019/utils/performance/safer-transactions.js +1 -1
  218. package/dist/es2019/utils/prepare-extension-provider.js +13 -0
  219. package/dist/es2019/version-wrapper.js +1 -1
  220. package/dist/es2019/version.json +1 -1
  221. package/dist/esm/actions/index.js +2 -2
  222. package/dist/esm/create-editor/ReactEditorView.js +12 -763
  223. package/dist/esm/create-editor/ReactEditorViewInternal.js +776 -0
  224. package/dist/esm/create-editor/ReactEditorViewNext.js +7 -0
  225. package/dist/esm/create-editor/create-plugins-list.js +1 -0
  226. package/dist/esm/create-editor/feature-flags-from-props.js +3 -2
  227. package/dist/esm/editor-next/editor-internal.js +141 -0
  228. package/dist/esm/editor-next/editor-migration-component.js +28 -0
  229. package/dist/esm/editor-next/hooks/useEditorMeasuresConstructor.js +30 -0
  230. package/dist/esm/editor-next/hooks/useMeasureEditorMountTime.js +35 -0
  231. package/dist/esm/editor-next/hooks/useProviderFactory.js +65 -0
  232. package/dist/esm/editor-next/index.js +134 -0
  233. package/dist/esm/editor-next/utils/deprecationWarnings.js +39 -0
  234. package/dist/esm/editor-next/utils/editorMeasureTTICallback.js +38 -0
  235. package/dist/esm/editor-next/utils/editorPropTypes.js +28 -0
  236. package/dist/esm/editor-next/utils/getBaseFontSize.js +11 -0
  237. package/dist/esm/editor-next/utils/handleProviders.js +50 -0
  238. package/dist/esm/editor-next/utils/onEditorCreated.js +21 -0
  239. package/dist/esm/editor-next/utils/sendDurationAnalytics.js +61 -0
  240. package/dist/esm/editor-next/utils/trackEditorActions.js +94 -0
  241. package/dist/esm/editor.js +130 -440
  242. package/dist/esm/index.js +2 -1
  243. package/dist/esm/labs/next/internal/hooks/use-analytics/index.js +2 -2
  244. package/dist/esm/labs/next/internal/hooks/use-editor/create-dispatch-transaction.js +2 -3
  245. package/dist/esm/labs/next/presets/create-stub-internal-apis.js +110 -0
  246. package/dist/esm/labs/next/presets/preset.js +0 -5
  247. package/dist/esm/labs/next/presets/universal.js +11 -2
  248. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +48 -13
  249. package/dist/esm/plugins/analytics/index.js +3 -4
  250. package/dist/esm/plugins/analytics/plugin.js +1 -2
  251. package/dist/esm/plugins/analytics/utils.js +0 -9
  252. package/dist/esm/plugins/base/pm-plugins/filter-steps.js +1 -1
  253. package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +98 -56
  254. package/dist/esm/plugins/base/utils/input-latency-tracking.js +24 -25
  255. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -0
  256. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +36 -9
  257. package/dist/esm/plugins/card/nodeviews/blockCard.js +2 -1
  258. package/dist/esm/plugins/card/nodeviews/genericCard.js +16 -2
  259. package/dist/esm/plugins/card/pm-plugins/main.js +4 -2
  260. package/dist/esm/plugins/clipboard/pm-plugins/main.js +4 -1
  261. package/dist/esm/plugins/collab-edit/plugin.js +1 -2
  262. package/dist/esm/plugins/extension/toolbar.js +7 -1
  263. package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +5 -1
  264. package/dist/esm/plugins/floating-toolbar/ui/Button.js +2 -0
  265. package/dist/esm/plugins/floating-toolbar/ui/CheckboxModal.js +5 -3
  266. package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +38 -9
  267. package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +23 -21
  268. package/dist/esm/plugins/floating-toolbar/ui/ScrollButtons.js +12 -7
  269. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +11 -0
  270. package/dist/esm/plugins/fragment/pm-plugins/fragment-consistency.js +1 -0
  271. package/dist/esm/plugins/hyperlink/analytics.js +1 -1
  272. package/dist/esm/plugins/hyperlink/index.js +1 -1
  273. package/dist/esm/plugins/hyperlink/pm-plugins/main.js +9 -5
  274. package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +10 -4
  275. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
  276. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -2
  277. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -0
  278. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -0
  279. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +3 -0
  280. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +1 -0
  281. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +22 -0
  282. package/dist/esm/plugins/media/commands/helpers.js +9 -35
  283. package/dist/esm/plugins/media/commands/index.js +1 -1
  284. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +14 -12
  285. package/dist/esm/plugins/media/nodeviews/mediaInline.js +1 -1
  286. package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +311 -206
  287. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
  288. package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
  289. package/dist/esm/plugins/media/pm-plugins/main.js +3 -28
  290. package/dist/esm/plugins/media/toolbar/filePreviewItem.js +1 -4
  291. package/dist/esm/plugins/panel/utils.js +4 -1
  292. package/dist/esm/plugins/paste/handlers.js +127 -13
  293. package/dist/esm/plugins/paste/pm-plugins/analytics.js +13 -5
  294. package/dist/esm/plugins/paste/pm-plugins/main.js +13 -4
  295. package/dist/esm/plugins/placeholder-text/index.js +2 -2
  296. package/dist/esm/plugins/status/index.js +9 -3
  297. package/dist/esm/plugins/status/ui/statusPicker.js +8 -2
  298. package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +42 -8
  299. package/dist/esm/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +23 -3
  300. package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +4 -2
  301. package/dist/esm/plugins/text-formatting/ui/Toolbar/more-button.js +3 -1
  302. package/dist/esm/plugins/text-formatting/utils.js +0 -8
  303. package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +19 -1
  304. package/dist/esm/plugins/type-ahead/index.js +1 -1
  305. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +79 -106
  306. package/dist/esm/types/get-editor-props.js +1 -0
  307. package/dist/esm/ui/ChromeCollapsed/index.js +1 -0
  308. package/dist/esm/ui/CollapsedEditor/index.js +7 -13
  309. package/dist/esm/ui/ColorPickerButton/index.js +69 -7
  310. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +1 -1
  311. package/dist/esm/ui/ContextPanel/context.js +8 -8
  312. package/dist/esm/ui/Dropdown/index.js +7 -2
  313. package/dist/esm/ui/DropdownMenu/index.js +7 -2
  314. package/dist/esm/ui/ElementBrowser/components/CategoryList.js +1 -1
  315. package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +1 -1
  316. package/dist/esm/ui/ElementBrowser/components/StatelessElementBrowser.js +1 -1
  317. package/dist/esm/ui/PanelTextInput/index.js +4 -4
  318. package/dist/esm/ui/PortalProvider/index.js +1 -1
  319. package/dist/esm/ui/WidthEmitter/index.js +28 -37
  320. package/dist/esm/utils/document.js +15 -1
  321. package/dist/esm/utils/extensions.js +1 -3
  322. package/dist/esm/utils/get-editor-plugins.js +25 -0
  323. package/dist/esm/utils/linking-utils.js +1 -1
  324. package/dist/esm/utils/performance/components/RenderTracking.js +1 -1
  325. package/dist/esm/utils/performance/safer-transactions.js +1 -1
  326. package/dist/esm/utils/prepare-extension-provider.js +17 -0
  327. package/dist/esm/version-wrapper.js +1 -1
  328. package/dist/esm/version.json +1 -1
  329. package/dist/types/actions/index.d.ts +2 -2
  330. package/dist/types/create-editor/ReactEditorView.d.ts +7 -109
  331. package/dist/types/create-editor/ReactEditorViewInternal.d.ts +112 -0
  332. package/dist/types/create-editor/ReactEditorViewNext.d.ts +9 -0
  333. package/dist/types/editor-next/editor-internal.d.ts +44 -0
  334. package/dist/types/editor-next/editor-migration-component.d.ts +5 -0
  335. package/dist/types/editor-next/hooks/useEditorMeasuresConstructor.d.ts +17 -0
  336. package/dist/types/editor-next/hooks/useMeasureEditorMountTime.d.ts +13 -0
  337. package/dist/types/editor-next/hooks/useProviderFactory.d.ts +21 -0
  338. package/dist/types/editor-next/index.d.ts +34 -0
  339. package/dist/types/editor-next/utils/deprecationWarnings.d.ts +2 -0
  340. package/dist/types/editor-next/utils/editorMeasureTTICallback.d.ts +5 -0
  341. package/dist/types/editor-next/utils/editorPropTypes.d.ts +19 -0
  342. package/dist/types/editor-next/utils/getBaseFontSize.d.ts +6 -0
  343. package/dist/types/editor-next/utils/handleProviders.d.ts +14 -0
  344. package/dist/types/editor-next/utils/onEditorCreated.d.ts +12 -0
  345. package/dist/types/editor-next/utils/sendDurationAnalytics.d.ts +15 -0
  346. package/dist/types/editor-next/utils/trackEditorActions.d.ts +29 -0
  347. package/dist/types/editor.d.ts +47 -25
  348. package/dist/types/index.d.ts +1 -0
  349. package/dist/types/labs/next/internal/hooks/use-analytics/index.d.ts +1 -1
  350. package/dist/types/labs/next/presets/create-stub-internal-apis.d.ts +16 -0
  351. package/dist/types/labs/next/presets/preset.d.ts +6 -6
  352. package/dist/types/labs/next/presets/universal.d.ts +1 -1
  353. package/dist/types/plugins/alignment/index.d.ts +1 -1
  354. package/dist/types/plugins/alignment/ui/ToolbarAlignment/index.d.ts +3 -1
  355. package/dist/types/plugins/analytics/index.d.ts +3 -6
  356. package/dist/types/plugins/analytics/plugin.d.ts +3 -1
  357. package/dist/types/plugins/analytics/utils.d.ts +2 -3
  358. package/dist/types/plugins/annotation/index.d.ts +3 -1
  359. package/dist/types/plugins/avatar-group/index.d.ts +3 -1
  360. package/dist/types/plugins/base/index.d.ts +3 -1
  361. package/dist/types/plugins/base/pm-plugins/filter-steps.d.ts +1 -1
  362. package/dist/types/plugins/base/utils/input-latency-tracking.d.ts +1 -3
  363. package/dist/types/plugins/before-primaryToolbar/index.d.ts +3 -1
  364. package/dist/types/plugins/block-type/index.d.ts +3 -1
  365. package/dist/types/plugins/block-type/ui/ToolbarBlockType/blocktype-button.d.ts +1 -0
  366. package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -0
  367. package/dist/types/plugins/breakout/index.d.ts +3 -1
  368. package/dist/types/plugins/card/index.d.ts +3 -1
  369. package/dist/types/plugins/card/nodeviews/genericCard.d.ts +1 -1
  370. package/dist/types/plugins/card/pm-plugins/util/state.d.ts +1 -0
  371. package/dist/types/plugins/card/types.d.ts +3 -0
  372. package/dist/types/plugins/code-bidi-warning/index.d.ts +3 -1
  373. package/dist/types/plugins/code-block/index.d.ts +3 -1
  374. package/dist/types/plugins/collab-edit/index.d.ts +3 -1
  375. package/dist/types/plugins/context-panel/index.d.ts +1 -1
  376. package/dist/types/plugins/emoji/index.d.ts +3 -1
  377. package/dist/types/plugins/expand/index.d.ts +3 -1
  378. package/dist/types/plugins/extension/index.d.ts +3 -1
  379. package/dist/types/plugins/extension/toolbar.d.ts +5 -0
  380. package/dist/types/plugins/feature-flags-context/index.d.ts +3 -1
  381. package/dist/types/plugins/feedback-dialog/index.d.ts +3 -1
  382. package/dist/types/plugins/find-replace/index.d.ts +3 -1
  383. package/dist/types/plugins/floating-toolbar/ui/Button.d.ts +2 -1
  384. package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +5 -2
  385. package/dist/types/plugins/grid/index.d.ts +3 -1
  386. package/dist/types/plugins/help-dialog/index.d.ts +3 -1
  387. package/dist/types/plugins/hyperlink/analytics.d.ts +1 -1
  388. package/dist/types/plugins/hyperlink/index.d.ts +3 -1
  389. package/dist/types/plugins/hyperlink/pm-plugins/main.d.ts +4 -2
  390. package/dist/types/plugins/hyperlink/types.d.ts +3 -1
  391. package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +3 -1
  392. package/dist/types/plugins/insert-block/index.d.ts +3 -1
  393. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +1 -0
  394. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +1 -0
  395. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +1 -0
  396. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -0
  397. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/index.d.ts +1 -0
  398. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +1 -0
  399. package/dist/types/plugins/layout/index.d.ts +3 -1
  400. package/dist/types/plugins/list/index.d.ts +3 -1
  401. package/dist/types/plugins/max-content-size/index.d.ts +3 -1
  402. package/dist/types/plugins/media/commands/helpers.d.ts +5 -12
  403. package/dist/types/plugins/media/commands/index.d.ts +1 -1
  404. package/dist/types/plugins/media/index.d.ts +3 -1
  405. package/dist/types/plugins/media/nodeviews/__mocks__/mediaNodeUpdater.d.ts +3 -1
  406. package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +4 -1
  407. package/dist/types/plugins/media/pm-plugins/main.d.ts +1 -4
  408. package/dist/types/plugins/media/pm-plugins/types.d.ts +1 -4
  409. package/dist/types/plugins/mentions/index.d.ts +3 -1
  410. package/dist/types/plugins/panel/index.d.ts +3 -1
  411. package/dist/types/plugins/paste/handlers.d.ts +2 -1
  412. package/dist/types/plugins/paste/index.d.ts +3 -1
  413. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +4 -1
  414. package/dist/types/plugins/placeholder/index.d.ts +3 -1
  415. package/dist/types/plugins/placeholder-text/index.d.ts +3 -1
  416. package/dist/types/plugins/quick-insert/index.d.ts +3 -1
  417. package/dist/types/plugins/save-on-enter/index.d.ts +3 -1
  418. package/dist/types/plugins/selection/index.d.ts +3 -1
  419. package/dist/types/plugins/status/index.d.ts +3 -1
  420. package/dist/types/plugins/status/ui/statusPicker.d.ts +3 -0
  421. package/dist/types/plugins/submit-editor/index.d.ts +3 -1
  422. package/dist/types/plugins/tasks-and-decisions/index.d.ts +3 -1
  423. package/dist/types/plugins/text-color/index.d.ts +3 -1
  424. package/dist/types/plugins/text-color/ui/ToolbarTextColor/index.d.ts +2 -0
  425. package/dist/types/plugins/text-formatting/index.d.ts +3 -1
  426. package/dist/types/plugins/text-formatting/ui/Toolbar/more-button.d.ts +2 -1
  427. package/dist/types/plugins/text-formatting/utils.d.ts +0 -1
  428. package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +3 -1
  429. package/dist/types/plugins/type-ahead/index.d.ts +3 -1
  430. package/dist/types/types/get-editor-props.d.ts +12 -0
  431. package/dist/types/types/performance-tracking.d.ts +10 -0
  432. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +29 -29
  433. package/dist/types/ui/CollapsedEditor/index.d.ts +4 -3
  434. package/dist/types/ui/ColorPickerButton/index.d.ts +2 -1
  435. package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
  436. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  437. package/dist/types/ui/ContextPanel/context.d.ts +2 -1
  438. package/dist/types/ui/PanelTextInput/index.d.ts +1 -1
  439. package/dist/types/ui/PortalProvider/index.d.ts +1 -1
  440. package/dist/types/utils/document.d.ts +4 -3
  441. package/dist/types/utils/get-editor-plugins.d.ts +10 -0
  442. package/dist/types/utils/linking-utils.d.ts +1 -1
  443. package/dist/types/utils/performance/components/RenderTracking.d.ts +1 -1
  444. package/dist/types/utils/performance/instrumented-plugin.d.ts +1 -1
  445. package/dist/types/utils/performance/safer-transactions.d.ts +1 -1
  446. package/dist/types/utils/prepare-extension-provider.d.ts +5 -0
  447. package/docs/0-intro.tsx +0 -1
  448. package/package.json +27 -26
  449. package/report.api.md +193 -139
  450. package/dist/cjs/plugins/analytics/analytics-queue.js +0 -79
  451. package/dist/cjs/plugins/analytics/fire-analytics-event.js +0 -35
  452. package/dist/es2019/plugins/analytics/analytics-queue.js +0 -53
  453. package/dist/es2019/plugins/analytics/fire-analytics-event.js +0 -26
  454. package/dist/esm/plugins/analytics/analytics-queue.js +0 -71
  455. package/dist/esm/plugins/analytics/fire-analytics-event.js +0 -28
  456. package/dist/types/plugins/analytics/analytics-queue.d.ts +0 -10
  457. package/dist/types/plugins/analytics/fire-analytics-event.d.ts +0 -9
@@ -7,7 +7,7 @@ import uuidV4 from 'uuid/v4';
7
7
  import { DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/ui';
8
8
  import { getMediaClient, isMediaBlobUrl as _isMediaBlobUrl, getAttrsFromUrl, isImageRepresentationReady } from '@atlaskit/media-client';
9
9
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../analytics';
10
- import { replaceExternalMedia, updateAllMediaNodesAttrs, updateCurrentMediaNodeAttrs, updateMediaNodeAttrs } from '../commands/helpers';
10
+ import { replaceExternalMedia, updateAllMediaSingleNodesAttrs, updateCurrentMediaNodeAttrs, updateMediaSingleNodeAttrs } from '../commands/helpers';
11
11
  export var MediaNodeUpdater = /*#__PURE__*/function () {
12
12
  function MediaNodeUpdater(props) {
13
13
  var _this = this;
@@ -30,9 +30,9 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
30
30
  return _this.getObjectId();
31
31
  case 6:
32
32
  objectId = _context.sent;
33
- updateAllMediaNodesAttrs(id, {
33
+ updateAllMediaSingleNodesAttrs(id, {
34
34
  __contextId: objectId
35
- }, _this.props.isMediaSingle)(_this.props.view.state, _this.props.view.dispatch);
35
+ })(_this.props.view.state, _this.props.view.dispatch);
36
36
  case 8:
37
37
  case "end":
38
38
  return _context.stop();
@@ -40,60 +40,95 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
40
40
  }
41
41
  }, _callee);
42
42
  })));
43
+ _defineProperty(this, "updateNodeContextId", /*#__PURE__*/function () {
44
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(getPos) {
45
+ var attrs, objectId;
46
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
47
+ while (1) {
48
+ switch (_context2.prev = _context2.next) {
49
+ case 0:
50
+ attrs = _this.getAttrs();
51
+ if (!((attrs === null || attrs === void 0 ? void 0 : attrs.type) !== 'file')) {
52
+ _context2.next = 3;
53
+ break;
54
+ }
55
+ return _context2.abrupt("return");
56
+ case 3:
57
+ _context2.next = 5;
58
+ return _this.getObjectId();
59
+ case 5:
60
+ objectId = _context2.sent;
61
+ updateCurrentMediaNodeAttrs({
62
+ __contextId: objectId
63
+ }, {
64
+ node: _this.props.node,
65
+ getPos: getPos
66
+ })(_this.props.view.state, _this.props.view.dispatch);
67
+ case 7:
68
+ case "end":
69
+ return _context2.stop();
70
+ }
71
+ }
72
+ }, _callee2);
73
+ }));
74
+ return function (_x) {
75
+ return _ref2.apply(this, arguments);
76
+ };
77
+ }());
43
78
  _defineProperty(this, "hasFileAttributesDefined", function (attrs) {
44
79
  return attrs && attrs.type === 'file' && attrs.__fileName && attrs.__fileMimeType && attrs.__fileSize && attrs.__contextId;
45
80
  });
46
- _defineProperty(this, "getNewFileAttrsForNode", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
81
+ _defineProperty(this, "getNewFileAttrsForNode", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
47
82
  var attrs, mediaProvider, mediaClientConfig, mediaClient, fileState, id, collectionName, contextId, _fileState, name, mimeType, size, newAttrs;
48
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
83
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
49
84
  while (1) {
50
- switch (_context2.prev = _context2.next) {
85
+ switch (_context3.prev = _context3.next) {
51
86
  case 0:
52
87
  attrs = _this.getAttrs();
53
- _context2.next = 3;
88
+ _context3.next = 3;
54
89
  return _this.props.mediaProvider;
55
90
  case 3:
56
- mediaProvider = _context2.sent;
91
+ mediaProvider = _context3.sent;
57
92
  if (!(!mediaProvider || !mediaProvider.uploadParams || !attrs || attrs.type !== 'file' || _this.hasFileAttributesDefined(attrs))) {
58
- _context2.next = 6;
93
+ _context3.next = 6;
59
94
  break;
60
95
  }
61
- return _context2.abrupt("return");
96
+ return _context3.abrupt("return");
62
97
  case 6:
63
98
  mediaClientConfig = mediaProvider.viewMediaClientConfig;
64
99
  mediaClient = getMediaClient(mediaClientConfig);
65
100
  id = attrs.id, collectionName = attrs.collection;
66
- _context2.prev = 9;
67
- _context2.next = 12;
101
+ _context3.prev = 9;
102
+ _context3.next = 12;
68
103
  return mediaClient.file.getCurrentState(id, {
69
104
  collectionName: collectionName
70
105
  });
71
106
  case 12:
72
- fileState = _context2.sent;
107
+ fileState = _context3.sent;
73
108
  if (!(fileState.status === 'error')) {
74
- _context2.next = 15;
109
+ _context3.next = 15;
75
110
  break;
76
111
  }
77
- return _context2.abrupt("return");
112
+ return _context3.abrupt("return");
78
113
  case 15:
79
- _context2.next = 20;
114
+ _context3.next = 20;
80
115
  break;
81
116
  case 17:
82
- _context2.prev = 17;
83
- _context2.t0 = _context2["catch"](9);
84
- return _context2.abrupt("return");
117
+ _context3.prev = 17;
118
+ _context3.t0 = _context3["catch"](9);
119
+ return _context3.abrupt("return");
85
120
  case 20:
86
- _context2.t1 = _this.getNodeContextId();
87
- if (_context2.t1) {
88
- _context2.next = 25;
121
+ _context3.t1 = _this.getNodeContextId();
122
+ if (_context3.t1) {
123
+ _context3.next = 25;
89
124
  break;
90
125
  }
91
- _context2.next = 24;
126
+ _context3.next = 24;
92
127
  return _this.getObjectId();
93
128
  case 24:
94
- _context2.t1 = _context2.sent;
129
+ _context3.t1 = _context3.sent;
95
130
  case 25:
96
- contextId = _context2.t1;
131
+ contextId = _context3.t1;
97
132
  _fileState = fileState, name = _fileState.name, mimeType = _fileState.mimeType, size = _fileState.size;
98
133
  newAttrs = {
99
134
  __fileName: name,
@@ -102,56 +137,51 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
102
137
  __contextId: contextId
103
138
  };
104
139
  if (hasPrivateAttrsChanged(attrs, newAttrs)) {
105
- _context2.next = 30;
140
+ _context3.next = 30;
106
141
  break;
107
142
  }
108
- return _context2.abrupt("return");
143
+ return _context3.abrupt("return");
109
144
  case 30:
110
- return _context2.abrupt("return", newAttrs);
145
+ return _context3.abrupt("return", newAttrs);
111
146
  case 31:
112
147
  case "end":
113
- return _context2.stop();
148
+ return _context3.stop();
114
149
  }
115
150
  }
116
- }, _callee2, null, [[9, 17]]);
151
+ }, _callee3, null, [[9, 17]]);
117
152
  })));
118
- _defineProperty(this, "updateFileAttrs", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
119
- var isMediaSingle,
120
- newAttrs,
121
- _ref4,
122
- id,
123
- _args3 = arguments;
124
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
153
+ _defineProperty(this, "updateMediaSingleFileAttrs", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
154
+ var newAttrs, _ref5, id;
155
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
125
156
  while (1) {
126
- switch (_context3.prev = _context3.next) {
157
+ switch (_context4.prev = _context4.next) {
127
158
  case 0:
128
- isMediaSingle = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : true;
129
- _context3.next = 3;
159
+ _context4.next = 2;
130
160
  return _this.getNewFileAttrsForNode();
131
- case 3:
132
- newAttrs = _context3.sent;
133
- _ref4 = _this.getAttrs(), id = _ref4.id;
161
+ case 2:
162
+ newAttrs = _context4.sent;
163
+ _ref5 = _this.getAttrs(), id = _ref5.id;
134
164
  if (id && newAttrs) {
135
- updateAllMediaNodesAttrs(id, newAttrs, isMediaSingle)(_this.props.view.state, _this.props.view.dispatch);
165
+ updateAllMediaSingleNodesAttrs(id, newAttrs)(_this.props.view.state, _this.props.view.dispatch);
136
166
  }
137
- case 6:
167
+ case 5:
138
168
  case "end":
139
- return _context3.stop();
169
+ return _context4.stop();
140
170
  }
141
171
  }
142
- }, _callee3);
172
+ }, _callee4);
143
173
  })));
144
174
  _defineProperty(this, "updateNodeAttrs", /*#__PURE__*/function () {
145
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(getPos) {
175
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(getPos) {
146
176
  var newAttrs;
147
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
177
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
148
178
  while (1) {
149
- switch (_context4.prev = _context4.next) {
179
+ switch (_context5.prev = _context5.next) {
150
180
  case 0:
151
- _context4.next = 2;
181
+ _context5.next = 2;
152
182
  return _this.getNewFileAttrsForNode();
153
183
  case 2:
154
- newAttrs = _context4.sent;
184
+ newAttrs = _context5.sent;
155
185
  if (newAttrs) {
156
186
  updateCurrentMediaNodeAttrs(newAttrs, {
157
187
  node: _this.props.node,
@@ -160,13 +190,13 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
160
190
  }
161
191
  case 4:
162
192
  case "end":
163
- return _context4.stop();
193
+ return _context5.stop();
164
194
  }
165
195
  }
166
- }, _callee4);
196
+ }, _callee5);
167
197
  }));
168
- return function (_x) {
169
- return _ref5.apply(this, arguments);
198
+ return function (_x2) {
199
+ return _ref6.apply(this, arguments);
170
200
  };
171
201
  }());
172
202
  _defineProperty(this, "getAttrs", function () {
@@ -176,54 +206,54 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
176
206
  }
177
207
  return undefined;
178
208
  });
179
- _defineProperty(this, "getObjectId", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
209
+ _defineProperty(this, "getObjectId", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
180
210
  var contextIdentifierProvider;
181
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
211
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
182
212
  while (1) {
183
- switch (_context5.prev = _context5.next) {
213
+ switch (_context6.prev = _context6.next) {
184
214
  case 0:
185
- _context5.next = 2;
215
+ _context6.next = 2;
186
216
  return _this.props.contextIdentifierProvider;
187
217
  case 2:
188
- contextIdentifierProvider = _context5.sent;
189
- return _context5.abrupt("return", (contextIdentifierProvider === null || contextIdentifierProvider === void 0 ? void 0 : contextIdentifierProvider.objectId) || null);
218
+ contextIdentifierProvider = _context6.sent;
219
+ return _context6.abrupt("return", (contextIdentifierProvider === null || contextIdentifierProvider === void 0 ? void 0 : contextIdentifierProvider.objectId) || null);
190
220
  case 4:
191
221
  case "end":
192
- return _context5.stop();
222
+ return _context6.stop();
193
223
  }
194
224
  }
195
- }, _callee5);
225
+ }, _callee6);
196
226
  })));
197
227
  _defineProperty(this, "uploadExternalMedia", /*#__PURE__*/function () {
198
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(getPos) {
228
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(getPos) {
199
229
  var node, mediaProvider, uploadMediaClientConfig, mediaClient, collection, uploader, uploadableFileUpfrontIds, dimensions;
200
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
230
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
201
231
  while (1) {
202
- switch (_context6.prev = _context6.next) {
232
+ switch (_context7.prev = _context7.next) {
203
233
  case 0:
204
234
  node = _this.props.node;
205
- _context6.next = 3;
235
+ _context7.next = 3;
206
236
  return _this.props.mediaProvider;
207
237
  case 3:
208
- mediaProvider = _context6.sent;
238
+ mediaProvider = _context7.sent;
209
239
  if (!(node && mediaProvider)) {
210
- _context6.next = 21;
240
+ _context7.next = 21;
211
241
  break;
212
242
  }
213
243
  uploadMediaClientConfig = mediaProvider.uploadMediaClientConfig;
214
244
  if (!(!uploadMediaClientConfig || !node.attrs.url)) {
215
- _context6.next = 8;
245
+ _context7.next = 8;
216
246
  break;
217
247
  }
218
- return _context6.abrupt("return");
248
+ return _context7.abrupt("return");
219
249
  case 8:
220
250
  mediaClient = getMediaClient(uploadMediaClientConfig);
221
251
  collection = mediaProvider.uploadParams && mediaProvider.uploadParams.collection;
222
- _context6.prev = 10;
223
- _context6.next = 13;
252
+ _context7.prev = 10;
253
+ _context7.next = 13;
224
254
  return mediaClient.file.uploadExternal(node.attrs.url, collection);
225
255
  case 13:
226
- uploader = _context6.sent;
256
+ uploader = _context7.sent;
227
257
  uploadableFileUpfrontIds = uploader.uploadableFileUpfrontIds, dimensions = uploader.dimensions;
228
258
  replaceExternalMedia(getPos() + 1, {
229
259
  id: uploadableFileUpfrontIds.id,
@@ -232,11 +262,11 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
232
262
  width: dimensions.width,
233
263
  occurrenceKey: uploadableFileUpfrontIds.occurrenceKey
234
264
  })(_this.props.view.state, _this.props.view.dispatch);
235
- _context6.next = 21;
265
+ _context7.next = 21;
236
266
  break;
237
267
  case 18:
238
- _context6.prev = 18;
239
- _context6.t0 = _context6["catch"](10);
268
+ _context7.prev = 18;
269
+ _context7.t0 = _context7["catch"](10);
240
270
  //keep it as external media
241
271
  if (_this.props.dispatchAnalyticsEvent) {
242
272
  _this.props.dispatchAnalyticsEvent({
@@ -247,13 +277,13 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
247
277
  }
248
278
  case 21:
249
279
  case "end":
250
- return _context6.stop();
280
+ return _context7.stop();
251
281
  }
252
282
  }
253
- }, _callee6, null, [[10, 18]]);
283
+ }, _callee7, null, [[10, 18]]);
254
284
  }));
255
- return function (_x2) {
256
- return _ref7.apply(this, arguments);
285
+ return function (_x3) {
286
+ return _ref8.apply(this, arguments);
257
287
  };
258
288
  }());
259
289
  _defineProperty(this, "getNodeContextId", function () {
@@ -264,132 +294,132 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
264
294
  return attrs.__contextId || null;
265
295
  });
266
296
  _defineProperty(this, "updateDimensions", function (dimensions) {
267
- updateAllMediaNodesAttrs(dimensions.id, {
297
+ updateAllMediaSingleNodesAttrs(dimensions.id, {
268
298
  height: dimensions.height,
269
299
  width: dimensions.width
270
- }, true)(_this.props.view.state, _this.props.view.dispatch);
300
+ })(_this.props.view.state, _this.props.view.dispatch);
271
301
  });
272
- _defineProperty(this, "hasDifferentContextId", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
302
+ _defineProperty(this, "hasDifferentContextId", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
273
303
  var nodeContextId, currentContextId;
274
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
304
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
275
305
  while (1) {
276
- switch (_context7.prev = _context7.next) {
306
+ switch (_context8.prev = _context8.next) {
277
307
  case 0:
278
308
  nodeContextId = _this.getNodeContextId();
279
- _context7.next = 3;
309
+ _context8.next = 3;
280
310
  return _this.getObjectId();
281
311
  case 3:
282
- currentContextId = _context7.sent;
312
+ currentContextId = _context8.sent;
283
313
  if (!(nodeContextId && currentContextId && nodeContextId !== currentContextId)) {
284
- _context7.next = 6;
314
+ _context8.next = 6;
285
315
  break;
286
316
  }
287
- return _context7.abrupt("return", true);
317
+ return _context8.abrupt("return", true);
288
318
  case 6:
289
- return _context7.abrupt("return", false);
319
+ return _context8.abrupt("return", false);
290
320
  case 7:
291
321
  case "end":
292
- return _context7.stop();
322
+ return _context8.stop();
293
323
  }
294
324
  }
295
- }, _callee7);
325
+ }, _callee8);
296
326
  })));
297
- _defineProperty(this, "isNodeFromDifferentCollection", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
327
+ _defineProperty(this, "isNodeFromDifferentCollection", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
298
328
  var mediaProvider, currentCollectionName, attrs, nodeCollection, __contextId, contextId;
299
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
329
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
300
330
  while (1) {
301
- switch (_context8.prev = _context8.next) {
331
+ switch (_context9.prev = _context9.next) {
302
332
  case 0:
303
- _context8.next = 2;
333
+ _context9.next = 2;
304
334
  return _this.props.mediaProvider;
305
335
  case 2:
306
- mediaProvider = _context8.sent;
336
+ mediaProvider = _context9.sent;
307
337
  if (!(!mediaProvider || !mediaProvider.uploadParams)) {
308
- _context8.next = 5;
338
+ _context9.next = 5;
309
339
  break;
310
340
  }
311
- return _context8.abrupt("return", false);
341
+ return _context9.abrupt("return", false);
312
342
  case 5:
313
343
  currentCollectionName = mediaProvider.uploadParams.collection;
314
344
  attrs = _this.getAttrs();
315
345
  if (!(!attrs || attrs.type !== 'file')) {
316
- _context8.next = 9;
346
+ _context9.next = 9;
317
347
  break;
318
348
  }
319
- return _context8.abrupt("return", false);
349
+ return _context9.abrupt("return", false);
320
350
  case 9:
321
351
  nodeCollection = attrs.collection, __contextId = attrs.__contextId;
322
- _context8.t0 = __contextId;
323
- if (_context8.t0) {
324
- _context8.next = 15;
352
+ _context9.t0 = __contextId;
353
+ if (_context9.t0) {
354
+ _context9.next = 15;
325
355
  break;
326
356
  }
327
- _context8.next = 14;
357
+ _context9.next = 14;
328
358
  return _this.getObjectId();
329
359
  case 14:
330
- _context8.t0 = _context8.sent;
360
+ _context9.t0 = _context9.sent;
331
361
  case 15:
332
- contextId = _context8.t0;
362
+ contextId = _context9.t0;
333
363
  if (!(contextId && currentCollectionName !== nodeCollection)) {
334
- _context8.next = 18;
364
+ _context9.next = 18;
335
365
  break;
336
366
  }
337
- return _context8.abrupt("return", true);
367
+ return _context9.abrupt("return", true);
338
368
  case 18:
339
- return _context8.abrupt("return", false);
369
+ return _context9.abrupt("return", false);
340
370
  case 19:
341
371
  case "end":
342
- return _context8.stop();
372
+ return _context9.stop();
343
373
  }
344
374
  }
345
- }, _callee8);
375
+ }, _callee9);
346
376
  })));
347
377
  _defineProperty(this, "copyNodeFromBlobUrl", /*#__PURE__*/function () {
348
- var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(getPos) {
378
+ var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(getPos) {
349
379
  var attrs, url, mediaAttrs, mediaProvider, currentCollectionName, contextId, id, collection, height, width, mimeType, name, size, uploadMediaClientConfig, mediaClient, auth, source, destination, mediaFile;
350
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
380
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
351
381
  while (1) {
352
- switch (_context9.prev = _context9.next) {
382
+ switch (_context10.prev = _context10.next) {
353
383
  case 0:
354
384
  attrs = _this.getAttrs();
355
385
  if (!(!attrs || attrs.type !== 'external')) {
356
- _context9.next = 3;
386
+ _context10.next = 3;
357
387
  break;
358
388
  }
359
- return _context9.abrupt("return");
389
+ return _context10.abrupt("return");
360
390
  case 3:
361
391
  url = attrs.url;
362
392
  mediaAttrs = getAttrsFromUrl(url);
363
393
  if (mediaAttrs) {
364
- _context9.next = 7;
394
+ _context10.next = 7;
365
395
  break;
366
396
  }
367
- return _context9.abrupt("return");
397
+ return _context10.abrupt("return");
368
398
  case 7:
369
- _context9.next = 9;
399
+ _context10.next = 9;
370
400
  return _this.props.mediaProvider;
371
401
  case 9:
372
- mediaProvider = _context9.sent;
402
+ mediaProvider = _context10.sent;
373
403
  if (!(!mediaProvider || !mediaProvider.uploadParams)) {
374
- _context9.next = 12;
404
+ _context10.next = 12;
375
405
  break;
376
406
  }
377
- return _context9.abrupt("return");
407
+ return _context10.abrupt("return");
378
408
  case 12:
379
409
  currentCollectionName = mediaProvider.uploadParams.collection;
380
410
  contextId = mediaAttrs.contextId, id = mediaAttrs.id, collection = mediaAttrs.collection, height = mediaAttrs.height, width = mediaAttrs.width, mimeType = mediaAttrs.mimeType, name = mediaAttrs.name, size = mediaAttrs.size;
381
411
  uploadMediaClientConfig = mediaProvider.uploadMediaClientConfig;
382
412
  if (!(!uploadMediaClientConfig || !uploadMediaClientConfig.getAuthFromContext)) {
383
- _context9.next = 17;
413
+ _context10.next = 17;
384
414
  break;
385
415
  }
386
- return _context9.abrupt("return");
416
+ return _context10.abrupt("return");
387
417
  case 17:
388
418
  mediaClient = getMediaClient(uploadMediaClientConfig);
389
- _context9.next = 20;
419
+ _context10.next = 20;
390
420
  return uploadMediaClientConfig.getAuthFromContext(contextId);
391
421
  case 20:
392
- auth = _context9.sent;
422
+ auth = _context10.sent;
393
423
  source = {
394
424
  id: id,
395
425
  collection: collection,
@@ -402,10 +432,10 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
402
432
  authProvider: uploadMediaClientConfig.authProvider,
403
433
  occurrenceKey: uuidV4()
404
434
  };
405
- _context9.next = 25;
435
+ _context10.next = 25;
406
436
  return mediaClient.file.copyFile(source, destination);
407
437
  case 25:
408
- mediaFile = _context9.sent;
438
+ mediaFile = _context10.sent;
409
439
  replaceExternalMedia(getPos() + 1, {
410
440
  id: mediaFile.id,
411
441
  collection: currentCollectionName,
@@ -417,50 +447,125 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
417
447
  })(_this.props.view.state, _this.props.view.dispatch);
418
448
  case 27:
419
449
  case "end":
420
- return _context9.stop();
450
+ return _context10.stop();
421
451
  }
422
452
  }
423
- }, _callee9);
453
+ }, _callee10);
424
454
  }));
425
- return function (_x3) {
426
- return _ref10.apply(this, arguments);
455
+ return function (_x4) {
456
+ return _ref11.apply(this, arguments);
457
+ };
458
+ }());
459
+ _defineProperty(this, "copyNodeFromPos", /*#__PURE__*/function () {
460
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(getPos, traceContext) {
461
+ var attrs, copiedAttrs;
462
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
463
+ while (1) {
464
+ switch (_context11.prev = _context11.next) {
465
+ case 0:
466
+ attrs = _this.getAttrs();
467
+ if (!((attrs === null || attrs === void 0 ? void 0 : attrs.type) !== 'file')) {
468
+ _context11.next = 3;
469
+ break;
470
+ }
471
+ return _context11.abrupt("return");
472
+ case 3:
473
+ _context11.next = 5;
474
+ return _this.copyFile(attrs.id, attrs.collection, traceContext);
475
+ case 5:
476
+ copiedAttrs = _context11.sent;
477
+ if (copiedAttrs) {
478
+ _context11.next = 8;
479
+ break;
480
+ }
481
+ return _context11.abrupt("return");
482
+ case 8:
483
+ updateCurrentMediaNodeAttrs(copiedAttrs, {
484
+ node: _this.props.node,
485
+ getPos: getPos
486
+ })(_this.props.view.state, _this.props.view.dispatch);
487
+ case 9:
488
+ case "end":
489
+ return _context11.stop();
490
+ }
491
+ }
492
+ }, _callee11);
493
+ }));
494
+ return function (_x5, _x6) {
495
+ return _ref12.apply(this, arguments);
427
496
  };
428
497
  }());
429
498
  _defineProperty(this, "copyNode", /*#__PURE__*/function () {
430
- var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(traceContext) {
431
- var mediaProvider, _this$props, isMediaSingle, view, attrs, nodeContextId, uploadMediaClientConfig, mediaClient, auth, objectId, id, collection, source, currentCollectionName, destination, mediaFile;
432
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
499
+ var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(traceContext) {
500
+ var attrs, view, copiedAttrs;
501
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
433
502
  while (1) {
434
- switch (_context10.prev = _context10.next) {
503
+ switch (_context12.prev = _context12.next) {
504
+ case 0:
505
+ attrs = _this.getAttrs();
506
+ view = _this.props.view;
507
+ if (!((attrs === null || attrs === void 0 ? void 0 : attrs.type) !== 'file')) {
508
+ _context12.next = 4;
509
+ break;
510
+ }
511
+ return _context12.abrupt("return");
512
+ case 4:
513
+ _context12.next = 6;
514
+ return _this.copyFile(attrs.id, attrs.collection, traceContext);
515
+ case 6:
516
+ copiedAttrs = _context12.sent;
517
+ if (copiedAttrs) {
518
+ _context12.next = 9;
519
+ break;
520
+ }
521
+ return _context12.abrupt("return");
522
+ case 9:
523
+ updateMediaSingleNodeAttrs(attrs.id, copiedAttrs)(view.state, view.dispatch);
524
+ case 10:
525
+ case "end":
526
+ return _context12.stop();
527
+ }
528
+ }
529
+ }, _callee12);
530
+ }));
531
+ return function (_x7) {
532
+ return _ref13.apply(this, arguments);
533
+ };
534
+ }());
535
+ _defineProperty(this, "copyFile", /*#__PURE__*/function () {
536
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(id, collection, traceContext) {
537
+ var mediaProvider, nodeContextId, uploadMediaClientConfig, mediaClient, auth, objectId, source, currentCollectionName, destination, mediaFile;
538
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
539
+ while (1) {
540
+ switch (_context13.prev = _context13.next) {
435
541
  case 0:
436
- _context10.next = 2;
542
+ _context13.next = 2;
437
543
  return _this.props.mediaProvider;
438
544
  case 2:
439
- mediaProvider = _context10.sent;
440
- _this$props = _this.props, isMediaSingle = _this$props.isMediaSingle, view = _this$props.view;
441
- attrs = _this.getAttrs();
442
- if (!(!mediaProvider || !mediaProvider.uploadParams || !attrs || attrs.type !== 'file')) {
443
- _context10.next = 7;
545
+ mediaProvider = _context13.sent;
546
+ if (!(!id || !collection || !(mediaProvider !== null && mediaProvider !== void 0 && mediaProvider.uploadParams))) {
547
+ _context13.next = 5;
444
548
  break;
445
549
  }
446
- return _context10.abrupt("return");
447
- case 7:
550
+ return _context13.abrupt("return");
551
+ case 5:
448
552
  nodeContextId = _this.getNodeContextId();
449
553
  uploadMediaClientConfig = mediaProvider.uploadMediaClientConfig;
450
- if (!(uploadMediaClientConfig && uploadMediaClientConfig.getAuthFromContext && nodeContextId)) {
451
- _context10.next = 25;
554
+ if (!(!(uploadMediaClientConfig !== null && uploadMediaClientConfig !== void 0 && uploadMediaClientConfig.getAuthFromContext) || !nodeContextId)) {
555
+ _context13.next = 9;
452
556
  break;
453
557
  }
558
+ return _context13.abrupt("return");
559
+ case 9:
454
560
  mediaClient = getMediaClient(uploadMediaClientConfig);
455
- _context10.next = 13;
561
+ _context13.next = 12;
456
562
  return uploadMediaClientConfig.getAuthFromContext(nodeContextId);
457
- case 13:
458
- auth = _context10.sent;
459
- _context10.next = 16;
563
+ case 12:
564
+ auth = _context13.sent;
565
+ _context13.next = 15;
460
566
  return _this.getObjectId();
461
- case 16:
462
- objectId = _context10.sent;
463
- id = attrs.id, collection = attrs.collection;
567
+ case 15:
568
+ objectId = _context13.sent;
464
569
  source = {
465
570
  id: id,
466
571
  collection: collection,
@@ -474,24 +579,24 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
474
579
  authProvider: uploadMediaClientConfig.authProvider,
475
580
  occurrenceKey: uuidV4()
476
581
  };
477
- _context10.next = 23;
582
+ _context13.next = 21;
478
583
  return mediaClient.file.copyFile(source, destination, undefined, traceContext);
479
- case 23:
480
- mediaFile = _context10.sent;
481
- updateMediaNodeAttrs(source.id, {
584
+ case 21:
585
+ mediaFile = _context13.sent;
586
+ return _context13.abrupt("return", {
482
587
  id: mediaFile.id,
483
588
  collection: currentCollectionName,
484
589
  __contextId: objectId
485
- }, isMediaSingle)(view.state, view.dispatch);
486
- case 25:
590
+ });
591
+ case 23:
487
592
  case "end":
488
- return _context10.stop();
593
+ return _context13.stop();
489
594
  }
490
595
  }
491
- }, _callee10);
596
+ }, _callee13);
492
597
  }));
493
- return function (_x4) {
494
- return _ref11.apply(this, arguments);
598
+ return function (_x8, _x9, _x10) {
599
+ return _ref14.apply(this, arguments);
495
600
  };
496
601
  }());
497
602
  this.props = props;
@@ -504,47 +609,47 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
504
609
  }
505
610
 
506
611
  // Updates the node with contextId if it doesn't have one already
507
- // TODO [MS-2258]: remove updateContextId in order to only use updateFileAttrs
612
+ // TODO [MS-2258]: remove updateContextId in order to only use updateMediaSingleFileAttrs
508
613
  }, {
509
614
  key: "getRemoteDimensions",
510
615
  value: function () {
511
- var _getRemoteDimensions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
616
+ var _getRemoteDimensions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
512
617
  var mediaProvider, mediaOptions, attrs, height, width, id, collection, viewMediaClientConfig, mediaClient, currentState, imageMetadata;
513
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
618
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
514
619
  while (1) {
515
- switch (_context11.prev = _context11.next) {
620
+ switch (_context14.prev = _context14.next) {
516
621
  case 0:
517
- _context11.next = 2;
622
+ _context14.next = 2;
518
623
  return this.props.mediaProvider;
519
624
  case 2:
520
- mediaProvider = _context11.sent;
625
+ mediaProvider = _context14.sent;
521
626
  mediaOptions = this.props.mediaOptions;
522
627
  attrs = this.getAttrs();
523
628
  if (!(!mediaProvider || !attrs)) {
524
- _context11.next = 7;
629
+ _context14.next = 7;
525
630
  break;
526
631
  }
527
- return _context11.abrupt("return", false);
632
+ return _context14.abrupt("return", false);
528
633
  case 7:
529
634
  height = attrs.height, width = attrs.width;
530
635
  if (!(attrs.type === 'external' || !attrs.id)) {
531
- _context11.next = 10;
636
+ _context14.next = 10;
532
637
  break;
533
638
  }
534
- return _context11.abrupt("return", false);
639
+ return _context14.abrupt("return", false);
535
640
  case 10:
536
641
  id = attrs.id, collection = attrs.collection;
537
642
  if (!(height && width)) {
538
- _context11.next = 13;
643
+ _context14.next = 13;
539
644
  break;
540
645
  }
541
- return _context11.abrupt("return", false);
646
+ return _context14.abrupt("return", false);
542
647
  case 13:
543
648
  if (!(mediaOptions && !mediaOptions.allowRemoteDimensionsFetch)) {
544
- _context11.next = 15;
649
+ _context14.next = 15;
545
650
  break;
546
651
  }
547
- return _context11.abrupt("return", {
652
+ return _context14.abrupt("return", {
548
653
  id: id,
549
654
  height: DEFAULT_IMAGE_HEIGHT,
550
655
  width: DEFAULT_IMAGE_WIDTH
@@ -552,41 +657,41 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
552
657
  case 15:
553
658
  viewMediaClientConfig = mediaProvider.viewMediaClientConfig;
554
659
  mediaClient = getMediaClient(viewMediaClientConfig);
555
- _context11.next = 19;
660
+ _context14.next = 19;
556
661
  return mediaClient.file.getCurrentState(id, {
557
662
  collectionName: collection
558
663
  });
559
664
  case 19:
560
- currentState = _context11.sent;
665
+ currentState = _context14.sent;
561
666
  if (isImageRepresentationReady(currentState)) {
562
- _context11.next = 22;
667
+ _context14.next = 22;
563
668
  break;
564
669
  }
565
- return _context11.abrupt("return", false);
670
+ return _context14.abrupt("return", false);
566
671
  case 22:
567
- _context11.next = 24;
672
+ _context14.next = 24;
568
673
  return mediaClient.getImageMetadata(id, {
569
674
  collection: collection
570
675
  });
571
676
  case 24:
572
- imageMetadata = _context11.sent;
677
+ imageMetadata = _context14.sent;
573
678
  if (!(!imageMetadata || !imageMetadata.original)) {
574
- _context11.next = 27;
679
+ _context14.next = 27;
575
680
  break;
576
681
  }
577
- return _context11.abrupt("return", false);
682
+ return _context14.abrupt("return", false);
578
683
  case 27:
579
- return _context11.abrupt("return", {
684
+ return _context14.abrupt("return", {
580
685
  id: id,
581
686
  height: imageMetadata.original.height || DEFAULT_IMAGE_HEIGHT,
582
687
  width: imageMetadata.original.width || DEFAULT_IMAGE_WIDTH
583
688
  });
584
689
  case 28:
585
690
  case "end":
586
- return _context11.stop();
691
+ return _context14.stop();
587
692
  }
588
693
  }
589
- }, _callee11, this);
694
+ }, _callee14, this);
590
695
  }));
591
696
  function getRemoteDimensions() {
592
697
  return _getRemoteDimensions.apply(this, arguments);
@@ -596,40 +701,40 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
596
701
  }, {
597
702
  key: "handleExternalMedia",
598
703
  value: function () {
599
- var _handleExternalMedia = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(getPos) {
600
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
704
+ var _handleExternalMedia = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(getPos) {
705
+ return _regeneratorRuntime.wrap(function _callee15$(_context15) {
601
706
  while (1) {
602
- switch (_context12.prev = _context12.next) {
707
+ switch (_context15.prev = _context15.next) {
603
708
  case 0:
604
709
  if (!this.isMediaBlobUrl()) {
605
- _context12.next = 12;
710
+ _context15.next = 12;
606
711
  break;
607
712
  }
608
- _context12.prev = 1;
609
- _context12.next = 4;
713
+ _context15.prev = 1;
714
+ _context15.next = 4;
610
715
  return this.copyNodeFromBlobUrl(getPos);
611
716
  case 4:
612
- _context12.next = 10;
717
+ _context15.next = 10;
613
718
  break;
614
719
  case 6:
615
- _context12.prev = 6;
616
- _context12.t0 = _context12["catch"](1);
617
- _context12.next = 10;
720
+ _context15.prev = 6;
721
+ _context15.t0 = _context15["catch"](1);
722
+ _context15.next = 10;
618
723
  return this.uploadExternalMedia(getPos);
619
724
  case 10:
620
- _context12.next = 14;
725
+ _context15.next = 14;
621
726
  break;
622
727
  case 12:
623
- _context12.next = 14;
728
+ _context15.next = 14;
624
729
  return this.uploadExternalMedia(getPos);
625
730
  case 14:
626
731
  case "end":
627
- return _context12.stop();
732
+ return _context15.stop();
628
733
  }
629
734
  }
630
- }, _callee12, this, [[1, 6]]);
735
+ }, _callee15, this, [[1, 6]]);
631
736
  }));
632
- function handleExternalMedia(_x5) {
737
+ function handleExternalMedia(_x11) {
633
738
  return _handleExternalMedia.apply(this, arguments);
634
739
  }
635
740
  return handleExternalMedia;