@atlaskit/editor-common 72.1.2 → 72.2.1

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 (583) hide show
  1. package/CHANGELOG.md +21 -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 +1 -16
  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 +15 -39
  202. package/dist/cjs/ui-menu/DropdownMenu/index.js +43 -79
  203. package/dist/cjs/ui-menu/MenuArrowKeyNavigationProvider/index.js +66 -82
  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 +12 -52
  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 +1 -16
  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 +1 -8
  362. package/dist/es2019/ui-menu/DropdownMenu/index.js +23 -27
  363. package/dist/es2019/ui-menu/MenuArrowKeyNavigationProvider/index.js +59 -73
  364. package/dist/es2019/ui-menu/ToolbarButton/index.js +2 -6
  365. package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +7 -25
  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 +1 -16
  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 +15 -28
  529. package/dist/esm/ui-menu/DropdownMenu/index.js +43 -60
  530. package/dist/esm/ui-menu/MenuArrowKeyNavigationProvider/index.js +66 -78
  531. package/dist/esm/ui-menu/ToolbarButton/index.js +23 -32
  532. package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +12 -41
  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/dist/types/analytics/types/enums.d.ts +1 -1
  574. package/dist/types/analytics/types/events.d.ts +3 -2
  575. package/dist/types/analytics/types/general-events.d.ts +8 -3
  576. package/dist/types/types/editor-plugin.d.ts +24 -2
  577. package/dist/types/types/floating-toolbar.d.ts +10 -0
  578. package/dist/types/types/type-ahead.d.ts +8 -0
  579. package/dist/types/ui-menu/DropdownMenu/index.d.ts +1 -1
  580. package/dist/types/ui-menu/DropdownMenu/types.d.ts +1 -0
  581. package/dist/types/ui-menu/MenuArrowKeyNavigationProvider/index.d.ts +3 -2
  582. package/dist/types/ui-react/with-react-editor-view-outer-listeners.d.ts +1 -1
  583. package/package.json +8 -8
@@ -1,46 +1,37 @@
1
1
  import _typeof from "@babel/runtime/helpers/typeof";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
-
5
4
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
6
-
7
5
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
-
9
6
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
10
-
11
7
  export var isReferencedSource = function isReferencedSource(state, node) {
12
8
  var _node$attrs, _node$marks, _node$marks$find, _node$marks$find$attr;
13
-
14
9
  if (!node) {
15
10
  return false;
16
11
  }
12
+ var found = false;
17
13
 
18
- var found = false; // Handle nodes having 2 uuids. They could have a localId or a fragment. Regardless this needs
14
+ // Handle nodes having 2 uuids. They could have a localId or a fragment. Regardless this needs
19
15
  // to check if either id is used by a data consumer.
20
-
21
16
  var localIds = new Set([(_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId, (_node$marks = node.marks) === null || _node$marks === void 0 ? void 0 : (_node$marks$find = _node$marks.find(function (mark) {
22
17
  return mark.type === state.schema.marks.fragment;
23
- })) === null || _node$marks$find === void 0 ? void 0 : (_node$marks$find$attr = _node$marks$find.attrs) === null || _node$marks$find$attr === void 0 ? void 0 : _node$marks$find$attr.localId].filter(Boolean)); // If there are no uuids on the node then it's not possible for it to be referenced anywhere.
18
+ })) === null || _node$marks$find === void 0 ? void 0 : (_node$marks$find$attr = _node$marks$find.attrs) === null || _node$marks$find$attr === void 0 ? void 0 : _node$marks$find$attr.localId].filter(Boolean));
24
19
 
20
+ // If there are no uuids on the node then it's not possible for it to be referenced anywhere.
25
21
  if (!localIds.size) {
26
22
  return false;
27
23
  }
28
-
29
24
  state.doc.descendants(function (node) {
30
25
  var _dataConsumer$attrs$s, _dataConsumer$attrs$s2;
31
-
32
26
  if (found) {
33
27
  return false;
34
28
  }
35
-
36
29
  var dataConsumer = node.marks.find(function (mark) {
37
30
  return mark.type === state.schema.marks.dataConsumer;
38
31
  });
39
-
40
32
  if (!dataConsumer) {
41
33
  return true;
42
34
  }
43
-
44
35
  found = (_dataConsumer$attrs$s = (_dataConsumer$attrs$s2 = dataConsumer.attrs.sources) === null || _dataConsumer$attrs$s2 === void 0 ? void 0 : _dataConsumer$attrs$s2.some(function (src) {
45
36
  return localIds.has(src);
46
37
  })) !== null && _dataConsumer$attrs$s !== void 0 ? _dataConsumer$attrs$s : false;
@@ -48,20 +39,20 @@ export var isReferencedSource = function isReferencedSource(state, node) {
48
39
  });
49
40
  return found;
50
41
  };
