@atlaskit/editor-plugin-table 7.25.10 → 7.25.12

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 (361) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cjs/commands/clear.js +2 -14
  3. package/dist/cjs/commands/column-resize.js +11 -5
  4. package/dist/cjs/commands/delete.js +2 -1
  5. package/dist/cjs/commands/insert.js +8 -5
  6. package/dist/cjs/commands/selection.js +3 -3
  7. package/dist/cjs/commands-with-analytics.js +23 -52
  8. package/dist/cjs/nodeviews/TableComponent.js +29 -14
  9. package/dist/cjs/nodeviews/TableContainer.js +2 -2
  10. package/dist/cjs/nodeviews/TableResizer.js +1 -1
  11. package/dist/cjs/plugin.js +4 -2
  12. package/dist/cjs/pm-plugins/analytics/plugin.js +2 -1
  13. package/dist/cjs/pm-plugins/decorations/utils/index.js +1 -8
  14. package/dist/cjs/pm-plugins/drag-and-drop/commands.js +3 -3
  15. package/dist/cjs/pm-plugins/drag-and-drop/index.js +1 -14
  16. package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +4 -1
  17. package/dist/cjs/pm-plugins/drag-and-drop/utils/index.js +0 -7
  18. package/dist/cjs/pm-plugins/safari-delete-composition-text-issue-workaround.js +2 -2
  19. package/dist/cjs/pm-plugins/sticky-headers/index.js +1 -14
  20. package/dist/cjs/pm-plugins/table-analytics.js +2 -2
  21. package/dist/cjs/pm-plugins/table-resizing/commands.js +2 -2
  22. package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +33 -15
  23. package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +15 -6
  24. package/dist/cjs/pm-plugins/table-resizing/utils/consts.js +1 -2
  25. package/dist/cjs/pm-plugins/table-resizing/utils/dom.js +3 -3
  26. package/dist/cjs/pm-plugins/table-resizing/utils/index.js +0 -103
  27. package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +23 -15
  28. package/dist/cjs/pm-plugins/table-resizing/utils/resize-column.js +6 -7
  29. package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +23 -18
  30. package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +13 -8
  31. package/dist/cjs/pm-plugins/table-selection-keymap.js +1 -3
  32. package/dist/cjs/pm-plugins/view-mode-sort/utils.js +2 -2
  33. package/dist/cjs/toolbar.js +9 -9
  34. package/dist/cjs/transforms/column-width.js +3 -1
  35. package/dist/cjs/transforms/delete-columns.js +2 -1
  36. package/dist/cjs/transforms/index.js +0 -6
  37. package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +2 -2
  38. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
  39. package/dist/cjs/ui/FloatingDeleteButton/index.js +0 -1
  40. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +5 -4
  41. package/dist/cjs/ui/FloatingDragMenu/index.js +4 -2
  42. package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +2 -2
  43. package/dist/cjs/ui/FloatingInsertButton/index.js +3 -2
  44. package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +2 -3
  45. package/dist/cjs/ui/TableFloatingColumnControls/index.js +2 -2
  46. package/dist/cjs/ui/icons/index.js +0 -7
  47. package/dist/cjs/utils/column-controls.js +1 -22
  48. package/dist/cjs/utils/dom.js +1 -4
  49. package/dist/cjs/utils/drag-menu.js +3 -2
  50. package/dist/cjs/utils/index.js +0 -108
  51. package/dist/cjs/utils/merged-cells.js +1 -60
  52. package/dist/cjs/utils/nodes.js +2 -2
  53. package/dist/cjs/utils/row-controls.js +1 -8
  54. package/dist/cjs/utils/selection.js +1 -60
  55. package/dist/cjs/utils/table.js +1 -11
  56. package/dist/es2019/commands/clear.js +1 -14
  57. package/dist/es2019/commands/column-resize.js +11 -5
  58. package/dist/es2019/commands/delete.js +2 -2
  59. package/dist/es2019/commands/insert.js +8 -8
  60. package/dist/es2019/commands/selection.js +2 -2
  61. package/dist/es2019/commands-with-analytics.js +6 -36
  62. package/dist/es2019/nodeviews/TableComponent.js +30 -15
  63. package/dist/es2019/nodeviews/TableContainer.js +1 -1
  64. package/dist/es2019/nodeviews/TableResizer.js +1 -1
  65. package/dist/es2019/plugin.js +4 -2
  66. package/dist/es2019/pm-plugins/analytics/plugin.js +2 -1
  67. package/dist/es2019/pm-plugins/decorations/utils/index.js +1 -2
  68. package/dist/es2019/pm-plugins/drag-and-drop/commands.js +2 -2
  69. package/dist/es2019/pm-plugins/drag-and-drop/index.js +1 -2
  70. package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +4 -1
  71. package/dist/es2019/pm-plugins/drag-and-drop/utils/index.js +0 -1
  72. package/dist/es2019/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
  73. package/dist/es2019/pm-plugins/sticky-headers/index.js +1 -2
  74. package/dist/es2019/pm-plugins/table-analytics.js +1 -1
  75. package/dist/es2019/pm-plugins/table-resizing/commands.js +1 -1
  76. package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +32 -14
  77. package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +15 -7
  78. package/dist/es2019/pm-plugins/table-resizing/utils/consts.js +0 -1
  79. package/dist/es2019/pm-plugins/table-resizing/utils/dom.js +2 -2
  80. package/dist/es2019/pm-plugins/table-resizing/utils/index.js +5 -6
  81. package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +22 -14
  82. package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +6 -7
  83. package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +21 -15
  84. package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +10 -7
  85. package/dist/es2019/pm-plugins/table-selection-keymap.js +1 -2
  86. package/dist/es2019/pm-plugins/view-mode-sort/utils.js +1 -1
  87. package/dist/es2019/toolbar.js +8 -8
  88. package/dist/es2019/transforms/column-width.js +3 -2
  89. package/dist/es2019/transforms/delete-columns.js +2 -2
  90. package/dist/es2019/transforms/index.js +1 -1
  91. package/dist/es2019/ui/FloatingContextualButton/FixedButton.js +1 -1
  92. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
  93. package/dist/es2019/ui/FloatingDeleteButton/index.js +1 -1
  94. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +4 -3
  95. package/dist/es2019/ui/FloatingDragMenu/index.js +4 -2
  96. package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +1 -1
  97. package/dist/es2019/ui/FloatingInsertButton/index.js +3 -2
  98. package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +1 -2
  99. package/dist/es2019/ui/TableFloatingColumnControls/index.js +1 -1
  100. package/dist/es2019/ui/icons/index.js +0 -1
  101. package/dist/es2019/utils/column-controls.js +1 -19
  102. package/dist/es2019/utils/dom.js +0 -1
  103. package/dist/es2019/utils/drag-menu.js +3 -3
  104. package/dist/es2019/utils/index.js +8 -8
  105. package/dist/es2019/utils/merged-cells.js +0 -47
  106. package/dist/es2019/utils/nodes.js +1 -1
  107. package/dist/es2019/utils/row-controls.js +1 -8
  108. package/dist/es2019/utils/selection.js +0 -60
  109. package/dist/es2019/utils/table.js +0 -6
  110. package/dist/esm/commands/clear.js +1 -14
  111. package/dist/esm/commands/column-resize.js +11 -5
  112. package/dist/esm/commands/delete.js +2 -1
  113. package/dist/esm/commands/insert.js +8 -5
  114. package/dist/esm/commands/selection.js +2 -2
  115. package/dist/esm/commands-with-analytics.js +24 -52
  116. package/dist/esm/nodeviews/TableComponent.js +30 -15
  117. package/dist/esm/nodeviews/TableContainer.js +1 -1
  118. package/dist/esm/nodeviews/TableResizer.js +1 -1
  119. package/dist/esm/plugin.js +4 -2
  120. package/dist/esm/pm-plugins/analytics/plugin.js +2 -1
  121. package/dist/esm/pm-plugins/decorations/utils/index.js +1 -2
  122. package/dist/esm/pm-plugins/drag-and-drop/commands.js +2 -2
  123. package/dist/esm/pm-plugins/drag-and-drop/index.js +1 -2
  124. package/dist/esm/pm-plugins/drag-and-drop/plugin.js +4 -1
  125. package/dist/esm/pm-plugins/drag-and-drop/utils/index.js +0 -1
  126. package/dist/esm/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
  127. package/dist/esm/pm-plugins/sticky-headers/index.js +1 -2
  128. package/dist/esm/pm-plugins/table-analytics.js +1 -1
  129. package/dist/esm/pm-plugins/table-resizing/commands.js +1 -1
  130. package/dist/esm/pm-plugins/table-resizing/event-handlers.js +33 -15
  131. package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +15 -6
  132. package/dist/esm/pm-plugins/table-resizing/utils/consts.js +0 -1
  133. package/dist/esm/pm-plugins/table-resizing/utils/dom.js +2 -2
  134. package/dist/esm/pm-plugins/table-resizing/utils/index.js +5 -6
  135. package/dist/esm/pm-plugins/table-resizing/utils/misc.js +24 -14
  136. package/dist/esm/pm-plugins/table-resizing/utils/resize-column.js +6 -7
  137. package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +22 -17
  138. package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +12 -6
  139. package/dist/esm/pm-plugins/table-selection-keymap.js +1 -2
  140. package/dist/esm/pm-plugins/view-mode-sort/utils.js +1 -1
  141. package/dist/esm/toolbar.js +8 -8
  142. package/dist/esm/transforms/column-width.js +3 -1
  143. package/dist/esm/transforms/delete-columns.js +2 -1
  144. package/dist/esm/transforms/index.js +1 -1
  145. package/dist/esm/ui/FloatingContextualButton/FixedButton.js +1 -1
  146. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
  147. package/dist/esm/ui/FloatingDeleteButton/index.js +1 -1
  148. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +4 -3
  149. package/dist/esm/ui/FloatingDragMenu/index.js +4 -2
  150. package/dist/esm/ui/FloatingInsertButton/InsertButton.js +1 -1
  151. package/dist/esm/ui/FloatingInsertButton/index.js +3 -2
  152. package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +1 -2
  153. package/dist/esm/ui/TableFloatingColumnControls/index.js +1 -1
  154. package/dist/esm/ui/icons/index.js +0 -1
  155. package/dist/esm/utils/column-controls.js +1 -22
  156. package/dist/esm/utils/dom.js +0 -3
  157. package/dist/esm/utils/drag-menu.js +3 -2
  158. package/dist/esm/utils/index.js +8 -8
  159. package/dist/esm/utils/merged-cells.js +0 -59
  160. package/dist/esm/utils/nodes.js +1 -1
  161. package/dist/esm/utils/row-controls.js +1 -8
  162. package/dist/esm/utils/selection.js +0 -59
  163. package/dist/esm/utils/table.js +0 -9
  164. package/dist/types/commands/clear.d.ts +0 -1
  165. package/dist/types/commands/delete.d.ts +1 -1
  166. package/dist/types/commands/insert.d.ts +4 -4
  167. package/dist/types/commands/selection.d.ts +0 -4
  168. package/dist/types/commands-with-analytics.d.ts +2 -3
  169. package/dist/types/nodeviews/TableComponent.d.ts +1 -1
  170. package/dist/types/nodeviews/TableContainer.d.ts +0 -11
  171. package/dist/types/nodeviews/TableResizer.d.ts +1 -3
  172. package/dist/types/pm-plugins/analytics/actions.d.ts +3 -2
  173. package/dist/types/pm-plugins/decorations/utils/index.d.ts +0 -1
  174. package/dist/types/pm-plugins/decorations/utils/types.d.ts +2 -1
  175. package/dist/types/pm-plugins/drag-and-drop/actions.d.ts +5 -4
  176. package/dist/types/pm-plugins/drag-and-drop/commands.d.ts +1 -6
  177. package/dist/types/pm-plugins/drag-and-drop/index.d.ts +0 -2
  178. package/dist/types/pm-plugins/drag-and-drop/utils/index.d.ts +0 -1
  179. package/dist/types/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +0 -2
  180. package/dist/types/pm-plugins/sticky-headers/index.d.ts +0 -1
  181. package/dist/types/pm-plugins/sticky-headers/types.d.ts +3 -2
  182. package/dist/types/pm-plugins/table-analytics.d.ts +0 -12
  183. package/dist/types/pm-plugins/table-resizing/commands.d.ts +0 -5
  184. package/dist/types/pm-plugins/table-resizing/utils/colgroup.d.ts +3 -2
  185. package/dist/types/pm-plugins/table-resizing/utils/consts.d.ts +0 -1
  186. package/dist/types/pm-plugins/table-resizing/utils/dom.d.ts +0 -2
  187. package/dist/types/pm-plugins/table-resizing/utils/index.d.ts +5 -8
  188. package/dist/types/pm-plugins/table-resizing/utils/misc.d.ts +1 -2
  189. package/dist/types/pm-plugins/table-resizing/utils/resize-column.d.ts +3 -2
  190. package/dist/types/pm-plugins/table-resizing/utils/resize-state.d.ts +3 -5
  191. package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +3 -4
  192. package/dist/types/pm-plugins/table-selection-keymap.d.ts +0 -1
  193. package/dist/types/pm-plugins/view-mode-sort/types.d.ts +2 -1
  194. package/dist/types/pm-plugins/view-mode-sort/utils.d.ts +0 -6
  195. package/dist/types/toolbar.d.ts +1 -14
  196. package/dist/types/transforms/column-width.d.ts +1 -1
  197. package/dist/types/transforms/delete-columns.d.ts +1 -1
  198. package/dist/types/transforms/index.d.ts +1 -1
  199. package/dist/types/ui/FloatingContextualButton/FixedButton.d.ts +1 -2
  200. package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
  201. package/dist/types/ui/FloatingContextualMenu/index.d.ts +1 -1
  202. package/dist/types/ui/FloatingDeleteButton/DeleteButton.d.ts +1 -1
  203. package/dist/types/ui/FloatingDeleteButton/index.d.ts +2 -3
  204. package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +1 -2
  205. package/dist/types/ui/FloatingDragMenu/index.d.ts +3 -2
  206. package/dist/types/ui/FloatingInsertButton/InsertButton.d.ts +1 -2
  207. package/dist/types/ui/FloatingInsertButton/index.d.ts +1 -0
  208. package/dist/types/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +2 -1
  209. package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
  210. package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +2 -1
  211. package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +2 -1
  212. package/dist/types/ui/TableFloatingColumnControls/index.d.ts +2 -2
  213. package/dist/types/ui/TableFloatingControls/NumberColumn/index.d.ts +2 -1
  214. package/dist/types/ui/TableFloatingControls/RowDropTarget/index.d.ts +1 -1
  215. package/dist/types/ui/TableFloatingControls/index.d.ts +1 -1
  216. package/dist/types/ui/icons/index.d.ts +0 -1
  217. package/dist/types/utils/column-controls.d.ts +0 -2
  218. package/dist/types/utils/dom.d.ts +0 -1
  219. package/dist/types/utils/drag-menu.d.ts +1 -1
  220. package/dist/types/utils/index.d.ts +8 -8
  221. package/dist/types/utils/merged-cells.d.ts +0 -2
  222. package/dist/types/utils/nodes.d.ts +0 -1
  223. package/dist/types/utils/row-controls.d.ts +0 -1
  224. package/dist/types/utils/selection.d.ts +0 -3
  225. package/dist/types/utils/table.d.ts +0 -2
  226. package/dist/types-ts4.5/commands/clear.d.ts +0 -1
  227. package/dist/types-ts4.5/commands/delete.d.ts +1 -1
  228. package/dist/types-ts4.5/commands/insert.d.ts +4 -4
  229. package/dist/types-ts4.5/commands/selection.d.ts +0 -4
  230. package/dist/types-ts4.5/commands-with-analytics.d.ts +2 -3
  231. package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +1 -1
  232. package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +0 -11
  233. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +1 -3
  234. package/dist/types-ts4.5/pm-plugins/analytics/actions.d.ts +3 -2
  235. package/dist/types-ts4.5/pm-plugins/decorations/utils/index.d.ts +0 -1
  236. package/dist/types-ts4.5/pm-plugins/decorations/utils/types.d.ts +2 -1
  237. package/dist/types-ts4.5/pm-plugins/drag-and-drop/actions.d.ts +5 -4
  238. package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands.d.ts +1 -6
  239. package/dist/types-ts4.5/pm-plugins/drag-and-drop/index.d.ts +0 -2
  240. package/dist/types-ts4.5/pm-plugins/drag-and-drop/utils/index.d.ts +0 -1
  241. package/dist/types-ts4.5/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +0 -2
  242. package/dist/types-ts4.5/pm-plugins/sticky-headers/index.d.ts +0 -1
  243. package/dist/types-ts4.5/pm-plugins/sticky-headers/types.d.ts +3 -2
  244. package/dist/types-ts4.5/pm-plugins/table-analytics.d.ts +0 -12
  245. package/dist/types-ts4.5/pm-plugins/table-resizing/commands.d.ts +0 -5
  246. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/colgroup.d.ts +3 -2
  247. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/consts.d.ts +0 -1
  248. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/dom.d.ts +0 -2
  249. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/index.d.ts +5 -8
  250. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/misc.d.ts +1 -2
  251. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-column.d.ts +3 -2
  252. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-state.d.ts +3 -5
  253. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +3 -4
  254. package/dist/types-ts4.5/pm-plugins/table-selection-keymap.d.ts +0 -1
  255. package/dist/types-ts4.5/pm-plugins/view-mode-sort/types.d.ts +2 -1
  256. package/dist/types-ts4.5/pm-plugins/view-mode-sort/utils.d.ts +0 -6
  257. package/dist/types-ts4.5/toolbar.d.ts +1 -14
  258. package/dist/types-ts4.5/transforms/column-width.d.ts +1 -1
  259. package/dist/types-ts4.5/transforms/delete-columns.d.ts +1 -1
  260. package/dist/types-ts4.5/transforms/index.d.ts +1 -1
  261. package/dist/types-ts4.5/ui/FloatingContextualButton/FixedButton.d.ts +1 -2
  262. package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
  263. package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +1 -1
  264. package/dist/types-ts4.5/ui/FloatingDeleteButton/DeleteButton.d.ts +1 -1
  265. package/dist/types-ts4.5/ui/FloatingDeleteButton/index.d.ts +2 -3
  266. package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +1 -2
  267. package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +3 -2
  268. package/dist/types-ts4.5/ui/FloatingInsertButton/InsertButton.d.ts +1 -2
  269. package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +1 -0
  270. package/dist/types-ts4.5/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +2 -1
  271. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
  272. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +2 -1
  273. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +2 -1
  274. package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +2 -2
  275. package/dist/types-ts4.5/ui/TableFloatingControls/NumberColumn/index.d.ts +2 -1
  276. package/dist/types-ts4.5/ui/TableFloatingControls/RowDropTarget/index.d.ts +1 -1
  277. package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +1 -1
  278. package/dist/types-ts4.5/ui/icons/index.d.ts +0 -1
  279. package/dist/types-ts4.5/utils/column-controls.d.ts +0 -2
  280. package/dist/types-ts4.5/utils/dom.d.ts +0 -1
  281. package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
  282. package/dist/types-ts4.5/utils/index.d.ts +8 -8
  283. package/dist/types-ts4.5/utils/merged-cells.d.ts +0 -2
  284. package/dist/types-ts4.5/utils/nodes.d.ts +0 -1
  285. package/dist/types-ts4.5/utils/row-controls.d.ts +0 -1
  286. package/dist/types-ts4.5/utils/selection.d.ts +0 -3
  287. package/dist/types-ts4.5/utils/table.d.ts +0 -2
  288. package/package.json +3 -3
  289. package/src/commands/clear.ts +0 -14
  290. package/src/commands/column-resize.ts +19 -6
  291. package/src/commands/delete.ts +2 -0
  292. package/src/commands/insert.ts +8 -0
  293. package/src/commands/selection.ts +1 -1
  294. package/src/commands-with-analytics.ts +5 -40
  295. package/src/nodeviews/TableComponent.tsx +43 -9
  296. package/src/nodeviews/TableContainer.tsx +1 -1
  297. package/src/nodeviews/TableResizer.tsx +2 -4
  298. package/src/plugin.tsx +2 -0
  299. package/src/pm-plugins/analytics/actions.ts +2 -2
  300. package/src/pm-plugins/analytics/plugin.ts +2 -1
  301. package/src/pm-plugins/decorations/utils/index.ts +0 -1
  302. package/src/pm-plugins/decorations/utils/types.ts +1 -1
  303. package/src/pm-plugins/drag-and-drop/actions.ts +4 -4
  304. package/src/pm-plugins/drag-and-drop/commands.ts +2 -2
  305. package/src/pm-plugins/drag-and-drop/index.ts +0 -3
  306. package/src/pm-plugins/drag-and-drop/plugin.ts +4 -0
  307. package/src/pm-plugins/drag-and-drop/utils/index.ts +0 -2
  308. package/src/pm-plugins/safari-delete-composition-text-issue-workaround.ts +1 -1
  309. package/src/pm-plugins/sticky-headers/index.ts +0 -1
  310. package/src/pm-plugins/sticky-headers/types.ts +2 -2
  311. package/src/pm-plugins/table-analytics.ts +1 -1
  312. package/src/pm-plugins/table-resizing/commands.ts +1 -1
  313. package/src/pm-plugins/table-resizing/event-handlers.ts +39 -15
  314. package/src/pm-plugins/table-resizing/utils/colgroup.ts +18 -7
  315. package/src/pm-plugins/table-resizing/utils/consts.ts +0 -1
  316. package/src/pm-plugins/table-resizing/utils/dom.ts +2 -5
  317. package/src/pm-plugins/table-resizing/utils/index.ts +4 -30
  318. package/src/pm-plugins/table-resizing/utils/misc.ts +25 -17
  319. package/src/pm-plugins/table-resizing/utils/resize-column.ts +14 -13
  320. package/src/pm-plugins/table-resizing/utils/resize-state.ts +28 -21
  321. package/src/pm-plugins/table-resizing/utils/scale-table.ts +18 -6
  322. package/src/pm-plugins/table-selection-keymap.ts +0 -2
  323. package/src/pm-plugins/view-mode-sort/types.ts +1 -1
  324. package/src/pm-plugins/view-mode-sort/utils.ts +1 -5
  325. package/src/toolbar.tsx +8 -5
  326. package/src/transforms/column-width.ts +2 -0
  327. package/src/transforms/delete-columns.ts +2 -0
  328. package/src/transforms/index.ts +1 -1
  329. package/src/ui/FloatingContextualButton/FixedButton.tsx +2 -2
  330. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +5 -2
  331. package/src/ui/FloatingContextualMenu/index.tsx +1 -1
  332. package/src/ui/FloatingDeleteButton/DeleteButton.tsx +1 -1
  333. package/src/ui/FloatingDeleteButton/index.tsx +2 -2
  334. package/src/ui/FloatingDragMenu/DragMenu.tsx +4 -1
  335. package/src/ui/FloatingDragMenu/index.tsx +4 -1
  336. package/src/ui/FloatingInsertButton/InsertButton.tsx +2 -2
  337. package/src/ui/FloatingInsertButton/index.tsx +3 -0
  338. package/src/ui/FloatingToolbarLabel/FloatingToolbarLabel.tsx +1 -1
  339. package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +1 -3
  340. package/src/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +1 -1
  341. package/src/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +1 -1
  342. package/src/ui/TableFloatingColumnControls/index.tsx +2 -2
  343. package/src/ui/TableFloatingControls/NumberColumn/index.tsx +1 -1
  344. package/src/ui/TableFloatingControls/RowDropTarget/index.tsx +1 -1
  345. package/src/ui/TableFloatingControls/index.tsx +1 -1
  346. package/src/ui/icons/index.ts +0 -1
  347. package/src/utils/column-controls.ts +2 -38
  348. package/src/utils/dom.ts +0 -4
  349. package/src/utils/drag-menu.ts +3 -0
  350. package/src/utils/index.ts +1 -22
  351. package/src/utils/merged-cells.ts +0 -62
  352. package/src/utils/nodes.ts +1 -1
  353. package/src/utils/row-controls.ts +1 -19
  354. package/src/utils/selection.ts +0 -84
  355. package/src/utils/table.ts +0 -8
  356. package/dist/cjs/utils/transforms.js +0 -11
  357. package/dist/es2019/utils/transforms.js +0 -5
  358. package/dist/esm/utils/transforms.js +0 -5
  359. package/dist/types/utils/transforms.d.ts +0 -2
  360. package/dist/types-ts4.5/utils/transforms.d.ts +0 -2
  361. package/src/utils/transforms.ts +0 -10
