@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
@@ -55,6 +55,8 @@ var dispatchLongTaskEvent = function dispatchLongTaskEvent(dispatchAnalyticsEven
55
55
  var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserFreezeTracking, ufo) {
56
56
  var interactionType;
57
57
  var inputLatencyTracker = null;
58
+ var inputLatencySingleKeyTracker = null;
59
+ var inputLatencyRenderedTracker = null;
58
60
  if (browserFreezeTracking !== null && browserFreezeTracking !== void 0 && browserFreezeTracking.trackInteractionType) {
59
61
  interactionType = (0, _frozenEditor.setInteractionType)(_analytics.BROWSER_FREEZE_INTERACTION_TYPE.LOADING);
60
62
  }
@@ -78,19 +80,80 @@ var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserF
78
80
  var shouldTrackSeverity = (inputTracking === null || inputTracking === void 0 ? void 0 : inputTracking.trackSeverity) || DEFAULT_TRACK_SEVERITY_ENABLED;
79
81
  var severityThresholdNormal = (inputTracking === null || inputTracking === void 0 ? void 0 : inputTracking.severityNormalThreshold) || DEFAULT_TRACK_SEVERITY_THRESHOLD_NORMAL;
80
82
  var severityThresholdDegraded = (inputTracking === null || inputTracking === void 0 ? void 0 : inputTracking.severityDegradedThreshold) || DEFAULT_TRACK_SEVERITY_THRESHOLD_DEGRADED;
83
+ var createDispatchSample = function createDispatchSample(action, view) {
84
+ return function (time, severity) {
85
+ var _getContextIdentifier2;
86
+ var state = view.state;
87
+ var nodesCount = getNodeCount(state);
88
+ var samplePayload = {
89
+ action: action,
90
+ actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
91
+ attributes: _objectSpread(_objectSpread({
92
+ time: time,
93
+ nodeSize: state.doc.nodeSize
94
+ }, nodesCount), {}, {
95
+ participants: (0, _getParticipantsCount.getParticipantsCount)(state),
96
+ objectId: (_getContextIdentifier2 = (0, _contextIdentifier.getContextIdentifier)(state)) === null || _getContextIdentifier2 === void 0 ? void 0 : _getContextIdentifier2.objectId,
97
+ severity: shouldTrackSeverity ? severity : undefined
98
+ }),
99
+ eventType: _analytics.EVENT_TYPE.OPERATIONAL
100
+ };
101
+ dispatchAnalyticsEvent(samplePayload);
102
+ };
103
+ };
104
+ var createDispatchAverage = function createDispatchAverage(action, view) {
105
+ return function (_ref, severity) {
106
+ var _getContextIdentifier3;
107
+ var mean = _ref.mean,
108
+ median = _ref.median,
109
+ sampleSize = _ref.sampleSize;
110
+ var state = view.state;
111
+ var nodeCount = getNodeCount(state);
112
+ var averagePayload = {
113
+ action: action,
114
+ actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
115
+ attributes: _objectSpread(_objectSpread({
116
+ mean: mean,
117
+ median: median,
118
+ sampleSize: sampleSize
119
+ }, nodeCount), {}, {
120
+ nodeSize: state.doc.nodeSize,
121
+ severity: shouldTrackSeverity ? severity : undefined,
122
+ participants: (0, _getParticipantsCount.getParticipantsCount)(state),
123
+ objectId: (_getContextIdentifier3 = (0, _contextIdentifier.getContextIdentifier)(state)) === null || _getContextIdentifier3 === void 0 ? void 0 : _getContextIdentifier3.objectId
124
+ }),
125
+ eventType: _analytics.EVENT_TYPE.OPERATIONAL
126
+ };
127
+ dispatchAnalyticsEvent(averagePayload);
128
+ };
129
+ };
81
130
  return new _safePlugin.SafePlugin({
82
131
  key: frozenEditorPluginKey,
83
132
  props: (0, _utils.isPerformanceAPIAvailable)() ? {
84
133
  handleTextInput: function handleTextInput(view) {
85
- var _inputLatencyTracker;
86
- (_inputLatencyTracker = inputLatencyTracker) === null || _inputLatencyTracker === void 0 ? void 0 : _inputLatencyTracker.start();
87
134
  if (browserFreezeTracking !== null && browserFreezeTracking !== void 0 && browserFreezeTracking.trackInteractionType) {
88
135
  interactionType = _analytics.BROWSER_FREEZE_INTERACTION_TYPE.TYPING;
89
136
  }
90
- requestAnimationFrame(function () {
91
- var _inputLatencyTracker2;
92
- (_inputLatencyTracker2 = inputLatencyTracker) === null || _inputLatencyTracker2 === void 0 ? void 0 : _inputLatencyTracker2.end();
93
- });
137
+ if (inputLatencyTracker) {
138
+ var end = inputLatencyTracker.start();
139
+
140
+ // This is called after all handleTextInput events are executed which means first handleTextInput time incorporates following handleTextInput processing time
141
+ // Also this is called before browser rendering so it doesn't count it.
142
+ requestAnimationFrame(end);
143
+ }
144
+ if (inputLatencySingleKeyTracker) {
145
+ var _end = inputLatencySingleKeyTracker.start();
146
+
147
+ // This is executed before next handleTextInput when multiple keypress events are in one animation frame
148
+ // so it tracks individual keypress processing time
149
+ Promise.resolve().then(_end);
150
+ }
151
+ if (inputLatencyRenderedTracker) {
152
+ var _end2 = inputLatencyRenderedTracker.start();
153
+
154
+ // This is called at the next event loop so it counts browser rendering time.
155
+ setTimeout(_end2);
156
+ }
94
157
  return false;
95
158
  },
96
159
  handleDOMEvents: browserFreezeTracking !== null && browserFreezeTracking !== void 0 && browserFreezeTracking.trackInteractionType ? {
@@ -118,10 +181,10 @@ var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserF
118
181
  onSampleStart: function onSampleStart() {
119
182
  experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.start(_ufo.EditorExperience.typing);
120
183
  },
121
- onSampleEnd: function onSampleEnd(time, _ref) {
122
- var _getContextIdentifier2;
123
- var isSlow = _ref.isSlow,
124
- severity = _ref.severity;
184
+ onSampleEnd: function onSampleEnd(time, _ref2) {
185
+ var _getContextIdentifier4;
186
+ var isSlow = _ref2.isSlow,
187
+ severity = _ref2.severity;
125
188
  var state = _view.state;
126
189
  var nodesCount = getNodeCount(state);
127
190
  if (isSlow) {
@@ -133,54 +196,13 @@ var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserF
133
196
  nodeSize: state.doc.nodeSize
134
197
  }, nodesCount), {}, {
135
198
  participants: (0, _getParticipantsCount.getParticipantsCount)(state),
136
- objectId: (_getContextIdentifier2 = (0, _contextIdentifier.getContextIdentifier)(state)) === null || _getContextIdentifier2 === void 0 ? void 0 : _getContextIdentifier2.objectId,
199
+ objectId: (_getContextIdentifier4 = (0, _contextIdentifier.getContextIdentifier)(state)) === null || _getContextIdentifier4 === void 0 ? void 0 : _getContextIdentifier4.objectId,
137
200
  time: time,
138
201
  severity: shouldTrackSeverity ? severity : undefined
139
202
  }));
140
203
  },
141
- dispatchSample: function dispatchSample(time, severity) {
142
- var _getContextIdentifier3;
143
- var state = _view.state;
144
- var nodesCount = getNodeCount(state);
145
- var samplePayload = {
146
- action: _analytics.ACTION.INPUT_PERF_SAMPLING,
147
- actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
148
- attributes: _objectSpread(_objectSpread({
149
- time: time,
150
- nodeSize: state.doc.nodeSize
151
- }, nodesCount), {}, {
152
- participants: (0, _getParticipantsCount.getParticipantsCount)(state),
153
- objectId: (_getContextIdentifier3 = (0, _contextIdentifier.getContextIdentifier)(state)) === null || _getContextIdentifier3 === void 0 ? void 0 : _getContextIdentifier3.objectId,
154
- severity: shouldTrackSeverity ? severity : undefined
155
- }),
156
- eventType: _analytics.EVENT_TYPE.OPERATIONAL
157
- };
158
- dispatchAnalyticsEvent(samplePayload);
159
- },
160
- dispatchAverage: function dispatchAverage(_ref2, severity) {
161
- var _getContextIdentifier4;
162
- var mean = _ref2.mean,
163
- median = _ref2.median,
164
- sampleSize = _ref2.sampleSize;
165
- var state = _view.state;
166
- var nodeCount = getNodeCount(state);
167
- var averagePayload = {
168
- action: _analytics.ACTION.INPUT_PERF_SAMPLING_AVG,
169
- actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
170
- attributes: _objectSpread(_objectSpread({
171
- mean: mean,
172
- median: median,
173
- sampleSize: sampleSize
174
- }, nodeCount), {}, {
175
- nodeSize: state.doc.nodeSize,
176
- severity: shouldTrackSeverity ? severity : undefined,
177
- participants: (0, _getParticipantsCount.getParticipantsCount)(state),
178
- objectId: (_getContextIdentifier4 = (0, _contextIdentifier.getContextIdentifier)(state)) === null || _getContextIdentifier4 === void 0 ? void 0 : _getContextIdentifier4.objectId
179
- }),
180
- eventType: _analytics.EVENT_TYPE.OPERATIONAL
181
- };
182
- dispatchAnalyticsEvent(averagePayload);
183
- },
204
+ dispatchSample: createDispatchSample(_analytics.ACTION.INPUT_PERF_SAMPLING, _view),
205
+ dispatchAverage: createDispatchAverage(_analytics.ACTION.INPUT_PERF_SAMPLING_AVG, _view),
184
206
  onSlowInput: function onSlowInput(time) {
185
207
  var _getContextIdentifier5;
186
208
  var state = _view.state;
@@ -200,6 +222,26 @@ var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserF
200
222
  }
201
223
  });
202
224
  }