51
-
52
42
  var getConnections = function getConnections(state) {
53
43
  var result = {};
54
44
  var doc = state.doc,
55
- schema = state.schema; // Keeps a map of all raw ids -> to their preferred normalised varient. A node with both fragmentMark & localId will
56
- // have both ids mapped here to the same normalized version.
45
+ schema = state.schema;
57
46
 
47
+ // Keeps a map of all raw ids -> to their preferred normalised varient. A node with both fragmentMark & localId will
48
+ // have both ids mapped here to the same normalized version.
58
49
  var normalizedIds = new Map();
59
- var dataConsumerSources = new Map(); // Perform a prelim scan creating the initial id to connection link mappings.
60
- // This will also save a list of data sources consumed per node.
50
+ var dataConsumerSources = new Map();
61
51
 
52
+ // Perform a prelim scan creating the initial id to connection link mappings.
53
+ // This will also save a list of data sources consumed per node.
62
54
  doc.descendants(function (node, pos) {
63
55
  var _node$attrs2, _fragmentMark$attrs$l, _fragmentMark, _fragmentMark$attrs, _node$attrs3, _fragmentMark2, _fragmentMark2$attrs, _node$attrs4, _fragmentMark$attrs$n, _fragmentMark3, _fragmentMark3$attrs;
64
-
65
56
  var dataConsumer;
66
57
  var fragmentMark;
67
58
  node.marks.some(function (mark) {
@@ -69,35 +60,30 @@ var getConnections = function getConnections(state) {
69
60
  dataConsumer = mark;
70
61
  } else if (mark.type === schema.marks.fragment) {
71
62
  fragmentMark = mark;
72
- } // Stop searching marks if we've found both consumer and fragment.
73
-
63
+ }
74
64
 
65
+ // Stop searching marks if we've found both consumer and fragment.
75
66
  return !!dataConsumer && !!fragmentMark;
76
- }); // If node cannot be referenced by any means then abort.
67
+ });
77
68
 
69
+ // If node cannot be referenced by any means then abort.
78
70
  if (!fragmentMark && !((_node$attrs2 = node.attrs) !== null && _node$attrs2 !== void 0 && _node$attrs2.localId)) {
79
71
  return true;
80
72
  }
81
-
82
73
  var normalizedId = (_fragmentMark$attrs$l = (_fragmentMark = fragmentMark) === null || _fragmentMark === void 0 ? void 0 : (_fragmentMark$attrs = _fragmentMark.attrs) === null || _fragmentMark$attrs === void 0 ? void 0 : _fragmentMark$attrs.localId) !== null && _fragmentMark$attrs$l !== void 0 ? _fragmentMark$attrs$l : (_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.localId;
83
-
84
74
  if (!normalizedId) {
85
75
  return true;
86
76
  }
87
-
88
77
  if (!!((_fragmentMark2 = fragmentMark) !== null && _fragmentMark2 !== void 0 && (_fragmentMark2$attrs = _fragmentMark2.attrs) !== null && _fragmentMark2$attrs !== void 0 && _fragmentMark2$attrs.localId)) {
89
78
  normalizedIds.set(fragmentMark.attrs.localId, normalizedId);
90
79
  }
91
-
92
80
  if (!!((_node$attrs4 = node.attrs) !== null && _node$attrs4 !== void 0 && _node$attrs4.localId)) {
93
81
  normalizedIds.set(node.attrs.localId, normalizedId);
94
82
  }
95
-
96
83
  if (!!result[normalizedId]) {
97
84
  // Duplicate ID has been found, we'll care about the first one for now.
98
85
  return true;
99
86
  }
100
-
101
87
  result[normalizedId] = {
102
88
  localId: normalizedId,
103
89
  name: (_fragmentMark$attrs$n = (_fragmentMark3 = fragmentMark) === null || _fragmentMark3 === void 0 ? void 0 : (_fragmentMark3$attrs = _fragmentMark3.attrs) === null || _fragmentMark3$attrs === void 0 ? void 0 : _fragmentMark3$attrs.name) !== null && _fragmentMark$attrs$n !== void 0 ? _fragmentMark$attrs$n : normalizedId,
@@ -105,38 +91,34 @@ var getConnections = function getConnections(state) {
105
91
  pos: pos,
106
92
  targets: []
107
93
  };
108
-
109
94
  if (!!dataConsumer && dataConsumer.attrs.sources.length) {
110
95
  dataConsumerSources.set(normalizedId, dataConsumer.attrs.sources);
111
- } // Do not descend into children of a node which has a dataConsumer attached. This assumes all children of the node cannot
112
- // be referenced by another node.
113
-
96
+ }
114
97
 
98
+ // Do not descend into children of a node which has a dataConsumer attached. This assumes all children of the node cannot
99
+ // be referenced by another node.
115
100
  return !dataConsumer;
116
- }); // This 2nd-pass only looks at the consumer sources and updates all connections with the correct id refs.
101
+ });
117
102
 
