@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
@@ -8,11 +8,8 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
8
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
10
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
11
-
12
11
  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); }; }
13
-
14
12
  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; } }
15
-
16
13
  import React from 'react';
17
14
  import { DOMSerializer } from 'prosemirror-model';
18
15
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
@@ -24,7 +21,6 @@ import { pluginKey as tableResizingPluginKey } from '../pm-plugins/table-resizin
24
21
  import { generateColgroup } from '../pm-plugins/table-resizing/utils';
25
22
  import { TableMap } from '@atlaskit/editor-tables/table-map';
26
23
  import TableComponent from './TableComponent';
27
-
28
24
  var tableAttributes = function tableAttributes(node) {
29
25
  return {
30
26
  'data-number-column': node.attrs.isNumberColumnEnabled,
@@ -33,61 +29,45 @@ var tableAttributes = function tableAttributes(node) {
33
29
  'data-table-local-id': node.attrs.localId || ''
34
30
  };
35
31
  };
36
-
37
32
  var toDOM = function toDOM(node, props) {
38
33
  var colgroup = '';
39
-
40
34
  if (props.allowColumnResizing) {
41
35
  colgroup = ['colgroup', {}].concat(_toConsumableArray(generateColgroup(node)));
42
36
  }
43
-
44
37
  return ['table', tableAttributes(node), colgroup, ['tbody', 0]];
45
38
  };
46
-
47
39
  var TableView = /*#__PURE__*/function (_ReactNodeView) {
48
40
  _inherits(TableView, _ReactNodeView);
49
-
50
41
  var _super = _createSuper(TableView);
51
-
52
42
  function TableView(props) {
53
43
  var _this;
54
-
55
44
  _classCallCheck(this, TableView);
56
-
57
45
  _this = _super.call(this, props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props, undefined, undefined, undefined, props.hasIntlContext);
58
-
59
46
  _defineProperty(_assertThisInitialized(_this), "getNode", function () {
60
47
  return _this.node;
61
48
  });
62
-
63
49
  _defineProperty(_assertThisInitialized(_this), "hasHoveredRows", false);
64
-
65
50
  _this.getPos = props.getPos;
66
51
  _this.tableRenderOptimization = props.tableRenderOptimization;
67
52
  _this.eventDispatcher = props.eventDispatcher;
68
53
  return _this;
69
54
  }
70
-
71
55
  _createClass(TableView, [{
72
56
  key: "getContentDOM",
73
57
  value: function getContentDOM() {
74
58
  var rendered = DOMSerializer.renderSpec(document, toDOM(this.node, this.reactComponentProps));
75
-
76
59
  if (rendered.dom) {
77
60
  this.table = rendered.dom;
78
61
  }
79
-
80
62
  return rendered;
81
63
  }
82
64
  }, {
83
65
  key: "setDomAttrs",
84
66
  value: function setDomAttrs(node) {
85
67
  var _this2 = this;
86
-
87
68
  if (!this.table) {
88
69
  return;
89
70
  }
90
-
91
71
  var attrs = tableAttributes(node);
92
72
  Object.keys(attrs).forEach(function (attr) {
93
73
  _this2.table.setAttribute(attr, attrs[attr]);
@@ -97,7 +77,6 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
97
77
  key: "render",
98
78
  value: function render(props, forwardRef) {
99
79
  var _this3 = this;
100
-
101
80
  // TODO: ED-15663
102
81
  // Please, do not copy or use this kind of code below
103
82
  // @ts-ignore
@@ -106,10 +85,11 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
106
85
  getState: function getState(state) {
107
86
  return state['widthPlugin$'];
108
87
  }
109
- }; // TODO: ED-15663
88
+ };
89
+
90
+ // TODO: ED-15663
110
91
  // Please, do not copy or use this kind of code below
111
92
  // @ts-ignore
112
-
113
93
  var fakeMediaPluginKey = {
114
94
  key: 'mediaPlugin$',
115
95
  getState: function getState(state) {
@@ -126,8 +106,8 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
126
106
  editorView: props.view,
127
107
  render: function render(pluginStates) {
128
108
  var tableResizingPluginState = pluginStates.tableResizingPluginState,
129
- pluginState = pluginStates.pluginState,
130
- mediaState = pluginStates.mediaState;
109
+ pluginState = pluginStates.pluginState,
110
+ mediaState = pluginStates.mediaState;
131
111
  var tableActive = props.getPos() === pluginState.tablePos;
132
112
  var containerWidth = props.getEditorContainerWidth();
133
113
  return /*#__PURE__*/React.createElement(TableComponent, {
@@ -156,85 +136,65 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
156
136
  value: function viewShouldUpdate(nextNode) {
157
137
  if (this.tableRenderOptimization) {
158
138
  var _getPluginState = getPluginState(this.view.state),
159
- hoveredRows = _getPluginState.hoveredRows;
160
-
139
+ hoveredRows = _getPluginState.hoveredRows;
161
140
  var hoveredRowsChanged = !!(hoveredRows !== null && hoveredRows !== void 0 && hoveredRows.length) !== this.hasHoveredRows;
162
-
163
141
  if (nextNode.attrs.isNumberColumnEnabled && hoveredRowsChanged) {
164
142
  this.hasHoveredRows = !!(hoveredRows !== null && hoveredRows !== void 0 && hoveredRows.length);
165
143
  return true;
166
144
  }
167
-
168
145
  var _node = this.getNode();
169
-
170
146
  if (_typeof(_node.attrs) !== _typeof(nextNode.attrs)) {
171
147
  return true;
172
148
  }
173
-
174
149
  var attrKeys = Object.keys(_node.attrs);
175
150
  var nextAttrKeys = Object.keys(nextNode.attrs);
176
-
177
151
  if (attrKeys.length !== nextAttrKeys.length) {
178
152
  return true;
179
153
  }
180
-
181
154
  var tableMap = TableMap.get(_node);
182
155
  var nextTableMap = TableMap.get(nextNode);
183
-
184
156
  if (tableMap.width !== nextTableMap.width) {
185
157
  return true;
186
158
  }
187
-
188
159
  return attrKeys.some(function (key) {
189
160
  return _node.attrs[key] !== nextNode.attrs[key];
190
161
  });
191
162
  }
192
-
193
163
  return _get(_getPrototypeOf(TableView.prototype), "viewShouldUpdate", this).call(this, nextNode);
194
164
  }
195
165
  }, {
196
166
  key: "ignoreMutation",
197
167
  value: function ignoreMutation(mutation) {
198
168
  var type = mutation.type,
199
- _mutation$target = mutation.target,
200
- nodeName = _mutation$target.nodeName,
201
- firstChild = _mutation$target.firstChild;
202
-
169
+ _mutation$target = mutation.target,
170
+ nodeName = _mutation$target.nodeName,
171
+ firstChild = _mutation$target.firstChild;
203
172
  if (type === 'selection' && (nodeName === null || nodeName === void 0 ? void 0 : nodeName.toUpperCase()) === 'DIV' && (firstChild === null || firstChild === void 0 ? void 0 : firstChild.nodeName.toUpperCase()) === 'TABLE') {
204
173
  return false;
205
174
  }
206
-
207
175
  return true;
208
176
  }
209
177
  }, {
210
178
  key: "destroy",
211
179
  value: function destroy() {
212
180
  var _this$eventDispatcher;
213
-
214
181
  if (this.resizeObserver) {
215
182
  this.resizeObserver.disconnect();
216
183
  }
217
-
218
184
  (_this$eventDispatcher = this.eventDispatcher) === null || _this$eventDispatcher === void 0 ? void 0 : _this$eventDispatcher.emit('TABLE_DELETED', this.node);
219
-
220
185
  _get(_getPrototypeOf(TableView.prototype), "destroy", this).call(this);
221
186
  }
222
187
  }]);
223
-
224
188
  return TableView;
225
189
  }(ReactNodeView);
226
-
227
190
  export { TableView as default };
228
191
  export var createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, options, getEditorContainerWidth, getEditorFeatureFlags) {
229
192
  var _getPluginState2 = getPluginState(view.state),
230
- pluginConfig = _getPluginState2.pluginConfig;
231
-
193
+ pluginConfig = _getPluginState2.pluginConfig;
232
194
  var _getPluginConfig = getPluginConfig(pluginConfig),
233
- allowColumnResizing = _getPluginConfig.allowColumnResizing;
234
-
195
+ allowColumnResizing = _getPluginConfig.allowColumnResizing;
235
196
  var _getEditorFeatureFlag = getEditorFeatureFlags(),
236
- tableRenderOptimization = _getEditorFeatureFlag.tableRenderOptimization;
237
-
197
+ tableRenderOptimization = _getEditorFeatureFlag.tableRenderOptimization;
238
198
  var hasIntlContext = true;
239
199
  return new TableView({
240
200
  node: node,
@@ -6,25 +6,19 @@ import { DOMSerializer } from 'prosemirror-model';
6
6
  import { getCellDomAttrs, getCellAttrs } from '@atlaskit/adf-schema';
7
7
  var DEFAULT_COL_SPAN = 1;
8
8
  var DEFAULT_ROW_SPAN = 1;
9
-
10
9
  var TableCellNodeView = /*#__PURE__*/function () {
11
10
  function TableCellNodeView(node, view, getPos, getEditorFeatureFlags, observer) {
12
11
  _classCallCheck(this, TableCellNodeView);
13
-
14
12
  this.view = view;
15
13
  this.node = node;
16
-
17
14
  var _DOMSerializer$render = DOMSerializer.renderSpec(document, node.type.spec.toDOM(node)),
18
- dom = _DOMSerializer$render.dom,
19
- contentDOM = _DOMSerializer$render.contentDOM;
20
-
15
+ dom = _DOMSerializer$render.dom,
16
+ contentDOM = _DOMSerializer$render.contentDOM;
21
17
  this.getPos = getPos;
22
18
  this.dom = dom;
23
19
  this.contentDOM = contentDOM;
24
-
25
20
  var _getEditorFeatureFlag = getEditorFeatureFlags(),
26
- mouseMoveOptimization = _getEditorFeatureFlag.mouseMoveOptimization;
27
-
21
+ mouseMoveOptimization = _getEditorFeatureFlag.mouseMoveOptimization;
28
22
  if (mouseMoveOptimization && observer) {
29
23
  this.contentDOM.id = uuid();
30
24
  this.mouseMoveOptimization = mouseMoveOptimization;
@@ -32,71 +26,61 @@ var TableCellNodeView = /*#__PURE__*/function () {
32
26
  observer.observe(this.contentDOM);
33
27
  }
34
28
  }
35
-
36
29
  _createClass(TableCellNodeView, [{
37
30
  key: "updateNodeView",
38
31
  value: function updateNodeView(node) {
39
32
  var _this = this;
40
-
41
33
  if (this.node.type !== node.type) {
42
34
  return false;
43
35
  }
44
-
45
36
  var attrs = getCellDomAttrs(this.node);
46
37
  var nextAttrs = getCellDomAttrs(node);
47
-
48
38
  var _getCellAttrs = getCellAttrs(this.dom),
49
- colspan = _getCellAttrs.colspan,
50
- rowspan = _getCellAttrs.rowspan; // need to rerender when colspan/rowspan in dom are different from the node attrs
51
- // this can happen when undoing merge cells
52
-
39
+ colspan = _getCellAttrs.colspan,
40
+ rowspan = _getCellAttrs.rowspan;
53
41
 
42
+ // need to rerender when colspan/rowspan in dom are different from the node attrs
43
+ // this can happen when undoing merge cells
54
44
  if (colspan !== (node.attrs.colspan || DEFAULT_COL_SPAN) || rowspan !== (node.attrs.rowspan || DEFAULT_ROW_SPAN)) {
55
45
  return false;
56
- } // added + changed attributes
57
-
46
+ }
58
47
 
48
+ // added + changed attributes
59
49
  var addedAttrs = Object.entries(nextAttrs).filter(function (_ref) {
60
50
  var _ref2 = _slicedToArray(_ref, 2),
61
- key = _ref2[0],
62
- value = _ref2[1];
63
-
51
+ key = _ref2[0],
52
+ value = _ref2[1];
64
53
  return attrs[key] !== value;
65
54
  });
66
55
  var removedAttrs = Object.keys(attrs).filter(function (key) {
67
56
  return !nextAttrs.hasOwnProperty(key);
68
57
  });
69
-
70
58
  if (addedAttrs.length || removedAttrs.length) {
71
59
  addedAttrs.forEach(function (_ref3) {
72
60
  var _ref4 = _slicedToArray(_ref3, 2),
73
- key = _ref4[0],
74
- value = _ref4[1];
75
-
61
+ key = _ref4[0],
62
+ value = _ref4[1];
76
63
  return _this.dom.setAttribute(key, value || '');
77
64
  });
78
65
  removedAttrs.forEach(function (key) {
79
66
  return _this.dom.removeAttribute(key);
80
67
  });
81
68
  return true;
82
- } // Return true to not re-render this node view
83
-
69
+ }
84
70
 
71
+ // Return true to not re-render this node view
85
72
  if (this.node.sameMarkup(node)) {
86
73
  return true;
87
74
  }
88
-
89
75
  return false;
90
76
  }
91
77
  }, {
92
78
  key: "update",
93
79
  value: function update(node) {
94
80
  var didUpdate = this.updateNodeView(node);
95
-
96
81
  if (didUpdate) {
97
82
  this.node = node;
98
83
  }
99
-
100
84
  return didUpdate;
101
85
  }
102
86
  }, {
@@ -107,8 +91,6 @@ var TableCellNodeView = /*#__PURE__*/function () {
107
91
  }
108
92
  }
109
93
  }]);
110
-
111
94
  return TableCellNodeView;
112
95
  }();
113
-
114
96
  export { TableCellNodeView as default };
@@ -8,42 +8,35 @@ export var updateShadowListForStickyStyles = function updateShadowListForStickyS
8
8
  }
9
9
  });
10
10
  };
11
+
11
12
  /**
12
13
  * Update overflow shadows for a given wrapper & table.
13
14
  * if `overflowShadowOptimization` is enabled, this will exit early.
14
15
  */
15
-
16
16
  export var updateOverflowShadows = function updateOverflowShadows(getEditorFeatureFlags) {
17
17
  return function (editorState, wrapper, table, rightShadows, leftShadows) {
18
18
  var _getEditorFeatureFlag;
19
-
20
19
  if (((_getEditorFeatureFlag = getEditorFeatureFlags()) === null || _getEditorFeatureFlag === void 0 ? void 0 : _getEditorFeatureFlag.tableOverflowShadowsOptimization) === true) {
21
20
  return false;
22
- } // Right shadow
23
-
24
-
21
+ }
22
+ // Right shadow
25
23
  if (table && wrapper) {
26
24
  var stickyRow = wrapper.querySelector('tr.sticky');
27
25
  var stickyCell = stickyRow && stickyRow.firstElementChild;
28
-
29
26
  if (rightShadows) {
30
27
  var diff = table.offsetWidth - wrapper.offsetWidth;
31
-
32
28
  for (var i = 0; i < rightShadows.length; i++) {
33
29
  var rightShadow = rightShadows[i];
34
30
  rightShadow.style.display = diff > 0 && diff > wrapper.scrollLeft ? 'block' : 'none';
35
-
36
31
  if (rightShadow.classList.contains(ClassName.TABLE_STICKY_SHADOW) && stickyCell) {
37
32
  rightShadow.style.height = "".concat(stickyCell.clientHeight + 1, "px");
38
33
  }
39
34
  }
40
35
  }
41
-
42
36
  if (leftShadows) {
43
37
  for (var _i = 0; _i < leftShadows.length; _i++) {
44
38
  var leftShadow = leftShadows[_i];
45
39
  leftShadow.style.display = wrapper.scrollLeft > 0 ? 'block' : 'none';
46
-
47
40
  if (leftShadow.classList.contains(ClassName.TABLE_STICKY_SHADOW) && stickyCell) {
48
41
  leftShadow.style.height = "".concat(stickyCell.clientHeight + 1, "px");
49
42
  }
@@ -16,7 +16,6 @@ export var handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr
16
16
  });
17
17
  } else if (tr.selectionSet) {
18
18
  var isTransactionFromMouseClick = !tr.docChanged && tr.selectionSet && tr.getMeta('pointer');
19
-
20
19
  if (isTransactionFromMouseClick || oldState.selection instanceof CellSelection) {
21
20
  return maybeUpdateColumnControlsSelectedDecoration({
22
21
  decorationSet: decorationSet,
@@ -24,7 +23,6 @@ export var handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr
24
23
  });
25
24
  }
26
25
  }
27
-
28
26
  return decorationSet;
29
27
  };
30
28
  export var createPlugin = function createPlugin() {
@@ -36,16 +34,13 @@ export var createPlugin = function createPlugin() {
36
34
  apply: function apply(tr, decorationSet, oldState) {
37
35
  var pluginState = decorationSet;
38
36
  var meta = tr.getMeta(tablePluginKey);
39
-
40
37
  if (meta && meta.data && meta.data.decorationSet) {
41
38
  pluginState = meta.data.decorationSet;
42
39
  }
43
-
44
40
  if (tr.docChanged || tr.selectionSet) {
45
41
  pluginState = pluginState.map(tr.mapping, tr.doc);
46
42
  return handleDocOrSelectionChanged(tr, pluginState, oldState);
47
43
  }
48
-
49
44
  return pluginState;
50
45
  }
51
46
  },
@@ -3,58 +3,47 @@ import { findTable } from '@atlaskit/editor-tables/utils';
3
3
  import { TableDecorations } from '../../../types';
4
4
  import { createColumnControlsDecoration, createColumnSelectedDecoration, findColumnControlSelectedDecoration, findControlsHoverDecoration, updateDecorations } from '../../../utils/decoration';
5
5
  import { composeDecorations } from './compose-decorations';
6
-
7
6
  var isColumnSelected = function isColumnSelected(tr) {
8
7
  return tr.selection instanceof CellSelection && tr.selection.isColSelection();
9
- }; // @see: https://product-fabric.atlassian.net/browse/ED-3796
10
-
8
+ };
11
9
 
10
+ // @see: https://product-fabric.atlassian.net/browse/ED-3796
12
11
  var removeControlsHoverDecoration = function removeControlsHoverDecoration(_ref) {
13
12
  var decorationSet = _ref.decorationSet;
14
13
  return decorationSet.remove(findControlsHoverDecoration(decorationSet));
15
14
  };
16
-
17
15
  var maybeUpdateColumnSelectedDecoration = function maybeUpdateColumnSelectedDecoration(_ref2) {
18
16
  var decorationSet = _ref2.decorationSet,
19
- tr = _ref2.tr;
20
-
17
+ tr = _ref2.tr;
21
18
  if (!isColumnSelected(tr)) {
22
19
  return decorationSet;
23
20
  }
24
-
25
21
  return updateDecorations(tr.doc, decorationSet, createColumnSelectedDecoration(tr), TableDecorations.COLUMN_SELECTED);
26
22
  };
27
-
28
23
  var maybeUpdateColumnControlsDecoration = function maybeUpdateColumnControlsDecoration(_ref3) {
29
24
  var decorationSet = _ref3.decorationSet,
30
- tr = _ref3.tr;
25
+ tr = _ref3.tr;
31
26
  var table = findTable(tr.selection);
32
-
33
27
  if (!table) {
34
28
  return decorationSet;
35
29
  }
36
-
37
30
  return updateDecorations(tr.doc, decorationSet, createColumnControlsDecoration(tr.selection), TableDecorations.COLUMN_CONTROLS_DECORATIONS);
38
- }; // @see: https://product-fabric.atlassian.net/browse/ED-7304
39
-
31
+ };
40
32
 
33
+ // @see: https://product-fabric.atlassian.net/browse/ED-7304
41
34
  var removeColumnControlsSelectedDecoration = function removeColumnControlsSelectedDecoration(_ref4) {
42
35
  var decorationSet = _ref4.decorationSet;
43
36
  return decorationSet.remove(findColumnControlSelectedDecoration(decorationSet));
44
37
  };
45
-
46
38
  var hasColumnSelectedDecorations = function hasColumnSelectedDecorations(decorationSet) {
47
39
  return !!findColumnControlSelectedDecoration(decorationSet).length;
48
40
  };
49
-
50
41
  export var maybeUpdateColumnControlsSelectedDecoration = function maybeUpdateColumnControlsSelectedDecoration(_ref5) {
51
42
  var decorationSet = _ref5.decorationSet,
52
- tr = _ref5.tr;
53
-
43
+ tr = _ref5.tr;
54
44
  if (!hasColumnSelectedDecorations(decorationSet)) {
55
45
  return decorationSet;
56
46
  }
57
-
58
47
  return removeColumnControlsSelectedDecoration({
59
48
  decorationSet: decorationSet,
60
49
  tr: tr
@@ -62,7 +51,7 @@ export var maybeUpdateColumnControlsSelectedDecoration = function maybeUpdateCol
62
51
  };
63
52
  export var buildColumnControlsDecorations = function buildColumnControlsDecorations(_ref6) {
64
53
  var decorationSet = _ref6.decorationSet,
65
- tr = _ref6.tr;
54
+ tr = _ref6.tr;
66
55
  return composeDecorations([removeColumnControlsSelectedDecoration, removeControlsHoverDecoration, maybeUpdateColumnSelectedDecoration, maybeUpdateColumnControlsDecoration])({
67
56
  decorationSet: decorationSet,
68
57
  tr: tr
@@ -3,35 +3,30 @@ import { TableDecorations } from '../../../types';
3
3
  import { createResizeHandleDecoration, updateDecorations } from '../../../utils/decoration';
4
4
  import { composeDecorations } from './compose-decorations';
5
5
  var emptyDecorations = [[], []];
6
-
7
6
  var updateColumnResizeHandle = function updateColumnResizeHandle(columnResizesDecorations) {
8
7
  return function (_ref) {
9
8
  var decorationSet = _ref.decorationSet,
10
- tr = _ref.tr;
9
+ tr = _ref.tr;
11
10
  return updateDecorations(tr.doc, decorationSet, columnResizesDecorations, TableDecorations.COLUMN_RESIZING_HANDLE);
12
11
  };
13
12
  };
14
-
15
13
  var updateLastCellElement = function updateLastCellElement(lastCellElementsDecorations) {
16
14
  return function (_ref2) {
17
15
  var decorationSet = _ref2.decorationSet,
18
- tr = _ref2.tr;
16
+ tr = _ref2.tr;
19
17
  return updateDecorations(tr.doc, decorationSet, lastCellElementsDecorations, TableDecorations.LAST_CELL_ELEMENT);
20
18
  };
21
19
  };
22
-
23
20
  export var buildColumnResizingDecorations = function buildColumnResizingDecorations(rowEndIndex, columnEndIndex) {
24
21
  return function (_ref3) {
25
22
  var tr = _ref3.tr,
26
- decorationSet = _ref3.decorationSet;
27
-
23
+ decorationSet = _ref3.decorationSet;
28
24
  var _ref4 = columnEndIndex < 0 ? emptyDecorations : createResizeHandleDecoration(tr, rowEndIndex, {
29
- right: columnEndIndex
30
- }),
31
- _ref5 = _slicedToArray(_ref4, 2),
32
- columnResizesDecorations = _ref5[0],
33
- lastCellElementsDecorations = _ref5[1];
34
-
25
+ right: columnEndIndex
26
+ }),
27
+ _ref5 = _slicedToArray(_ref4, 2),
28
+ columnResizesDecorations = _ref5[0],
29
+ lastCellElementsDecorations = _ref5[1];
35
30
  return composeDecorations([updateColumnResizeHandle(columnResizesDecorations), updateLastCellElement(lastCellElementsDecorations)])({
36
31
  decorationSet: decorationSet,
37
32
  tr: tr
@@ -1,7 +1,7 @@
1
1
  export var composeDecorations = function composeDecorations(transformers) {
2
2
  return function (_ref) {
3
3
  var decorationSet = _ref.decorationSet,
4
- tr = _ref.tr;
4
+ tr = _ref.tr;
5
5
  return transformers.reduce(function (decorationSet, transform) {
6
6
  return transform({
7
7
  decorationSet: decorationSet,
@@ -6,7 +6,6 @@ import { triggerUnlessTableHeader, createTable, goToNextCell, moveCursorBackward
6
6
  import { addRowAroundSelection, emptyMultipleCellsWithAnalytics, deleteTableIfSelectedWithAnalytics } from '../commands-with-analytics';
7
7
  import { addColumnAfter, addColumnBefore } from '../commands/insert';
8
8
  import { withEditorAnalyticsAPI } from '../utils/analytics';
9
-
10
9
  var createTableWithAnalytics = function createTableWithAnalytics(editorAnalyticsAPI) {
11
10
  return withEditorAnalyticsAPI({
12
11
  action: ACTION.INSERTED,
@@ -18,15 +17,15 @@ var createTableWithAnalytics = function createTableWithAnalytics(editorAnalytics
18
17
  eventType: EVENT_TYPE.TRACK
19
18
  })(editorAnalyticsAPI)(createTable());
20
19
  };
21
-
22
20
  export function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI) {
23
21
  var list = {};
24
22
  keymaps.bindKeymapWithCommand(keymaps.nextCell.common, goToNextCell(editorAnalyticsAPI)(1), list);
25
23
  keymaps.bindKeymapWithCommand(keymaps.previousCell.common, goToNextCell(editorAnalyticsAPI)(-1), list);
26
24
  keymaps.bindKeymapWithCommand(keymaps.toggleTable.common, createTableWithAnalytics(editorAnalyticsAPI), list);
27
25
  keymaps.bindKeymapWithCommand(keymaps.backspace.common, chainCommands(deleteTableIfSelectedWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), emptyMultipleCellsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD)), list);
28
- keymaps.bindKeymapWithCommand(keymaps.backspace.common, moveCursorBackward, list); // Add row/column shortcuts
26
+ keymaps.bindKeymapWithCommand(keymaps.backspace.common, moveCursorBackward, list);
29
27
 
28
+ // Add row/column shortcuts
30
29
  keymaps.bindKeymapWithCommand(keymaps.addRowBefore.common, addRowAroundSelection(editorAnalyticsAPI)('TOP'), list);
31
30
  keymaps.bindKeymapWithCommand(keymaps.addRowAfter.common, addRowAroundSelection(editorAnalyticsAPI)('BOTTOM'), list);
32
31
  keymaps.bindKeymapWithCommand(keymaps.addColumnBefore.common, triggerUnlessTableHeader(addColumnBefore(getEditorContainerWidth)), list);