@atlaskit/editor-plugin-table 5.0.0 → 5.2.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 (271) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/plugins/table/index.js +47 -37
  3. package/dist/cjs/plugins/table/nodeviews/TableCell.js +111 -0
  4. package/dist/cjs/plugins/table/nodeviews/TableNodeViewBase.js +30 -0
  5. package/dist/cjs/plugins/table/{pm-plugins/sticky-headers/nodeviews/tableRow.js → nodeviews/TableRow.js} +313 -307
  6. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/actions.js +12 -0
  7. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/commands.js +27 -0
  8. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/consts.js +11 -0
  9. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/index.js +32 -0
  10. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin-factory.js +13 -0
  11. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin-key.js +8 -0
  12. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin.js +28 -0
  13. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/reducer.js +28 -0
  14. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/types.js +5 -0
  15. package/dist/cjs/plugins/table/pm-plugins/main.js +16 -13
  16. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/index.js +1 -8
  17. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin.js +1 -9
  18. package/dist/cjs/plugins/table/utils/dom.js +31 -1
  19. package/dist/cjs/plugins/table/utils/index.js +12 -0
  20. package/dist/cjs/plugins/table/utils/nodes.js +31 -7
  21. package/dist/es2019/plugins/table/index.js +12 -3
  22. package/dist/es2019/plugins/table/nodeviews/{tableCell.js → TableCell.js} +28 -24
  23. package/dist/es2019/plugins/table/nodeviews/TableNodeViewBase.js +22 -0
  24. package/dist/es2019/plugins/table/{pm-plugins/sticky-headers/nodeviews/tableRow.js → nodeviews/TableRow.js} +273 -284
  25. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/actions.js +6 -0
  26. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/commands.js +14 -0
  27. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/consts.js +5 -0
  28. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/index.js +3 -0
  29. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin-factory.js +8 -0
  30. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin-key.js +2 -0
  31. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin.js +22 -0
  32. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/reducer.js +20 -0
  33. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/types.js +1 -0
  34. package/dist/es2019/plugins/table/pm-plugins/main.js +8 -8
  35. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/index.js +1 -2
  36. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/plugin.js +1 -9
  37. package/dist/es2019/plugins/table/utils/dom.js +30 -0
  38. package/dist/es2019/plugins/table/utils/index.js +1 -1
  39. package/dist/es2019/plugins/table/utils/nodes.js +16 -0
  40. package/dist/esm/plugins/table/index.js +47 -37
  41. package/dist/esm/plugins/table/nodeviews/TableCell.js +105 -0
  42. package/dist/esm/plugins/table/nodeviews/TableNodeViewBase.js +24 -0
  43. package/dist/esm/plugins/table/{pm-plugins/sticky-headers/nodeviews/tableRow.js → nodeviews/TableRow.js} +314 -307
  44. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/actions.js +6 -0
  45. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/commands.js +22 -0
  46. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/consts.js +5 -0
  47. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/index.js +3 -0
  48. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin-factory.js +7 -0
  49. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin-key.js +2 -0
  50. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin.js +22 -0
  51. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/reducer.js +21 -0
  52. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/types.js +1 -0
  53. package/dist/esm/plugins/table/pm-plugins/main.js +16 -13
  54. package/dist/esm/plugins/table/pm-plugins/sticky-headers/index.js +1 -2
  55. package/dist/esm/plugins/table/pm-plugins/sticky-headers/plugin.js +1 -9
  56. package/dist/esm/plugins/table/utils/dom.js +30 -0
  57. package/dist/esm/plugins/table/utils/index.js +1 -1
  58. package/dist/esm/plugins/table/utils/nodes.js +24 -0
  59. package/dist/types/plugins/table/nodeviews/TableCell.d.ts +13 -0
  60. package/dist/types/plugins/table/nodeviews/TableNodeViewBase.d.ts +18 -0
  61. package/dist/types/plugins/table/nodeviews/TableRow.d.ts +60 -0
  62. package/dist/types/plugins/table/pm-plugins/drag-and-drop/actions.d.ts +15 -0
  63. package/dist/types/plugins/table/pm-plugins/drag-and-drop/commands.d.ts +4 -0
  64. package/dist/types/plugins/table/pm-plugins/drag-and-drop/consts.d.ts +6 -0
  65. package/dist/types/plugins/table/pm-plugins/drag-and-drop/index.d.ts +4 -0
  66. package/dist/types/plugins/table/pm-plugins/drag-and-drop/plugin-factory.d.ts +2 -0
  67. package/dist/types/plugins/table/pm-plugins/drag-and-drop/plugin-key.d.ts +3 -0
  68. package/dist/types/plugins/table/pm-plugins/drag-and-drop/plugin.d.ts +3 -0
  69. package/dist/types/plugins/table/pm-plugins/drag-and-drop/reducer.d.ts +4 -0
  70. package/dist/types/plugins/table/pm-plugins/drag-and-drop/types.d.ts +5 -0
  71. package/dist/types/plugins/table/pm-plugins/main.d.ts +1 -1
  72. package/dist/types/plugins/table/pm-plugins/sticky-headers/index.d.ts +0 -1
  73. package/dist/types/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +1 -1
  74. package/dist/types/plugins/table/types.d.ts +1 -0
  75. package/dist/types/plugins/table/utils/dom.d.ts +6 -0
  76. package/dist/types/plugins/table/utils/index.d.ts +1 -1
  77. package/dist/types/plugins/table/utils/nodes.d.ts +12 -2
  78. package/dist/types-ts4.5/i18n/cs.d.ts +37 -0
  79. package/dist/types-ts4.5/i18n/da.d.ts +35 -0
  80. package/dist/types-ts4.5/i18n/de.d.ts +35 -0
  81. package/dist/types-ts4.5/i18n/en.d.ts +37 -0
  82. package/dist/types-ts4.5/i18n/en_GB.d.ts +37 -0
  83. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +37 -0
  84. package/dist/types-ts4.5/i18n/es.d.ts +35 -0
  85. package/dist/types-ts4.5/i18n/fi.d.ts +35 -0
  86. package/dist/types-ts4.5/i18n/fr.d.ts +37 -0
  87. package/dist/types-ts4.5/i18n/hu.d.ts +37 -0
  88. package/dist/types-ts4.5/i18n/it.d.ts +37 -0
  89. package/dist/types-ts4.5/i18n/ja.d.ts +37 -0
  90. package/dist/types-ts4.5/i18n/ko.d.ts +35 -0
  91. package/dist/types-ts4.5/i18n/nb.d.ts +35 -0
  92. package/dist/types-ts4.5/i18n/nl.d.ts +37 -0
  93. package/dist/types-ts4.5/i18n/pl.d.ts +37 -0
  94. package/dist/types-ts4.5/i18n/pt_BR.d.ts +37 -0
  95. package/dist/types-ts4.5/i18n/ru.d.ts +37 -0
  96. package/dist/types-ts4.5/i18n/sv.d.ts +35 -0
  97. package/dist/types-ts4.5/i18n/th.d.ts +35 -0
  98. package/dist/types-ts4.5/i18n/tr.d.ts +37 -0
  99. package/dist/types-ts4.5/i18n/uk.d.ts +37 -0
  100. package/dist/types-ts4.5/i18n/vi.d.ts +35 -0
  101. package/dist/types-ts4.5/i18n/zh.d.ts +37 -0
  102. package/dist/types-ts4.5/i18n/zh_TW.d.ts +37 -0
  103. package/dist/types-ts4.5/index.d.ts +2 -0
  104. package/dist/types-ts4.5/plugins/table/commands/clear.d.ts +3 -0
  105. package/dist/types-ts4.5/plugins/table/commands/collapse.d.ts +2 -0
  106. package/dist/types-ts4.5/plugins/table/commands/delete.d.ts +3 -0
  107. package/dist/types-ts4.5/plugins/table/commands/go-to-next-cell.d.ts +4 -0
  108. package/dist/types-ts4.5/plugins/table/commands/hover.d.ts +8 -0
  109. package/dist/types-ts4.5/plugins/table/commands/index.d.ts +8 -0
  110. package/dist/types-ts4.5/plugins/table/commands/insert.d.ts +9 -0
  111. package/dist/types-ts4.5/plugins/table/commands/misc.d.ts +29 -0
  112. package/dist/types-ts4.5/plugins/table/commands/referentiality.d.ts +2 -0
  113. package/dist/types-ts4.5/plugins/table/commands/selection.d.ts +8 -0
  114. package/dist/types-ts4.5/plugins/table/commands/sort.d.ts +3 -0
  115. package/dist/types-ts4.5/plugins/table/commands/split-cell.d.ts +6 -0
  116. package/dist/types-ts4.5/plugins/table/commands/toggle.d.ts +12 -0
  117. package/dist/types-ts4.5/plugins/table/commands-with-analytics.d.ts +25 -0
  118. package/dist/types-ts4.5/plugins/table/create-plugin-config.d.ts +2 -0
  119. package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +15 -0
  120. package/dist/types-ts4.5/plugins/table/handlers.d.ts +3 -0
  121. package/dist/types-ts4.5/plugins/table/index.d.ts +38 -0
  122. package/dist/types-ts4.5/plugins/table/nodeviews/OverflowShadowsObserver.d.ts +24 -0
  123. package/dist/types-ts4.5/plugins/table/nodeviews/TableCell.d.ts +13 -0
  124. package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +73 -0
  125. package/dist/types-ts4.5/plugins/table/nodeviews/TableContainer.d.ts +44 -0
  126. package/dist/types-ts4.5/plugins/table/nodeviews/TableNodeViewBase.d.ts +18 -0
  127. package/dist/types-ts4.5/plugins/table/nodeviews/TableResizer.d.ts +25 -0
  128. package/dist/types-ts4.5/plugins/table/nodeviews/TableRow.d.ts +60 -0
  129. package/dist/types-ts4.5/plugins/table/nodeviews/TableStickyScrollbar.d.ts +24 -0
  130. package/dist/types-ts4.5/plugins/table/nodeviews/__mocks__/OverflowShadowsObserver.d.ts +9 -0
  131. package/dist/types-ts4.5/plugins/table/nodeviews/__mocks__/OverridableMock.d.ts +9 -0
  132. package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +33 -0
  133. package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +26 -0
  134. package/dist/types-ts4.5/plugins/table/nodeviews/update-overflow-shadows.d.ts +1 -0
  135. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/plugin.d.ts +7 -0
  136. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-controls.d.ts +3 -0
  137. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-resizing.d.ts +4 -0
  138. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/compose-decorations.d.ts +2 -0
  139. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/index.d.ts +3 -0
  140. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/types.d.ts +6 -0
  141. package/dist/types-ts4.5/plugins/table/pm-plugins/default-table-selection.d.ts +4 -0
  142. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/actions.d.ts +15 -0
  143. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/commands.d.ts +4 -0
  144. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/consts.d.ts +6 -0
  145. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/index.d.ts +4 -0
  146. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/plugin-factory.d.ts +2 -0
  147. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/plugin-key.d.ts +3 -0
  148. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/plugin.d.ts +3 -0
  149. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/reducer.d.ts +4 -0
  150. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/types.d.ts +5 -0
  151. package/dist/types-ts4.5/plugins/table/pm-plugins/keymap.d.ts +5 -0
  152. package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +8 -0
  153. package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-factory.d.ts +1 -0
  154. package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
  155. package/dist/types-ts4.5/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +15 -0
  156. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/commands.d.ts +3 -0
  157. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/index.d.ts +5 -0
  158. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-key.d.ts +3 -0
  159. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-state.d.ts +3 -0
  160. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +4 -0
  161. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/types.d.ts +16 -0
  162. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/util.d.ts +2 -0
  163. package/dist/types-ts4.5/plugins/table/pm-plugins/table-analytics.d.ts +23 -0
  164. package/dist/types-ts4.5/plugins/table/pm-plugins/table-local-id.d.ts +10 -0
  165. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/commands.d.ts +23 -0
  166. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +4 -0
  167. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/index.d.ts +3 -0
  168. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-factory.d.ts +4 -0
  169. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-key.d.ts +3 -0
  170. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin.d.ts +6 -0
  171. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/reducer.d.ts +3 -0
  172. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +23 -0
  173. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/column-state.d.ts +14 -0
  174. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/consts.d.ts +2 -0
  175. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/content-width.d.ts +4 -0
  176. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +12 -0
  177. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/index.d.ts +13 -0
  178. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +20 -0
  179. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -0
  180. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-logic.d.ts +4 -0
  181. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +29 -0
  182. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +21 -0
  183. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +22 -0
  184. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.d.ts +1 -0
  185. package/dist/types-ts4.5/plugins/table/pm-plugins/table-selection-keymap.d.ts +5 -0
  186. package/dist/types-ts4.5/plugins/table/pm-plugins/table-width.d.ts +17 -0
  187. package/dist/types-ts4.5/plugins/table/reducer.d.ts +3 -0
  188. package/dist/types-ts4.5/plugins/table/toolbar.d.ts +36 -0
  189. package/dist/types-ts4.5/plugins/table/transforms/column-width.d.ts +37 -0
  190. package/dist/types-ts4.5/plugins/table/transforms/delete-columns.d.ts +4 -0
  191. package/dist/types-ts4.5/plugins/table/transforms/delete-rows.d.ts +3 -0
  192. package/dist/types-ts4.5/plugins/table/transforms/fix-tables.d.ts +9 -0
  193. package/dist/types-ts4.5/plugins/table/transforms/index.d.ts +6 -0
  194. package/dist/types-ts4.5/plugins/table/transforms/merge.d.ts +5 -0
  195. package/dist/types-ts4.5/plugins/table/transforms/replace-table.d.ts +5 -0
  196. package/dist/types-ts4.5/plugins/table/transforms/split.d.ts +9 -0
  197. package/dist/types-ts4.5/plugins/table/types.d.ts +343 -0
  198. package/dist/types-ts4.5/plugins/table/ui/ColumnResizeWidget/index.d.ts +9 -0
  199. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/FixedButton.d.ts +23 -0
  200. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/index.d.ts +21 -0
  201. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/styles.d.ts +3 -0
  202. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +87 -0
  203. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/index.d.ts +23 -0
  204. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/styles.d.ts +2 -0
  205. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +13 -0
  206. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.d.ts +10 -0
  207. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/index.d.ts +54 -0
  208. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/types.d.ts +1 -0
  209. package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +13 -0
  210. package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +3 -0
  211. package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/index.d.ts +35 -0
  212. package/dist/types-ts4.5/plugins/table/ui/LayoutButton/index.d.ts +21 -0
  213. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +16 -0
  214. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +21 -0
  215. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/index.d.ts +17 -0
  216. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +39 -0
  217. package/dist/types-ts4.5/plugins/table/ui/common-styles.d.ts +9 -0
  218. package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +50 -0
  219. package/dist/types-ts4.5/plugins/table/ui/messages.d.ts +63 -0
  220. package/dist/types-ts4.5/plugins/table/ui/ui-styles.d.ts +15 -0
  221. package/dist/types-ts4.5/plugins/table/utils/analytics.d.ts +45 -0
  222. package/dist/types-ts4.5/plugins/table/utils/collapse.d.ts +29 -0
  223. package/dist/types-ts4.5/plugins/table/utils/column-controls.d.ts +10 -0
  224. package/dist/types-ts4.5/plugins/table/utils/decoration.d.ts +19 -0
  225. package/dist/types-ts4.5/plugins/table/utils/dom.d.ts +26 -0
  226. package/dist/types-ts4.5/plugins/table/utils/get-allow-add-column-custom-step.d.ts +2 -0
  227. package/dist/types-ts4.5/plugins/table/utils/guidelines.d.ts +2 -0
  228. package/dist/types-ts4.5/plugins/table/utils/index.d.ts +11 -0
  229. package/dist/types-ts4.5/plugins/table/utils/nodes.d.ts +23 -0
  230. package/dist/types-ts4.5/plugins/table/utils/paste.d.ts +14 -0
  231. package/dist/types-ts4.5/plugins/table/utils/row-controls.d.ts +16 -0
  232. package/dist/types-ts4.5/plugins/table/utils/selection.d.ts +6 -0
  233. package/dist/types-ts4.5/plugins/table/utils/snapping.d.ts +10 -0
  234. package/dist/types-ts4.5/plugins/table/utils/table.d.ts +4 -0
  235. package/dist/types-ts4.5/plugins/table/utils/update-plugin-state-decorations.d.ts +4 -0
  236. package/dist/types-ts4.5/plugins/table-plugin.d.ts +2 -0
  237. package/dist/types-ts4.5/types/i18n.d.ts +5 -0
  238. package/package.json +3 -3
  239. package/report.api.md +2 -17
  240. package/src/__tests__/unit/nodeviews/cell.ts +2 -2
  241. package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +25 -148
  242. package/src/plugins/table/index.tsx +14 -0
  243. package/src/plugins/table/nodeviews/{tableCell.tsx → TableCell.ts} +41 -46
  244. package/src/plugins/table/nodeviews/TableNodeViewBase.ts +32 -0
  245. package/src/plugins/table/{pm-plugins/sticky-headers/nodeviews/tableRow.ts → nodeviews/TableRow.ts} +193 -246
  246. package/src/plugins/table/pm-plugins/drag-and-drop/actions.ts +29 -0
  247. package/src/plugins/table/pm-plugins/drag-and-drop/commands.ts +32 -0
  248. package/src/plugins/table/pm-plugins/drag-and-drop/consts.ts +8 -0
  249. package/src/plugins/table/pm-plugins/drag-and-drop/index.ts +5 -0
  250. package/src/plugins/table/pm-plugins/drag-and-drop/plugin-factory.ts +8 -0
  251. package/src/plugins/table/pm-plugins/drag-and-drop/plugin-key.ts +7 -0
  252. package/src/plugins/table/pm-plugins/drag-and-drop/plugin.ts +32 -0
  253. package/src/plugins/table/pm-plugins/drag-and-drop/reducer.ts +26 -0
  254. package/src/plugins/table/pm-plugins/drag-and-drop/types.ts +6 -0
  255. package/src/plugins/table/pm-plugins/main.ts +10 -19
  256. package/src/plugins/table/pm-plugins/sticky-headers/index.ts +0 -1
  257. package/src/plugins/table/pm-plugins/sticky-headers/plugin.ts +1 -9
  258. package/src/plugins/table/types.ts +2 -0
  259. package/src/plugins/table/utils/dom.ts +38 -0
  260. package/src/plugins/table/utils/index.ts +2 -0
  261. package/src/plugins/table/utils/nodes.ts +30 -2
  262. package/tmp/api-report-tmp.d.ts +100 -0
  263. package/dist/cjs/plugins/table/nodeviews/tableCell.js +0 -99
  264. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +0 -35
  265. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +0 -29
  266. package/dist/esm/plugins/table/nodeviews/tableCell.js +0 -93
  267. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +0 -29
  268. package/dist/types/plugins/table/nodeviews/tableCell.d.ts +0 -17
  269. package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +0 -6
  270. package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +0 -73
  271. package/src/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.ts +0 -37