103
+ // This 2nd-pass only looks at the consumer sources and updates all connections with the correct id refs.
118
104
  var _iterator = _createForOfIteratorHelper(dataConsumerSources),
119
- _step;
120
-
105
+ _step;
121
106
  try {
122
107
  var _loop = function _loop() {
123
108
  var _step$value = _slicedToArray(_step.value, 2),
124
- localId = _step$value[0],
125
- sources = _step$value[1];
126
-
109
+ localId = _step$value[0],
110
+ sources = _step$value[1];
127
111
  // This is a ref to the node (connection link) which contains the consumer.
112
+
128
113
  sources.forEach(function (src) {
129
114
  var _normalizedIds$get;
130
-
131
115
  var normalizedId = (_normalizedIds$get = normalizedIds.get(src)) !== null && _normalizedIds$get !== void 0 ? _normalizedIds$get : src;
132
116
  var srcLink = result[normalizedId];
133
-
134
117
  if (srcLink && normalizedId !== localId) {
135
118
  srcLink.targets.push(localId);
136
119
  }
137
120
  });
138
121
  };
139
-
140
122
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
141
123
  _loop();
142
124
  }
@@ -145,71 +127,58 @@ var getConnections = function getConnections(state) {
145
127
  } finally {
146
128
  _iterator.f();
147
129
  }
148
-
149
130
  return result;
150
131
  };
151
-
152
132
  export var removeConnectedNodes = function removeConnectedNodes(state, node) {
153
133
  if (!node) {
154
134
  return state.tr;
155
135
  }
156
-
157
136
  var selectedLocalIds = getSelectedLocalIds(state, node);
158
137
  var allNodes = getConnections(state);
159
138
  var idsToBeDeleted = getIdsToBeDeleted(selectedLocalIds, allNodes);
160
-
161
139
  if (!(idsToBeDeleted !== null && idsToBeDeleted !== void 0 && idsToBeDeleted.length)) {
162
140
  return state.tr;
163
141
  }
164
-
165
142
  var tr = state.tr;
166
143
  var newTr = tr;
167
144
  idsToBeDeleted.forEach(function (id) {
168
145
  if (!allNodes[id]) {
169
146
  return;
170
147
  }
171
-
172
148
  var _allNodes$id = allNodes[id],
173
- node = _allNodes$id.node,
174
- pos = _allNodes$id.pos;
149
+ node = _allNodes$id.node,
150
+ pos = _allNodes$id.pos;
175
151
  newTr = newTr.delete(newTr.mapping.map(pos), newTr.mapping.map(node.nodeSize + pos));
176
152
  });
177
153
  return newTr;
178
- }; // find all ids need to be remove connected to selected extension
154
+ };
179
155
 
