@atlaskit/renderer 105.1.1 → 106.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/actions/index.js +19 -71
  3. package/dist/cjs/actions/matches-utils.js +10 -11
  4. package/dist/cjs/actions.js +0 -2
  5. package/dist/cjs/analytics/analyticsContext.js +0 -4
  6. package/dist/cjs/analytics/events.js +0 -5
  7. package/dist/cjs/analytics/unsupported-content.js +14 -27
  8. package/dist/cjs/i18n/cs.js +0 -1
  9. package/dist/cjs/i18n/da.js +0 -1
  10. package/dist/cjs/i18n/de.js +0 -1
  11. package/dist/cjs/i18n/en.js +0 -1
  12. package/dist/cjs/i18n/en_GB.js +0 -1
  13. package/dist/cjs/i18n/en_ZZ.js +0 -1
  14. package/dist/cjs/i18n/es.js +0 -1
  15. package/dist/cjs/i18n/et.js +0 -1
  16. package/dist/cjs/i18n/fi.js +0 -1
  17. package/dist/cjs/i18n/fr.js +0 -1
  18. package/dist/cjs/i18n/hu.js +0 -1
  19. package/dist/cjs/i18n/index.js +0 -26
  20. package/dist/cjs/i18n/it.js +0 -1
  21. package/dist/cjs/i18n/ja.js +0 -1
  22. package/dist/cjs/i18n/ko.js +0 -1
  23. package/dist/cjs/i18n/nb.js +0 -1
  24. package/dist/cjs/i18n/nl.js +0 -1
  25. package/dist/cjs/i18n/pl.js +0 -1
  26. package/dist/cjs/i18n/pt_BR.js +0 -1
  27. package/dist/cjs/i18n/pt_PT.js +0 -1
  28. package/dist/cjs/i18n/ru.js +0 -1
  29. package/dist/cjs/i18n/sk.js +0 -1
  30. package/dist/cjs/i18n/sv.js +0 -1
  31. package/dist/cjs/i18n/th.js +0 -1
  32. package/dist/cjs/i18n/tr.js +0 -1
  33. package/dist/cjs/i18n/uk.js +0 -1
  34. package/dist/cjs/i18n/vi.js +0 -1
  35. package/dist/cjs/i18n/zh.js +0 -1
  36. package/dist/cjs/i18n/zh_TW.js +0 -1
  37. package/dist/cjs/index.js +0 -6
  38. package/dist/cjs/messages.js +0 -2
  39. package/dist/cjs/react/hooks/use-bidi-warnings.js +2 -12
  40. package/dist/cjs/react/hooks/use-in-viewport.js +4 -17
  41. package/dist/cjs/react/hooks/use-observed-width.js +20 -35
  42. package/dist/cjs/react/index.js +27 -114
  43. package/dist/cjs/react/marks/alignment.js +0 -9
  44. package/dist/cjs/react/marks/annotation.js +6 -21
  45. package/dist/cjs/react/marks/breakout.js +0 -9
  46. package/dist/cjs/react/marks/code.js +0 -11
  47. package/dist/cjs/react/marks/confluence-inline-comment.js +2 -19
  48. package/dist/cjs/react/marks/data-consumer.js +0 -4
  49. package/dist/cjs/react/marks/em.js +0 -3
  50. package/dist/cjs/react/marks/fragment.js +0 -4
  51. package/dist/cjs/react/marks/indentation.js +0 -3
  52. package/dist/cjs/react/marks/index.js +1 -24
  53. package/dist/cjs/react/marks/link.js +5 -25
  54. package/dist/cjs/react/marks/strike.js +0 -4
  55. package/dist/cjs/react/marks/strong.js +0 -3
  56. package/dist/cjs/react/marks/subsup.js +0 -5
  57. package/dist/cjs/react/marks/textColor.js +0 -9
  58. package/dist/cjs/react/marks/underline.js +0 -3
  59. package/dist/cjs/react/marks/unsupportedMark.js +0 -3
  60. package/dist/cjs/react/marks/unsupportedNodeAttribute.js +0 -3
  61. package/dist/cjs/react/nodes/blockCard.js +4 -16
  62. package/dist/cjs/react/nodes/blockquote.js +0 -3
  63. package/dist/cjs/react/nodes/bodiedExtension.js +6 -17
  64. package/dist/cjs/react/nodes/bulletList.js +0 -5
  65. package/dist/cjs/react/nodes/caption.js +1 -6
  66. package/dist/cjs/react/nodes/codeBlock/codeBlock.js +5 -14
  67. package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +3 -16
  68. package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +6 -23
  69. package/dist/cjs/react/nodes/codeBlock/windowedCodeBlock.js +9 -32
  70. package/dist/cjs/react/nodes/codeBlockCopyButton.js +7 -31
  71. package/dist/cjs/react/nodes/date.js +5 -33
  72. package/dist/cjs/react/nodes/decisionItem.js +1 -5
  73. package/dist/cjs/react/nodes/decisionList.js +0 -20
  74. package/dist/cjs/react/nodes/doc.js +0 -6
  75. package/dist/cjs/react/nodes/embedCard.js +25 -54
  76. package/dist/cjs/react/nodes/emoji.js +6 -24
  77. package/dist/cjs/react/nodes/extension.js +12 -26
  78. package/dist/cjs/react/nodes/fallback.js +2 -24
  79. package/dist/cjs/react/nodes/hardBreak.js +1 -7
  80. package/dist/cjs/react/nodes/heading-anchor.js +1 -46
  81. package/dist/cjs/react/nodes/heading.js +4 -17
  82. package/dist/cjs/react/nodes/index.js +7 -62
  83. package/dist/cjs/react/nodes/inline.js +0 -6
  84. package/dist/cjs/react/nodes/inlineCard.js +6 -23
  85. package/dist/cjs/react/nodes/inlineExtension.js +2 -10
  86. package/dist/cjs/react/nodes/layoutColumn.js +0 -8
  87. package/dist/cjs/react/nodes/layoutSection.js +0 -3
  88. package/dist/cjs/react/nodes/listItem.js +0 -3
  89. package/dist/cjs/react/nodes/media.js +10 -49
  90. package/dist/cjs/react/nodes/mediaGroup.js +6 -47
  91. package/dist/cjs/react/nodes/mediaInline.js +7 -37
  92. package/dist/cjs/react/nodes/mediaSingle/index.js +38 -85
  93. package/dist/cjs/react/nodes/mediaSingle/styles.js +0 -5
  94. package/dist/cjs/react/nodes/mention.js +5 -23
  95. package/dist/cjs/react/nodes/orderedList.js +0 -14
  96. package/dist/cjs/react/nodes/panel.js +10 -38
  97. package/dist/cjs/react/nodes/paragraph.js +1 -5
  98. package/dist/cjs/react/nodes/placeholder.js +0 -4
  99. package/dist/cjs/react/nodes/rule.js +0 -3
  100. package/dist/cjs/react/nodes/status.js +3 -22
  101. package/dist/cjs/react/nodes/table/colgroup.js +12 -26
  102. package/dist/cjs/react/nodes/table/sticky.js +17 -47
  103. package/dist/cjs/react/nodes/table/table.js +5 -10
  104. package/dist/cjs/react/nodes/table.js +19 -102
  105. package/dist/cjs/react/nodes/tableCell.js +26 -79
  106. package/dist/cjs/react/nodes/tableRow.js +4 -33
  107. package/dist/cjs/react/nodes/task-item-with-providers.js +4 -40
  108. package/dist/cjs/react/nodes/taskItem.js +8 -36
  109. package/dist/cjs/react/nodes/taskList.js +2 -22
  110. package/dist/cjs/react/nodes/text-wrapper.js +1 -8
  111. package/dist/cjs/react/nodes/unknownBlock.js +0 -3
  112. package/dist/cjs/react/renderer-node.js +0 -6
  113. package/dist/cjs/react/utils/clipboard.js +0 -3
  114. package/dist/cjs/react/utils/element-selection.js +0 -13
  115. package/dist/cjs/react/utils/getCardClickHandler.js +0 -3
  116. package/dist/cjs/react/utils/inject-props.js +4 -9
  117. package/dist/cjs/react/utils/links.js +2 -6
  118. package/dist/cjs/react/utils/lists.js +0 -1
  119. package/dist/cjs/react/utils/performance/RenderTracking.js +2 -10
  120. package/dist/cjs/react/utils/use-select-all-trap.js +1 -23
  121. package/dist/cjs/render-document.js +42 -83
  122. package/dist/cjs/renderer-context.js +0 -5
  123. package/dist/cjs/steps/index.js +7 -39
  124. package/dist/cjs/text/index.js +0 -9
  125. package/dist/cjs/text/nodes/blockquote.js +0 -3
  126. package/dist/cjs/text/nodes/bulletList.js +0 -3
  127. package/dist/cjs/text/nodes/date.js +0 -4
  128. package/dist/cjs/text/nodes/decisionItem.js +0 -5
  129. package/dist/cjs/text/nodes/hardBreak.js +0 -2
  130. package/dist/cjs/text/nodes/heading.js +0 -3
  131. package/dist/cjs/text/nodes/index.js +0 -21
  132. package/dist/cjs/text/nodes/inlineCard.js +0 -4
  133. package/dist/cjs/text/nodes/listItem.js +0 -3
  134. package/dist/cjs/text/nodes/mediaGroup.js +0 -4
  135. package/dist/cjs/text/nodes/mention.js +0 -3
  136. package/dist/cjs/text/nodes/orderedList.js +0 -4
  137. package/dist/cjs/text/nodes/panel.js +0 -3
  138. package/dist/cjs/text/nodes/paragraph.js +0 -5
  139. package/dist/cjs/text/nodes/rule.js +0 -2
  140. package/dist/cjs/text/nodes/status.js +0 -3
  141. package/dist/cjs/text/nodes/table.js +0 -5
  142. package/dist/cjs/text/nodes/taskItem.js +0 -5
  143. package/dist/cjs/text/nodes/unknown.js +0 -6
  144. package/dist/cjs/text-serializer.js +0 -2
  145. package/dist/cjs/ui/Expand.js +15 -59
  146. package/dist/cjs/ui/ExtensionRenderer.js +10 -43
  147. package/dist/cjs/ui/MediaCard.js +40 -116
  148. package/dist/cjs/ui/Renderer/ErrorBoundary.js +0 -26
  149. package/dist/cjs/ui/Renderer/breakout-ssr.js +6 -32
  150. package/dist/cjs/ui/Renderer/click-to-edit.js +0 -6
  151. package/dist/cjs/ui/Renderer/index.js +47 -149
  152. package/dist/cjs/ui/Renderer/style.js +1 -39
  153. package/dist/cjs/ui/Renderer/truncated-wrapper.js +12 -30
  154. package/dist/cjs/ui/RendererActionsContext/WithRendererActions.js +0 -4
  155. package/dist/cjs/ui/RendererActionsContext/index.js +1 -11
  156. package/dist/cjs/ui/SmartCardStorage.js +0 -20
  157. package/dist/cjs/ui/SortingIcon.js +10 -40
  158. package/dist/cjs/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -11
  159. package/dist/cjs/ui/TaskItemsFormatContext/index.js +0 -1
  160. package/dist/cjs/ui/active-header-id-provider.js +6 -19
  161. package/dist/cjs/ui/annotations/context.js +0 -24
  162. package/dist/cjs/ui/annotations/draft/component.js +5 -42
  163. package/dist/cjs/ui/annotations/draft/dom.js +3 -17
  164. package/dist/cjs/ui/annotations/draft/index.js +0 -2
  165. package/dist/cjs/ui/annotations/draft/position.js +1 -12
  166. package/dist/cjs/ui/annotations/draft/text.js +2 -8
  167. package/dist/cjs/ui/annotations/element/index.js +4 -16
  168. package/dist/cjs/ui/annotations/element/mark.js +8 -26
  169. package/dist/cjs/ui/annotations/hooks/index.js +0 -3
  170. package/dist/cjs/ui/annotations/hooks/use-events.js +13 -45
  171. package/dist/cjs/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -6
  172. package/dist/cjs/ui/annotations/hooks/use-inline-comments-filter.js +1 -8
  173. package/dist/cjs/ui/annotations/hooks/use-load-annotations.js +4 -19
  174. package/dist/cjs/ui/annotations/hooks/user-selection.js +3 -18
  175. package/dist/cjs/ui/annotations/hooks/utils.js +0 -2
  176. package/dist/cjs/ui/annotations/index.js +4 -20
  177. package/dist/cjs/ui/annotations/selection/index.js +0 -1
  178. package/dist/cjs/ui/annotations/selection/mounter.js +13 -42
  179. package/dist/cjs/ui/annotations/selection/range-validator.js +9 -23
  180. package/dist/cjs/ui/annotations/selection/wrapper.js +3 -13
  181. package/dist/cjs/ui/annotations/types.js +0 -1
  182. package/dist/cjs/ui/annotations/view/index.js +1 -12
  183. package/dist/cjs/ui/index.js +0 -2
  184. package/dist/cjs/use-feature-flags.js +0 -4
  185. package/dist/cjs/utils.js +1 -19
  186. package/dist/cjs/version.json +1 -1
  187. package/dist/es2019/actions/index.js +6 -50
  188. package/dist/es2019/actions/matches-utils.js +10 -9
  189. package/dist/es2019/actions.js +2 -1
  190. package/dist/es2019/analytics/events.js +0 -5
  191. package/dist/es2019/analytics/unsupported-content.js +8 -14
  192. package/dist/es2019/react/hooks/use-bidi-warnings.js +0 -2
  193. package/dist/es2019/react/hooks/use-in-viewport.js +0 -1
  194. package/dist/es2019/react/hooks/use-observed-width.js +0 -2
  195. package/dist/es2019/react/index.js +44 -119
  196. package/dist/es2019/react/marks/alignment.js +0 -3
  197. package/dist/es2019/react/marks/annotation.js +2 -5
  198. package/dist/es2019/react/marks/confluence-inline-comment.js +0 -1
  199. package/dist/es2019/react/marks/index.js +2 -1
  200. package/dist/es2019/react/marks/link.js +0 -6
  201. package/dist/es2019/react/marks/subsup.js +0 -3
  202. package/dist/es2019/react/nodes/bodiedExtension.js +2 -5
  203. package/dist/es2019/react/nodes/caption.js +0 -2
  204. package/dist/es2019/react/nodes/codeBlock/codeBlock.js +0 -2
  205. package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +1 -3
  206. package/dist/es2019/react/nodes/codeBlock/windowedCodeBlock.js +1 -6
  207. package/dist/es2019/react/nodes/codeBlockCopyButton.js +0 -4
  208. package/dist/es2019/react/nodes/date.js +0 -7
  209. package/dist/es2019/react/nodes/decisionList.js +0 -3
  210. package/dist/es2019/react/nodes/embedCard.js +8 -16
  211. package/dist/es2019/react/nodes/emoji.js +0 -1
  212. package/dist/es2019/react/nodes/extension.js +4 -6
  213. package/dist/es2019/react/nodes/fallback.js +0 -8
  214. package/dist/es2019/react/nodes/hardBreak.js +0 -3
  215. package/dist/es2019/react/nodes/heading-anchor.js +0 -15
  216. package/dist/es2019/react/nodes/heading.js +0 -6
  217. package/dist/es2019/react/nodes/index.js +28 -61
  218. package/dist/es2019/react/nodes/inline.js +0 -2
  219. package/dist/es2019/react/nodes/inlineCard.js +0 -5
  220. package/dist/es2019/react/nodes/inlineExtension.js +2 -5
  221. package/dist/es2019/react/nodes/media.js +0 -10
  222. package/dist/es2019/react/nodes/mediaGroup.js +2 -22
  223. package/dist/es2019/react/nodes/mediaInline.js +1 -8
  224. package/dist/es2019/react/nodes/mediaSingle/index.js +8 -29
  225. package/dist/es2019/react/nodes/mention.js +0 -1
  226. package/dist/es2019/react/nodes/orderedList.js +0 -5
  227. package/dist/es2019/react/nodes/panel.js +4 -17
  228. package/dist/es2019/react/nodes/placeholder.js +0 -1
  229. package/dist/es2019/react/nodes/status.js +0 -1
  230. package/dist/es2019/react/nodes/table/colgroup.js +9 -18
  231. package/dist/es2019/react/nodes/table/sticky.js +3 -16
  232. package/dist/es2019/react/nodes/table.js +9 -75
  233. package/dist/es2019/react/nodes/tableCell.js +4 -31
  234. package/dist/es2019/react/nodes/tableRow.js +0 -10
  235. package/dist/es2019/react/nodes/task-item-with-providers.js +0 -6
  236. package/dist/es2019/react/nodes/taskItem.js +0 -7
  237. package/dist/es2019/react/nodes/taskList.js +0 -3
  238. package/dist/es2019/react/nodes/text-wrapper.js +0 -4
  239. package/dist/es2019/react/utils/clipboard.js +0 -1
  240. package/dist/es2019/react/utils/element-selection.js +0 -12
  241. package/dist/es2019/react/utils/inject-props.js +5 -7
  242. package/dist/es2019/react/utils/links.js +2 -4
  243. package/dist/es2019/react/utils/performance/RenderTracking.js +0 -1
  244. package/dist/es2019/react/utils/use-select-all-trap.js +0 -7
  245. package/dist/es2019/render-document.js +16 -33
  246. package/dist/es2019/steps/index.js +4 -33
  247. package/dist/es2019/text/index.js +0 -3
  248. package/dist/es2019/text/nodes/blockquote.js +0 -2
  249. package/dist/es2019/text/nodes/bulletList.js +0 -2
  250. package/dist/es2019/text/nodes/date.js +0 -2
  251. package/dist/es2019/text/nodes/decisionItem.js +0 -4
  252. package/dist/es2019/text/nodes/hardBreak.js +0 -1
  253. package/dist/es2019/text/nodes/heading.js +0 -2
  254. package/dist/es2019/text/nodes/inlineCard.js +0 -3
  255. package/dist/es2019/text/nodes/listItem.js +0 -2
  256. package/dist/es2019/text/nodes/mediaGroup.js +0 -3
  257. package/dist/es2019/text/nodes/mention.js +0 -2
  258. package/dist/es2019/text/nodes/orderedList.js +0 -2
  259. package/dist/es2019/text/nodes/panel.js +0 -2
  260. package/dist/es2019/text/nodes/paragraph.js +0 -4
  261. package/dist/es2019/text/nodes/rule.js +0 -1
  262. package/dist/es2019/text/nodes/status.js +0 -2
  263. package/dist/es2019/text/nodes/table.js +0 -4
  264. package/dist/es2019/text/nodes/taskItem.js +0 -4
  265. package/dist/es2019/text/nodes/unknown.js +0 -4
  266. package/dist/es2019/ui/Expand.js +2 -17
  267. package/dist/es2019/ui/ExtensionRenderer.js +0 -19
  268. package/dist/es2019/ui/MediaCard.js +9 -40
  269. package/dist/es2019/ui/Renderer/ErrorBoundary.js +0 -10
  270. package/dist/es2019/ui/Renderer/breakout-ssr.js +6 -26
  271. package/dist/es2019/ui/Renderer/click-to-edit.js +1 -4
  272. package/dist/es2019/ui/Renderer/index.js +17 -66
  273. package/dist/es2019/ui/Renderer/style.js +0 -14
  274. package/dist/es2019/ui/Renderer/truncated-wrapper.js +2 -6
  275. package/dist/es2019/ui/SmartCardStorage.js +0 -1
  276. package/dist/es2019/ui/SortingIcon.js +3 -20
  277. package/dist/es2019/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -2
  278. package/dist/es2019/ui/active-header-id-provider.js +0 -3
  279. package/dist/es2019/ui/annotations/context.js +0 -6
  280. package/dist/es2019/ui/annotations/draft/component.js +0 -13
  281. package/dist/es2019/ui/annotations/draft/dom.js +0 -6
  282. package/dist/es2019/ui/annotations/draft/position.js +0 -8
  283. package/dist/es2019/ui/annotations/draft/text.js +0 -1
  284. package/dist/es2019/ui/annotations/element/index.js +0 -3
  285. package/dist/es2019/ui/annotations/element/mark.js +4 -6
  286. package/dist/es2019/ui/annotations/hooks/use-events.js +4 -13
  287. package/dist/es2019/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -2
  288. package/dist/es2019/ui/annotations/hooks/use-inline-comments-filter.js +0 -1
  289. package/dist/es2019/ui/annotations/hooks/use-load-annotations.js +4 -8
  290. package/dist/es2019/ui/annotations/hooks/user-selection.js +0 -6
  291. package/dist/es2019/ui/annotations/selection/mounter.js +0 -13
  292. package/dist/es2019/ui/annotations/selection/range-validator.js +0 -2
  293. package/dist/es2019/ui/annotations/selection/wrapper.js +0 -2
  294. package/dist/es2019/ui/annotations/types.js +0 -1
  295. package/dist/es2019/ui/annotations/view/index.js +0 -4
  296. package/dist/es2019/use-feature-flags.js +0 -1
  297. package/dist/es2019/utils.js +1 -8
  298. package/dist/es2019/version.json +1 -1
  299. package/dist/esm/actions/index.js +19 -63
  300. package/dist/esm/actions/matches-utils.js +10 -9
  301. package/dist/esm/actions.js +2 -1
  302. package/dist/esm/analytics/events.js +0 -5
  303. package/dist/esm/analytics/unsupported-content.js +14 -21
  304. package/dist/esm/react/hooks/use-bidi-warnings.js +2 -4
  305. package/dist/esm/react/hooks/use-in-viewport.js +4 -13
  306. package/dist/esm/react/hooks/use-observed-width.js +20 -29
  307. package/dist/esm/react/index.js +27 -111
  308. package/dist/esm/react/marks/alignment.js +0 -4
  309. package/dist/esm/react/marks/annotation.js +6 -14
  310. package/dist/esm/react/marks/breakout.js +0 -2
  311. package/dist/esm/react/marks/confluence-inline-comment.js +2 -12
  312. package/dist/esm/react/marks/index.js +2 -1
  313. package/dist/esm/react/marks/link.js +5 -12
  314. package/dist/esm/react/marks/subsup.js +0 -3
  315. package/dist/esm/react/nodes/blockCard.js +4 -4
  316. package/dist/esm/react/nodes/bodiedExtension.js +6 -10
  317. package/dist/esm/react/nodes/caption.js +1 -3
  318. package/dist/esm/react/nodes/codeBlock/codeBlock.js +4 -6
  319. package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +4 -8
  320. package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +6 -10
  321. package/dist/esm/react/nodes/codeBlock/windowedCodeBlock.js +10 -21
  322. package/dist/esm/react/nodes/codeBlockCopyButton.js +7 -15
  323. package/dist/esm/react/nodes/date.js +5 -20
  324. package/dist/esm/react/nodes/decisionItem.js +1 -1
  325. package/dist/esm/react/nodes/decisionList.js +0 -12
  326. package/dist/esm/react/nodes/embedCard.js +25 -39
  327. package/dist/esm/react/nodes/emoji.js +6 -16
  328. package/dist/esm/react/nodes/extension.js +12 -16
  329. package/dist/esm/react/nodes/fallback.js +2 -18
  330. package/dist/esm/react/nodes/hardBreak.js +1 -5
  331. package/dist/esm/react/nodes/heading-anchor.js +1 -32
  332. package/dist/esm/react/nodes/heading.js +4 -10
  333. package/dist/esm/react/nodes/index.js +26 -64
  334. package/dist/esm/react/nodes/inline.js +0 -2
  335. package/dist/esm/react/nodes/inlineCard.js +6 -12
  336. package/dist/esm/react/nodes/inlineExtension.js +2 -6
  337. package/dist/esm/react/nodes/layoutColumn.js +0 -2
  338. package/dist/esm/react/nodes/media.js +10 -34
  339. package/dist/esm/react/nodes/mediaGroup.js +6 -37
  340. package/dist/esm/react/nodes/mediaInline.js +7 -20
  341. package/dist/esm/react/nodes/mediaSingle/index.js +37 -66
  342. package/dist/esm/react/nodes/mediaSingle/styles.js +0 -2
  343. package/dist/esm/react/nodes/mention.js +5 -15
  344. package/dist/esm/react/nodes/orderedList.js +0 -5
  345. package/dist/esm/react/nodes/panel.js +12 -28
  346. package/dist/esm/react/nodes/paragraph.js +1 -1
  347. package/dist/esm/react/nodes/placeholder.js +0 -1
  348. package/dist/esm/react/nodes/status.js +3 -13
  349. package/dist/esm/react/nodes/table/colgroup.js +12 -21
  350. package/dist/esm/react/nodes/table/sticky.js +17 -32
  351. package/dist/esm/react/nodes/table/table.js +5 -5
  352. package/dist/esm/react/nodes/table.js +19 -95
  353. package/dist/esm/react/nodes/tableCell.js +26 -66
  354. package/dist/esm/react/nodes/tableRow.js +4 -25
  355. package/dist/esm/react/nodes/task-item-with-providers.js +4 -27
  356. package/dist/esm/react/nodes/taskItem.js +8 -24
  357. package/dist/esm/react/nodes/taskList.js +2 -14
  358. package/dist/esm/react/nodes/text-wrapper.js +1 -5
  359. package/dist/esm/react/utils/clipboard.js +0 -1
  360. package/dist/esm/react/utils/element-selection.js +0 -10
  361. package/dist/esm/react/utils/inject-props.js +5 -7
  362. package/dist/esm/react/utils/links.js +2 -4
  363. package/dist/esm/react/utils/performance/RenderTracking.js +2 -4
  364. package/dist/esm/react/utils/use-select-all-trap.js +1 -9
  365. package/dist/esm/render-document.js +42 -70
  366. package/dist/esm/steps/index.js +7 -36
  367. package/dist/esm/text/index.js +0 -6
  368. package/dist/esm/text/nodes/blockquote.js +0 -2
  369. package/dist/esm/text/nodes/bulletList.js +0 -2
  370. package/dist/esm/text/nodes/date.js +0 -2
  371. package/dist/esm/text/nodes/decisionItem.js +0 -4
  372. package/dist/esm/text/nodes/hardBreak.js +0 -1
  373. package/dist/esm/text/nodes/heading.js +0 -2
  374. package/dist/esm/text/nodes/inlineCard.js +0 -3
  375. package/dist/esm/text/nodes/listItem.js +0 -2
  376. package/dist/esm/text/nodes/mediaGroup.js +0 -3
  377. package/dist/esm/text/nodes/mention.js +0 -2
  378. package/dist/esm/text/nodes/orderedList.js +0 -2
  379. package/dist/esm/text/nodes/panel.js +0 -2
  380. package/dist/esm/text/nodes/paragraph.js +0 -4
  381. package/dist/esm/text/nodes/rule.js +0 -1
  382. package/dist/esm/text/nodes/status.js +0 -2
  383. package/dist/esm/text/nodes/table.js +0 -4
  384. package/dist/esm/text/nodes/taskItem.js +0 -4
  385. package/dist/esm/text/nodes/unknown.js +0 -4
  386. package/dist/esm/ui/Expand.js +15 -36
  387. package/dist/esm/ui/ExtensionRenderer.js +10 -39
  388. package/dist/esm/ui/MediaCard.js +42 -99
  389. package/dist/esm/ui/Renderer/ErrorBoundary.js +0 -16
  390. package/dist/esm/ui/Renderer/breakout-ssr.js +7 -27
  391. package/dist/esm/ui/Renderer/click-to-edit.js +1 -4
  392. package/dist/esm/ui/Renderer/index.js +47 -110
  393. package/dist/esm/ui/Renderer/style.js +1 -21
  394. package/dist/esm/ui/Renderer/truncated-wrapper.js +12 -23
  395. package/dist/esm/ui/RendererActionsContext/index.js +1 -1
  396. package/dist/esm/ui/SmartCardStorage.js +0 -9
  397. package/dist/esm/ui/SortingIcon.js +10 -29
  398. package/dist/esm/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -2
  399. package/dist/esm/ui/active-header-id-provider.js +6 -12
  400. package/dist/esm/ui/annotations/context.js +0 -15
  401. package/dist/esm/ui/annotations/draft/component.js +5 -19
  402. package/dist/esm/ui/annotations/draft/dom.js +3 -11
  403. package/dist/esm/ui/annotations/draft/position.js +1 -9
  404. package/dist/esm/ui/annotations/draft/text.js +2 -4
  405. package/dist/esm/ui/annotations/element/index.js +4 -7
  406. package/dist/esm/ui/annotations/element/mark.js +8 -14
  407. package/dist/esm/ui/annotations/hooks/use-events.js +13 -32
  408. package/dist/esm/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -2
  409. package/dist/esm/ui/annotations/hooks/use-inline-comments-filter.js +1 -2
  410. package/dist/esm/ui/annotations/hooks/use-load-annotations.js +4 -12
  411. package/dist/esm/ui/annotations/hooks/user-selection.js +3 -11
  412. package/dist/esm/ui/annotations/index.js +4 -6
  413. package/dist/esm/ui/annotations/selection/mounter.js +13 -29
  414. package/dist/esm/ui/annotations/selection/range-validator.js +9 -12
  415. package/dist/esm/ui/annotations/selection/wrapper.js +3 -5
  416. package/dist/esm/ui/annotations/types.js +0 -1
  417. package/dist/esm/ui/annotations/view/index.js +1 -5
  418. package/dist/esm/use-feature-flags.js +0 -1
  419. package/dist/esm/utils.js +1 -8
  420. package/dist/esm/version.json +1 -1
  421. package/package.json +7 -7
