@atlaskit/editor-plugin-table 1.3.0 → 1.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 (293) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/commands/package.json +2 -2
  3. package/dist/cjs/plugins/table/commands/misc.js +1 -2
  4. package/dist/cjs/plugins/table/index.js +25 -34
  5. package/dist/cjs/plugins/table/transforms/column-width.js +0 -17
  6. package/dist/cjs/plugins/table/transforms/delete-columns.js +4 -13
  7. package/dist/cjs/plugins/table/transforms/delete-rows.js +4 -13
  8. package/dist/cjs/plugins/table/transforms/fix-tables.js +6 -24
  9. package/dist/cjs/plugins/table/transforms/index.js +0 -13
  10. package/dist/cjs/plugins/table/transforms/merge.js +5 -20
  11. package/dist/cjs/version.json +1 -1
  12. package/dist/es2019/plugins/table/commands/misc.js +2 -3
  13. package/dist/es2019/plugins/table/index.js +21 -33
  14. package/dist/es2019/plugins/table/transforms/column-width.js +0 -17
  15. package/dist/es2019/plugins/table/transforms/delete-columns.js +4 -13
  16. package/dist/es2019/plugins/table/transforms/delete-rows.js +4 -13
  17. package/dist/es2019/plugins/table/transforms/fix-tables.js +0 -14
  18. package/dist/es2019/plugins/table/transforms/index.js +1 -2
  19. package/dist/es2019/plugins/table/transforms/merge.js +5 -21
  20. package/dist/es2019/version.json +1 -1
  21. package/dist/esm/plugins/table/commands/misc.js +2 -3
  22. package/dist/esm/plugins/table/index.js +25 -34
  23. package/dist/esm/plugins/table/transforms/column-width.js +0 -17
  24. package/dist/esm/plugins/table/transforms/delete-columns.js +4 -13
  25. package/dist/esm/plugins/table/transforms/delete-rows.js +4 -13
  26. package/dist/esm/plugins/table/transforms/fix-tables.js +0 -17
  27. package/dist/esm/plugins/table/transforms/index.js +1 -2
  28. package/dist/esm/plugins/table/transforms/merge.js +5 -21
  29. package/dist/esm/version.json +1 -1
  30. package/dist/types/i18n/cs.d.ts +6 -6
  31. package/dist/types/i18n/da.d.ts +6 -6
  32. package/dist/types/i18n/de.d.ts +6 -6
  33. package/dist/types/i18n/en.d.ts +6 -6
  34. package/dist/types/i18n/en_GB.d.ts +6 -6
  35. package/dist/types/i18n/es.d.ts +6 -6
  36. package/dist/types/i18n/fi.d.ts +6 -6
  37. package/dist/types/i18n/fr.d.ts +6 -6
  38. package/dist/types/i18n/hu.d.ts +6 -6
  39. package/dist/types/i18n/it.d.ts +6 -6
  40. package/dist/types/i18n/ja.d.ts +6 -6
  41. package/dist/types/i18n/ko.d.ts +6 -6
  42. package/dist/types/i18n/nb.d.ts +6 -6
  43. package/dist/types/i18n/nl.d.ts +6 -6
  44. package/dist/types/i18n/pl.d.ts +6 -6
  45. package/dist/types/i18n/pt_BR.d.ts +6 -6
  46. package/dist/types/i18n/ru.d.ts +6 -6
  47. package/dist/types/i18n/sv.d.ts +6 -6
  48. package/dist/types/i18n/th.d.ts +6 -6
  49. package/dist/types/i18n/tr.d.ts +6 -6
  50. package/dist/types/i18n/uk.d.ts +6 -6
  51. package/dist/types/i18n/vi.d.ts +6 -6
  52. package/dist/types/i18n/zh.d.ts +6 -6
  53. package/dist/types/i18n/zh_TW.d.ts +6 -6
  54. package/dist/types/plugins/table/commands/clear.d.ts +1 -1
  55. package/dist/types/plugins/table/commands/hover.d.ts +3 -3
  56. package/dist/types/plugins/table/commands/misc.d.ts +4 -4
  57. package/dist/types/plugins/table/commands-with-analytics.d.ts +2 -2
  58. package/dist/types/plugins/table/event-handlers.d.ts +3 -3
  59. package/dist/types/plugins/table/index.d.ts +9 -0
  60. package/dist/types/plugins/table/nodeviews/OverflowShadowsObserver.d.ts +2 -2
  61. package/dist/types/plugins/table/nodeviews/table.d.ts +1 -1
  62. package/dist/types/plugins/table/nodeviews/types.d.ts +1 -1
  63. package/dist/types/plugins/table/nodeviews/update-overflow-shadows.d.ts +1 -1
  64. package/dist/types/plugins/table/pm-plugins/decorations/utils/types.d.ts +1 -1
  65. package/dist/types/plugins/table/pm-plugins/main.d.ts +1 -1
  66. package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +1 -1
  67. package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -1
  68. package/dist/types/plugins/table/pm-plugins/sticky-headers/types.d.ts +5 -5
  69. package/dist/types/plugins/table/pm-plugins/table-resizing/commands.d.ts +2 -2
  70. package/dist/types/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
  71. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -1
  72. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +1 -1
  73. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-column.d.ts +1 -1
  74. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-logic.d.ts +2 -2
  75. package/dist/types/plugins/table/transforms/fix-tables.d.ts +2 -3
  76. package/dist/types/plugins/table/transforms/index.d.ts +1 -2
  77. package/dist/types/plugins/table/transforms/replace-table.d.ts +1 -1
  78. package/dist/types/plugins/table/types.d.ts +11 -11
  79. package/dist/types/plugins/table/ui/FloatingDeleteButton/types.d.ts +1 -1
  80. package/dist/types/plugins/table/ui/ui-styles.d.ts +2 -2
  81. package/dist/types/plugins/table/utils/column-controls.d.ts +1 -1
  82. package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
  83. package/dist/types/plugins/table/utils/dom.d.ts +2 -2
  84. package/dist/types/plugins/table/utils/row-controls.d.ts +1 -1
  85. package/dist/types/plugins/table/utils/selection.d.ts +1 -1
  86. package/dist/types-ts4.5/i18n/cs.d.ts +35 -0
  87. package/dist/types-ts4.5/i18n/da.d.ts +33 -0
  88. package/dist/types-ts4.5/i18n/de.d.ts +33 -0
  89. package/dist/types-ts4.5/i18n/en.d.ts +35 -0
  90. package/dist/types-ts4.5/i18n/en_GB.d.ts +35 -0
  91. package/dist/types-ts4.5/i18n/es.d.ts +33 -0
  92. package/dist/types-ts4.5/i18n/fi.d.ts +33 -0
  93. package/dist/types-ts4.5/i18n/fr.d.ts +35 -0
  94. package/dist/types-ts4.5/i18n/hu.d.ts +35 -0
  95. package/dist/types-ts4.5/i18n/it.d.ts +35 -0
  96. package/dist/types-ts4.5/i18n/ja.d.ts +35 -0
  97. package/dist/types-ts4.5/i18n/ko.d.ts +33 -0
  98. package/dist/types-ts4.5/i18n/nb.d.ts +33 -0
  99. package/dist/types-ts4.5/i18n/nl.d.ts +35 -0
  100. package/dist/types-ts4.5/i18n/pl.d.ts +35 -0
  101. package/dist/types-ts4.5/i18n/pt_BR.d.ts +35 -0
  102. package/dist/types-ts4.5/i18n/ru.d.ts +35 -0
  103. package/dist/types-ts4.5/i18n/sv.d.ts +33 -0
  104. package/dist/types-ts4.5/i18n/th.d.ts +33 -0
  105. package/dist/types-ts4.5/i18n/tr.d.ts +35 -0
  106. package/dist/types-ts4.5/i18n/uk.d.ts +35 -0
  107. package/dist/types-ts4.5/i18n/vi.d.ts +33 -0
  108. package/dist/types-ts4.5/i18n/zh.d.ts +35 -0
  109. package/dist/types-ts4.5/i18n/zh_TW.d.ts +35 -0
  110. package/dist/types-ts4.5/index.d.ts +1 -0
  111. package/dist/types-ts4.5/plugins/table/commands/clear.d.ts +3 -0
  112. package/dist/types-ts4.5/plugins/table/commands/collapse.d.ts +2 -0
  113. package/dist/types-ts4.5/plugins/table/commands/go-to-next-cell.d.ts +4 -0
  114. package/dist/types-ts4.5/plugins/table/commands/hover.d.ts +8 -0
  115. package/dist/types-ts4.5/plugins/table/commands/index.d.ts +8 -0
  116. package/dist/types-ts4.5/plugins/table/commands/insert.d.ts +10 -0
  117. package/dist/types-ts4.5/plugins/table/commands/misc.d.ts +27 -0
  118. package/dist/types-ts4.5/plugins/table/commands/referentiality.d.ts +2 -0
  119. package/dist/types-ts4.5/plugins/table/commands/selection.d.ts +8 -0
  120. package/dist/types-ts4.5/plugins/table/commands/sort.d.ts +3 -0
  121. package/dist/types-ts4.5/plugins/table/commands/split-cell.d.ts +6 -0
  122. package/dist/types-ts4.5/plugins/table/commands/toggle.d.ts +12 -0
  123. package/dist/types-ts4.5/plugins/table/commands-with-analytics.d.ts +26 -0
  124. package/dist/types-ts4.5/plugins/table/create-plugin-config.d.ts +2 -0
  125. package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +16 -0
  126. package/dist/types-ts4.5/plugins/table/handlers.d.ts +3 -0
  127. package/dist/types-ts4.5/plugins/table/index.d.ts +30 -0
  128. package/dist/types-ts4.5/plugins/table/nodeviews/OverflowShadowsObserver.d.ts +25 -0
  129. package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +73 -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 +34 -0
  133. package/dist/types-ts4.5/plugins/table/nodeviews/tableCell.d.ts +19 -0
  134. package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +24 -0
  135. package/dist/types-ts4.5/plugins/table/nodeviews/update-overflow-shadows.d.ts +8 -0
  136. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/plugin.d.ts +7 -0
  137. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-controls.d.ts +3 -0
  138. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-resizing.d.ts +2 -0
  139. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/compose-decorations.d.ts +2 -0
  140. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/index.d.ts +3 -0
  141. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/types.d.ts +6 -0
  142. package/dist/types-ts4.5/plugins/table/pm-plugins/default-table-selection.d.ts +4 -0
  143. package/dist/types-ts4.5/plugins/table/pm-plugins/keymap.d.ts +5 -0
  144. package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +8 -0
  145. package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-factory.d.ts +1 -0
  146. package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
  147. package/dist/types-ts4.5/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +15 -0
  148. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/commands.d.ts +3 -0
  149. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/index.d.ts +6 -0
  150. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +6 -0
  151. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +72 -0
  152. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-key.d.ts +3 -0
  153. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-state.d.ts +3 -0
  154. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +4 -0
  155. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/types.d.ts +16 -0
  156. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/util.d.ts +2 -0
  157. package/dist/types-ts4.5/plugins/table/pm-plugins/table-local-id.d.ts +22 -0
  158. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/commands.d.ts +25 -0
  159. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +4 -0
  160. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/index.d.ts +4 -0
  161. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-factory.d.ts +4 -0
  162. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-key.d.ts +3 -0
  163. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin.d.ts +6 -0
  164. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/reducer.d.ts +3 -0
  165. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +15 -0
  166. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/column-state.d.ts +14 -0
  167. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/content-width.d.ts +4 -0
  168. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +13 -0
  169. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/index.d.ts +12 -0
  170. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +22 -0
  171. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -0
  172. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-logic.d.ts +4 -0
  173. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +29 -0
  174. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +17 -0
  175. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +22 -0
  176. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.d.ts +1 -0
  177. package/dist/types-ts4.5/plugins/table/pm-plugins/table-selection-keymap.d.ts +4 -0
  178. package/dist/types-ts4.5/plugins/table/reducer.d.ts +3 -0
  179. package/dist/types-ts4.5/plugins/table/toolbar.d.ts +37 -0
  180. package/dist/types-ts4.5/plugins/table/transforms/column-width.d.ts +18 -0
  181. package/dist/types-ts4.5/plugins/table/transforms/delete-columns.d.ts +3 -0
  182. package/dist/types-ts4.5/plugins/table/transforms/delete-rows.d.ts +3 -0
  183. package/dist/types-ts4.5/plugins/table/transforms/fix-tables.d.ts +9 -0
  184. package/dist/types-ts4.5/plugins/table/transforms/index.d.ts +6 -0
  185. package/dist/types-ts4.5/plugins/table/transforms/merge.d.ts +5 -0
  186. package/dist/types-ts4.5/plugins/table/transforms/replace-table.d.ts +5 -0
  187. package/dist/types-ts4.5/plugins/table/transforms/split.d.ts +9 -0
  188. package/dist/types-ts4.5/plugins/table/types.d.ts +332 -0
  189. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/index.d.ts +29 -0
  190. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/styles.d.ts +3 -0
  191. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +88 -0
  192. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/index.d.ts +23 -0
  193. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/styles.d.ts +2 -0
  194. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +14 -0
  195. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.d.ts +10 -0
  196. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/index.d.ts +54 -0
  197. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/types.d.ts +1 -0
  198. package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +12 -0
  199. package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +3 -0
  200. package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/index.d.ts +35 -0
  201. package/dist/types-ts4.5/plugins/table/ui/LayoutButton/index.d.ts +21 -0
  202. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +16 -0
  203. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +21 -0
  204. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/index.d.ts +17 -0
  205. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +40 -0
  206. package/dist/types-ts4.5/plugins/table/ui/common-styles.d.ts +8 -0
  207. package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +39 -0
  208. package/dist/types-ts4.5/plugins/table/ui/messages.d.ts +58 -0
  209. package/dist/types-ts4.5/plugins/table/ui/ui-styles.d.ts +15 -0
  210. package/dist/types-ts4.5/plugins/table/utils/analytics.d.ts +18 -0
  211. package/dist/types-ts4.5/plugins/table/utils/collapse.d.ts +29 -0
  212. package/dist/types-ts4.5/plugins/table/utils/column-controls.d.ts +10 -0
  213. package/dist/types-ts4.5/plugins/table/utils/decoration.d.ts +16 -0
  214. package/dist/types-ts4.5/plugins/table/utils/dom.d.ts +20 -0
  215. package/dist/types-ts4.5/plugins/table/utils/get-allow-add-column-custom-step.d.ts +2 -0
  216. package/dist/types-ts4.5/plugins/table/utils/index.d.ts +11 -0
  217. package/dist/types-ts4.5/plugins/table/utils/nodes.d.ts +12 -0
  218. package/dist/types-ts4.5/plugins/table/utils/paste.d.ts +14 -0
  219. package/dist/types-ts4.5/plugins/table/utils/row-controls.d.ts +16 -0
  220. package/dist/types-ts4.5/plugins/table/utils/selection.d.ts +6 -0
  221. package/dist/types-ts4.5/plugins/table/utils/table.d.ts +4 -0
  222. package/dist/types-ts4.5/plugins/table/utils/update-plugin-state-decorations.d.ts +4 -0
  223. package/dist/types-ts4.5/plugins/table-plugin.d.ts +2 -0
  224. package/dist/types-ts4.5/types/i18n.d.ts +5 -0
  225. package/examples/99-testing.tsx +4 -94
  226. package/package.json +19 -9
  227. package/plugin-key/package.json +2 -2
  228. package/report.api.md +11 -0
  229. package/src/__tests__/unit/analytics.ts +6 -0
  230. package/src/__tests__/unit/collab.ts +6 -0
  231. package/src/__tests__/unit/color-picker.ts +4 -0
  232. package/src/__tests__/unit/commands/go-to-next-cell.ts +8 -1
  233. package/src/__tests__/unit/commands/insert.ts +6 -0
  234. package/src/__tests__/unit/commands/misc.ts +14 -6
  235. package/src/__tests__/unit/commands/sort.ts +19 -12
  236. package/src/__tests__/unit/commands.ts +10 -2
  237. package/src/__tests__/unit/copy-paste.ts +6 -0
  238. package/src/__tests__/unit/event-handlers/index.ts +13 -8
  239. package/src/__tests__/unit/event-handlers.ts +13 -1
  240. package/src/__tests__/unit/fix-tables.ts +8 -4
  241. package/src/__tests__/unit/get-toolbar-config.ts +4 -0
  242. package/src/__tests__/unit/handlers.ts +8 -1
  243. package/src/__tests__/unit/hover-selection.ts +8 -1
  244. package/src/__tests__/unit/index.ts +10 -2
  245. package/src/__tests__/unit/keymap.ts +10 -4
  246. package/src/__tests__/unit/layout.ts +4 -0
  247. package/src/__tests__/unit/nodeviews/cell.ts +6 -0
  248. package/src/__tests__/unit/nodeviews/table.ts +16 -9
  249. package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +14 -4
  250. package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +8 -1
  251. package/src/__tests__/unit/pm-plugins/main-with-allow-collapse.ts +4 -0
  252. package/src/__tests__/unit/pm-plugins/main.ts +6 -0
  253. package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +8 -4
  254. package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +13 -4
  255. package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +6 -0
  256. package/src/__tests__/unit/pm-plugins/table-selection-keymap.ts +6 -0
  257. package/src/__tests__/unit/sort-column.ts +6 -0
  258. package/src/__tests__/unit/toolbar.ts +16 -9
  259. package/src/__tests__/unit/transforms/delete-columns.ts +8 -1
  260. package/src/__tests__/unit/transforms/delete-rows.ts +8 -1
  261. package/src/__tests__/unit/transforms/merging.ts +8 -1
  262. package/src/__tests__/unit/ui/ContextualMenu.tsx +8 -4
  263. package/src/__tests__/unit/ui/CornerControls.tsx +8 -1
  264. package/src/__tests__/unit/ui/FloatingContextualButton.tsx +8 -1
  265. package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +8 -1
  266. package/src/__tests__/unit/ui/RowControls.tsx +8 -1
  267. package/src/__tests__/unit/ui/TableFloatingControls.tsx +8 -1
  268. package/src/__tests__/unit/undo-redo.ts +6 -0
  269. package/src/__tests__/unit/utils/collapse.ts +4 -0
  270. package/src/__tests__/unit/utils/nodes.ts +8 -1
  271. package/src/__tests__/unit/utils/row-controls.ts +8 -1
  272. package/src/__tests__/unit/utils.ts +8 -1
  273. package/src/plugins/table/commands/misc.ts +2 -4
  274. package/src/plugins/table/index.tsx +39 -40
  275. package/src/plugins/table/transforms/column-width.ts +0 -11
  276. package/src/plugins/table/transforms/delete-columns.ts +4 -5
  277. package/src/plugins/table/transforms/delete-rows.ts +4 -7
  278. package/src/plugins/table/transforms/fix-tables.ts +0 -17
  279. package/src/plugins/table/transforms/index.ts +1 -2
  280. package/src/plugins/table/transforms/merge.ts +9 -20
  281. package/types/package.json +2 -2
  282. package/ui/common-styles/package.json +2 -2
  283. package/ui/consts/package.json +2 -2
  284. package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +0 -79
  285. package/dist/cjs/plugins/table/transforms/metadata.js +0 -20
  286. package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +0 -71
  287. package/dist/es2019/plugins/table/transforms/metadata.js +0 -12
  288. package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +0 -71
  289. package/dist/esm/plugins/table/transforms/metadata.js +0 -14
  290. package/dist/types/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.d.ts +0 -4
  291. package/dist/types/plugins/table/transforms/metadata.d.ts +0 -21
  292. package/src/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.ts +0 -78
  293. package/src/plugins/table/transforms/metadata.ts +0 -35
