@atlaskit/editor-plugin-table 2.3.0 → 2.4.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 (427) hide show
  1. package/.eslintrc.js +6 -0
  2. package/CHANGELOG.md +12 -0
  3. package/dist/cjs/plugins/table/commands/go-to-next-cell.js +2 -2
  4. package/dist/cjs/plugins/table/commands/insert.js +3 -3
  5. package/dist/cjs/plugins/table/commands/misc.js +26 -26
  6. package/dist/cjs/plugins/table/commands/referentiality.js +1 -1
  7. package/dist/cjs/plugins/table/commands/selection.js +2 -2
  8. package/dist/cjs/plugins/table/commands/sort.js +8 -8
  9. package/dist/cjs/plugins/table/commands-with-analytics.js +3 -3
  10. package/dist/cjs/plugins/table/event-handlers.js +15 -15
  11. package/dist/cjs/plugins/table/handlers.js +6 -7
  12. package/dist/cjs/plugins/table/index.js +16 -16
  13. package/dist/cjs/plugins/table/nodeviews/TableComponent.js +44 -40
  14. package/dist/cjs/plugins/table/nodeviews/TableContainer.js +10 -8
  15. package/dist/cjs/plugins/table/nodeviews/TableResizer.js +2 -2
  16. package/dist/cjs/plugins/table/nodeviews/table.js +11 -9
  17. package/dist/cjs/plugins/table/nodeviews/tableCell.js +1 -1
  18. package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +2 -2
  19. package/dist/cjs/plugins/table/pm-plugins/keymap.js +2 -2
  20. package/dist/cjs/plugins/table/pm-plugins/main.js +24 -21
  21. package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
  22. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -2
  23. package/dist/cjs/plugins/table/pm-plugins/table-local-id.js +1 -1
  24. package/dist/cjs/plugins/table/pm-plugins/table-resizing/commands.js +1 -1
  25. package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +4 -4
  26. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +1 -1
  27. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/column-state.js +1 -1
  28. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -1
  29. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -2
  30. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +1 -1
  31. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -3
  32. package/dist/cjs/plugins/table/pm-plugins/table-width.js +3 -3
  33. package/dist/cjs/plugins/table/toolbar.js +26 -26
  34. package/dist/cjs/plugins/table/transforms/column-width.js +5 -5
  35. package/dist/cjs/plugins/table/transforms/delete-columns.js +1 -1
  36. package/dist/cjs/plugins/table/transforms/merge.js +1 -1
  37. package/dist/cjs/plugins/table/transforms/replace-table.js +2 -2
  38. package/dist/cjs/plugins/table/ui/FloatingContextualButton/FixedButton.js +2 -2
  39. package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +3 -3
  40. package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
  41. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +11 -11
  42. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +2 -2
  43. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +6 -3
  44. package/dist/cjs/plugins/table/ui/FloatingDeleteButton/index.js +10 -10
  45. package/dist/cjs/plugins/table/ui/FloatingInsertButton/InsertButton.js +3 -3
  46. package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +9 -9
  47. package/dist/cjs/plugins/table/ui/LayoutButton/index.js +3 -3
  48. package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -1
  49. package/dist/cjs/plugins/table/ui/common-styles.js +2 -2
  50. package/dist/cjs/plugins/table/ui/consts.js +2 -2
  51. package/dist/cjs/plugins/table/ui/ui-styles.js +2 -2
  52. package/dist/cjs/plugins/table/utils/column-controls.js +11 -11
  53. package/dist/cjs/plugins/table/utils/decoration.js +11 -11
  54. package/dist/cjs/plugins/table/utils/nodes.js +1 -1
  55. package/dist/cjs/plugins/table/utils/row-controls.js +9 -9
  56. package/dist/cjs/plugins/table/utils/selection.js +1 -1
  57. package/dist/cjs/version.json +1 -1
  58. package/dist/es2019/plugins/table/commands/clear.js +3 -1
  59. package/dist/es2019/plugins/table/commands/go-to-next-cell.js +2 -2
  60. package/dist/es2019/plugins/table/commands/insert.js +4 -3
  61. package/dist/es2019/plugins/table/commands/misc.js +4 -4
  62. package/dist/es2019/plugins/table/commands/referentiality.js +1 -1
  63. package/dist/es2019/plugins/table/commands/selection.js +3 -3
  64. package/dist/es2019/plugins/table/commands/sort.js +3 -4
  65. package/dist/es2019/plugins/table/commands/toggle.js +1 -2
  66. package/dist/es2019/plugins/table/commands-with-analytics.js +4 -4
  67. package/dist/es2019/plugins/table/event-handlers.js +3 -5
  68. package/dist/es2019/plugins/table/handlers.js +5 -5
  69. package/dist/es2019/plugins/table/index.js +16 -16
  70. package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -1
  71. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +21 -18
  72. package/dist/es2019/plugins/table/nodeviews/TableContainer.js +10 -9
  73. package/dist/es2019/plugins/table/nodeviews/TableResizer.js +4 -4
  74. package/dist/es2019/plugins/table/nodeviews/table.js +11 -9
  75. package/dist/es2019/plugins/table/nodeviews/tableCell.js +2 -2
  76. package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +2 -3
  77. package/dist/es2019/plugins/table/pm-plugins/keymap.js +4 -4
  78. package/dist/es2019/plugins/table/pm-plugins/main.js +13 -13
  79. package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
  80. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -2
  81. package/dist/es2019/plugins/table/pm-plugins/table-local-id.js +1 -1
  82. package/dist/es2019/plugins/table/pm-plugins/table-resizing/commands.js +1 -1
  83. package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +4 -4
  84. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +1 -1
  85. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/column-state.js +1 -1
  86. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -1
  87. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -3
  88. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +1 -1
  89. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -3
  90. package/dist/es2019/plugins/table/pm-plugins/table-selection-keymap.js +1 -1
  91. package/dist/es2019/plugins/table/pm-plugins/table-width.js +3 -3
  92. package/dist/es2019/plugins/table/toolbar.js +16 -18
  93. package/dist/es2019/plugins/table/transforms/column-width.js +6 -7
  94. package/dist/es2019/plugins/table/transforms/delete-columns.js +1 -1
  95. package/dist/es2019/plugins/table/transforms/merge.js +2 -1
  96. package/dist/es2019/plugins/table/transforms/replace-table.js +2 -2
  97. package/dist/es2019/plugins/table/transforms/split.js +1 -0
  98. package/dist/es2019/plugins/table/ui/FloatingContextualButton/FixedButton.js +2 -2
  99. package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +4 -4
  100. package/dist/es2019/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
  101. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +10 -10
  102. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +2 -2
  103. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/styles.js +7 -4
  104. package/dist/es2019/plugins/table/ui/FloatingDeleteButton/index.js +5 -5
  105. package/dist/es2019/plugins/table/ui/FloatingInsertButton/InsertButton.js +3 -3
  106. package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +4 -5
  107. package/dist/es2019/plugins/table/ui/LayoutButton/index.js +3 -3
  108. package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -1
  109. package/dist/es2019/plugins/table/ui/common-styles.js +5 -5
  110. package/dist/es2019/plugins/table/ui/consts.js +2 -2
  111. package/dist/es2019/plugins/table/ui/ui-styles.js +3 -3
  112. package/dist/es2019/plugins/table/utils/column-controls.js +3 -3
  113. package/dist/es2019/plugins/table/utils/decoration.js +2 -2
  114. package/dist/es2019/plugins/table/utils/guidelines.js +1 -1
  115. package/dist/es2019/plugins/table/utils/nodes.js +1 -1
  116. package/dist/es2019/plugins/table/utils/row-controls.js +3 -3
  117. package/dist/es2019/plugins/table/utils/selection.js +1 -1
  118. package/dist/es2019/version.json +1 -1
  119. package/dist/esm/plugins/table/commands/clear.js +3 -1
  120. package/dist/esm/plugins/table/commands/go-to-next-cell.js +2 -2
  121. package/dist/esm/plugins/table/commands/insert.js +4 -3
  122. package/dist/esm/plugins/table/commands/misc.js +4 -4
  123. package/dist/esm/plugins/table/commands/referentiality.js +1 -1
  124. package/dist/esm/plugins/table/commands/selection.js +3 -3
  125. package/dist/esm/plugins/table/commands/sort.js +3 -4
  126. package/dist/esm/plugins/table/commands/toggle.js +1 -2
  127. package/dist/esm/plugins/table/commands-with-analytics.js +4 -4
  128. package/dist/esm/plugins/table/event-handlers.js +3 -5
  129. package/dist/esm/plugins/table/handlers.js +5 -5
  130. package/dist/esm/plugins/table/index.js +16 -16
  131. package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -1
  132. package/dist/esm/plugins/table/nodeviews/TableComponent.js +39 -36
  133. package/dist/esm/plugins/table/nodeviews/TableContainer.js +10 -9
  134. package/dist/esm/plugins/table/nodeviews/TableResizer.js +4 -4
  135. package/dist/esm/plugins/table/nodeviews/table.js +11 -9
  136. package/dist/esm/plugins/table/nodeviews/tableCell.js +2 -2
  137. package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +2 -3
  138. package/dist/esm/plugins/table/pm-plugins/keymap.js +4 -4
  139. package/dist/esm/plugins/table/pm-plugins/main.js +13 -13
  140. package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
  141. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -2
  142. package/dist/esm/plugins/table/pm-plugins/table-local-id.js +1 -1
  143. package/dist/esm/plugins/table/pm-plugins/table-resizing/commands.js +1 -1
  144. package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +4 -4
  145. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +1 -1
  146. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/column-state.js +1 -1
  147. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -1
  148. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -3
  149. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +1 -1
  150. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -3
  151. package/dist/esm/plugins/table/pm-plugins/table-selection-keymap.js +1 -1
  152. package/dist/esm/plugins/table/pm-plugins/table-width.js +3 -3
  153. package/dist/esm/plugins/table/toolbar.js +16 -18
  154. package/dist/esm/plugins/table/transforms/column-width.js +6 -7
  155. package/dist/esm/plugins/table/transforms/delete-columns.js +1 -1
  156. package/dist/esm/plugins/table/transforms/merge.js +2 -1
  157. package/dist/esm/plugins/table/transforms/replace-table.js +2 -2
  158. package/dist/esm/plugins/table/transforms/split.js +1 -0
  159. package/dist/esm/plugins/table/ui/FloatingContextualButton/FixedButton.js +2 -2
  160. package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +4 -4
  161. package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
  162. package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +10 -10
  163. package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +2 -2
  164. package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +6 -3
  165. package/dist/esm/plugins/table/ui/FloatingDeleteButton/index.js +5 -5
  166. package/dist/esm/plugins/table/ui/FloatingInsertButton/InsertButton.js +3 -3
  167. package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +4 -5
  168. package/dist/esm/plugins/table/ui/LayoutButton/index.js +3 -3
  169. package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -1
  170. package/dist/esm/plugins/table/ui/common-styles.js +5 -5
  171. package/dist/esm/plugins/table/ui/consts.js +2 -2
  172. package/dist/esm/plugins/table/ui/ui-styles.js +3 -3
  173. package/dist/esm/plugins/table/utils/column-controls.js +3 -3
  174. package/dist/esm/plugins/table/utils/decoration.js +2 -2
  175. package/dist/esm/plugins/table/utils/guidelines.js +1 -1
  176. package/dist/esm/plugins/table/utils/nodes.js +1 -1
  177. package/dist/esm/plugins/table/utils/row-controls.js +3 -3
  178. package/dist/esm/plugins/table/utils/selection.js +1 -1
  179. package/dist/esm/version.json +1 -1
  180. package/dist/types/plugins/table/commands/go-to-next-cell.d.ts +2 -2
  181. package/dist/types/plugins/table/commands/insert.d.ts +1 -1
  182. package/dist/types/plugins/table/commands/selection.d.ts +1 -1
  183. package/dist/types/plugins/table/commands/sort.d.ts +1 -1
  184. package/dist/types/plugins/table/commands-with-analytics.d.ts +4 -5
  185. package/dist/types/plugins/table/event-handlers.d.ts +1 -1
  186. package/dist/types/plugins/table/handlers.d.ts +1 -1
  187. package/dist/types/plugins/table/index.d.ts +4 -4
  188. package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +3 -4
  189. package/dist/types/plugins/table/nodeviews/TableContainer.d.ts +2 -2
  190. package/dist/types/plugins/table/nodeviews/TableResizer.d.ts +1 -1
  191. package/dist/types/plugins/table/nodeviews/table.d.ts +3 -4
  192. package/dist/types/plugins/table/nodeviews/tableCell.d.ts +1 -2
  193. package/dist/types/plugins/table/nodeviews/types.d.ts +2 -1
  194. package/dist/types/plugins/table/pm-plugins/decorations/plugin.d.ts +2 -2
  195. package/dist/types/plugins/table/pm-plugins/keymap.d.ts +1 -1
  196. package/dist/types/plugins/table/pm-plugins/main.d.ts +4 -6
  197. package/dist/types/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +1 -1
  198. package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -1
  199. package/dist/types/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +1 -1
  200. package/dist/types/plugins/table/pm-plugins/table-local-id.d.ts +0 -12
  201. package/dist/types/plugins/table/pm-plugins/table-resizing/plugin.d.ts +3 -3
  202. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +3 -4
  203. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +3 -3
  204. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -1
  205. package/dist/types/plugins/table/pm-plugins/table-width.d.ts +1 -1
  206. package/dist/types/plugins/table/toolbar.d.ts +4 -5
  207. package/dist/types/plugins/table/transforms/column-width.d.ts +1 -1
  208. package/dist/types/plugins/table/transforms/replace-table.d.ts +1 -1
  209. package/dist/types/plugins/table/types.d.ts +1 -1
  210. package/dist/types/plugins/table/ui/FloatingContextualButton/index.d.ts +2 -2
  211. package/dist/types/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
  212. package/dist/types/plugins/table/ui/FloatingContextualMenu/index.d.ts +1 -1
  213. package/dist/types/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +1 -2
  214. package/dist/types/plugins/table/ui/FloatingDeleteButton/index.d.ts +1 -1
  215. package/dist/types/plugins/table/ui/FloatingInsertButton/index.d.ts +1 -1
  216. package/dist/types/plugins/table/ui/LayoutButton/index.d.ts +1 -1
  217. package/dist/types/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +1 -1
  218. package/dist/types/plugins/table/ui/TableFloatingControls/index.d.ts +1 -1
  219. package/dist/types/plugins/table/utils/analytics.d.ts +1 -1
  220. package/dist/types/plugins/table/utils/collapse.d.ts +2 -2
  221. package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
  222. package/dist/types-ts4.5/plugins/table/commands/go-to-next-cell.d.ts +2 -2
  223. package/dist/types-ts4.5/plugins/table/commands/insert.d.ts +1 -1
  224. package/dist/types-ts4.5/plugins/table/commands/selection.d.ts +1 -1
  225. package/dist/types-ts4.5/plugins/table/commands/sort.d.ts +1 -1
  226. package/dist/types-ts4.5/plugins/table/commands-with-analytics.d.ts +4 -5
  227. package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +1 -1
  228. package/dist/types-ts4.5/plugins/table/handlers.d.ts +1 -1
  229. package/dist/types-ts4.5/plugins/table/index.d.ts +4 -4
  230. package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +3 -4
  231. package/dist/types-ts4.5/plugins/table/nodeviews/TableContainer.d.ts +2 -2
  232. package/dist/types-ts4.5/plugins/table/nodeviews/TableResizer.d.ts +1 -1
  233. package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +3 -4
  234. package/dist/types-ts4.5/plugins/table/nodeviews/tableCell.d.ts +1 -2
  235. package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +2 -1
  236. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/plugin.d.ts +2 -2
  237. package/dist/types-ts4.5/plugins/table/pm-plugins/keymap.d.ts +1 -1
  238. package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +4 -6
  239. package/dist/types-ts4.5/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +1 -1
  240. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -1
  241. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +1 -1
  242. package/dist/types-ts4.5/plugins/table/pm-plugins/table-local-id.d.ts +0 -12
  243. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin.d.ts +3 -3
  244. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +3 -4
  245. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +3 -3
  246. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -1
  247. package/dist/types-ts4.5/plugins/table/pm-plugins/table-width.d.ts +1 -1
  248. package/dist/types-ts4.5/plugins/table/toolbar.d.ts +4 -5
  249. package/dist/types-ts4.5/plugins/table/transforms/column-width.d.ts +1 -1
  250. package/dist/types-ts4.5/plugins/table/transforms/replace-table.d.ts +1 -1
  251. package/dist/types-ts4.5/plugins/table/types.d.ts +1 -1
  252. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/index.d.ts +2 -2
  253. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
  254. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/index.d.ts +1 -1
  255. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +1 -2
  256. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/index.d.ts +1 -1
  257. package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/index.d.ts +1 -1
  258. package/dist/types-ts4.5/plugins/table/ui/LayoutButton/index.d.ts +1 -1
  259. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +1 -1
  260. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +1 -1
  261. package/dist/types-ts4.5/plugins/table/utils/analytics.d.ts +1 -1
  262. package/dist/types-ts4.5/plugins/table/utils/collapse.d.ts +2 -2
  263. package/dist/types-ts4.5/plugins/table/utils/decoration.d.ts +1 -1
  264. package/examples/99-testing.tsx +11 -10
  265. package/package.json +11 -3
  266. package/report.api.md +2 -0
  267. package/src/__tests__/integration/arrow-down-into-table.ts +3 -2
  268. package/src/__tests__/integration/auto-size.ts +8 -10
  269. package/src/__tests__/integration/cell-selection.ts +8 -7
  270. package/src/__tests__/integration/change-date-inside-table.ts +4 -5
  271. package/src/__tests__/integration/delete-columns.ts +6 -4
  272. package/src/__tests__/integration/delete-last-column-in-full-width.ts +4 -4
  273. package/src/__tests__/integration/delete-last-column-with-empty-action.ts +4 -4
  274. package/src/__tests__/integration/delete-last-row-with-empty-action.ts +4 -4
  275. package/src/__tests__/integration/delete-rows.ts +8 -6
  276. package/src/__tests__/integration/delete-table-when-selected.ts +10 -11
  277. package/src/__tests__/integration/deleting-empty-paragraph-under-table.ts +5 -4
  278. package/src/__tests__/integration/even-columns.ts +8 -8
  279. package/src/__tests__/integration/floating-toolbar.ts +3 -1
  280. package/src/__tests__/integration/horizontal-scroll-shadows.ts +7 -8
  281. package/src/__tests__/integration/horizontal-scroll.ts +8 -7
  282. package/src/__tests__/integration/insert-cell-header-with-strong-mark.ts +3 -4
  283. package/src/__tests__/integration/insert-row-inside-layout.ts +8 -6
  284. package/src/__tests__/integration/layout.ts +8 -11
  285. package/src/__tests__/integration/meta-arrowup-cursor-in-first-row.ts +3 -2
  286. package/src/__tests__/integration/resize-handler.ts +2 -2
  287. package/src/__tests__/integration/resize.ts +15 -15
  288. package/src/__tests__/integration/scale.ts +8 -8
  289. package/src/__tests__/integration/sticky-header.ts +3 -2
  290. package/src/__tests__/unit/analytics.ts +21 -21
  291. package/src/__tests__/unit/collab.ts +16 -16
  292. package/src/__tests__/unit/commands/go-to-next-cell.ts +14 -13
  293. package/src/__tests__/unit/commands/insert.ts +12 -12
  294. package/src/__tests__/unit/commands/misc.ts +18 -16
  295. package/src/__tests__/unit/commands/sort.ts +9 -8
  296. package/src/__tests__/unit/commands.ts +13 -14
  297. package/src/__tests__/unit/copy-paste.ts +31 -25
  298. package/src/__tests__/unit/event-handlers/index.ts +15 -13
  299. package/src/__tests__/unit/event-handlers.ts +18 -18
  300. package/src/__tests__/unit/fix-tables.ts +9 -9
  301. package/src/__tests__/unit/get-toolbar-config.ts +21 -21
  302. package/src/__tests__/unit/handlers.ts +13 -12
  303. package/src/__tests__/unit/hover-selection.ts +14 -13
  304. package/src/__tests__/unit/index-with-fake-timers.ts +6 -5
  305. package/src/__tests__/unit/index.ts +30 -31
  306. package/src/__tests__/unit/layout.ts +16 -16
  307. package/src/__tests__/unit/nodeviews/OverflowShadowsObserver.ts +4 -2
  308. package/src/__tests__/unit/nodeviews/TableComponent.tsx +21 -20
  309. package/src/__tests__/unit/nodeviews/TableContainer.tsx +38 -105
  310. package/src/__tests__/unit/nodeviews/cell.ts +17 -16
  311. package/src/__tests__/unit/nodeviews/table.ts +15 -13
  312. package/src/__tests__/unit/pm-plugins/decorations/column-controls.ts +1 -1
  313. package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +7 -8
  314. package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +45 -57
  315. package/src/__tests__/unit/pm-plugins/main.ts +15 -14
  316. package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +7 -6
  317. package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +23 -21
  318. package/src/__tests__/unit/pm-plugins/table-local-id.ts +14 -15
  319. package/src/__tests__/unit/pm-plugins/table-resizing/colgroup.ts +3 -2
  320. package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +22 -21
  321. package/src/__tests__/unit/sort-column.ts +16 -14
  322. package/src/__tests__/unit/toolbar.ts +22 -21
  323. package/src/__tests__/unit/transforms/delete-columns.ts +16 -14
  324. package/src/__tests__/unit/transforms/delete-rows.ts +16 -14
  325. package/src/__tests__/unit/transforms/merging.ts +15 -13
  326. package/src/__tests__/unit/ui/ContextualMenu.tsx +8 -6
  327. package/src/__tests__/unit/ui/CornerControls.tsx +11 -9
  328. package/src/__tests__/unit/ui/DeleteButton.tsx +3 -1
  329. package/src/__tests__/unit/ui/FixedButton.tsx +4 -1
  330. package/src/__tests__/unit/ui/FloatingContextualButton.tsx +14 -11
  331. package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +8 -6
  332. package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +12 -9
  333. package/src/__tests__/unit/ui/FloatingInsertButton.tsx +21 -19
  334. package/src/__tests__/unit/ui/RowControls.tsx +15 -12
  335. package/src/__tests__/unit/ui/TableFloatingControls.tsx +16 -15
  336. package/src/__tests__/unit/undo-redo.ts +17 -15
  337. package/src/__tests__/unit/utils/collapse.ts +7 -8
  338. package/src/__tests__/unit/utils/nodes.ts +12 -11
  339. package/src/__tests__/unit/utils/row-controls.ts +12 -12
  340. package/src/__tests__/unit/utils/table.ts +5 -4
  341. package/src/__tests__/unit/utils.ts +18 -16
  342. package/src/__tests__/visual-regression/cell-options-menu.ts +2 -2
  343. package/src/__tests__/visual-regression/index.ts +8 -7
  344. package/src/__tests__/visual-regression/sticky-header.ts +6 -5
  345. package/src/plugins/table/commands/clear.ts +3 -2
  346. package/src/plugins/table/commands/collapse.ts +1 -0
  347. package/src/plugins/table/commands/go-to-next-cell.ts +8 -7
  348. package/src/plugins/table/commands/insert.ts +8 -7
  349. package/src/plugins/table/commands/misc.ts +15 -18
  350. package/src/plugins/table/commands/referentiality.ts +3 -1
  351. package/src/plugins/table/commands/selection.ts +11 -10
  352. package/src/plugins/table/commands/sort.ts +9 -9
  353. package/src/plugins/table/commands/split-cell.ts +1 -1
  354. package/src/plugins/table/commands/toggle.ts +2 -3
  355. package/src/plugins/table/commands-with-analytics.ts +15 -15
  356. package/src/plugins/table/event-handlers.ts +19 -20
  357. package/src/plugins/table/handlers.ts +6 -7
  358. package/src/plugins/table/index.tsx +51 -51
  359. package/src/plugins/table/nodeviews/OverflowShadowsObserver.ts +2 -1
  360. package/src/plugins/table/nodeviews/TableComponent.tsx +23 -30
  361. package/src/plugins/table/nodeviews/TableContainer.tsx +16 -23
  362. package/src/plugins/table/nodeviews/TableResizer.tsx +8 -7
  363. package/src/plugins/table/nodeviews/table.tsx +25 -18
  364. package/src/plugins/table/nodeviews/tableCell.tsx +9 -7
  365. package/src/plugins/table/nodeviews/types.ts +4 -2
  366. package/src/plugins/table/nodeviews/update-overflow-shadows.ts +3 -1
  367. package/src/plugins/table/pm-plugins/decorations/plugin.ts +4 -3
  368. package/src/plugins/table/pm-plugins/decorations/utils/column-controls.ts +2 -1
  369. package/src/plugins/table/pm-plugins/keymap.ts +8 -8
  370. package/src/plugins/table/pm-plugins/main.ts +38 -33
  371. package/src/plugins/table/pm-plugins/plugin-factory.ts +2 -0
  372. package/src/plugins/table/pm-plugins/plugin-key.ts +1 -0
  373. package/src/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.ts +2 -1
  374. package/src/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.ts +6 -7
  375. package/src/plugins/table/pm-plugins/sticky-headers/plugin-key.ts +1 -0
  376. package/src/plugins/table/pm-plugins/sticky-headers/plugin.ts +3 -4
  377. package/src/plugins/table/pm-plugins/table-local-id.ts +3 -4
  378. package/src/plugins/table/pm-plugins/table-resizing/commands.ts +3 -2
  379. package/src/plugins/table/pm-plugins/table-resizing/event-handlers.ts +13 -14
  380. package/src/plugins/table/pm-plugins/table-resizing/plugin-factory.ts +1 -0
  381. package/src/plugins/table/pm-plugins/table-resizing/plugin-key.ts +1 -0
  382. package/src/plugins/table/pm-plugins/table-resizing/plugin.ts +7 -6
  383. package/src/plugins/table/pm-plugins/table-resizing/utils/colgroup.ts +2 -1
  384. package/src/plugins/table/pm-plugins/table-resizing/utils/column-state.ts +1 -1
  385. package/src/plugins/table/pm-plugins/table-resizing/utils/dom.ts +3 -3
  386. package/src/plugins/table/pm-plugins/table-resizing/utils/misc.ts +8 -9
  387. package/src/plugins/table/pm-plugins/table-resizing/utils/resize-state.ts +8 -6
  388. package/src/plugins/table/pm-plugins/table-resizing/utils/scale-table.ts +4 -5
  389. package/src/plugins/table/pm-plugins/table-resizing/utils/types.ts +2 -1
  390. package/src/plugins/table/pm-plugins/table-selection-keymap.ts +4 -3
  391. package/src/plugins/table/pm-plugins/table-width.ts +5 -4
  392. package/src/plugins/table/toolbar.tsx +54 -57
  393. package/src/plugins/table/transforms/column-width.ts +13 -13
  394. package/src/plugins/table/transforms/delete-columns.ts +2 -2
  395. package/src/plugins/table/transforms/delete-rows.ts +2 -2
  396. package/src/plugins/table/transforms/merge.ts +3 -3
  397. package/src/plugins/table/transforms/replace-table.ts +6 -5
  398. package/src/plugins/table/transforms/split.ts +1 -1
  399. package/src/plugins/table/types.ts +3 -3
  400. package/src/plugins/table/ui/FloatingContextualButton/FixedButton.tsx +4 -2
  401. package/src/plugins/table/ui/FloatingContextualButton/index.tsx +12 -11
  402. package/src/plugins/table/ui/FloatingContextualButton/styles.ts +5 -3
  403. package/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx +27 -28
  404. package/src/plugins/table/ui/FloatingContextualMenu/index.tsx +10 -11
  405. package/src/plugins/table/ui/FloatingContextualMenu/styles.ts +8 -4
  406. package/src/plugins/table/ui/FloatingDeleteButton/DeleteButton.tsx +5 -2
  407. package/src/plugins/table/ui/FloatingDeleteButton/index.tsx +9 -9
  408. package/src/plugins/table/ui/FloatingInsertButton/InsertButton.tsx +4 -5
  409. package/src/plugins/table/ui/FloatingInsertButton/index.tsx +16 -18
  410. package/src/plugins/table/ui/LayoutButton/index.tsx +6 -6
  411. package/src/plugins/table/ui/TableFloatingControls/CornerControls/index.tsx +3 -2
  412. package/src/plugins/table/ui/TableFloatingControls/NumberColumn/index.tsx +2 -1
  413. package/src/plugins/table/ui/TableFloatingControls/index.tsx +2 -3
  414. package/src/plugins/table/ui/common-styles.ts +33 -34
  415. package/src/plugins/table/ui/consts.ts +12 -13
  416. package/src/plugins/table/ui/ui-styles.ts +24 -22
  417. package/src/plugins/table/utils/analytics.ts +3 -2
  418. package/src/plugins/table/utils/collapse.ts +2 -2
  419. package/src/plugins/table/utils/column-controls.ts +5 -6
  420. package/src/plugins/table/utils/decoration.ts +6 -7
  421. package/src/plugins/table/utils/dom.ts +1 -0
  422. package/src/plugins/table/utils/guidelines.ts +2 -2
  423. package/src/plugins/table/utils/nodes.ts +2 -1
  424. package/src/plugins/table/utils/row-controls.ts +4 -3
  425. package/src/plugins/table/utils/selection.ts +2 -1
  426. package/src/plugins/table/utils/table.ts +2 -1
  427. package/tmp/api-report-tmp.d.ts +2 -0