@@ -5,11 +5,8 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
5
5
  import _createClass from "@babel/runtime/helpers/createClass";
6
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
7
  var _excluded = ["key"];
8
-
9
8
  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; }
10
-
11
9
  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; }
12
-
13
10
  import React from 'react';
14
11
  import { MarkType } from 'prosemirror-model';
15
12
  import { isNestedHeaderLinksEnabled } from './utils/links';
@@ -22,21 +19,17 @@ import { getText } from '../utils';
22
19
  import { findChildrenByType } from 'prosemirror-utils';
23
20
  import { insideBreakoutLayout } from './renderer-node';
24
21
  import { isCodeMark } from './marks/code';
25
-
26
22
  function mergeMarks(marksAndNodes) {
27
23
  return marksAndNodes.reduce(function (acc, markOrNode) {
28
24
  var prev = acc.length && acc[acc.length - 1] || null;
29
-
30
25
  if (markOrNode.type instanceof MarkType && prev && prev.type instanceof MarkType && Array.isArray(prev.content) && isSameMark(prev, markOrNode)) {
31
26
  prev.content = mergeMarks(prev.content.concat(markOrNode.content));
32
27
  } else {
33
28
  acc.push(markOrNode);
34
29
  }
35
-
36
30
  return acc;
37
31
  }, []);
38
32
  }