@@ -12,72 +12,14 @@ import {
12
12
  createEditorExampleForTests,
13
13
  mapProvidersToProps,
14
14
  } from '@atlaskit/editor-core/example-helpers/create-editor-example-for-tests';
15
- import { Editor, ContextPanel } from '@atlaskit/editor-core/src';
15
+ import {
16
+ EditorMigrationComponent as Editor,
17
+ ContextPanel,
18
+ } from '@atlaskit/editor-core/src';
16
19
  import { SaveAndCancelButtons } from '@atlaskit/editor-core/examples/5-full-page';
17
20
  import { TitleInput } from '@atlaskit/editor-core/example-helpers/PageElements';
18
21
  import { getDefaultLinkPickerOptions } from '@atlaskit/editor-core/example-helpers/link-picker';
19
22
  import { CollabEditOptions } from '@atlaskit/editor-core/src/plugins/collab-edit';
20
- import { tablesPlugin as createTablesPlugin } from '../src';
21
-
22
- import type { RelativeSelectionPos } from '@atlaskit/editor-common/selection';
23
- import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
24
- import type { FeatureFlags as EditorFeatureFlags } from '@atlaskit/editor-common/types';
25
- import type { Transaction, Selection, EditorState } from 'prosemirror-state';
26
- import type {
27
- EditorAnalyticsAPI,
28
- AnalyticsEventPayload,
29
- } from '@atlaskit/editor-common/analytics';
30
-
31
- const editorAnalyticsAPI: EditorAnalyticsAPI = {
32
- attachAnalyticsEvent: (payload: AnalyticsEventPayload) => {
33
- // You can send your payload to anyplace
34
- // It is recommend that you delay any blocking operation
35
- // with 'requestIdleCallback' or 'requestAnimationFrame'
36
- if (window.requestAnimationFrame) {
37
- window.requestAnimationFrame(() => {
38
- /* sending my data */
39
- console.log('Sending...', payload);
40
- });
41
- }
42
-
43
- return (_tr: Transaction) => {
44
- // Probably, you don't care about this.
45
- // just return true;
46
- return true;
47
- };
48
- },
49
- };
50
- const editorSelectionAPI = {
51
- getSelectionPluginState: (state: EditorState) => {
52
- // DO NOT COPY THIS KIND OF CODE OUTSIDE OF THIS API
53
- // IT IS DANGEROUS AND YOU WILL BREAK SOMETHING
54
- return (state as any)['selection$'];
55
- },
56
- setSelectionRelativeToNode:
57
- ({
58
- selectionRelativeToNode,
59
- selection,
60
- }: {
61
- selectionRelativeToNode?: RelativeSelectionPos;
62
- selection?: Selection | null;
63
- }) =>
64
- (state: EditorState) => {
65
- const tr = state.tr;
66
-
67
- // THE CODE BELOW IS REALLY WRONG
68
- // DO NOT EVEN THINK TO USE THIS ANYWHERE ELSE
69
- tr.setMeta('selection$', {
70
- type: 'SET_RELATIVE_SELECTION',
71
- selectionRelativeToNode,
72
- });
73
-
74
- if (selection) {
75
- tr.setSelection(selection);
76
- }
77
-
78
- return tr;
79
- },
80
- };
81
23
 