@@ -25,6 +25,7 @@ export const getResizeState = ({
25
25
  domAtPos,
26
26
  isTableScalingEnabled = false,
27
27
  shouldUseIncreasedScalingPercent = false,
28
+ isCommentEditor = false,
28
29
  }: {
29
30
  minWidth: number;
30
31
  maxSize: number;
@@ -34,13 +35,18 @@ export const getResizeState = ({
34
35
  domAtPos: (pos: number) => { node: Node; offset: number };
35
36
  isTableScalingEnabled: boolean;
36
37
  shouldUseIncreasedScalingPercent: boolean;
38
+ isCommentEditor: boolean;
37
39
  }): ResizeState => {
38
- if (isTableScalingEnabled) {
40
+ if (
41
+ (isTableScalingEnabled && !isCommentEditor) ||
42
+ (isTableScalingEnabled && isCommentEditor && table.attrs?.width)
43
+ ) {
39
44
  const scalePercent = getTableScalingPercent(table, tableRef, shouldUseIncreasedScalingPercent);
40
45
  minWidth = Math.ceil(minWidth / scalePercent);
41
46
  }
42
- // If the table has been resized, we can use the column widths from the table node
47
+
43
48
  if (hasTableBeenResized(table)) {
49
+ // If the table has been resized, we can use the column widths from the table node
44
50
  const cols = calcTableColumnWidths(table).map((width, index) => ({
45
51
  width: width === 0 ? tableNewColumnMinWidth : width,
46
52
  minWidth: width === 0 ? tableNewColumnMinWidth : minWidth,
@@ -70,12 +76,16 @@ export const getResizeState = ({
70
76
  isTableScalingEnabled,
71
77
  shouldReinsertColgroup, // don't reinsert colgroup when preserving table width - this causes widths to jump
72
78
  shouldUseIncreasedScalingPercent,
79
+ isCommentEditor,
73
80
  );
74
81
  const cols = Array.from(colgroupChildren).map((_, index) => {
75
82
  // If the table hasn't been resized and we have a table width attribute, we can use it
76
83
  // to calculate the widths of the columns
77
84
  if (isTableScalingEnabled) {
78
- const tableNodeWidth = getTableContainerWidth(table);
85
+ // isCommentEditor when table cols were not resized,
86
+ // we want to use tableRef.parentElement.clientWidth, which is the same as maxSize
87
+ const tableNodeWidth =
88
+ isCommentEditor && !table.attrs?.width ? maxSize : getTableContainerWidth(table);
79
89
  return {
80
90
  index,
81
91
  width: tableNodeWidth / colgroupChildren.length,
@@ -107,7 +117,7 @@ export const updateColgroup = (
107
117
  tableRef: HTMLElement | null,
108
118
  tableNode?: PMNode,
109
119
  isTableScalingEnabled?: boolean,
110
- shouldUseIncreasedScalingPercent?: boolean,
120
+ scalePercent?: number,
111
121
  ): void => {
112
122
  const cols = tableRef?.querySelectorAll('col');
113
123
  const columnsCount = cols?.length;
@@ -117,16 +127,11 @@ export const updateColgroup = (
117
127
  We need to remove !isColumnResizing if we handled auto scale table when mouseUp event.
118
128
  * */
119
129
  if (isTableScalingEnabled && tableNode) {
120
- const scalePercent = getTableScalingPercent(
121
- tableNode,
122
- tableRef,
123
- shouldUseIncreasedScalingPercent,
124
- );
125
130
  state.cols
126
131
  .filter((column) => column && !!column.width) // if width is 0, we dont want to apply that.
127
132
  .forEach((column, i) => {
128
133
  const fixedColWidth = getColWidthFix(column.width, columnsCount ?? 0);
129
- const scaledWidth = fixedColWidth * scalePercent;
134
+ const scaledWidth = fixedColWidth * (scalePercent || 1);
130
135
  const finalWidth = Math.max(scaledWidth, tableCellMinWidth);
131
136
  // we aren't handling the remaining pixels here when the 48px min width is reached
132
137
  if (cols?.[i]) {
@@ -187,7 +192,7 @@ const getSpace = (columns: ColumnState[], start: number, end: number) =>
187
192
  .map((col) => col.width)
188
193
  .reduce((sum, width) => sum + width, 0);
189
194
 
190
- export const evenSelectedColumnsWidths = (resizeState: ResizeState, rect: Rect): ResizeState => {
195
+ const evenSelectedColumnsWidths = (resizeState: ResizeState, rect: Rect): ResizeState => {
191
196
  const cols = resizeState.cols;
192
197
  const selectedSpace = getSpace(cols, rect.left, rect.right);
193
198
  const allSpace = getSpace(cols, 0, cols.length);
@@ -302,13 +307,8 @@ export const bulkColumnsResize = (
302
307
  return adjustColumnsWidths(newState, resizeState.maxSize);
303
308
  };
304
309
 
305
- export const areColumnsEven = (resizeState: ResizeState): boolean => {
306
- const newResizeState = evenAllColumnsWidths(resizeState);
307
- return newResizeState.cols.every((col, i) => col.width === resizeState.cols[i].width);
308
- };
309
-
310
310
  // Get the layout
311
- export const normaliseTableLayout = (input: string | undefined | null) => {
311
+ const normaliseTableLayout = (input: string | undefined | null) => {
312
312
  switch (input) {
313
313
  case 'wide':
314
314
  return input;
@@ -373,6 +373,15 @@ export const getNewResizeStateFromSelectedColumns = (
373
373
  isTableScalingEnabledOnCurrentTable = table.node.attrs.displayMode !== 'fixed';
374
374
  }
375
375
 
376
+ let shouldUseIncreasedScalingPercent =
377
+ isTableScalingWithFixedColumnWidthsOptionEnabled &&
378
+ fg('platform.editor.table.use-increased-scaling-percent');
379
+
380
+ if (isTableScalingEnabled && isCommentEditor) {
381
+ isTableScalingEnabledOnCurrentTable = true;
382
+ shouldUseIncreasedScalingPercent = true;
383
+ }
384
+
376
385
  resizeState = getResizeState({
377
386
  minWidth: tableCellMinWidth,
378
387
  maxSize,
@@ -381,10 +390,8 @@ export const getNewResizeStateFromSelectedColumns = (
381
390
  start: table.start,
382
391
  domAtPos,
383
392
  isTableScalingEnabled: isTableScalingEnabledOnCurrentTable,
384
- shouldUseIncreasedScalingPercent:
385
- (isTableScalingWithFixedColumnWidthsOptionEnabled &&
386
- fg('platform.editor.table.use-increased-scaling-percent')) ||
387
- (isTableScalingEnabled && isCommentEditor),
393
+ shouldUseIncreasedScalingPercent,
394
+ isCommentEditor,
388
395
  });
389
396
 
390
397
  const newResizeState = evenSelectedColumnsWidths(resizeState, rect);
@@ -22,7 +22,7 @@ import type { ResizeState } from '../utils/types';
22
22
  import { hasTableBeenResized, insertColgroupFromNode } from './colgroup';
23
23
  import { syncStickyRowToTable } from './dom';
24
24
 
25
- export interface ScaleOptions {
25
+ interface ScaleOptions {
26
26
  node: PMNode;
27
27
  prevNode: PMNode;
28
28
  start: number;
@@ -36,12 +36,13 @@ export interface ScaleOptions {
36
36
 
37
37
  // Base function to trigger the actual scale on a table node.
38
38
  // Will only resize/scale if a table has been previously resized.
39
- export const scale = (
39
+ const scale = (
40
40
  tableRef: HTMLTableElement,
41
41
  options: ScaleOptions,
42
42
  domAtPos: DomAtPos,
43
43
  isTableScalingEnabledOnCurrentTable = false,
44
44
  shouldUseIncreasedScalingPercent = false,
45
+ isCommentEditor = false,
45
46
  ): ResizeState | undefined => {
46
47
  const {
47
48
  node,
@@ -92,12 +93,13 @@ export const scale = (
92
93
  domAtPos,
93
94
  isTableScalingEnabled: isTableScalingEnabledOnCurrentTable,
94
95
  shouldUseIncreasedScalingPercent,
96
+ isCommentEditor,
95
97
  });
96
98
 
97
99
  return scaleTableTo(resizeState, newWidth);
98
100
  };
99
101
 
100
- export const scaleWithParent = (
102
+ const scaleWithParent = (
101
103
  tableRef: HTMLTableElement,
102
104
  parentWidth: number,
103
105
  table: PMNode,
@@ -105,6 +107,7 @@ export const scaleWithParent = (
105
107
  domAtPos: DomAtPos,
106
108
  isTableScalingEnabledOnCurrentTable = false,
107
109
  shouldUseIncreasedScalingPercent = false,
110
+ isCommentEditor = false,
108
111
  ) => {
109
112
  const resizeState = getResizeState({
110
113
  minWidth: tableCellMinWidth,
@@ -115,6 +118,7 @@ export const scaleWithParent = (
115
118
  domAtPos,
116
119
  isTableScalingEnabled: isTableScalingEnabledOnCurrentTable,
117
120
  shouldUseIncreasedScalingPercent,
121
+ isCommentEditor,
118
122
  });
119
123
 
120
124
  if (table.attrs.isNumberColumnEnabled) {
@@ -205,7 +209,7 @@ export const previewScaleTable = (
205
209
  : scale(tableRef, options, domAtPos, false, shouldUseIncreasedScalingPercent);
206
210
 
207
211
  if (resizeState) {
208
- updateColgroup(resizeState, tableRef, node, false, shouldUseIncreasedScalingPercent);
212
+ updateColgroup(resizeState, tableRef, node, false, 1);
209
213
  }
210
214
  };
211
215
 
@@ -218,19 +222,27 @@ export const scaleTable =
218
222
  api: PluginInjectionAPI | undefined | null,
219
223
  isTableScalingEnabledOnCurrentTable = false,
220
224
  shouldUseIncreasedScalingPercent = false,
225
+ isCommentEditor = false,
221
226
  ) =>
222
227
  (tr: Transaction) => {
223
228
  if (!tableRef) {
224
229
  return tr;
225
230
  }
226
-
227
231
  const { node, start, parentWidth, layoutChanged } = options;
228
232
  // If a table has not been resized yet, columns should be auto.
229
233
  if (hasTableBeenResized(node) === false) {
230
234
  // If its not a re-sized table, we still want to re-create cols
231
235
  // To force reflow of columns upon delete.
232
236
  if (!isTableScalingEnabledOnCurrentTable) {
233
- insertColgroupFromNode(tableRef, node, false, undefined, shouldUseIncreasedScalingPercent);
237
+ const isTableScalingEnabled = false;
238
+ insertColgroupFromNode(
239
+ tableRef,
240
+ node,
241
+ isTableScalingEnabled,
242
+ undefined,
243
+ shouldUseIncreasedScalingPercent,
244
+ isCommentEditor,
245
+ );
234
246
  }
235
247
  tr.setMeta('scrollIntoView', false);
236
248
  return tr;
@@ -53,5 +53,3 @@ export function tableSelectionKeymapPlugin(
53
53
 
54
54
  return keymap(list) as SafePlugin;
55
55
  }
56
-
57
- export default tableSelectionKeymapPlugin;
@@ -20,4 +20,4 @@ export interface ViewModeSortPluginState {
20
20
  allTables: HoverTableMeta[];
21
21
  }
22
22
 
23
- export type HoverTableMeta = [string, PMNode, number];
23
+ type HoverTableMeta = [string, PMNode, number];
@@ -23,11 +23,7 @@ export const unsort = (oldOrder: { index: number; value: number }[], tableElemen
23
23
  });
24
24
  };
25
25
 
26
- export const getSortOrderFromTable = (
27
- tableNode: PMNode,
28
- sortIndex: number,
29
- direction: SortOrder,
30
- ) => {
26
+ const getSortOrderFromTable = (tableNode: PMNode, sortIndex: number, direction: SortOrder) => {
31
27
  const tableArray = convertProsemirrorTableNodeToArrayOfRows(tableNode);
32
28
  tableArray.shift(); // remove header row
33
29
 
package/src/toolbar.tsx CHANGED
@@ -221,6 +221,7 @@ export const getToolbarCellOptionsConfig = (
221
221
  isCellBackgroundDuplicated,
222
222
  isTableFixedColumnWidthsOptionEnabled,
223
223
  shouldUseIncreasedScalingPercent,
224
+ isCommentEditor,
224
225
  )(INPUT_METHOD.FLOATING_TB, index)(state, dispatch, view);
225
226
  }
226
227
  return true;
@@ -263,6 +264,7 @@ export const getToolbarCellOptionsConfig = (
263
264
  isTableScalingEnabled,
264
265
  isTableFixedColumnWidthsOptionEnabled,
265
266
  shouldUseIncreasedScalingPercent,
267
+ isCommentEditor,
266
268
  )(INPUT_METHOD.FLOATING_TB, selectionRect)(state, dispatch, view);
267
269
  }
268
270
  return true;
@@ -449,7 +451,7 @@ export const getClosestSelectionRect = (state: EditorState): Rect | undefined =>
449
451
  : findCellRectClosestToPos(selection.$from);
450
452
  };
451
453
 
452
- export const getClosestSelectionOrTableRect = (state: EditorState): Rect | undefined => {
454
+ const getClosestSelectionOrTableRect = (state: EditorState): Rect | undefined => {
453
455
  const selection = state.selection;
454
456
  const tableObject = findTable(state.selection);
455
457
  if (!tableObject) {
@@ -696,7 +698,7 @@ const getCellItems = (
696
698
  return [];
697
699
  };
698
700
 
699
- export const getDistributeConfig =
701
+ const getDistributeConfig =
700
702
  (
701
703
  getEditorContainerWidth: GetEditorContainerWidth,
702
704
  api: PluginInjectionAPI | undefined | null,
@@ -756,6 +758,7 @@ const getColumnSettingItems = (
756
758
  getEditorContainerWidth,
757
759
  isTableScalingEnabled,
758
760
  isTableFixedColumnWidthsOptionEnabled,
761
+ isCommentEditor,
759
762
  );
760
763
 
761
764
  const wouldChange = newResizeStateWithAnalytics?.changed ?? false;
@@ -875,7 +878,7 @@ type AlignmentIcon = {
875
878
  icon: React.ComponentClass<any>;
876
879
  };
877
880
 
878
- export const getAlignmentOptionsConfig = (
881
+ const getAlignmentOptionsConfig = (
879
882
  editorState: EditorState,
880
883
  { formatMessage }: ToolbarMenuContext,
881
884
  editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
@@ -964,13 +967,13 @@ export const getAlignmentOptionsConfig = (
964
967
  return alignmentToolbarItem;
965
968
  };
966
969
 
967
- export const getSelectedAlignmentIcon = (alignmentIcons: AlignmentIcon[], selectedNode: PMNode) => {
970
+ const getSelectedAlignmentIcon = (alignmentIcons: AlignmentIcon[], selectedNode: PMNode) => {
968
971
  const selectedAlignment = selectedNode.attrs.layout;
969
972
 
970
973
  return alignmentIcons.find((icon) => icon.value === normaliseAlignment(selectedAlignment));
971
974
  };
972
975
 
973
- export const isLayoutOptionDisabled = (
976
+ const isLayoutOptionDisabled = (
974
977
  selectedNode: PMNode,
975
978
  getEditorContainerWidth: GetEditorContainerWidth,
976
979
  getDomRef: (editorView: EditorView) => HTMLElement | undefined,
@@ -115,6 +115,7 @@ export const rescaleColumns =
115
115
  isTableFixedColumnWidthsOptionEnabled = false,
116
116
  shouldUseIncreasedScalingPercent = false,
117
117
  api: PluginInjectionAPI | undefined | null,
118
+ isCommentEditor = false,
118
119
  ) =>
119
120
  (table: ContentNodeWithPos, view: EditorView | undefined) =>
120
121
  (tr: Transaction): Transaction => {
@@ -215,6 +216,7 @@ export const rescaleColumns =
215
216
  maxSize: previousTableInfo.possibleMaxWidth,
216
217
  isTableScalingEnabled: shouldScale,
217
218
  shouldUseIncreasedScalingPercent,
219
+ isCommentEditor,
218
220
  });
219
221
  // Two scenarios that require scaling:
220
222
  // 1. If the new table width will result in the table going into overflow
@@ -249,6 +249,7 @@ export const deleteColumns =
249
249
  isTableScalingEnabled = false,
250
250
  isTableFixedColumnWidthsOptionEnabled = false,
251
251
  shouldUseIncreasedScalingPercent = false,
252
+ isCommentEditor = false,
252
253
  ) =>
253
254
  (tr: Transaction) => {
254
255
  let updatedTr = tr;
@@ -268,6 +269,7 @@ export const deleteColumns =
268
269
  isTableFixedColumnWidthsOptionEnabled,
269
270
  shouldUseIncreasedScalingPercent,
270
271
  api,
272
+ isCommentEditor,
271
273
  )(
272
274
  table,
273
275
  view,
@@ -1,5 +1,5 @@
1
1
  export { fixTables, fixAutoSizedTable } from './fix-tables';
2
- export { mergeCells, canMergeCells, mergeEmptyColumns } from './merge';
2
+ export { mergeCells, canMergeCells } from './merge';
3
3
  export { deleteColumns } from './delete-columns';
4
4
  export { deleteRows } from './delete-rows';
5
5
  export { updateColumnWidths } from './column-width';
@@ -10,9 +10,9 @@ import type { RowStickyState } from '../../pm-plugins/sticky-headers';
10
10
  import { TableCssClassName as ClassName } from '../../types';
11
11
  import { insertColumnButtonOffset } from '../common-styles';
12
12
 
13
- export const BUTTON_WIDTH = 20;
13
+ const BUTTON_WIDTH = 20;
14
14
 
15
- export interface Props {
15
+ interface Props {
16
16
  children: React.ReactNode;
17
17
  mountTo: HTMLElement;
18
18
  offset: number;
@@ -87,7 +87,7 @@ import { AddColRightIcon, AddRowBelowIcon, MergeCellsIcon, SplitCellIcon } from
87
87
 
88
88
  import { cellColourPreviewStyles, elementBeforeIconStyles } from './styles';
89
89
 
90
- export interface Props {
90
+ interface Props {
91
91
  editorView: EditorView;
92
92
  isOpen: boolean;
93
93
  selectionRect: Rect;
@@ -106,7 +106,7 @@ export interface Props {
106
106
  isCommentEditor?: boolean;
107
107
  }
108
108
 
109
- export interface State {
109
+ interface State {
110
110
  isSubmenuOpen: boolean;
111
111
  isOpenAllowed: boolean;
112
112
  }
@@ -721,6 +721,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
721
721
  getEditorContainerWidth,
722
722
  isTableScalingEnabled,
723
723
  tableWithFixedColumnWidthsOption,
724
+ isCommentEditor,
724
725
  );
725
726
 
726
727
  if (newResizeStateWithAnalytics) {
@@ -746,6 +747,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
746
747
  tableDuplicateCellColouring,
747
748
  tableWithFixedColumnWidthsOption,
748
749
  shouldUseIncreasedScalingPercent,
750
+ isCommentEditor,
749
751
  )(INPUT_METHOD.CONTEXT_MENU, selectionRect.right)(state, dispatch, editorView);
750
752
  this.toggleOpen();
751
753
  break;
@@ -766,6 +768,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
766
768
  isTableScalingEnabled,
767
769
  tableWithFixedColumnWidthsOption,
768
770
  shouldUseIncreasedScalingPercent,
771
+ isCommentEditor,
769
772
  )(INPUT_METHOD.CONTEXT_MENU, selectionRect)(state, dispatch, editorView);
770
773
  this.toggleOpen();
771
774
  break;
@@ -32,7 +32,7 @@ import {
32
32
  import ContextualMenu from './ContextualMenu';
33
33
  import { tablePopupStyles } from './styles';
34
34
 
35
- export interface Props {
35
+ interface Props {
36
36
  editorView: EditorView;
37
37
  isOpen: boolean;
38
38
  getEditorContainerWidth: GetEditorContainerWidth;
@@ -6,7 +6,7 @@ import { injectIntl } from 'react-intl-next';
6
6
 
7
7
  import { TableCssClassName as ClassName } from '../../types';
8
8
 
9
- export interface ButtonProps {
9
+ interface ButtonProps {
10
10
  removeLabel: MessageDescriptor;
11
11
  style?: object;
12
12
  onClick?: (event: SyntheticEvent) => void;
@@ -45,7 +45,7 @@ export interface Props {
45
45
  editorAnalyticsAPI?: EditorAnalyticsAPI;
46
46
  }
47
47
 
48
- export interface State {
48
+ interface State {
49
49
  selectionType?: CellSelectionType;
50
50
  left: number;
51
51
  top: number;
@@ -54,7 +54,7 @@ export interface State {
54
54
  scrollLeft: number;
55
55
  }
56
56
 
57
- export function getSelectionType(selection: Selection): TableDirection | undefined {
57
+ function getSelectionType(selection: Selection): TableDirection | undefined {
58
58
  if (!isTableSelected(selection) && selection instanceof CellSelection) {
59
59
  if (selection.isRowSelection()) {
60
60
  return 'row';
@@ -102,6 +102,7 @@ type DragMenuProps = {
102
102
  message: string,
103
103
  ariaLiveElementAttributes?: AriaLiveElementAttributes,
104
104
  ) => void;
105
+ isCommentEditor?: boolean;
105
106
  };
106
107
 
107
108
  type PluralOptionType = 'noOfCols' | 'noOfRows' | 'noOfCells' | null;
@@ -261,7 +262,7 @@ const convertToDropdownItems = (
261
262
 
262
263
  const ColorPaletteWithListeners = withOuterListeners(ColorPalette);
263
264
 
264
- export const DragMenu = React.memo(
265
+ const DragMenu = React.memo(
265
266
  ({
266
267
  direction = 'row',
267
268
  index,
@@ -286,6 +287,7 @@ export const DragMenu = React.memo(
286
287
  isTableFixedColumnWidthsOptionEnabled,
287
288
  tableSortColumnReorder,
288
289
  ariaNotifyPlugin,
290
+ isCommentEditor,
289
291
  }: DragMenuProps & WrappedComponentProps) => {
290
292
  const { state, dispatch } = editorView;
291
293
  const { selection } = state;
@@ -318,6 +320,7 @@ export const DragMenu = React.memo(
318
320
  shouldUseIncreasedScalingPercent,
319
321
  tableSortColumnReorder,
320
322
  ariaNotifyPlugin,
323
+ isCommentEditor,
321
324
  );
322
325
 
323
326
  const { menuItems, menuCallback } = convertToDropdownItems(
@@ -19,7 +19,7 @@ import { dragMenuDropdownWidth, tablePopupMenuFitHeight } from '../consts';
19
19
 
20
20
  import DragMenu from './DragMenu';
21
21
 
22
- export interface Props {
22
+ interface Props {
23
23
  editorView: EditorView;
24
24
  isOpen: boolean;
25
25
  tableRef?: HTMLTableElement;
@@ -41,6 +41,7 @@ export interface Props {
41
41
  message: string,
42
42
  ariaLiveElementAttributes?: AriaLiveElementAttributes,
43
43
  ) => void;
44
+ isCommentEditor?: boolean;
44
45
  }
45
46
 
46
47
  const FloatingDragMenu = ({
@@ -61,6 +62,7 @@ const FloatingDragMenu = ({
61
62
  getEditorFeatureFlags,
62
63
  ariaNotifyPlugin,
63
64
  api,
65
+ isCommentEditor,
64
66
  }: Props) => {
65
67
  if (!isOpen || !targetCellPosition || editorView.state.doc.nodeSize <= targetCellPosition) {
66
68
  return null;
@@ -130,6 +132,7 @@ const FloatingDragMenu = ({
130
132
  tableSortColumnReorder={tableSortColumnReorder}
131
133
  ariaNotifyPlugin={ariaNotifyPlugin}
132
134
  api={api}
135
+ isCommentEditor={isCommentEditor || false}
133
136
  />
134
137
  </Popup>
135
138
  );
@@ -18,7 +18,7 @@ import type { TableDirection } from '../../types';
18
18
  import { TableCssClassName as ClassName } from '../../types';
19
19
  import { tableToolbarSize } from '../consts';
20
20
 
21
- export interface ButtonProps {
21
+ interface ButtonProps {
22
22
  type: TableDirection;
23
23
  tableRef: HTMLElement;
24
24
  onMouseDown: (event: SyntheticEvent<HTMLButtonElement>) => void;
@@ -96,7 +96,7 @@ const tooltipMessageByType = (type: TableDirection) => {
96
96
  return type === 'row' ? messages.insertRow : messages.insertColumn;
97
97
  };
98
98
 
99
- export const InsertButtonForDragAndDrop = ({
99
+ const InsertButtonForDragAndDrop = ({
100
100
  onMouseDown,
101
101
  tableRef,
102
102
  type,
@@ -55,6 +55,7 @@ export interface Props {
55
55
  editorAnalyticsAPI?: EditorAnalyticsAPI;
56
56
  getEditorFeatureFlags?: GetEditorFeatureFlags;
57
57
  isChromelessEditor?: boolean;
58
+ isCommentEditor?: boolean;
58
59
  }
59
60
 
60
61
  export class FloatingInsertButton extends React.Component<Props & WrappedComponentProps, any> {
@@ -267,6 +268,7 @@ export class FloatingInsertButton extends React.Component<Props & WrappedCompone
267
268
  editorAnalyticsAPI,
268
269
  getEditorFeatureFlags,
269
270
  isTableScalingEnabled,
271
+ isCommentEditor,
270
272
  } = this.props;
271
273
 
272
274
  if (typeof insertColumnButtonIndex !== 'undefined') {
@@ -288,6 +290,7 @@ export class FloatingInsertButton extends React.Component<Props & WrappedCompone
288
290
  tableDuplicateCellColouring,
289
291
  tableWithFixedColumnWidthsOption,
290
292
  shouldUseIncreasedScalingPercent,
293
+ isCommentEditor,
291
294
  )(INPUT_METHOD.BUTTON, insertColumnButtonIndex)(state, dispatch, editorView);
292
295
  }
293
296
  }
@@ -2,7 +2,7 @@ import React from 'react';
2
2
 
3
3
  import { Popup } from '@atlaskit/editor-common/ui';
4
4
 
5
- export interface Props {
5
+ interface Props {
6
6
  target: HTMLElement;
7
7
  content: React.ReactNode;
8
8
  alignX?: 'left' | 'center' | 'right';
@@ -27,7 +27,7 @@ import { getRowsParams, getSelectedColumnIndexes } from '../../../utils';
27
27
  import type { DragHandleAppearance } from '../../DragHandle';
28
28
  import { DragHandle } from '../../DragHandle';
29
29
 
30
- export interface ColumnControlsProps {
30
+ interface ColumnControlsProps {
31
31
  editorView: EditorView;
32
32
  tableActive?: boolean;
33
33
  isInDanger?: boolean;
@@ -339,5 +339,3 @@ export const ColumnControls = ({
339
339
  </div>
340
340
  );
341
341
  };
342
-
343
- export default ColumnControls;
@@ -9,7 +9,7 @@ import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element
9
9
  import { getDragBehaviour } from '../../../pm-plugins/drag-and-drop/utils/getDragBehaviour';
10
10
  import type { DraggableSourceData } from '../../../types';
11
11
 
12
- export interface Props {
12
+ interface Props {
13
13
  index: number;
14
14
  localId?: string;
15
15
  width?: number;
@@ -4,7 +4,7 @@ import { TableCssClassName as ClassName } from '../../../types';
4
4
 
5
5
  import { ColumnDropTarget } from './ColumnDropTarget';
6
6
 
7
- export interface Props {
7
+ interface Props {
8
8
  tableRef: HTMLTableElement;
9
9
  tableHeight?: number;
10
10
  localId?: string;
@@ -16,7 +16,7 @@ import { containsHeaderColumn, getColumnsWidths, getRowHeights } from '../../uti
16
16
  import { ColumnControls } from './ColumnControls';
17
17
  import { ColumnDropTargets } from './ColumnDropTargets';
18
18
 
19
- export interface Props {
19
+ interface Props {
20
20
  editorView: EditorView;
21
21
  getEditorFeatureFlags: GetEditorFeatureFlags;
22
22
  selection?: Selection;
@@ -40,7 +40,7 @@ export interface Props {
40
40
  isChromelessEditor?: boolean;
41
41
  }
42
42
 
43
- export const TableFloatingColumnControls = ({
43
+ const TableFloatingColumnControls = ({
44
44
  editorView,
45
45
  tableRef,
46
46
  getNode,
@@ -11,7 +11,7 @@ import { TableCssClassName as ClassName } from '../../../types';
11
11
  import { getRowHeights } from '../../../utils';
12
12
  import { tableBorderColor } from '../../consts';
13
13
 
14
- export interface Props {
14
+ interface Props {
15
15
  editorView: EditorView;
16
16
  tableRef: HTMLTableElement;
17
17
  tableActive?: boolean;
@@ -9,7 +9,7 @@ import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element
9
9
  import { getDragBehaviour } from '../../../pm-plugins/drag-and-drop/utils/getDragBehaviour';
10
10
  import type { DraggableSourceData } from '../../../types';
11
11
 
12
- export type RowDropTargetProps = {
12
+ type RowDropTargetProps = {
13
13
  index: number;
14
14
  localId?: string;
15
15
  style?: React.CSSProperties;
@@ -26,7 +26,7 @@ import { FloatingControlsWithSelection } from './FloatingControlsWithSelection';
26
26
  import NumberColumn from './NumberColumn';
27
27
  import { DragControls, RowControls } from './RowControls';
28
28
 
29
- export interface TableFloatingControlsProps {
29
+ interface TableFloatingControlsProps {
30
30
  editorView: EditorView;
31
31
  selection?: Selection;
32
32
  tableRef?: HTMLTableElement;
@@ -1,5 +1,4 @@
1
1
  export { DragHandleIcon } from './DragHandleIcon';
2
- export { DragInMotionIcon } from './DragInMotionIcon';
3
2
  export { DragHandleDisabledIcon } from './DragHandleDisabledIcon';
4
3
  export { MinimisedHandleIcon } from './MinimisedHandle';
5
4
  export { MergeCellsIcon } from './MergeCellsIcon';