@atlaskit/editor-plugin-table 0.0.9 → 0.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 (219) hide show
  1. package/.eslintrc.js +35 -0
  2. package/CHANGELOG.md +29 -0
  3. package/commands/package.json +14 -0
  4. package/dist/cjs/plugins/table/commands/hover.js +4 -4
  5. package/dist/cjs/plugins/table/commands-with-analytics.js +59 -58
  6. package/dist/cjs/plugins/table/event-handlers.js +0 -1
  7. package/dist/cjs/plugins/table/index.js +54 -37
  8. package/dist/cjs/plugins/table/pm-plugins/table-resizing/index.js +9 -1
  9. package/dist/cjs/plugins/table/toolbar.js +150 -22
  10. package/dist/cjs/plugins/table/transforms/fix-tables.js +7 -7
  11. package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +1 -2
  12. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +4 -6
  13. package/dist/cjs/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +1 -1
  14. package/dist/cjs/plugins/table/ui/LayoutButton/index.js +3 -5
  15. package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
  16. package/dist/cjs/plugins/table/utils/column-controls.js +0 -1
  17. package/dist/cjs/plugins/table/utils/decoration.js +53 -4
  18. package/dist/cjs/plugins/table/utils/dom.js +0 -2
  19. package/dist/cjs/plugins/table/utils/paste.js +0 -1
  20. package/dist/cjs/version.json +1 -1
  21. package/dist/es2019/plugins/table/commands/hover.js +4 -4
  22. package/dist/es2019/plugins/table/commands-with-analytics.js +6 -9
  23. package/dist/es2019/plugins/table/event-handlers.js +1 -2
  24. package/dist/es2019/plugins/table/handlers.js +1 -2
  25. package/dist/es2019/plugins/table/index.js +23 -5
  26. package/dist/es2019/plugins/table/pm-plugins/keymap.js +1 -1
  27. package/dist/es2019/plugins/table/pm-plugins/table-local-id.js +1 -3
  28. package/dist/es2019/plugins/table/pm-plugins/table-resizing/index.js +2 -1
  29. package/dist/es2019/plugins/table/toolbar.js +133 -16
  30. package/dist/es2019/plugins/table/transforms/fix-tables.js +2 -4
  31. package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +1 -2
  32. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +4 -6
  33. package/dist/es2019/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +2 -3
  34. package/dist/es2019/plugins/table/ui/FloatingDeleteButton/index.js +1 -2
  35. package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +1 -2
  36. package/dist/es2019/plugins/table/ui/LayoutButton/index.js +3 -5
  37. package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
  38. package/dist/es2019/plugins/table/utils/column-controls.js +0 -1
  39. package/dist/es2019/plugins/table/utils/decoration.js +60 -25
  40. package/dist/es2019/plugins/table/utils/dom.js +0 -2
  41. package/dist/es2019/plugins/table/utils/paste.js +1 -2
  42. package/dist/es2019/plugins/table/utils/row-controls.js +1 -2
  43. package/dist/es2019/version.json +1 -1
  44. package/dist/esm/plugins/table/commands/hover.js +4 -4
  45. package/dist/esm/plugins/table/commands-with-analytics.js +56 -55
  46. package/dist/esm/plugins/table/event-handlers.js +1 -2
  47. package/dist/esm/plugins/table/handlers.js +1 -2
  48. package/dist/esm/plugins/table/index.js +55 -38
  49. package/dist/esm/plugins/table/pm-plugins/keymap.js +1 -1
  50. package/dist/esm/plugins/table/pm-plugins/table-local-id.js +1 -3
  51. package/dist/esm/plugins/table/pm-plugins/table-resizing/index.js +2 -1
  52. package/dist/esm/plugins/table/toolbar.js +139 -17
  53. package/dist/esm/plugins/table/transforms/fix-tables.js +2 -4
  54. package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +1 -2
  55. package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +4 -6
  56. package/dist/esm/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +2 -3
  57. package/dist/esm/plugins/table/ui/FloatingDeleteButton/index.js +1 -2
  58. package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +1 -2
  59. package/dist/esm/plugins/table/ui/LayoutButton/index.js +3 -5
  60. package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
  61. package/dist/esm/plugins/table/utils/column-controls.js +0 -1
  62. package/dist/esm/plugins/table/utils/decoration.js +50 -4
  63. package/dist/esm/plugins/table/utils/dom.js +0 -2
  64. package/dist/esm/plugins/table/utils/paste.js +1 -2
  65. package/dist/esm/plugins/table/utils/row-controls.js +1 -2
  66. package/dist/esm/version.json +1 -1
  67. package/dist/types/plugins/table/commands-with-analytics.d.ts +5 -5
  68. package/dist/types/plugins/table/pm-plugins/table-resizing/index.d.ts +1 -0
  69. package/dist/types/plugins/table/toolbar.d.ts +2 -2
  70. package/dist/types/plugins/table/transforms/fix-tables.d.ts +1 -1
  71. package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
  72. package/dist/types-ts4.0/plugins/table/commands-with-analytics.d.ts +5 -5
  73. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/index.d.ts +1 -0
  74. package/dist/types-ts4.0/plugins/table/toolbar.d.ts +2 -2
  75. package/dist/types-ts4.0/plugins/table/transforms/fix-tables.d.ts +1 -1
  76. package/dist/types-ts4.0/plugins/table/utils/decoration.d.ts +1 -1
  77. package/examples/config.jsonc +14 -0
  78. package/package.json +15 -11
  79. package/plugin-key/package.json +14 -0
  80. package/report.api.md +1 -1
  81. package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/auto-size-documents.ts +0 -0
  82. package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/basic-table.ts +0 -0
  83. package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/empty-paragraph-underneath-table.ts +0 -0
  84. package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/even-columns.ts +0 -0
  85. package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/layout-documents.ts +0 -0
  86. package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/merged-rows-and-cols-document.ts +0 -0
  87. package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/nested-in-extension.ts +0 -0
  88. package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/paragraph-and-table-adf.json +0 -0
  89. package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/resize-documents.ts +0 -0
  90. package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/scale.ts +0 -0
  91. package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/table-inside-layout.ts +0 -0
  92. package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/table-with-min-width-columns-document.ts +0 -0
  93. package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/table-with-multiline-date.adf.json +0 -0
  94. package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/table-with-text-and-empty-row.ts +0 -0
  95. package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/auto-size.ts.snap +0 -0
  96. package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/change-date-inside-table.ts.snap +0 -0
  97. package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/copy-button.ts.snap +0 -0
  98. package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-columns.ts.snap +0 -0
  99. package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-last-column-in-full-width.ts.snap +0 -0
  100. package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-last-column-with-empty-action.ts.snap +0 -0
  101. package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-last-row-with-empty-action.ts.snap +0 -0
  102. package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-rows.ts.snap +0 -0
  103. package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-table-when-selected.ts.snap +0 -0
  104. package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/deleting-empty-paragraph-under-table.ts.snap +0 -0
  105. package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/even-columns.ts.snap +0 -0
  106. package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/insert-cell-header-with-strong-mark.ts.snap +0 -0
  107. package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/insert-row-inside-layout.ts.snap +0 -0
  108. package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/layout.ts.snap +0 -0
  109. package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/resize.ts.snap +0 -0
  110. package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/scale.ts.snap +0 -0
  111. package/src/{plugins/table/__tests__ → __tests__}/integration/arrow-down-into-table.ts +0 -0
  112. package/src/{plugins/table/__tests__ → __tests__}/integration/auto-size.ts +0 -0
  113. package/src/{plugins/table/__tests__ → __tests__}/integration/block-node-selection.ts +1 -0
  114. package/src/{plugins/table/__tests__ → __tests__}/integration/cell-selection.ts +0 -0
  115. package/src/{plugins/table/__tests__ → __tests__}/integration/change-date-inside-table.ts +0 -0
  116. package/src/{plugins/table/__tests__ → __tests__}/integration/copy-button.ts +1 -1
  117. package/src/{plugins/table/__tests__ → __tests__}/integration/delete-columns.ts +2 -2
  118. package/src/{plugins/table/__tests__ → __tests__}/integration/delete-last-column-in-full-width.ts +1 -1
  119. package/src/{plugins/table/__tests__ → __tests__}/integration/delete-last-column-with-empty-action.ts +1 -1
  120. package/src/{plugins/table/__tests__ → __tests__}/integration/delete-last-row-with-empty-action.ts +1 -1
  121. package/src/{plugins/table/__tests__ → __tests__}/integration/delete-rows.ts +2 -2
  122. package/src/{plugins/table/__tests__ → __tests__}/integration/delete-table-when-selected.ts +0 -0
  123. package/src/{plugins/table/__tests__ → __tests__}/integration/deleting-empty-paragraph-under-table.ts +0 -0
  124. package/src/{plugins/table/__tests__ → __tests__}/integration/even-columns.ts +0 -0
  125. package/src/{plugins/table/__tests__ → __tests__}/integration/insert-cell-header-with-strong-mark.ts +0 -0
  126. package/src/{plugins/table/__tests__ → __tests__}/integration/insert-long-smart-link.ts +1 -0
  127. package/src/{plugins/table/__tests__ → __tests__}/integration/insert-row-inside-layout.ts +0 -0
  128. package/src/{plugins/table/__tests__ → __tests__}/integration/layout.ts +0 -0
  129. package/src/{plugins/table/__tests__ → __tests__}/integration/resize-handler.ts +0 -0
  130. package/src/{plugins/table/__tests__ → __tests__}/integration/resize.ts +1 -1
  131. package/src/{plugins/table/__tests__ → __tests__}/integration/scale.ts +0 -0
  132. package/src/__tests__/integration/table-controls-selection.ts +71 -0
  133. package/src/__tests__/unit/analytics.ts +8 -9
  134. package/src/{plugins/table/__tests__ → __tests__}/unit/commands/go-to-next-cell.ts +4 -4
  135. package/src/{plugins/table/__tests__ → __tests__}/unit/commands/insert.ts +4 -4
  136. package/src/{plugins/table/__tests__ → __tests__}/unit/commands/misc.ts +12 -6
  137. package/src/{plugins/table/__tests__ → __tests__}/unit/commands.ts +7 -7
  138. package/src/__tests__/unit/copy-button.ts +22 -0
  139. package/src/__tests__/unit/event-handlers.ts +120 -1
  140. package/src/{plugins/table/__tests__ → __tests__}/unit/get-toolbar-config.ts +8 -3
  141. package/src/{plugins/table/__tests__ → __tests__}/unit/nodeviews/OverflowShadowsObserver.ts +2 -2
  142. package/src/{plugins/table/__tests__ → __tests__}/unit/nodeviews/TableComponent.tsx +11 -11
  143. package/src/{plugins/table/__tests__ → __tests__}/unit/nodeviews/table.ts +5 -5
  144. package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/decorations/column-controls.ts +2 -2
  145. package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/decorations/column-resizing.ts +9 -6
  146. package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/decorations/plugin.ts +5 -5
  147. package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/main-with-allow-collapse.ts +4 -4
  148. package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/main.ts +6 -6
  149. package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +2 -2
  150. package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/sticky-headers/tableRow.tsx +16 -13
  151. package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/table-local-id.ts +3 -6
  152. package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/table-resizing/colgroup.ts +1 -1
  153. package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/table-resizing/event-handlers.ts +3 -3
  154. package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/table-selection-keymap.ts +3 -3
  155. package/src/{plugins/table/__tests__ → __tests__}/unit/toolbar.ts +5 -9
  156. package/src/__tests__/unit/ui/DeleteButton.tsx +35 -0
  157. package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +26 -64
  158. package/src/{plugins/table/__tests__ → __tests__}/unit/utils/collapse.ts +2 -2
  159. package/src/{plugins/table/__tests__ → __tests__}/unit/utils/column-controls.ts +1 -1
  160. package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__fixtures__/table-with-100-numbered-list-items.json +0 -0
  161. package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-column-menu-item-should-remove-the-table-column-on-click-1-snap.png +0 -0
  162. package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-column-menu-item-visual-hints-should-be-added-to-the-table-column-on-hover-1-snap.png +0 -0
  163. package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-row-menu-item-should-remove-the-table-row-on-click-1-snap.png +0 -0
  164. package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-row-menu-item-visual-hints-should-be-added-to-the-table-row-on-hover-1-snap.png +0 -0
  165. package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/copy-button-ts-floating-toolbar-copy-button-table-target-node-displays-blue-border-when-copy-button-is-hovered-1-snap.png +0 -0
  166. package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/index-ts-snapshot-test-table-numbered-list-should-not-overflow-table-cell-when-there-are-more-than-100-ordered-list-items-1-snap.png +0 -0
  167. package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/index-ts-snapshot-test-table-numbered-list-should-not-overflow-table-cell-when-there-are-more-than-100-ordered-list-items-2-snap.png +0 -0
  168. package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/index-ts-snapshot-test-table-numbered-list-should-not-overflow-table-cell-when-there-are-more-than-100-ordered-list-items-3-snap.png +0 -0
  169. package/src/{plugins/table/__tests__ → __tests__}/visual-regression/cell-options-menu.ts +2 -0
  170. package/src/__tests__/visual-regression/copy-button.ts +181 -0
  171. package/src/{plugins/table/__tests__ → __tests__}/visual-regression/index.ts +3 -1
  172. package/src/plugins/table/commands/hover.ts +4 -1
  173. package/src/plugins/table/commands-with-analytics.ts +12 -8
  174. package/src/plugins/table/event-handlers.ts +0 -1
  175. package/src/plugins/table/handlers.ts +0 -1
  176. package/src/plugins/table/index.tsx +28 -2
  177. package/src/plugins/table/pm-plugins/keymap.ts +1 -1
  178. package/src/plugins/table/pm-plugins/table-local-id.ts +0 -2
  179. package/src/plugins/table/pm-plugins/table-resizing/index.ts +1 -0
  180. package/src/plugins/table/{toolbar.ts → toolbar.tsx} +186 -14
  181. package/src/plugins/table/transforms/fix-tables.ts +2 -3
  182. package/src/plugins/table/ui/FloatingContextualButton/index.tsx +0 -1
  183. package/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx +13 -10
  184. package/src/plugins/table/ui/FloatingContextualMenu/__tests__/ContextualMenu.tsx +1 -0
  185. package/src/plugins/table/ui/FloatingContextualMenu/__tests__/FloatingContextualMenu.tsx +1 -0
  186. package/src/plugins/table/ui/FloatingDeleteButton/DeleteButton.tsx +1 -2
  187. package/src/plugins/table/ui/FloatingDeleteButton/index.tsx +0 -1
  188. package/src/plugins/table/ui/FloatingInsertButton/index.tsx +0 -1
  189. package/src/plugins/table/ui/LayoutButton/index.tsx +2 -4
  190. package/src/plugins/table/ui/TableFloatingControls/CornerControls/index.tsx +1 -0
  191. package/src/plugins/table/utils/column-controls.ts +0 -1
  192. package/src/plugins/table/utils/decoration.ts +44 -5
  193. package/src/plugins/table/utils/dom.ts +0 -2
  194. package/src/plugins/table/utils/paste.ts +0 -1
  195. package/src/plugins/table/utils/row-controls.ts +0 -1
  196. package/types/package.json +5 -5
  197. package/ui/common-styles/package.json +14 -0
  198. package/ui/consts/package.json +14 -0
  199. package/dist/cjs/plugins/plugin-key.js +0 -17
  200. package/dist/cjs/plugins/table/todo-stubs.js +0 -10
  201. package/dist/cjs/types.js +0 -5
  202. package/dist/es2019/plugins/plugin-key.js +0 -3
  203. package/dist/es2019/plugins/table/todo-stubs.js +0 -1
  204. package/dist/es2019/types.js +0 -1
  205. package/dist/esm/plugins/plugin-key.js +0 -5
  206. package/dist/esm/plugins/table/todo-stubs.js +0 -1
  207. package/dist/esm/types.js +0 -1
  208. package/dist/types/plugins/plugin-key.d.ts +0 -4
  209. package/dist/types/plugins/table/todo-stubs.d.ts +0 -1
  210. package/dist/types/types.d.ts +0 -3
  211. package/dist/types-ts4.0/plugins/plugin-key.d.ts +0 -4
  212. package/dist/types-ts4.0/plugins/table/todo-stubs.d.ts +0 -1
  213. package/dist/types-ts4.0/types.d.ts +0 -3
  214. package/src/plugins/plugin-key.ts +0 -7
  215. package/src/plugins/table/__tests__/integration/table-controls-selection.ts +0 -70
  216. package/src/plugins/table/__tests__/unit/event-handlers.ts +0 -130
  217. package/src/plugins/table/todo-stubs.ts +0 -1
  218. package/src/types.ts +0 -3
  219. package/tmp/api-report-tmp.d.ts +0 -91