156
+ // find all ids need to be remove connected to selected extension
180
157
  var getIdsToBeDeleted = function getIdsToBeDeleted(selectedIds, allNodes) {
181
158
  if (!selectedIds.size) {
182
159
  return [];
183
160
  }
184
-
185
161
  var searchSet = _toConsumableArray(selectedIds);
186
-
187
162
  var deletedIds = new Set();
188
-
189
163
  while (searchSet.length) {
190
164
  var id = searchSet.pop();
191
-
192
165
  if (allNodes[id]) {
193
166
  var _allNodes$id$targets$, _allNodes$id2;
194
-
195
167
  deletedIds.add(allNodes[id].localId);
196
168
  searchSet = searchSet.concat((_allNodes$id$targets$ = (_allNodes$id2 = allNodes[id]) === null || _allNodes$id2 === void 0 ? void 0 : _allNodes$id2.targets.filter(function (targetId) {
197
169
  var _allNodes$targetId;
198
-
199
170
  return !deletedIds.has((_allNodes$targetId = allNodes[targetId]) === null || _allNodes$targetId === void 0 ? void 0 : _allNodes$targetId.localId);
200
171
  })) !== null && _allNodes$id$targets$ !== void 0 ? _allNodes$id$targets$ : []);
201
172
  }
202
173
  }
203
-
204
174
  return Array.from(deletedIds);
205
- }; // for get children info for confirmation dialog
206
-
175
+ };
207
176
 
177
+ // for get children info for confirmation dialog
208
178
  export var getChildrenInfo = function getChildrenInfo(state, node) {
209
179
  if (!node) {
210
180
  return [];
211
181
  }
212
-
213
182
  var childrenIdSet = new Set();
214
183
  var childrenInfoArray = [];
215
184
  var allNodes = getConnections(state);
@@ -228,81 +197,62 @@ export var getChildrenInfo = function getChildrenInfo(state, node) {
228
197
  });
229
198
  return childrenInfoArray;
230
199
  };
231
-
232
200
  var getChildrenNodeAmount = function getChildrenNodeAmount(id, allNodes) {
233
201
  var searchTerms = new Set([id]);
234
202
  var traverseHistory = new Map();
235
203
  var childrenIds = new Set();
236
204
  traverseHistory.set(id, false);
237
-
238
205
  while (searchTerms.size > 0) {
239
206
  var _searchTerms = _slicedToArray(searchTerms, 1),
240
- currTerm = _searchTerms[0];
241
-
207
+ currTerm = _searchTerms[0];
242
208
  var targets = getNodeTargetsById(currTerm, allNodes);
243
209
  targets.forEach(function (target) {
244
210
  var isTargetCounted = traverseHistory.get(target);
245
-
246
211
  if (!isTargetCounted) {
247
212
  searchTerms.add(target);
248
213
  childrenIds.add(target);
249
214
  }
250
-
251
215
  target !== id && childrenIds.add(target);
252
216
  });
253
217
  traverseHistory.set(currTerm, true);
254
218
  searchTerms.delete(currTerm);
255
219
  }
256
-
257
220
  return childrenIds.size;
258
221
  };
259
-
260
222
  var getNodeTargetsById = function getNodeTargetsById(id, allNodes) {
261
223
  if (!id || !allNodes[id]) {
262
224
  return [];
263
225
  }
264
-
265
226
  return allNodes[id].targets;
266
227
  };
267
-
268
228
  var DEFAULT_EXTENSION_NAME = 'Default extension';
269
-
270
229
  var getNodeNameById = function getNodeNameById(id, allNodes) {
271
230
  if (_typeof(id) === 'object') {
272
231
  var _name2;
273
-
274
232
  var name;
275
233
  id.forEach(function (localId) {
276
234
  var _name, _allNodes$localId;
277
-
278
235
  name = (_name = name) !== null && _name !== void 0 ? _name : (_allNodes$localId = allNodes[localId]) === null || _allNodes$localId === void 0 ? void 0 : _allNodes$localId.name;
279
236
  });
280
237
  return (_name2 = name) !== null && _name2 !== void 0 ? _name2 : DEFAULT_EXTENSION_NAME;
281
238
  }
282
-
283
239
  if (!id || !allNodes[id]) {
284
240
  return DEFAULT_EXTENSION_NAME;
285
241
  }
286
-
287
242
  return allNodes[id].name;
288
243
  };
289
-
290
244
  var getSelectedLocalIds = function getSelectedLocalIds(state, node) {
291
245
  var _node$attrs5, _node$marks2, _node$marks2$find, _node$marks2$find$att;
292
-
293
246
  if (!node) {
294
247
  return new Set([]);
295
248
  }
296
-
297
249
  var localIds = new Set([(_node$attrs5 = node.attrs) === null || _node$attrs5 === void 0 ? void 0 : _node$attrs5.localId, (_node$marks2 = node.marks) === null || _node$marks2 === void 0 ? void 0 : (_node$marks2$find = _node$marks2.find(function (mark) {
298
250
  return mark.type === state.schema.marks.fragment;
299
251
  })) === null || _node$marks2$find === void 0 ? void 0 : (_node$marks2$find$att = _node$marks2$find.attrs) === null || _node$marks2$find$att === void 0 ? void 0 : _node$marks2$find$att.localId].filter(Boolean));
300
252
  return localIds;
301
253
  };
