@atlaskit/editor-plugin-table 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/index.js +0 -2
  3. package/dist/cjs/plugins/table/commands/clear.js +4 -16
  4. package/dist/cjs/plugins/table/commands/collapse.js +0 -6
  5. package/dist/cjs/plugins/table/commands/go-to-next-cell.js +7 -18
  6. package/dist/cjs/plugins/table/commands/hover.js +7 -37
  7. package/dist/cjs/plugins/table/commands/index.js +0 -8
  8. package/dist/cjs/plugins/table/commands/insert.js +17 -56
  9. package/dist/cjs/plugins/table/commands/misc.js +36 -132
  10. package/dist/cjs/plugins/table/commands/referentiality.js +0 -4
  11. package/dist/cjs/plugins/table/commands/selection.js +21 -87
  12. package/dist/cjs/plugins/table/commands/sort.js +2 -23
  13. package/dist/cjs/plugins/table/commands/split-cell.js +3 -11
  14. package/dist/cjs/plugins/table/commands/toggle.js +8 -34
  15. package/dist/cjs/plugins/table/commands-with-analytics.js +50 -139
  16. package/dist/cjs/plugins/table/create-plugin-config.js +0 -6
  17. package/dist/cjs/plugins/table/event-handlers.js +58 -160
  18. package/dist/cjs/plugins/table/handlers.js +10 -39
  19. package/dist/cjs/plugins/table/index.js +47 -91
  20. package/dist/cjs/plugins/table/nodeviews/OverflowShadowsObserver.js +8 -41
  21. package/dist/cjs/plugins/table/nodeviews/TableComponent.js +82 -188
  22. package/dist/cjs/plugins/table/nodeviews/table.js +12 -70
  23. package/dist/cjs/plugins/table/nodeviews/tableCell.js +15 -39
  24. package/dist/cjs/plugins/table/nodeviews/update-overflow-shadows.js +3 -15
  25. package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +0 -18
  26. package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-controls.js +8 -27
  27. package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-resizing.js +8 -20
  28. package/dist/cjs/plugins/table/pm-plugins/decorations/utils/compose-decorations.js +1 -3
  29. package/dist/cjs/plugins/table/pm-plugins/decorations/utils/index.js +0 -3
  30. package/dist/cjs/plugins/table/pm-plugins/keymap.js +2 -15
  31. package/dist/cjs/plugins/table/pm-plugins/main.js +20 -72
  32. package/dist/cjs/plugins/table/pm-plugins/plugin-factory.js +25 -42
  33. package/dist/cjs/plugins/table/pm-plugins/plugin-key.js +0 -2
  34. package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +8 -8
  35. package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +4 -23
  36. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/commands.js +0 -5
  37. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/index.js +0 -5
  38. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +4 -13
  39. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +56 -138
  40. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin-key.js +0 -2
  41. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin-state.js +15 -30
  42. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin.js +0 -6
  43. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/util.js +0 -5
  44. package/dist/cjs/plugins/table/pm-plugins/table-local-id.js +13 -44
  45. package/dist/cjs/plugins/table/pm-plugins/table-resizing/commands.js +12 -42
  46. package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +16 -52
  47. package/dist/cjs/plugins/table/pm-plugins/table-resizing/index.js +0 -4
  48. package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin-factory.js +0 -10
  49. package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin-key.js +0 -2
  50. package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin.js +5 -19
  51. package/dist/cjs/plugins/table/pm-plugins/table-resizing/reducer.js +0 -10
  52. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +0 -15
  53. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/column-state.js +8 -28
  54. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/content-width.js +3 -23
  55. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/dom.js +4 -46
  56. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/index.js +0 -9
  57. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +15 -36
  58. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-column.js +1 -4
  59. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +15 -71
  60. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +34 -82
  61. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +12 -36
  62. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.js +0 -2
  63. package/dist/cjs/plugins/table/pm-plugins/table-selection-keymap.js +0 -5
  64. package/dist/cjs/plugins/table/reducer.js +0 -24
  65. package/dist/cjs/plugins/table/toolbar.js +14 -94
  66. package/dist/cjs/plugins/table/transforms/column-width.js +12 -45
  67. package/dist/cjs/plugins/table/transforms/delete-columns.js +11 -76
  68. package/dist/cjs/plugins/table/transforms/delete-rows.js +4 -42
  69. package/dist/cjs/plugins/table/transforms/fix-tables.js +24 -61
  70. package/dist/cjs/plugins/table/transforms/index.js +0 -7
  71. package/dist/cjs/plugins/table/transforms/merge.js +14 -90
  72. package/dist/cjs/plugins/table/transforms/metadata.js +0 -5
  73. package/dist/cjs/plugins/table/transforms/replace-table.js +2 -13
  74. package/dist/cjs/plugins/table/transforms/split.js +18 -32
  75. package/dist/cjs/plugins/table/types.js +0 -11
  76. package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +10 -51
  77. package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +0 -12
  78. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +46 -145
  79. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +12 -35
  80. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +0 -11
  81. package/dist/cjs/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +5 -12
  82. package/dist/cjs/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.js +3 -16
  83. package/dist/cjs/plugins/table/ui/FloatingDeleteButton/index.js +19 -89
  84. package/dist/cjs/plugins/table/ui/FloatingInsertButton/InsertButton.js +6 -31
  85. package/dist/cjs/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +5 -22
  86. package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +25 -80
  87. package/dist/cjs/plugins/table/ui/LayoutButton/index.js +16 -64
  88. package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +14 -47
  89. package/dist/cjs/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +20 -48
  90. package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/index.js +10 -43
  91. package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +33 -74
  92. package/dist/cjs/plugins/table/ui/common-styles.js +6 -19
  93. package/dist/cjs/plugins/table/ui/consts.js +3 -8
  94. package/dist/cjs/plugins/table/ui/messages.js +0 -3
  95. package/dist/cjs/plugins/table/ui/ui-styles.js +0 -32
  96. package/dist/cjs/plugins/table/utils/analytics.js +4 -19
  97. package/dist/cjs/plugins/table/utils/collapse.js +4 -21
  98. package/dist/cjs/plugins/table/utils/column-controls.js +25 -61
  99. package/dist/cjs/plugins/table/utils/decoration.js +46 -114
  100. package/dist/cjs/plugins/table/utils/dom.js +4 -51
  101. package/dist/cjs/plugins/table/utils/get-allow-add-column-custom-step.js +0 -2
  102. package/dist/cjs/plugins/table/utils/index.js +0 -10
  103. package/dist/cjs/plugins/table/utils/nodes.js +5 -48
  104. package/dist/cjs/plugins/table/utils/paste.js +22 -47
  105. package/dist/cjs/plugins/table/utils/row-controls.js +6 -67
  106. package/dist/cjs/plugins/table/utils/selection.js +3 -36
  107. package/dist/cjs/plugins/table/utils/table.js +0 -11
  108. package/dist/cjs/plugins/table/utils/update-plugin-state-decorations.js +0 -4
  109. package/dist/cjs/plugins/table-plugin.js +0 -3
  110. package/dist/cjs/version.json +1 -1
  111. package/dist/es2019/plugins/table/commands/clear.js +3 -8
  112. package/dist/es2019/plugins/table/commands/collapse.js +0 -3
  113. package/dist/es2019/plugins/table/commands/go-to-next-cell.js +4 -7
  114. package/dist/es2019/plugins/table/commands/hover.js +7 -17
  115. package/dist/es2019/plugins/table/commands/insert.js +16 -36
  116. package/dist/es2019/plugins/table/commands/misc.js +37 -67
  117. package/dist/es2019/plugins/table/commands/selection.js +7 -62
  118. package/dist/es2019/plugins/table/commands/sort.js +0 -12
  119. package/dist/es2019/plugins/table/commands/split-cell.js +0 -4
  120. package/dist/es2019/plugins/table/commands/toggle.js +13 -15
  121. package/dist/es2019/plugins/table/commands-with-analytics.js +4 -14
  122. package/dist/es2019/plugins/table/event-handlers.js +14 -62
  123. package/dist/es2019/plugins/table/handlers.js +16 -26
  124. package/dist/es2019/plugins/table/index.js +12 -25
  125. package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +8 -40
  126. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +27 -100
  127. package/dist/es2019/plugins/table/nodeviews/table.js +3 -33
  128. package/dist/es2019/plugins/table/nodeviews/tableCell.js +7 -16
  129. package/dist/es2019/plugins/table/nodeviews/update-overflow-shadows.js +3 -10
  130. package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +0 -5
  131. package/dist/es2019/plugins/table/pm-plugins/decorations/utils/column-controls.js +4 -13
  132. package/dist/es2019/plugins/table/pm-plugins/decorations/utils/column-resizing.js +0 -3
  133. package/dist/es2019/plugins/table/pm-plugins/keymap.js +2 -3
  134. package/dist/es2019/plugins/table/pm-plugins/main.js +19 -43
  135. package/dist/es2019/plugins/table/pm-plugins/plugin-factory.js +2 -6
  136. package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +8 -3
  137. package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +0 -12
  138. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +4 -9
  139. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +55 -130
  140. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/plugin-state.js +2 -9
  141. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/util.js +0 -3
  142. package/dist/es2019/plugins/table/pm-plugins/table-local-id.js +20 -39
  143. package/dist/es2019/plugins/table/pm-plugins/table-resizing/commands.js +7 -15
  144. package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +9 -27
  145. package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin-factory.js +2 -4
  146. package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
  147. package/dist/es2019/plugins/table/pm-plugins/table-resizing/reducer.js +8 -8
  148. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +0 -4
  149. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/column-state.js +8 -11
  150. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/content-width.js +4 -21
  151. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/dom.js +3 -22
  152. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +10 -18
  153. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +29 -59
  154. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +54 -51
  155. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +9 -14
  156. package/dist/es2019/plugins/table/reducer.js +26 -30
  157. package/dist/es2019/plugins/table/toolbar.js +5 -48
  158. package/dist/es2019/plugins/table/transforms/column-width.js +16 -28
  159. package/dist/es2019/plugins/table/transforms/delete-columns.js +17 -58
  160. package/dist/es2019/plugins/table/transforms/delete-rows.js +8 -25
  161. package/dist/es2019/plugins/table/transforms/fix-tables.js +25 -42
  162. package/dist/es2019/plugins/table/transforms/merge.js +22 -70
  163. package/dist/es2019/plugins/table/transforms/metadata.js +3 -2
  164. package/dist/es2019/plugins/table/transforms/replace-table.js +0 -2
  165. package/dist/es2019/plugins/table/transforms/split.js +16 -19
  166. package/dist/es2019/plugins/table/types.js +2 -4
  167. package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +2 -16
  168. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +8 -54
  169. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +4 -13
  170. package/dist/es2019/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +0 -2
  171. package/dist/es2019/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.js +2 -11
  172. package/dist/es2019/plugins/table/ui/FloatingDeleteButton/index.js +13 -49
  173. package/dist/es2019/plugins/table/ui/FloatingInsertButton/InsertButton.js +0 -8
  174. package/dist/es2019/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +16 -24
  175. package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +3 -31
  176. package/dist/es2019/plugins/table/ui/LayoutButton/index.js +2 -29
  177. package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/index.js +0 -12
  178. package/dist/es2019/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +6 -12
  179. package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/index.js +0 -9
  180. package/dist/es2019/plugins/table/ui/TableFloatingControls/index.js +4 -19
  181. package/dist/es2019/plugins/table/ui/common-styles.js +6 -5
  182. package/dist/es2019/plugins/table/ui/consts.js +4 -3
  183. package/dist/es2019/plugins/table/ui/ui-styles.js +0 -10
  184. package/dist/es2019/plugins/table/utils/analytics.js +0 -8
  185. package/dist/es2019/plugins/table/utils/collapse.js +3 -14
  186. package/dist/es2019/plugins/table/utils/column-controls.js +22 -37
  187. package/dist/es2019/plugins/table/utils/decoration.js +13 -51
  188. package/dist/es2019/plugins/table/utils/dom.js +3 -19
  189. package/dist/es2019/plugins/table/utils/nodes.js +2 -15
  190. package/dist/es2019/plugins/table/utils/paste.js +17 -22
  191. package/dist/es2019/plugins/table/utils/row-controls.js +12 -45
  192. package/dist/es2019/plugins/table/utils/selection.js +0 -21
  193. package/dist/es2019/plugins/table/utils/table.js +0 -2
  194. package/dist/es2019/version.json +1 -1
  195. package/dist/esm/plugins/table/commands/clear.js +3 -8
  196. package/dist/esm/plugins/table/commands/collapse.js +0 -3
  197. package/dist/esm/plugins/table/commands/go-to-next-cell.js +6 -9
  198. package/dist/esm/plugins/table/commands/hover.js +8 -18
  199. package/dist/esm/plugins/table/commands/insert.js +16 -36
  200. package/dist/esm/plugins/table/commands/misc.js +39 -78
  201. package/dist/esm/plugins/table/commands/selection.js +21 -78
  202. package/dist/esm/plugins/table/commands/sort.js +2 -14
  203. package/dist/esm/plugins/table/commands/split-cell.js +3 -8
  204. package/dist/esm/plugins/table/commands/toggle.js +11 -20
  205. package/dist/esm/plugins/table/commands-with-analytics.js +50 -85
  206. package/dist/esm/plugins/table/create-plugin-config.js +0 -3
  207. package/dist/esm/plugins/table/event-handlers.js +58 -123
  208. package/dist/esm/plugins/table/handlers.js +11 -29
  209. package/dist/esm/plugins/table/index.js +47 -60
  210. package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +8 -44
  211. package/dist/esm/plugins/table/nodeviews/TableComponent.js +82 -181
  212. package/dist/esm/plugins/table/nodeviews/table.js +12 -52
  213. package/dist/esm/plugins/table/nodeviews/tableCell.js +15 -33
  214. package/dist/esm/plugins/table/nodeviews/update-overflow-shadows.js +3 -10
  215. package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +0 -5
  216. package/dist/esm/plugins/table/pm-plugins/decorations/utils/column-controls.js +8 -19
  217. package/dist/esm/plugins/table/pm-plugins/decorations/utils/column-resizing.js +8 -13
  218. package/dist/esm/plugins/table/pm-plugins/decorations/utils/compose-decorations.js +1 -1
  219. package/dist/esm/plugins/table/pm-plugins/keymap.js +2 -3
  220. package/dist/esm/plugins/table/pm-plugins/main.js +20 -47
  221. package/dist/esm/plugins/table/pm-plugins/plugin-factory.js +25 -37
  222. package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +8 -3
  223. package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +3 -15
  224. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +4 -9
  225. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +58 -147
  226. package/dist/esm/plugins/table/pm-plugins/sticky-headers/plugin-state.js +15 -27
  227. package/dist/esm/plugins/table/pm-plugins/sticky-headers/util.js +0 -3
  228. package/dist/esm/plugins/table/pm-plugins/table-local-id.js +14 -37
  229. package/dist/esm/plugins/table/pm-plugins/table-resizing/commands.js +12 -24
  230. package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +16 -36
  231. package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin-factory.js +0 -6
  232. package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin.js +5 -8
  233. package/dist/esm/plugins/table/pm-plugins/table-resizing/reducer.js +0 -7
  234. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +0 -4
  235. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/column-state.js +8 -12
  236. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/content-width.js +5 -22
  237. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/dom.js +4 -23
  238. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +15 -23
  239. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +15 -60
  240. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +34 -55
  241. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +12 -24
  242. package/dist/esm/plugins/table/reducer.js +0 -20
  243. package/dist/esm/plugins/table/toolbar.js +13 -63
  244. package/dist/esm/plugins/table/transforms/column-width.js +12 -32
  245. package/dist/esm/plugins/table/transforms/delete-columns.js +11 -62
  246. package/dist/esm/plugins/table/transforms/delete-rows.js +4 -30
  247. package/dist/esm/plugins/table/transforms/fix-tables.js +24 -49
  248. package/dist/esm/plugins/table/transforms/merge.js +16 -75
  249. package/dist/esm/plugins/table/transforms/metadata.js +3 -2
  250. package/dist/esm/plugins/table/transforms/replace-table.js +2 -6
  251. package/dist/esm/plugins/table/transforms/split.js +18 -29
  252. package/dist/esm/plugins/table/types.js +0 -6
  253. package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +10 -31
  254. package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +0 -2
  255. package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +46 -126
  256. package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +13 -24
  257. package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +0 -2
  258. package/dist/esm/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +5 -7
  259. package/dist/esm/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.js +3 -13
  260. package/dist/esm/plugins/table/ui/FloatingDeleteButton/index.js +19 -68
  261. package/dist/esm/plugins/table/ui/FloatingInsertButton/InsertButton.js +6 -14
  262. package/dist/esm/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +5 -18
  263. package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +25 -57
  264. package/dist/esm/plugins/table/ui/LayoutButton/index.js +16 -47
  265. package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/index.js +14 -35
  266. package/dist/esm/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +20 -38
  267. package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/index.js +10 -29
  268. package/dist/esm/plugins/table/ui/TableFloatingControls/index.js +33 -62
  269. package/dist/esm/plugins/table/ui/common-styles.js +6 -7
  270. package/dist/esm/plugins/table/ui/consts.js +4 -3
  271. package/dist/esm/plugins/table/ui/ui-styles.js +0 -12
  272. package/dist/esm/plugins/table/utils/analytics.js +4 -13
  273. package/dist/esm/plugins/table/utils/collapse.js +4 -15
  274. package/dist/esm/plugins/table/utils/column-controls.js +25 -41
  275. package/dist/esm/plugins/table/utils/decoration.js +46 -88
  276. package/dist/esm/plugins/table/utils/dom.js +4 -20
  277. package/dist/esm/plugins/table/utils/nodes.js +5 -18
  278. package/dist/esm/plugins/table/utils/paste.js +24 -29
  279. package/dist/esm/plugins/table/utils/row-controls.js +6 -46
  280. package/dist/esm/plugins/table/utils/selection.js +3 -26
  281. package/dist/esm/plugins/table/utils/table.js +0 -2
  282. package/dist/esm/version.json +1 -1
  283. package/package.json +2 -2
  284. package/src/__tests__/visual-regression/cell-options-menu.ts +1 -12