@@ -5,10 +5,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
6
 
7
7
  import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
8
- import { akEditorDefaultLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles'; // import { sendLogs } from '../../../utils/sendLogs';
9
- // import { sendLogs } from '@atlaskit/editor-core/src/utils/sendLogs';
10
-
11
- import { sendLogs } from '../todo-stubs';
8
+ import { akEditorDefaultLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
9
+ import { sendLogs } from '@atlaskit/editor-common/utils';
12
10
  import { calculateColumnWidth, contentWidth, getCellsRefsInColumn, getLayoutSize } from '../pm-plugins/table-resizing/utils';
13
11
  export var fireAnalytics = function fireAnalytics() {
14
12
  var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -148,8 +148,7 @@ export var FloatingContextualButtonInner = /*#__PURE__*/function (_React$Compone
148
148
  key: "shouldComponentUpdate",
149
149
  value: function shouldComponentUpdate(nextProps) {
150
150
  return this.props.tableNode !== nextProps.tableNode || this.props.targetCellPosition !== nextProps.targetCellPosition || this.props.layout !== nextProps.layout || this.props.isContextualMenuOpen !== nextProps.isContextualMenuOpen || this.props.isNumberColumnEnabled !== nextProps.isNumberColumnEnabled || this.props.stickyHeader !== nextProps.stickyHeader;
151
- } // TODO: restore
152
-
151
+ }
153
152
  }]);