302
-
303
254
  export var getNodeName = function getNodeName(state, node) {
304
255
  var _node$marks$find$attr2, _node$marks3, _node$marks3$find, _node$marks3$find$att;
305
-
306
256
  return (_node$marks$find$attr2 = node === null || node === void 0 ? void 0 : (_node$marks3 = node.marks) === null || _node$marks3 === void 0 ? void 0 : (_node$marks3$find = _node$marks3.find(function (mark) {
307
257
  return mark.type === state.schema.marks.fragment;
308
258
  })) === null || _node$marks3$find === void 0 ? void 0 : (_node$marks3$find$att = _node$marks3$find.attrs) === null || _node$marks3$find$att === void 0 ? void 0 : _node$marks3$find$att.name) !== null && _node$marks$find$attr2 !== void 0 ? _node$marks$find$attr2 : '';
@@ -2,13 +2,13 @@
2
2
  export var shouldForceTracking = function shouldForceTracking() {
3
3
  try {
4
4
  var _ref = window.__buildInfo || {},
5
- _ref$FRONTEND_VERSION = _ref.FRONTEND_VERSION,
6
- FRONTEND_VERSION = _ref$FRONTEND_VERSION === void 0 ? '' : _ref$FRONTEND_VERSION;
7
-
5
+ _ref$FRONTEND_VERSION = _ref.FRONTEND_VERSION,
6
+ FRONTEND_VERSION = _ref$FRONTEND_VERSION === void 0 ? '' : _ref$FRONTEND_VERSION;
8
7
  return window.location.hostname === 'product-fabric.atlassian.net' && FRONTEND_VERSION.includes('branch-deploy');
9
8
  } catch (err) {
10
9
  // eslint-disable-next-line no-console
11
10
  console.warn(err);
12
11
  return false;
13
12
  }
14
- }; // END: temporary code https://product-fabric.atlassian.net/browse/ED-10260
13
+ };
14
+ // END: temporary code https://product-fabric.atlassian.net/browse/ED-10260
@@ -1,21 +1,18 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import { Fragment, Slice } from 'prosemirror-model';
3
+
3
4
  /**
4
5
  * A helper to get the underlying array of a fragment.
5
6
  */
6
-
7
7
  export function getFragmentBackingArray(fragment) {
8
8
  return fragment.content;
9
9
  }
