@atlaskit/editor-plugin-table 5.0.0 → 5.1.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 (213) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/plugins/table/index.js +44 -35
  3. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/actions.js +12 -0
  4. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/commands.js +27 -0
  5. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/consts.js +11 -0
  6. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/index.js +32 -0
  7. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin-factory.js +13 -0
  8. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin-key.js +8 -0
  9. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin.js +28 -0
  10. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/reducer.js +28 -0
  11. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/types.js +5 -0
  12. package/dist/es2019/plugins/table/index.js +9 -1
  13. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/actions.js +6 -0
  14. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/commands.js +14 -0
  15. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/consts.js +5 -0
  16. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/index.js +3 -0
  17. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin-factory.js +8 -0
  18. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin-key.js +2 -0
  19. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin.js +22 -0
  20. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/reducer.js +20 -0
  21. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/types.js +1 -0
  22. package/dist/esm/plugins/table/index.js +44 -35
  23. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/actions.js +6 -0
  24. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/commands.js +22 -0
  25. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/consts.js +5 -0
  26. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/index.js +3 -0
  27. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin-factory.js +7 -0
  28. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin-key.js +2 -0
  29. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin.js +22 -0
  30. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/reducer.js +21 -0
  31. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/types.js +1 -0
  32. package/dist/types/plugins/table/pm-plugins/drag-and-drop/actions.d.ts +15 -0
  33. package/dist/types/plugins/table/pm-plugins/drag-and-drop/commands.d.ts +4 -0
  34. package/dist/types/plugins/table/pm-plugins/drag-and-drop/consts.d.ts +6 -0
  35. package/dist/types/plugins/table/pm-plugins/drag-and-drop/index.d.ts +4 -0
  36. package/dist/types/plugins/table/pm-plugins/drag-and-drop/plugin-factory.d.ts +2 -0
  37. package/dist/types/plugins/table/pm-plugins/drag-and-drop/plugin-key.d.ts +3 -0
  38. package/dist/types/plugins/table/pm-plugins/drag-and-drop/plugin.d.ts +3 -0
  39. package/dist/types/plugins/table/pm-plugins/drag-and-drop/reducer.d.ts +4 -0
  40. package/dist/types/plugins/table/pm-plugins/drag-and-drop/types.d.ts +5 -0
  41. package/dist/types-ts4.5/i18n/cs.d.ts +37 -0
  42. package/dist/types-ts4.5/i18n/da.d.ts +35 -0
  43. package/dist/types-ts4.5/i18n/de.d.ts +35 -0
  44. package/dist/types-ts4.5/i18n/en.d.ts +37 -0
  45. package/dist/types-ts4.5/i18n/en_GB.d.ts +37 -0
  46. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +37 -0
  47. package/dist/types-ts4.5/i18n/es.d.ts +35 -0
  48. package/dist/types-ts4.5/i18n/fi.d.ts +35 -0
  49. package/dist/types-ts4.5/i18n/fr.d.ts +37 -0
  50. package/dist/types-ts4.5/i18n/hu.d.ts +37 -0
  51. package/dist/types-ts4.5/i18n/it.d.ts +37 -0
  52. package/dist/types-ts4.5/i18n/ja.d.ts +37 -0
  53. package/dist/types-ts4.5/i18n/ko.d.ts +35 -0
  54. package/dist/types-ts4.5/i18n/nb.d.ts +35 -0
  55. package/dist/types-ts4.5/i18n/nl.d.ts +37 -0
  56. package/dist/types-ts4.5/i18n/pl.d.ts +37 -0
  57. package/dist/types-ts4.5/i18n/pt_BR.d.ts +37 -0
  58. package/dist/types-ts4.5/i18n/ru.d.ts +37 -0
  59. package/dist/types-ts4.5/i18n/sv.d.ts +35 -0
  60. package/dist/types-ts4.5/i18n/th.d.ts +35 -0
  61. package/dist/types-ts4.5/i18n/tr.d.ts +37 -0
  62. package/dist/types-ts4.5/i18n/uk.d.ts +37 -0
  63. package/dist/types-ts4.5/i18n/vi.d.ts +35 -0
  64. package/dist/types-ts4.5/i18n/zh.d.ts +37 -0
  65. package/dist/types-ts4.5/i18n/zh_TW.d.ts +37 -0
  66. package/dist/types-ts4.5/index.d.ts +2 -0
  67. package/dist/types-ts4.5/plugins/table/commands/clear.d.ts +3 -0
  68. package/dist/types-ts4.5/plugins/table/commands/collapse.d.ts +2 -0
  69. package/dist/types-ts4.5/plugins/table/commands/delete.d.ts +3 -0
  70. package/dist/types-ts4.5/plugins/table/commands/go-to-next-cell.d.ts +4 -0
  71. package/dist/types-ts4.5/plugins/table/commands/hover.d.ts +8 -0
  72. package/dist/types-ts4.5/plugins/table/commands/index.d.ts +8 -0
  73. package/dist/types-ts4.5/plugins/table/commands/insert.d.ts +9 -0
  74. package/dist/types-ts4.5/plugins/table/commands/misc.d.ts +29 -0
  75. package/dist/types-ts4.5/plugins/table/commands/referentiality.d.ts +2 -0
  76. package/dist/types-ts4.5/plugins/table/commands/selection.d.ts +8 -0
  77. package/dist/types-ts4.5/plugins/table/commands/sort.d.ts +3 -0
  78. package/dist/types-ts4.5/plugins/table/commands/split-cell.d.ts +6 -0
  79. package/dist/types-ts4.5/plugins/table/commands/toggle.d.ts +12 -0
  80. package/dist/types-ts4.5/plugins/table/commands-with-analytics.d.ts +25 -0
  81. package/dist/types-ts4.5/plugins/table/create-plugin-config.d.ts +2 -0
  82. package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +15 -0
  83. package/dist/types-ts4.5/plugins/table/handlers.d.ts +3 -0
  84. package/dist/types-ts4.5/plugins/table/index.d.ts +38 -0
  85. package/dist/types-ts4.5/plugins/table/nodeviews/OverflowShadowsObserver.d.ts +24 -0
  86. package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +73 -0
  87. package/dist/types-ts4.5/plugins/table/nodeviews/TableContainer.d.ts +44 -0
  88. package/dist/types-ts4.5/plugins/table/nodeviews/TableResizer.d.ts +25 -0
  89. package/dist/types-ts4.5/plugins/table/nodeviews/TableStickyScrollbar.d.ts +24 -0
  90. package/dist/types-ts4.5/plugins/table/nodeviews/__mocks__/OverflowShadowsObserver.d.ts +9 -0
  91. package/dist/types-ts4.5/plugins/table/nodeviews/__mocks__/OverridableMock.d.ts +9 -0
  92. package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +33 -0
  93. package/dist/types-ts4.5/plugins/table/nodeviews/tableCell.d.ts +17 -0
  94. package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +26 -0
  95. package/dist/types-ts4.5/plugins/table/nodeviews/update-overflow-shadows.d.ts +1 -0
  96. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/plugin.d.ts +7 -0
  97. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-controls.d.ts +3 -0
  98. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-resizing.d.ts +4 -0
  99. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/compose-decorations.d.ts +2 -0
  100. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/index.d.ts +3 -0
  101. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/types.d.ts +6 -0
  102. package/dist/types-ts4.5/plugins/table/pm-plugins/default-table-selection.d.ts +4 -0
  103. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/actions.d.ts +15 -0
  104. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/commands.d.ts +4 -0
  105. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/consts.d.ts +6 -0
  106. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/index.d.ts +4 -0
  107. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/plugin-factory.d.ts +2 -0
  108. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/plugin-key.d.ts +3 -0
  109. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/plugin.d.ts +3 -0
  110. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/reducer.d.ts +4 -0
  111. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/types.d.ts +5 -0
  112. package/dist/types-ts4.5/plugins/table/pm-plugins/keymap.d.ts +5 -0
  113. package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +8 -0
  114. package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-factory.d.ts +1 -0
  115. package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
  116. package/dist/types-ts4.5/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +15 -0
  117. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/commands.d.ts +3 -0
  118. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/index.d.ts +6 -0
  119. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +6 -0
  120. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +73 -0
  121. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-key.d.ts +3 -0
  122. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-state.d.ts +3 -0
  123. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +4 -0
  124. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/types.d.ts +16 -0
  125. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/util.d.ts +2 -0
  126. package/dist/types-ts4.5/plugins/table/pm-plugins/table-analytics.d.ts +23 -0
  127. package/dist/types-ts4.5/plugins/table/pm-plugins/table-local-id.d.ts +10 -0
  128. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/commands.d.ts +23 -0
  129. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +4 -0
  130. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/index.d.ts +3 -0
  131. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-factory.d.ts +4 -0
  132. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-key.d.ts +3 -0
  133. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin.d.ts +6 -0
  134. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/reducer.d.ts +3 -0
  135. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +23 -0
  136. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/column-state.d.ts +14 -0
  137. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/consts.d.ts +2 -0
  138. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/content-width.d.ts +4 -0
  139. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +12 -0
  140. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/index.d.ts +13 -0
  141. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +20 -0
  142. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -0
  143. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-logic.d.ts +4 -0
  144. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +29 -0
  145. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +21 -0
  146. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +22 -0
  147. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.d.ts +1 -0
  148. package/dist/types-ts4.5/plugins/table/pm-plugins/table-selection-keymap.d.ts +5 -0
  149. package/dist/types-ts4.5/plugins/table/pm-plugins/table-width.d.ts +17 -0
  150. package/dist/types-ts4.5/plugins/table/reducer.d.ts +3 -0
  151. package/dist/types-ts4.5/plugins/table/toolbar.d.ts +36 -0
  152. package/dist/types-ts4.5/plugins/table/transforms/column-width.d.ts +37 -0
  153. package/dist/types-ts4.5/plugins/table/transforms/delete-columns.d.ts +4 -0
  154. package/dist/types-ts4.5/plugins/table/transforms/delete-rows.d.ts +3 -0
  155. package/dist/types-ts4.5/plugins/table/transforms/fix-tables.d.ts +9 -0
  156. package/dist/types-ts4.5/plugins/table/transforms/index.d.ts +6 -0
  157. package/dist/types-ts4.5/plugins/table/transforms/merge.d.ts +5 -0
  158. package/dist/types-ts4.5/plugins/table/transforms/replace-table.d.ts +5 -0
  159. package/dist/types-ts4.5/plugins/table/transforms/split.d.ts +9 -0
  160. package/dist/types-ts4.5/plugins/table/types.d.ts +342 -0
  161. package/dist/types-ts4.5/plugins/table/ui/ColumnResizeWidget/index.d.ts +9 -0
  162. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/FixedButton.d.ts +23 -0
  163. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/index.d.ts +21 -0
  164. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/styles.d.ts +3 -0
  165. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +87 -0
  166. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/index.d.ts +23 -0
  167. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/styles.d.ts +2 -0
  168. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +13 -0
  169. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.d.ts +10 -0
  170. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/index.d.ts +54 -0
  171. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/types.d.ts +1 -0
  172. package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +13 -0
  173. package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +3 -0
  174. package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/index.d.ts +35 -0
  175. package/dist/types-ts4.5/plugins/table/ui/LayoutButton/index.d.ts +21 -0
  176. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +16 -0
  177. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +21 -0
  178. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/index.d.ts +17 -0
  179. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +39 -0
  180. package/dist/types-ts4.5/plugins/table/ui/common-styles.d.ts +9 -0
  181. package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +50 -0
  182. package/dist/types-ts4.5/plugins/table/ui/messages.d.ts +63 -0
  183. package/dist/types-ts4.5/plugins/table/ui/ui-styles.d.ts +15 -0
  184. package/dist/types-ts4.5/plugins/table/utils/analytics.d.ts +45 -0
  185. package/dist/types-ts4.5/plugins/table/utils/collapse.d.ts +29 -0
  186. package/dist/types-ts4.5/plugins/table/utils/column-controls.d.ts +10 -0
  187. package/dist/types-ts4.5/plugins/table/utils/decoration.d.ts +19 -0
  188. package/dist/types-ts4.5/plugins/table/utils/dom.d.ts +20 -0
  189. package/dist/types-ts4.5/plugins/table/utils/get-allow-add-column-custom-step.d.ts +2 -0
  190. package/dist/types-ts4.5/plugins/table/utils/guidelines.d.ts +2 -0
  191. package/dist/types-ts4.5/plugins/table/utils/index.d.ts +11 -0
  192. package/dist/types-ts4.5/plugins/table/utils/nodes.d.ts +13 -0
  193. package/dist/types-ts4.5/plugins/table/utils/paste.d.ts +14 -0
  194. package/dist/types-ts4.5/plugins/table/utils/row-controls.d.ts +16 -0
  195. package/dist/types-ts4.5/plugins/table/utils/selection.d.ts +6 -0
  196. package/dist/types-ts4.5/plugins/table/utils/snapping.d.ts +10 -0
  197. package/dist/types-ts4.5/plugins/table/utils/table.d.ts +4 -0
  198. package/dist/types-ts4.5/plugins/table/utils/update-plugin-state-decorations.d.ts +4 -0
  199. package/dist/types-ts4.5/plugins/table-plugin.d.ts +2 -0
  200. package/dist/types-ts4.5/types/i18n.d.ts +5 -0
  201. package/package.json +3 -3
  202. package/report.api.md +2 -17
  203. package/src/plugins/table/index.tsx +12 -0
  204. package/src/plugins/table/pm-plugins/drag-and-drop/actions.ts +29 -0
  205. package/src/plugins/table/pm-plugins/drag-and-drop/commands.ts +32 -0
  206. package/src/plugins/table/pm-plugins/drag-and-drop/consts.ts +8 -0
  207. package/src/plugins/table/pm-plugins/drag-and-drop/index.ts +5 -0
  208. package/src/plugins/table/pm-plugins/drag-and-drop/plugin-factory.ts +8 -0
  209. package/src/plugins/table/pm-plugins/drag-and-drop/plugin-key.ts +7 -0
  210. package/src/plugins/table/pm-plugins/drag-and-drop/plugin.ts +32 -0
  211. package/src/plugins/table/pm-plugins/drag-and-drop/reducer.ts +26 -0
  212. package/src/plugins/table/pm-plugins/drag-and-drop/types.ts +6 -0
  213. package/tmp/api-report-tmp.d.ts +100 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 5.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#41273](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41273) [`322add4eb2a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/322add4eb2a) - Created table drag N drop plugin