154
153
 
155
154
  return FloatingContextualButtonInner;
@@ -293,14 +293,14 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
293
293
  break;
294
294
 
295
295
  case 'merge':
296
- mergeCellsWithAnalytics(editorAnalyticsAPI)(state, dispatch);
296
+ mergeCellsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU)(state, dispatch);
297
297
 
298
298
  _this.toggleOpen();
299
299
 
300
300
  break;
301
301
 
302
302
  case 'split':
303
- splitCellWithAnalytics(editorAnalyticsAPI)(state, dispatch);
303
+ splitCellWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU)(state, dispatch);
304
304
 
305
305
  _this.toggleOpen();
306
306
 
@@ -447,10 +447,8 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
447
447
  targetCellPosition = _getPluginState4.targetCellPosition;
448
448
 
449
449
  var state = editorView.state,
450
- dispatch = editorView.dispatch; // setColorWithAnalytics(color, targetCellPosition)(state, dispatch);
451
- // TODO: restore
452
-
453
- setColorWithAnalytics(editorAnalyticsAPI)(color, targetCellPosition)(state, dispatch);
450
+ dispatch = editorView.dispatch;
451
+ setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, color, targetCellPosition)(state, dispatch);
454
452
 
455
453
  _this.toggleOpen();
456
454
  });
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { injectIntl } from 'react-intl-next'; // import { MessageDescriptor } from '../../../../types/i18n';
3
-
2
+ import { injectIntl } from 'react-intl-next';
4
3
  import { TableCssClassName as ClassName } from '../../types';
