@atlaskit/editor-plugin-table 23.4.2 → 24.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/cjs/nodeviews/TableCell.js +4 -27
  3. package/dist/cjs/nodeviews/TableComponent.js +1 -1
  4. package/dist/cjs/nodeviews/rounded-table-edges.js +168 -0
  5. package/dist/cjs/nodeviews/table.js +16 -67
  6. package/dist/cjs/pm-plugins/table-resizing/utils/dom.js +16 -1
  7. package/dist/cjs/ui/TableFloatingControls/index.js +1 -17
  8. package/dist/cjs/ui/common-styles.js +1 -1
  9. package/dist/es2019/nodeviews/TableCell.js +4 -27
  10. package/dist/es2019/nodeviews/TableComponent.js +2 -2
  11. package/dist/es2019/nodeviews/rounded-table-edges.js +150 -0
  12. package/dist/es2019/nodeviews/table.js +14 -61
  13. package/dist/es2019/pm-plugins/table-resizing/utils/dom.js +15 -0
  14. package/dist/es2019/ui/TableFloatingControls/index.js +1 -17
  15. package/dist/es2019/ui/common-styles.js +14 -0
  16. package/dist/esm/nodeviews/TableCell.js +4 -27
  17. package/dist/esm/nodeviews/TableComponent.js +2 -2
  18. package/dist/esm/nodeviews/rounded-table-edges.js +161 -0
  19. package/dist/esm/nodeviews/table.js +16 -67
  20. package/dist/esm/pm-plugins/table-resizing/utils/dom.js +15 -0
  21. package/dist/esm/ui/TableFloatingControls/index.js +1 -17
  22. package/dist/esm/ui/common-styles.js +1 -1
  23. package/dist/types/nodeviews/TableCell.d.ts +0 -5
  24. package/dist/types/nodeviews/rounded-table-edges.d.ts +26 -0
  25. package/dist/types/nodeviews/table.d.ts +1 -2
  26. package/dist/types/pm-plugins/table-resizing/utils/dom.d.ts +4 -0
  27. package/dist/types/ui/FloatingContextualButton/index.d.ts +0 -1
  28. package/dist/types/ui/TableFloatingControls/index.d.ts +1 -1
  29. package/package.json +38 -46
  30. package/table-plugin/package.json +1 -8
  31. package/table-plugin-type/package.json +1 -8
  32. package/types/package.json +1 -8
  33. package/ui/common-styles/package.json +1 -8
  34. package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +0 -125
  35. package/dist/cjs/ui/TableFloatingControls/FloatingControlsWithSelection.js +0 -52
  36. package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +0 -124
  37. package/dist/es2019/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +0 -110
  38. package/dist/es2019/ui/TableFloatingControls/FloatingControlsWithSelection.js +0 -47
  39. package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +0 -101
  40. package/dist/esm/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +0 -116
  41. package/dist/esm/ui/TableFloatingControls/FloatingControlsWithSelection.js +0 -45
  42. package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +0 -115
  43. package/dist/types/ui/TableFloatingControls/CornerControls/ClassicCornerControls.d.ts +0 -6
  44. package/dist/types/ui/TableFloatingControls/FloatingControlsWithSelection.d.ts +0 -20
  45. package/dist/types/ui/TableFloatingControls/RowControls/ClassicControls.d.ts +0 -19
  46. package/dist/types-ts4.5/entry-points/table-plugin-type.d.ts +0 -1
  47. package/dist/types-ts4.5/entry-points/table-plugin.d.ts +0 -6
  48. package/dist/types-ts4.5/entry-points/types.d.ts +0 -2
  49. package/dist/types-ts4.5/entry-points/ui-common-styles.d.ts +0 -1
  50. package/dist/types-ts4.5/index.d.ts +0 -7
  51. package/dist/types-ts4.5/nodeviews/ExternalDropTargets.d.ts +0 -9
  52. package/dist/types-ts4.5/nodeviews/OverflowShadowsObserver.d.ts +0 -26
  53. package/dist/types-ts4.5/nodeviews/TableCell.d.ts +0 -24
  54. package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +0 -48
  55. package/dist/types-ts4.5/nodeviews/TableComponentWithSharedState.d.ts +0 -30
  56. package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +0 -48
  57. package/dist/types-ts4.5/nodeviews/TableNodeViewBase.d.ts +0 -18
  58. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +0 -36
  59. package/dist/types-ts4.5/nodeviews/TableRow.d.ts +0 -68
  60. package/dist/types-ts4.5/nodeviews/TableRowNativeStickyWithFallback.d.ts +0 -89
  61. package/dist/types-ts4.5/nodeviews/TableStickyScrollbar.d.ts +0 -23
  62. package/dist/types-ts4.5/nodeviews/__mocks__/OverflowShadowsObserver.d.ts +0 -9
  63. package/dist/types-ts4.5/nodeviews/__mocks__/OverridableMock.d.ts +0 -9
  64. package/dist/types-ts4.5/nodeviews/table-container-styles.d.ts +0 -5
  65. package/dist/types-ts4.5/nodeviews/table-node-views.d.ts +0 -30
  66. package/dist/types-ts4.5/nodeviews/table.d.ts +0 -48
  67. package/dist/types-ts4.5/nodeviews/toDOM.d.ts +0 -17
  68. package/dist/types-ts4.5/nodeviews/types.d.ts +0 -33
  69. package/dist/types-ts4.5/nodeviews/update-overflow-shadows.d.ts +0 -1
  70. package/dist/types-ts4.5/pm-plugins/active-cell-highlight/plugin.d.ts +0 -11
  71. package/dist/types-ts4.5/pm-plugins/analytics/actions.d.ts +0 -18
  72. package/dist/types-ts4.5/pm-plugins/analytics/commands.d.ts +0 -6
  73. package/dist/types-ts4.5/pm-plugins/analytics/plugin-factory.d.ts +0 -8
  74. package/dist/types-ts4.5/pm-plugins/analytics/plugin-key.d.ts +0 -3
  75. package/dist/types-ts4.5/pm-plugins/analytics/plugin.d.ts +0 -5
  76. package/dist/types-ts4.5/pm-plugins/analytics/reducer.d.ts +0 -3
  77. package/dist/types-ts4.5/pm-plugins/analytics/types.d.ts +0 -11
  78. package/dist/types-ts4.5/pm-plugins/analytics/utils/moved-event.d.ts +0 -6
  79. package/dist/types-ts4.5/pm-plugins/commands/active-table-menu.d.ts +0 -6
  80. package/dist/types-ts4.5/pm-plugins/commands/clear.d.ts +0 -2
  81. package/dist/types-ts4.5/pm-plugins/commands/collapse.d.ts +0 -2
  82. package/dist/types-ts4.5/pm-plugins/commands/column-resize.d.ts +0 -34
  83. package/dist/types-ts4.5/pm-plugins/commands/commands-with-analytics.d.ts +0 -33
  84. package/dist/types-ts4.5/pm-plugins/commands/delete.d.ts +0 -4
  85. package/dist/types-ts4.5/pm-plugins/commands/display-mode.d.ts +0 -2
  86. package/dist/types-ts4.5/pm-plugins/commands/go-to-next-cell.d.ts +0 -11
  87. package/dist/types-ts4.5/pm-plugins/commands/hover.d.ts +0 -11
  88. package/dist/types-ts4.5/pm-plugins/commands/index.d.ts +0 -10
  89. package/dist/types-ts4.5/pm-plugins/commands/insert.d.ts +0 -54
  90. package/dist/types-ts4.5/pm-plugins/commands/misc.d.ts +0 -47
  91. package/dist/types-ts4.5/pm-plugins/commands/referentiality.d.ts +0 -3
  92. package/dist/types-ts4.5/pm-plugins/commands/selection.d.ts +0 -10
  93. package/dist/types-ts4.5/pm-plugins/commands/sort.d.ts +0 -3
  94. package/dist/types-ts4.5/pm-plugins/commands/split-cell.d.ts +0 -8
  95. package/dist/types-ts4.5/pm-plugins/commands/toggle.d.ts +0 -12
  96. package/dist/types-ts4.5/pm-plugins/create-plugin-config.d.ts +0 -2
  97. package/dist/types-ts4.5/pm-plugins/decorations/plugin.d.ts +0 -8
  98. package/dist/types-ts4.5/pm-plugins/decorations/utils/column-controls.d.ts +0 -4
  99. package/dist/types-ts4.5/pm-plugins/decorations/utils/column-resizing.d.ts +0 -5
  100. package/dist/types-ts4.5/pm-plugins/decorations/utils/compose-decorations.d.ts +0 -2
  101. package/dist/types-ts4.5/pm-plugins/decorations/utils/types.d.ts +0 -7
  102. package/dist/types-ts4.5/pm-plugins/default-table-selection.d.ts +0 -16
  103. package/dist/types-ts4.5/pm-plugins/drag-and-drop/actions.d.ts +0 -28
  104. package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands-with-analytics.d.ts +0 -13
  105. package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands.d.ts +0 -10
  106. package/dist/types-ts4.5/pm-plugins/drag-and-drop/consts.d.ts +0 -6
  107. package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin-factory.d.ts +0 -8
  108. package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin-key.d.ts +0 -3
  109. package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin.d.ts +0 -7
  110. package/dist/types-ts4.5/pm-plugins/drag-and-drop/reducer.d.ts +0 -4
  111. package/dist/types-ts4.5/pm-plugins/drag-and-drop/types.d.ts +0 -14
  112. package/dist/types-ts4.5/pm-plugins/drag-and-drop/utils/autoscrollers.d.ts +0 -8
  113. package/dist/types-ts4.5/pm-plugins/drag-and-drop/utils/getDragBehaviour.d.ts +0 -3
  114. package/dist/types-ts4.5/pm-plugins/drag-and-drop/utils/monitor.d.ts +0 -3
  115. package/dist/types-ts4.5/pm-plugins/editor-content-area-height.d.ts +0 -12
  116. package/dist/types-ts4.5/pm-plugins/handlers.d.ts +0 -3
  117. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +0 -8
  118. package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -8
  119. package/dist/types-ts4.5/pm-plugins/plugin-factory.d.ts +0 -7
  120. package/dist/types-ts4.5/pm-plugins/plugin-key.d.ts +0 -3
  121. package/dist/types-ts4.5/pm-plugins/reducer.d.ts +0 -3
  122. package/dist/types-ts4.5/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +0 -13
  123. package/dist/types-ts4.5/pm-plugins/sticky-headers/commands.d.ts +0 -4
  124. package/dist/types-ts4.5/pm-plugins/sticky-headers/plugin-key.d.ts +0 -3
  125. package/dist/types-ts4.5/pm-plugins/sticky-headers/plugin-state.d.ts +0 -7
  126. package/dist/types-ts4.5/pm-plugins/sticky-headers/plugin.d.ts +0 -4
  127. package/dist/types-ts4.5/pm-plugins/sticky-headers/types.d.ts +0 -17
  128. package/dist/types-ts4.5/pm-plugins/sticky-headers/util.d.ts +0 -2
  129. package/dist/types-ts4.5/pm-plugins/table-analytics.d.ts +0 -11
  130. package/dist/types-ts4.5/pm-plugins/table-anchor-names/plugin.d.ts +0 -5
  131. package/dist/types-ts4.5/pm-plugins/table-local-id.d.ts +0 -10
  132. package/dist/types-ts4.5/pm-plugins/table-resizing/commands.d.ts +0 -20
  133. package/dist/types-ts4.5/pm-plugins/table-resizing/event-handlers.d.ts +0 -6
  134. package/dist/types-ts4.5/pm-plugins/table-resizing/plugin-factory.d.ts +0 -7
  135. package/dist/types-ts4.5/pm-plugins/table-resizing/plugin-key.d.ts +0 -3
  136. package/dist/types-ts4.5/pm-plugins/table-resizing/plugin.d.ts +0 -7
  137. package/dist/types-ts4.5/pm-plugins/table-resizing/reducer.d.ts +0 -3
  138. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/colgroup.d.ts +0 -26
  139. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/column-state.d.ts +0 -14
  140. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/consts.d.ts +0 -9
  141. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/content-width.d.ts +0 -4
  142. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/dom.d.ts +0 -11
  143. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/misc.d.ts +0 -69
  144. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-column.d.ts +0 -3
  145. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-logic.d.ts +0 -8
  146. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-state.d.ts +0 -28
  147. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +0 -20
  148. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/types.d.ts +0 -23
  149. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/unit-to-number.d.ts +0 -1
  150. package/dist/types-ts4.5/pm-plugins/table-selection-keymap.d.ts +0 -4
  151. package/dist/types-ts4.5/pm-plugins/table-size-selector.d.ts +0 -10
  152. package/dist/types-ts4.5/pm-plugins/table-width-in-comment-fix.d.ts +0 -9
  153. package/dist/types-ts4.5/pm-plugins/table-width.d.ts +0 -17
  154. package/dist/types-ts4.5/pm-plugins/transforms/column-width.d.ts +0 -25
  155. package/dist/types-ts4.5/pm-plugins/transforms/content-mode.d.ts +0 -9
  156. package/dist/types-ts4.5/pm-plugins/transforms/delete-columns.d.ts +0 -5
  157. package/dist/types-ts4.5/pm-plugins/transforms/delete-rows.d.ts +0 -3
  158. package/dist/types-ts4.5/pm-plugins/transforms/fix-tables.d.ts +0 -9
  159. package/dist/types-ts4.5/pm-plugins/transforms/merge.d.ts +0 -7
  160. package/dist/types-ts4.5/pm-plugins/transforms/replace-table.d.ts +0 -4
  161. package/dist/types-ts4.5/pm-plugins/transforms/split.d.ts +0 -9
  162. package/dist/types-ts4.5/pm-plugins/transforms/table-transform-utils.d.ts +0 -11
  163. package/dist/types-ts4.5/pm-plugins/utils/alignment.d.ts +0 -14
  164. package/dist/types-ts4.5/pm-plugins/utils/analytics.d.ts +0 -49
  165. package/dist/types-ts4.5/pm-plugins/utils/collapse.d.ts +0 -31
  166. package/dist/types-ts4.5/pm-plugins/utils/column-controls.d.ts +0 -11
  167. package/dist/types-ts4.5/pm-plugins/utils/create.d.ts +0 -15
  168. package/dist/types-ts4.5/pm-plugins/utils/decoration.d.ts +0 -19
  169. package/dist/types-ts4.5/pm-plugins/utils/dom.d.ts +0 -42
  170. package/dist/types-ts4.5/pm-plugins/utils/drag-menu.d.ts +0 -19
  171. package/dist/types-ts4.5/pm-plugins/utils/get-allow-add-column-custom-step.d.ts +0 -2
  172. package/dist/types-ts4.5/pm-plugins/utils/guidelines.d.ts +0 -5
  173. package/dist/types-ts4.5/pm-plugins/utils/merged-cells.d.ts +0 -25
  174. package/dist/types-ts4.5/pm-plugins/utils/nodes.d.ts +0 -30
  175. package/dist/types-ts4.5/pm-plugins/utils/paste.d.ts +0 -16
  176. package/dist/types-ts4.5/pm-plugins/utils/row-controls.d.ts +0 -15
  177. package/dist/types-ts4.5/pm-plugins/utils/selection.d.ts +0 -3
  178. package/dist/types-ts4.5/pm-plugins/utils/snapping.d.ts +0 -17
  179. package/dist/types-ts4.5/pm-plugins/utils/sticky-header.d.ts +0 -3
  180. package/dist/types-ts4.5/pm-plugins/utils/table.d.ts +0 -5
  181. package/dist/types-ts4.5/pm-plugins/utils/tableMode/apply-measured-width-to-all-tables.d.ts +0 -8
  182. package/dist/types-ts4.5/pm-plugins/utils/tableMode/apply-measured-width-to-selected-table.d.ts +0 -6
  183. package/dist/types-ts4.5/pm-plugins/utils/tableMode/is-content-mode-supported.d.ts +0 -7
  184. package/dist/types-ts4.5/pm-plugins/utils/tableMode/measure-table-with-auto-layout.d.ts +0 -2
  185. package/dist/types-ts4.5/pm-plugins/utils/tableMode/smart-adjust/constants.d.ts +0 -4
  186. package/dist/types-ts4.5/pm-plugins/utils/tableMode/smart-adjust/distribute-column-widths.d.ts +0 -8
  187. package/dist/types-ts4.5/pm-plugins/utils/tableMode/smart-adjust/run-smart-adjust.d.ts +0 -7
  188. package/dist/types-ts4.5/pm-plugins/utils/update-plugin-state-decorations.d.ts +0 -4
  189. package/dist/types-ts4.5/pm-plugins/view-mode-sort/consts.d.ts +0 -3
  190. package/dist/types-ts4.5/pm-plugins/view-mode-sort/index.d.ts +0 -21
  191. package/dist/types-ts4.5/pm-plugins/view-mode-sort/plugin-key.d.ts +0 -3
  192. package/dist/types-ts4.5/pm-plugins/view-mode-sort/types.d.ts +0 -22
  193. package/dist/types-ts4.5/pm-plugins/view-mode-sort/utils.d.ts +0 -11
  194. package/dist/types-ts4.5/tablePlugin.d.ts +0 -7
  195. package/dist/types-ts4.5/tablePluginType.d.ts +0 -81
  196. package/dist/types-ts4.5/types/index.d.ts +0 -544
  197. package/dist/types-ts4.5/ui/ColumnResizeWidget/index.d.ts +0 -12
  198. package/dist/types-ts4.5/ui/ContentComponent.d.ts +0 -18
  199. package/dist/types-ts4.5/ui/DragHandle/HandleIconComponent.d.ts +0 -8
  200. package/dist/types-ts4.5/ui/DragHandle/index.d.ts +0 -29
  201. package/dist/types-ts4.5/ui/DragPreview/index.d.ts +0 -7
  202. package/dist/types-ts4.5/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.d.ts +0 -13
  203. package/dist/types-ts4.5/ui/FloatingContextualButton/FixedButton.d.ts +0 -22
  204. package/dist/types-ts4.5/ui/FloatingContextualButton/index.d.ts +0 -22
  205. package/dist/types-ts4.5/ui/FloatingContextualButton/styles.d.ts +0 -3
  206. package/dist/types-ts4.5/ui/FloatingContextualMenu/CellMenuPopup.d.ts +0 -14
  207. package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +0 -63
  208. package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +0 -24
  209. package/dist/types-ts4.5/ui/FloatingContextualMenu/styles.d.ts +0 -3
  210. package/dist/types-ts4.5/ui/FloatingDeleteButton/DeleteButton.d.ts +0 -14
  211. package/dist/types-ts4.5/ui/FloatingDeleteButton/getPopUpOptions.d.ts +0 -10
  212. package/dist/types-ts4.5/ui/FloatingDeleteButton/index.d.ts +0 -55
  213. package/dist/types-ts4.5/ui/FloatingDeleteButton/types.d.ts +0 -2
  214. package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +0 -41
  215. package/dist/types-ts4.5/ui/FloatingDragMenu/DropdownMenu.d.ts +0 -36
  216. package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +0 -36
  217. package/dist/types-ts4.5/ui/FloatingDragMenu/styles.d.ts +0 -4
  218. package/dist/types-ts4.5/ui/FloatingInsertButton/InsertButton.d.ts +0 -18
  219. package/dist/types-ts4.5/ui/FloatingInsertButton/getPopupOptions.d.ts +0 -4
  220. package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +0 -40
  221. package/dist/types-ts4.5/ui/FloatingTableMenu/index.d.ts +0 -23
  222. package/dist/types-ts4.5/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +0 -16
  223. package/dist/types-ts4.5/ui/SizeSelector/index.d.ts +0 -9
  224. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +0 -24
  225. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +0 -10
  226. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +0 -11
  227. package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +0 -33
  228. package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/ClassicCornerControls.d.ts +0 -6
  229. package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +0 -15
  230. package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/types.d.ts +0 -11
  231. package/dist/types-ts4.5/ui/TableFloatingControls/FloatingControlsWithSelection.d.ts +0 -20
  232. package/dist/types-ts4.5/ui/TableFloatingControls/NumberColumn/index.d.ts +0 -22
  233. package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/ClassicControls.d.ts +0 -19
  234. package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/DragControls.d.ts +0 -25
  235. package/dist/types-ts4.5/ui/TableFloatingControls/RowDropTarget/index.d.ts +0 -8
  236. package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +0 -37
  237. package/dist/types-ts4.5/ui/TableFullWidthLabel/index.d.ts +0 -2
  238. package/dist/types-ts4.5/ui/TableMenu/cell/getCellMenuComponents.d.ts +0 -3
  239. package/dist/types-ts4.5/ui/TableMenu/cell/items/MergeCellsItem.d.ts +0 -3
  240. package/dist/types-ts4.5/ui/TableMenu/cell/items/SplitCellItem.d.ts +0 -3
  241. package/dist/types-ts4.5/ui/TableMenu/cell/items/VerticalAlignDropdownItem.d.ts +0 -12
  242. package/dist/types-ts4.5/ui/TableMenu/cell/items/VerticalAlignNestedMenu.d.ts +0 -4
  243. package/dist/types-ts4.5/ui/TableMenu/cell/items/verticalAlignUtils.d.ts +0 -3
  244. package/dist/types-ts4.5/ui/TableMenu/cell/keys.d.ts +0 -16
  245. package/dist/types-ts4.5/ui/TableMenu/column/getColumnMenuComponents.d.ts +0 -3
  246. package/dist/types-ts4.5/ui/TableMenu/column/items/AddColumnLeftItem.d.ts +0 -3
  247. package/dist/types-ts4.5/ui/TableMenu/column/items/AddColumnRightItem.d.ts +0 -3
  248. package/dist/types-ts4.5/ui/TableMenu/column/items/ColumnBackgroundSection.d.ts +0 -11
  249. package/dist/types-ts4.5/ui/TableMenu/column/items/ColumnToggleSection.d.ts +0 -10
  250. package/dist/types-ts4.5/ui/TableMenu/column/items/DeleteColumnItem.d.ts +0 -3
  251. package/dist/types-ts4.5/ui/TableMenu/column/items/DistributeColumnsItem.d.ts +0 -3
  252. package/dist/types-ts4.5/ui/TableMenu/column/items/HeaderColumnToggleItem.d.ts +0 -16
  253. package/dist/types-ts4.5/ui/TableMenu/column/items/MoveColumnLeftItem.d.ts +0 -3
  254. package/dist/types-ts4.5/ui/TableMenu/column/items/MoveColumnRightItem.d.ts +0 -3
  255. package/dist/types-ts4.5/ui/TableMenu/column/items/SortDecreasingItem.d.ts +0 -3
  256. package/dist/types-ts4.5/ui/TableMenu/column/items/SortIncreasingItem.d.ts +0 -3
  257. package/dist/types-ts4.5/ui/TableMenu/column/keys.d.ts +0 -22
  258. package/dist/types-ts4.5/ui/TableMenu/row/getRowMenuComponents.d.ts +0 -3
  259. package/dist/types-ts4.5/ui/TableMenu/row/items/AddRowAboveItem.d.ts +0 -3
  260. package/dist/types-ts4.5/ui/TableMenu/row/items/AddRowBelowItem.d.ts +0 -3
  261. package/dist/types-ts4.5/ui/TableMenu/row/items/DeleteRowItem.d.ts +0 -3
  262. package/dist/types-ts4.5/ui/TableMenu/row/items/HeaderRowToggleItem.d.ts +0 -3
  263. package/dist/types-ts4.5/ui/TableMenu/row/items/MoveRowDownItem.d.ts +0 -3
  264. package/dist/types-ts4.5/ui/TableMenu/row/items/MoveRowUpItem.d.ts +0 -3
  265. package/dist/types-ts4.5/ui/TableMenu/row/items/NumberedRowsToggleItem.d.ts +0 -3
  266. package/dist/types-ts4.5/ui/TableMenu/row/keys.d.ts +0 -18
  267. package/dist/types-ts4.5/ui/TableMenu/shared/TableMenu.d.ts +0 -11
  268. package/dist/types-ts4.5/ui/TableMenu/shared/TableMenuContext.d.ts +0 -16
  269. package/dist/types-ts4.5/ui/TableMenu/shared/consts.d.ts +0 -4
  270. package/dist/types-ts4.5/ui/TableMenu/shared/getSharedItems.d.ts +0 -3
  271. package/dist/types-ts4.5/ui/TableMenu/shared/getTableMenuComponents.d.ts +0 -3
  272. package/dist/types-ts4.5/ui/TableMenu/shared/items/BackgroundColorItem.d.ts +0 -7
  273. package/dist/types-ts4.5/ui/TableMenu/shared/items/ClearCellsItem.d.ts +0 -3
  274. package/dist/types-ts4.5/ui/TableMenu/shared/keys.d.ts +0 -3
  275. package/dist/types-ts4.5/ui/TableMenu/shared/types.d.ts +0 -4
  276. package/dist/types-ts4.5/ui/common-styles.d.ts +0 -14
  277. package/dist/types-ts4.5/ui/consts.d.ts +0 -69
  278. package/dist/types-ts4.5/ui/event-handlers.d.ts +0 -20
  279. package/dist/types-ts4.5/ui/global-styles.d.ts +0 -11
  280. package/dist/types-ts4.5/ui/hooks/useInternalTablePluginStateSelector.d.ts +0 -22
  281. package/dist/types-ts4.5/ui/icons/AddColLeftIcon.d.ts +0 -2
  282. package/dist/types-ts4.5/ui/icons/AddColRightIcon.d.ts +0 -2
  283. package/dist/types-ts4.5/ui/icons/AddRowAboveIcon.d.ts +0 -2
  284. package/dist/types-ts4.5/ui/icons/AddRowBelowIcon.d.ts +0 -2
  285. package/dist/types-ts4.5/ui/icons/DragHandleDisabledIcon.d.ts +0 -6
  286. package/dist/types-ts4.5/ui/icons/DragHandleIcon.d.ts +0 -2
  287. package/dist/types-ts4.5/ui/icons/DragInMotionIcon.d.ts +0 -6
  288. package/dist/types-ts4.5/ui/icons/MergeCellsIcon.d.ts +0 -2
  289. package/dist/types-ts4.5/ui/icons/MinimisedHandle.d.ts +0 -2
  290. package/dist/types-ts4.5/ui/icons/SortingIconWrapper.d.ts +0 -10
  291. package/dist/types-ts4.5/ui/icons/SplitCellIcon.d.ts +0 -2
  292. package/dist/types-ts4.5/ui/rounded-table-styles.d.ts +0 -2
  293. package/dist/types-ts4.5/ui/toolbar.d.ts +0 -11
  294. package/dist/types-ts4.5/ui/ui-styles.d.ts +0 -21