@@ -0,0 +1,87 @@
1
+ /** @jsx jsx */
2
+ import { Component } from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import type { WrappedComponentProps } from 'react-intl-next';
5
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
6
+ import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
7
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
+ import type { Rect } from '@atlaskit/editor-tables/table-map';
9
+ export declare const messages: {
10
+ cellBackground: {
11
+ id: string;
12
+ defaultMessage: string;
13
+ description: string;
14
+ };
15
+ mergeCells: {
16
+ id: string;
17
+ defaultMessage: string;
18
+ description: string;
19
+ };
20
+ splitCell: {
21
+ id: string;
22
+ defaultMessage: string;
23
+ description: string;
24
+ };
25
+ clearCells: {
26
+ id: string;
27
+ defaultMessage: string;
28
+ description: string;
29
+ };
30
+ sortColumnASC: {
31
+ id: string;
32
+ defaultMessage: string;
33
+ description: string;
34
+ };
35
+ sortColumnDESC: {
36
+ id: string;
37
+ defaultMessage: string;
38
+ description: string;
39
+ };
40
+ canNotSortTable: {
41
+ id: string;
42
+ defaultMessage: string;
43
+ description: string;
44
+ };
45
+ distributeColumns: {
46
+ id: string;
47
+ defaultMessage: string;
48
+ description: string;
49
+ };
50
+ };
51
+ export interface Props {
52
+ editorView: EditorView;
53
+ isOpen: boolean;
54
+ selectionRect: Rect;
55
+ targetCellPosition?: number;
56
+ mountPoint?: HTMLElement;
57
+ allowMergeCells?: boolean;
58
+ allowColumnSorting?: boolean;
59
+ allowBackgroundColor?: boolean;
60
+ boundariesElement?: HTMLElement;
61
+ offset?: Array<number>;
62
+ editorAnalyticsAPI?: EditorAnalyticsAPI;
63
+ getEditorContainerWidth: GetEditorContainerWidth;
64
+ }
65
+ export interface State {
66
+ isSubmenuOpen: boolean;
67
+ }
68
+ export declare class ContextualMenu extends Component<Props & WrappedComponentProps, State> {
69
+ state: State;
70
+ static defaultProps: {
71
+ boundariesElement: HTMLElement | undefined;
72
+ };
73
+ render(): jsx.JSX.Element | null;
74
+ private handleSubMenuRef;
75
+ private createItems;
76
+ private onMenuItemActivated;
77
+ private toggleOpen;
78
+ private handleOpenChange;
79
+ private handleItemMouseEnter;
80
+ private handleItemMouseLeave;
81
+ private closeSubmenu;
82
+ private setColor;
83
+ }
84
+ declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
85
+ WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
86
+ };
87
+ export default _default;
@@ -0,0 +1,23 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
+ import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
5
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
+ import type { PluginConfig } from '../../types';
7
+ export interface Props {
8
+ editorView: EditorView;
9
+ isOpen: boolean;
10
+ getEditorContainerWidth: GetEditorContainerWidth;
11
+ getEditorFeatureFlags?: GetEditorFeatureFlags;
12
+ targetCellPosition?: number;
13
+ mountPoint?: HTMLElement;
14
+ boundariesElement?: HTMLElement;
15
+ scrollableElement?: HTMLElement;
16
+ pluginConfig?: PluginConfig;
17
+ editorAnalyticsAPI?: EditorAnalyticsAPI;
18
+ }
19
+ declare const FloatingContextualMenu: {
20
+ ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, }: Props): jsx.JSX.Element | null;
21
+ displayName: string;
22
+ };
23
+ export default FloatingContextualMenu;
@@ -0,0 +1,2 @@
1
+ export declare const cellColourPreviewStyles: (selectedColor: string) => import("@emotion/react").SerializedStyles;
2
+ export declare const tablePopupStyles: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,13 @@
1
+ import React, { SyntheticEvent } from 'react';
2
+ import { MessageDescriptor, WrappedComponentProps } from 'react-intl-next';
3
+ export interface ButtonProps {
4
+ removeLabel: MessageDescriptor;
5
+ style?: object;
6
+ onClick?: (event: SyntheticEvent) => void;
7
+ onMouseEnter?: (event: SyntheticEvent) => void;
8
+ onMouseLeave?: (event: SyntheticEvent) => void;
9
+ }
10
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
11
+ WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
12
+ };
13
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import type { PopupProps } from '@atlaskit/editor-common/ui';
2
+ import { CellSelectionType } from './types';
3
+ interface GetPopupOptions {
4
+ left: number;
5
+ top: number;
6
+ selectionType?: CellSelectionType;
7
+ tableWrapper: HTMLElement | null;
8
+ }
9
+ export default function getPopupOptions({ left, top, selectionType, tableWrapper, }: GetPopupOptions): Partial<PopupProps>;
10
+ export {};
@@ -0,0 +1,54 @@
1
+ import { Component } from 'react';
2
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
+ import type { Selection } from '@atlaskit/editor-prosemirror/state';
4
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { RowStickyState } from '../../pm-plugins/sticky-headers';
6
+ import type { CellSelectionType } from './types';
7
+ export interface Props {
8
+ editorView: EditorView;
9
+ selection: Selection;
10
+ tableRef?: HTMLTableElement;
11
+ mountPoint?: HTMLElement;
12
+ boundariesElement?: HTMLElement;
13
+ scrollableElement?: HTMLElement;
14
+ stickyHeaders?: RowStickyState;
15
+ isNumberColumnEnabled?: boolean;
16
+ editorAnalyticsAPI?: EditorAnalyticsAPI;
17
+ }
18
+ export interface State {
19
+ selectionType?: CellSelectionType;
20
+ left: number;
21
+ top: number;
22
+ indexes: number[];
23
+ position?: string;
24
+ scrollLeft: number;
25
+ }
26
+ export declare function getSelectionType(selection: Selection): 'column' | 'row' | undefined;
27
+ declare class FloatingDeleteButton extends Component<Props, State> {
28
+ static displayName: string;
29
+ wrapper: HTMLElement | null;
30
+ constructor(props: Props);
31
+ shouldComponentUpdate(_: Props, nextState: State): boolean;
32
+ componentDidMount(): void;
33
+ componentDidUpdate(): void;
34
+ updateWrapper: () => void;
35
+ componentWillUnmount(): void;
36
+ onWrapperScrolled: (e: Event) => void;
37
+ /**
38
+ * We derivate the button state from the properties passed.
39
+ * We do this in here because we need this information in different places
40
+ * and this prevent to do multiple width calculations in the same component.
41
+ */
42
+ static getDerivedStateFromProps(nextProps: Readonly<Props>, prevState: State): Partial<State> | null;
43
+ private handleMouseEnter;
44
+ private handleMouseLeave;
45
+ /**
46
+ *
47
+ *
48
+ * @private
49
+ * @memberof FloatingDeleteButton
50
+ */
51
+ private handleClick;
52
+ render(): JSX.Element | null;
53
+ }
54
+ export default FloatingDeleteButton;
@@ -0,0 +1 @@
1
+ export type CellSelectionType = 'column' | 'row' | undefined;
@@ -0,0 +1,13 @@
1
+ import type { SyntheticEvent } from 'react';
2
+ import React from 'react';
3
+ import type { WrappedComponentProps } from 'react-intl-next';
4
+ export interface ButtonProps {
5
+ type: 'row' | 'column';
6
+ tableRef: HTMLElement;
7
+ onMouseDown: (event: SyntheticEvent<HTMLButtonElement>) => void;
8
+ hasStickyHeaders: boolean;
9
+ }
10
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
11
+ WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
12
+ };
13
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import type { PopupProps } from '@atlaskit/editor-common/ui';
2
+ declare function getPopupOptions(type: 'column' | 'row', index: number, hasNumberedColumns: boolean, tableContainer: HTMLElement | null): Partial<PopupProps>;
3
+ export default getPopupOptions;
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import { WrappedComponentProps } from 'react-intl-next';
3
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
+ import { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
5
+ import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
6
+ import { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
7
+ import { EditorView } from '@atlaskit/editor-prosemirror/view';
8
+ export interface Props {
9
+ editorView: EditorView;
10
+ getEditorContainerWidth: GetEditorContainerWidth;
11
+ tableRef?: HTMLElement;
12
+ tableNode?: PmNode;
13
+ insertColumnButtonIndex?: number;
14
+ insertRowButtonIndex?: number;
15
+ isHeaderColumnEnabled?: boolean;
16
+ isHeaderRowEnabled?: boolean;
17
+ mountPoint?: HTMLElement;
18
+ boundariesElement?: HTMLElement;
19
+ scrollableElement?: HTMLElement;
20
+ hasStickyHeaders?: boolean;
21
+ dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
22
+ editorAnalyticsAPI?: EditorAnalyticsAPI;
23
+ }
24
+ export declare class FloatingInsertButton extends React.Component<Props & WrappedComponentProps, any> {
25
+ static displayName: string;
26
+ constructor(props: Props & WrappedComponentProps);
27
+ render(): JSX.Element | null;
28
+ private getCellPosition;
29
+ private insertRow;
30
+ private insertColumn;
31
+ }
32
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
33
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
34
+ };
35
+ export default _default;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { WrappedComponentProps } from 'react-intl-next';
3
+ import { TableLayout } from '@atlaskit/adf-schema';
4
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
+ import { EditorView } from '@atlaskit/editor-prosemirror/view';
6
+ import { RowStickyState } from '../../pm-plugins/sticky-headers';
7
+ export interface Props {
8
+ editorView: EditorView;
9
+ targetRef?: HTMLElement;
10
+ mountPoint?: HTMLElement;
11
+ boundariesElement?: HTMLElement;
12
+ scrollableElement?: HTMLElement;
13
+ isResizing?: boolean;
14
+ layout?: TableLayout;
15
+ stickyHeader?: RowStickyState;
16
+ editorAnalyticsAPI?: EditorAnalyticsAPI;
17
+ }
18
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
19
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
20
+ };
21
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { WrappedComponentProps } from 'react-intl-next';
3
+ import { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ export interface Props {
5
+ editorView: EditorView;
6
+ tableRef?: HTMLTableElement;
7
+ isInDanger?: boolean;
8
+ isResizing?: boolean;
9
+ hoveredRows?: number[];
10
+ isHeaderColumnEnabled?: boolean;
11
+ isHeaderRowEnabled?: boolean;
12
+ stickyTop?: number;
13
+ }
14
+ export declare const CornerControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
15
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
16
+ };
@@ -0,0 +1,21 @@
1
+ import { Component } from 'react';
2
+ import { EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ export interface Props {
4
+ editorView: EditorView;
5
+ tableRef: HTMLTableElement;
6
+ tableActive?: boolean;
7
+ hoverRows: (rows: number[], danger?: boolean) => void;
8
+ hoveredRows?: number[];
9
+ selectRow: (row: number, expand: boolean) => void;
10
+ hasHeaderRow?: boolean;
11
+ isInDanger?: boolean;
12
+ isResizing?: boolean;
13
+ stickyTop?: number;
14
+ }
15
+ export default class NumberColumn extends Component<Props, any> {
16
+ render(): JSX.Element;
17
+ private hoverRows;
18
+ private selectRow;
19
+ private clearHoverSelection;
20
+ private getClassNames;
21
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import type { WrappedComponentProps } from 'react-intl-next';
3
+ import { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ export interface Props {
5
+ editorView: EditorView;
6
+ tableRef: HTMLTableElement;
7
+ selectRow: (row: number, expand: boolean) => void;
8
+ hoverRows: (rows: number[], danger?: boolean) => void;
9
+ hoveredRows?: number[];
10
+ isInDanger?: boolean;
11
+ isResizing?: boolean;
12
+ insertRowButtonIndex?: number;
13
+ stickyTop?: number;
14
+ }
15
+ export declare const RowControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
16
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
17
+ };
@@ -0,0 +1,39 @@
1
+ import { Component } from 'react';
2
+ import type { TableColumnOrdering } from '@atlaskit/custom-steps';
3
+ import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
+ import type { Selection } from '@atlaskit/editor-prosemirror/state';
5
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
+ import type { RowStickyState } from '../../pm-plugins/sticky-headers';
7
+ export interface Props {
8
+ editorView: EditorView;
9
+ getEditorFeatureFlags: GetEditorFeatureFlags;
10
+ selection?: Selection;
11
+ tableRef?: HTMLTableElement;
12
+ tableActive?: boolean;
13
+ isInDanger?: boolean;
14
+ isResizing?: boolean;
15
+ isHeaderRowEnabled?: boolean;
16
+ isHeaderColumnEnabled?: boolean;
17
+ isNumberColumnEnabled?: boolean;
18
+ hasHeaderRow?: boolean;
19
+ headerRowHeight?: number;
20
+ hoveredRows?: number[];
21
+ ordering?: TableColumnOrdering;
22
+ stickyHeader?: RowStickyState;
23
+ }
24
+ interface State {
25
+ tableHeight: number;
26
+ }
27
+ export default class TableFloatingControls extends Component<Props, State> {
28
+ static displayName: string;
29
+ private resizeObserver?;
30
+ componentDidMount(): void;
31
+ componentDidUpdate(): void;
32
+ private tryInitResizeObserver;
33
+ shouldComponentUpdate(nextProps: Props, nextState: State): boolean;
34
+ componentWillUnmount(): void;
35
+ render(): JSX.Element | null;
36
+ private selectRow;
37
+ private hoverRows;
38
+ }
39
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { FeatureFlags } from '@atlaskit/editor-common/types';
2
+ import type { ThemeProps } from '@atlaskit/theme/types';
3
+ export declare const insertColumnButtonOffset: number;
4
+ export declare const tableRowHeight = 44;
5
+ export declare const tableStyles: (props: ThemeProps & {
6
+ featureFlags?: FeatureFlags;
7
+ }) => import("@emotion/react").SerializedStyles;
8
+ export declare const tableFullPageEditorStyles: import("@emotion/react").SerializedStyles;
9
+ export declare const tableCommentEditorStyles: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Basic colors added to prevent content overflow in table cells.
3
+ */
4
+ export declare const tableCellBackgroundColor: import("@atlaskit/theme").ThemedValue<"var(--ds-surface)">;
5
+ export declare const tableHeaderCellBackgroundColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-accent-gray-subtlest)">;
6
+ export declare const tableToolbarColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-neutral-subtle)">;
7
+ export declare const tableTextColor: import("@atlaskit/theme").ThemedValue<"var(--ds-text-subtlest)">;
8
+ export declare const tableBorderColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-accent-gray-subtler)">;
9
+ export declare const tableFloatingControlsColor: "var(--ds-background-neutral)";
10
+ export declare const tableCellSelectedColor: import("@atlaskit/theme").ThemedValue<"var(--ds-blanket-selected)">;
11
+ export declare const tableToolbarSelectedColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-selected-pressed)">;
12
+ export declare const tableBorderSelectedColor: import("@atlaskit/theme").ThemedValue<"var(--ds-border-focused)">;
13
+ export declare const tableCellSelectedDeleteIconColor: import("@atlaskit/theme").ThemedValue<"var(--ds-icon-subtle)">;
14
+ export declare const tableCellSelectedDeleteIconBackground: import("@atlaskit/theme").ThemedValue<"var(--ds-background-accent-gray-subtlest)">;
15
+ export declare const tableCellDeleteColor: import("@atlaskit/theme").ThemedValue<"var(--ds-blanket-danger)">;
16
+ export declare const tableBorderDeleteColor: import("@atlaskit/theme").ThemedValue<"var(--ds-border-danger)">;
17
+ export declare const tableToolbarDeleteColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-danger-pressed)">;
18
+ export declare const tableCellHoverDeleteIconColor: import("@atlaskit/theme").ThemedValue<"var(--ds-icon-inverse)">;
19
+ export declare const tableCellHoverDeleteIconBackground: import("@atlaskit/theme").ThemedValue<"var(--ds-background-danger-bold)">;
20
+ export declare const tableBorderRadiusSize = 3;
21
+ export declare const tablePadding = 8;
22
+ export declare const tableScrollbarOffset = 15;
23
+ export declare const tableMarginFullWidthMode = 2;
24
+ export declare const tableInsertColumnButtonSize = 20;
25
+ export declare const tableDeleteButtonSize = 16;
26
+ export declare const tableDeleteButtonOffset = 6;
27
+ export declare const tableToolbarSize = 11;
28
+ export declare const tableControlsSpacing: number;
29
+ export declare const tableInsertColumnButtonOffset = 3;
30
+ export declare const layoutButtonSize = 32;
31
+ export declare const lineMarkerOffsetFromColumnControls = 13;
32
+ export declare const lineMarkerSize = 4;
33
+ export declare const columnControlsDecorationHeight = 25;
34
+ export declare const columnControlsZIndex: number;
35
+ export declare const columnControlsSelectedZIndex: number;
36
+ export declare const columnResizeHandleZIndex: number;
37
+ export declare const resizeHandlerAreaWidth: number;
38
+ export declare const resizeLineWidth = 2;
39
+ export declare const resizeHandlerZIndex: number;
40
+ export declare const contextualMenuTriggerSize = 16;
41
+ export declare const contextualMenuDropdownWidth = 180;
42
+ export declare const stickyRowZIndex: number;
43
+ export declare const stickyRowOffsetTop = 8;
44
+ export declare const stickyHeaderBorderBottomWidth = 1;
45
+ export declare const tableOverflowShadowWidth = 8;
46
+ export declare const tableOverflowShadowWidthWide = 32;
47
+ export declare const TABLE_SNAP_GAP = 9;
48
+ export declare const TABLE_HIGHLIGHT_GAP = 10;
49
+ export declare const TABLE_HIGHLIGHT_TOLERANCE = 2;
50
+ export declare const STICKY_HEADER_TOGGLE_TOLERANCE_MS = 5;
@@ -0,0 +1,63 @@
1
+ declare const _default: {
2
+ insertColumn: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ removeColumns: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ insertRow: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
17
+ removeRows: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ cellOptions: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
27
+ confirmDeleteLinkedModalOKButton: {
28
+ id: string;
29
+ defaultMessage: string;
30
+ description: string;
31
+ };
32
+ confirmDeleteLinkedModalMessage: {
33
+ id: string;
34
+ defaultMessage: string;
35
+ description: string;
36
+ };
37
+ confirmDeleteLinkedModalMessagePrefix: {
38
+ id: string;
39
+ defaultMessage: string;
40
+ description: string;
41
+ };
42
+ confirmModalCheckboxLabel: {
43
+ id: string;
44
+ defaultMessage: string;
45
+ description: string;
46
+ };
47
+ deleteElementTitle: {
48
+ id: string;
49
+ defaultMessage: string;
50
+ description: string;
51
+ };
52
+ unnamedSource: {
53
+ id: string;
54
+ defaultMessage: string;
55
+ description: string;
56
+ };
57
+ adjustColumns: {
58
+ id: string;
59
+ defaultMessage: string;
60
+ description: string;
61
+ };
62
+ };
63
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import type { ThemeProps } from '@atlaskit/theme/types';
2
+ export declare const InsertMarker: (props: ThemeProps, cssString?: string) => import("@emotion/react").SerializedStyles;
3
+ export declare const HeaderButton: (props: ThemeProps, cssString?: string) => import("@emotion/react").SerializedStyles;
4
+ export declare const HeaderButtonHover: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
5
+ export declare const HeaderButtonDanger: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
6
+ export declare const insertColumnButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
7
+ export declare const insertRowButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
8
+ export declare const columnControlsLineMarker: () => import("@emotion/react").SerializedStyles;
9
+ export declare const DeleteButton: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
10
+ export declare const OverflowShadow: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
11
+ export declare const columnControlsDecoration: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
12
+ export declare const hoveredDeleteButton: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
13
+ export declare const hoveredCell: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
14
+ export declare const hoveredWarningCell: import("@emotion/react").SerializedStyles;
15
+ export declare const resizeHandle: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
@@ -0,0 +1,45 @@
1
+ import type { AnalyticsEventPayload, AnalyticsEventPayloadCallback, EditorAnalyticsAPI, TableEventPayload } from '@atlaskit/editor-common/analytics';
2
+ import { HigherOrderCommand } from '@atlaskit/editor-common/types';
3
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
+ import { Selection } from '@atlaskit/editor-prosemirror/state';
5
+ import { TableMap } from '@atlaskit/editor-tables/table-map';
6
+ export declare function getSelectedTableInfo(selection: Selection): {
7
+ table: import("prosemirror-utils").ContentNodeWithPos | undefined;
8
+ map: TableMap | undefined;
9
+ totalRowCount: number;
10
+ totalColumnCount: number;
11
+ };
12
+ export declare function getSelectedCellInfo(selection: Selection): {
13
+ totalRowCount: number;
14
+ totalColumnCount: number;
15
+ horizontalCells: number;
16
+ verticalCells: number;
17
+ totalCells: number;
18
+ };
19
+ export declare const withEditorAnalyticsAPI: (payload: AnalyticsEventPayload | AnalyticsEventPayloadCallback) => (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => HigherOrderCommand;
20
+ interface UseMeasureFramerateConfig {
21
+ maxSamples?: number;
22
+ minFrames?: number;
23
+ minTimeMs?: number;
24
+ sampleRateMs?: number;
25
+ timeoutMs?: number;
26
+ }
27
+ export declare const generateResizedPayload: (props: {
28
+ originalNode: PMNode;
29
+ resizedNode: PMNode;
30
+ }) => TableEventPayload;
31
+ export declare const reduceResizeFrameRateSamples: (frameRateSamples: number[]) => number[];
32
+ export declare const generateResizeFrameRatePayloads: (props: {
33
+ docSize: number;
34
+ frameRateSamples: number[];
35
+ originalNode: PMNode;
36
+ }) => TableEventPayload[];
37
+ /**
38
+ * Measures the framerate of a component over a given time period.
39
+ */
40
+ export declare const useMeasureFramerate: (config?: UseMeasureFramerateConfig) => {
41
+ startMeasure: () => void;
42
+ endMeasure: () => number[];
43
+ countFrames: () => void;
44
+ };
45
+ export {};
@@ -0,0 +1,29 @@
1
+ import { NodeRange, NodeType } from '@atlaskit/editor-prosemirror/model';
2
+ import { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
3
+ interface IsTableCollapsibleResult {
4
+ tableIsCollapsible: boolean;
5
+ range?: NodeRange;
6
+ findWrappingRes?: Array<{
7
+ type: NodeType;
8
+ attrs?: {
9
+ [key: string]: any;
10
+ } | null;
11
+ }> | null | undefined;
12
+ }
13
+ /**
14
+ * Checks whether we can wrap the selected table into an expand via
15
+ * prosemirror-transform's `findWrapping` helper
16
+ */
17
+ export declare const isTableCollapsible: (tr: Transaction | ReadonlyTransaction) => IsTableCollapsibleResult;
18
+ /**
19
+ * Collapses the selected table into an expand given a transaction via
20
+ * `Transform.wrap`.
21
+ *
22
+ * Will return undefined if it cannot determine the relevant table from a
23
+ * selection, or if the table itself isn't collapsible.
24
+ *
25
+ * @param tr
26
+ * @returns Transaction | undefined
27
+ */
28
+ export declare const collapseSelectedTable: (tr: Transaction) => Transaction | undefined;
29
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Selection } from '@atlaskit/editor-prosemirror/state';
2
+ import { EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ export declare const getColumnsWidths: (view: EditorView) => Array<number | undefined>;
4
+ export declare const isColumnDeleteButtonVisible: (selection: Selection) => boolean;
5
+ export declare const getColumnDeleteButtonParams: (columnsWidths: Array<number | undefined>, selection: Selection) => {
6
+ left: number;
7
+ indexes: number[];
8
+ } | null;
9
+ export declare const getColumnClassNames: (index: number, selection: Selection, hoveredColumns?: number[], isInDanger?: boolean, isResizing?: boolean) => string;
10
+ export declare const colWidthsForRow: (tr: HTMLTableRowElement) => string;
@@ -0,0 +1,19 @@
1
+ import type { IntlShape } from 'react-intl-next';
2
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
+ import type { ReadonlyTransaction, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
4
+ import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
5
+ import { Decoration } from '@atlaskit/editor-prosemirror/view';
6
+ import type { Cell, CellColumnPositioning } from '../types';
7
+ import { TableDecorations } from '../types';
8
+ export declare const findColumnControlSelectedDecoration: (decorationSet: DecorationSet) => Decoration[];
9
+ export declare const findControlsHoverDecoration: (decorationSet: DecorationSet) => Decoration[];
10
+ export declare const createCellHoverDecoration: (cells: Cell[]) => Decoration[];
11
+ export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row' | 'column' | 'table', tr: Transaction | ReadonlyTransaction, danger?: boolean, selected?: boolean) => Decoration[];
12
+ export declare const createColumnSelectedDecoration: (tr: Transaction | ReadonlyTransaction) => Decoration[];
13
+ export declare const createColumnControlsDecoration: (selection: Selection) => Decoration[];
14
+ export declare const updateDecorations: (node: PmNode, decorationSet: DecorationSet, decorations: Decoration[], key: TableDecorations) => DecorationSet;
15
+ export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, 'left'>, includeTooltip: boolean | undefined, getIntl: () => IntlShape) => [
16
+ Decoration[],
17
+ Decoration[]
18
+ ];
19
+ export declare const createColumnLineResize: (selection: Selection, cellColumnPositioning: Omit<CellColumnPositioning, 'left'>) => Decoration[];
@@ -0,0 +1,26 @@
1
+ import type { ElementContentRects } from '../types';
2
+ export declare const isCell: (node: HTMLElement | null) => boolean;
3
+ export declare const isCornerButton: (node: HTMLElement | null) => boolean;
4
+ export declare const isInsertRowButton: (node: HTMLElement | null) => boolean | HTMLElement | null;
5
+ export declare const getColumnOrRowIndex: (target: HTMLElement) => [
6
+ number,
7
+ number
8
+ ];
9
+ export declare const isColumnControlsDecorations: (node: HTMLElement | null) => boolean;
10
+ export declare const isRowControlsButton: (node: HTMLElement | null) => boolean;
11
+ export declare const isResizeHandleDecoration: (node: HTMLElement | null) => boolean;
12
+ export declare const isTableControlsButton: (node: HTMLElement | null) => boolean;
13
+ export declare const isTableContainerOrWrapper: (node: HTMLElement | null) => boolean;
14
+ export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, elementContentRects?: ElementContentRects, gapInPixels?: number) => 'left' | 'right' | null;
15
+ export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => 'top' | 'bottom' | null;
16
+ export declare const updateResizeHandles: (tableRef?: HTMLElement) => void;
17
+ export declare const hasResizeHandler: ({ columnEndIndexTarget, target, }: {
18
+ columnEndIndexTarget: number;
19
+ target: HTMLElement;
20
+ }) => boolean;
21
+ export type TableDOMElements = {
22
+ wrapper: HTMLDivElement;
23
+ table: HTMLTableElement;
24
+ };
25
+ export declare const getTree: (tr: HTMLTableRowElement) => TableDOMElements | null;
26
+ export declare const getTop: (element: HTMLElement | Window | undefined) => number;