@@ -1,46 +1,30 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.triggerUnlessTableHeader = exports.transformSliceToRemoveColumnsWidths = exports.transformSliceToAddTableHeaders = exports.transformSliceRemoveCellBackgroundColor = exports.showInsertRowButton = exports.showInsertColumnButton = exports.setTableRef = exports.setMultipleCellAttrs = exports.setEditorFocus = exports.setCellAttr = exports.selectRow = exports.selectColumn = exports.moveCursorBackward = exports.hideInsertColumnOrRowButton = exports.deleteTableIfSelected = exports.deleteTable = exports.convertFirstRowToHeader = exports.autoSizeTable = exports.addResizeHandleDecorations = exports.addBoldInEmptyHeaderCells = void 0;
9
-
10
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
9
  var _prosemirrorState = require("prosemirror-state");
13
-
14
10
  var _tableMap = require("@atlaskit/editor-tables/table-map");
15
-
16
11
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
17
-
18
12
  var _utils = require("@atlaskit/editor-tables/utils");
19
-
20
13
  var _utils2 = require("@atlaskit/editor-common/utils");
21
-
22
14
  var _plugin = require("../pm-plugins/decorations/plugin");
23
-
24
15
  var _utils3 = require("../pm-plugins/decorations/utils");
25
-
26
16
  var _pluginFactory = require("../pm-plugins/plugin-factory");