@@ -14,12 +14,13 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
14
14
  var _defineProperty3 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
15
  var _react = _interopRequireDefault(require("react"));
16
16
  var _classnames2 = _interopRequireDefault(require("classnames"));
17
- var _utils = require("@atlaskit/editor-tables/utils");
17
+ var _memoizeOne = _interopRequireDefault(require("memoize-one"));
18
18
  var _rafSchd = _interopRequireDefault(require("raf-schd"));
19
+ var _nodeWidth = require("@atlaskit/editor-common/node-width");
19
20
  var _styles = require("@atlaskit/editor-common/styles");
20
- var _utils2 = require("@atlaskit/editor-common/utils");
21
+ var _utils = require("@atlaskit/editor-common/utils");
21
22
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
22
- var _nodeWidth = require("@atlaskit/editor-common/node-width");
23
+ var _utils2 = require("@atlaskit/editor-tables/utils");
23
24
  var _commands = require("../commands");
24
25
  var _pluginFactory = require("../pm-plugins/plugin-factory");
25
26
  var _stickyHeaders = require("../pm-plugins/sticky-headers");
@@ -28,16 +29,14 @@ var _dom = require("../pm-plugins/table-resizing/utils/dom");
28
29
  var _types = require("../types");
29
30
  var _TableFloatingControls = _interopRequireDefault(require("../ui/TableFloatingControls"));