39
-
40
33
  var ReactSerializer = /*#__PURE__*/function () {
41
34
  /**
42
35
  * The reason we have this extra array here is because we need to generate the same unique
@@ -46,35 +39,25 @@ var ReactSerializer = /*#__PURE__*/function () {
46
39
  * We will eventually need to refactor the current approach to generate unique ids
47
40
  * for headers under this ticket -> https://product-fabric.atlassian.net/browse/ED-9668
48
41
  */
42
+
49
43
  function ReactSerializer(init) {
50
44
  var _this = this;
51
-
52
45
  _classCallCheck(this, ReactSerializer);
53
-
54
46
  _defineProperty(this, "headingIds", []);
55
-
56
47
  _defineProperty(this, "expandHeadingIds", []);
57
-
58
48
  _defineProperty(this, "allowCopyToClipboard", false);
59
-
60
49
  _defineProperty(this, "allowPlaceholderText", true);
61
-
62
50
  _defineProperty(this, "allowCustomPanels", false);
63
-
64
51
  _defineProperty(this, "startPos", 1);
65
-
66
52
  _defineProperty(this, "surroundTextNodesWithTextWrapper", false);
67
-
68
53
  _defineProperty(this, "allowAnnotations", false);
69
-
70
54
  _defineProperty(this, "serializeFragmentChild", function (node, _ref) {
71
55
  var index = _ref.index,
72
- parentInfo = _ref.parentInfo;
56
+ parentInfo = _ref.parentInfo;
73
57
  var pos = _this.startPos;
74
58
  var currentPath = parentInfo && parentInfo.path || [];
75
59
  var parentIsIncompleteTask = node.type.name === 'taskItem' && node.attrs.state !== 'DONE';
76
60
  var nodeKey = "".concat(node.type.name, "__").concat(_this.startPos);
77
-
78
61
  var serializedContent = _this.serializeFragment(node.content, _this.getNodeProps(node, parentInfo), toReact(node, {
79
62
  allowSelectAllTrap: _this.allowSelectAllTrap,
80
63
  allowWindowedCodeBlock: _this.allowWindowedCodeBlock
@@ -83,47 +66,38 @@ var ReactSerializer = /*#__PURE__*/function () {
83
66
  path: [].concat(_toConsumableArray(currentPath), [node]),
84
67
  pos: _this.startPos
85
68
  });
86
-
87
69
  _this.startPos = pos + node.nodeSize;
88
70
  var marks = node.marks ? _toConsumableArray(node.marks) : [];
89
71
  var isMedia = node.type.name === 'media';
90
-
91
72
  var shouldSkipMark = function shouldSkipMark(mark) {
92
73
  return _this.allowMediaLinking !== true && isMedia && mark.type.name === 'link';
93
74
  };
94
-
95
75
  return marks.reverse().reduce(function (content, mark) {
96
76
  if (shouldSkipMark(mark)) {
97
77
  return content;
98
78
  }
99
-
100
79
  return _this.renderMark(markToReact(mark), _this.withMediaMarkProps(node, mark, _this.getMarkProps(mark, [], node)), "".concat(mark.type.name, "-").concat(index), content);
101
80
  }, serializedContent);
102
81
  });
103
-
104
82
  _defineProperty(this, "withMediaMarkProps", function (node, mark, defaultProps) {
105
83
  if (mark.type.name === 'link' && node.type.name === 'media') {
106
84
  return _objectSpread(_objectSpread({}, defaultProps), {}, {
107
85
  isMediaLink: true
108
86
  });
109
87
  }
110
-
111
88
  return defaultProps;
112
89
  });
113
-
114
90
  _defineProperty(this, "getUnsupportedContentProps", function (node) {
115
91
  return {
116
92
  node: node,
117
93
  dispatchAnalyticsEvent: _this.fireAnalyticsEvent
118
94
  };
119
95
  });
120
-
121
96
  _defineProperty(this, "getAnnotationMarkProps", function (mark, marksParentPath) {
122
97
  var annotationParentIds = (marksParentPath || []).reduce(function (acc, parent) {
123
98
  if (isAnnotationMark(parent)) {
124
99
  return [].concat(_toConsumableArray(acc), [parent.attrs.id]);
125
100
  }
126
-
127
101
  return acc;
128
102
  }, []);
129
103
  return {
@@ -136,20 +110,18 @@ var ReactSerializer = /*#__PURE__*/function () {
136
110
  }
137
111
  };
138
112
  });
139
-
140
113
  _defineProperty(this, "getMarkProps", function (mark, marksParentPath, node) {
141
114
  if (isAnnotationMark(mark)) {
142
115
  return _this.getAnnotationMarkProps(mark, marksParentPath);
143
116
  }
144
-
145
117
  var _mark$attrs = mark.attrs,
146
- key = _mark$attrs.key,
147
- otherAttrs = _objectWithoutProperties(_mark$attrs, _excluded);
148
-
118
+ key = _mark$attrs.key,
119
+ otherAttrs = _objectWithoutProperties(_mark$attrs, _excluded);
149
120
  var extraProps = {
150
121
  isInline: node === null || node === void 0 ? void 0 : node.isInline
151
- }; // currently the only mark which has custom props is the code mark
122
+ };
152
123
 
124
+ // currently the only mark which has custom props is the code mark
153
125
  var markSpecificProps = isCodeMark(mark) ? {
154
126
  // The appearance being mobile indicates we are in an renderer being
155
127
  // rendered by mobile bridge in a web view.
@@ -158,7 +130,6 @@ var ReactSerializer = /*#__PURE__*/function () {
158
130
  // the rendering in the mobile Native Renderer.
159
131
  codeBidiWarningTooltipEnabled: _this.appearance !== 'mobile'
160
132
  } : {};
161
-
162
133
  var props = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
163
134
  eventHandlers: _this.eventHandlers,
164
135
  fireAnalyticsEvent: _this.fireAnalyticsEvent,
@@ -168,10 +139,8 @@ var ReactSerializer = /*#__PURE__*/function () {
168
139
  'data-renderer-mark': true
169
140
  }
170
141
  });
171
-
172
142
  return props;
173
143
  });
174
-
175
144
  this.providers = init.providers;
176
145
  this.eventHandlers = init.eventHandlers;
177
146
  this.extensionHandlers = init.extensionHandlers;
@@ -199,7 +168,6 @@ var ReactSerializer = /*#__PURE__*/function () {
199
168
  this.nodeComponents = init.nodeComponents;
200
169
  this.allowWindowedCodeBlock = init.allowWindowedCodeBlock;
201
170
  }
202
-
203
171
  _createClass(ReactSerializer, [{
204
172
  key: "resetState",
205
173
  value: function resetState() {
@@ -211,58 +179,41 @@ var ReactSerializer = /*#__PURE__*/function () {
211
179
  key: "getNodeProps",
212
180
  value: function getNodeProps(node, parentInfo) {
213
181
  var path = parentInfo ? parentInfo.path : undefined;
214
-
215
182
  switch (node.type.name) {
216
183
  case 'date':
217
184
  return this.getDateProps(node, parentInfo);
218
-
219
185
  case 'hardBreak':
220
186
  return this.getHardBreakProps(node, path);
221
-
222
187
  case 'heading':
223
188
  return this.getHeadingProps(node, path);
224
-
225
189
  case 'media':
226
190
  return this.getMediaProps(node, path);
227
-
228
191
  case 'emoji':
229
192
  return this.getEmojiProps(node);
230
-
231
193
  case 'mediaGroup':
232
194
  return this.getMediaGroupProps(node);
233
-
234
195
  case 'mediaInline':
235
196
  return this.getMediaInlineProps(node);
236
-
237
197
  case 'mediaSingle':
238
198
  return this.getMediaSingleProps(node, path);
239
-
240
199
  case 'table':
241
200
  return this.getTableProps(node, path);
242
-
243
201
  case 'tableHeader':
244
202
  case 'tableRow':
245
203
  return this.getTableChildrenProps(node);
246
-
247
204
  case 'taskItem':
248
205
  return this.getTaskItemProps(node, path);
249
-
250
206
  case 'embedCard':
251
207
  return this.getEmbedCardProps(node, path);
252
-
253
208
  case 'expand':
254
209
  return this.getExpandProps(node, path);
255
-
256
210
  case 'unsupportedBlock':
257
211
  case 'unsupportedInline':
258
212
  return this.getUnsupportedContentProps(node);
259
-
260
213
  case 'codeBlock':
261
214
  return this.getCodeBlockProps(node);
262
-
263
215
  case 'panel':
264
216
  return this.getPanelProps(node);
265
-
266
217
  default:
267
218
  return this.getProps(node, path);
268
219
  }
@@ -271,17 +222,14 @@ var ReactSerializer = /*#__PURE__*/function () {
271
222
  key: "serializeFragment",
272
223
  value: function serializeFragment(fragment) {
273
224
  var _this2 = this;
274
-
275
225
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
276
226
  var target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.allowSelectAllTrap ? DocWithSelectAllTrap : Doc;
277
227
  var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'root-0';
278
228
  var parentInfo = arguments.length > 4 ? arguments[4] : undefined;
279
-
280
229
  // This makes sure that we reset internal state on re-render.
281
230
  if (key === 'root-0') {
282
231
  this.resetState();
283
232
  }
284
-
285
233
  return this.renderNode(target, props, key, ReactSerializer.getChildNodes(fragment).map(function (node, index) {
286
234
  if (isTextWrapper(node)) {
287
235
  return _this2.serializeTextWrapper(node.content, {
@@ -289,7 +237,6 @@ var ReactSerializer = /*#__PURE__*/function () {
289
237
  parentInfo: parentInfo
290
238
  });
291
239
  }
292
-
293
240
  return _this2.serializeFragmentChild(node, {
294
241
  index: index,
295
242
  parentInfo: parentInfo
@@ -300,9 +247,8 @@ var ReactSerializer = /*#__PURE__*/function () {
300
247
  key: "serializeTextWrapper",
301
248
  value: function serializeTextWrapper(content, _ref2) {
302
249
  var _this3 = this;
303
-
304
250
  var index = _ref2.index,
305
- parentInfo = _ref2.parentInfo;
251
+ parentInfo = _ref2.parentInfo;
306
252
  var currentPath = parentInfo && parentInfo.path || [];
307
253
  var nodePosition = parentInfo && parentInfo.pos || 1;
308
254
  return ReactSerializer.buildMarkStructure(content).map(function (mark, index) {
@@ -322,11 +268,9 @@ var ReactSerializer = /*#__PURE__*/function () {
322
268
  key: "serializeMark",
323
269
  value: function serializeMark(_ref3) {
324
270
  var _this4 = this;
325
-
326
271
  var mark = _ref3.mark,
327
- parentNode = _ref3.parentNode,
328
- parentMark = _ref3.parentMark;
329
-
272
+ parentNode = _ref3.parentNode,
273
+ parentMark = _ref3.parentMark;
330
274
  if (!isTextNode(mark)) {
331
275
  var serializeContent = function serializeContent(childMark, index) {
332
276
  return _this4.serializeMark({
@@ -337,16 +281,13 @@ var ReactSerializer = /*#__PURE__*/function () {
337
281
  }
338
282
  });
339
283
  };
340
-
341
284
  var content = (mark.content || []).map(serializeContent);
342
285
  var markKey = "".concat(mark.type.name, "-component__").concat(this.startPos, "__").concat(parentMark.path.length);
343
286
  return this.renderMark(markToReact(mark), this.getMarkProps(mark, parentMark.path), markKey, content);
344
287
  }
345
-
346
288
  var startPos = this.startPos;
347
289
  var endPos = startPos + mark.nodeSize;
348
290
  this.startPos = endPos;
349
-
350
291
  if (this.surroundTextNodesWithTextWrapper) {
351
292
  var textKey = "text-wrapper_".concat(this.startPos);
352
293
  var parentDepth = Math.max(parentNode.path.length - 1, 0);
@@ -356,7 +297,6 @@ var ReactSerializer = /*#__PURE__*/function () {
356
297
  endPos: endPos + parentDepth
357
298
  }, mark.text);
358
299
  }
359
-
360
300
  return mark.text || '';
361
301
  }
362
302
  }, {
@@ -405,14 +345,13 @@ var ReactSerializer = /*#__PURE__*/function () {
405
345
  key: "getMediaSingleProps",
406
346
  value: function getMediaSingleProps(node) {
407
347
  var _this5 = this;
408
-
409
348
  var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
410
349
  var _node$type$schema = node.type.schema,
411
- _node$type$schema$nod = _node$type$schema.nodes,
412
- expand = _node$type$schema$nod.expand,
413
- nestedExpand = _node$type$schema$nod.nestedExpand,
414
- layoutColumn = _node$type$schema$nod.layoutColumn,
415
- link = _node$type$schema.marks.link;
350
+ _node$type$schema$nod = _node$type$schema.nodes,
351
+ expand = _node$type$schema$nod.expand,
352
+ nestedExpand = _node$type$schema$nod.nestedExpand,
353
+ layoutColumn = _node$type$schema$nod.layoutColumn,
354
+ link = _node$type$schema.marks.link;
416
355
  var blockNodeNames = [expand, nestedExpand, layoutColumn].filter(function (node) {
417
356
  return Boolean(node);
418
357
  }) // Check if the node exist first
@@ -422,11 +361,9 @@ var ReactSerializer = /*#__PURE__*/function () {
422
361
  var isInsideOfBlockNode = path && path.some(function (n) {
423
362
  return n.type && blockNodeNames.indexOf(n.type.name) > -1;
424
363
  });
425
-
426
364
  var isLinkMark = function isLinkMark(mark) {
427
365
  return mark.type === link;
428
366
  };
429
-
430
367
  var childHasLink = node.firstChild && node.firstChild.marks.filter(function (m) {
431
368
  return isLinkMark(m) || _this5.allowMediaLinking === true;
432
369
  }).length;
@@ -440,15 +377,12 @@ var ReactSerializer = /*#__PURE__*/function () {
440
377
  key: "getMediaProps",
441
378
  value: function getMediaProps(node) {
442
379
  var _this6 = this,
443
- _this$media;
444
-
380
+ _this$media;
445
381
  var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
446
382
  var link = node.type.schema.marks.link;
447
-
448
383
  var isLinkMark = function isLinkMark(mark) {
449
384
  return mark.type === link;
450
385
  };
451
-
452
386
  return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
453
387
  marks: node.marks.filter(function (m) {
454
388
  return !isLinkMark(m) || _this6.allowMediaLinking === true;
@@ -472,9 +406,9 @@ var ReactSerializer = /*#__PURE__*/function () {
472
406
  value: function getEmbedCardProps(node) {
473
407
  var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
474
408
  var _node$type$schema$nod2 = node.type.schema.nodes,
475
- expand = _node$type$schema$nod2.expand,
476
- nestedExpand = _node$type$schema$nod2.nestedExpand,
477
- layoutColumn = _node$type$schema$nod2.layoutColumn;
409
+ expand = _node$type$schema$nod2.expand,
410
+ nestedExpand = _node$type$schema$nod2.nestedExpand,
411
+ layoutColumn = _node$type$schema$nod2.layoutColumn;
478
412
  var blockNodeNames = [expand, nestedExpand, layoutColumn].filter(function (node) {
479
413
  return Boolean(node);
480
414
  }) // Check if the node exist first
@@ -492,7 +426,6 @@ var ReactSerializer = /*#__PURE__*/function () {
492
426
  key: "getMediaGroupProps",
493
427
  value: function getMediaGroupProps(node) {
494
428
  var _this$media2, _this$media3;
495
-
496
429
  return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
497
430
  shouldOpenMediaViewer: this.shouldOpenMediaViewer,
498
431
  allowAltTextOnImages: this.allowAltTextOnImages,
@@ -520,11 +453,9 @@ var ReactSerializer = /*#__PURE__*/function () {
520
453
  var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
521
454
  var forceNewLine = false;
522
455
  var parentNode = path.length > 0 ? path[path.length - 1] : null;
523
-
524
456
  if (parentNode && parentNode.lastChild === node) {
525
457
  forceNewLine = true;
526
458
  }
527
-
528
459
  return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
529
460
  forceNewLine: forceNewLine
530
461
  });
@@ -583,11 +514,9 @@ var ReactSerializer = /*#__PURE__*/function () {
583
514
  key: "headingAnchorSupported",
584
515
  value: function headingAnchorSupported() {
585
516
  var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
586
-
587
517
  var isImmediateParent = function isImmediateParent(path, nodeName) {
588
518
  return path.length > 0 && path[path.length - 1].type.name === nodeName;
589
519
  };
590
-
591
520
  return isNestedHeaderLinksEnabled(this.allowHeadingAnchorLinks) || path.length === 0 || isImmediateParent(path, 'layoutColumn');
592
521
  }
593
522
  }, {
@@ -604,13 +533,10 @@ var ReactSerializer = /*#__PURE__*/function () {
604
533
  key: "getExpandProps",
605
534
  value: function getExpandProps(node) {
606
535
  var _this7 = this;
607
-
608
536
  var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
609
-
610
537
  if (!isNestedHeaderLinksEnabled(this.allowHeadingAnchorLinks)) {
611
538
  return this.getProps(node);
612
539
  }
613
-
614
540
  var nestedHeaderIds = findChildrenByType(node, node.type.schema.nodes.heading).map(function (_ref4) {
615
541
  var node = _ref4.node;
616
542
  return _this7.getHeadingId(node, _this7.expandHeadingIds);
@@ -618,47 +544,43 @@ var ReactSerializer = /*#__PURE__*/function () {
618
544
  return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
619
545
  nestedHeaderIds: nestedHeaderIds
620
546
  });
621
- } // The return value of this function is NOT url encoded,
547
+ }
548
+
549
+ // The return value of this function is NOT url encoded,
622
550
  // In HTML5 standard, id can contain any characters, encoding is no necessary.
623
551
  // Plus we trying to avoid double encoding, therefore we leave the value as is.
624
552
  // Remember to use encodeURIComponent when generating url from the id value.
625
-
626
553
  }, {
627
554
  key: "getHeadingId",
628
555
  value: function getHeadingId(node, headingIds) {
629
556
  if (this.disableHeadingIDs || !node.content.size) {
630
557
  return;
631
- } // We are not use node.textContent here, because we would like to handle cases where
632
- // headings only contain inline blocks like emoji, status and date.
633
-
558
+ }
634
559
 
560
+ // We are not use node.textContent here, because we would like to handle cases where
561
+ // headings only contain inline blocks like emoji, status and date.
635
562
  var nodeContent = node.content.toJSON().reduce(function (acc, node) {
636
563
  return acc.concat(getText(node) || '');
637
564
  }, '').trim().replace(/\s/g, '-');
638
-
639
565
  if (!nodeContent) {
640
566
  return;
641
567
  }
642
-
643
568
  return this.getUniqueHeadingId(nodeContent, headingIds);
644
569
  }
645
570
  }, {
646
571
  key: "getUniqueHeadingId",
647
572
  value: function getUniqueHeadingId(baseId, headingIds) {
648
573
  var counter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
649
-
650
574
  if (counter === 0 && headingIds.indexOf(baseId) === -1) {
651
575
  headingIds.push(baseId);
652
576
  return baseId;
653
577
  } else if (counter !== 0) {
654
578
  var headingId = "".concat(baseId, ".").concat(counter);
655
-
656
579
  if (headingIds.indexOf(headingId) === -1) {
657
580
  headingIds.push(headingId);
658
581
  return headingId;
659
582
  }
660
583
  }
661
-
662
584
  return this.getUniqueHeadingId(baseId, headingIds, ++counter);
663
585
  }
664
586
  }], [{
@@ -676,21 +598,17 @@ var ReactSerializer = /*#__PURE__*/function () {
676
598
  if (!node.marks || node.marks.length === 0) {
677
599
  return [];
678
600
  }
679
-
680
601
  return getMarksByOrder(node.marks);
681
602
  }
682
603
  }, {
683
604
  key: "buildMarkStructure",
684
605
  value: function buildMarkStructure(content) {
685
606
  var _this8 = this;
686
-
687
607
  return mergeMarks(content.map(function (node) {
688
608
  var nodeMarks = _this8.getMarks(node);
689
-
690
609
  if (nodeMarks.length === 0) {
691
610
  return node;
692
611
  }
693
-
694
612
  return nodeMarks.reverse().reduce(function (acc, mark) {
695
613
  var eq = mark.eq;
696
614
  return _objectSpread(_objectSpread({}, mark), {}, {
@@ -699,9 +617,10 @@ var ReactSerializer = /*#__PURE__*/function () {
699
617
  });
700
618
  }, node);
701
619
  }));
702
- } // TODO: ED-9004 Remove unused ReactSerializer.fromSchema in renderer
703
- // https://sourcegraph-frontend.internal.shared-prod.us-west-2.kitt-inf.net/search?q=ReactSerializer.fromSchema&patternType=literal
620
+ }
704
621
 
622
+ // TODO: ED-9004 Remove unused ReactSerializer.fromSchema in renderer
623
+ // https://sourcegraph-frontend.internal.shared-prod.us-west-2.kitt-inf.net/search?q=ReactSerializer.fromSchema&patternType=literal
705
624
  }, {
706
625
  key: "fromSchema",
707
626
  value: function fromSchema(_, init) {
@@ -709,12 +628,9 @@ var ReactSerializer = /*#__PURE__*/function () {
709
628
  // eslint-disable-next-line no-console
710
629
  console.warn('ReactSerializer.fromSchema is deprecated. Please use the constructor instead via new ReactSerializer()');
711
630
  }
712
-
713
631
  return new ReactSerializer(init);
714
632
  }
715
633
  }]);
716
-
717
634
  return ReactSerializer;
718
635
  }();
719
-
720
636
  export { ReactSerializer as default };
@@ -1,20 +1,16 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
-
4
3
  var _templateObject;
5
-
6
4
  /** @jsx jsx */
7
5
  import React from 'react';
8
6
  import { css, jsx } from '@emotion/react';
9
7
  import { alignmentPositionMap } from '@atlaskit/adf-schema';
10
-
11
8
  var MarkWrapper = function MarkWrapper(props) {
12
9
  var styles = props['data-align'] ? css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-align: ", ";\n "])), alignmentPositionMap[props['data-align']]) : '';
13
10
  return jsx("div", _extends({
14
11
  css: styles
15
12
  }, props), props.children);
16
13
  };
17
-
18
14
  export default function Alignment(props) {
19
15
  return jsx(MarkWrapper, {
20
16
  className: "fabric-editor-block-mark fabric-editor-alignment",
@@ -1,31 +1,25 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
-
4
3
  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; }
5
-
6
4
  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; }
7
-
8
5
  import React from 'react';
9
6
  import { buildAnnotationMarkDataAttributes } from '@atlaskit/adf-schema';
10
7
  import { AnnotationMark } from '../../ui/annotations';
11
8
  export var isAnnotationMark = function isAnnotationMark(mark) {
12
9
  return mark && mark.type && mark.type.name === 'annotation';
13
10
  };
14
-
15
11
  var AnnotationComponent = function AnnotationComponent(_ref) {
16
12
  var id = _ref.id,
17
- annotationType = _ref.annotationType,
18
- children = _ref.children,
19
- dataAttributes = _ref.dataAttributes,
20
- _ref$annotationParent = _ref.annotationParentIds,
21
- annotationParentIds = _ref$annotationParent === void 0 ? [] : _ref$annotationParent,
22
- allowAnnotations = _ref.allowAnnotations;
23
-
13
+ annotationType = _ref.annotationType,
14
+ children = _ref.children,
15
+ dataAttributes = _ref.dataAttributes,
16
+ _ref$annotationParent = _ref.annotationParentIds,
17
+ annotationParentIds = _ref$annotationParent === void 0 ? [] : _ref$annotationParent,
18
+ allowAnnotations = _ref.allowAnnotations;
24
19
  var data = _objectSpread(_objectSpread({}, dataAttributes), buildAnnotationMarkDataAttributes({
25
20
  id: id,
26
21
  annotationType: annotationType
27
22
  }));
28
-
29
23
  if (allowAnnotations) {
30
24
  return /*#__PURE__*/React.createElement(AnnotationMark, {
31
25
  id: id,
@@ -34,10 +28,8 @@ var AnnotationComponent = function AnnotationComponent(_ref) {
34
28
  annotationType: annotationType
35
29
  }, children);
36
30
  }
37
-
38
31
  return /*#__PURE__*/React.createElement("span", _extends({
39
32
  id: id
40
33
  }, data), children);
41
34
  };
42
-
43
35
  export default AnnotationComponent;
@@ -1,7 +1,5 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
2
  var _templateObject;
4
-
5
3
  /** @jsx jsx */
6
4
  import { css, jsx } from '@emotion/react';
7
5
  import { WidthConsumer } from '@atlaskit/editor-common/ui';
@@ -3,39 +3,29 @@ import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
-
7
6
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
-
9
7
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
-
11
8
  import React from 'react';
12
9
  import { Component } from 'react';
13
-
14
10
  var ConfluenceInlineComment = /*#__PURE__*/function (_Component) {
15
11
  _inherits(ConfluenceInlineComment, _Component);
16
-
17
12
  var _super = _createSuper(ConfluenceInlineComment);
18
-
19
13
  function ConfluenceInlineComment() {
20
14
  _classCallCheck(this, ConfluenceInlineComment);
21
-
22
15
  return _super.apply(this, arguments);
23
16
  }
24
-
25
17
  _createClass(ConfluenceInlineComment, [{
26
18
  key: "render",
27
19
  value: function render() {
28
20
  var _this$props = this.props,
29
- reference = _this$props.reference,
30
- children = _this$props.children;
21
+ reference = _this$props.reference,
22
+ children = _this$props.children;
31
23
  return /*#__PURE__*/React.createElement("span", {
32
24
  "data-mark-type": "confluenceInlineComment",
33
25
  "data-reference": reference
34
26
  }, children);
35
27
  }
36
28
  }]);
37
-
38
29
  return ConfluenceInlineComment;
39
30
  }(Component);
40
-
41
31
  export { ConfluenceInlineComment as default };
@@ -13,8 +13,9 @@ import UnsupportedMark from './unsupportedMark';
13
13
  import UnsupportedNodeAttribute from './unsupportedNodeAttribute';
14
14
  import DataConsumer from './data-consumer';
15
15
  import FragmentMark from './fragment';
16
- import Annotation, { isAnnotationMark } from './annotation'; // Stage0
16
+ import Annotation, { isAnnotationMark } from './annotation';
17
17
 
18
+ // Stage0
18
19
  import ConfluenceInlineComment from './confluence-inline-comment';
19
20
  export var markToReact = {
20
21
  code: Code,