27
-
28
17
  var _transforms = require("../transforms");
29
-
30
18
  var _types = require("../types");
31
-
32
19
  var _decoration = require("../utils/decoration");
33
-
34
20
  var _nodes = require("../utils/nodes");
35
-
36
21
  var _updatePluginStateDecorations = require("../utils/update-plugin-state-decorations");
37
-
38
22
  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; }
39
-
40
23
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
41
-
42
24
  // #endregion
25
+
43
26
  // #endregion
27
+
44
28
  // #region Commands
45
29
  var setEditorFocus = function setEditorFocus(editorHasFocus) {
46
30
  return (0, _pluginFactory.createCommand)({
@@ -50,9 +34,7 @@ var setEditorFocus = function setEditorFocus(editorHasFocus) {
50
34
  }
51
35
  });
52
36
  };
53
-
54
37
  exports.setEditorFocus = setEditorFocus;
55
-
56
38
  var setTableRef = function setTableRef(ref) {
57
39
  return (0, _pluginFactory.createCommand)(function (state) {
58
40
  var tableRef = ref;
@@ -82,14 +64,11 @@ var setTableRef = function setTableRef(ref) {
82
64
  return tr.setMeta('addToHistory', false);
83
65
  });
84
66
  };
85
-
86
67
  exports.setTableRef = setTableRef;
87
-
88
68
  var setCellAttr = function setCellAttr(name, value) {
89
69
  return function (state, dispatch) {
90
70
  var tr = state.tr,
91
- selection = state.selection;
92
-
71
+ selection = state.selection;
93
72
  if (selection instanceof _cellSelection.CellSelection) {
94
73
  var updated = false;
95
74
  selection.forEachCell(function (cell, pos) {
@@ -98,88 +77,68 @@ var setCellAttr = function setCellAttr(name, value) {
98
77
  updated = true;
99
78
  }
100
79
  });
101
-
102
80
  if (updated) {
103
81
  if (dispatch) {
104
82
  dispatch(tr);
105
83
  }
106
-
107
84
  return true;
108
85
  }
109
86
  } else {
110
87
  var cell = (0, _utils.selectionCell)(state.selection);
111
-
112
88
  if (cell) {
113
89
  if (dispatch) {
114
90
  var _cell$nodeAfter, _cell$nodeAfter2;
115
-
116
91
  dispatch(tr.setNodeMarkup(cell.pos, (_cell$nodeAfter = cell.nodeAfter) === null || _cell$nodeAfter === void 0 ? void 0 : _cell$nodeAfter.type, _objectSpread(_objectSpread({}, (_cell$nodeAfter2 = cell.nodeAfter) === null || _cell$nodeAfter2 === void 0 ? void 0 : _cell$nodeAfter2.attrs), {}, (0, _defineProperty2.default)({}, name, value))));
117
92
  }
118
-
119
93
  return true;
120
94
  }
121
95
  }
122
-
123
96
  return false;
124
97
  };
125
98
  };
126
-
127
99
  exports.setCellAttr = setCellAttr;
128
-
129
100
  var triggerUnlessTableHeader = function triggerUnlessTableHeader(command) {
130
101
  return function (state, dispatch, view) {
131
102
  var selection = state.selection,
132
- tableHeader = state.schema.nodes.tableHeader;
133
-
103
+ tableHeader = state.schema.nodes.tableHeader;
134
104
  if (selection instanceof _prosemirrorState.TextSelection) {
135
105
  var cell = (0, _utils.findCellClosestToPos)(selection.$from);
136
-
137
106
  if (cell && cell.node.type !== tableHeader) {
138
107
  return command(state, dispatch, view);
139
108
  }
140
109
  }
141
-
142
110
  if (selection instanceof _cellSelection.CellSelection) {
143
111
  var rect = (0, _utils.getSelectionRect)(selection);
144
-
145
112
  if (!(0, _nodes.checkIfHeaderRowEnabled)(selection) || rect && rect.top > 0) {
146
113
  return command(state, dispatch, view);
147
114
  }
148
115
  }
149
-
150
116
  return false;
151
117
  };
152
118
  };
153
-
154
119
  exports.triggerUnlessTableHeader = triggerUnlessTableHeader;
155
-
156
120
  var transformSliceRemoveCellBackgroundColor = function transformSliceRemoveCellBackgroundColor(slice, schema) {
157
121
  var _schema$nodes = schema.nodes,
158
- tableCell = _schema$nodes.tableCell,
159
- tableHeader = _schema$nodes.tableHeader;
122
+ tableCell = _schema$nodes.tableCell,
123
+ tableHeader = _schema$nodes.tableHeader;
160
124
  return (0, _utils2.mapSlice)(slice, function (maybeCell) {
161
125
  if (maybeCell.type === tableCell || maybeCell.type === tableHeader) {
162
126
  var cellAttrs = _objectSpread({}, maybeCell.attrs);
163
-
164
127
  cellAttrs.background = undefined;
165
128
  return maybeCell.type.createChecked(cellAttrs, maybeCell.content, maybeCell.marks);
166
129
  }
167
-
168
130
  return maybeCell;
169
131
  });
170
132
  };
171
-
172
133
  exports.transformSliceRemoveCellBackgroundColor = transformSliceRemoveCellBackgroundColor;
173
-
174
134
  var transformSliceToAddTableHeaders = function transformSliceToAddTableHeaders(slice, schema) {
175
135
  var _schema$nodes2 = schema.nodes,
176
- table = _schema$nodes2.table,
177
- tableHeader = _schema$nodes2.tableHeader,
178
- tableRow = _schema$nodes2.tableRow;
136
+ table = _schema$nodes2.table,
137
+ tableHeader = _schema$nodes2.tableHeader,
138
+ tableRow = _schema$nodes2.tableRow;
179
139
  return (0, _utils2.mapSlice)(slice, function (maybeTable) {
180
140
  if (maybeTable.type === table) {
181
141
  var firstRow = maybeTable.firstChild;
182
-
183
142
  if (firstRow) {
184
143
  var headerCols = [];
185
144
  firstRow.forEach(function (oldCol) {
@@ -189,147 +148,120 @@ var transformSliceToAddTableHeaders = function transformSliceToAddTableHeaders(s
189
148
  return maybeTable.copy(maybeTable.content.replaceChild(0, headerRow));
190
149
  }
191
150
  }
192
-
193
151
  return maybeTable;
194
152
  });
195
153
  };
196
-
197
154
  exports.transformSliceToAddTableHeaders = transformSliceToAddTableHeaders;
198
-
199
155
  var transformSliceToRemoveColumnsWidths = function transformSliceToRemoveColumnsWidths(slice, schema) {
200
156
  var _schema$nodes3 = schema.nodes,
201
- tableHeader = _schema$nodes3.tableHeader,
202
- tableCell = _schema$nodes3.tableCell;
157
+ tableHeader = _schema$nodes3.tableHeader,
158
+ tableCell = _schema$nodes3.tableCell;
203
159
  return (0, _utils2.mapSlice)(slice, function (maybeCell) {
204
160
  if (maybeCell.type === tableCell || maybeCell.type === tableHeader) {
205
161
  if (!maybeCell.attrs.colwidth) {
206
162
  return maybeCell;
207
163
  }
208
-
209
164
  return maybeCell.type.createChecked(_objectSpread(_objectSpread({}, maybeCell.attrs), {}, {
210
165
  colwidth: undefined
211
166
  }), maybeCell.content, maybeCell.marks);
212
167
  }
213
-
214
168
  return maybeCell;
215
169
  });
216
170
  };
217
-
218
171
  exports.transformSliceToRemoveColumnsWidths = transformSliceToRemoveColumnsWidths;
219
-
220
172
  var deleteTable = function deleteTable(state, dispatch) {
221
173
  if (dispatch) {
222
174
  dispatch((0, _utils.removeTable)(state.tr));
223
175
  }
224
-
225
176
  return true;
226
177
  };
227
-
228
178
  exports.deleteTable = deleteTable;
229
-
230
179
  var deleteTableIfSelected = function deleteTableIfSelected(state, dispatch) {
231
180
  if ((0, _utils.isTableSelected)(state.selection)) {
232
181
  return deleteTable(state, dispatch);
233
182
  }
234
-
235
183
  return false;
236
184
  };
237
-
238
185
  exports.deleteTableIfSelected = deleteTableIfSelected;
239
-
240
186
  var convertFirstRowToHeader = function convertFirstRowToHeader(schema) {
241
187
  return function (tr) {
242
188
  var table = (0, _utils.findTable)(tr.selection);
243
-
244
189
  var map = _tableMap.TableMap.get(table.node);
245
-
246
190
  for (var i = 0; i < map.width; i++) {
247
191
  var cell = table.node.child(0).child(i);
248
192
  tr.setNodeMarkup(table.start + map.map[i], schema.nodes.tableHeader, cell.attrs);
249
193
  }
250
-
251
194
  return tr;
252
195
  };
253
196
  };
254
-
255
197
  exports.convertFirstRowToHeader = convertFirstRowToHeader;
256
-
257
198
  var moveCursorBackward = function moveCursorBackward(state, dispatch) {
258
199
  var _ref = state.selection,
259
- $cursor = _ref.$cursor; // if cursor is in the middle of a text node, do nothing
260
-
200
+ $cursor = _ref.$cursor;
201
+ // if cursor is in the middle of a text node, do nothing
261
202
  if (!$cursor || $cursor.parentOffset > 0) {
262
203
  return false;
263
- } // find the node before the cursor
264
-
204
+ }
265
205
 
206
+ // find the node before the cursor
266
207
  var before;
267
208
  var cut;
268
-
269
209
  if (!(0, _nodes.isIsolating)($cursor.parent)) {
270
210
  for (var i = $cursor.depth - 1; !before && i >= 0; i--) {
271
211
  if ($cursor.index(i) > 0) {
272
212
  cut = $cursor.before(i + 1);
273
213
  before = $cursor.node(i).child($cursor.index(i) - 1);
274
214
  }
275
-
276
215
  if ((0, _nodes.isIsolating)($cursor.node(i))) {
277
216
  break;
278
217
  }
279
218
  }
280
- } // if the node before is not a table node - do nothing
281
-
219
+ }
282
220
 
221
+ // if the node before is not a table node - do nothing
283
222
  if (!before || before.type !== state.schema.nodes.table) {
284
223
  return false;
285
224
  }
225
+
286
226
  /*
287
227
  ensure we're just at a top level paragraph
288
228
  otherwise, perform regular backspace behaviour
289
229
  */
290
-
291
-
292
230
  var grandparent = $cursor.node($cursor.depth - 1);
293
-
294
231
  if ($cursor.parent.type !== state.schema.nodes.paragraph || grandparent && grandparent.type !== state.schema.nodes.doc) {
295
232
  return false;
296
233
  }
297
-
298
234
  var tr = state.tr;
299
- var lastCellPos = (cut || 0) - 4; // need to move cursor inside the table to be able to calculate table's offset
300
-
235
+ var lastCellPos = (cut || 0) - 4;
236
+ // need to move cursor inside the table to be able to calculate table's offset
301
237
  tr.setSelection(new _prosemirrorState.TextSelection(state.doc.resolve(lastCellPos)));
302
238
  var $from = tr.selection.$from;
303
239
  var start = $from.start(-1);
304
- var pos = start + $from.parent.nodeSize - 1; // move cursor to the last cell
240
+ var pos = start + $from.parent.nodeSize - 1;
241
+
242
+ // move cursor to the last cell
305
243
  // it doesn't join node before (last cell) with node after (content after the cursor)
306
244
  // due to ridiculous amount of PM code that would have been required to overwrite
245
+ tr.setSelection(new _prosemirrorState.TextSelection(state.doc.resolve(pos)));
307
246
 
308
- tr.setSelection(new _prosemirrorState.TextSelection(state.doc.resolve(pos))); // if we are inside an empty paragraph not at the end of the doc we delete it
309
-
247
+ // if we are inside an empty paragraph not at the end of the doc we delete it
310
248
  var cursorNode = $cursor.node();
311
249
  var docEnd = state.doc.content.size;
312
250
  var paragraphWrapStart = $cursor.pos - 1;
313
251
  var paragraphWrapEnd = $cursor.pos + 1;
314
-
315
252
  if (cursorNode.content.size === 0 && $cursor.pos + 1 !== docEnd) {
316
253
  tr.delete(paragraphWrapStart, paragraphWrapEnd);
317
254
  }
318
-
319
255
  if (dispatch) {
320
256
  dispatch(tr);
321
257
  }
322
-
323
258
  return true;
324
259
  };
325
-
326
260
  exports.moveCursorBackward = moveCursorBackward;
327
-
328
261
  var setMultipleCellAttrs = function setMultipleCellAttrs(attrs, targetCellPosition) {
329
262
  return function (state, dispatch) {
330
263
  var cursorPos;
331
264
  var tr = state.tr;
332
-
333
265
  if ((0, _utils.isSelectionType)(tr.selection, 'cell')) {
334
266
  var selection = tr.selection;
335
267
  selection.forEachCell(function (_cell, pos) {
@@ -342,31 +274,23 @@ var setMultipleCellAttrs = function setMultipleCellAttrs(attrs, targetCellPositi
342
274
  tr = (0, _utils.setCellAttrs)(cell, attrs)(tr);
343
275
  cursorPos = cell.pos;
344
276
  }
345
-
346
277
  if (tr.docChanged && cursorPos !== undefined) {
347
278
  var $pos = tr.doc.resolve(tr.mapping.map(cursorPos));
348
-
349
279
  if (dispatch) {
350
280
  dispatch(tr.setSelection(_prosemirrorState.Selection.near($pos)));
351
281
  }
352
-
353
282
  return true;
354
283
  }
355
-
356
284
  return false;
357
285
  };
358
286
  };
359
-
360
287
  exports.setMultipleCellAttrs = setMultipleCellAttrs;
361
-
362
288
  var selectColumn = function selectColumn(column, expand) {
363
289
  return (0, _pluginFactory.createCommand)(function (state) {
364
290
  var cells = (0, _utils.getCellsInColumn)(column)(state.tr.selection);
365
-
366
291
  if (!cells || !cells.length || typeof cells[0].pos !== 'number') {
367
292
  return false;
368
293
  }
369
-
370
294
  var decorations = (0, _decoration.createColumnSelectedDecoration)((0, _utils.selectColumn)(column, expand)(state.tr));
371
295
  var decorationSet = (0, _updatePluginStateDecorations.updatePluginStateDecorations)(state, decorations, _types.TableDecorations.COLUMN_SELECTED);
372
296
  var targetCellPosition = cells[0].pos;
@@ -381,18 +305,14 @@ var selectColumn = function selectColumn(column, expand) {
381
305
  return (0, _utils.selectColumn)(column, expand)(tr).setMeta('addToHistory', false);
382
306
  });
383
307
  };
384
-
385
308
  exports.selectColumn = selectColumn;
386
-
387
309
  var selectRow = function selectRow(row, expand) {
388
310
  return (0, _pluginFactory.createCommand)(function (state) {
389
311
  var targetCellPosition;
390
312
  var cells = (0, _utils.getCellsInRow)(row)(state.tr.selection);
391
-
392
313
  if (cells && cells.length) {
393
314
  targetCellPosition = cells[0].pos;
394
315
  }
395
-
396
316
  return {
397
317
  type: 'SET_TARGET_CELL_POSITION',
398
318
  data: {
@@ -403,9 +323,7 @@ var selectRow = function selectRow(row, expand) {
403
323
  return (0, _utils.selectRow)(row, expand)(tr).setMeta('addToHistory', false);
404
324
  });
405
325
  };
406
-
407
326
  exports.selectRow = selectRow;
408
-
409
327
  var showInsertColumnButton = function showInsertColumnButton(columnIndex) {
410
328
  return (0, _pluginFactory.createCommand)(function (_) {
411
329
  return columnIndex > -1 ? {
@@ -418,9 +336,7 @@ var showInsertColumnButton = function showInsertColumnButton(columnIndex) {
418
336
  return tr.setMeta('addToHistory', false);
419
337
  });
420
338
  };
421
-
422
339
  exports.showInsertColumnButton = showInsertColumnButton;
423
-
424
340
  var showInsertRowButton = function showInsertRowButton(rowIndex) {
425
341
  return (0, _pluginFactory.createCommand)(function (_) {
426
342
  return rowIndex > -1 ? {
@@ -433,9 +349,7 @@ var showInsertRowButton = function showInsertRowButton(rowIndex) {
433
349
  return tr.setMeta('addToHistory', false);
434
350
  });
435
351
  };
436
-
437
352
  exports.showInsertRowButton = showInsertRowButton;
438
-
439
353
  var hideInsertColumnOrRowButton = function hideInsertColumnOrRowButton() {
440
354
  return (0, _pluginFactory.createCommand)({
441
355
  type: 'HIDE_INSERT_COLUMN_OR_ROW_BUTTON'
@@ -443,20 +357,15 @@ var hideInsertColumnOrRowButton = function hideInsertColumnOrRowButton() {
443
357
  return tr.setMeta('addToHistory', false);
444
358
  });
445
359
  };
446
-
447
360
  exports.hideInsertColumnOrRowButton = hideInsertColumnOrRowButton;
448
-
449
361
  var addResizeHandleDecorations = function addResizeHandleDecorations(rowIndex, columnIndex) {
450
362
  return (0, _pluginFactory.createCommand)(function (state) {
451
363
  var tableNode = (0, _utils.findTable)(state.selection);
452
-
453
364
  var _getPluginState = (0, _pluginFactory.getPluginState)(state),
454
- allowColumnResizing = _getPluginState.pluginConfig.allowColumnResizing;
455
-
365
+ allowColumnResizing = _getPluginState.pluginConfig.allowColumnResizing;
456
366
  if (!tableNode || !allowColumnResizing) {
457
367
  return false;
458
368
  }
459
-
460
369
  return {
461
370
  type: 'ADD_RESIZE_HANDLE_DECORATIONS',
462
371
  data: {
@@ -472,40 +381,35 @@ var addResizeHandleDecorations = function addResizeHandleDecorations(rowIndex, c
472
381
  return tr.setMeta('addToHistory', false);
473
382
  });
474
383
  };
475
-
476
384
  exports.addResizeHandleDecorations = addResizeHandleDecorations;
477
-
478
385
  var autoSizeTable = function autoSizeTable(view, node, table, basePos, opts) {
479
386
  view.dispatch((0, _transforms.fixAutoSizedTable)(view, node, table, basePos, opts));
480
387
  return true;
481
388
  };
482
-
483
389
  exports.autoSizeTable = autoSizeTable;
484
-
485
390
  var addBoldInEmptyHeaderCells = function addBoldInEmptyHeaderCells(tableCellHeader) {
486
391
  return function (state, dispatch) {
487
392
  var tr = state.tr;
488
-
489
- if ( // Avoid infinite loop when the current selection is not a TextSelection
490
- (0, _utils2.isTextSelection)(tr.selection) && tr.selection.$cursor && // When storedMark is null that means this is the initial state
393
+ if (
394
+ // Avoid infinite loop when the current selection is not a TextSelection
395
+ (0, _utils2.isTextSelection)(tr.selection) && tr.selection.$cursor &&
396
+ // When storedMark is null that means this is the initial state
491
397
  // if the user press to remove the mark storedMark will be an empty array
492
398
  // and we shouldn't apply the strong mark
493
- tr.storedMarks == null && // Check if the current node is a direct child from paragraph
494
- tr.selection.$from.depth === tableCellHeader.depth + 1 && // this logic is applied only for empty paragraph
399
+ tr.storedMarks == null &&
400
+ // Check if the current node is a direct child from paragraph
401
+ tr.selection.$from.depth === tableCellHeader.depth + 1 &&
402
+ // this logic is applied only for empty paragraph
495
403
  tableCellHeader.node.nodeSize === 4 && (0, _utils2.isParagraph)(tableCellHeader.node.firstChild, state.schema)) {
496
404
  var strong = state.schema.marks.strong;
497
405
  tr.setStoredMarks([strong.create()]).setMeta('addToHistory', false);
498
-
499
406
  if (dispatch) {
500
407
  dispatch(tr);
501
408
  }
502
-
503
409
  return true;
504
410
  }
505
-
506
411
  return false;
507
412
  };
508
- }; // #endregion
509
-
510
-
413
+ };
414
+ // #endregion
511
415
  exports.addBoldInEmptyHeaderCells = addBoldInEmptyHeaderCells;
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.removeDescendantNodes = void 0;
7
-
8
7
  var _pluginFactory = require("../pm-plugins/plugin-factory");
9
-
10
8
  var _utils = require("@atlaskit/editor-common/utils");
11
-
12
9
  var removeDescendantNodes = function removeDescendantNodes(sourceNode) {
13
10
  return (0, _pluginFactory.createCommand)({
14
11
  type: 'UPDATE_STATE',
@@ -19,5 +16,4 @@ var removeDescendantNodes = function removeDescendantNodes(sourceNode) {
19
16
  return sourceNode ? (0, _utils.removeConnectedNodes)(state, sourceNode) : tr;
20
17
  });
21
18
  };
22
-
23
19
  exports.removeDescendantNodes = removeDescendantNodes;