10
10
  export function mapFragment(content, callback) {
11
11
  var parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
12
12
  var children = [];
13
-
14
13
  for (var i = 0, size = content.childCount; i < size; i++) {
15
14
  var _node = content.child(i);
16
-
17
15
  var transformed = _node.isLeaf ? callback(_node, parent, i) : callback(_node.copy(mapFragment(_node.content, callback, _node)), parent, i);
18
-
19
16
  if (transformed) {
20
17
  if (transformed instanceof Fragment) {
21
18
  children.push.apply(children, _toConsumableArray(getFragmentBackingArray(transformed)));
@@ -26,7 +23,6 @@ export function mapFragment(content, callback) {
26
23
  }
27
24
  }
28
25
  }
29
-
30
26
  return Fragment.fromArray(children);
31
27
  }
32
28
  export function mapSlice(slice, callback) {
@@ -35,25 +31,20 @@ export function mapSlice(slice, callback) {
35
31
  }
36
32
  export function flatmap(fragment, callback) {
37
33
  var fragmentContent = [];
38
-
39
34
  for (var i = 0; i < fragment.childCount; i++) {
40
35
  var child = callback(fragment.child(i), i, fragment);
41
-
42
36
  if (Array.isArray(child)) {
43
37
  fragmentContent.push.apply(fragmentContent, _toConsumableArray(child));
44
38
  } else {
45
39
  fragmentContent.push(child);
46
40
  }
47
41
  }
48
-
49
42
  return Fragment.fromArray(fragmentContent);
50
43
  }
51
44
  export function mapChildren(node, callback) {
52
45
  var array = [];
53
-
54
46
  for (var i = 0; i < node.childCount; i++) {
55
47
  array.push(callback(node.child(i), i, node instanceof Fragment ? node : node.content));
56
48
  }
57
-
58
49
  return array;
59
50
  }
@@ -2,19 +2,18 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  export function calcTableColumnWidths(node) {
3
3
  var tableColumnWidths = [];
4
4
  var firstRow = node.firstChild;
5
-
6
5
  if (firstRow) {
7
6
  // Sanity validation, but it should always have a first row
8
7
  // Iterate for the cells in the first row
9
8
  firstRow.forEach(function (colNode) {
10
- var colwidth = colNode.attrs.colwidth || [0]; // If we have colwidth, we added it
9
+ var colwidth = colNode.attrs.colwidth || [0];
11
10
 
11
+ // If we have colwidth, we added it
12
12
  if (colwidth) {
13
13
  tableColumnWidths = [].concat(_toConsumableArray(tableColumnWidths), _toConsumableArray(colwidth));
14
14
  }
15
15
  });
16
16
  }
17
-
18
17
  return tableColumnWidths;
19
18
  }
20
19
  export function hasMergedCell(tableNode) {
@@ -23,15 +22,12 @@ export function hasMergedCell(tableNode) {
23
22
  if (node.type.name === 'tableRow') {
24
23
  return true;
25
24
  }
26
-
27
25
  var _node$attrs = node.attrs,
28
- colspan = _node$attrs.colspan,
29
- rowspan = _node$attrs.rowspan;
30
-
26
+ colspan = _node$attrs.colspan,
27
+ rowspan = _node$attrs.rowspan;
31
28
  if (colspan > 1 || rowspan > 1) {
32
29
  hasSpan = true;
33
30
  }
34
-
35
31
  return false;
36
32
  });
37
33
  return hasSpan;
@@ -1,18 +1,13 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
-
3
2
  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; }
4
-
5
3
  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) { _defineProperty(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; }
6
-
7
4
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../analytics';
8
5
  var whitelistedAttributes = ['align', 'annotationType', 'extensionKey', 'extensionType', 'layout', 'type', 'localId', 'mode', 'language', 'timestamp', 'state', 'originalWidth', 'originalHeight', 'height', 'width', 'shortName', 'level', 'userType', 'order', 'panelType', 'color', 'style', 'isNumberColumnEnabled', 'colspan', 'rowspan', 'colwidth', 'background'];
9
-
10
6
  function concatAncestorHierarchy(node, ancestoryHierarchy) {
11
- var name = node.type.name; // Space concatenator used to reduce analytics payload size
12
-
7
+ var name = node.type.name;
8
+ // Space concatenator used to reduce analytics payload size
13
9
  return ancestoryHierarchy ? "".concat(ancestoryHierarchy, " ").concat(name) : name;
14
10
  }
15
-
16
11
  var sanitizeMarks = function sanitizeMarks() {
17
12
  var marks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
18
13
  var sanitizedMarks = [];
@@ -28,7 +23,6 @@ var sanitizeMarks = function sanitizeMarks() {
28
23
  });
29
24
  return sanitizedMarks;
30
25
  };
31
-
32
26
  var sanitizeAttributes = function sanitizeAttributes() {
33
27
  var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
34
28
  var sanitizedAttrs = Object.assign({}, attrs);
@@ -39,7 +33,6 @@ var sanitizeAttributes = function sanitizeAttributes() {
39
33
  });
40
34
  return sanitizedAttrs;
41
35
  };
42
-
43
36
  var trackUnsupportedContentTooltipActionFor = function trackUnsupportedContentTooltipActionFor(action, dispatchAnalyticsEvent, unsupportedContentType, originalNodeType) {
44
37
  dispatchAnalyticsEvent({
45
38
  action: action,
@@ -51,28 +44,24 @@ var trackUnsupportedContentTooltipActionFor = function trackUnsupportedContentTo
51
44
  }
52
45
  });
53
46
  };