@@ -14,7 +14,6 @@ import { hoverCell, hoverRows, selectRow, selectRows } from '../../pm-plugins/co
14
14
  import { isTableNested } from '../../pm-plugins/utils/nodes';
15
15
  import { TableCssClassName as ClassName } from '../../types';
16
16
  import { DragCornerControlsWithSelection } from './CornerControls/DragCornerControls';
17
- import { FloatingControlsWithSelection } from './FloatingControlsWithSelection';
18
17
  import NumberColumn from './NumberColumn';
19
18
  import { DragControlsWithSelection } from './RowControls/DragControls';
20
19
  const styles = css({
@@ -32,8 +31,6 @@ export const TableFloatingControls = ({
32
31
  isInDanger,
33
32
  isResizing,
34
33
  isNumberColumnEnabled,
35
- isHeaderRowEnabled,
36
- isHeaderColumnEnabled,
37
34
  isDragAndDropEnabled,
38
35
  tableActive,
39
36
  hasHeaderRow,
@@ -124,7 +121,7 @@ export const TableFloatingControls = ({
124
121
  updateCellHoverLocation: updateCellHoverLocation,
125
122
  stickyTop: stickyTop,
126
123
  isDragAndDropEnabled: isDragAndDropEnabled
127
- }) : null, tableActive && jsx(Fragment, null, isDragAndDropEnabled ? jsx(Fragment, null, shouldShowCornerControls && jsx(DragCornerControlsWithSelection, {
124
+ }) : null, tableActive && jsx(Fragment, null, shouldShowCornerControls && jsx(DragCornerControlsWithSelection, {
128
125
  editorView: editorView,
129
126
  tableRef: tableRef,
130
127
  isInDanger: isInDanger,
@@ -148,19 +145,6 @@ export const TableFloatingControls = ({
148
145
  selectRows: _selectRows,
149
146
  updateCellHoverLocation: updateCellHoverLocation,
150
147
  api: api
151
- })) : jsx(FloatingControlsWithSelection, {
152
- editorView: editorView,
153
- tableRef: tableRef,
154
- isInDanger: isInDanger,
155
- isResizing: isResizing,
156
- isHeaderRowEnabled: isHeaderRowEnabled,
157
- isHeaderColumnEnabled: isHeaderColumnEnabled,
158
- hoveredRows: hoveredRows,
159
- stickyTop: tableActive ? stickyTop : undefined,
160
- tableActive: tableActive,
161
- hoverRows: _hoverRows,
162
- selectRow: _selectRow,
163
- api: api
164
148
  }))));
165
149
  };
166
150
  export default TableFloatingControls;
@@ -304,6 +304,20 @@ const baseTableStylesWithoutSharedStyle = props => css`
304
304
  box-shadow: 0px -${stickyRowOffsetTop}px
305
305
  ${expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? `var(${akEditorTableContainerBg}, ${"var(--ds-surface, #FFFFFF)"})` : "var(--ds-surface, #FFFFFF)"};
306
306
  border-right: 0 none;
307
+ ${expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? `
308
+ width: ${akEditorTableNumberColumnWidth + 1}px;
309
+ border-left: 1px solid ${tableBorderColor};
310
+
311
+ /* Keep the new fixed left border in sync with the selected/danger states,
312
+ which would otherwise leave it the default colour (.active recolours the
313
+ rest of the border) or drop it entirely (delete-hover sets border-left: 0). */
314
+ &.active {
315
+ border-left-color: ${tableBorderSelectedColor};
316
+ }
317
+ &.${ClassName.HOVERED_CELL_IN_DANGER} {
318
+ border-left: 1px solid ${tableBorderDeleteColor};
319
+ }
320
+ ` : ''}
307
321
  /* top set by NumberColumn component */
308
322
  }
309
323
 
@@ -51,11 +51,6 @@ var TableCell = /*#__PURE__*/function (_TableNodeView) {
51
51
  var _this;
52
52
  _classCallCheck(this, TableCell);
53
53
  _this = _callSuper(this, TableCell, [node, view, getPos, eventDispatcher]);
54
- /** Cached edge state to avoid redundant DOM writes. */
55
- _defineProperty(_this, "prevReachesTop", false);
56
- _defineProperty(_this, "prevReachesBottom", false);
57
- _defineProperty(_this, "prevReachesLeft", false);
58
- _defineProperty(_this, "prevReachesRight", false);
59
54
  _defineProperty(_this, "destroy", function () {
60
55
  if (_this.delayHandle && typeof window !== 'undefined') {
61
56
  var _window, _window$cancelIdleCal, _window2, _window2$cancelAnimat;
@@ -137,28 +132,10 @@ var TableCell = /*#__PURE__*/function (_TableNodeView) {
137
132
  var tableMap = TableMap.get(tableNode);
138
133
  var cellStartInTable = pos - resolvedPos.start(tableDepth);
139
134
  var cellRect = tableMap.findCell(cellStartInTable);
140
- var reachesTop = cellRect.top === 0;
141
- var reachesBottom = cellRect.bottom >= tableMap.height;
142
- var reachesLeft = cellRect.left === 0;
143
- var reachesRight = cellRect.right >= tableMap.width;
144
-
145
- // Only touch DOM attributes that actually changed
146
- if (reachesTop !== this.prevReachesTop) {
147
- this.prevReachesTop = reachesTop;
148
- this.setDataAttr('data-reaches-top', reachesTop);
149
- }
150
- if (reachesBottom !== this.prevReachesBottom) {
151
- this.prevReachesBottom = reachesBottom;
152
- this.setDataAttr('data-reaches-bottom', reachesBottom);
153
- }
154
- if (reachesLeft !== this.prevReachesLeft) {
155
- this.prevReachesLeft = reachesLeft;
156
- this.setDataAttr('data-reaches-left', reachesLeft);
157
- }
158
- if (reachesRight !== this.prevReachesRight) {
159
- this.prevReachesRight = reachesRight;
160
- this.setDataAttr('data-reaches-right', reachesRight);
161
- }
135
+ this.setDataAttr('data-reaches-top', cellRect.top === 0);
136
+ this.setDataAttr('data-reaches-bottom', cellRect.bottom >= tableMap.height);
137
+ this.setDataAttr('data-reaches-left', cellRect.left === 0);
138
+ this.setDataAttr('data-reaches-right', cellRect.right >= tableMap.width);
162
139
  } catch (_unused) {
163
140
  // Position may be stale during document mutations; silently ignore.
164
141
  }
@@ -35,7 +35,7 @@ import { pluginKey as stickyHeadersPluginKey } from '../pm-plugins/sticky-header
35
35
  import { findStickyHeaderForTable } from '../pm-plugins/sticky-headers/util';
36
36
  import { hasTableBeenResized, insertColgroupFromNode } from '../pm-plugins/table-resizing/utils/colgroup';
37
37
  import { COLUMN_MIN_WIDTH, TABLE_EDITOR_MARGIN, TABLE_OFFSET_IN_COMMENT_EDITOR } from '../pm-plugins/table-resizing/utils/consts';
38
- import { syncStickyRowToTable, updateControls } from '../pm-plugins/table-resizing/utils/dom';
38
+ import { syncStickyCornerMasks, updateControls } from '../pm-plugins/table-resizing/utils/dom';
39
39
  import { getLayoutSize, getScalingPercentForTableWithoutWidth, getTableScalingPercent } from '../pm-plugins/table-resizing/utils/misc';
40
40
  import { getResizeState, updateColgroup } from '../pm-plugins/table-resizing/utils/resize-state';
41
41
  import { scaleTable } from '../pm-plugins/table-resizing/utils/scale-table';
@@ -135,7 +135,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
135
135
  header.style.marginRight = '2px';
136
136
  }
137
137
  if (expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true)) {
138
- syncStickyRowToTable(_this.table);
138
+ syncStickyCornerMasks(_this.table);
139
139
  }
140
140
  }
141
141
 
@@ -0,0 +1,161 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import { TableMap } from '@atlaskit/editor-tables/table-map';
4
+ var setDataAttr = function setDataAttr(cell, attr, value) {
5
+ var hasAttr = cell.hasAttribute(attr);
6
+ if (value && !hasAttr) {
7
+ cell.setAttribute(attr, 'true');
8
+ } else if (!value && hasAttr) {
9
+ cell.removeAttribute(attr);
10
+ }
11
+ };
12
+
13
+ /**
14
+ * Refreshes the `data-reaches-{top,bottom,left,right}` attributes used by CSS to round
15
+ * the table's corner cells (including merged cells that span to an edge).
16
+ *
17
+ * Edge membership is derived directly from the table map's border rows/columns: a cell
18
+ * reaches an edge iff its offset appears in the corresponding border slice (this naturally
19
+ * accounts for rowspan/colspan cells, whose offset is repeated across every grid slot they
20
+ * cover). This is O(cells) overall, versus O(cells^2) when calling findCell per cell.
21
+ */
22
+ var refreshRoundedTableEdgeAttrs = function refreshRoundedTableEdgeAttrs(table, tableNode) {
23
+ try {
24
+ var tableMap = TableMap.get(tableNode);
25
+ var width = tableMap.width,
26
+ height = tableMap.height,
27
+ map = tableMap.map;
28
+ var cells = Array.from(table.rows).flatMap(function (row) {
29
+ return Array.from(row.cells);
30
+ });
31
+ var cellOffsets = Array.from(new Set(map));
32
+ var topOffsets = new Set();
33
+ var bottomOffsets = new Set();
34
+ var leftOffsets = new Set();
35
+ var rightOffsets = new Set();
36
+ for (var col = 0; col < width; col++) {
37
+ topOffsets.add(map[col]);
38
+ bottomOffsets.add(map[(height - 1) * width + col]);
39
+ }
40
+ for (var row = 0; row < height; row++) {
41
+ leftOffsets.add(map[row * width]);
42
+ rightOffsets.add(map[row * width + width - 1]);
43
+ }
44
+ cellOffsets.forEach(function (cellOffset, cellIndex) {
45
+ var cell = cells[cellIndex];
46
+ if (!cell) {
47
+ return;
48
+ }
49
+ setDataAttr(cell, 'data-reaches-top', topOffsets.has(cellOffset));
50
+ setDataAttr(cell, 'data-reaches-bottom', bottomOffsets.has(cellOffset));
51
+ setDataAttr(cell, 'data-reaches-left', leftOffsets.has(cellOffset));
52
+ setDataAttr(cell, 'data-reaches-right', rightOffsets.has(cellOffset));
53
+ });
54
+ } catch (_unused) {
55
+ // Table structure can be transient while ProseMirror normalises transactions.
56
+ // Keep existing edge attrs if the current shape cannot be mapped safely.
57
+ }
58
+ };
59
+
60
+ /**
61
+ * Builds a lightweight signature of the cells sitting on the table's four borders, using
62
+ * their (immutable) ProseMirror node references. The signature changes whenever a border
63
+ * cell is added, removed, merged, or moved (row/column reorder via drag-and-drop) but stays
64
+ * stable across pure text edits in non-edge cells. This lets the controller decide cheaply
65
+ * (O(rows + cols)) whether the rounded-edge attrs need a full refresh, instead of only
66
+ * reacting to width/height changes.
67
+ */
68
+ var getTableEdgeSignature = function getTableEdgeSignature(tableNode) {
69
+ var edgeCells = [];
70
+ var lastRowIndex = tableNode.childCount - 1;
71
+ tableNode.forEach(function (row, _rowOffset, rowIndex) {
72
+ var isEdgeRow = rowIndex === 0 || rowIndex === lastRowIndex;
73
+ var lastCellIndex = row.childCount - 1;
74
+ row.forEach(function (cell, _cellOffset, cellIndex) {
75
+ if (isEdgeRow || cellIndex === 0 || cellIndex === lastCellIndex) {
76
+ edgeCells.push(cell);
77
+ }
78
+ });
79
+ });
80
+ return edgeCells;
81
+ };
82
+ var tableEdgeSignaturesDiffer = function tableEdgeSignaturesDiffer(prev, next) {
83
+ if (!prev || prev.length !== next.length) {
84
+ return true;
85
+ }
86
+ for (var i = 0; i < prev.length; i++) {
87
+ if (prev[i] !== next[i]) {
88
+ return true;
89
+ }
90
+ }
91
+ return false;
92
+ };
93
+
94
+ /**
95
+ * Keeps a table's rounded-corner edge attributes in sync as its shape changes.
96
+ *
97
+ * Each TableCell node view refreshes its own edge attrs when its cell attrs change. However,
98
+ * when the table's shape changes (e.g. a new row is inserted below the last row) or cells are
99
+ * reordered (e.g. dragging a row/column to a new position), ProseMirror may reuse the existing
100
+ * neighbouring cells as-is, so those cells never get a chance to update their edge attrs on
101
+ * their own. This controller covers those cases from the table node view.
102
+ *
103
+ * Callers are responsible for feature-gating each call site.
104
+ */
105
+ export var RoundedTableEdges = /*#__PURE__*/function () {
106
+ // References to the previous render's border cells (O(rows + cols), perimeter-sized, not all cells).
107
+
108
+ function RoundedTableEdges(getTableElement, node) {
109
+ _classCallCheck(this, RoundedTableEdges);
110
+ this.getTableElement = getTableElement;
111
+
112
+ // Baseline the edge signature so the first content edit doesn't trigger a spurious
113
+ // refresh — the cells set their own edge attrs on construction.
114
+ this.prevSignature = getTableEdgeSignature(node);
115
+ }
116
+
117
+ /**
118
+ * Call from the node view's `update()` after `super.update()`. When the border signature
119
+ * changes it schedules a refresh of the edge attrs on the next animation frame.
120
+ */
121
+ return _createClass(RoundedTableEdges, [{
122
+ key: "handleUpdate",
123
+ value: function handleUpdate(node) {
124
+ var nextSignature = getTableEdgeSignature(node);
125
+ var edgesChanged = tableEdgeSignaturesDiffer(this.prevSignature, nextSignature);
126
+ this.prevSignature = nextSignature;
127
+ if (edgesChanged) {
128
+ this.scheduleRefresh(node);
129
+ }
130
+ }
131
+
132
+ /** Call from the node view's `destroy()` to cancel any pending refresh. */
133
+ }, {
134
+ key: "destroy",
135
+ value: function destroy() {
136
+ if (this.refreshHandle !== undefined) {
137
+ cancelAnimationFrame(this.refreshHandle);
138
+ this.refreshHandle = undefined;
139
+ }
140
+ }
141
+
142
+ // The refresh runs on the next animation frame because ReactNodeView.update() schedules the
143
+ // table's React render via the portal provider. If we read `table.rows` synchronously, we'd
144
+ // still see the previous DOM.
145
+ }, {
146
+ key: "scheduleRefresh",
147
+ value: function scheduleRefresh(node) {
148
+ var _this = this;
149
+ if (this.refreshHandle !== undefined) {
150
+ cancelAnimationFrame(this.refreshHandle);
151
+ }
152
+ this.refreshHandle = requestAnimationFrame(function () {
153
+ _this.refreshHandle = undefined;
154
+ var table = _this.getTableElement();
155
+ if (table instanceof HTMLTableElement) {
156
+ refreshRoundedTableEdgeAttrs(table, node);
157
+ }
158
+ });
159
+ }
160
+ }]);
161
+ }();
@@ -25,6 +25,7 @@ import { getPluginState } from '../pm-plugins/plugin-factory';
25
25
  import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
26
26
  import { isTableNested, tablesHaveDifferentColumnWidths } from '../pm-plugins/utils/nodes';
27
27
  import { isContentModeSupported } from '../pm-plugins/utils/tableMode/is-content-mode-supported';
28
+ import { RoundedTableEdges } from './rounded-table-edges';
28
29
  import { TableComponentWithSharedState } from './TableComponentWithSharedState';
29
30
  import { tableNodeSpecWithFixedToDOM } from './toDOM';
30
31
  var tableAttributes = function tableAttributes(node) {
@@ -58,37 +59,6 @@ var handleInlineTableWidth = function handleInlineTableWidth(table, width) {
58
59
  }
59
60
  table.style.setProperty('width', "".concat(width, "px"));
60
61
  };
61
- var setDataAttr = function setDataAttr(cell, attr, value) {
62
- var hasAttr = cell.hasAttribute(attr);
63
- if (value && !hasAttr) {
64
- cell.setAttribute(attr, 'true');
65
- } else if (!value && hasAttr) {
66
- cell.removeAttribute(attr);
67
- }
68
- };
69
- var refreshRoundedTableEdgeAttrs = function refreshRoundedTableEdgeAttrs(table, tableNode) {
70
- try {
71
- var tableMap = TableMap.get(tableNode);
72
- var cells = Array.from(table.rows).flatMap(function (row) {
73
- return Array.from(row.cells);
74
- });
75
- var cellOffsets = Array.from(new Set(tableMap.map));
76
- cellOffsets.forEach(function (cellOffset, cellIndex) {
77
- var cell = cells[cellIndex];
78
- if (!cell) {
79
- return;
80
- }
81
- var cellRect = tableMap.findCell(cellOffset);
82
- setDataAttr(cell, 'data-reaches-top', cellRect.top === 0);
83
- setDataAttr(cell, 'data-reaches-bottom', cellRect.bottom >= tableMap.height);
84
- setDataAttr(cell, 'data-reaches-left', cellRect.left === 0);
85
- setDataAttr(cell, 'data-reaches-right', cellRect.right >= tableMap.width);
86
- });
87
- } catch (_unused) {
88
- // Table structure can be transient while ProseMirror normalises transactions.
89
- // Keep existing edge attrs if the current shape cannot be mapped safely.
90
- }
91
- };
92
62
  var TableView = /*#__PURE__*/function (_ReactNodeView) {
93
63
  function TableView(props) {
94
64
  var _this;
@@ -104,6 +74,11 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
104
74
  _this.eventDispatcher = props.eventDispatcher;
105
75
  _this.options = props.options;
106
76
  _this.getEditorFeatureFlags = props.getEditorFeatureFlags;
77
+ if (expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true)) {
78
+ _this.roundedTableEdges = new RoundedTableEdges(function () {
79
+ return _this.table;
80
+ }, props.node);
81
+ }
107
82
  _this.handleRef = function (node) {
108
83
  return _this._handleTableRef(node);
109
84
  };
@@ -273,43 +248,17 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
273
248
  }
274
249
  }
275
250
  }
276
- }, {
277
- key: "scheduleRoundedTableEdgeRefresh",
278
- value:
279
- // Each TableCell node view refreshes its own edge attrs when its cell attrs change.
280
- // However, when the table's shape changes (e.g. a new row is inserted below the
281
- // last row), ProseMirror may reuse the existing neighbouring cells as-is, so those
282
- // cells never get a chance to update their edge attrs on their own.
283
- //
284
- // To cover those cases, we refresh edge attrs from the table node view here.
285
- //
286
- // The refresh runs on the next animation frame because ReactNodeView.update()
287
- // schedules the table's React render via the portal provider. If we read
288
- // `this.table.rows` synchronously, we'd still see the previous DOM.
289
- function scheduleRoundedTableEdgeRefresh(node) {
290
- var _this4 = this;
291
- if (this.roundedTableEdgeRefreshHandle !== undefined) {
292
- cancelAnimationFrame(this.roundedTableEdgeRefreshHandle);
293
- }
294
- this.roundedTableEdgeRefreshHandle = requestAnimationFrame(function () {
295
- _this4.roundedTableEdgeRefreshHandle = undefined;
296
- if (_this4.table instanceof HTMLTableElement) {
297
- refreshRoundedTableEdgeAttrs(_this4.table, node);
298
- }
299
- });
300
- }
301
251
  }, {
302
252
  key: "update",
303
253
  value: function update(node, decorations, innerDecorations, validUpdate) {
304
- if (!expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true)) {
305
- return _superPropGet(TableView, "update", this, 3)([node, decorations, innerDecorations, validUpdate]);
306
- }
307
- var currentTableMap = TableMap.get(this.node);
308
- var nextTableMap = TableMap.get(node);
309
- var tableGeometryChanged = currentTableMap.width !== nextTableMap.width || currentTableMap.height !== nextTableMap.height;
310
254
  var didUpdate = _superPropGet(TableView, "update", this, 3)([node, decorations, innerDecorations, validUpdate]);
311
- if (didUpdate && tableGeometryChanged) {
312
- this.scheduleRoundedTableEdgeRefresh(node);
255
+
256
+ // Keep the rounded-corner edge attrs in sync with structural changes (rows/columns
257
+ // added, removed, merged, or reordered via drag-and-drop) that the cells themselves
258
+ // can miss.
259
+ if (didUpdate && expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true)) {
260
+ var _this$roundedTableEdg;
261
+ (_this$roundedTableEdg = this.roundedTableEdges) === null || _this$roundedTableEdg === void 0 || _this$roundedTableEdg.handleUpdate(node);
313
262
  }
314
263
  return didUpdate;
315
264
  }
@@ -390,9 +339,9 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
390
339
  key: "destroy",
391
340
  value: function destroy() {
392
341
  var _this$eventDispatcher;
393
- if (this.roundedTableEdgeRefreshHandle !== undefined) {
394
- cancelAnimationFrame(this.roundedTableEdgeRefreshHandle);
395
- this.roundedTableEdgeRefreshHandle = undefined;
342
+ if (expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true)) {
343
+ var _this$roundedTableEdg2;
344
+ (_this$roundedTableEdg2 = this.roundedTableEdges) === null || _this$roundedTableEdg2 === void 0 || _this$roundedTableEdg2.destroy();
396
345
  }
397
346
  if (this.resizeObserver) {
398
347
  this.resizeObserver.disconnect();
@@ -103,6 +103,21 @@ var applyTableWidthToStickyRow = function applyTableWidthToStickyRow(tableRef, h
103
103
  }
104
104
  }
105
105
  };
106
+
107
+ /**
108
+ * Repositions only the sticky-header corner masks to match the current scroll position.
109
+ */
110
+ export var syncStickyCornerMasks = function syncStickyCornerMasks(tableRef) {
111
+ if (!tableRef) {
112
+ return;
113
+ }
114
+ var headerRow = tableRef.querySelector('tr[data-header-row]');
115
+ var wrapper = tableRef.parentElement;
116
+ if (!headerRow || !wrapper) {
117
+ return;
118
+ }
119
+ syncCornerMasksToStickyRow(tableRef, headerRow, wrapper);
120
+ };
106
121
  export var clearStickyCornerMaskPositions = function clearStickyCornerMaskPositions(tableRef) {
107
122
  var wrapper = tableRef === null || tableRef === void 0 ? void 0 : tableRef.parentElement;
108
123
  if (!wrapper) {
@@ -14,7 +14,6 @@ import { hoverCell, hoverRows, selectRow, selectRows } from '../../pm-plugins/co
14
14
  import { isTableNested } from '../../pm-plugins/utils/nodes';
15
15
  import { TableCssClassName as ClassName } from '../../types';
16
16
  import { DragCornerControlsWithSelection } from './CornerControls/DragCornerControls';
17
- import { FloatingControlsWithSelection } from './FloatingControlsWithSelection';
18
17
  import NumberColumn from './NumberColumn';
19
18
  import { DragControlsWithSelection } from './RowControls/DragControls';
20
19
  var styles = css({
@@ -33,8 +32,6 @@ export var TableFloatingControls = function TableFloatingControls(_ref) {
33
32
  isInDanger = _ref.isInDanger,
34
33
  isResizing = _ref.isResizing,
35
34
  isNumberColumnEnabled = _ref.isNumberColumnEnabled,
36
- isHeaderRowEnabled = _ref.isHeaderRowEnabled,
37
- isHeaderColumnEnabled = _ref.isHeaderColumnEnabled,
38
35
  isDragAndDropEnabled = _ref.isDragAndDropEnabled,
39
36
  tableActive = _ref.tableActive,
40
37
  hasHeaderRow = _ref.hasHeaderRow,
@@ -117,7 +114,7 @@ export var TableFloatingControls = function TableFloatingControls(_ref) {
117
114
  updateCellHoverLocation: updateCellHoverLocation,
118
115
  stickyTop: stickyTop,
119
116
  isDragAndDropEnabled: isDragAndDropEnabled
120
- }) : null, tableActive && jsx(Fragment, null, isDragAndDropEnabled ? jsx(Fragment, null, shouldShowCornerControls && jsx(DragCornerControlsWithSelection, {
117
+ }) : null, tableActive && jsx(Fragment, null, shouldShowCornerControls && jsx(DragCornerControlsWithSelection, {
121
118
  editorView: editorView,
122
119
  tableRef: tableRef,
123
120
  isInDanger: isInDanger,
@@ -141,19 +138,6 @@ export var TableFloatingControls = function TableFloatingControls(_ref) {
141
138
  selectRows: _selectRows,
142
139
  updateCellHoverLocation: updateCellHoverLocation,
143
140
  api: api
144
- })) : jsx(FloatingControlsWithSelection, {
145
- editorView: editorView,
146
- tableRef: tableRef,
147
- isInDanger: isInDanger,
148
- isResizing: isResizing,
149
- isHeaderRowEnabled: isHeaderRowEnabled,
150
- isHeaderColumnEnabled: isHeaderColumnEnabled,
151
- hoveredRows: hoveredRows,
152
- stickyTop: tableActive ? stickyTop : undefined,
153
- tableActive: tableActive,
154
- hoverRows: _hoverRows,
155
- selectRow: _selectRow,
156
- api: api
157
141
  }))));
158
142
  };
159
143
  export default TableFloatingControls;