225
+ if (inputTracking !== null && inputTracking !== void 0 && inputTracking.trackSingleKeypress) {
226
+ inputLatencySingleKeyTracker = new _inputLatencyTracking.default({
227
+ samplingRate: samplingRate,
228
+ slowThreshold: slowThreshold,
229
+ normalThreshold: severityThresholdNormal,
230
+ degradedThreshold: severityThresholdDegraded,
231
+ dispatchSample: createDispatchSample(_analytics.ACTION.INPUT_PERF_SAMPLING_SINGLE_KEYPRESS, _view),
232
+ dispatchAverage: createDispatchAverage(_analytics.ACTION.INPUT_PERF_SAMPLING_SINGLE_KEYPRESS_AVG, _view)
233
+ });
234
+ }
235
+ if (inputTracking !== null && inputTracking !== void 0 && inputTracking.trackRenderingTime) {
236
+ inputLatencyRenderedTracker = new _inputLatencyTracking.default({
237
+ samplingRate: samplingRate,
238
+ slowThreshold: slowThreshold,
239
+ normalThreshold: severityThresholdNormal,
240
+ degradedThreshold: severityThresholdDegraded,
241
+ dispatchSample: createDispatchSample(_analytics.ACTION.INPUT_PERF_SAMPLING_RENDERED, _view),
242
+ dispatchAverage: createDispatchAverage(_analytics.ACTION.INPUT_PERF_SAMPLING_RENDERED_AVG, _view)
243
+ });
244
+ }
203
245
  var observer;
