@atlaskit/editor-common 72.2.0 → 72.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (573) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/__tests_external__/cases/fundamentals/collection.js +0 -5
  3. package/dist/cjs/__tests_external__/cases/fundamentals/test-cases/editor-is-present.js +0 -4
  4. package/dist/cjs/__tests_external__/cases/fundamentals/test-cases/editor-typing.js +0 -8
  5. package/dist/cjs/__tests_external__/cases/smart-links/index.js +0 -4
  6. package/dist/cjs/__tests_external__/cases/smart-links/test-cases/block/delete.js +1 -8
  7. package/dist/cjs/__tests_external__/cases/smart-links/test-cases/block/edit.js +2 -12
  8. package/dist/cjs/__tests_external__/cases/smart-links/test-cases/block/index.js +0 -6
  9. package/dist/cjs/__tests_external__/cases/smart-links/test-cases/block/insert.js +1 -8
  10. package/dist/cjs/__tests_external__/cases/smart-links/test-cases/embed/delete.js +1 -8
  11. package/dist/cjs/__tests_external__/cases/smart-links/test-cases/embed/edit.js +2 -12
  12. package/dist/cjs/__tests_external__/cases/smart-links/test-cases/embed/index.js +0 -6
  13. package/dist/cjs/__tests_external__/cases/smart-links/test-cases/embed/insert.js +1 -8
  14. package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/delete.js +1 -8
  15. package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/edit.js +2 -12
  16. package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/index.js +0 -7
  17. package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/insert.js +1 -8
  18. package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/unlink.js +1 -8
  19. package/dist/cjs/__tests_external__/cases/smart-links/test-cases/url/index.js +0 -4
  20. package/dist/cjs/__tests_external__/cases/smart-links/test-cases/url/insert.js +1 -8
  21. package/dist/cjs/__tests_external__/index.js +0 -3
  22. package/dist/cjs/__tests_external__/page-objects/Editor.js +0 -16
  23. package/dist/cjs/__tests_external__/page-objects/EditorSmartLink.js +0 -29
  24. package/dist/cjs/__tests_external__/page-objects/Renderer.js +0 -14
  25. package/dist/cjs/analytics/index.js +0 -1
  26. package/dist/cjs/analytics/types/enums.js +0 -15
  27. package/dist/cjs/analytics/types/extension-events.js +0 -4
  28. package/dist/cjs/analytics/types/format-events.js +0 -3
  29. package/dist/cjs/analytics/types/general-events.js +0 -7
  30. package/dist/cjs/analytics/types/index.js +0 -14
  31. package/dist/cjs/analytics/types/inline-comment-events.js +0 -1
  32. package/dist/cjs/analytics/types/insert-events.js +0 -7
  33. package/dist/cjs/analytics/types/list-events.js +0 -3
  34. package/dist/cjs/analytics/types/node-events.js +0 -3
  35. package/dist/cjs/analytics/types/substitute-events.js +0 -3
  36. package/dist/cjs/analytics/types/table-events.js +0 -4
  37. package/dist/cjs/analytics/types/toolbar-button.js +0 -1
  38. package/dist/cjs/analytics/types/utils.js +0 -3
  39. package/dist/cjs/core-utils/index.js +0 -1
  40. package/dist/cjs/core-utils/inside.js +2 -5
  41. package/dist/cjs/emoji.js +0 -3
  42. package/dist/cjs/event-dispatcher/index.js +0 -14
  43. package/dist/cjs/extensions/combine-extension-providers.js +2 -6
  44. package/dist/cjs/extensions/default-extension-provider.js +0 -26
  45. package/dist/cjs/extensions/extension-fields-helpers.js +0 -35
  46. package/dist/cjs/extensions/extension-handlers.js +0 -27
  47. package/dist/cjs/extensions/index.js +0 -8
  48. package/dist/cjs/extensions/manifest-helpers.js +4 -30
  49. package/dist/cjs/extensions/module-helpers.js +17 -89
  50. package/dist/cjs/extensions/types/field-definitions.js +1 -10
  51. package/dist/cjs/extensions/types/index.js +0 -1
  52. package/dist/cjs/extensions.js +0 -1
  53. package/dist/cjs/i18n/cs.js +0 -1
  54. package/dist/cjs/i18n/da.js +0 -1
  55. package/dist/cjs/i18n/de.js +0 -1
  56. package/dist/cjs/i18n/en.js +0 -1
  57. package/dist/cjs/i18n/en_GB.js +0 -1
  58. package/dist/cjs/i18n/en_ZZ.js +0 -1
  59. package/dist/cjs/i18n/es.js +0 -1
  60. package/dist/cjs/i18n/et.js +0 -1
  61. package/dist/cjs/i18n/fi.js +0 -1
  62. package/dist/cjs/i18n/fr.js +0 -1
  63. package/dist/cjs/i18n/hu.js +0 -1
  64. package/dist/cjs/i18n/index.js +0 -27
  65. package/dist/cjs/i18n/it.js +0 -1
  66. package/dist/cjs/i18n/ja.js +0 -1
  67. package/dist/cjs/i18n/ko.js +0 -1
  68. package/dist/cjs/i18n/languages.js +0 -1
  69. package/dist/cjs/i18n/nb.js +0 -1
  70. package/dist/cjs/i18n/nl.js +0 -1
  71. package/dist/cjs/i18n/pl.js +0 -1
  72. package/dist/cjs/i18n/pt_BR.js +0 -1
  73. package/dist/cjs/i18n/pt_PT.js +0 -1
  74. package/dist/cjs/i18n/ru.js +0 -1
  75. package/dist/cjs/i18n/sk.js +0 -1
  76. package/dist/cjs/i18n/sv.js +0 -1
  77. package/dist/cjs/i18n/th.js +0 -1
  78. package/dist/cjs/i18n/tr.js +0 -1
  79. package/dist/cjs/i18n/uk.js +0 -1
  80. package/dist/cjs/i18n/vi.js +0 -1
  81. package/dist/cjs/i18n/zh.js +0 -1
  82. package/dist/cjs/i18n/zh_TW.js +0 -1
  83. package/dist/cjs/icons/index.js +0 -11
  84. package/dist/cjs/icons/shared/PanelErrorIcon.js +0 -7
  85. package/dist/cjs/icons/shared/PanelInfoIcon.js +0 -7
  86. package/dist/cjs/icons/shared/PanelNoteIcon.js +0 -7
  87. package/dist/cjs/icons/shared/PanelSuccessIcon.js +0 -7
  88. package/dist/cjs/icons/shared/PanelWarningIcon.js +0 -7
  89. package/dist/cjs/icons/shared/table.js +1 -3
  90. package/dist/cjs/in-product.js +0 -1
  91. package/dist/cjs/keymaps/index.js +2 -50
  92. package/dist/cjs/mention.js +0 -3
  93. package/dist/cjs/messages/codeBidiWarning.js +0 -2
  94. package/dist/cjs/messages/codeBlockCopyButton.js +0 -2
  95. package/dist/cjs/messages/index.js +0 -8
  96. package/dist/cjs/messages/insert-block.js +0 -2
  97. package/dist/cjs/messages/link.js +0 -2
  98. package/dist/cjs/messages/unsupportedContent.js +0 -2
  99. package/dist/cjs/node-width/index.js +2 -20
  100. package/dist/cjs/normalize-feature-flags.js +6 -25
  101. package/dist/cjs/panel.js +0 -1
  102. package/dist/cjs/provider-factory/context.js +3 -17
  103. package/dist/cjs/provider-factory/provider-factory.js +0 -19
  104. package/dist/cjs/provider-factory/with-providers.js +5 -28
  105. package/dist/cjs/provider-factory.js +0 -4
  106. package/dist/cjs/provider-helpers/combine-providers.js +3 -33
  107. package/dist/cjs/provider-helpers/index.js +0 -2
  108. package/dist/cjs/provider-helpers/promise-helpers.js +3 -15
  109. package/dist/cjs/react-node-view/index.js +18 -48
  110. package/dist/cjs/safe-plugin/index.js +1 -14
  111. package/dist/cjs/selection/gap-cursor/selection.js +8 -44
  112. package/dist/cjs/selection/gap-cursor/utils/index.js +0 -2
  113. package/dist/cjs/selection/gap-cursor/utils/is-ignored.js +0 -2
  114. package/dist/cjs/selection/gap-cursor/utils/is-valid-target-node.js +0 -3
  115. package/dist/cjs/selection/index.js +0 -4
  116. package/dist/cjs/selection/types.js +0 -1
  117. package/dist/cjs/selection/utils.js +0 -12
  118. package/dist/cjs/styles/index.js +0 -23
  119. package/dist/cjs/styles/shared/annotation.js +0 -11
  120. package/dist/cjs/styles/shared/block-marks.js +0 -5
  121. package/dist/cjs/styles/shared/blockquote.js +0 -7
  122. package/dist/cjs/styles/shared/code-block.js +0 -11
  123. package/dist/cjs/styles/shared/code-mark.js +0 -9
  124. package/dist/cjs/styles/shared/column-layout.js +0 -6
  125. package/dist/cjs/styles/shared/date.js +0 -5
  126. package/dist/cjs/styles/shared/emoji.js +0 -2
  127. package/dist/cjs/styles/shared/extension.js +0 -2
  128. package/dist/cjs/styles/shared/headings.js +0 -7
  129. package/dist/cjs/styles/shared/indentation.js +0 -5
  130. package/dist/cjs/styles/shared/layout.js +0 -2
  131. package/dist/cjs/styles/shared/link.js +0 -5
  132. package/dist/cjs/styles/shared/lists.js +2 -21
  133. package/dist/cjs/styles/shared/media-single.js +0 -5
  134. package/dist/cjs/styles/shared/panel.js +15 -41
  135. package/dist/cjs/styles/shared/paragraph.js +0 -6
  136. package/dist/cjs/styles/shared/rule.js +2 -10
  137. package/dist/cjs/styles/shared/shadow.js +1 -9
  138. package/dist/cjs/styles/shared/smart-card.js +0 -3
  139. package/dist/cjs/styles/shared/table.js +0 -20
  140. package/dist/cjs/styles/shared/task-decision.js +0 -6
  141. package/dist/cjs/styles/shared/text-color.js +0 -5
  142. package/dist/cjs/styles/shared/whitespace.js +0 -5
  143. package/dist/cjs/transforms/expand.js +7 -16
  144. package/dist/cjs/transforms/extension.js +2 -7
  145. package/dist/cjs/transforms/index.js +0 -3
  146. package/dist/cjs/transforms/layout.js +9 -15
  147. package/dist/cjs/type-ahead/index.js +0 -3
  148. package/dist/cjs/types/annotation/emitter.js +0 -11
  149. package/dist/cjs/types/annotation/index.js +0 -1
  150. package/dist/cjs/types/index.js +0 -4
  151. package/dist/cjs/types/toolbar.js +0 -5
  152. package/dist/cjs/ufo/experience-store.js +0 -24
  153. package/dist/cjs/ufo/index.js +0 -1
  154. package/dist/cjs/ui/BaseTheme/index.js +3 -21
  155. package/dist/cjs/ui/Caption/index.js +5 -29
  156. package/dist/cjs/ui/Caption/messages.js +0 -2
  157. package/dist/cjs/ui/DropList/index.js +18 -51
  158. package/dist/cjs/ui/Emoji/index.js +7 -33
  159. package/dist/cjs/ui/ErrorBoundary/index.js +0 -22
  160. package/dist/cjs/ui/Expand/index.js +5 -31
  161. package/dist/cjs/ui/IntlErrorBoundary/index.js +0 -24
  162. package/dist/cjs/ui/IntlProviderIfMissingWrapper/index.js +0 -9
  163. package/dist/cjs/ui/Layer/index.js +16 -46
  164. package/dist/cjs/ui/Layer/internal/helpers.js +0 -2
  165. package/dist/cjs/ui/MediaSingle/grid.js +0 -8
  166. package/dist/cjs/ui/MediaSingle/index.js +26 -44
  167. package/dist/cjs/ui/MediaSingle/link.js +0 -5
  168. package/dist/cjs/ui/MediaSingle/styled.js +11 -50
  169. package/dist/cjs/ui/Mention/index.js +5 -27
  170. package/dist/cjs/ui/Mention/mention-with-profilecard.js +8 -16
  171. package/dist/cjs/ui/Mention/mention-with-providers.js +5 -33
  172. package/dist/cjs/ui/Messages/index.js +0 -18
  173. package/dist/cjs/ui/OverflowShadow/index.js +3 -48
  174. package/dist/cjs/ui/OverflowShadow/shadowObserver.js +2 -26
  175. package/dist/cjs/ui/Popup/index.js +28 -80
  176. package/dist/cjs/ui/Popup/utils.js +67 -132
  177. package/dist/cjs/ui/PortalProvider/PortalProviderThemesProvider.js +3 -13
  178. package/dist/cjs/ui/PortalProvider/index.js +16 -73
  179. package/dist/cjs/ui/UnsupportedBlock/index.js +5 -29
  180. package/dist/cjs/ui/UnsupportedInline/index.js +5 -29
  181. package/dist/cjs/ui/WidthProvider/index.js +1 -31
  182. package/dist/cjs/ui/WithCreateAnalyticsEvent/index.js +2 -16
  183. package/dist/cjs/ui/clear-next-sibling-margin-top.js +0 -5
  184. package/dist/cjs/ui/index.js +0 -23
  185. package/dist/cjs/ui/unsupported-content-helper.js +0 -5
  186. package/dist/cjs/ui/with-outer-listeners.js +0 -25
  187. package/dist/cjs/ui-color/ColorPalette/Color/index.js +12 -40
  188. package/dist/cjs/ui-color/ColorPalette/Color/styles.js +0 -10
  189. package/dist/cjs/ui-color/ColorPalette/Palettes/cellBackgroundColorPalette.js +0 -7
  190. package/dist/cjs/ui-color/ColorPalette/Palettes/common.js +4 -12
  191. package/dist/cjs/ui-color/ColorPalette/Palettes/getColorMessage.js +0 -3
  192. package/dist/cjs/ui-color/ColorPalette/Palettes/index.js +0 -1
  193. package/dist/cjs/ui-color/ColorPalette/Palettes/paletteMessages.js +0 -3
  194. package/dist/cjs/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +0 -8
  195. package/dist/cjs/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +0 -10
  196. package/dist/cjs/ui-color/ColorPalette/Palettes/statusColorPalette.js +0 -7
  197. package/dist/cjs/ui-color/ColorPalette/Palettes/textColorPalette.js +2 -9
  198. package/dist/cjs/ui-color/ColorPalette/index.js +16 -38
  199. package/dist/cjs/ui-color/ColorPalette/styles.js +0 -6
  200. package/dist/cjs/ui-color/index.js +0 -9
  201. package/dist/cjs/ui-menu/Dropdown/index.js +14 -38
  202. package/dist/cjs/ui-menu/DropdownMenu/index.js +23 -75
  203. package/dist/cjs/ui-menu/MenuArrowKeyNavigationProvider/index.js +16 -49
  204. package/dist/cjs/ui-menu/ToolbarButton/index.js +23 -46
  205. package/dist/cjs/ui-menu/ToolbarButton/styles.js +0 -6
  206. package/dist/cjs/ui-menu/index.js +0 -7
  207. package/dist/cjs/ui-react/ReactEditorViewContext.js +0 -4
  208. package/dist/cjs/ui-react/index.js +0 -3
  209. package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +9 -49
  210. package/dist/cjs/utils/analytics.js +0 -14
  211. package/dist/cjs/utils/annotation/index.js +5 -13
  212. package/dist/cjs/utils/breakout.js +7 -23
  213. package/dist/cjs/utils/browser-extensions.js +28 -56
  214. package/dist/cjs/utils/browser.js +0 -2
  215. package/dist/cjs/utils/builder.js +0 -10
  216. package/dist/cjs/utils/collab.js +0 -4
  217. package/dist/cjs/utils/compare-props.js +11 -25
  218. package/dist/cjs/utils/compareNodes.js +7 -53
  219. package/dist/cjs/utils/compose.js +0 -2
  220. package/dist/cjs/utils/date.js +4 -25
  221. package/dist/cjs/utils/dom.js +6 -29
  222. package/dist/cjs/utils/editor-core-utils.js +8 -33
  223. package/dist/cjs/utils/error-reporter.js +0 -7
  224. package/dist/cjs/utils/extension-handler.js +0 -3
  225. package/dist/cjs/utils/get-performance-options.js +4 -12
  226. package/dist/cjs/utils/getModeFromTheme.js +0 -1
  227. package/dist/cjs/utils/imageLoader.js +0 -27
  228. package/dist/cjs/utils/index.js +0 -40
  229. package/dist/cjs/utils/is-text-input.js +5 -11
  230. package/dist/cjs/utils/list.js +3 -13
  231. package/dist/cjs/utils/macro.js +1 -7
  232. package/dist/cjs/utils/nodes.js +4 -31
  233. package/dist/cjs/utils/outdated-browsers.js +0 -10
  234. package/dist/cjs/utils/performance/hooks/use-component-render-tracking/index.js +4 -14
  235. package/dist/cjs/utils/performance/is-performance-api-available.js +0 -4
  236. package/dist/cjs/utils/performance/measure-render.js +1 -11
  237. package/dist/cjs/utils/performance/measure-tti.js +3 -17
  238. package/dist/cjs/utils/performance/measure.js +0 -11
  239. package/dist/cjs/utils/performance/navigation.js +0 -5
  240. package/dist/cjs/utils/plugin-state-factory.js +3 -11
  241. package/dist/cjs/utils/profiler/render-count.js +4 -24
  242. package/dist/cjs/utils/referentiality.js +30 -88
  243. package/dist/cjs/utils/sendLogs.js +0 -2
  244. package/dist/cjs/utils/should-force-tracking.js +4 -7
  245. package/dist/cjs/utils/slice.js +0 -17
  246. package/dist/cjs/utils/table.js +4 -13
  247. package/dist/cjs/utils/track-unsupported-content.js +14 -39
  248. package/dist/cjs/utils/traversor.js +0 -14
  249. package/dist/cjs/utils/unsupportedContent/get-unsupported-content-level-data.js +5 -21
  250. package/dist/cjs/utils/validate-using-spec.js +5 -36
  251. package/dist/cjs/utils/validator.js +26 -188
  252. package/dist/cjs/validator.js +0 -1
  253. package/dist/cjs/version.json +1 -1
  254. package/dist/cjs/with-plugin-state/index.js +7 -55
  255. package/dist/es2019/__tests_external__/cases/fundamentals/test-cases/editor-typing.js +0 -3
  256. package/dist/es2019/__tests_external__/cases/smart-links/test-cases/block/delete.js +0 -1
  257. package/dist/es2019/__tests_external__/cases/smart-links/test-cases/block/edit.js +0 -2
  258. package/dist/es2019/__tests_external__/cases/smart-links/test-cases/block/insert.js +0 -1
  259. package/dist/es2019/__tests_external__/cases/smart-links/test-cases/embed/delete.js +0 -1
  260. package/dist/es2019/__tests_external__/cases/smart-links/test-cases/embed/edit.js +0 -2
  261. package/dist/es2019/__tests_external__/cases/smart-links/test-cases/embed/insert.js +0 -1
  262. package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/delete.js +0 -1
  263. package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/edit.js +0 -2
  264. package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/insert.js +0 -1
  265. package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/unlink.js +0 -1
  266. package/dist/es2019/__tests_external__/cases/smart-links/test-cases/url/insert.js +0 -1
  267. package/dist/es2019/__tests_external__/page-objects/Editor.js +0 -4
  268. package/dist/es2019/__tests_external__/page-objects/EditorSmartLink.js +0 -28
  269. package/dist/es2019/__tests_external__/page-objects/Renderer.js +0 -2
  270. package/dist/es2019/analytics/types/enums.js +0 -15
  271. package/dist/es2019/analytics/types/extension-events.js +2 -3
  272. package/dist/es2019/analytics/types/format-events.js +0 -3
  273. package/dist/es2019/analytics/types/general-events.js +0 -7
  274. package/dist/es2019/analytics/types/inline-comment-events.js +0 -1
  275. package/dist/es2019/analytics/types/insert-events.js +0 -7
  276. package/dist/es2019/analytics/types/list-events.js +0 -3
  277. package/dist/es2019/analytics/types/node-events.js +0 -3
  278. package/dist/es2019/analytics/types/substitute-events.js +0 -3
  279. package/dist/es2019/analytics/types/table-events.js +2 -3
  280. package/dist/es2019/analytics/types/toolbar-button.js +0 -1
  281. package/dist/es2019/analytics/types/utils.js +0 -3
  282. package/dist/es2019/event-dispatcher/index.js +1 -12
  283. package/dist/es2019/extensions/combine-extension-providers.js +0 -5
  284. package/dist/es2019/extensions/default-extension-provider.js +0 -8
  285. package/dist/es2019/extensions/extension-fields-helpers.js +4 -10
  286. package/dist/es2019/extensions/extension-handlers.js +1 -8
  287. package/dist/es2019/extensions/manifest-helpers.js +2 -7
  288. package/dist/es2019/extensions/module-helpers.js +10 -43
  289. package/dist/es2019/extensions/types/field-definitions.js +1 -0
  290. package/dist/es2019/icons/index.js +1 -3
  291. package/dist/es2019/icons/shared/PanelErrorIcon.js +0 -2
  292. package/dist/es2019/icons/shared/PanelInfoIcon.js +0 -2
  293. package/dist/es2019/icons/shared/PanelNoteIcon.js +0 -2
  294. package/dist/es2019/icons/shared/PanelSuccessIcon.js +0 -2
  295. package/dist/es2019/icons/shared/PanelWarningIcon.js +0 -2
  296. package/dist/es2019/keymaps/index.js +0 -24
  297. package/dist/es2019/node-width/index.js +3 -14
  298. package/dist/es2019/normalize-feature-flags.js +1 -11
  299. package/dist/es2019/provider-factory/context.js +0 -1
  300. package/dist/es2019/provider-factory/provider-factory.js +0 -25
  301. package/dist/es2019/provider-factory/with-providers.js +2 -8
  302. package/dist/es2019/provider-helpers/combine-providers.js +3 -13
  303. package/dist/es2019/provider-helpers/promise-helpers.js +3 -10
  304. package/dist/es2019/react-node-view/index.js +10 -34
  305. package/dist/es2019/safe-plugin/index.js +1 -1
  306. package/dist/es2019/selection/gap-cursor/selection.js +6 -31
  307. package/dist/es2019/selection/types.js +0 -1
  308. package/dist/es2019/selection/utils.js +0 -8
  309. package/dist/es2019/styles/shared/headings.js +3 -2
  310. package/dist/es2019/styles/shared/lists.js +0 -8
  311. package/dist/es2019/styles/shared/panel.js +13 -12
  312. package/dist/es2019/styles/shared/paragraph.js +2 -1
  313. package/dist/es2019/styles/shared/rule.js +2 -1
  314. package/dist/es2019/styles/shared/shadow.js +2 -0
  315. package/dist/es2019/styles/shared/table.js +1 -5
  316. package/dist/es2019/transforms/expand.js +3 -3
  317. package/dist/es2019/transforms/extension.js +3 -4
  318. package/dist/es2019/transforms/layout.js +9 -10
  319. package/dist/es2019/type-ahead/index.js +0 -3
  320. package/dist/es2019/types/annotation/emitter.js +0 -8
  321. package/dist/es2019/types/index.js +0 -2
  322. package/dist/es2019/types/toolbar.js +0 -5
  323. package/dist/es2019/ufo/experience-store.js +0 -25
  324. package/dist/es2019/ui/BaseTheme/index.js +0 -2
  325. package/dist/es2019/ui/Caption/index.js +0 -2
  326. package/dist/es2019/ui/DropList/index.js +9 -25
  327. package/dist/es2019/ui/Emoji/index.js +0 -11
  328. package/dist/es2019/ui/ErrorBoundary/index.js +0 -8
  329. package/dist/es2019/ui/Expand/index.js +2 -10
  330. package/dist/es2019/ui/IntlErrorBoundary/index.js +0 -8
  331. package/dist/es2019/ui/IntlProviderIfMissingWrapper/index.js +0 -4
  332. package/dist/es2019/ui/Layer/index.js +13 -29
  333. package/dist/es2019/ui/Layer/internal/helpers.js +0 -2
  334. package/dist/es2019/ui/MediaSingle/index.js +7 -12
  335. package/dist/es2019/ui/MediaSingle/styled.js +2 -25
  336. package/dist/es2019/ui/Mention/index.js +0 -5
  337. package/dist/es2019/ui/Mention/mention-with-providers.js +0 -8
  338. package/dist/es2019/ui/Messages/index.js +1 -2
  339. package/dist/es2019/ui/OverflowShadow/index.js +0 -32
  340. package/dist/es2019/ui/OverflowShadow/shadowObserver.js +0 -14
  341. package/dist/es2019/ui/Popup/index.js +11 -59
  342. package/dist/es2019/ui/Popup/utils.js +18 -57
  343. package/dist/es2019/ui/PortalProvider/PortalProviderThemesProvider.js +2 -1
  344. package/dist/es2019/ui/PortalProvider/index.js +7 -35
  345. package/dist/es2019/ui/UnsupportedBlock/index.js +0 -2
  346. package/dist/es2019/ui/UnsupportedInline/index.js +0 -2
  347. package/dist/es2019/ui/WidthProvider/index.js +0 -9
  348. package/dist/es2019/ui/WithCreateAnalyticsEvent/index.js +0 -1
  349. package/dist/es2019/ui/clear-next-sibling-margin-top.js +2 -1
  350. package/dist/es2019/ui/unsupported-content-helper.js +0 -4
  351. package/dist/es2019/ui/with-outer-listeners.js +0 -8
  352. package/dist/es2019/ui-color/ColorPalette/Color/index.js +0 -10
  353. package/dist/es2019/ui-color/ColorPalette/Color/styles.js +1 -4
  354. package/dist/es2019/ui-color/ColorPalette/Palettes/common.js +2 -4
  355. package/dist/es2019/ui-color/ColorPalette/Palettes/getColorMessage.js +0 -2
  356. package/dist/es2019/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +5 -3
  357. package/dist/es2019/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +4 -4
  358. package/dist/es2019/ui-color/ColorPalette/Palettes/statusColorPalette.js +0 -2
  359. package/dist/es2019/ui-color/ColorPalette/Palettes/textColorPalette.js +2 -3
  360. package/dist/es2019/ui-color/ColorPalette/index.js +3 -10
  361. package/dist/es2019/ui-menu/Dropdown/index.js +0 -7
  362. package/dist/es2019/ui-menu/DropdownMenu/index.js +1 -21
  363. package/dist/es2019/ui-menu/MenuArrowKeyNavigationProvider/index.js +8 -31
  364. package/dist/es2019/ui-menu/ToolbarButton/index.js +2 -6
  365. package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +4 -22
  366. package/dist/es2019/utils/analytics.js +0 -8
  367. package/dist/es2019/utils/annotation/index.js +3 -7
  368. package/dist/es2019/utils/breakout.js +6 -13
  369. package/dist/es2019/utils/browser-extensions.js +10 -22
  370. package/dist/es2019/utils/browser.js +0 -2
  371. package/dist/es2019/utils/builder.js +0 -2
  372. package/dist/es2019/utils/collab.js +0 -2
  373. package/dist/es2019/utils/compare-props.js +5 -4
  374. package/dist/es2019/utils/compareNodes.js +3 -42
  375. package/dist/es2019/utils/date.js +4 -11
  376. package/dist/es2019/utils/dom.js +6 -19
  377. package/dist/es2019/utils/editor-core-utils.js +6 -11
  378. package/dist/es2019/utils/error-reporter.js +0 -4
  379. package/dist/es2019/utils/get-performance-options.js +3 -3
  380. package/dist/es2019/utils/imageLoader.js +0 -11
  381. package/dist/es2019/utils/is-text-input.js +1 -2
  382. package/dist/es2019/utils/list.js +3 -7
  383. package/dist/es2019/utils/macro.js +0 -3
  384. package/dist/es2019/utils/nodes.js +3 -11
  385. package/dist/es2019/utils/outdated-browsers.js +0 -8
  386. package/dist/es2019/utils/performance/hooks/use-component-render-tracking/index.js +0 -4
  387. package/dist/es2019/utils/performance/is-performance-api-available.js +0 -1
  388. package/dist/es2019/utils/performance/measure-render.js +2 -10
  389. package/dist/es2019/utils/performance/measure-tti.js +3 -11
  390. package/dist/es2019/utils/performance/measure.js +0 -6
  391. package/dist/es2019/utils/performance/navigation.js +0 -3
  392. package/dist/es2019/utils/plugin-state-factory.js +1 -10
  393. package/dist/es2019/utils/profiler/render-count.js +10 -23
  394. package/dist/es2019/utils/referentiality.js +24 -65
  395. package/dist/es2019/utils/should-force-tracking.js +2 -1
  396. package/dist/es2019/utils/slice.js +1 -9
  397. package/dist/es2019/utils/table.js +2 -6
  398. package/dist/es2019/utils/track-unsupported-content.js +6 -11
  399. package/dist/es2019/utils/traversor.js +0 -13
  400. package/dist/es2019/utils/unsupportedContent/get-unsupported-content-level-data.js +3 -15
  401. package/dist/es2019/utils/validate-using-spec.js +3 -25
  402. package/dist/es2019/utils/validator.js +10 -149
  403. package/dist/es2019/version.json +1 -1
  404. package/dist/es2019/with-plugin-state/index.js +5 -46
  405. package/dist/esm/__tests_external__/cases/fundamentals/test-cases/editor-typing.js +0 -3
  406. package/dist/esm/__tests_external__/cases/smart-links/test-cases/block/delete.js +1 -2
  407. package/dist/esm/__tests_external__/cases/smart-links/test-cases/block/edit.js +2 -4
  408. package/dist/esm/__tests_external__/cases/smart-links/test-cases/block/insert.js +1 -2
  409. package/dist/esm/__tests_external__/cases/smart-links/test-cases/embed/delete.js +1 -2
  410. package/dist/esm/__tests_external__/cases/smart-links/test-cases/embed/edit.js +2 -4
  411. package/dist/esm/__tests_external__/cases/smart-links/test-cases/embed/insert.js +1 -2
  412. package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/delete.js +1 -2
  413. package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/edit.js +2 -4
  414. package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/insert.js +1 -2
  415. package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/unlink.js +1 -2
  416. package/dist/esm/__tests_external__/cases/smart-links/test-cases/url/insert.js +1 -2
  417. package/dist/esm/__tests_external__/page-objects/Editor.js +0 -9
  418. package/dist/esm/__tests_external__/page-objects/EditorSmartLink.js +0 -23
  419. package/dist/esm/__tests_external__/page-objects/Renderer.js +0 -8
  420. package/dist/esm/analytics/types/enums.js +0 -15
  421. package/dist/esm/analytics/types/extension-events.js +2 -3
  422. package/dist/esm/analytics/types/format-events.js +0 -3
  423. package/dist/esm/analytics/types/general-events.js +0 -7
  424. package/dist/esm/analytics/types/inline-comment-events.js +0 -1
  425. package/dist/esm/analytics/types/insert-events.js +0 -7
  426. package/dist/esm/analytics/types/list-events.js +0 -3
  427. package/dist/esm/analytics/types/node-events.js +0 -3
  428. package/dist/esm/analytics/types/substitute-events.js +0 -3
  429. package/dist/esm/analytics/types/table-events.js +2 -3
  430. package/dist/esm/analytics/types/toolbar-button.js +0 -1
  431. package/dist/esm/analytics/types/utils.js +0 -3
  432. package/dist/esm/core-utils/inside.js +2 -2
  433. package/dist/esm/event-dispatcher/index.js +1 -9
  434. package/dist/esm/extensions/combine-extension-providers.js +2 -4
  435. package/dist/esm/extensions/default-extension-provider.js +0 -22
  436. package/dist/esm/extensions/extension-fields-helpers.js +3 -29
  437. package/dist/esm/extensions/extension-handlers.js +1 -18
  438. package/dist/esm/extensions/manifest-helpers.js +4 -17
  439. package/dist/esm/extensions/module-helpers.js +17 -74
  440. package/dist/esm/extensions/types/field-definitions.js +1 -0
  441. package/dist/esm/icons/index.js +1 -3
  442. package/dist/esm/icons/shared/PanelErrorIcon.js +0 -2
  443. package/dist/esm/icons/shared/PanelInfoIcon.js +0 -2
  444. package/dist/esm/icons/shared/PanelNoteIcon.js +0 -2
  445. package/dist/esm/icons/shared/PanelSuccessIcon.js +0 -2
  446. package/dist/esm/icons/shared/PanelWarningIcon.js +0 -2
  447. package/dist/esm/keymaps/index.js +2 -28
  448. package/dist/esm/node-width/index.js +3 -14
  449. package/dist/esm/normalize-feature-flags.js +6 -19
  450. package/dist/esm/provider-factory/context.js +3 -5
  451. package/dist/esm/provider-factory/provider-factory.js +0 -18
  452. package/dist/esm/provider-factory/with-providers.js +5 -23
  453. package/dist/esm/provider-helpers/combine-providers.js +3 -27
  454. package/dist/esm/provider-helpers/promise-helpers.js +3 -10
  455. package/dist/esm/react-node-view/index.js +18 -42
  456. package/dist/esm/safe-plugin/index.js +1 -7
  457. package/dist/esm/selection/gap-cursor/selection.js +8 -35
  458. package/dist/esm/selection/types.js +0 -1
  459. package/dist/esm/selection/utils.js +0 -8
  460. package/dist/esm/styles/shared/annotation.js +0 -2
  461. package/dist/esm/styles/shared/block-marks.js +0 -2
  462. package/dist/esm/styles/shared/blockquote.js +0 -2
  463. package/dist/esm/styles/shared/code-block.js +0 -2
  464. package/dist/esm/styles/shared/code-mark.js +0 -2
  465. package/dist/esm/styles/shared/column-layout.js +0 -2
  466. package/dist/esm/styles/shared/date.js +0 -2
  467. package/dist/esm/styles/shared/headings.js +3 -4
  468. package/dist/esm/styles/shared/indentation.js +0 -2
  469. package/dist/esm/styles/shared/link.js +0 -2
  470. package/dist/esm/styles/shared/lists.js +2 -13
  471. package/dist/esm/styles/shared/media-single.js +0 -2
  472. package/dist/esm/styles/shared/panel.js +15 -17
  473. package/dist/esm/styles/shared/paragraph.js +2 -3
  474. package/dist/esm/styles/shared/rule.js +2 -3
  475. package/dist/esm/styles/shared/shadow.js +2 -2
  476. package/dist/esm/styles/shared/table.js +1 -8
  477. package/dist/esm/styles/shared/task-decision.js +0 -2
  478. package/dist/esm/styles/shared/text-color.js +0 -2
  479. package/dist/esm/styles/shared/whitespace.js +0 -2
  480. package/dist/esm/transforms/expand.js +7 -7
  481. package/dist/esm/transforms/extension.js +3 -4
  482. package/dist/esm/transforms/layout.js +9 -10
  483. package/dist/esm/type-ahead/index.js +0 -3
  484. package/dist/esm/types/annotation/emitter.js +0 -6
  485. package/dist/esm/types/index.js +0 -2
  486. package/dist/esm/types/toolbar.js +0 -5
  487. package/dist/esm/ufo/experience-store.js +0 -19
  488. package/dist/esm/ui/BaseTheme/index.js +3 -7
  489. package/dist/esm/ui/Caption/index.js +5 -14
  490. package/dist/esm/ui/DropList/index.js +18 -47
  491. package/dist/esm/ui/Emoji/index.js +7 -26
  492. package/dist/esm/ui/ErrorBoundary/index.js +0 -14
  493. package/dist/esm/ui/Expand/index.js +5 -15
  494. package/dist/esm/ui/IntlErrorBoundary/index.js +0 -16
  495. package/dist/esm/ui/IntlProviderIfMissingWrapper/index.js +0 -4
  496. package/dist/esm/ui/Layer/index.js +16 -39
  497. package/dist/esm/ui/Layer/internal/helpers.js +0 -2
  498. package/dist/esm/ui/MediaSingle/index.js +25 -32
  499. package/dist/esm/ui/MediaSingle/link.js +0 -2
  500. package/dist/esm/ui/MediaSingle/styled.js +11 -39
  501. package/dist/esm/ui/Mention/index.js +5 -18
  502. package/dist/esm/ui/Mention/mention-with-profilecard.js +8 -8
  503. package/dist/esm/ui/Mention/mention-with-providers.js +5 -21
  504. package/dist/esm/ui/Messages/index.js +1 -4
  505. package/dist/esm/ui/OverflowShadow/index.js +3 -46
  506. package/dist/esm/ui/OverflowShadow/shadowObserver.js +2 -27
  507. package/dist/esm/ui/Popup/index.js +28 -80
  508. package/dist/esm/ui/Popup/utils.js +67 -123
  509. package/dist/esm/ui/PortalProvider/PortalProviderThemesProvider.js +3 -3
  510. package/dist/esm/ui/PortalProvider/index.js +17 -61
  511. package/dist/esm/ui/UnsupportedBlock/index.js +5 -11
  512. package/dist/esm/ui/UnsupportedInline/index.js +5 -11
  513. package/dist/esm/ui/WidthProvider/index.js +1 -17
  514. package/dist/esm/ui/WithCreateAnalyticsEvent/index.js +2 -10
  515. package/dist/esm/ui/clear-next-sibling-margin-top.js +2 -3
  516. package/dist/esm/ui/unsupported-content-helper.js +0 -4
  517. package/dist/esm/ui/with-outer-listeners.js +0 -15
  518. package/dist/esm/ui-color/ColorPalette/Color/index.js +12 -27
  519. package/dist/esm/ui-color/ColorPalette/Color/styles.js +1 -6
  520. package/dist/esm/ui-color/ColorPalette/Palettes/common.js +5 -7
  521. package/dist/esm/ui-color/ColorPalette/Palettes/getColorMessage.js +0 -2
  522. package/dist/esm/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +2 -4
  523. package/dist/esm/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +0 -5
  524. package/dist/esm/ui-color/ColorPalette/Palettes/statusColorPalette.js +0 -2
  525. package/dist/esm/ui-color/ColorPalette/Palettes/textColorPalette.js +2 -3
  526. package/dist/esm/ui-color/ColorPalette/index.js +16 -24
  527. package/dist/esm/ui-color/ColorPalette/styles.js +0 -2
  528. package/dist/esm/ui-menu/Dropdown/index.js +14 -27
  529. package/dist/esm/ui-menu/DropdownMenu/index.js +23 -56
  530. package/dist/esm/ui-menu/MenuArrowKeyNavigationProvider/index.js +16 -42
  531. package/dist/esm/ui-menu/ToolbarButton/index.js +23 -32
  532. package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +9 -38
  533. package/dist/esm/utils/analytics.js +0 -8
  534. package/dist/esm/utils/annotation/index.js +5 -9
  535. package/dist/esm/utils/breakout.js +8 -15
  536. package/dist/esm/utils/browser-extensions.js +28 -55
  537. package/dist/esm/utils/browser.js +0 -2
  538. package/dist/esm/utils/builder.js +0 -4
  539. package/dist/esm/utils/collab.js +0 -2
  540. package/dist/esm/utils/compare-props.js +10 -15
  541. package/dist/esm/utils/compareNodes.js +7 -48
  542. package/dist/esm/utils/compose.js +0 -1
  543. package/dist/esm/utils/date.js +4 -11
  544. package/dist/esm/utils/dom.js +6 -19
  545. package/dist/esm/utils/editor-core-utils.js +8 -13
  546. package/dist/esm/utils/error-reporter.js +0 -5
  547. package/dist/esm/utils/get-performance-options.js +7 -7
  548. package/dist/esm/utils/imageLoader.js +0 -18
  549. package/dist/esm/utils/is-text-input.js +5 -6
  550. package/dist/esm/utils/list.js +3 -7
  551. package/dist/esm/utils/macro.js +1 -5
  552. package/dist/esm/utils/nodes.js +5 -13
  553. package/dist/esm/utils/outdated-browsers.js +0 -8
  554. package/dist/esm/utils/performance/hooks/use-component-render-tracking/index.js +4 -10
  555. package/dist/esm/utils/performance/is-performance-api-available.js +0 -1
  556. package/dist/esm/utils/performance/measure-render.js +2 -9
  557. package/dist/esm/utils/performance/measure-tti.js +3 -12
  558. package/dist/esm/utils/performance/measure.js +0 -6
  559. package/dist/esm/utils/performance/navigation.js +0 -3
  560. package/dist/esm/utils/plugin-state-factory.js +3 -10
  561. package/dist/esm/utils/profiler/render-count.js +4 -21
  562. package/dist/esm/utils/referentiality.js +30 -80
  563. package/dist/esm/utils/should-force-tracking.js +4 -4
  564. package/dist/esm/utils/slice.js +1 -10
  565. package/dist/esm/utils/table.js +4 -8
  566. package/dist/esm/utils/track-unsupported-content.js +14 -31
  567. package/dist/esm/utils/traversor.js +0 -13
  568. package/dist/esm/utils/unsupportedContent/get-unsupported-content-level-data.js +5 -18
  569. package/dist/esm/utils/validate-using-spec.js +5 -29
  570. package/dist/esm/utils/validator.js +26 -170
  571. package/dist/esm/version.json +1 -1
  572. package/dist/esm/with-plugin-state/index.js +7 -55
  573. package/package.json +4 -4
