@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,32 @@
1
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
+
3
+ import { DragAndDropActionType } from './actions';
4
+ import type { DropTargetType } from './consts';
5
+ import { createCommand } from './plugin-factory';
6
+
7
+ // TODO: This command is a placeholder example. Please replace this if required.
8
+ export const setDropTarget = (
9
+ type: DropTargetType,
10
+ index: number,
11
+ tr?: Transaction,
12
+ ) =>
13
+ createCommand(
14
+ {
15
+ type: DragAndDropActionType.SET_DROP_TARGET,
16
+ data: {
17
+ type,
18
+ index,
19
+ },
20
+ },
21
+ (originalTr: Transaction) =>
22
+ (tr || originalTr).setMeta('addToHistory', false),
23
+ );
24
+
25
+ export const clearDropTarget = (tr?: Transaction) =>
26
+ createCommand(
27
+ {
28
+ type: DragAndDropActionType.CLEAR_DROP_TARGET,
29
+ },
30
+ (originalTr: Transaction) =>
31
+ (tr || originalTr).setMeta('addToHistory', false),
32
+ );
@@ -0,0 +1,8 @@
1
+ export const DropTargetType = {
2
+ NONE: 'none',
3
+ ROW: 'row',
4
+ COLUMN: 'column',
5
+ } as const;
6
+
7
+ export type DropTargetType =
8
+ (typeof DropTargetType)[keyof typeof DropTargetType];
@@ -0,0 +1,5 @@
1
+ export { createPlugin } from './plugin';
2
+ export { pluginKey } from './plugin-key';
3
+ export type { DragAndDropPluginState } from './types';
4
+
5
+ export { setDropTarget, clearDropTarget } from './commands';
@@ -0,0 +1,8 @@
1
+ import { pluginFactory } from '@atlaskit/editor-common/utils';
2
+
3
+ import { pluginKey } from './plugin-key';
4
+ import reducer from './reducer';
5
+
6
+ const { createPluginState, createCommand } = pluginFactory(pluginKey, reducer);
7
+
8
+ export { createPluginState, createCommand };
@@ -0,0 +1,7 @@
1
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
+
3
+ import type { DragAndDropPluginState } from './types';
4
+
5
+ export const pluginKey = new PluginKey<DragAndDropPluginState>(
6
+ 'dragAndDropPlugin',
7
+ );
@@ -0,0 +1,32 @@
1
+ import type {
2
+ Dispatch,
3
+ EventDispatcher,
4
+ } from '@atlaskit/editor-common/event-dispatcher';
5
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
6
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
7
+
8
+ import { DropTargetType } from './consts';
9
+ import { createPluginState } from './plugin-factory';
10
+ import { pluginKey } from './plugin-key';
11
+
12
+ export const createPlugin = (
13
+ dispatch: Dispatch,
14
+ eventDispatcher: EventDispatcher,
15
+ ) => {
16
+ return new SafePlugin({
17
+ state: createPluginState(dispatch, {
18
+ // TODO: This is example placeholder state. We could use this to track which row/col is currently set as the drop target
19
+ // This would result in a blue highlight being displayed on the corrisponding row/column to single the drop target location.
20
+ dropTargetType: DropTargetType.NONE,
21
+ dropTargetIndex: 0,
22
+ }),
23
+ key: pluginKey,
24
+ view: (editorView: EditorView) => {
25
+ // TODO: Add Pragmatic DnD monitor when the view is constructed.
26
+ return {
27
+ // TODO: Cleanup monitor instance
28
+ // destroy: cleanup,
29
+ };
30
+ },
31
+ });
32
+ };
@@ -0,0 +1,26 @@
1
+ import type { DragAndDropPluginAction } from './actions';
2
+ import { DragAndDropActionType } from './actions';
3
+ import { DropTargetType } from './consts';
4
+ import type { DragAndDropPluginState } from './types';
5
+
6
+ export default (
7
+ pluginState: DragAndDropPluginState,
8
+ action: DragAndDropPluginAction,
9
+ ): DragAndDropPluginState => {
10
+ switch (action.type) {
11
+ case DragAndDropActionType.SET_DROP_TARGET:
12
+ return {
13
+ ...pluginState,
14
+ dropTargetType: action.data.type,
15
+ dropTargetIndex: action.data.index,
16
+ };
17
+ case DragAndDropActionType.CLEAR_DROP_TARGET:
18
+ return {
19
+ ...pluginState,
20
+ dropTargetType: DropTargetType.NONE,
21
+ dropTargetIndex: 0,
22
+ };
23
+ default:
24
+ return pluginState;
25
+ }
26
+ };
@@ -0,0 +1,6 @@
1
+ import type { DropTargetType } from './consts';
2
+
3
+ export interface DragAndDropPluginState {
4
+ dropTargetType: DropTargetType;
5
+ dropTargetIndex: number;
6
+ }
@@ -25,10 +25,8 @@ import {
25
25
  import type {
26
26
  GetEditorContainerWidth,
27
27
  GetEditorFeatureFlags,
28
- getPosHandler,
29
28
  } from '@atlaskit/editor-common/types';
30
29
  import { browser, closestElement } from '@atlaskit/editor-common/utils';
31
- import type { Node as ProseMirrorNode } from '@atlaskit/editor-prosemirror/model';
32
30
  import type {
33
31
  EditorState,
34
32
  TextSelection,
@@ -67,7 +65,8 @@ import {
67
65
  whenTableInFocus,
68
66
  } from '../event-handlers';
69
67
  import { createTableView } from '../nodeviews/table';
70
- import TableCellNodeView from '../nodeviews/tableCell';
68
+ import TableCell from '../nodeviews/TableCell';
69
+ import TableRow from '../nodeviews/TableRow';
71
70
  import { pluginKey as decorationsPluginKey } from '../pm-plugins/decorations/plugin';
72
71
  import { fixTables, replaceSelectedTable } from '../transforms';
73
72
  import type {
@@ -103,6 +102,7 @@ export const createPlugin = (
103
102
  fullWidthModeEnabled?: boolean,
104
103
  tableResizingEnabled?: boolean,
105
104
  previousFullWidthModeEnabled?: boolean,
105
+ dragAndDropEnabled?: boolean,
106
106
  editorAnalyticsAPI?: EditorAnalyticsAPI,
107
107
  pluginInjectionApi?: PluginInjectionAPI,
108
108
  ) => {
@@ -116,6 +116,7 @@ export const createPlugin = (
116
116
  isTableResizingEnabled: tableResizingEnabled,
117
117
  isHeaderRowEnabled: !!pluginConfig.allowHeaderRow,
118
118
  isHeaderColumnEnabled: false,
119
+ isDragAndDropEnabled: dragAndDropEnabled,
119
120
  ...defaultTableSelection,
120
121
  getIntl,
121
122
  });
@@ -133,19 +134,6 @@ export const createPlugin = (
133
134
  })
134
135
  : undefined;
135
136
 
136
- const tableCellNodeview = {
137
- tableCell: (
138
- node: ProseMirrorNode,
139
- view: EditorView,
140
- getPos: getPosHandler,
141
- ) => new TableCellNodeView(node, view, getPos, observer),
142
- tableHeader: (
143
- node: ProseMirrorNode,
144
- view: EditorView,
145
- getPos: getPosHandler,
146
- ) => new TableCellNodeView(node, view, getPos, observer),
147
- };
148
-
149
137
  // Used to prevent invalid table cell spans being reported more than once per editor/document
150
138
  const invalidTableIds: string[] = [];
151
139
  let editorViewRef: EditorView | null = null;
@@ -365,9 +353,7 @@ export const createPlugin = (
365
353
  }
366
354
  return false;
367
355
  },
368
-
369
356
  nodeViews: {
370
- ...tableCellNodeview,
371
357
  table: (node, view, getPos) =>
372
358
  createTableView(
373
359
  node,
@@ -379,8 +365,13 @@ export const createPlugin = (
379
365
  getEditorFeatureFlags,
380
366
  pluginInjectionApi,
381
367
  ),
368
+ tableRow: (node, view, getPos) =>
369
+ new TableRow(node, view, getPos, eventDispatcher),
370
+ tableCell: (node, view, getPos) =>
371
+ new TableCell(node, view, getPos, eventDispatcher, observer),
372
+ tableHeader: (node, view, getPos) =>
373
+ new TableCell(node, view, getPos, eventDispatcher, observer),
382
374
  },
383
-
384
375
  handleDOMEvents: {
385
376
  focus: handleFocus,
386
377
  blur: handleBlur,
@@ -4,4 +4,3 @@ export type { StickyPluginState, RowStickyState } from './types';
4
4
 
5
5
  export { findStickyHeaderForTable } from './util';
6
6
  export { updateStickyState, removeStickyState } from './commands';
7
- export { TableRowNodeView } from './nodeviews/tableRow';
@@ -1,11 +1,10 @@
1
- import {
1
+ import type {
2
2
  Dispatch,
3
3
  EventDispatcher,
4
4
  } from '@atlaskit/editor-common/event-dispatcher';
5
5
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
6
6
  import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
7
7
 
8
- import { TableRowNodeView } from './nodeviews/tableRow';
9
8
  import { pluginKey } from './plugin-key';
10
9
  import { createPluginState } from './plugin-state';
11
10
 
@@ -18,12 +17,5 @@ export const createPlugin = (
18
17
  return new SafePlugin({
19
18
  state: createPluginState(dispatch, initialState),
20
19
  key: pluginKey,
21
- props: {
22
- nodeViews: {
23
- tableRow: (node, view, getPos) => {
24
- return new TableRowNodeView(node, view, getPos, eventDispatcher);
25
- },
26
- },
27
- },
28
20
  });
29
21
  };
@@ -121,6 +121,8 @@ export interface TablePluginState {
121
121
  isBreakoutEnabled?: boolean;
122
122
  wasFullWidthModeEnabled?: boolean;
123
123
  isTableResizingEnabled?: boolean;
124
+
125
+ isDragAndDropEnabled?: boolean;
124
126
  }
125
127
 
126
128
  export type TablePluginAction =
@@ -203,3 +203,41 @@ export const hasResizeHandler = ({
203
203
 
204
204
  return true;
205
205
  };
206
+
207
+ export type TableDOMElements = {
208
+ wrapper: HTMLDivElement;
209
+ table: HTMLTableElement;
210
+ };
211
+
212
+ export const getTree = (tr: HTMLTableRowElement): TableDOMElements | null => {
213
+ // pm renders into tbody, owned by react
214
+ const tbody = tr.parentElement;
215
+ if (!tbody) {
216
+ return null;
217
+ }
218
+
219
+ // rendered by react
220
+ const table = tbody.parentElement;
221
+ if (!table) {
222
+ return null;
223
+ }
224
+
225
+ // rendered by react
226
+ const wrapper = table.parentElement;
227
+ if (!wrapper) {
228
+ return null;
229
+ }
230
+
231
+ return {
232
+ wrapper: wrapper as HTMLDivElement,
233
+ table: table as HTMLTableElement,
234
+ };
235
+ };
236
+
237
+ export const getTop = (element: HTMLElement | Window | undefined): number => {
238
+ if (!element || element instanceof Window) {
239
+ return 0;
240
+ }
241
+
242
+ return element?.getBoundingClientRect?.()?.top ?? 0;
243
+ };
@@ -26,6 +26,8 @@ export {
26
26
  tablesHaveDifferentColumnWidths,
27
27
  tablesHaveDifferentNoOfColumns,
28
28
  isTableNested,
29
+ anyChildCellMergedAcrossRow,
30
+ supportedHeaderRow,
29
31
  } from './nodes';
30
32
  export {
31
33
  unwrapContentFromTable,
@@ -1,5 +1,9 @@
1
- import { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
2
- import { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
1
+ import { mapChildren } from '@atlaskit/editor-common/utils';
2
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
+ import type {
4
+ EditorState,
5
+ Selection,
6
+ } from '@atlaskit/editor-prosemirror/state';
3
7
  import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
4
8
  import { TableMap } from '@atlaskit/editor-tables/table-map';
5
9
  import { findTable } from '@atlaskit/editor-tables/utils';
@@ -149,3 +153,27 @@ export const isTableNested = (state: EditorState, tablePos = 0): boolean => {
149
153
  parent.type === nodeTypes.bodiedExtension
150
154
  );
151
155
  };
156
+
157
+ export const anyChildCellMergedAcrossRow = (node: PmNode): boolean =>
158
+ mapChildren(node, (child) => child.attrs.rowspan || 0).some(
159
+ (rowspan) => rowspan > 1,
160
+ );
161
+
162
+ /**
163
+ * Check if a given node is a header row with this definition:
164
+ * - all children are tableHeader cells
165
+ * - no table cells have been have merged with other table row cells
166
+ *
167
+ * @param node ProseMirror node
168
+ * @return boolean if it meets definition
169
+ */
170
+ export const supportedHeaderRow = (node: PmNode): boolean => {
171
+ const allHeaders = mapChildren(
172
+ node,
173
+ (child) => child.type.name === 'tableHeader',
174
+ ).every(Boolean);
175
+
176
+ const someMerged = anyChildCellMergedAcrossRow(node);
177
+
178
+ return allHeaders && !someMerged;
179
+ };
@@ -0,0 +1,100 @@
1
+ ## API Report File for "@atlaskit/editor-plugin-table"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
8
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
9
+ import type { Command } from '@atlaskit/editor-common/types';
10
+ import type { ContentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
11
+ import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
12
+ import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
13
+ import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
14
+ import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
15
+ import type { TableLayout } from '@atlaskit/adf-schema';
16
+ import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
17
+
18
+ // @public (undocumented)
19
+ type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
20
+
21
+ // @public (undocumented)
22
+ type PermittedLayoutsDescriptor = 'all' | TableLayout[];
23
+
24
+ // @public (undocumented)
25
+ interface PluginConfig {
26
+ // (undocumented)
27
+ advanced?: boolean;
28
+ // (undocumented)
29
+ allowAddColumnWithCustomStep?: boolean;
30
+ // (undocumented)
31
+ allowBackgroundColor?: boolean;
32
+ // (undocumented)
33
+ allowCellOptionsInFloatingToolbar?: boolean;
34
+ // (undocumented)
35
+ allowCollapse?: boolean;
36
+ // (undocumented)
37
+ allowColumnResizing?: boolean;
38
+ // (undocumented)
39
+ allowColumnSorting?: boolean;
40
+ // (undocumented)
41
+ allowControls?: boolean;
42
+ // (undocumented)
43
+ allowDistributeColumns?: boolean;
44
+ // (undocumented)
45
+ allowHeaderColumn?: boolean;
46
+ // (undocumented)
47
+ allowHeaderRow?: boolean;
48
+ // (undocumented)
49
+ allowMergeCells?: boolean;
50
+ // (undocumented)
51
+ allowNumberColumn?: boolean;
52
+ // (undocumented)
53
+ isHeaderRowRequired?: boolean;
54
+ // (undocumented)
55
+ permittedLayouts?: PermittedLayoutsDescriptor;
56
+ // (undocumented)
57
+ stickyHeaders?: boolean;
58
+ }
59
+
60
+ // @public (undocumented)
61
+ export type TablePlugin = NextEditorPlugin<'table', {
62
+ pluginConfiguration: TablePluginOptions | undefined;
63
+ actions: {
64
+ insertTable: InsertTableAction;
65
+ };
66
+ dependencies: [
67
+ AnalyticsPlugin,
68
+ ContentInsertionPlugin,
69
+ WidthPlugin,
70
+ GuidelinePlugin,
71
+ SelectionPlugin
72
+ ];
73
+ }>;
74
+
75
+ // @public (undocumented)
76
+ interface TablePluginOptions {
77
+ // (undocumented)
78
+ allowContextualMenu?: boolean;
79
+ // (undocumented)
80
+ breakoutEnabled?: boolean;
81
+ // (undocumented)
82
+ dragAndDropEnabled?: boolean;
83
+ // (undocumented)
84
+ fullWidthEnabled?: boolean;
85
+ // (undocumented)
86
+ getEditorFeatureFlags?: GetEditorFeatureFlags;
87
+ // (undocumented)
88
+ tableOptions: PluginConfig;
89
+ // (undocumented)
90
+ tableResizingEnabled?: boolean;
91
+ // (undocumented)
92
+ wasFullWidthEnabled?: boolean;
93
+ }
94
+
95
+ // @public
96
+ export const tablesPlugin: TablePlugin;
97
+
98
+ // (No @packageDocumentation comment for this package)
99
+
100
+ ```
@@ -1,99 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _uuid = _interopRequireDefault(require("uuid"));
12
- var _adfSchema = require("@atlaskit/adf-schema");
13
- var _model = require("@atlaskit/editor-prosemirror/model");
14
- var DEFAULT_COL_SPAN = 1;
15
- var DEFAULT_ROW_SPAN = 1;
16
- var TableCellNodeView = exports.default = /*#__PURE__*/function () {
17
- function TableCellNodeView(node, view, getPos, observer) {
18
- (0, _classCallCheck2.default)(this, TableCellNodeView);
19
- this.view = view;
20
- this.node = node;
21
- var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, node.type.spec.toDOM(node)),
22
- dom = _DOMSerializer$render.dom,
23
- contentDOM = _DOMSerializer$render.contentDOM;
24
- this.getPos = getPos;
25
- this.dom = dom;
26
- this.contentDOM = contentDOM;
27
- if (observer) {
28
- this.contentDOM.id = (0, _uuid.default)();
29
- this.observer = observer;
30
- observer.observe(this.contentDOM);
31
- }
32
- }
33
- (0, _createClass2.default)(TableCellNodeView, [{
34
- key: "updateNodeView",
35
- value: function updateNodeView(node) {
36
- var _this = this;
37
- if (this.node.type !== node.type) {
38
- return false;
39
- }
40
- var attrs = (0, _adfSchema.getCellDomAttrs)(this.node);
41
- var nextAttrs = (0, _adfSchema.getCellDomAttrs)(node);
42
- var _getCellAttrs = (0, _adfSchema.getCellAttrs)(this.dom),
43
- colspan = _getCellAttrs.colspan,
44
- rowspan = _getCellAttrs.rowspan;
45
-
46
- // need to rerender when colspan/rowspan in dom are different from the node attrs
47
- // this can happen when undoing merge cells
48
- if (colspan !== (node.attrs.colspan || DEFAULT_COL_SPAN) || rowspan !== (node.attrs.rowspan || DEFAULT_ROW_SPAN)) {
49
- return false;
50
- }
51
-
52
- // added + changed attributes
53
- var addedAttrs = Object.entries(nextAttrs).filter(function (_ref) {
54
- var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
55
- key = _ref2[0],
56
- value = _ref2[1];
57
- return attrs[key] !== value;
58
- });
59
- var removedAttrs = Object.keys(attrs).filter(function (key) {
60
- return !nextAttrs.hasOwnProperty(key);
61
- });
62
- if (addedAttrs.length || removedAttrs.length) {
63
- addedAttrs.forEach(function (_ref3) {
64
- var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
65
- key = _ref4[0],
66
- value = _ref4[1];
67
- return _this.dom.setAttribute(key, value || '');
68
- });
69
- removedAttrs.forEach(function (key) {
70
- return _this.dom.removeAttribute(key);
71
- });
72
- return true;
73
- }
74
-
75
- // Return true to not re-render this node view
76
- if (this.node.sameMarkup(node)) {
77
- return true;
78
- }
79
- return false;
80
- }
81
- }, {
82
- key: "update",
83
- value: function update(node) {
84
- var didUpdate = this.updateNodeView(node);
85
- if (didUpdate) {
86
- this.node = node;
87
- }
88
- return didUpdate;
89
- }
90
- }, {
91
- key: "destroy",
92
- value: function destroy() {
93
- if (this.observer) {
94
- this.observer.unobserve(this.contentDOM);
95
- }
96
- }
97
- }]);
98
- return TableCellNodeView;
99
- }();
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getTree = exports.getTop = void 0;
7
- var getTree = exports.getTree = function getTree(tr) {
8
- // pm renders into tbody, owned by react
9
- var tbody = tr.parentElement;
10
- if (!tbody) {
11
- return null;
12
- }
13
-
14
- // rendered by react
15
- var table = tbody.parentElement;
16
- if (!table) {
17
- return null;
18
- }
19
-
20
- // rendered by react
21
- var wrapper = table.parentElement;
22
- if (!wrapper) {
23
- return null;
24
- }
25
- return {
26
- wrapper: wrapper,
27
- table: table
28
- };
29
- };
30
- var getTop = exports.getTop = function getTop(element) {
31
- if (!element || element instanceof Window) {
32
- return 0;
33
- }
34
- return element.getBoundingClientRect().top;
35
- };
@@ -1,29 +0,0 @@
1
- export const getTree = tr => {
2
- // pm renders into tbody, owned by react
3
- const tbody = tr.parentElement;
4
- if (!tbody) {
5
- return null;
6
- }
7
-
8
- // rendered by react
9
- const table = tbody.parentElement;
10
- if (!table) {
11
- return null;
12
- }
13
-
14
- // rendered by react
15
- const wrapper = table.parentElement;
16
- if (!wrapper) {
17
- return null;
18
- }
19
- return {
20
- wrapper: wrapper,
21
- table: table
22
- };
23
- };
24
- export const getTop = element => {
25
- if (!element || element instanceof Window) {
26
- return 0;
27
- }
28
- return element.getBoundingClientRect().top;
29
- };