54
-
55
47
  export var findAndTrackUnsupportedContentNodes = function findAndTrackUnsupportedContentNodes(node, schema, dispatchAnalyticsEvent) {
56
48
  var ancestorHierarchy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
57
49
  var nodeType = node.type,
58
- nodeMarks = node.marks;
50
+ nodeMarks = node.marks;
59
51
  var _schema$marks = schema.marks,
60
- unsupportedMark = _schema$marks.unsupportedMark,
61
- unsupportedNodeAttribute = _schema$marks.unsupportedNodeAttribute;
52
+ unsupportedMark = _schema$marks.unsupportedMark,
53
+ unsupportedNodeAttribute = _schema$marks.unsupportedNodeAttribute;
62
54
  var _schema$nodes = schema.nodes,
63
- unsupportedInline = _schema$nodes.unsupportedInline,
64
- unsupportedBlock = _schema$nodes.unsupportedBlock;
55
+ unsupportedInline = _schema$nodes.unsupportedInline,
56
+ unsupportedBlock = _schema$nodes.unsupportedBlock;
65
57
  var parentType = ancestorHierarchy.split(' ').pop() || '';
66
-
67
58
  if (nodeMarks.length) {
68
59
  nodeMarks.forEach(function (mark) {
69
60
  if (mark.type === unsupportedMark) {
70
61
  var _ref = mark.attrs || {},
71
- originalValue = _ref.originalValue;
72
-
62
+ originalValue = _ref.originalValue;
73
63
  var _ref2 = originalValue || {},
74
- type = _ref2.type;
75
-
64
+ type = _ref2.type;
76
65
  var unsupportedNode = {
77
66
  type: type || '',
78
67
  ancestry: ancestorHierarchy,
@@ -83,8 +72,7 @@ export var findAndTrackUnsupportedContentNodes = function findAndTrackUnsupporte
83
72
  fireUnsupportedEvent(dispatchAnalyticsEvent, ACTION_SUBJECT_ID.UNSUPPORTED_MARK, unsupportedNode);
84
73
  } else if (mark.type === unsupportedNodeAttribute) {
85
74
  var _ref3 = mark.attrs || {},
86
- unsupported = _ref3.unsupported;
87
-
75
+ unsupported = _ref3.unsupported;
88
76
  var _unsupportedNodeAttribute = {
89
77
  type: nodeType.name || '',
90
78
  ancestry: ancestorHierarchy,
@@ -96,20 +84,15 @@ export var findAndTrackUnsupportedContentNodes = function findAndTrackUnsupporte
96
84
  }
97
85
  });
98
86
  }
99
-
100
87
  if (nodeType === unsupportedInline || nodeType === unsupportedBlock) {
101
88
  var _ref4 = node.attrs || {},
102
- originalValue = _ref4.originalValue;
103
-
89
+ originalValue = _ref4.originalValue;
104
90
  var _ref5 = originalValue || [],
105
- marks = _ref5.marks;
106
-
91
+ marks = _ref5.marks;
107
92
  var _ref6 = originalValue || {},
108
- attrs = _ref6.attrs;
109
-
93
+ attrs = _ref6.attrs;
110
94
  var _ref7 = originalValue || {},
111
- type = _ref7.type;
112
-
95
+ type = _ref7.type;
113
96
  var unsupportedNode = {
114
97
  type: type || '',
115
98
  ancestry: ancestorHierarchy,
@@ -1,21 +1,16 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
-
5
4
  var ADFTraversor = /*#__PURE__*/function () {
6
5
  function ADFTraversor(doc) {
7
6
  _classCallCheck(this, ADFTraversor);
8
-
9
7
  _defineProperty(this, "subscribers", new Map());
10
-
11
8
  this.doc = doc;
12
9
  }
13
-
14
10
  _createClass(ADFTraversor, [{
15
11
  key: "subscribe",
16
12
  value: function subscribe(type, callback) {
17
13
  var callbacks = this.subscribers.get(type);
18
-
19
14
  if (!callbacks) {
20
15
  this.subscribers.set(type, [callback]);
21
16
  } else {
@@ -28,30 +23,22 @@ var ADFTraversor = /*#__PURE__*/function () {
28
23
  if (!this.doc || !Array.isArray(this.doc.content)) {
29
24
  return;
30
25
  }
31
-
32
26
  var candidates = this.doc.content.slice(0);
33
-
34
27
  while (candidates.length) {
35
28
  var _node = candidates.shift();
36
-
37
29
  if (Array.isArray(_node.content)) {
38
30
  candidates = candidates.concat(_node.content);
39
31
  }
40
-
41
32
  var callbacks = this.subscribers.get(_node.type);
42
-
43
33
  if (!callbacks) {
44
34
  continue;
45
35
  }
46
-
47
36
  for (var i = 0; i < callbacks.length; i++) {
48
37
  callbacks[i](_node);
49
38
  }
50
39
  }
51
40
  }
52
41
  }]);
53
-
54
42
  return ADFTraversor;
55
43
  }();
56
-
57
44
  export default ADFTraversor;