204
246
  try {
205
247
  var _observer = new PerformanceObserver(function (list) {
@@ -219,8 +261,8 @@ var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserF
219
261
  } catch (e) {}
220
262
  return {
221
263
  destroy: function destroy() {
222
- var _inputLatencyTracker3;
223
- (_inputLatencyTracker3 = inputLatencyTracker) === null || _inputLatencyTracker3 === void 0 ? void 0 : _inputLatencyTracker3.flush();
264
+ var _inputLatencyTracker;
265
+ (_inputLatencyTracker = inputLatencyTracker) === null || _inputLatencyTracker === void 0 ? void 0 : _inputLatencyTracker.flush();
224
266
  observer === null || observer === void 0 ? void 0 : observer.disconnect();
225
267
  }
226
268
  };
@@ -24,7 +24,6 @@ var InputLatencyTracker = /*#__PURE__*/function () {
24
24
  (0, _classCallCheck2.default)(this, InputLatencyTracker);
25
25
  (0, _defineProperty2.default)(this, "samples", []);
26
26
  (0, _defineProperty2.default)(this, "total", 0);
27
- this.currentStart = null;
28
27
  this.samplingRate = samplingRate;
29
28
  this.slowThreshold = slowThreshold;
30
29
  this.normalThreshold = normalThreshold;
@@ -38,34 +37,34 @@ var InputLatencyTracker = /*#__PURE__*/function () {
38
37
  (0, _createClass2.default)(InputLatencyTracker, [{
39
38
  key: "start",
40
39
  value: function start() {
41
- this.currentStart = performance.now();
40
+ var _this = this;
41
+ var currentStart = performance.now();
42
42
  if (this.samples.length + 1 === this.samplingRate) {
43
43
  var _this$onSampleStart;
44
44
  (_this$onSampleStart = this.onSampleStart) === null || _this$onSampleStart === void 0 ? void 0 : _this$onSampleStart.call(this);
45
45
  }
46
- }
47
- }, {
48
- key: "end",
49
- value: function end() {
50
- if (this.currentStart === null) {
51
- return;
52
- }
53
- var isSlow = false;
54
- var time = (0, _getPerformanceTiming.getTimeSince)(this.currentStart);
55
- this.push(time);
56
- if (time > this.slowThreshold) {
57
- var _this$onSlowInput;
58
- (_this$onSlowInput = this.onSlowInput) === null || _this$onSlowInput === void 0 ? void 0 : _this$onSlowInput.call(this, time);
59
- isSlow = true;
60
- }
61
- if (this.samples.length === this.samplingRate) {
62
- var _this$onSampleEnd;
63
- this.flush();
64
- (_this$onSampleEnd = this.onSampleEnd) === null || _this$onSampleEnd === void 0 ? void 0 : _this$onSampleEnd.call(this, time, {
65
- isSlow: isSlow,
66
- severity: this.severity(time)
67
- });
68
- }
46
+ var end = function end() {
47
+ if (currentStart === null) {
48
+ return;
49
+ }
50
+ var isSlow = false;
51
+ var time = (0, _getPerformanceTiming.getTimeSince)(currentStart);
52
+ _this.push(time);
53
+ if (time > _this.slowThreshold) {
54
+ var _this$onSlowInput;
55
+ (_this$onSlowInput = _this.onSlowInput) === null || _this$onSlowInput === void 0 ? void 0 : _this$onSlowInput.call(_this, time);
56
+ isSlow = true;
57
+ }
58
+ if (_this.samples.length === _this.samplingRate) {
59
+ var _this$onSampleEnd;
60
+ _this.flush();
61
+ (_this$onSampleEnd = _this.onSampleEnd) === null || _this$onSampleEnd === void 0 ? void 0 : _this$onSampleEnd.call(_this, time, {
62
+ isSlow: isSlow,
63
+ severity: _this.severity(time)
64
+ });
65
+ }
66
+ };
67
+ return end;
69
68
  }
70
69
  }, {
71
70
  key: "flush",
@@ -31,6 +31,7 @@ var BlockTypeButton = function BlockTypeButton(props) {
31
31
  className: "block-type-btn",
32
32
  disabled: props.disabled,
33
33
  onClick: props.onClick,
34
+ onKeyDown: props.onKeyDown,
34
35
  title: labelTextStyles,
35
36
  "aria-label": labelTextStyles,
36
37
  "aria-haspopup": true,
@@ -24,6 +24,8 @@ var _styled = require("./styled");
24
24
  var _keymaps = require("../../../../keymaps");
25
25
  var _blocktypeButton = require("./blocktype-button");
26
26
  var _keymaps2 = require("@atlaskit/editor-common/keymaps");
27
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
28
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
27
29
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
28
30
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
29
31
  var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
@@ -37,18 +39,30 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
37
39
  }
38
40
  _this = _super.call.apply(_super, [this].concat(args));
39
41
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
40
- active: false
42
+ active: false,
43
+ isOpenedByKeyboard: false
41
44
  });
42
45
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOpenChange", function (attrs) {
43
- _this.setState({
44
- active: attrs.isOpen
45
- });
46
+ _this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
47
+ active: attrs.isOpen,
48
+ isOpenedByKeyboard: attrs.isOpenedByKeyboard
49
+ }));
46
50
  });