30
31
  var _utils4 = require("../utils");
31
- var _updateOverflowShadows = require("./update-overflow-shadows");
32
- var _memoizeOne = _interopRequireDefault(require("memoize-one"));
33
32
  var _OverflowShadowsObserver = require("./OverflowShadowsObserver");
34
33
  var _TableContainer = require("./TableContainer");
35
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
34
+ var _updateOverflowShadows = require("./update-overflow-shadows");
36
35
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
37
36
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty3.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
38
37
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
39
38
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
40
- var isIE11 = _utils2.browser.ie_version === 11;
39
+ var isIE11 = _utils.browser.ie_version === 11;
41
40
  var NOOP = function NOOP() {
42
41
  return undefined;
43
42
  };
@@ -74,7 +73,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
74
73
  var _this$props$getEditor = _this.props.getEditorFeatureFlags(),
75
74
  tableOverflowShadowsOptimization = _this$props$getEditor.tableOverflowShadowsOptimization;
76
75
  var pos = _this.props.getPos();
77
- if (!(0, _utils2.isValidPosition)(pos, _this.props.view.state)) {
76
+ if (!(0, _utils.isValidPosition)(pos, _this.props.view.state)) {
78
77
  return;
79
78
  }
80
79
  var stickyHeader = (0, _stickyHeaders.findStickyHeaderForTable)(state, pos);
@@ -135,7 +134,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
135
134
  // This last check is also to cater for dynamic text sizing changing the 'default' layout width
136
135
  // Usually happens on window resize.
137
136
  layoutSize !== _this.layoutSize || noOfColumnsChanged) {
138
- var shouldScaleTable = (!(0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') || (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') && isNested) && !hasNumberedColumnChanged && !noOfColumnsChanged;
137
+ var shouldScaleTable = (!(options !== null && options !== void 0 && options.isTableResizingEnabled) || (options === null || options === void 0 ? void 0 : options.isTableResizingEnabled) && isNested) && !hasNumberedColumnChanged && !noOfColumnsChanged;
139
138
 
140
139
  // If column has been inserted/deleted avoid multi dispatch
141
140
  if (shouldScaleTable) {
@@ -161,7 +160,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
161
160
  var state = view.state,
162
161
  dispatch = view.dispatch;
163
162
  var pos = getPos();
164
- if (typeof pos !== 'number' || !(0, _utils2.isValidPosition)(pos, state)) {
163
+ if (typeof pos !== 'number' || !(0, _utils.isValidPosition)(pos, state)) {
165
164
  return;
166
165
  }
167
166
  var domAtPos = view.domAtPos.bind(view);
@@ -185,7 +184,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
185
184
  containerWidth = _this$props3.containerWidth;
186
185
  var _node = getNode();
187
186
  var pos = getPos();
188
- if (!(0, _utils2.isValidPosition)(pos, view.state)) {
187
+ if (!(0, _utils.isValidPosition)(pos, view.state)) {
189
188
  return;
190
189
  }
191
190
  (0, _commands.autoSizeTable)(view, _node, _this.table, pos, {
@@ -219,7 +218,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
219
218
  options = _this$props5.options,
220
219
  state = _this$props5.view.state;
221
220
  var pos = getPos();
222
- if (!(0, _utils2.isValidPosition)(pos, state)) {
221
+ if (!(0, _utils.isValidPosition)(pos, state)) {
223
222
  return;
224
223
  }
225
224
  var parentNodeWith = (0, _nodeWidth.getParentNodeWidth)(pos, state, containerWidth, options && options.isFullWidthModeEnabled);
@@ -277,7 +276,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
277
276
  value: function componentDidMount() {
278
277
  var _this$props6 = this.props,
279
278
  allowColumnResizing = _this$props6.allowColumnResizing,
280
- eventDispatcher = _this$props6.eventDispatcher;
279
+ eventDispatcher = _this$props6.eventDispatcher,
280
+ options = _this$props6.options;
281
281
  if (allowColumnResizing && this.wrapper && !isIE11) {
282
282
  this.wrapper.addEventListener('scroll', this.handleScrollDebounced);
283
283
  }
@@ -286,7 +286,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
286
286
  * We no longer use `containerWidth` as a variable to determine an update for table resizing (avoids unnecessary updates).
287
287
  * Instead we use the resize event to only trigger updates when necessary.
288
288
  */
289
- if (!(0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width')) {
289
+ if (!(options !== null && options !== void 0 && options.isTableResizingEnabled)) {
290
290
  window.addEventListener('resize', this.handleWindowResizeDebounced);
291
291
  }
292
292
  this.handleTableResizingDebounced();
@@ -300,6 +300,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
300
300
  }, {
301
301
  key: "componentWillUnmount",
302
302
  value: function componentWillUnmount() {
303
+ var _this$props7 = this.props,
304
+ allowColumnResizing = _this$props7.allowColumnResizing,
305
+ eventDispatcher = _this$props7.eventDispatcher,
306
+ options = _this$props7.options;
303
307
  if (this.wrapper && !isIE11) {
304
308
  this.wrapper.removeEventListener('scroll', this.handleScrollDebounced);
305
309
  }
@@ -307,28 +311,28 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
307
311
  this.scaleTableDebounced.cancel();
308
312
  this.handleTableResizingDebounced.cancel();
309
313
  this.handleAutoSizeDebounced.cancel();
310
- if (!(0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width')) {
314
+ if (!(options !== null && options !== void 0 && options.isTableResizingEnabled)) {
311
315
  this.handleWindowResizeDebounced.cancel();
312
316
  }
313
- if (!(0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') && this.props.allowColumnResizing) {
317
+ if (!(options !== null && options !== void 0 && options.isTableResizingEnabled) && allowColumnResizing) {
314
318
  window.removeEventListener('resize', this.handleWindowResizeDebounced);
315
319
  }
316
320
  if (this.overflowShadowsObserver) {
317
321
  this.overflowShadowsObserver.dispose();
318
322
  }
319
- this.props.eventDispatcher.off(_stickyHeaders.pluginKey.key, this.onStickyState);
323
+ eventDispatcher.off(_stickyHeaders.pluginKey.key, this.onStickyState);
320
324
  }
321
325
  }, {
322
326
  key: "componentDidUpdate",
323
327
  value: function componentDidUpdate() {
324
- var _this$props7 = this.props,
325
- view = _this$props7.view,
326
- getNode = _this$props7.getNode,
327
- isMediaFullscreen = _this$props7.isMediaFullscreen,
328
- allowColumnResizing = _this$props7.allowColumnResizing;
328
+ var _this$props8 = this.props,
329
+ view = _this$props8.view,
330
+ getNode = _this$props8.getNode,
331
+ isMediaFullscreen = _this$props8.isMediaFullscreen,
332
+ allowColumnResizing = _this$props8.allowColumnResizing;
329
333
  var _getPluginState = (0, _pluginFactory.getPluginState)(view.state),
330
334
  isInDanger = _getPluginState.isInDanger;
331
- var table = (0, _utils.findTable)(view.state.selection);
335
+ var table = (0, _utils2.findTable)(view.state.selection);
332
336
  if (isInDanger && !table) {
333
337
  (0, _commands.clearHoverSelection)()(view.state, view.dispatch);
334
338
  }
@@ -381,20 +385,20 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
381
385
  value: function render() {
382
386
  var _classnames,
383
387
  _this2 = this;
384
- var _this$props8 = this.props,
385
- view = _this$props8.view,
386
- getNode = _this$props8.getNode,
387
- isResizing = _this$props8.isResizing,
388
- _this$props8$allowCon = _this$props8.allowControls,
389
- allowControls = _this$props8$allowCon === void 0 ? true : _this$props8$allowCon,
390
- isHeaderRowEnabled = _this$props8.isHeaderRowEnabled,
391
- ordering = _this$props8.ordering,
392
- isHeaderColumnEnabled = _this$props8.isHeaderColumnEnabled,
393
- tableActive = _this$props8.tableActive,
394
- containerWidth = _this$props8.containerWidth,
395
- options = _this$props8.options,
396
- getPos = _this$props8.getPos,
397
- pluginInjectionApi = _this$props8.pluginInjectionApi;
388
+ var _this$props9 = this.props,
389
+ view = _this$props9.view,
390
+ getNode = _this$props9.getNode,
391
+ isResizing = _this$props9.isResizing,
392
+ _this$props9$allowCon = _this$props9.allowControls,
393
+ allowControls = _this$props9$allowCon === void 0 ? true : _this$props9$allowCon,
394
+ isHeaderRowEnabled = _this$props9.isHeaderRowEnabled,
395
+ ordering = _this$props9.ordering,
396
+ isHeaderColumnEnabled = _this$props9.isHeaderColumnEnabled,
397
+ tableActive = _this$props9.tableActive,
398
+ containerWidth = _this$props9.containerWidth,
399
+ options = _this$props9.options,
400
+ getPos = _this$props9.getPos,
401
+ pluginInjectionApi = _this$props9.pluginInjectionApi;
398
402
  var _this$state = this.state,
399
403
  isLoading = _this$state.isLoading,
400
404
  showBeforeShadow = _this$state.showBeforeShadow,
@@ -445,16 +449,16 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
445
449
  }) : NOOP;
446
450
  var isNested = (0, _utils4.isTableNested)(view.state, getPos());
447
451
  return /*#__PURE__*/_react.default.createElement(_TableContainer.TableContainer, {
448
- className: (0, _classnames2.default)(_types.TableCssClassName.TABLE_CONTAINER, (_classnames = {}, (0, _defineProperty3.default)(_classnames, _types.TableCssClassName.WITH_CONTROLS, allowControls && tableActive), (0, _defineProperty3.default)(_classnames, _types.TableCssClassName.TABLE_STICKY, this.state.stickyHeader && hasHeaderRow), (0, _defineProperty3.default)(_classnames, _types.TableCssClassName.HOVERED_DELETE_BUTTON, isInDanger), (0, _defineProperty3.default)(_classnames, _types.TableCssClassName.TABLE_SELECTED, (0, _utils.isTableSelected)(view.state.selection)), (0, _defineProperty3.default)(_classnames, 'less-padding', containerWidth.width < _editorSharedStyles.akEditorMobileBreakoutPoint), _classnames)),
452
+ className: (0, _classnames2.default)(_types.TableCssClassName.TABLE_CONTAINER, (_classnames = {}, (0, _defineProperty3.default)(_classnames, _types.TableCssClassName.WITH_CONTROLS, allowControls && tableActive), (0, _defineProperty3.default)(_classnames, _types.TableCssClassName.TABLE_STICKY, this.state.stickyHeader && hasHeaderRow), (0, _defineProperty3.default)(_classnames, _types.TableCssClassName.HOVERED_DELETE_BUTTON, isInDanger), (0, _defineProperty3.default)(_classnames, _types.TableCssClassName.TABLE_SELECTED, (0, _utils2.isTableSelected)(view.state.selection)), _classnames)),
449
453
  editorView: view,
450
454
  getPos: getPos,
451
455
  node: node,
452
456
  tableRef: tableRef,
453
457
  containerWidth: containerWidth,
454
- isFullWidthModeEnabled: options === null || options === void 0 ? void 0 : options.isFullWidthModeEnabled,
455
458
  isBreakoutEnabled: options === null || options === void 0 ? void 0 : options.isBreakoutEnabled,
456
459
  isNested: isNested,
457
- pluginInjectionApi: pluginInjectionApi
460
+ pluginInjectionApi: pluginInjectionApi,
461
+ isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.isTableResizingEnabled
458
462
  }, stickyHeadersOptimization && /*#__PURE__*/_react.default.createElement("div", {
459
463
  className: _types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP,
460
464
  "data-testid": "sticky-sentinel-top"
@@ -1,17 +1,19 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.TableContainer = exports.ResizableTableContainer = exports.InnerContainer = void 0;
8
9
  var _react = _interopRequireWildcard(require("react"));
9
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
+ var _classnames = _interopRequireDefault(require("classnames"));
10
11
  var _nodeWidth = require("@atlaskit/editor-common/node-width");
11
12
  var _styles = require("@atlaskit/editor-common/styles");
13
+ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
14
+ var _utils = require("../pm-plugins/table-resizing/utils");
12
15
  var _types = require("../types");
13
16
  var _TableResizer = require("./TableResizer");
14
- var _utils = require("../pm-plugins/table-resizing/utils");
15
17
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
19
  var getMarginLeft = function getMarginLeft(lineLength, tableWidth) {
@@ -50,10 +52,9 @@ var ResizableTableContainer = function ResizableTableContainer(_ref2) {
50
52
  tableRef = _ref2.tableRef,
51
53
  pluginInjectionApi = _ref2.pluginInjectionApi;
52
54
  var containerRef = (0, _react.useRef)(null);
53
- var innerContainerRef = (0, _react.useRef)(null);
54
55
  var marginLeftRef = (0, _react.useRef)(0);
55
56
  var updateWidth = (0, _react.useCallback)(function (width) {
56
- if (!containerRef.current || !innerContainerRef.current) {
57
+ if (!containerRef.current) {
57
58
  return;
58
59
  }
59
60
  var marginLeft = getMarginLeft(lineLength, width);
@@ -94,7 +95,6 @@ var ResizableTableContainer = function ResizableTableContainer(_ref2) {
94
95
  tableRef: tableRef,
95
96
  displayGuideline: displayGuideline
96
97
  }, /*#__PURE__*/_react.default.createElement(InnerContainer, {
97
- ref: innerContainerRef,
98
98
  className: className,
99
99
  node: node
100
100
  }, children)));
@@ -107,14 +107,14 @@ var TableContainer = function TableContainer(_ref3) {
107
107
  _ref3$containerWidth = _ref3.containerWidth,
108
108
  lineLength = _ref3$containerWidth.lineLength,
109
109
  editorWidth = _ref3$containerWidth.width,
110
- isFullWidthModeEnabled = _ref3.isFullWidthModeEnabled,
110
+ isTableResizingEnabled = _ref3.isTableResizingEnabled,
111
111
  isBreakoutEnabled = _ref3.isBreakoutEnabled,
112
112
  editorView = _ref3.editorView,
113
113
  getPos = _ref3.getPos,
114
114
  tableRef = _ref3.tableRef,
115
115
  isNested = _ref3.isNested,
116
116
  pluginInjectionApi = _ref3.pluginInjectionApi;
117
- if ((isFullWidthModeEnabled || isBreakoutEnabled) && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') && !isNested) {
117
+ if (isTableResizingEnabled && !isNested) {
118
118
  return /*#__PURE__*/_react.default.createElement(ResizableTableContainer, {
119
119
  className: className,
120
120
  node: node,
@@ -129,7 +129,9 @@ var TableContainer = function TableContainer(_ref3) {
129
129
  var tableWidth = isBreakoutEnabled ? (0, _styles.calcTableWidth)(node.attrs.layout, editorWidth) : 'inherit';
130
130
  return /*#__PURE__*/_react.default.createElement(InnerContainer, {
131
131
  node: node,
132
- className: className,
132
+ className: (0, _classnames.default)(className, {
133
+ 'less-padding': editorWidth < _editorSharedStyles.akEditorMobileBreakoutPoint
134
+ }),
133
135
  style: {
134
136
  width: tableWidth,
135
137
  marginLeft: getMarginLeft(lineLength, tableWidth)
@@ -10,13 +10,13 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
11
  var _react = _interopRequireWildcard(require("react"));
12
12
  var _rafSchd = _interopRequireDefault(require("raf-schd"));
13
- var _resizer = require("@atlaskit/editor-common/resizer");
14
13
  var _guideline = require("@atlaskit/editor-common/guideline");
14
+ var _resizer = require("@atlaskit/editor-common/resizer");
15
15
  var _utils = require("../pm-plugins/table-resizing/utils");
16
16
  var _tableWidth = require("../pm-plugins/table-width");
17
+ var _consts = require("../ui/consts");
17
18
  var _guidelines = require("../utils/guidelines");
18
19
  var _snapping = require("../utils/snapping");
19
- var _consts = require("../ui/consts");
20
20
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
21
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
22
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -17,23 +17,25 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
17
17
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
18
18
  var _react = _interopRequireDefault(require("react"));
19
19
  var _prosemirrorModel = require("prosemirror-model");
20
+ var _nodeWidth = require("@atlaskit/editor-common/node-width");
20
21
  var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
21
22
  var _withPluginState = require("@atlaskit/editor-common/with-plugin-state");
23
+ var _tableMap = require("@atlaskit/editor-tables/table-map");
22
24
  var _createPluginConfig = require("../create-plugin-config");
23
25
  var _pluginFactory = require("../pm-plugins/plugin-factory");
24
26
  var _pluginKey = require("../pm-plugins/plugin-key");
25
27
  var _tableResizing = require("../pm-plugins/table-resizing");
26
- var _tableWidth = require("../pm-plugins/table-width");
27
28
  var _utils = require("../pm-plugins/table-resizing/utils");
28
- var _tableMap = require("@atlaskit/editor-tables/table-map");
29
- var _TableComponent = _interopRequireDefault(require("./TableComponent"));
30
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
31
- var _nodeWidth = require("@atlaskit/editor-common/node-width");
29
+ var _tableWidth = require("../pm-plugins/table-width");
32
30
  var _utils2 = require("../utils");
31
+ var _TableComponent = _interopRequireDefault(require("./TableComponent"));
33
32
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
34
33
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
35
- var tableAttributes = function tableAttributes(node, state, pos) {
36
- var shouldHaveInlineWidth = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') && !(0, _utils2.isTableNested)(state, pos);
34
+ var tableAttributes = function tableAttributes(node, options, state, pos) {
35
+ // provide a width for tables when custom table width is supported
36
+ // this is to ensure 'responsive' tables (colgroup widths are undefined) become fixed to
37
+ // support screen size adjustments
38
+ var shouldHaveInlineWidth = (options === null || options === void 0 ? void 0 : options.isTableResizingEnabled) && !(0, _utils2.isTableNested)(state, pos);
37
39
  var style = shouldHaveInlineWidth ? "width: ".concat((0, _nodeWidth.getTableContainerWidth)(node), "px") : undefined;
38
40
  return {
39
41
  'data-number-column': node.attrs.isNumberColumnEnabled,
@@ -49,7 +51,7 @@ var toDOM = function toDOM(node, props) {
49
51
  if (props.allowColumnResizing) {
50
52
  colgroup = ['colgroup', {}].concat((0, _toConsumableArray2.default)((0, _utils.generateColgroup)(node)));
51
53
  }
52
- return ['table', tableAttributes(node, props.view.state, props.getPos()), colgroup, ['tbody', 0]];
54
+ return ['table', tableAttributes(node, props.options, props.view.state, props.getPos()), colgroup, ['tbody', 0]];
53
55
  };
54
56
  var TableView = /*#__PURE__*/function (_ReactNodeView) {
55
57
  (0, _inherits2.default)(TableView, _ReactNodeView);
@@ -83,7 +85,7 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
83
85
  if (!this.table) {
84
86
  return;
85
87
  }
86
- var attrs = tableAttributes(node, this.view.state, this.getPos());
88
+ var attrs = tableAttributes(node, this.reactComponentProps.options, this.view.state, this.getPos());
87
89
  Object.keys(attrs).forEach(function (attr) {
88
90
  _this2.table.setAttribute(attr, attrs[attr]);
89
91
  });
@@ -8,8 +8,8 @@ exports.default = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _uuid = _interopRequireDefault(require("uuid"));
12
11
  var _prosemirrorModel = require("prosemirror-model");
12
+ var _uuid = _interopRequireDefault(require("uuid"));
13
13
  var _adfSchema = require("@atlaskit/adf-schema");
14
14
  var DEFAULT_COL_SPAN = 1;
15
15
  var DEFAULT_ROW_SPAN = 1;
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.pluginKey = exports.handleDocOrSelectionChanged = exports.getDecorations = exports.createPlugin = void 0;
7
- var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
7
  var _prosemirrorState = require("prosemirror-state");
9
- var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
10
8
  var _prosemirrorView = require("prosemirror-view");
9
+ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
10
+ var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
11
11
  var _pluginKey = require("../plugin-key");
12
12
  var _tableWidth = require("../table-width");
13
13
  var _utils = require("./utils");
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  exports.keymapPlugin = keymapPlugin;
9
- var _prosemirrorKeymap = require("prosemirror-keymap");
10
9
  var _prosemirrorCommands = require("prosemirror-commands");
11
- var keymaps = _interopRequireWildcard(require("@atlaskit/editor-common/keymaps"));
10
+ var _prosemirrorKeymap = require("prosemirror-keymap");
12
11
  var _analytics = require("@atlaskit/editor-common/analytics");
12
+ var keymaps = _interopRequireWildcard(require("@atlaskit/editor-common/keymaps"));
13
13
  var _commands = require("../commands");
14
14
  var _commandsWithAnalytics = require("../commands-with-analytics");
15
15
  var _insert = require("../commands/insert");
@@ -6,36 +6,38 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.createPlugin = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
10
9
  var _prosemirrorUtils = require("prosemirror-utils");
11
- var _utils = require("@atlaskit/editor-tables/utils");
12
- var _utils2 = require("@atlaskit/editor-common/utils");
10
+ var _analytics = require("@atlaskit/editor-common/analytics");
11
+ var _coreUtils = require("@atlaskit/editor-common/core-utils");
12
+ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
13
+ var _transforms = require("@atlaskit/editor-common/transforms");
14
+ var _utils = require("@atlaskit/editor-common/utils");
15
+ var _utils2 = require("@atlaskit/editor-tables/utils");
13
16
  var _commands = require("../commands");
17
+ var _misc = require("../commands/misc");
14
18
  var _eventHandlers = require("../event-handlers");
15
19
  var _table = require("../nodeviews/table");
20
+ var _tableCell = _interopRequireDefault(require("../nodeviews/tableCell"));
16
21
  var _plugin = require("../pm-plugins/decorations/plugin");
17
- var _transforms = require("../transforms");
22
+ var _transforms2 = require("../transforms");
18
23
  var _types = require("../types");
19
24
  var _utils3 = require("../utils");
20
- var _analytics = require("@atlaskit/editor-common/analytics");
25
+ var _paste = require("../utils/paste");
21
26
  var _defaultTableSelection = require("./default-table-selection");
22
27
  var _pluginFactory = require("./plugin-factory");
23
28
  var _pluginKey = require("./plugin-key");
24
- var _tableCell = _interopRequireDefault(require("../nodeviews/tableCell"));
25
- var _misc = require("../commands/misc");
26
- var _transforms2 = require("@atlaskit/editor-common/transforms");
27
- var _coreUtils = require("@atlaskit/editor-common/core-utils");
28
- var _paste = require("../utils/paste");
29
29
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
30
30
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
31
31
  var isBreakoutEnabled;
32
32
  var isFullWidthModeEnabled;
33
33
  var wasFullWidthModeEnabled;
34
- var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, breakoutEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled, editorAnalyticsAPI, pluginInjectionApi) {
34
+ var isTableResizingEnabled;
35
+ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, breakoutEnabled, fullWidthModeEnabled, tableResizingEnabled, previousFullWidthModeEnabled, editorAnalyticsAPI, pluginInjectionApi) {
35
36
  var _window;
36
37
  isBreakoutEnabled = breakoutEnabled;
37
38
  isFullWidthModeEnabled = fullWidthModeEnabled;
38
39
  wasFullWidthModeEnabled = previousFullWidthModeEnabled;
40
+ isTableResizingEnabled = tableResizingEnabled;
39
41
  var state = (0, _pluginFactory.createPluginState)(dispatch, _objectSpread({
40
42
  pluginConfig: pluginConfig,
41
43
  insertColumnButtonIndex: undefined,
@@ -101,12 +103,12 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
101
103
  if (tr) {
102
104
  // "fixTables" removes empty rows as we don't allow that in schema
103
105
  var updatedTr = (0, _eventHandlers.handleCut)(tr, oldState, newState, editorAnalyticsAPI);
104
- return (0, _transforms.fixTables)(updatedTr) || updatedTr;
106
+ return (0, _transforms2.fixTables)(updatedTr) || updatedTr;
105
107
  }
106
108
  if (transactions.find(function (tr) {
107
109
  return tr.docChanged;
108
110
  })) {
109
- return (0, _transforms.fixTables)(newState.tr, reportInvalidTableCellSpanAttrs);
111
+ return (0, _transforms2.fixTables)(newState.tr, reportInvalidTableCellSpanAttrs);
110
112
  }
111
113
  },
112
114
  view: function view(editorView) {
@@ -125,7 +127,7 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
125
127
  if (parent) {
126
128
  tableRef = parent.querySelector('table') || undefined;
127
129
  }
128
- tableNode = (0, _utils.findTable)(state.selection);
130
+ tableNode = (0, _utils2.findTable)(state.selection);
129
131
  }
130
132
  if (pluginState.tableRef !== tableRef) {
131
133
  (0, _commands.setTableRef)(tableRef)(state, dispatch);
@@ -170,17 +172,17 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
170
172
 
171
173
  // We do this separately, so it also applies to drag/drop events
172
174
  // This needs to go before `transformSliceToRemoveOpenExpand`
173
- slice = (0, _transforms2.transformSliceToRemoveOpenLayoutNodes)(slice, schema);
175
+ slice = (0, _transforms.transformSliceToRemoveOpenLayoutNodes)(slice, schema);
174
176
 
175
177
  // If a partial paste of expand, paste only the content
176
178
  // This needs to go before `transformSliceToRemoveOpenTable`
177
- slice = (0, _transforms2.transformSliceToRemoveOpenExpand)(slice, schema);
179
+ slice = (0, _transforms.transformSliceToRemoveOpenExpand)(slice, schema);
178
180
 
179
181
  /** If a partial paste of table, paste only table's content */
180
182
  slice = (0, _utils3.transformSliceToRemoveOpenTable)(slice, schema);
181
183
 
182
184
  /** If a partial paste of bodied extension, paste only text */
183
- slice = (0, _transforms2.transformSliceToRemoveOpenBodiedExtension)(slice, schema);
185
+ slice = (0, _transforms.transformSliceToRemoveOpenBodiedExtension)(slice, schema);
184
186
  slice = (0, _utils3.transformSliceToCorrectEmptyTableCells)(slice, schema);
185
187
  if (!pluginConfig.allowColumnResizing) {
186
188
  slice = (0, _misc.transformSliceToRemoveColumnsWidths)(slice, schema);
@@ -204,7 +206,7 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
204
206
  // ED-6069: workaround for Chrome given a regression introduced in prosemirror-view@1.6.8
205
207
  // Returning true prevents that updateSelection() is getting called in the commit below:
206
208
  // @see https://github.com/ProseMirror/prosemirror-view/commit/33fe4a8b01584f6b4103c279033dcd33e8047b95
207
- if (_utils2.browser.chrome && event.target) {
209
+ if (_utils.browser.chrome && event.target) {
208
210
  var targetClassList = event.target.classList;
209
211
  if (targetClassList.contains(_types.TableCssClassName.CONTROLS_BUTTON) || targetClassList.contains(_types.TableCssClassName.CONTEXTUAL_MENU_BUTTON)) {
210
212
  return true;
@@ -217,13 +219,13 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
217
219
  // back to the top of the table if the user has already scrolled down
218
220
  var tableHeader = view.state.schema.nodes.tableHeader;
219
221
  var domRef = (0, _prosemirrorUtils.findParentDomRefOfType)(tableHeader, view.domAtPos.bind(view))(view.state.selection);
220
- var maybeTr = (0, _utils2.closestElement)(domRef, 'tr');
222
+ var maybeTr = (0, _utils.closestElement)(domRef, 'tr');
221
223
  return maybeTr ? maybeTr.classList.contains('sticky') : false;
222
224
  },
223
225
  handleTextInput: function handleTextInput(_ref3, _from, _to, text) {
224
226
  var state = _ref3.state,
225
227
  dispatch = _ref3.dispatch;
226
- var tr = (0, _transforms.replaceSelectedTable)(state, text, _analytics.INPUT_METHOD.KEYBOARD, editorAnalyticsAPI);
228
+ var tr = (0, _transforms2.replaceSelectedTable)(state, text, _analytics.INPUT_METHOD.KEYBOARD, editorAnalyticsAPI);
227
229
  if (tr.selectionSet) {
228
230
  dispatch(tr);
229
231
  return true;
@@ -235,7 +237,8 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
235
237
  return (0, _table.createTableView)(node, view, getPos, portalProviderAPI, eventDispatcher, {
236
238
  isBreakoutEnabled: isBreakoutEnabled,
237
239
  isFullWidthModeEnabled: isFullWidthModeEnabled,
238
- wasFullWidthModeEnabled: wasFullWidthModeEnabled
240
+ wasFullWidthModeEnabled: wasFullWidthModeEnabled,
241
+ isTableResizingEnabled: isTableResizingEnabled
239
242
  }, getEditorContainerWidth, getEditorFeatureFlags, pluginInjectionApi);
240
243
  }
241
244
  }),
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.tableSafariDeleteCompositionTextIssueWorkaroundKey = exports.createPlugin = void 0;
7
- var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
7
  var _prosemirrorState = require("prosemirror-state");
9
8
  var _prosemirrorView = require("prosemirror-view");
9
+ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
10
10
  /**
11
11
  * Fix an issue that composition text replacement in Safari removes empty nodes during text composition text deletion.
12
12
  * https://github.com/ProseMirror/prosemirror/issues/934
@@ -8,6 +8,8 @@ exports.supportedHeaderRow = exports.TableRowNodeView = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+ var _debounce = _interopRequireDefault(require("lodash/debounce"));
12
+ var _throttle = _interopRequireDefault(require("lodash/throttle"));
11
13
  var _ui = require("@atlaskit/editor-common/ui");
12
14
  var _utils = require("@atlaskit/editor-common/utils");
13
15
  var _types = require("../../../types");
@@ -16,8 +18,6 @@ var _pluginKey = require("../../plugin-key");
16
18
  var _dom = require("../../table-resizing/utils/dom");
17
19
  var _commands = require("../commands");
18
20
  var _dom2 = require("./dom");
19
- var _debounce = _interopRequireDefault(require("lodash/debounce"));
20
- var _throttle = _interopRequireDefault(require("lodash/throttle"));
21
21
  // limit scroll event calls
22
22
  var HEADER_ROW_SCROLL_THROTTLE_TIMEOUT = 200;
23
23
 
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.createPlugin = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
10
9
  var _prosemirrorState = require("prosemirror-state");
11
10
  var _rafSchd = _interopRequireDefault(require("raf-schd"));
12
11
  var _adfSchema = require("@atlaskit/adf-schema");
12
+ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
13
13
  var _utils = require("@atlaskit/editor-common/utils");
14
14
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
15
15
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.stopResizing = exports.setResizeHandlePos = exports.setLastClick = exports.setDragging = exports.evenColumns = exports.distributeColumnsWidths = void 0;
7
7
  var _utils = require("@atlaskit/editor-tables/utils");
8
+ var _transforms = require("../../transforms");
8
9
  var _pluginFactory = require("./plugin-factory");
9
10
  var _utils2 = require("./utils");
10
- var _transforms = require("../../transforms");
11
11
  var evenColumns = function evenColumns(_ref) {
12
12
  var resizeState = _ref.resizeState,
13
13
  table = _ref.table,
@@ -4,17 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.handleMouseDown = void 0;
7
- var _tableMap = require("@atlaskit/editor-tables/table-map");
8
- var _utils = require("@atlaskit/editor-tables/utils");
7
+ var _analytics = require("@atlaskit/editor-common/analytics");
8
+ var _nodeWidth = require("@atlaskit/editor-common/node-width");
9
9
  var _styles = require("@atlaskit/editor-common/styles");
10
10
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
11
- var _nodeWidth = require("@atlaskit/editor-common/node-width");
11
+ var _tableMap = require("@atlaskit/editor-tables/table-map");
12
+ var _utils = require("@atlaskit/editor-tables/utils");
12
13
  var _transforms = require("../../transforms");
13
14
  var _utils2 = require("../../utils");
14
15
  var _commands = require("./commands");
15
16
  var _pluginFactory = require("./plugin-factory");
16
17
  var _utils3 = require("./utils");
17
- var _analytics = require("@atlaskit/editor-common/analytics");
18
18
  var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, editorAnalyticsAPI) {
19
19
  var state = view.state,
20
20
  dispatch = view.dispatch;
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.isMinCellWidthTable = exports.insertColgroupFromNode = exports.hasTableBeenResized = exports.getColgroupChildrenLength = exports.generateColgroup = void 0;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
9
  var _prosemirrorModel = require("prosemirror-model");
10
- var _utils = require("@atlaskit/editor-common/utils");
11
10
  var _styles = require("@atlaskit/editor-common/styles");
11
+ var _utils = require("@atlaskit/editor-common/utils");
12
12
  var _tableMap = require("@atlaskit/editor-tables/table-map");
13
13
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
14
  var generateColgroup = function generateColgroup(table) {
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getFreeSpace = exports.getColumnStateFromDOM = exports.getCellsRefsInColumn = exports.calculateColumnWidth = exports.addContainerLeftRightPadding = void 0;
7
- var _tableMap = require("@atlaskit/editor-tables/table-map");
8
7
  var _prosemirrorUtils = require("prosemirror-utils");
9
8
  var _styles = require("@atlaskit/editor-common/styles");
9
+ var _tableMap = require("@atlaskit/editor-tables/table-map");
10
10
  var _contentWidth2 = require("./content-width");
11
11
  var _unitToNumber = require("./unit-to-number");
12
12
  // Reads `width` and `minWidth` of each column from DOM and returns `ColumnState` containing those values