@@ -1,14 +1,14 @@
1
1
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
2
2
  import { getParticipantsCount } from './collab';
3
- import { startMeasure, stopMeasure } from './performance/measure'; // This was existing logic when converting from ReactNodeView
4
- // our current sampling for this event is not bound by node.type
3
+ import { startMeasure, stopMeasure } from './performance/measure';
5
4
 
5
+ // This was existing logic when converting from ReactNodeView
6
+ // our current sampling for this event is not bound by node.type
6
7
  let nodeViewRenderedEventsCounter = 0;
7
8
  const DEFAULT_SAMPLING_RATE = 100;
8
9
  const DEFAULT_SLOW_THRESHOLD = 7;
9
10
  export function getPerformanceOptions(view) {
10
11
  var _nodeViewTracking$sam, _nodeViewTracking$slo;
11
-
12
12
  // TODO: ED-15663
13
13
  // Please, do not copy or use this kind of code below
14
14
  // @ts-ignore
@@ -4,11 +4,9 @@ import React, { Component } from 'react';
4
4
  export const withImageLoader = Wrapped => class WithImageLoader extends Component {
5
5
  constructor(...args) {
6
6
  super(...args);
7
-
8
7
  _defineProperty(this, "state", {
9
8
  imageStatus: 'loading'
10
9
  });
11
-
12
10
  _defineProperty(this, "onLoad", () => {
13
11
  this.setState({
14
12
  imageStatus: 'complete'
@@ -16,7 +14,6 @@ export const withImageLoader = Wrapped => class WithImageLoader extends Componen
16
14
  const {
17
15
  onExternalImageLoaded
18
16
  } = this.props;
19
-
20
17
  if (onExternalImageLoaded && this.img) {
21
18
  onExternalImageLoaded({
22
19
  width: this.img.naturalWidth,
@@ -24,18 +21,15 @@ export const withImageLoader = Wrapped => class WithImageLoader extends Componen
24
21
  });
25
22
  }
26
23
  });
27
-
28
24
  _defineProperty(this, "onError", () => {
29
25
  this.setState({
30
26
  imageStatus: 'error'
31
27
  });
32
28
  });
33
29
  }
34
-
35
30
  componentDidMount() {
36
31
  this.fetchImage(this.props);
37
32
  }
38
-
39
33
  UNSAFE_componentWillReceiveProps(nextProps) {
40
34
  if (nextProps.url !== this.props.url) {
41
35
  this.setState({
@@ -44,7 +38,6 @@ export const withImageLoader = Wrapped => class WithImageLoader extends Componen
44
38
  this.fetchImage(nextProps);
45
39
  }
46
40
  }
47
-
48
41
  componentWillUnmount() {
49
42
  if (this.img) {
50
43
  this.img.removeEventListener('load', this.onLoad);
@@ -52,7 +45,6 @@ export const withImageLoader = Wrapped => class WithImageLoader extends Componen
52
45
  this.img = null;
53
46
  }
54
47
  }
55
-
56
48
  fetchImage({
57
49
  url
58
50
  }) {
@@ -62,11 +54,9 @@ export const withImageLoader = Wrapped => class WithImageLoader extends Componen
62
54
  this.img.addEventListener('load', this.onLoad);
63
55
  this.img.addEventListener('error', this.onError);
64
56
  }
65
-
66
57
  this.img.src = url;
67
58
  }
68
59
  }
69
-
70
60
  render() {
71
61
  const {
72
62
  imageStatus
@@ -75,5 +65,4 @@ export const withImageLoader = Wrapped => class WithImageLoader extends Componen
75
65
  imageStatus: imageStatus
76
66
  }));
77
67
  }
78
-
79
68
  };
@@ -1,12 +1,11 @@
1
1
  // TODO: remove from editor-core utils, re-export from editor-common
2
+
2
3
  import { ReplaceStep } from 'prosemirror-transform';
3
4
  export const isTextInput = tr => {
4
5
  const [step] = tr.steps;
5
-
6
6
  if (!step || !(step instanceof ReplaceStep)) {
7
7
  return false;
8
8
  }
9
-
10
9
  const {
11
10
  slice: {
12
11
  content
@@ -1,29 +1,25 @@
1
- export const DEFAULT_ORDER = 1; // resolve "order" to a safe, 0+ integer, otherwise return undefined
1
+ export const DEFAULT_ORDER = 1;
2
+
3
+ // resolve "order" to a safe, 0+ integer, otherwise return undefined
2
4
  // Note: Any changes to this function should also be made to "resolveStart"
3
5
  // in packages/editor/adf-schema/src/schema/nodes/ordered-list.ts
4
-
5
6
  export const resolveOrder = order => {
6
7
  const num = Number(order);
7
-
8
8
  if (Number.isNaN(num)) {
9
9
  return;
10
10
  }
11
-
12
11
  if (num < 0) {
13
12
  return;
14
13
  }
15
-
16
14
  return Math.floor(Math.max(num, 0));
17
15
  };
18
16
  export const getOrderFromOrderedListNode = orderedListNode => {
19
17
  var _orderedListNode$attr, _resolveOrder;
20
-
21
18
  const order = orderedListNode === null || orderedListNode === void 0 ? void 0 : (_orderedListNode$attr = orderedListNode.attrs) === null || _orderedListNode$attr === void 0 ? void 0 : _orderedListNode$attr.order;
22
19
  return (_resolveOrder = resolveOrder(order)) !== null && _resolveOrder !== void 0 ? _resolveOrder : DEFAULT_ORDER;
23
20
  };
24
21
  export const getItemCounterDigitsSize = options => {
25
22
  var _resolveOrder2, _String, _String$split, _String$split$;
26
-
27
23
  const order = (_resolveOrder2 = resolveOrder(options.order)) !== null && _resolveOrder2 !== void 0 ? _resolveOrder2 : DEFAULT_ORDER;
28
24
  const itemsCount = typeof options.itemsCount === 'number' ? options.itemsCount : 0;
29
25
  const largestCounter = order + (itemsCount - 1);
@@ -5,11 +5,9 @@ export const getExtensionLozengeData = ({
5
5
  if (!node.attrs.parameters) {
6
6
  return;
7
7
  }
8
-
9
8
  const {
10
9
  macroMetadata
11
10
  } = node.attrs.parameters;
12
-
13
11
  if (macroMetadata && macroMetadata.placeholder) {
14
12
  let placeholderData;
15
13
  macroMetadata.placeholder.forEach(placeholder => {
@@ -19,6 +17,5 @@ export const getExtensionLozengeData = ({
19
17
  });
20
18
  return placeholderData;
21
19
  }
22
-
23
20
  return;
24
21
  };
@@ -13,11 +13,9 @@ export const findChangedNodesFromTransaction = tr => {
13
13
  slice
14
14
  } = step;
15
15
  const size = slice && slice.content ? slice.content.size : 0;
16
-
17
16
  for (let i = from; i <= to + size; i++) {
18
17
  if (i <= tr.doc.content.size) {
19
18
  const topLevelNode = tr.doc.resolve(i).node(1);
20
-
21
19
  if (topLevelNode && !nodes.find(n => n === topLevelNode)) {
22
20
  nodes.push(topLevelNode);
23
21
  }
@@ -32,55 +30,49 @@ export const validNode = node => {
32
30
  } catch (error) {
33
31
  return false;
34
32
  }
35
-
36
33
  return true;
37
34
  };
38
- /** Validates prosemirror nodes, and returns true only if all nodes are valid */
39
35
 
36
+ /** Validates prosemirror nodes, and returns true only if all nodes are valid */
40
37
  export const validateNodes = nodes => nodes.every(validNode);
41
38
  export const isType = (node, type) => type && node && node.type === type;
42
39
  export const isParagraph = (node, schema) => isType(node, schema.nodes.paragraph);
43
40
  export const isText = (node, schema) => isType(node, schema.nodes.text);
44
41
  export const isLinkMark = (node, schema) => isType(node, schema.marks.link);
45
42
  export let SelectedState;
43
+
46
44
  /**
47
45
  * Returns if the current selection from achor-head is selecting the node.
48
46
  * If the node is not selected then null is returned.
49
47
  * If the node is selected then an enum is returned that describes weather the node
50
48
  * is fully selected by a range or if the "inside" of the node has been selected or clicked.
51
49
  */
52
-
53
50
  (function (SelectedState) {
54
51
  SelectedState[SelectedState["selectedInRange"] = 0] = "selectedInRange";
55
52
  SelectedState[SelectedState["selectedInside"] = 1] = "selectedInside";
56
53
  })(SelectedState || (SelectedState = {}));
57
-
58
54
  export const isNodeSelectedOrInRange = (anchorPosition, headPosition, nodePosition, nodeSize) => {
59
55
  const rangeStart = Math.min(anchorPosition, headPosition);
60
56
  const rangeEnd = Math.max(anchorPosition, headPosition);
61
57
  const nodeStart = nodePosition;
62
58
  const nodeEnd = nodePosition + nodeSize;
63
-
64
59
  if (anchorPosition === headPosition) {
65
60
  return null;
66
61
  }
67
-
68
62
  if (rangeStart <= nodeStart && nodeEnd < rangeEnd || rangeStart < nodeStart && nodeEnd <= rangeEnd) {
69
63
  return SelectedState.selectedInRange;
70
64
  }
71
-
72
65
  if (nodeStart <= anchorPosition && headPosition <= nodeEnd) {
73
66
  return SelectedState.selectedInside;
74
67
  }
75
-
76
68
  return null;
77
69
  };
70
+
78
71
  /**
79
72
  * Checks if a particular node fragment is supported in the parent
80
73
  * @param state EditorState
81
74
  * @param fragment The fragment to be checked for
82
75
  */
83
-
84
76
  export const isSupportedInParent = (state, fragment, currentAppearance) => {
85
77
  const depth = currentAppearance === 'embed' || currentAppearance === 'block' ? undefined : -1;
86
78
  const parent = state.selection.$from.node(depth);
@@ -2,31 +2,23 @@ export const isOutdatedBrowser = userAgent => {
2
2
  // Take browsers in both Desktop and Mobile (includes Chrome, Firefox, Edge and Safari) within last 2 years
3
3
  const chrome = /Chrome\//.test(userAgent) && !/OPR\//.test(userAgent);
4
4
  const chromeVersion = chrome ? parseInt((userAgent.match(/Chrome\/(\d+)/) || [])[1], 10) : 0;
5
-
6
5
  if (chromeVersion >= 84) {
7
6
  return false;
8
7
  }
9
-
10
8
  const gecko = /gecko\/\d/i.test(userAgent);
11
9
  const geckoVersion = gecko ? parseInt((userAgent.match(/Firefox\/(\d+)/) || [])[1], 10) : 0;
12
-
13
10
  if (geckoVersion >= 84) {
14
11
  return false;
15
12
  }
16
-
17
13
  const edge = /Edge\/(\d+)/.exec(userAgent);
18
14
  const edgeVersion = edge ? +edge[1] : 0;
19
-
20
15
  if (edgeVersion >= 84) {
21
16
  return false;
22
17
  }
23
-
24
18
  const safari = !chrome && !gecko && /Version\/([0-9\._]+).*Safari/.test(userAgent);
25
19
  const safariVersion = safari ? parseInt((userAgent.match(/Version\/([0-9\._]+).*Safari/) || [])[1], 10) : 0;
26
-
27
20
  if (safariVersion >= 12) {
28
21
  return false;
29
22
  }
30
-
31
23
  return true;
32
24
  };
@@ -15,22 +15,18 @@ export function useComponentRenderTracking({
15
15
  const lastProps = propsRef.current;
16
16
  const renderCount = renderCountRef.current;
17
17
  let propsDifference;
18
-
19
18
  if (propsDiffingOptions !== null && propsDiffingOptions !== void 0 && propsDiffingOptions.enabled && lastProps) {
20
19
  propsDifference = propsDiffingOptions !== null && propsDiffingOptions !== void 0 && propsDiffingOptions.useShallow ? getShallowPropsDifference(lastProps, propsDiffingOptions.props) : getPropsDifference(lastProps, propsDiffingOptions.props, 0, 2, propsDiffingOptions === null || propsDiffingOptions === void 0 ? void 0 : propsDiffingOptions.propsToIgnore);
21
20
  }
22
-
23
21
  const result = {
24
22
  renderCount,
25
23
  propsDifference,
26
24
  componentId
27
25
  };
28
26
  onRender(result);
29
-
30
27
  if (propsDiffingOptions !== null && propsDiffingOptions !== void 0 && propsDiffingOptions.enabled) {
31
28
  propsRef.current = propsDiffingOptions.props;
32
29
  }
33
-
34
30
  renderCountRef.current = renderCountRef.current + 1;
35
31
  }); // No dependencies run on each render
36
32
  }
@@ -3,7 +3,6 @@ export function isPerformanceAPIAvailable() {
3
3
  if (hasRequiredPerformanceAPIs === undefined) {
4
4
  hasRequiredPerformanceAPIs = typeof window !== 'undefined' && 'performance' in window && ['measure', 'clearMeasures', 'clearMarks', 'getEntriesByName', 'getEntriesByType', 'now'].every(api => !!performance[api]);
5
5
  }
6
-
7
6
  return hasRequiredPerformanceAPIs;
8
7
  }
9
8
  export function isPerformanceObserverAvailable() {
@@ -1,10 +1,10 @@
1
1
  import { isPerformanceAPIAvailable } from './is-performance-api-available';
2
+
2
3
  /**
3
4
  * Monitors if a pages enters a visibility state which will lead to
4
5
  * distorted duration measurements (where the measurement uses the
5
6
  * requestAnimationFrame api).
6
7
  */
7
-
8
8
  export function getDistortedDurationMonitor() {
9
9
  // If an editor is rendered when the document is not visible -- the callback passed to
10
10
  // requestAnimationFrame will not fire until the document becomes visible again.
@@ -16,26 +16,23 @@ export function getDistortedDurationMonitor() {
16
16
  // To mitigate this -- we detect this state -- and fire a seperate callback when the
17
17
  // measurement has occured when the render was in the backgroun
18
18
  let distortedDuration = document.visibilityState !== 'visible';
19
-
20
19
  function handleVisibilityChange() {
21
20
  if (document.visibilityState !== 'visible') {
22
21
  distortedDuration = true;
23
22
  }
24
23
  }
25
-
26
24
  document.addEventListener('visibilitychange', handleVisibilityChange);
27
25
  return {
28
26
  distortedDuration,
29
-
30
27
  /**
31
28
  * Cleans up the document visibility event listener
32
29
  */
33
30
  cleanup() {
34
31
  document.removeEventListener('visibilitychange', handleVisibilityChange);
35
32
  }
36
-
37
33
  };
38
34
  }
35
+
39
36
  /**
40
37
  * Measures time it takes to render a frame including -> style, paint, layout and composition.
41
38
  *
@@ -49,7 +46,6 @@ export function getDistortedDurationMonitor() {
49
46
  * | javascript (framework) | style | layout | paint | composite | javascript | ...
50
47
  * | startMark + scheduling rAF | | rAF callback, endMark
51
48
  */
52
-
53
49
  export function measureRender(
54
50
  /**
55
51
  * Unique name for the measurement
@@ -70,7 +66,6 @@ onMeasureComplete) {
70
66
  if (!isPerformanceAPIAvailable()) {
71
67
  return;
72
68
  }
73
-
74
69
  const startMark = `[START]: ${measureName}`;
75
70
  const endMark = `[END]: ${measureName}`;
76
71
  const startTime = performance.now();
@@ -81,11 +76,9 @@ onMeasureComplete) {
81
76
  performance.mark(endMark);
82
77
  distortedDurationMonitor.cleanup();
83
78
  const duration = performance.now() - startTime;
84
-
85
79
  try {
86
80
  performance.measure(measureName, startMark, endMark);
87
81
  const entry = performance.getEntriesByName(measureName).pop();
88
-
89
82
  if (!entry) {
90
83
  onMeasureComplete({
91
84
  duration,
@@ -106,7 +99,6 @@ onMeasureComplete) {
106
99
  distortedDuration: distortedDurationMonitor.distortedDuration
107
100
  });
108
101
  }
109
-
110
102
  performance.clearMeasures(measureName);
111
103
  performance.clearMarks(startMark);
112
104
  performance.clearMarks(endMark);
@@ -1,11 +1,11 @@
1
1
  import { SEVERITY } from '../analytics';
2
2
  import { isPerformanceObserverLongTaskAvailable } from './is-performance-api-available';
3
- export function measureTTI(onMeasureComplete, idleThreshold = 1000, cancelAfter = 60, // Dependency Injection for easier testing
3
+ export function measureTTI(onMeasureComplete, idleThreshold = 1000, cancelAfter = 60,
4
+ // Dependency Injection for easier testing
4
5
  PerfObserver) {
5
6
  if (!isPerformanceObserverLongTaskAvailable()) {
6
7
  return;
7
8
  }
8
-
9
9
  const start = performance.now();
10
10
  let prevLongTask;
11
11
  let lastLongTask = {
@@ -15,7 +15,6 @@ PerfObserver) {
15
15
  let cancelAfterMs = cancelAfter * 1000;
16
16
  const observer = new (PerfObserver || PerformanceObserver)(list => {
17
17
  const entries = list.getEntries();
18
-
19
18
  if (entries.length) {
20
19
  prevLongTask = lastLongTask;
21
20
  lastLongTask = entries[entries.length - 1];
@@ -24,17 +23,16 @@ PerfObserver) {
24
23
  observer.observe({
25
24
  entryTypes: ['longtask']
26
25
  });
27
-
28
26
  const checkIdle = () => {
29
27
  // 1. There hasn't been any long task in `idleThreshold` time: Interactive from the start.
30
28
  // 2. Only 1 long task: Interactive from the end of the only long task.
31
29
  // 3. Several long tasks:
32
30
  // 3.1 Interactive from the end of prevLongTask if `lastLongTask.start - prevLongTask.end >= idleThreshold`
33
31
  // 3.2 Interactive from the end of lastLongTask if `lastLongTask.start - prevLongTask.end < idleThreshold`
32
+
34
33
  const now = performance.now();
35
34
  const lastEnd = lastLongTask.startTime + lastLongTask.duration;
36
35
  const prevEnd = prevLongTask ? prevLongTask.startTime + prevLongTask.duration : lastEnd;
37
-
38
36
  if (!prevLongTask) {
39
37
  observer.disconnect();
40
38
  return onMeasureComplete(prevEnd, 0, false);
@@ -45,11 +43,9 @@ PerfObserver) {
45
43
  observer.disconnect();
46
44
  return onMeasureComplete(lastEnd, lastEnd - start, cancelAfterMs <= 0);
47
45
  }
48
-
49
46
  cancelAfterMs = Math.max(0, cancelAfterMs - (now - start));
50
47
  return setTimeout(checkIdle, idleThreshold);
51
48
  };
52
-
53
49
  setTimeout(checkIdle, idleThreshold);
54
50
  }
55
51
  export const TTI_SEVERITY_THRESHOLD_DEFAULTS = {
@@ -64,7 +60,6 @@ export function getTTISeverity(tti, ttiFromInvocation, ttiSeverityNormalTheshold
64
60
  const ttiNormalThreshold = ttiSeverityNormalTheshold || TTI_SEVERITY_THRESHOLD_DEFAULTS.NORMAL;
65
61
  const ttiDegradedThreshold = ttiSeverityDegradedThreshold || TTI_SEVERITY_THRESHOLD_DEFAULTS.DEGRADED;
66
62
  let ttiSeverity;
67
-
68
63
  if (tti >= ttiNormalThreshold && tti < ttiDegradedThreshold) {
69
64
  ttiSeverity = SEVERITY.DEGRADED;
70
65
  } else if (tti >= ttiDegradedThreshold) {
@@ -72,11 +67,9 @@ export function getTTISeverity(tti, ttiFromInvocation, ttiSeverityNormalTheshold
72
67
  } else {
73
68
  ttiSeverity = SEVERITY.NORMAL;
74
69
  }
75
-
76
70
  const ttiFromInvocationNormalThreshold = ttiFromInvocationSeverityNormalThreshold || TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.NORMAL;
77
71
  const ttiFromInvocationDegradedThreshold = ttiFromInvocationSeverityDegradedThreshold || TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.DEGRADED;
78
72
  let ttiFromInvocationSeverity;
79
-
80
73
  if (ttiFromInvocation >= ttiFromInvocationNormalThreshold && ttiFromInvocation < ttiFromInvocationDegradedThreshold) {
81
74
  ttiFromInvocationSeverity = SEVERITY.DEGRADED;
82
75
  } else if (ttiFromInvocation >= ttiFromInvocationDegradedThreshold) {
@@ -84,7 +77,6 @@ export function getTTISeverity(tti, ttiFromInvocation, ttiSeverityNormalTheshold
84
77
  } else {
85
78
  ttiFromInvocationSeverity = SEVERITY.NORMAL;
86
79
  }
87
-
88
80
  return {
89
81
  ttiSeverity,
90
82
  ttiFromInvocationSeverity
@@ -4,7 +4,6 @@ export function startMeasure(measureName) {
4
4
  if (!isPerformanceAPIAvailable()) {
5
5
  return;
6
6
  }
7
-
8
7
  performance.mark(`${measureName}::start`);
9
8
  measureMap.set(measureName, performance.now());
10
9
  }
@@ -12,23 +11,19 @@ export function stopMeasure(measureName, onMeasureComplete) {
12
11
  if (!isPerformanceAPIAvailable()) {
13
12
  return;
14
13
  }
15
-
16
14
  performance.mark(`${measureName}::end`);
17
15
  const start = onMeasureComplete ? measureMap.get(measureName) : undefined;
18
-
19
16
  try {
20
17
  performance.measure(measureName, `${measureName}::start`, `${measureName}::end`);
21
18
  } catch (error) {} finally {
22
19
  if (onMeasureComplete) {
23
20
  const entry = performance.getEntriesByName(measureName).pop();
24
-
25
21
  if (entry) {
26
22
  onMeasureComplete(entry.duration, entry.startTime);
27
23
  } else if (start) {
28
24
  onMeasureComplete(performance.now() - start, start);
29
25
  }
30
26
  }
31
-
32
27
  clearMeasure(measureName);
33
28
  }
34
29
  }
@@ -36,7 +31,6 @@ export function clearMeasure(measureName) {
36
31
  if (!isPerformanceAPIAvailable()) {
37
32
  return;
38
33
  }
39
-
40
34
  measureMap.delete(measureName);
41
35
  performance.clearMarks(`${measureName}::start`);
42
36
  performance.clearMarks(`${measureName}::end`);
@@ -3,12 +3,9 @@ export function getResponseEndTime() {
3
3
  if (!isPerformanceAPIAvailable()) {
4
4
  return;
5
5
  }
6
-
7
6
  const nav = performance.getEntriesByType('navigation')[0];
8
-
9
7
  if (nav) {
10
8
  return nav.responseEnd;
11
9
  }
12
-
13
10
  return;
14
11
  }
@@ -44,10 +44,10 @@
44
44
  * }, tr => tr.setMeta('addToHistory', false));
45
45
  *
46
46
  */
47
+
47
48
  function isFunction(x) {
48
49
  return typeof x === 'function';
49
50
  }
50
-
51
51
  export function pluginFactory(pluginKey, reducer, options = {}) {
52
52
  const {
53
53
  mapping,
@@ -62,46 +62,37 @@ export function pluginFactory(pluginKey, reducer, options = {}) {
62
62
  const oldPluginState = mapping ? mapping(tr, _pluginState, newEditorState) : _pluginState;
63
63
  let newPluginState = oldPluginState;
64
64
  const meta = tr.getMeta(pluginKey);
65
-
66
65
  if (meta) {
67
66
  newPluginState = reducer(oldPluginState, meta);
68
67
  }
69
-
70
68
  if (onDocChanged && tr.docChanged) {
71
69
  newPluginState = onDocChanged(tr, newPluginState, newEditorState);
72
70
  } else if (onSelectionChanged && tr.selectionSet) {
73
71
  newPluginState = onSelectionChanged(tr, newPluginState, newEditorState);
74
72
  }
75
-
76
73
  if (newPluginState !== oldPluginState) {
77
74
  dispatch(pluginKey, newPluginState);
78
75
  }
79
-
80
76
  return newPluginState;
81
77
  }
82
78
  };
83
79
  },
84
-
85
80
  createCommand(action, transform) {
86
81
  return (state, dispatch) => {
87
82
  if (dispatch) {
88
83
  const tr = transform ? transform(state.tr, state) : state.tr;
89
84
  const resolvedAction = isFunction(action) ? action(state) : action;
90
-
91
85
  if (tr && resolvedAction) {
92
86
  dispatch(tr.setMeta(pluginKey, resolvedAction));
93
87
  } else {
94
88
  return false;
95
89
  }
96
90
  }
97
-
98
91
  return true;
99
92
  };
100
93
  },
101
-
102
94
  getPluginState(state) {
103
95
  return pluginKey.getState(state);
104
96
  }
105
-
106
97
  };
107
98
  }
@@ -4,51 +4,44 @@ export class RenderCountProfiler {
4
4
  * The singleton/cached instance of RenderCountProfiler that will be shared
5
5
  * betweenRenderCountProfiler.getInstance() calls
6
6
  */
7
+
7
8
  constructor({
8
9
  store
9
10
  }) {
10
11
  this.store = store;
11
12
  }
13
+
12
14
  /**
13
15
  * Returns the singleton/cached instance of RenderCountProfiler that
14
16
  * currently exists. If it hasn't been instantiated yet, the singleton
15
17
  * instance will be created using the given params. Returns the latest
16
18
  * singleton/instance.
17
19
  */
18
-
19
-
20
20
  static getInstance(params) {
21
21
  if (!RenderCountProfiler.instance) {
22
22
  RenderCountProfiler.instance = new RenderCountProfiler({
23
23
  store: params.store
24
24
  });
25
25
  }
26
-
27
26
  return RenderCountProfiler.instance;
28
27
  }
29
-
30
28
  getData(profilerKey) {
31
29
  var _this$store;
32
-
33
30
  return (_this$store = this.store) === null || _this$store === void 0 ? void 0 : _this$store[profilerKey];
34
31
  }
35
-
36
32
  enable() {
37
- this.store[PROFILER_KEY] = { ...this.store[PROFILER_KEY],
33
+ this.store[PROFILER_KEY] = {
34
+ ...this.store[PROFILER_KEY],
38
35
  enabled: true
39
36
  };
40
37
  }
41
-
42
38
  remove() {
43
39
  delete this.store[PROFILER_KEY];
44
40
  }
45
-
46
41
  isEnabled() {
47
42
  var _this$store2, _this$store2$PROFILER;
48
-
49
43
  return Boolean((_this$store2 = this.store) === null || _this$store2 === void 0 ? void 0 : (_this$store2$PROFILER = _this$store2[PROFILER_KEY]) === null || _this$store2$PROFILER === void 0 ? void 0 : _this$store2$PROFILER.enabled);
50
44
  }
51
-
52
45
  setRenderCount({
53
46
  componentId,
54
47
  renderCount,
@@ -60,24 +53,24 @@ export class RenderCountProfiler {
60
53
  };
61
54
  const existingComponents = profilerData === null || profilerData === void 0 ? void 0 : profilerData.components;
62
55
  const existingInstances = existingComponents === null || existingComponents === void 0 ? void 0 : existingComponents[componentId];
63
- const updatedComponent = { ...existingInstances,
56
+ const updatedComponent = {
57
+ ...existingInstances,
64
58
  [instanceId]: instance
65
59
  };
66
- this.store[PROFILER_KEY] = { ...profilerData,
67
- components: { ...existingComponents,
60
+ this.store[PROFILER_KEY] = {
61
+ ...profilerData,
62
+ components: {
63
+ ...existingComponents,
68
64
  [componentId]: updatedComponent
69
65
  }
70
66
  };
71
67
  }
72
-
73
68
  getInstanceRenderCounters({
74
69
  componentId
75
70
  }) {
76
71
  var _this$store$PROFILER_, _this$store3, _this$store3$PROFILER, _this$store3$PROFILER2;
77
-
78
72
  const component = (_this$store$PROFILER_ = (_this$store3 = this.store) === null || _this$store3 === void 0 ? void 0 : (_this$store3$PROFILER = _this$store3[PROFILER_KEY]) === null || _this$store3$PROFILER === void 0 ? void 0 : (_this$store3$PROFILER2 = _this$store3$PROFILER.components) === null || _this$store3$PROFILER2 === void 0 ? void 0 : _this$store3$PROFILER2[componentId]) !== null && _this$store$PROFILER_ !== void 0 ? _this$store$PROFILER_ : {};
79
73
  const counters = [];
80
-
81
74
  for (let instanceId in component) {
82
75
  const counter = {
83
76
  instanceId,
@@ -85,23 +78,17 @@ export class RenderCountProfiler {
85
78
  };
86
79
  counters.push(counter);
87
80
  }
88
-
89
81
  return counters;
90
82
  }
91
-
92
83
  getRenderCount({
93
84
  componentId
94
85
  }) {
95
86
  var _this$store$PROFILER_2, _this$store4, _this$store4$PROFILER, _this$store4$PROFILER2;
96
-
97
87
  const component = (_this$store$PROFILER_2 = (_this$store4 = this.store) === null || _this$store4 === void 0 ? void 0 : (_this$store4$PROFILER = _this$store4[PROFILER_KEY]) === null || _this$store4$PROFILER === void 0 ? void 0 : (_this$store4$PROFILER2 = _this$store4$PROFILER.components) === null || _this$store4$PROFILER2 === void 0 ? void 0 : _this$store4$PROFILER2[componentId]) !== null && _this$store$PROFILER_2 !== void 0 ? _this$store$PROFILER_2 : {};
98
88
  let total = 0;
99
-
100
89
  for (let instanceId in component) {
101
90
  total += component[instanceId].count;
102
91
  }
103
-
104
92
  return total;
105
93
  }
106
-
107
94
  }