47
51
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleTriggerClick", function () {
48
52
  _this.onOpenChange({
49
- isOpen: !_this.state.active
53
+ isOpen: !_this.state.active,
54
+ isOpenedByKeyboard: false
50
55
  });
51
56
  });
57
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleTriggerByKeyboard", function (event) {
58
+ if (event.key === 'Enter' || event.key === ' ') {
59
+ event.preventDefault();
60
+ _this.onOpenChange({
61
+ isOpen: !_this.state.active,
62
+ isOpenedByKeyboard: true
63
+ });
64
+ }
65
+ });
52
66
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createItems", function () {
53
67
  var formatMessage = _this.props.intl.formatMessage;
54
68
  var _this$props$pluginSta = _this.props.pluginState,
@@ -85,9 +99,9 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
85
99
  var blockType = item.value;
86
100
  _this.props.setBlockType(blockType.name);
87
101
  if (shouldCloseMenu) {
88
- _this.setState({
102
+ _this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
89
103
  active: false
90
- });
104
+ }));
91
105
  }
92
106
  });
93
107
  return _this;
@@ -95,7 +109,10 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
95
109
  (0, _createClass2.default)(ToolbarBlockType, [{
96
110
  key: "render",
97
111
  value: function render() {
98
- var active = this.state.active;
112
+ var _this2 = this;
113
+ var _this$state = this.state,
114
+ active = _this$state.active,
115
+ isOpenedByKeyboard = _this$state.isOpenedByKeyboard;
99
116
  var _this$props = this.props,
100
117
  popupsMountPoint = _this$props.popupsMountPoint,
101
118
  popupsBoundariesElement = _this$props.popupsBoundariesElement,
@@ -137,7 +154,15 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
137
154
  zIndex: _editorSharedStyles.akEditorMenuZIndex,
138
155
  fitHeight: 360,
139
156
  fitWidth: 106,
140
- shouldUseDefaultRole: true
157
+ shouldUseDefaultRole: true,
158
+ shouldFocusFirstItem: function shouldFocusFirstItem() {
159
+ if (isOpenedByKeyboard) {
160
+ _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {
161
+ isOpenedByKeyboard: false
162
+ }));
163
+ }
164
+ return isOpenedByKeyboard;
165
+ }
141
166
  }, (0, _react2.jsx)(_blocktypeButton.BlockTypeButton, {
142
167
  isSmall: isSmall,
143
168
  isReducedSpacing: isReducedSpacing,
@@ -145,6 +170,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
145
170
  disabled: false,
146
171
  title: blockTypeTitles[0],
147
172
  onClick: this.handleTriggerClick,
173
+ onKeyDown: this.handleTriggerByKeyboard,
148
174
  formatMessage: formatMessage,
149
175
  "aria-expanded": active
150
176
  }, longestDropdownMenuItem)), (0, _react2.jsx)("span", {
@@ -160,6 +186,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
160
186
  disabled: true,
161
187
  title: blockTypeTitles[0],
162
188
  onClick: this.handleTriggerClick,
189
+ onKeyDown: this.handleTriggerByKeyboard,
163
190
  formatMessage: formatMessage,
164
191
  "aria-expanded": active
165
192
  }, longestDropdownMenuItem), (0, _react2.jsx)("span", {
@@ -133,11 +133,12 @@ var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
133
133
  }, {
134
134
  key: "render",
135
135
  value: function render() {
136
+ var platform = this.reactComponentProps.platform;
136
137
  return /*#__PURE__*/_react.default.createElement(WrappedBlockCard, {
137
138
  node: this.node,
138
139
  view: this.view,
139
140
  getPos: this.getPos,
140
- platform: this.reactComponentProps.platform
141
+ platform: platform
141
142
  });
142
143
  }
143
144
  }]);