5
4
 
6
5
  var DeleteButton = function DeleteButton(_ref) {
@@ -17,7 +16,7 @@ var DeleteButton = function DeleteButton(_ref) {
17
16
  onMouseLeave: onMouseLeave
18
17
  }, /*#__PURE__*/React.createElement("button", {
19
18
  type: "button",
20
- title: formatMessage(removeLabel, {
19
+ "aria-label": formatMessage(removeLabel, {
21
20
  0: 1
22
21
  }),
23
22
  className: ClassName.CONTROLS_DELETE_BUTTON,
@@ -20,8 +20,7 @@ import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
20
20
  import { getSelectionRect, isTableSelected } from '@atlaskit/editor-tables/utils';
21
21
  import { createPortal } from 'react-dom';
22
22
  import { Popup } from '@atlaskit/editor-common/ui';
23
- import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles'; // import { closestElement } from '../../../../utils/dom';
24
-
23
+ import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
25
24
  import { closestElement } from '@atlaskit/editor-common/utils';
26
25
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
27
26
  import { clearHoverSelection, hoverColumns, hoverRows } from '../../commands';
@@ -17,8 +17,7 @@ import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
17
17
  import { findDomRefAtPos } from 'prosemirror-utils';
18
18
  import { findTable } from '@atlaskit/editor-tables/utils';
19
19
  import { injectIntl } from 'react-intl-next';
20
- import { Popup } from '@atlaskit/editor-common/ui'; // import { closestElement } from '../../../../utils/dom';
21
-
20
+ import { Popup } from '@atlaskit/editor-common/ui';
22
21
  import { closestElement } from '@atlaskit/editor-common/utils';
23
22
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
24
23
  import { insertColumnWithAnalytics, insertRowWithAnalytics } from '../../commands-with-analytics';
@@ -127,8 +127,7 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
127
127
  }, {
128
128
  key: "renderSticky",
129
129
  value: function renderSticky(button, targetRef, tableRef) {
130
- // const title = this.getTitle();
131
- var title = 'TODO MISSING TITLE';
130
+ var title = this.getTitle();
132
131
 
133
132
  if (!(targetRef instanceof HTMLElement) || !(tableRef instanceof HTMLElement)) {
134
133
  return null;
@@ -157,10 +156,9 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
157
156
 
158
157
  if (!targetRef) {
159
158
  return null;
160
- } // const title = this.getTitle();
161
-
159
+ }
162
160
 
163
- var title = 'TODO MISSING TITLE';
161
+ var title = this.getTitle();
164
162
  return /*#__PURE__*/React.createElement(Popup, {
165
163
  ariaLabel: title,
166
164
  target: targetRef,
@@ -102,7 +102,8 @@ var CornerControlComponent = /*#__PURE__*/function (_Component) {
102
102
  }),
103
103
  style: {
104
104
  top: this.props.stickyTop !== undefined ? "".concat(this.props.stickyTop, "px") : undefined
105
- }
105
+ },
106
+ contentEditable: false
106
107
  }, /*#__PURE__*/React.createElement("button", {
107
108
  "aria-label": formatMessage(messages.cornerControl),
108
109
  type: "button",
@@ -3,7 +3,6 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
3
3
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
4
4
  import { findDomRefAtPos } from 'prosemirror-utils';
5
5
  import { findTable, getCellsInColumn, getSelectionRect, isColumnSelected, isTableSelected } from '@atlaskit/editor-tables/utils';
6
- // import { maphElem } from '@atlaskit/editor-core/src/utils/dom';
7
6
  import { maphElem } from '@atlaskit/editor-common/utils';
8
7
  import { TableCssClassName as ClassName } from '../types';
9
8
  import { tableDeleteButtonSize } from '../ui/consts';
@@ -1,7 +1,7 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
1
2
  import { TableMap } from '@atlaskit/editor-tables/table-map';
2
3
  import { findTable, getCellsInRow, getSelectionRect } from '@atlaskit/editor-tables/utils';
3
4
  import { Decoration } from 'prosemirror-view';
4
- // import { nonNullable } from '@atlaskit/editor-core/src/utils';
5
5
  import { nonNullable } from '@atlaskit/editor-common/utils';
6
6
  import { TableCssClassName as ClassName, TableDecorations } from '../types';
7
7
 
@@ -26,8 +26,54 @@ export var createCellHoverDecoration = function createCellHoverDecoration(cells,
26
26
  });
27
27
  });
28
28
  };
29
- export var createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, danger, selected) {
30
- return cells.map(function (cell) {
29
+ export var createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, tr, danger, selected) {
30
+ var table = findTable(tr.selection);
31
+
32
+ if (!table) {
33
+ return [];
34
+ }
35
+
36
+ var map = TableMap.get(table.node);
37
+
38
+ var _cells$reduce = cells.reduce(function (_ref, cell) {
39
+ var _ref2 = _slicedToArray(_ref, 2),
40
+ min = _ref2[0],
41
+ max = _ref2[1];
42
+
43
+ if (min === null || cell.pos < min) {
44
+ min = cell.pos;
45
+ }
46
+
47
+ if (max === null || cell.pos > max) {
48
+ max = cell.pos;
49
+ }
50
+
51
+ return [min, max];
52
+ }, [null, null]),
53
+ _cells$reduce2 = _slicedToArray(_cells$reduce, 2),
54
+ min = _cells$reduce2[0],
55
+ max = _cells$reduce2[1];
56
+
57
+ if (min === null || max === null) {
58
+ return [];
59
+ }
60
+
61
+ var updatedCells = cells.map(function (x) {
62
+ return x.pos;
63
+ }); // ED-15246 fixed trello card table overflow issue
64
+ // If columns / rows have been merged the hovered selection is different to the actual selection
65
+ // So If the table cells are in danger we want to create a "rectangle" selection
66
+ // to match the "clicked" selection
67
+
68
+ if (danger) {
69
+ var rect = map.rectBetween(min - table.start, max - table.start);
70
+ updatedCells = map.cellsInRect(rect).map(function (x) {
71
+ return x + table.start;
72
+ });
73
+ }
74
+
75
+ return updatedCells.map(function (pos) {
76
+ var cell = tr.doc.nodeAt(pos);
31
77
  var classes = [ClassName.HOVERED_CELL];
32
78
 
33
79
  if (danger) {
@@ -55,7 +101,7 @@ export var createControlsHoverDecoration = function createControlsHoverDecoratio
55
101
  break;
56
102
  }
57
103
 
58
- return Decoration.node(cell.pos, cell.pos + cell.node.nodeSize, {
104
+ return Decoration.node(pos, pos + cell.nodeSize, {
59
105
  class: classes.join(' ')
60
106
  }, {
61
107
  key: key
@@ -1,5 +1,3 @@
1
- // import { containsClassName } from '@atlaskit/editor-core/src/utils';
2
- // import { closestElement } from '@atlaskit/editor-core/src/utils/dom';
3
1
  import { closestElement, containsClassName } from '@atlaskit/editor-common/utils';
4
2
  import { TableCssClassName as ClassName } from '../types';
5
3
  import { tableToolbarSize } from '../ui/consts';
@@ -1,7 +1,6 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import { Fragment, Slice } from 'prosemirror-model';
3
- import { flatten } from 'prosemirror-utils'; // import { flatmap, mapSlice } from '@atlaskit/editor-core/src/utils/slice';
4
-
3
+ import { flatten } from 'prosemirror-utils';
5
4
  import { flatmap, mapSlice } from '@atlaskit/editor-common/utils';
6
5
  import { getPluginState } from '../pm-plugins/plugin-factory'; // lifts up the content of each cell, returning an array of nodes
7
6
 
@@ -7,8 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
7
7
  import { TableMap } from '@atlaskit/editor-tables/table-map';
8
8
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
9
9
  import { safeInsert } from 'prosemirror-utils';
10
- import { findTable, getSelectionRect, isRowSelected, isTableSelected } from '@atlaskit/editor-tables/utils'; // import { parsePx } from '@atlaskit/editor-core/src/utils/dom';
11
-
10
+ import { findTable, getSelectionRect, isRowSelected, isTableSelected } from '@atlaskit/editor-tables/utils';
12
11
  import { parsePx } from '@atlaskit/editor-common/utils';
13
12
  import { TableCssClassName as ClassName } from '../types';
14
13
  import { tableDeleteButtonSize } from '../ui/consts';
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "0.0.9"
3
+ "version": "0.1.0"
4
4
  }
@@ -7,9 +7,9 @@ import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
7
7
  import { ResizeStateWithAnalytics } from './pm-plugins/table-resizing/utils';
8
8
  import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
9
9
  export declare const emptyMultipleCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB, targetCellPosition?: number | undefined) => Command;
10
- export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => Command;
11
- export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
12
- export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (cellColor: string, targetCellPosition?: number | undefined) => Command;
10
+ export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
11
+ export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
12
+ export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB, cellColor: string, targetCellPosition?: number | undefined) => Command;
13
13
  export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
14
14
  export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
15
15
  export declare const insertColumnWithAnalytics: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB, position: number) => Command;
@@ -21,6 +21,6 @@ export declare const toggleHeaderRowWithAnalytics: (editorAnalyticsAPI: EditorAn
21
21
  export declare const toggleHeaderColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
22
22
  export declare const toggleNumberColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
23
23
  export declare const toggleTableLayoutWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
24
- export declare const sortColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU, columnIndex: number, sortOrder: SortOrder) => Command;
25
- export declare const distributeColumnsWidthsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU, { resizeState, table, attributes }: ResizeStateWithAnalytics) => Command;
24
+ export declare const sortColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB, columnIndex: number, sortOrder: SortOrder) => Command;
25
+ export declare const distributeColumnsWidthsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB, { resizeState, table, attributes }: ResizeStateWithAnalytics) => Command;
26
26
  export declare const wrapTableInExpandWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
@@ -1,3 +1,4 @@
1
1
  export { createPlugin } from './plugin';
2
2
  export { scaleTable } from './commands';
3
3
  export { pluginKey } from './plugin-key';
4
+ export { getPluginState } from './plugin-factory';
@@ -1,4 +1,4 @@
1
- import type { Command, FloatingToolbarDropdown, FloatingToolbarHandler, FloatingToolbarItem } from '@atlaskit/editor-common/types';
1
+ import type { Command, FloatingToolbarDropdown, FloatingToolbarHandler, FloatingToolbarItem, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import { ToolbarMenuConfig, ToolbarMenuState, ToolbarMenuContext, PluginConfig } from './types';
4
4
  import { EditorState } from 'prosemirror-state';
@@ -33,4 +33,4 @@ export declare const messages: {
33
33
  };
34
34
  export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarItem<Command>;
35
35
  export declare const getToolbarCellOptionsConfig: (editorState: EditorState, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarDropdown<Command>;
36
- export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (config: PluginConfig) => FloatingToolbarHandler;
36
+ export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags) => (config: PluginConfig) => FloatingToolbarHandler;
@@ -2,7 +2,7 @@ import { Node as PMNode } from 'prosemirror-model';
2
2
  import { Transaction } from 'prosemirror-state';
3
3
  import { EditorView } from 'prosemirror-view';
4
4
  import { ReportInvalidNodeAttrs } from '../types';
5
- export declare const fireAnalytics: (properties?: {}) => void;
5
+ export declare const fireAnalytics: (properties?: {}) => Promise<Response>;
6
6
  export declare const removeExtraneousColumnWidths: (node: PMNode, basePos: number, tr: Transaction, reportInvalidTableCellSpanAttrs?: ReportInvalidNodeAttrs | undefined) => boolean;
7
7
  export declare const fixTables: (tr: Transaction, reportInvalidTableCellSpanAttrs?: ReportInvalidNodeAttrs | undefined) => Transaction | undefined;
8
8
  export declare const fixAutoSizedTable: (view: EditorView, tableNode: PMNode, tableRef: HTMLTableElement, tablePos: number, opts: {
@@ -5,7 +5,7 @@ import { Cell, CellColumnPositioning, TableDecorations } from '../types';
5
5
  export declare const findColumnControlSelectedDecoration: (decorationSet: DecorationSet) => Decoration[];
6
6
  export declare const findControlsHoverDecoration: (decorationSet: DecorationSet) => Decoration[];
7
7
  export declare const createCellHoverDecoration: (cells: Cell[], type: 'warning') => Decoration[];
8
- export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row' | 'column' | 'table', danger?: boolean | undefined, selected?: boolean | undefined) => Decoration[];
8
+ export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row' | 'column' | 'table', tr: Transaction | ReadonlyTransaction, danger?: boolean | undefined, selected?: boolean | undefined) => Decoration[];
9
9
  export declare const createColumnSelectedDecoration: (tr: Transaction | ReadonlyTransaction) => Decoration[];
10
10
  export declare const createColumnControlsDecoration: (selection: Selection) => Decoration[];
11
11
  export declare const updateDecorations: (node: PmNode, decorationSet: DecorationSet, decorations: Decoration[], key: TableDecorations) => DecorationSet;
@@ -7,9 +7,9 @@ import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
7
7
  import { ResizeStateWithAnalytics } from './pm-plugins/table-resizing/utils';
8
8
  import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
9
9
  export declare const emptyMultipleCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB, targetCellPosition?: number | undefined) => Command;
10
- export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => Command;
11
- export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
12
- export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (cellColor: string, targetCellPosition?: number | undefined) => Command;
10
+ export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
11
+ export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
12
+ export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB, cellColor: string, targetCellPosition?: number | undefined) => Command;
13
13
  export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
14
14
  export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
15
15
  export declare const insertColumnWithAnalytics: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB, position: number) => Command;
@@ -21,6 +21,6 @@ export declare const toggleHeaderRowWithAnalytics: (editorAnalyticsAPI: EditorAn
21
21
  export declare const toggleHeaderColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
22
22
  export declare const toggleNumberColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
23
23
  export declare const toggleTableLayoutWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
24
- export declare const sortColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU, columnIndex: number, sortOrder: SortOrder) => Command;
25
- export declare const distributeColumnsWidthsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU, { resizeState, table, attributes }: ResizeStateWithAnalytics) => Command;
24
+ export declare const sortColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB, columnIndex: number, sortOrder: SortOrder) => Command;
25
+ export declare const distributeColumnsWidthsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB, { resizeState, table, attributes }: ResizeStateWithAnalytics) => Command;
26
26
  export declare const wrapTableInExpandWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
@@ -1,3 +1,4 @@
1
1
  export { createPlugin } from './plugin';
2
2
  export { scaleTable } from './commands';
3
3
  export { pluginKey } from './plugin-key';
4
+ export { getPluginState } from './plugin-factory';
@@ -1,4 +1,4 @@
1
- import type { Command, FloatingToolbarDropdown, FloatingToolbarHandler, FloatingToolbarItem } from '@atlaskit/editor-common/types';
1
+ import type { Command, FloatingToolbarDropdown, FloatingToolbarHandler, FloatingToolbarItem, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import { ToolbarMenuConfig, ToolbarMenuState, ToolbarMenuContext, PluginConfig } from './types';
4
4
  import { EditorState } from 'prosemirror-state';
@@ -33,4 +33,4 @@ export declare const messages: {
33
33
  };
34
34
  export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarItem<Command>;
35
35
  export declare const getToolbarCellOptionsConfig: (editorState: EditorState, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarDropdown<Command>;
36
- export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (config: PluginConfig) => FloatingToolbarHandler;
36
+ export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags) => (config: PluginConfig) => FloatingToolbarHandler;
@@ -2,7 +2,7 @@ import { Node as PMNode } from 'prosemirror-model';
2
2
  import { Transaction } from 'prosemirror-state';
3
3
  import { EditorView } from 'prosemirror-view';
4
4
  import { ReportInvalidNodeAttrs } from '../types';
5
- export declare const fireAnalytics: (properties?: {}) => void;
5
+ export declare const fireAnalytics: (properties?: {}) => Promise<Response>;
6
6
  export declare const removeExtraneousColumnWidths: (node: PMNode, basePos: number, tr: Transaction, reportInvalidTableCellSpanAttrs?: ReportInvalidNodeAttrs | undefined) => boolean;
7
7
  export declare const fixTables: (tr: Transaction, reportInvalidTableCellSpanAttrs?: ReportInvalidNodeAttrs | undefined) => Transaction | undefined;
8
8
  export declare const fixAutoSizedTable: (view: EditorView, tableNode: PMNode, tableRef: HTMLTableElement, tablePos: number, opts: {
@@ -5,7 +5,7 @@ import { Cell, CellColumnPositioning, TableDecorations } from '../types';
5
5
  export declare const findColumnControlSelectedDecoration: (decorationSet: DecorationSet) => Decoration[];
6
6
  export declare const findControlsHoverDecoration: (decorationSet: DecorationSet) => Decoration[];
7
7
  export declare const createCellHoverDecoration: (cells: Cell[], type: 'warning') => Decoration[];
8
- export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row' | 'column' | 'table', danger?: boolean | undefined, selected?: boolean | undefined) => Decoration[];
8
+ export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row' | 'column' | 'table', tr: Transaction | ReadonlyTransaction, danger?: boolean | undefined, selected?: boolean | undefined) => Decoration[];
9
9
  export declare const createColumnSelectedDecoration: (tr: Transaction | ReadonlyTransaction) => Decoration[];
10
10
  export declare const createColumnControlsDecoration: (selection: Selection) => Decoration[];
11
11
  export declare const updateDecorations: (node: PmNode, decorationSet: DecorationSet, decorations: Decoration[], key: TableDecorations) => DecorationSet;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file is used by the test scaling project to optimise test result caching
3
+ * Examples that are used by tests affect the outcome of tests so must be included when hashing
4
+ * They are defined here so the hashing algorithm doesn't need to search test files for example usage each time
5
+ */
6
+ {
7
+ "exampleDependencies": [
8
+ "@atlaskit/button",
9
+ "@atlaskit/link-provider",
10
+ "@atlaskit/logo",
11
+ "@atlaskit/media-integration-test-helpers",
12
+ "@atlaskit/synchrony-test-helpers"
13
+ ]
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "0.0.9",
3
+ "version": "0.1.0",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -14,18 +14,19 @@
14
14
  "typesVersions": {
15
15
  ">=4.0 <4.5": {
16
16
  "*": [
17
- "dist/types-ts4.0/*"
17
+ "dist/types-ts4.0/*",
18
+ "dist/types-ts4.0/index.d.ts"
18
19
  ]
19
20
  }
20
21
  },
21
22
  "atlaskit:src": "src/index.ts",
22
23
  "atlassian": {
23
24
  "team": "Editor",
24
- "releaseModel": "continuous"
25
+ "releaseModel": "scheduled"
25
26
  },
26
27
  "dependencies": {
27
28
  "@atlaskit/adf-schema": "^24.0.0",
28
- "@atlaskit/editor-common": "^70.1.0",
29
+ "@atlaskit/editor-common": "^70.2.0",
29
30
  "@atlaskit/editor-shared-styles": "^2.2.0",
30
31
  "@atlaskit/editor-tables": "^2.2.0",
31
32
  "@atlaskit/icon": "^21.11.0",
@@ -52,15 +53,14 @@
52
53
  "peerDependencies": {
53
54
  "react": "^16.8.0",
54
55
  "react-dom": "^16.8.0",
55
- "react-intl-next": "npm:react-intl@^5.18.1",
56
- "styled-components": "^3.2.6"
56
+ "react-intl-next": "npm:react-intl@^5.18.1"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@atlaskit/analytics-next": "^8.3.3",
60
- "@atlaskit/button": "^16.3.0",
61
- "@atlaskit/editor-core": "^173.0.0",
60
+ "@atlaskit/button": "^16.4.0",
61
+ "@atlaskit/editor-core": "^175.0.0",
62
62
  "@atlaskit/editor-test-helpers": "^17.2.0",
63
- "@atlaskit/link-provider": "^1.2.6",
63
+ "@atlaskit/link-provider": "^1.3.0",
64
64
  "@atlaskit/logo": "^13.10.0",
65
65
  "@atlaskit/media-integration-test-helpers": "^2.6.0",
66
66
  "@atlaskit/synchrony-test-helpers": "^2.3.0",
@@ -76,8 +76,12 @@
76
76
  "typescript": "4.5.5"
77
77
  },
78
78
  "af:exports": {
79
- "./types": "./src/types.ts",
80
- ".": "./src/index.ts"
79
+ "./types": "./src/plugins/table/types.ts",
80
+ ".": "./src/index.ts",
81
+ "./ui/common-styles": "./src/plugins/table/ui/common-styles.ts",
82
+ "./ui/consts": "./src/plugins/table/ui/consts.ts",
83
+ "./plugin-key": "./src/plugins/table/pm-plugins/plugin-key.ts",
84
+ "./commands": "./src/plugins/table/commands/index.ts"
81
85
  },
82
86
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
83
87
  "techstack": {
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "@atlaskit/editor-plugin-table/plugin-key",
3
+ "main": "../dist/cjs/plugins/table/pm-plugins/plugin-key.js",
4
+ "module": "../dist/esm/plugins/table/pm-plugins/plugin-key.js",
5
+ "module:es2019": "../dist/es2019/plugins/table/pm-plugins/plugin-key.js",
6
+ "types": "../dist/types/plugins/table/pm-plugins/plugin-key.d.ts",
7
+ "typesVersions": {
8
+ ">=4.0 <4.5": {
9
+ "*": [
10
+ "../dist/types-ts4.0/plugins/table/pm-plugins/plugin-key.d.ts"
11
+ ]
12
+ }
13
+ }
14
+ }
package/report.api.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- API Report Version: 2.2 -->
1
+ <!-- API Report Version: 2.3 -->
2
2
 
3
3
  ## API Report File for "@atlaskit/editor-plugin-table"
4
4
 
@@ -1,3 +1,4 @@
1
+ export {};
1
2
  it.todo('TODO: ED-15801 - Fix smart link async rendering integration test');
2
3
  // import { runBlockNodeSelectionTestSuite } from '@atlaskit/editor-test-helpers/integration/selection';
3
4
  //
@@ -1,6 +1,6 @@
1
1
  //import { runBlockNodeSelectionTestSuite } from '@atlaskit/editor-test-helpers/integration/selection';
2
2
  // import { _getCopyButtonTestSuite } from '@atlaskit/editor-core/src/plugins/copy-button/__tests__/integration/_getCopyButtonTestSuite';
3
-
3
+ export {};
4
4
  test.todo('TODO: ED-15706 We disabled the copy button');
5
5
  // _getCopyButtonTestSuite({
6
6
  // nodeName: 'Table',
@@ -7,12 +7,12 @@ import {
7
7
  fullpage,
8
8
  } from '@atlaskit/editor-test-helpers/integration/helpers';
9
9
  import { documentWithMergedCells } from './__fixtures__/merged-rows-and-cols-document';
10
- import { TableCssClassName as ClassName } from '@atlaskit/editor-core/src/plugins/table/types';
10
+ import { TableCssClassName as ClassName } from '../../plugins/table/types';
11
11
  import {
12
12
  goToEditorTestingWDExample,
13
13
  mountEditor,
14
14
  } from '@atlaskit/editor-test-helpers/testing-example-page';
15
- import messages from '@atlaskit/editor-core/src/plugins/table/ui/messages';
15
+ import messages from '../../plugins/table/ui/messages';
16
16
 
17
17
  BrowserTestCase(
18
18
  'Should delete merged columns from contextual menu and append missing cells to the table',