82
24
  export default function EditorExampleForIntegrationTests({ clipboard = true }) {
83
25
  return createEditorExampleForTests<any>(
@@ -152,37 +94,6 @@ export default function EditorExampleForIntegrationTests({ clipboard = true }) {
152
94
  };
153
95
  }
154
96
 
155
- const tableOptions =
156
- !props.allowTables || typeof props.allowTables === 'boolean'
157
- ? {}
158
- : props.allowTables;
159
-
160
- const getEditorFeatureFlags = (): EditorFeatureFlags => {
161
- const normalizedFeatureFlags = normalizeFeatureFlags(
162
- props.featureFlags,
163
- );
164
-
165
- return {
166
- ...normalizedFeatureFlags,
167
- };
168
- };
169
-
170
- const isMobile = props.appearance === 'mobile';
171
- const tablesPlugin = createTablesPlugin({
172
- tableOptions,
173
- breakoutEnabled: props.appearance === 'full-page',
174
- allowContextualMenu: !isMobile,
175
- fullWidthEnabled: props.appearance === 'full-width',
176
- editorAnalyticsAPI,
177
- editorSelectionAPI,
178
- getEditorFeatureFlags,
179
- });
180
-
181
- props.allowTables = false;
182
- const dangerouslyAppendPlugins = {
183
- __plugins: [tablesPlugin],
184
- };
185
-
186
97
  const createCollabEdit = (userId: string): CollabEditOptions => {
187
98
  return {
188
99
  provider: createCollabEditProvider({ userId }),
@@ -202,7 +113,6 @@ export default function EditorExampleForIntegrationTests({ clipboard = true }) {
202
113
  onChange={onChange}
203
114
  onDestroy={onDestroy}
204
115
  collabEdit={collabEdit}
205
- dangerouslyAppendPlugins={dangerouslyAppendPlugins}
206
116
  />
207
117
  </IntlProvider>
208
118
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -11,6 +11,14 @@
11
11
  "module": "dist/esm/index.js",
12
12
  "module:es2019": "dist/es2019/index.js",
13
13
  "types": "dist/types/index.d.ts",
14
+ "typesVersions": {
15
+ ">=4.5 <4.9": {
16
+ "*": [
17
+ "dist/types-ts4.5/*",
18
+ "dist/types-ts4.5/index.d.ts"
19
+ ]
20
+ }
21
+ },
14
22
  "sideEffects": false,
15
23
  "atlaskit:src": "src/index.ts",
16
24
  "atlassian": {
@@ -19,13 +27,15 @@
19
27
  },
20
28
  "dependencies": {
21
29
  "@atlaskit/adf-schema": "^25.6.0",
22
- "@atlaskit/editor-common": "^74.0.0",
23
- "@atlaskit/editor-palette": "1.4.0",
30
+ "@atlaskit/editor-common": "^74.1.0",
31
+ "@atlaskit/editor-palette": "1.4.1",
32
+ "@atlaskit/editor-plugin-analytics": "^0.0.1",
33
+ "@atlaskit/editor-plugin-content-insertion": "^0.0.1",
24
34
  "@atlaskit/editor-shared-styles": "^2.4.0",
25
35
  "@atlaskit/editor-tables": "^2.3.0",
26
36
  "@atlaskit/icon": "^21.12.0",
27
37
  "@atlaskit/theme": "^12.5.0",
28
- "@atlaskit/tokens": "^1.3.0",
38
+ "@atlaskit/tokens": "^1.4.0",
29
39
  "@atlaskit/tooltip": "^17.8.0",
30
40
  "@babel/runtime": "^7.0.0",
31
41
  "@emotion/react": "^11.7.1",
@@ -36,11 +46,11 @@
36
46
  "memoize-one": "^6.0.0",
37
47
  "prosemirror-commands": "1.1.11",
38
48
  "prosemirror-keymap": "1.1.4",
39
- "prosemirror-model": "1.14.3",
49
+ "prosemirror-model": "1.16.0",
40
50
  "prosemirror-state": "1.3.4",
41
51
  "prosemirror-transform": "1.3.2",
42
52
  "prosemirror-utils": "^1.0.0-0",
43
- "prosemirror-view": "1.23.2",
53
+ "prosemirror-view": "1.23.7",
44
54
  "raf-schd": "^4.0.3",
45
55
  "uuid": "^3.1.0"
46
56
  },
@@ -52,9 +62,9 @@
52
62
  "devDependencies": {
53
63
  "@atlaskit/analytics-next": "^9.1.0",
54
64
  "@atlaskit/button": "^16.7.0",
55
- "@atlaskit/editor-core": "^183.0.0",
65
+ "@atlaskit/editor-core": "^183.1.0",
56
66
  "@atlaskit/editor-plugin-feature-flags": "^0.1.0",
57
- "@atlaskit/editor-test-helpers": "^18.2.0",
67
+ "@atlaskit/editor-test-helpers": "^18.3.0",
58
68
  "@atlaskit/link-provider": "^1.6.0",
59
69
  "@atlaskit/logo": "^13.14.0",
60
70
  "@atlaskit/media-integration-test-helpers": "^2.6.0",
@@ -67,7 +77,7 @@
67
77
  "@types/prosemirror-history": "^1.0.1",
68
78
  "prosemirror-history": "^1.1.3",
69
79
  "raf-stub": "^2.0.1",
70
- "typescript": "4.5.5"
80
+ "typescript": "~4.9.5"
71
81
  },
72
82
  "af:exports": {
73
83
  "./types": "./src/plugins/table/types.ts",
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/plugins/table/pm-plugins/plugin-key.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/plugins/table/pm-plugins/plugin-key.d.ts"
11
+ "../dist/types-ts4.5/plugins/table/pm-plugins/plugin-key.d.ts"
12
12
  ]
13
13
  }
14
14
  }
package/report.api.md CHANGED
@@ -15,12 +15,19 @@
15
15
  <!--SECTION START: Main Entry Types-->
16
16
 
17
17
  ```ts
18
+ import { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
19
+ import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
20
+ import type { Command } from '@atlaskit/editor-common/types';
21
+ import type { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
18
22
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
19
23
  import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
20
24
  import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
21
25
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
22
26
  import { TableLayout } from '@atlaskit/adf-schema';
23
27
 
28
+ // @public (undocumented)
29
+ type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
30
+
24
31
  // @public (undocumented)
25
32
  type PermittedLayoutsDescriptor = 'all' | TableLayout[];
26
33
 
@@ -97,6 +104,10 @@ export const tablesPlugin: NextEditorPlugin<
97
104
  'table',
98
105
  {
99
106
  pluginConfiguration: TablePluginOptions | undefined;
107
+ actions: {
108
+ insertTable: InsertTableAction;
109
+ };
110
+ dependencies: [typeof analyticsPlugin, typeof contentInsertionPlugin];
100
111
  }
101
112
  >;
102
113
 
@@ -43,6 +43,9 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
43
43
  import tablePlugin from '../../plugins/table-plugin';
44
44
  import typeAheadPlugin from '@atlaskit/editor-core/src/plugins/type-ahead';
45
45
  import quickInsertPlugin from '@atlaskit/editor-core/src/plugins/quick-insert';
46
+ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
47
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
48
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
46
49
 
47
50
  const defaultTableDoc = doc(
48
51
  table()(
@@ -78,7 +81,10 @@ describe('Table analytic events', () => {
78
81
  const _editor = createEditor({
79
82
  doc,
80
83
  preset: new Preset<LightEditorPlugin>()
84
+ .add([featureFlagsPlugin, {}])
85
+ .add([analyticsPlugin, {}])
81
86
  .add(typeAheadPlugin)
87
+ .add(contentInsertionPlugin)
82
88
  .add(quickInsertPlugin)
83
89
  .add([
84
90
  tablePlugin,
@@ -19,6 +19,9 @@ import {
19
19
  } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
20
20
  import tablePlugin from '../../plugins/table-plugin';
21
21
  import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
22
+ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
23
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
24
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
22
25
 
23
26
  const TABLE_LOCAL_ID = 'test-table-local-id';
24
27
 
@@ -36,6 +39,9 @@ describe('Tables with Collab editing', () => {
36
39
  return createEditor({
37
40
  doc,
38
41
  preset: new Preset<LightEditorPlugin>()
42
+ .add([featureFlagsPlugin, {}])
43
+ .add([analyticsPlugin, {}])
44
+ .add(contentInsertionPlugin)
39
45
  .add([tablePlugin, { tableOptions }])
40
46
  .add(widthPlugin),
41
47
  pluginKey: tablePluginKey,
@@ -24,6 +24,8 @@ import tablePlugin from '../../plugins/table';
24
24
  import { setEditorFocus, setTableRef } from '../../plugins/table/commands';
25
25
  import { getToolbarConfig } from '../../plugins/table/toolbar';
26
26
  import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
27
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
28
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
27
29
 
28
30
  const formatMessage: (t: { id: string }) => string = (message) =>
29
31
  `${message.id}`;
@@ -42,6 +44,8 @@ describe('color picker', () => {
42
44
  attachTo: document.body,
43
45
  preset: new Preset<LightEditorPlugin>()
44
46
  .add([featureFlagsPlugin, {}])
47
+ .add([analyticsPlugin, {}])
48
+ .add(contentInsertionPlugin)
45
49
  .add(dataConsumerPlugin)
46
50
  .add(extensionPlugin)
47
51
  .add(tablePlugin),
@@ -20,6 +20,9 @@ import tablePlugin from '../../../plugins/table/index';
20
20
  import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
21
21
  import { TablePluginState } from '../../../plugins/table/types';
22
22
  import { goToNextCell } from '../../../plugins/table/commands/go-to-next-cell';
23
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
24
+ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
25
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
23
26
 
24
27
  const TABLE_LOCAL_ID = 'test-table-local-id';
25
28
 
@@ -30,7 +33,11 @@ describe('table plugin: goToNextCell', () => {
30
33
  attachAnalyticsEvent: jest.fn().mockReturnValue(() => jest.fn()),
31
34
  };
32
35
  const createEditor = createProsemirrorEditorFactory();
33
- const preset = new Preset<LightEditorPlugin>().add(tablePlugin);
36
+ const preset = new Preset<LightEditorPlugin>()
37
+ .add([featureFlagsPlugin, {}])
38
+ .add([analyticsPlugin, {}])
39
+ .add(contentInsertionPlugin)
40
+ .add(tablePlugin);
34
41
  const editor = (doc: DocBuilder) =>
35
42
  createEditor<TablePluginState, PluginKey>({
36
43
  doc,
@@ -21,6 +21,9 @@ import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
21
21
  import { TablePluginState } from '../../../plugins/table/types';
22
22
  import { addColumnAt } from '../../../plugins/table/commands/insert';
23
23
  import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
24
+ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
25
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
26
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
24
27
 
25
28
  const TABLE_LOCAL_ID = 'test-table-local-id';
26
29
 
@@ -38,6 +41,9 @@ describe('table plugin: insert', () => {
38
41
  const createEditor = createProsemirrorEditorFactory();
39
42
 
40
43
  const preset = new Preset<LightEditorPlugin>()
44
+ .add([featureFlagsPlugin, {}])
45
+ .add([analyticsPlugin, {}])
46
+ .add(contentInsertionPlugin)
41
47
  .add([
42
48
  tablePlugin,
43
49
  {
@@ -27,15 +27,23 @@ import {
27
27
  TablePluginState,
28
28
  } from '../../../plugins/table/types';
29
29
  import tablePlugin from '../../../plugins/table';
30
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
31
+ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
32
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
30
33
 
31
34
  describe('table plugin: commands', () => {
32
35
  const createEditor = createProsemirrorEditorFactory();
33
- const preset = new Preset<LightEditorPlugin>().add(panelPlugin).add([
34
- tablePlugin,
35
- {
36
- tableOptions: { allowHeaderColumn: true },
37
- },
38
- ]);
36
+ const preset = new Preset<LightEditorPlugin>()
37
+ .add([featureFlagsPlugin, {}])
38
+ .add([analyticsPlugin, {}])
39
+ .add(panelPlugin)
40
+ .add(contentInsertionPlugin)
41
+ .add([
42
+ tablePlugin,
43
+ {
44
+ tableOptions: { allowHeaderColumn: true },
45
+ },
46
+ ]);
39
47
  const editor = (doc: DocBuilder) =>
40
48
  createEditor<TablePluginState, PluginKey>({
41
49
  doc,
@@ -26,6 +26,8 @@ import editorDisabledPlugin from '@atlaskit/editor-core/src/plugins/editor-disab
26
26
  import hyperlinkPlugin from '@atlaskit/editor-core/src/plugins/hyperlink';
27
27
  import datePlugin from '@atlaskit/editor-core/src/plugins/date';
28
28
  import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
29
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
30
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
29
31
 
30
32
  const TABLE_LOCAL_ID = 'test-table-local-id';
31
33
 
@@ -41,10 +43,11 @@ describe('Sort Table', () => {
41
43
  const createEditor = createProsemirrorEditorFactory();
42
44
  it('should test a basic table with heading', () => {
43
45
  const { editorView } = createEditor({
44
- preset: new Preset<LightEditorPlugin>().add([
45
- tablePlugin,
46
- { tableOptions: { allowHeaderRow: true } },
47
- ]),
46
+ preset: new Preset<LightEditorPlugin>()
47
+ .add([featureFlagsPlugin, {}])
48
+ .add([analyticsPlugin, {}])
49
+ .add(contentInsertionPlugin)
50
+ .add([tablePlugin, { tableOptions: { allowHeaderRow: true } }]),
48
51
  doc: doc(
49
52
  table()(
50
53
  tr(th({})(p('Number{<>}'))),
@@ -70,10 +73,11 @@ describe('Sort Table', () => {
70
73
 
71
74
  it('should test a basic table descending', () => {
72
75
  const { editorView } = createEditor({
73
- preset: new Preset<LightEditorPlugin>().add([
74
- tablePlugin,
75
- { tableOptions: { allowHeaderRow: true } },
76
- ]),
76
+ preset: new Preset<LightEditorPlugin>()
77
+ .add([featureFlagsPlugin, {}])
78
+ .add([analyticsPlugin, {}])
79
+ .add(contentInsertionPlugin)
80
+ .add([tablePlugin, { tableOptions: { allowHeaderRow: true } }]),
77
81
  doc: doc(
78
82
  table()(tr(td({})(p('2{<>}'))), tr(td({})(p('5'))), tr(td({})(p('4')))),
79
83
  ),
@@ -93,10 +97,11 @@ describe('Sort Table', () => {
93
97
 
94
98
  it('should test a basic table ascending', () => {
95
99
  const { editorView } = createEditor({
96
- preset: new Preset<LightEditorPlugin>().add([
97
- tablePlugin,
98
- { tableOptions: { allowHeaderRow: true } },
99
- ]),
100
+ preset: new Preset<LightEditorPlugin>()
101
+ .add([featureFlagsPlugin, {}])
102
+ .add([analyticsPlugin, {}])
103
+ .add(contentInsertionPlugin)
104
+ .add([tablePlugin, { tableOptions: { allowHeaderRow: true } }]),
100
105
  doc: doc(
101
106
  table()(tr(td({})(p('2{<>}'))), tr(td({})(p('5'))), tr(td({})(p('4')))),
102
107
  ),
@@ -121,6 +126,8 @@ describe('Sort Table', () => {
121
126
  ({ editorView } = createEditor({
122
127
  preset: new Preset<LightEditorPlugin>()
123
128
  .add([featureFlagsPlugin, {}])
129
+ .add([analyticsPlugin, {}])
130
+ .add(contentInsertionPlugin)
124
131
  .add(editorDisabledPlugin)
125
132
  .add([tablePlugin, { tableOptions: { allowHeaderRow: true } }])
126
133
  .add([statusPlugin, { menuDisabled: false }])
@@ -59,8 +59,12 @@ import panelPlugin from '@atlaskit/editor-core/src/plugins/panel';
59
59
  import expandPlugin from '@atlaskit/editor-core/src/plugins/expand';
60
60
  import extensionPlugin from '@atlaskit/editor-core/src/plugins/extension';
61
61
  import mediaPlugin from '@atlaskit/editor-core/src/plugins/media';
62
+ import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
63
+ import gridPlugin from '@atlaskit/editor-core/src/plugins/grid';
62
64
  import textFormattingPlugin from '@atlaskit/editor-core/src/plugins/text-formatting';
63
65
  import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
66
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
67
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
64
68
 
65
69
  const TABLE_LOCAL_ID = 'test-table-local-id';
66
70
 
@@ -80,6 +84,10 @@ describe('table plugin: actions', () => {
80
84
  attachTo: document.body,
81
85
  preset: new Preset<LightEditorPlugin>()
82
86
  .add([featureFlagsPlugin, {}])
87
+ .add([analyticsPlugin, {}])
88
+ .add(contentInsertionPlugin)
89
+ .add(widthPlugin)
90
+ .add(gridPlugin)
83
91
  .add(tablePlugin)
84
92
  .add(panelPlugin)
85
93
  .add(textFormattingPlugin)
@@ -341,12 +349,12 @@ describe('table plugin: actions', () => {
341
349
  editorView.state,
342
350
  dispatch,
343
351
  );
344
- expect(editorView.state.doc).toEqualDocument(
352
+ expect(editorView.state).toEqualDocumentAndSelection(
345
353
  doc(
346
354
  p('text'),
347
355
  table({ localId: TABLE_LOCAL_ID })(
348
356
  tr(tdEmpty, tdEmpty, tdEmpty),
349
- tr(td({ colspan: 2 })(panelNote(p('text'))), tdEmpty),
357
+ tr(td({ colspan: 2 })(panelNote(p('te{<>}xt'))), tdEmpty),
350
358
  ),
351
359
  ),
352
360
  );
@@ -43,6 +43,9 @@ import { transformSliceToRemoveOpenExpand } from '@atlaskit/editor-common/transf
43
43
  import { Schema } from 'prosemirror-model';
44
44
  import tablePlugin from '../../plugins/table-plugin';
45
45
  import undoRedoPlugin from '@atlaskit/editor-core/src/plugins/undo-redo';
46
+ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
47
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
48
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
46
49
 
47
50
  const TABLE_LOCAL_ID = 'test-table-local-id';
48
51
  const array = (...args: any): Node[] => args.map((i: any) => i(defaultSchema));
@@ -101,6 +104,9 @@ describe('table plugin', () => {
101
104
  } as PluginConfig;
102
105
 
103
106
  const preset = new Preset<LightEditorPlugin>()
107
+ .add([featureFlagsPlugin, {}])
108
+ .add([analyticsPlugin, {}])
109
+ .add(contentInsertionPlugin)
104
110
  .add([tablePlugin, { tableOptions }])
105
111
  .add(undoRedoPlugin);
106
112
 
@@ -17,6 +17,9 @@ import { setDragging } from '../../../plugins/table/pm-plugins/table-resizing/co
17
17
  import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
18
18
  import tablePlugin from '../../../plugins/table-plugin';
19
19
  import { PluginKey } from 'prosemirror-state';
20
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
21
+ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
22
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
20
23
 
21
24
  describe('event-handlers', () => {
22
25
  let editor: any;
@@ -25,10 +28,11 @@ describe('event-handlers', () => {
25
28
  describe('when allowColumnResizing is false', () => {
26
29
  beforeEach(() => {
27
30
  const createEditor = createProsemirrorEditorFactory();
28
- const preset = new Preset<LightEditorPlugin>().add([
29
- tablePlugin,
30
- { tableOptions: { allowColumnResizing: false } },
31
- ]);
31
+ const preset = new Preset<LightEditorPlugin>()
32
+ .add([featureFlagsPlugin, {}])
33
+ .add([analyticsPlugin, {}])
34
+ .add(contentInsertionPlugin)
35
+ .add([tablePlugin, { tableOptions: { allowColumnResizing: false } }]);
32
36
  editor = (doc: DocBuilder) =>
33
37
  createEditor<TablePluginState, PluginKey>({
34
38
  doc,
@@ -55,10 +59,11 @@ describe('event-handlers', () => {
55
59
  describe('when allowColumnResizing is true', () => {
56
60
  beforeEach(() => {
57
61
  const createEditor = createProsemirrorEditorFactory();
58
- const preset = new Preset<LightEditorPlugin>().add([
59
- tablePlugin,
60
- { tableOptions: { allowColumnResizing: false } },
61
- ]);
62
+ const preset = new Preset<LightEditorPlugin>()
63
+ .add([featureFlagsPlugin, {}])
64
+ .add([analyticsPlugin, {}])
65
+ .add(contentInsertionPlugin)
66
+ .add([tablePlugin, { tableOptions: { allowColumnResizing: false } }]);
62
67
  editor = (doc: DocBuilder) =>
63
68
  createEditor<TablePluginState, PluginKey>({
64
69
  doc,
@@ -35,14 +35,22 @@ import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
35
35
  import { TableCssClassName as ClassName } from '../../plugins/table/types';
36
36
  import tablePlugin from '../../plugins/table-plugin';
37
37
  import mediaPlugin from '@atlaskit/editor-core/src/plugins/media';
38
+ import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
39
+ import gridPlugin from '@atlaskit/editor-core/src/plugins/grid';
38
40
  import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
41
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
42
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
39
43
 
40
44
  describe('table plugin: decorations', () => {
41
45
  const createEditor = createProsemirrorEditorFactory();
42
46
  const editor = (doc: DocBuilder) =>
43
47
  createEditor({
44
48
  doc,
45
- preset: new Preset<LightEditorPlugin>().add(tablePlugin),
49
+ preset: new Preset<LightEditorPlugin>()
50
+ .add([featureFlagsPlugin, {}])
51
+ .add([analyticsPlugin, {}])
52
+ .add(contentInsertionPlugin)
53
+ .add(tablePlugin),
46
54
  pluginKey,
47
55
  });
48
56
 
@@ -156,6 +164,10 @@ describe('table event handlers', () => {
156
164
  attachTo: document.body,
157
165
  preset: new Preset<LightEditorPlugin>()
158
166
  .add([featureFlagsPlugin, {}])
167
+ .add([analyticsPlugin, {}])
168
+ .add(contentInsertionPlugin)
169
+ .add(widthPlugin)
170
+ .add(gridPlugin)
159
171
  .add(tablePlugin)
160
172
  .add([
161
173
  mediaPlugin,
@@ -16,6 +16,9 @@ import { PluginConfig } from '../../plugins/table/types';
16
16
 
17
17
  import { pluginKey as tablePluginKey } from '../../plugins/table/pm-plugins/plugin-key';
18
18
  import tablePlugin from '../../plugins/table-plugin';
19
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
20
+ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
21
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
19
22
 
20
23
  const TABLE_LOCAL_ID = 'test-table-local-id';
21
24
 
@@ -36,10 +39,11 @@ describe('fix tables', () => {
36
39
  return createEditor({
37
40
  doc,
38
41
  attachTo: document.body,
39
- preset: new Preset<LightEditorPlugin>().add([
40
- tablePlugin,
41
- { tableOptions },
42
- ]),
42
+ preset: new Preset<LightEditorPlugin>()
43
+ .add([featureFlagsPlugin, {}])
44
+ .add([analyticsPlugin, {}])
45
+ .add(contentInsertionPlugin)
46
+ .add([tablePlugin, { tableOptions }]),
43
47
  pluginKey: tablePluginKey,
44
48
  });
45
49
  };
@@ -29,6 +29,8 @@ import type {
29
29
  GetEditorFeatureFlags,
30
30
  } from '@atlaskit/editor-common/types';
31
31
  import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
32
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
33
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
32
34
 
33
35
  const formatMessage: (t: { id: string }) => string = (message) =>
34
36
  `${message.id}`;
@@ -75,6 +77,8 @@ describe('getToolbarConfig', () => {
75
77
  attachTo: document.body,
76
78
  preset: new Preset<LightEditorPlugin>()
77
79
  .add([featureFlagsPlugin, {}])
80
+ .add([analyticsPlugin, {}])
81
+ .add(contentInsertionPlugin)
78
82
  .add(dataConsumerPlugin)
79
83
  .add(extensionPlugin)
80
84
  .add(tablePlugin),
@@ -18,6 +18,9 @@ import { handleDocOrSelectionChanged } from '../../plugins/table/handlers';
18
18
  import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
19
19
  import { defaultTableSelection } from '../../plugins/table/pm-plugins/default-table-selection';
20
20
  import tablePlugin from '../../plugins/table-plugin';
21
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
22
+ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
23
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
21
24
 
22
25
  describe('table action handlers', () => {
23
26
  let editor: any;
@@ -25,7 +28,11 @@ describe('table action handlers', () => {
25
28
 
26
29
  beforeEach(() => {
27
30
  const createEditor = createProsemirrorEditorFactory();
28
- const preset = new Preset<LightEditorPlugin>().add(tablePlugin);
31
+ const preset = new Preset<LightEditorPlugin>()
32
+ .add([featureFlagsPlugin, {}])
33
+ .add([analyticsPlugin, {}])
34
+ .add(contentInsertionPlugin)
35
+ .add(tablePlugin);
29
36
 
30
37
  editor = (doc: DocBuilder) =>
31
38
  createEditor<TablePluginState, PluginKey>({