@@ -18,6 +18,9 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
18
18
  var _adfSchema = require("@atlaskit/adf-schema");
19
19
  var _utils = require("../utils");
20
20
  var _doc = require("../pm-plugins/doc");
21
+ var _analyticsNext = require("@atlaskit/analytics-next");
22
+ var _state = require("../pm-plugins/util/state");
23
+ var _utils2 = require("@atlaskit/editor-common/utils");
21
24
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
22
25
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
23
26
  function Card(SmartCardComponent, UnsupportedComponent) {
@@ -40,6 +43,7 @@ function Card(SmartCardComponent, UnsupportedComponent) {
40
43
  (0, _createClass2.default)(_class, [{
41
44
  key: "render",
42
45
  value: function render() {
46
+ var _getPluginState;
43
47
  var _titleUrlPairFromNode = (0, _utils.titleUrlPairFromNode)(this.props.node),
44
48
  url = _titleUrlPairFromNode.url;
45
49
  if (url && !(0, _adfSchema.isSafeUrl)(url)) {
@@ -58,10 +62,20 @@ function Card(SmartCardComponent, UnsupportedComponent) {
58
62
  }
59
63
  }
60
64
  var cardContext = this.context.contextAdapter ? this.context.contextAdapter.card : undefined;
61
- return /*#__PURE__*/_react.default.createElement(SmartCardComponent, (0, _extends2.default)({
65
+ var editorAppearance = (_getPluginState = (0, _state.getPluginState)(this.props.view.state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.editorAppearance;
66
+ var analyticsEditorAppearance = (0, _utils2.getAnalyticsEditorAppearance)(editorAppearance);
67
+ return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
68
+ data: {
69
+ attributes: {
70
+ location: analyticsEditorAppearance
71
+ },
72
+ // Below is added for the future implementation of Linking Platform namespaced analytics context
73
+ location: analyticsEditorAppearance
74
+ }
75
+ }, /*#__PURE__*/_react.default.createElement(SmartCardComponent, (0, _extends2.default)({
62
76
  key: url,
63
77
  cardContext: cardContext
64
- }, this.props));
78
+ }, this.props)));
65
79
  }
66
80
  }, {
67
81
  key: "componentDidCatch",
@@ -23,7 +23,8 @@ var _resolve = require("./util/resolve");
23
23
  var _state = require("./util/state");
24
24
  var createPlugin = function createPlugin(options) {
25
25
  return function (pmPluginFactoryParams) {
26
- var platform = options.platform,
26
+ var editorAppearance = options.editorAppearance,
27
+ platform = options.platform,
27
28
  allowResizing = options.allowResizing,
28
29
  useAlternativePreloader = options.useAlternativePreloader,
29
30
  fullWidthMode = options.fullWidthMode,
@@ -37,7 +38,8 @@ var createPlugin = function createPlugin(options) {
37
38
  cards: [],
38
39
  showLinkingToolbar: false,
39
40
  smartLinkEvents: undefined,
40
- createAnalyticsEvent: createAnalyticsEvent
41
+ createAnalyticsEvent: createAnalyticsEvent,
42
+ editorAppearance: editorAppearance
41
43
  };
42
44
  },
43
45
  apply: function apply(tr, pluginState) {
@@ -91,7 +91,10 @@ var createClipboardSerializer = function createClipboardSerializer(schema, getEd
91
91
  var parentTable = (0, _prosemirrorUtils.findParentNodeOfType)(schema.nodes.table)(selection);
92
92
  var attributes = parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs;
93
93
  var newTable = schema.nodes.table;
94
- var newTableNode = newTable.createChecked(_objectSpread({}, attributes), content);
94
+ // Explicitly remove local id since we are creating a new table and it should have a unique local id which will be generated.
95
+ var newTableNode = newTable.createChecked(_objectSpread(_objectSpread({}, attributes), {}, {
96
+ localId: undefined
97
+ }), content);
95
98
  var newContent = _prosemirrorModel.Fragment.from(newTableNode);
96
99
  // Pass updated content into original ProseMirror serializeFragment function.
97
100
  // Currently incorrectly typed in @Types. See this GitHub thread: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/57668
@@ -21,10 +21,9 @@ var _initialize = require("./events/initialize");
21
21
  var _pluginState = require("./plugin-state");
22
22
  var _pluginKey = require("./plugin-key");
23
23
  var _analytics = require("./analytics");
24
- var _fireAnalyticsEvent = require("../analytics/fire-analytics-event");
25
- var _analytics2 = require("../analytics");
24
+ var _analytics2 = require("@atlaskit/editor-common/analytics");
26
25
  var createPlugin = function createPlugin(dispatch, providerFactory, collabProviderCallback, options) {
27
- var fireAnalyticsCallback = (0, _fireAnalyticsEvent.fireAnalyticsEvent)(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
26
+ var fireAnalyticsCallback = (0, _analytics2.fireAnalyticsEvent)(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
28
27
  return new _safePlugin.SafePlugin({
29
28
  key: _pluginKey.pluginKey,
30
29
  state: {
@@ -32,6 +32,11 @@ var messages = (0, _reactIntlNext.defineMessages)({
32
32
  defaultMessage: 'Delete element',
33
33
  description: 'Title text for confirm modal when deleting an extension linked to a data consumer.'
34
34
  },
35
+ unnamedSource: {
36
+ id: 'fabric.editor.extension.sourceNoTitledName',
37
+ defaultMessage: 'this element',
38
+ description: 'The current element without preset name been selected'
39
+ },
35
40
  confirmDeleteLinkedModalOKButton: {
36
41
  id: 'fabric.editor.extension.confirmDeleteLinkedModalOKButton',
37
42
  defaultMessage: 'Delete',
@@ -130,11 +135,12 @@ var getToolbarConfig = function getToolbarConfig() {
130
135
  var confirmDialog;
131
136
  if ((0, _utils2.isReferencedSource)(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node)) {
132
137
  confirmDialog = function confirmDialog() {
138
+ var localSourceName = formatMessage(messages.unnamedSource);
133
139
  return {
134
140
  title: formatMessage(messages.deleteElementTitle),
135
141
  okButtonLabel: formatMessage(messages.confirmDeleteLinkedModalOKButton),
136
142
  message: formatMessage(messages.confirmDeleteLinkedModalMessage, {
137
- nodeName: (0, _utils2.getNodeName)(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node)
143
+ nodeName: (0, _utils2.getNodeName)(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node) || localSourceName
138
144
  }),
139
145
  isReferentialityDialog: true,
140
146
  getChildrenInfo: function getChildrenInfo() {
@@ -26,6 +26,7 @@ var _FindReplace = _interopRequireDefault(require("./FindReplace"));
26
26
  var _types = require("../../analytics/types");
27
27
  var _keymaps = require("../../../keymaps");
28
28
  var _keymaps2 = require("@atlaskit/editor-common/keymaps");
29
+ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
29
30
  var _templateObject, _templateObject2, _templateObject3;
30
31
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
32
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -97,7 +98,10 @@ var FindReplaceToolbarButton = /*#__PURE__*/function (_React$PureComponent) {
97
98
  },
98
99
  fitWidth: 352,
99
100
  zIndex: stackBelowOtherEditorFloatingPanels,
100
- disableArrowKeyNavigation: true,
101
+ arrowKeyNavigationProviderOptions: {
102
+ type: _uiMenu.ArrowKeyNavigationType.MENU,
103
+ disableArrowKeyNavigation: true
104
+ },
101
105
  trigger: (0, _react2.jsx)(_ToolbarButton.default, {
102
106
  buttonId: _ToolbarButton.TOOLBAR_BUTTON.FIND_REPLACE,
103
107
  spacing: isReducedSpacing ? 'none' : 'default',
@@ -19,6 +19,7 @@ var _default = function _default(_ref) {
19
19
  icon = _ref.icon,
20
20
  iconAfter = _ref.iconAfter,
21
21
  onClick = _ref.onClick,
22
+ onKeyDown = _ref.onKeyDown,
22
23
  onMouseEnter = _ref.onMouseEnter,
23
24
  onMouseLeave = _ref.onMouseLeave,
24
25
  onFocus = _ref.onFocus,
@@ -71,6 +72,7 @@ var _default = function _default(_ref) {
71
72
  iconBefore: icon || undefined,
72
73
  iconAfter: iconAfter,
73
74
  onClick: onClick,
75
+ onKeyDown: onKeyDown,
74
76
  isSelected: selected,
75
77
  isDisabled: disabled,
76
78
  testId: testId,
@@ -16,6 +16,7 @@ var _messages = _interopRequireDefault(require("./messages"));
16
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
17
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
18
  var CheckboxModal = function CheckboxModal(props) {
19
+ var _options$getChildrenI;
19
20
  var _useState = (0, _react.useState)(false),
20
21
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
21
22
  isChecked = _useState2[0],
@@ -29,9 +30,10 @@ var CheckboxModal = function CheckboxModal(props) {
29
30
  var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(_messages.default.confirmModalOK);
30
31
  var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(_messages.default.confirmModalCancel);
31
32
  var checkboxlabel = options === null || options === void 0 ? void 0 : options.checkboxLabel;
33
+ var childrenInfo = options === null || options === void 0 ? void 0 : (_options$getChildrenI = options.getChildrenInfo) === null || _options$getChildrenI === void 0 ? void 0 : _options$getChildrenI.call(options);
32
34
  var ListComponent = function ListComponent(_ref) {
33
35
  var nodes = _ref.nodes;
34
- if (!nodes) {
36
+ if (nodes.length === 0) {
35
37
  return null;
36
38
  }
37
39
  return /*#__PURE__*/_react.default.createElement("ul", null, nodes.map(function (node) {
@@ -56,8 +58,8 @@ var CheckboxModal = function CheckboxModal(props) {
56
58
  testId: testId
57
59
  }, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalHeader, null, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTitle, {
58
60
  appearance: "warning"
59
- }, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement("p", null, options === null || options === void 0 ? void 0 : options.message), (options === null || options === void 0 ? void 0 : options.getChildrenInfo) && /*#__PURE__*/_react.default.createElement(ListComponent, {
60
- nodes: options === null || options === void 0 ? void 0 : options.getChildrenInfo()
61
+ }, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement("p", null, options === null || options === void 0 ? void 0 : options.message), !!(childrenInfo !== null && childrenInfo !== void 0 && childrenInfo.length) && /*#__PURE__*/_react.default.createElement(ListComponent, {
62
+ nodes: childrenInfo
61
63
  }), /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_checkbox.Checkbox, {
62
64
  isChecked: isChecked,
63
65
  onChange: function onChange() {