8
+
3
9
  ## 5.0.0
4
10
 
5
11
  ### Major Changes
@@ -20,6 +20,7 @@ var _utils2 = require("@atlaskit/editor-tables/utils");
20
20
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
21
  var _createPluginConfig = require("./create-plugin-config");
22
22
  var _plugin = require("./pm-plugins/decorations/plugin");
23
+ var _dragAndDrop = require("./pm-plugins/drag-and-drop");
23
24
  var _keymap = require("./pm-plugins/keymap");
24
25
  var _main = require("./pm-plugins/main");
25
26
  var _pluginKey = require("./pm-plugins/plugin-key");
@@ -175,25 +176,32 @@ var tablesPlugin = function tablesPlugin(_ref) {
175
176
  }, (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags) : undefined;
176
177
  }
177
178
  }, {
178
- name: 'tableLocalId',
179
+ name: 'tableDragAndDrop',
179
180
  plugin: function plugin(_ref8) {
180
- var dispatch = _ref8.dispatch;
181
+ var dispatch = _ref8.dispatch,
182
+ eventDispatcher = _ref8.eventDispatcher;
183
+ return options !== null && options !== void 0 && options.dragAndDropEnabled ? (0, _dragAndDrop.createPlugin)(dispatch, eventDispatcher) : undefined;
184
+ }
185
+ }, {
186
+ name: 'tableLocalId',
187
+ plugin: function plugin(_ref9) {
188
+ var dispatch = _ref9.dispatch;
181
189
  return (0, _tableLocalId.createPlugin)(dispatch);
182
190
  }
183
191
  }, {
184
192
  name: 'tableWidth',
185
- plugin: function plugin(_ref9) {
193
+ plugin: function plugin(_ref10) {
186
194
  var _options$fullWidthEna;
187
- var dispatchAnalyticsEvent = _ref9.dispatchAnalyticsEvent,
188
- dispatch = _ref9.dispatch;
195
+ var dispatchAnalyticsEvent = _ref10.dispatchAnalyticsEvent,
196
+ dispatch = _ref10.dispatch;
189
197
  return options !== null && options !== void 0 && options.tableResizingEnabled ? (0, _tableWidth.createPlugin)(dispatch, dispatchAnalyticsEvent, (_options$fullWidthEna = options === null || options === void 0 ? void 0 : options.fullWidthEnabled) !== null && _options$fullWidthEna !== void 0 ? _options$fullWidthEna : false) : undefined;
190
198
  }
191
199
  }, {
192
200
  name: 'tableAnalyticsPlugin',
193
- plugin: function plugin(_ref10) {
201
+ plugin: function plugin(_ref11) {
194
202
  var _options$tableResizin;
195
- var dispatch = _ref10.dispatch,
196
- dispatchAnalyticsEvent = _ref10.dispatchAnalyticsEvent;
203
+ var dispatch = _ref11.dispatch,
204
+ dispatchAnalyticsEvent = _ref11.dispatchAnalyticsEvent;
197
205
  return (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.overflow-state-analytics') ? (0, _tableAnalytics.createPlugin)(dispatch, dispatchAnalyticsEvent, (_options$tableResizin = options === null || options === void 0 ? void 0 : options.tableResizingEnabled) !== null && _options$tableResizin !== void 0 ? _options$tableResizin : false) : undefined;
198
206
  }
199
207
  }, {
@@ -224,12 +232,12 @@ var tablesPlugin = function tablesPlugin(_ref) {
224
232
  }
225
233
  return plugins;
226
234
  },
227
- contentComponent: function contentComponent(_ref11) {
228
- var editorView = _ref11.editorView,
229
- popupsMountPoint = _ref11.popupsMountPoint,
230
- popupsBoundariesElement = _ref11.popupsBoundariesElement,
231
- popupsScrollableElement = _ref11.popupsScrollableElement,
232
- dispatchAnalyticsEvent = _ref11.dispatchAnalyticsEvent;
235
+ contentComponent: function contentComponent(_ref12) {
236
+ var editorView = _ref12.editorView,
237
+ popupsMountPoint = _ref12.popupsMountPoint,
238
+ popupsBoundariesElement = _ref12.popupsBoundariesElement,
239
+ popupsScrollableElement = _ref12.popupsScrollableElement,
240
+ dispatchAnalyticsEvent = _ref12.dispatchAnalyticsEvent;
233
241
  return /*#__PURE__*/_react.default.createElement(_errorBoundary.ErrorBoundary, {
234
242
  component: _analytics.ACTION_SUBJECT.TABLES_PLUGIN,
235
243
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
@@ -240,30 +248,31 @@ var tablesPlugin = function tablesPlugin(_ref) {
240
248
  tablePluginState: _pluginKey.pluginKey,
241
249
  tableWidthPluginState: _tableWidth.pluginKey,
242
250
  tableResizingPluginState: _tableResizing.pluginKey,
243
- stickyHeadersState: _stickyHeaders.pluginKey
251
+ stickyHeadersState: _stickyHeaders.pluginKey,
252
+ dragAndDropState: _dragAndDrop.pluginKey
244
253
  },
245
- render: function render(_ref12) {
246
- var resizingPluginState = _ref12.tableResizingPluginState,
247
- stickyHeadersState = _ref12.stickyHeadersState,
248
- tablePluginState = _ref12.tablePluginState,
249
- tableWidthPluginState = _ref12.tableWidthPluginState;
254
+ render: function render(_ref13) {
255
+ var resizingPluginState = _ref13.tableResizingPluginState,
256
+ stickyHeadersState = _ref13.stickyHeadersState,
257
+ tablePluginState = _ref13.tablePluginState,
258
+ tableWidthPluginState = _ref13.tableWidthPluginState;
250
259
  var state = editorView.state;
251
260
  var isColumnResizing = resizingPluginState === null || resizingPluginState === void 0 ? void 0 : resizingPluginState.dragging;
252
261
  var isTableResizing = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.resizing;
253
262
  var isResizing = isColumnResizing || isTableResizing;
254
- var _ref13 = tablePluginState,
255
- tableNode = _ref13.tableNode,
256
- tablePos = _ref13.tablePos,
257
- targetCellPosition = _ref13.targetCellPosition,
258
- isContextualMenuOpen = _ref13.isContextualMenuOpen,
259
- layout = _ref13.layout,
260
- tableRef = _ref13.tableRef,
261
- pluginConfig = _ref13.pluginConfig,
262
- insertColumnButtonIndex = _ref13.insertColumnButtonIndex,
263
- insertRowButtonIndex = _ref13.insertRowButtonIndex,
264
- isHeaderColumnEnabled = _ref13.isHeaderColumnEnabled,
265
- isHeaderRowEnabled = _ref13.isHeaderRowEnabled,
266
- tableWrapperTarget = _ref13.tableWrapperTarget;
263
+ var _ref14 = tablePluginState,
264
+ tableNode = _ref14.tableNode,
265
+ tablePos = _ref14.tablePos,
266
+ targetCellPosition = _ref14.targetCellPosition,
267
+ isContextualMenuOpen = _ref14.isContextualMenuOpen,
268
+ layout = _ref14.layout,
269
+ tableRef = _ref14.tableRef,
270
+ pluginConfig = _ref14.pluginConfig,
271
+ insertColumnButtonIndex = _ref14.insertColumnButtonIndex,
272
+ insertRowButtonIndex = _ref14.insertRowButtonIndex,
273
+ isHeaderColumnEnabled = _ref14.isHeaderColumnEnabled,
274
+ isHeaderRowEnabled = _ref14.isHeaderRowEnabled,
275
+ tableWrapperTarget = _ref14.tableWrapperTarget;
267
276
  var allowControls = pluginConfig.allowControls;
268
277
  var stickyHeader = stickyHeadersState ? (0, _stickyHeaders.findStickyHeaderForTable)(stickyHeadersState, tablePos) : undefined;
269
278
  var LayoutContent = options && !options.tableResizingEnabled && (0, _utils3.isLayoutSupported)(state) && options.breakoutEnabled ? /*#__PURE__*/_react.default.createElement(_LayoutButton.default, {
@@ -329,8 +338,8 @@ var tablesPlugin = function tablesPlugin(_ref) {
329
338
  }));
330
339
  },
331
340
  pluginsOptions: {
332
- quickInsert: function quickInsert(_ref14) {
333
- var formatMessage = _ref14.formatMessage;
341
+ quickInsert: function quickInsert(_ref15) {
342
+ var formatMessage = _ref15.formatMessage;
334
343
  return [{
335
344
  id: 'table',
336
345
  title: formatMessage(_messages.toolbarInsertBlockMessages.table),
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DragAndDropActionType = void 0;
7
+ var DragAndDropActionType = exports.DragAndDropActionType = {
8
+ SET_DROP_TARGET: 'SET_DROP_TARGET',
9
+ CLEAR_DROP_TARGET: 'CLEAR_DROP_TARGET'
10
+ };
11
+
12
+ // NOTE: This should be a Union of all possible actions
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.setDropTarget = exports.clearDropTarget = void 0;
7
+ var _actions = require("./actions");
8
+ var _pluginFactory = require("./plugin-factory");
9
+ // TODO: This command is a placeholder example. Please replace this if required.
10
+ var setDropTarget = exports.setDropTarget = function setDropTarget(type, index, tr) {
11
+ return (0, _pluginFactory.createCommand)({
12
+ type: _actions.DragAndDropActionType.SET_DROP_TARGET,
13
+ data: {
14
+ type: type,
15
+ index: index
16
+ }
17
+ }, function (originalTr) {
18
+ return (tr || originalTr).setMeta('addToHistory', false);
19
+ });
20
+ };
21
+ var clearDropTarget = exports.clearDropTarget = function clearDropTarget(tr) {
22
+ return (0, _pluginFactory.createCommand)({
23
+ type: _actions.DragAndDropActionType.CLEAR_DROP_TARGET
24
+ }, function (originalTr) {
25
+ return (tr || originalTr).setMeta('addToHistory', false);
26
+ });
27
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DropTargetType = void 0;
7
+ var DropTargetType = exports.DropTargetType = {
8
+ NONE: 'none',
9
+ ROW: 'row',
10
+ COLUMN: 'column'
11
+ };
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "clearDropTarget", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _commands.clearDropTarget;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "createPlugin", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _plugin.createPlugin;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "pluginKey", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _pluginKey.pluginKey;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "setDropTarget", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _commands.setDropTarget;
28
+ }
29
+ });
30
+ var _plugin = require("./plugin");
31
+ var _pluginKey = require("./plugin-key");
32
+ var _commands = require("./commands");
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.createPluginState = exports.createCommand = void 0;
8
+ var _utils = require("@atlaskit/editor-common/utils");
9
+ var _pluginKey = require("./plugin-key");
10
+ var _reducer = _interopRequireDefault(require("./reducer"));
11
+ var _pluginFactory = (0, _utils.pluginFactory)(_pluginKey.pluginKey, _reducer.default),
12
+ createPluginState = exports.createPluginState = _pluginFactory.createPluginState,
13
+ createCommand = exports.createCommand = _pluginFactory.createCommand;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.pluginKey = void 0;
7
+ var _state = require("@atlaskit/editor-prosemirror/state");
8
+ var pluginKey = exports.pluginKey = new _state.PluginKey('dragAndDropPlugin');
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createPlugin = void 0;
7
+ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
+ var _consts = require("./consts");
9
+ var _pluginFactory = require("./plugin-factory");
10
+ var _pluginKey = require("./plugin-key");
11
+ var createPlugin = exports.createPlugin = function createPlugin(dispatch, eventDispatcher) {
12
+ return new _safePlugin.SafePlugin({
13
+ state: (0, _pluginFactory.createPluginState)(dispatch, {
14
+ // TODO: This is example placeholder state. We could use this to track which row/col is currently set as the drop target
15
+ // This would result in a blue highlight being displayed on the corrisponding row/column to single the drop target location.
16
+ dropTargetType: _consts.DropTargetType.NONE,
17
+ dropTargetIndex: 0
18
+ }),
19
+ key: _pluginKey.pluginKey,
20
+ view: function view(editorView) {
21
+ // TODO: Add Pragmatic DnD monitor when the view is constructed.
22
+ return {
23
+ // TODO: Cleanup monitor instance
24
+ // destroy: cleanup,
25
+ };
26
+ }
27
+ });
28
+ };
@@ -0,0 +1,28 @@
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 _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _actions = require("./actions");
10
+ var _consts = require("./consts");
11
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
+ var _default = exports.default = function _default(pluginState, action) {
14
+ switch (action.type) {
15
+ case _actions.DragAndDropActionType.SET_DROP_TARGET:
16
+ return _objectSpread(_objectSpread({}, pluginState), {}, {
17
+ dropTargetType: action.data.type,
18
+ dropTargetIndex: action.data.index
19
+ });
20
+ case _actions.DragAndDropActionType.CLEAR_DROP_TARGET:
21
+ return _objectSpread(_objectSpread({}, pluginState), {}, {
22
+ dropTargetType: _consts.DropTargetType.NONE,
23
+ dropTargetIndex: 0
24
+ });
25
+ default:
26
+ return pluginState;
27
+ }
28
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -13,6 +13,7 @@ import { createTable } from '@atlaskit/editor-tables/utils';
13
13
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
14
14
  import { pluginConfig } from './create-plugin-config';
15
15
  import { createPlugin as createDecorationsPlugin } from './pm-plugins/decorations/plugin';
16
+ import { createPlugin as createDragAndDropPlugin, pluginKey as dragAndDropPluginKey } from './pm-plugins/drag-and-drop';
16
17
  import { keymapPlugin } from './pm-plugins/keymap';
17
18
  import { createPlugin } from './pm-plugins/main';
18
19
  import { pluginKey } from './pm-plugins/plugin-key';
@@ -159,6 +160,12 @@ const tablesPlugin = ({
159
160
  dispatch,
160
161
  eventDispatcher
161
162
  }) => options && options.tableOptions.stickyHeaders ? createStickyHeadersPlugin(dispatch, eventDispatcher, () => [], (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags) : undefined
163
+ }, {
164
+ name: 'tableDragAndDrop',
165
+ plugin: ({
166
+ dispatch,
167
+ eventDispatcher
168
+ }) => options !== null && options !== void 0 && options.dragAndDropEnabled ? createDragAndDropPlugin(dispatch, eventDispatcher) : undefined
162
169
  }, {
163
170
  name: 'tableLocalId',
164
171
  plugin: ({
@@ -227,7 +234,8 @@ const tablesPlugin = ({
227
234
  tablePluginState: pluginKey,
228
235
  tableWidthPluginState: tableWidthPluginKey,
229
236
  tableResizingPluginState: tableResizingPluginKey,
230
- stickyHeadersState: stickyHeadersPluginKey
237
+ stickyHeadersState: stickyHeadersPluginKey,
238
+ dragAndDropState: dragAndDropPluginKey
231
239
  },
232
240
  render: ({
233
241
  tableResizingPluginState: resizingPluginState,
@@ -0,0 +1,6 @@
1
+ export const DragAndDropActionType = {
2
+ SET_DROP_TARGET: 'SET_DROP_TARGET',
3
+ CLEAR_DROP_TARGET: 'CLEAR_DROP_TARGET'
4
+ };
5
+
6
+ // NOTE: This should be a Union of all possible actions
@@ -0,0 +1,14 @@
1
+ import { DragAndDropActionType } from './actions';
2
+ import { createCommand } from './plugin-factory';
3
+
4
+ // TODO: This command is a placeholder example. Please replace this if required.
5
+ export const setDropTarget = (type, index, tr) => createCommand({
6
+ type: DragAndDropActionType.SET_DROP_TARGET,
7
+ data: {
8
+ type,
9
+ index
10
+ }
11
+ }, originalTr => (tr || originalTr).setMeta('addToHistory', false));
12
+ export const clearDropTarget = tr => createCommand({
13
+ type: DragAndDropActionType.CLEAR_DROP_TARGET
14
+ }, originalTr => (tr || originalTr).setMeta('addToHistory', false));
@@ -0,0 +1,5 @@
1
+ export const DropTargetType = {
2
+ NONE: 'none',
3
+ ROW: 'row',
4
+ COLUMN: 'column'
5
+ };
@@ -0,0 +1,3 @@
1
+ export { createPlugin } from './plugin';
2
+ export { pluginKey } from './plugin-key';
3
+ export { setDropTarget, clearDropTarget } from './commands';
@@ -0,0 +1,8 @@
1
+ import { pluginFactory } from '@atlaskit/editor-common/utils';
2
+ import { pluginKey } from './plugin-key';
3
+ import reducer from './reducer';
4
+ const {
5
+ createPluginState,
6
+ createCommand
7
+ } = pluginFactory(pluginKey, reducer);
8
+ export { createPluginState, createCommand };
@@ -0,0 +1,2 @@
1
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
+ export const pluginKey = new PluginKey('dragAndDropPlugin');
@@ -0,0 +1,22 @@
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import { DropTargetType } from './consts';
3
+ import { createPluginState } from './plugin-factory';
4
+ import { pluginKey } from './plugin-key';
5
+ export const createPlugin = (dispatch, eventDispatcher) => {
6
+ return new SafePlugin({
7
+ state: createPluginState(dispatch, {
8
+ // TODO: This is example placeholder state. We could use this to track which row/col is currently set as the drop target
9
+ // This would result in a blue highlight being displayed on the corrisponding row/column to single the drop target location.
10
+ dropTargetType: DropTargetType.NONE,
11
+ dropTargetIndex: 0
12
+ }),
13
+ key: pluginKey,
14
+ view: editorView => {
15
+ // TODO: Add Pragmatic DnD monitor when the view is constructed.
16
+ return {
17
+ // TODO: Cleanup monitor instance
18
+ // destroy: cleanup,
19
+ };
20
+ }
21
+ });
22
+ };
@@ -0,0 +1,20 @@
1
+ import { DragAndDropActionType } from './actions';
2
+ import { DropTargetType } from './consts';
3
+ export default ((pluginState, action) => {
4
+ switch (action.type) {
5
+ case DragAndDropActionType.SET_DROP_TARGET:
6
+ return {
7
+ ...pluginState,
8
+ dropTargetType: action.data.type,
9
+ dropTargetIndex: action.data.index
10
+ };
11
+ case DragAndDropActionType.CLEAR_DROP_TARGET:
12
+ return {
13
+ ...pluginState,
14
+ dropTargetType: DropTargetType.NONE,
15
+ dropTargetIndex: 0
16
+ };
17
+ default:
18
+ return pluginState;
19
+ }
20
+ });
@@ -13,6 +13,7 @@ import { createTable } from '@atlaskit/editor-tables/utils';
13
13
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
14
14
  import { pluginConfig } from './create-plugin-config';
15
15
  import { createPlugin as createDecorationsPlugin } from './pm-plugins/decorations/plugin';
16
+ import { createPlugin as createDragAndDropPlugin, pluginKey as dragAndDropPluginKey } from './pm-plugins/drag-and-drop';
16
17
  import { keymapPlugin } from './pm-plugins/keymap';
17
18
  import { createPlugin } from './pm-plugins/main';
18
19
  import { pluginKey } from './pm-plugins/plugin-key';
@@ -168,25 +169,32 @@ var tablesPlugin = function tablesPlugin(_ref) {
168
169
  }, (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags) : undefined;
169
170
  }
170
171
  }, {
171
- name: 'tableLocalId',
172
+ name: 'tableDragAndDrop',
172
173
  plugin: function plugin(_ref8) {
173
- var dispatch = _ref8.dispatch;
174
+ var dispatch = _ref8.dispatch,
175
+ eventDispatcher = _ref8.eventDispatcher;
176
+ return options !== null && options !== void 0 && options.dragAndDropEnabled ? createDragAndDropPlugin(dispatch, eventDispatcher) : undefined;
177
+ }
178
+ }, {
179
+ name: 'tableLocalId',
180
+ plugin: function plugin(_ref9) {
181
+ var dispatch = _ref9.dispatch;
174
182
  return createTableLocalIdPlugin(dispatch);
175
183
  }
176
184
  }, {
177
185
  name: 'tableWidth',
178
- plugin: function plugin(_ref9) {
186
+ plugin: function plugin(_ref10) {
179
187
  var _options$fullWidthEna;
180
- var dispatchAnalyticsEvent = _ref9.dispatchAnalyticsEvent,
181
- dispatch = _ref9.dispatch;
188
+ var dispatchAnalyticsEvent = _ref10.dispatchAnalyticsEvent,
189
+ dispatch = _ref10.dispatch;
182
190
  return options !== null && options !== void 0 && options.tableResizingEnabled ? createTableWidthPlugin(dispatch, dispatchAnalyticsEvent, (_options$fullWidthEna = options === null || options === void 0 ? void 0 : options.fullWidthEnabled) !== null && _options$fullWidthEna !== void 0 ? _options$fullWidthEna : false) : undefined;
183
191
  }
184
192
  }, {
185
193
  name: 'tableAnalyticsPlugin',
186
- plugin: function plugin(_ref10) {
194
+ plugin: function plugin(_ref11) {
187
195
  var _options$tableResizin;
188
- var dispatch = _ref10.dispatch,
189
- dispatchAnalyticsEvent = _ref10.dispatchAnalyticsEvent;
196
+ var dispatch = _ref11.dispatch,
197
+ dispatchAnalyticsEvent = _ref11.dispatchAnalyticsEvent;
190
198
  return getBooleanFF('platform.editor.table.overflow-state-analytics') ? createTableAnalyticsPlugin(dispatch, dispatchAnalyticsEvent, (_options$tableResizin = options === null || options === void 0 ? void 0 : options.tableResizingEnabled) !== null && _options$tableResizin !== void 0 ? _options$tableResizin : false) : undefined;
191
199
  }
192
200
  }, {
@@ -217,12 +225,12 @@ var tablesPlugin = function tablesPlugin(_ref) {
217
225
  }
218
226
  return plugins;
219
227
  },
220
- contentComponent: function contentComponent(_ref11) {
221
- var editorView = _ref11.editorView,
222
- popupsMountPoint = _ref11.popupsMountPoint,
223
- popupsBoundariesElement = _ref11.popupsBoundariesElement,
224
- popupsScrollableElement = _ref11.popupsScrollableElement,
225
- dispatchAnalyticsEvent = _ref11.dispatchAnalyticsEvent;
228
+ contentComponent: function contentComponent(_ref12) {
229
+ var editorView = _ref12.editorView,
230
+ popupsMountPoint = _ref12.popupsMountPoint,
231
+ popupsBoundariesElement = _ref12.popupsBoundariesElement,
232
+ popupsScrollableElement = _ref12.popupsScrollableElement,
233
+ dispatchAnalyticsEvent = _ref12.dispatchAnalyticsEvent;
226
234
  return /*#__PURE__*/React.createElement(ErrorBoundary, {
227
235
  component: ACTION_SUBJECT.TABLES_PLUGIN,
228
236
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
@@ -233,30 +241,31 @@ var tablesPlugin = function tablesPlugin(_ref) {
233
241
  tablePluginState: pluginKey,
234
242
  tableWidthPluginState: tableWidthPluginKey,
235
243
  tableResizingPluginState: tableResizingPluginKey,
236
- stickyHeadersState: stickyHeadersPluginKey
244
+ stickyHeadersState: stickyHeadersPluginKey,
245
+ dragAndDropState: dragAndDropPluginKey
237
246
  },
238
- render: function render(_ref12) {
239
- var resizingPluginState = _ref12.tableResizingPluginState,
240
- stickyHeadersState = _ref12.stickyHeadersState,
241
- tablePluginState = _ref12.tablePluginState,
242
- tableWidthPluginState = _ref12.tableWidthPluginState;
247
+ render: function render(_ref13) {
248
+ var resizingPluginState = _ref13.tableResizingPluginState,
249
+ stickyHeadersState = _ref13.stickyHeadersState,
250
+ tablePluginState = _ref13.tablePluginState,
251
+ tableWidthPluginState = _ref13.tableWidthPluginState;
243
252
  var state = editorView.state;
244
253
  var isColumnResizing = resizingPluginState === null || resizingPluginState === void 0 ? void 0 : resizingPluginState.dragging;
245
254
  var isTableResizing = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.resizing;
246
255
  var isResizing = isColumnResizing || isTableResizing;
247
- var _ref13 = tablePluginState,
248
- tableNode = _ref13.tableNode,
249
- tablePos = _ref13.tablePos,
250
- targetCellPosition = _ref13.targetCellPosition,
251
- isContextualMenuOpen = _ref13.isContextualMenuOpen,
252
- layout = _ref13.layout,
253
- tableRef = _ref13.tableRef,
254
- pluginConfig = _ref13.pluginConfig,
255
- insertColumnButtonIndex = _ref13.insertColumnButtonIndex,
256
- insertRowButtonIndex = _ref13.insertRowButtonIndex,
257
- isHeaderColumnEnabled = _ref13.isHeaderColumnEnabled,
258
- isHeaderRowEnabled = _ref13.isHeaderRowEnabled,
259
- tableWrapperTarget = _ref13.tableWrapperTarget;
256
+ var _ref14 = tablePluginState,
257
+ tableNode = _ref14.tableNode,
258
+ tablePos = _ref14.tablePos,
259
+ targetCellPosition = _ref14.targetCellPosition,
260
+ isContextualMenuOpen = _ref14.isContextualMenuOpen,
261
+ layout = _ref14.layout,
262
+ tableRef = _ref14.tableRef,
263
+ pluginConfig = _ref14.pluginConfig,
264
+ insertColumnButtonIndex = _ref14.insertColumnButtonIndex,
265
+ insertRowButtonIndex = _ref14.insertRowButtonIndex,
266
+ isHeaderColumnEnabled = _ref14.isHeaderColumnEnabled,
267
+ isHeaderRowEnabled = _ref14.isHeaderRowEnabled,
268
+ tableWrapperTarget = _ref14.tableWrapperTarget;
260
269
  var allowControls = pluginConfig.allowControls;
261
270
  var stickyHeader = stickyHeadersState ? findStickyHeaderForTable(stickyHeadersState, tablePos) : undefined;
262
271
  var LayoutContent = options && !options.tableResizingEnabled && isLayoutSupported(state) && options.breakoutEnabled ? /*#__PURE__*/React.createElement(LayoutButton, {
@@ -322,8 +331,8 @@ var tablesPlugin = function tablesPlugin(_ref) {
322
331
  }));
323
332
  },
324
333
  pluginsOptions: {
325
- quickInsert: function quickInsert(_ref14) {
326
- var formatMessage = _ref14.formatMessage;
334
+ quickInsert: function quickInsert(_ref15) {
335
+ var formatMessage = _ref15.formatMessage;
327
336
  return [{
328
337
  id: 'table',
329
338
  title: formatMessage(messages.table),
@@ -0,0 +1,6 @@
1
+ export var DragAndDropActionType = {
2
+ SET_DROP_TARGET: 'SET_DROP_TARGET',
3
+ CLEAR_DROP_TARGET: 'CLEAR_DROP_TARGET'
4
+ };
5
+
6
+ // NOTE: This should be a Union of all possible actions
@@ -0,0 +1,22 @@
1
+ import { DragAndDropActionType } from './actions';
2
+ import { createCommand } from './plugin-factory';
3
+
4
+ // TODO: This command is a placeholder example. Please replace this if required.
5
+ export var setDropTarget = function setDropTarget(type, index, tr) {
6
+ return createCommand({
7
+ type: DragAndDropActionType.SET_DROP_TARGET,
8
+ data: {
9
+ type: type,
10
+ index: index
11
+ }
12
+ }, function (originalTr) {
13
+ return (tr || originalTr).setMeta('addToHistory', false);
14
+ });
15
+ };
16
+ export var clearDropTarget = function clearDropTarget(tr) {
17
+ return createCommand({
18
+ type: DragAndDropActionType.CLEAR_DROP_TARGET
19
+ }, function (originalTr) {
20
+ return (tr || originalTr).setMeta('addToHistory', false);
21
+ });
22
+ };
@@ -0,0 +1,5 @@
1
+ export var DropTargetType = {
2
+ NONE: 'none',
3
+ ROW: 'row',
4
+ COLUMN: 'column'
5
+ };
@@ -0,0 +1,3 @@
1
+ export { createPlugin } from './plugin';
2
+ export { pluginKey } from './plugin-key';
3
+ export { setDropTarget, clearDropTarget } from './commands';
@@ -0,0 +1,7 @@
1
+ import { pluginFactory } from '@atlaskit/editor-common/utils';
2
+ import { pluginKey } from './plugin-key';
3
+ import reducer from './reducer';
4
+ var _pluginFactory = pluginFactory(pluginKey, reducer),
5
+ createPluginState = _pluginFactory.createPluginState,
6
+ createCommand = _pluginFactory.createCommand;
7
+ export { createPluginState, createCommand };
@@ -0,0 +1,2 @@
1
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
+ export var pluginKey = new PluginKey('dragAndDropPlugin');