@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
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { WrappedComponentProps } from 'react-intl-next';
3
+ import { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ export interface Props {
5
+ editorView: EditorView;
6
+ tableRef?: HTMLTableElement;
7
+ isInDanger?: boolean;
8
+ isResizing?: boolean;
9
+ hoveredRows?: number[];
10
+ isHeaderColumnEnabled?: boolean;
11
+ isHeaderRowEnabled?: boolean;
12
+ stickyTop?: number;
13
+ }
14
+ export declare const CornerControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
15
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
16
+ };
@@ -0,0 +1,21 @@
1
+ import { Component } from 'react';
2
+ import { EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ export interface Props {
4
+ editorView: EditorView;
5
+ tableRef: HTMLTableElement;
6
+ tableActive?: boolean;
7
+ hoverRows: (rows: number[], danger?: boolean) => void;
8
+ hoveredRows?: number[];
9
+ selectRow: (row: number, expand: boolean) => void;
10
+ hasHeaderRow?: boolean;
11
+ isInDanger?: boolean;
12
+ isResizing?: boolean;
13
+ stickyTop?: number;
14
+ }
15
+ export default class NumberColumn extends Component<Props, any> {
16
+ render(): JSX.Element;
17
+ private hoverRows;
18
+ private selectRow;
19
+ private clearHoverSelection;
20
+ private getClassNames;
21
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import type { WrappedComponentProps } from 'react-intl-next';
3
+ import { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ export interface Props {
5
+ editorView: EditorView;
6
+ tableRef: HTMLTableElement;
7
+ selectRow: (row: number, expand: boolean) => void;
8
+ hoverRows: (rows: number[], danger?: boolean) => void;
9
+ hoveredRows?: number[];
10
+ isInDanger?: boolean;
11
+ isResizing?: boolean;
12
+ insertRowButtonIndex?: number;
13
+ stickyTop?: number;
14
+ }
15
+ export declare const RowControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
16
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
17
+ };
@@ -0,0 +1,39 @@
1
+ import { Component } from 'react';
2
+ import type { TableColumnOrdering } from '@atlaskit/custom-steps';
3
+ import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
+ import type { Selection } from '@atlaskit/editor-prosemirror/state';
5
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
+ import type { RowStickyState } from '../../pm-plugins/sticky-headers';
7
+ export interface Props {
8
+ editorView: EditorView;
9
+ getEditorFeatureFlags: GetEditorFeatureFlags;
10
+ selection?: Selection;
11
+ tableRef?: HTMLTableElement;
12
+ tableActive?: boolean;
13
+ isInDanger?: boolean;
14
+ isResizing?: boolean;
15
+ isHeaderRowEnabled?: boolean;
16
+ isHeaderColumnEnabled?: boolean;
17
+ isNumberColumnEnabled?: boolean;
18
+ hasHeaderRow?: boolean;
19
+ headerRowHeight?: number;
20
+ hoveredRows?: number[];
21
+ ordering?: TableColumnOrdering;
22
+ stickyHeader?: RowStickyState;
23
+ }
24
+ interface State {
25
+ tableHeight: number;
26
+ }
27
+ export default class TableFloatingControls extends Component<Props, State> {
28
+ static displayName: string;
29
+ private resizeObserver?;
30
+ componentDidMount(): void;
31
+ componentDidUpdate(): void;
32
+ private tryInitResizeObserver;
33
+ shouldComponentUpdate(nextProps: Props, nextState: State): boolean;
34
+ componentWillUnmount(): void;
35
+ render(): JSX.Element | null;
36
+ private selectRow;
37
+ private hoverRows;
38
+ }
39
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { FeatureFlags } from '@atlaskit/editor-common/types';
2
+ import type { ThemeProps } from '@atlaskit/theme/types';
3
+ export declare const insertColumnButtonOffset: number;
4
+ export declare const tableRowHeight = 44;
5
+ export declare const tableStyles: (props: ThemeProps & {
6
+ featureFlags?: FeatureFlags;
7
+ }) => import("@emotion/react").SerializedStyles;
8
+ export declare const tableFullPageEditorStyles: import("@emotion/react").SerializedStyles;
9
+ export declare const tableCommentEditorStyles: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Basic colors added to prevent content overflow in table cells.
3
+ */
4
+ export declare const tableCellBackgroundColor: import("@atlaskit/theme").ThemedValue<"var(--ds-surface)">;
5
+ export declare const tableHeaderCellBackgroundColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-accent-gray-subtlest)">;
6
+ export declare const tableToolbarColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-neutral-subtle)">;
7
+ export declare const tableTextColor: import("@atlaskit/theme").ThemedValue<"var(--ds-text-subtlest)">;
8
+ export declare const tableBorderColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-accent-gray-subtler)">;
9
+ export declare const tableFloatingControlsColor: "var(--ds-background-neutral)";
10
+ export declare const tableCellSelectedColor: import("@atlaskit/theme").ThemedValue<"var(--ds-blanket-selected)">;
11
+ export declare const tableToolbarSelectedColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-selected-pressed)">;
12
+ export declare const tableBorderSelectedColor: import("@atlaskit/theme").ThemedValue<"var(--ds-border-focused)">;
13
+ export declare const tableCellSelectedDeleteIconColor: import("@atlaskit/theme").ThemedValue<"var(--ds-icon-subtle)">;
14
+ export declare const tableCellSelectedDeleteIconBackground: import("@atlaskit/theme").ThemedValue<"var(--ds-background-accent-gray-subtlest)">;
15
+ export declare const tableCellDeleteColor: import("@atlaskit/theme").ThemedValue<"var(--ds-blanket-danger)">;
16
+ export declare const tableBorderDeleteColor: import("@atlaskit/theme").ThemedValue<"var(--ds-border-danger)">;
17
+ export declare const tableToolbarDeleteColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-danger-pressed)">;
18
+ export declare const tableCellHoverDeleteIconColor: import("@atlaskit/theme").ThemedValue<"var(--ds-icon-inverse)">;
19
+ export declare const tableCellHoverDeleteIconBackground: import("@atlaskit/theme").ThemedValue<"var(--ds-background-danger-bold)">;
20
+ export declare const tableBorderRadiusSize = 3;
21
+ export declare const tablePadding = 8;
22
+ export declare const tableScrollbarOffset = 15;
23
+ export declare const tableMarginFullWidthMode = 2;
24
+ export declare const tableInsertColumnButtonSize = 20;
25
+ export declare const tableDeleteButtonSize = 16;
26
+ export declare const tableDeleteButtonOffset = 6;
27
+ export declare const tableToolbarSize = 11;
28
+ export declare const tableControlsSpacing: number;
29
+ export declare const tableInsertColumnButtonOffset = 3;
30
+ export declare const layoutButtonSize = 32;
31
+ export declare const lineMarkerOffsetFromColumnControls = 13;
32
+ export declare const lineMarkerSize = 4;
33
+ export declare const columnControlsDecorationHeight = 25;
34
+ export declare const columnControlsZIndex: number;
35
+ export declare const columnControlsSelectedZIndex: number;
36
+ export declare const columnResizeHandleZIndex: number;
37
+ export declare const resizeHandlerAreaWidth: number;
38
+ export declare const resizeLineWidth = 2;
39
+ export declare const resizeHandlerZIndex: number;
40
+ export declare const contextualMenuTriggerSize = 16;
41
+ export declare const contextualMenuDropdownWidth = 180;
42
+ export declare const stickyRowZIndex: number;
43
+ export declare const stickyRowOffsetTop = 8;
44
+ export declare const stickyHeaderBorderBottomWidth = 1;
45
+ export declare const tableOverflowShadowWidth = 8;
46
+ export declare const tableOverflowShadowWidthWide = 32;
47
+ export declare const TABLE_SNAP_GAP = 9;
48
+ export declare const TABLE_HIGHLIGHT_GAP = 10;
49
+ export declare const TABLE_HIGHLIGHT_TOLERANCE = 2;
50
+ export declare const STICKY_HEADER_TOGGLE_TOLERANCE_MS = 5;
@@ -0,0 +1,63 @@
1
+ declare const _default: {
2
+ insertColumn: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ removeColumns: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ insertRow: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
17
+ removeRows: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ cellOptions: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
27
+ confirmDeleteLinkedModalOKButton: {
28
+ id: string;
29
+ defaultMessage: string;
30
+ description: string;
31
+ };
32
+ confirmDeleteLinkedModalMessage: {
33
+ id: string;
34
+ defaultMessage: string;
35
+ description: string;
36
+ };
37
+ confirmDeleteLinkedModalMessagePrefix: {
38
+ id: string;
39
+ defaultMessage: string;
40
+ description: string;
41
+ };
42
+ confirmModalCheckboxLabel: {
43
+ id: string;
44
+ defaultMessage: string;
45
+ description: string;
46
+ };
47
+ deleteElementTitle: {
48
+ id: string;
49
+ defaultMessage: string;
50
+ description: string;
51
+ };
52
+ unnamedSource: {
53
+ id: string;
54
+ defaultMessage: string;
55
+ description: string;
56
+ };
57
+ adjustColumns: {
58
+ id: string;
59
+ defaultMessage: string;
60
+ description: string;
61
+ };
62
+ };
63
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import type { ThemeProps } from '@atlaskit/theme/types';
2
+ export declare const InsertMarker: (props: ThemeProps, cssString?: string) => import("@emotion/react").SerializedStyles;
3
+ export declare const HeaderButton: (props: ThemeProps, cssString?: string) => import("@emotion/react").SerializedStyles;
4
+ export declare const HeaderButtonHover: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
5
+ export declare const HeaderButtonDanger: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
6
+ export declare const insertColumnButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
7
+ export declare const insertRowButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
8
+ export declare const columnControlsLineMarker: () => import("@emotion/react").SerializedStyles;
9
+ export declare const DeleteButton: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
10
+ export declare const OverflowShadow: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
11
+ export declare const columnControlsDecoration: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
12
+ export declare const hoveredDeleteButton: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
13
+ export declare const hoveredCell: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
14
+ export declare const hoveredWarningCell: import("@emotion/react").SerializedStyles;
15
+ export declare const resizeHandle: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
@@ -0,0 +1,45 @@
1
+ import type { AnalyticsEventPayload, AnalyticsEventPayloadCallback, EditorAnalyticsAPI, TableEventPayload } from '@atlaskit/editor-common/analytics';
2
+ import { HigherOrderCommand } from '@atlaskit/editor-common/types';
3
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
+ import { Selection } from '@atlaskit/editor-prosemirror/state';
5
+ import { TableMap } from '@atlaskit/editor-tables/table-map';
6
+ export declare function getSelectedTableInfo(selection: Selection): {
7
+ table: import("prosemirror-utils").ContentNodeWithPos | undefined;
8
+ map: TableMap | undefined;
9
+ totalRowCount: number;
10
+ totalColumnCount: number;
11
+ };
12
+ export declare function getSelectedCellInfo(selection: Selection): {
13
+ totalRowCount: number;
14
+ totalColumnCount: number;
15
+ horizontalCells: number;
16
+ verticalCells: number;
17
+ totalCells: number;
18
+ };
19
+ export declare const withEditorAnalyticsAPI: (payload: AnalyticsEventPayload | AnalyticsEventPayloadCallback) => (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => HigherOrderCommand;
20
+ interface UseMeasureFramerateConfig {
21
+ maxSamples?: number;
22
+ minFrames?: number;
23
+ minTimeMs?: number;
24
+ sampleRateMs?: number;
25
+ timeoutMs?: number;
26
+ }
27
+ export declare const generateResizedPayload: (props: {
28
+ originalNode: PMNode;
29
+ resizedNode: PMNode;
30
+ }) => TableEventPayload;
31
+ export declare const reduceResizeFrameRateSamples: (frameRateSamples: number[]) => number[];
32
+ export declare const generateResizeFrameRatePayloads: (props: {
33
+ docSize: number;
34
+ frameRateSamples: number[];
35
+ originalNode: PMNode;
36
+ }) => TableEventPayload[];
37
+ /**
38
+ * Measures the framerate of a component over a given time period.
39
+ */
40
+ export declare const useMeasureFramerate: (config?: UseMeasureFramerateConfig) => {
41
+ startMeasure: () => void;
42
+ endMeasure: () => number[];
43
+ countFrames: () => void;
44
+ };
45
+ export {};
@@ -0,0 +1,29 @@
1
+ import { NodeRange, NodeType } from '@atlaskit/editor-prosemirror/model';
2
+ import { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
3
+ interface IsTableCollapsibleResult {
4
+ tableIsCollapsible: boolean;
5
+ range?: NodeRange;
6
+ findWrappingRes?: Array<{
7
+ type: NodeType;
8
+ attrs?: {
9
+ [key: string]: any;
10
+ } | null;
11
+ }> | null | undefined;
12
+ }
13
+ /**
14
+ * Checks whether we can wrap the selected table into an expand via
15
+ * prosemirror-transform's `findWrapping` helper
16
+ */
17
+ export declare const isTableCollapsible: (tr: Transaction | ReadonlyTransaction) => IsTableCollapsibleResult;
18
+ /**
19
+ * Collapses the selected table into an expand given a transaction via
20
+ * `Transform.wrap`.
21
+ *
22
+ * Will return undefined if it cannot determine the relevant table from a
23
+ * selection, or if the table itself isn't collapsible.
24
+ *
25
+ * @param tr
26
+ * @returns Transaction | undefined
27
+ */
28
+ export declare const collapseSelectedTable: (tr: Transaction) => Transaction | undefined;
29
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Selection } from '@atlaskit/editor-prosemirror/state';
2
+ import { EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ export declare const getColumnsWidths: (view: EditorView) => Array<number | undefined>;
4
+ export declare const isColumnDeleteButtonVisible: (selection: Selection) => boolean;
5
+ export declare const getColumnDeleteButtonParams: (columnsWidths: Array<number | undefined>, selection: Selection) => {
6
+ left: number;
7
+ indexes: number[];
8
+ } | null;
9
+ export declare const getColumnClassNames: (index: number, selection: Selection, hoveredColumns?: number[], isInDanger?: boolean, isResizing?: boolean) => string;
10
+ export declare const colWidthsForRow: (tr: HTMLTableRowElement) => string;
@@ -0,0 +1,19 @@
1
+ import type { IntlShape } from 'react-intl-next';
2
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
+ import type { ReadonlyTransaction, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
4
+ import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
5
+ import { Decoration } from '@atlaskit/editor-prosemirror/view';
6
+ import type { Cell, CellColumnPositioning } from '../types';
7
+ import { TableDecorations } from '../types';
8
+ export declare const findColumnControlSelectedDecoration: (decorationSet: DecorationSet) => Decoration[];
9
+ export declare const findControlsHoverDecoration: (decorationSet: DecorationSet) => Decoration[];
10
+ export declare const createCellHoverDecoration: (cells: Cell[]) => Decoration[];
11
+ export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row' | 'column' | 'table', tr: Transaction | ReadonlyTransaction, danger?: boolean, selected?: boolean) => Decoration[];
12
+ export declare const createColumnSelectedDecoration: (tr: Transaction | ReadonlyTransaction) => Decoration[];
13
+ export declare const createColumnControlsDecoration: (selection: Selection) => Decoration[];
14
+ export declare const updateDecorations: (node: PmNode, decorationSet: DecorationSet, decorations: Decoration[], key: TableDecorations) => DecorationSet;
15
+ export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, 'left'>, includeTooltip: boolean | undefined, getIntl: () => IntlShape) => [
16
+ Decoration[],
17
+ Decoration[]
18
+ ];
19
+ export declare const createColumnLineResize: (selection: Selection, cellColumnPositioning: Omit<CellColumnPositioning, 'left'>) => Decoration[];
@@ -0,0 +1,20 @@
1
+ import type { ElementContentRects } from '../types';
2
+ export declare const isCell: (node: HTMLElement | null) => boolean;
3
+ export declare const isCornerButton: (node: HTMLElement | null) => boolean;
4
+ export declare const isInsertRowButton: (node: HTMLElement | null) => boolean | HTMLElement | null;
5
+ export declare const getColumnOrRowIndex: (target: HTMLElement) => [
6
+ number,
7
+ number
8
+ ];
9
+ export declare const isColumnControlsDecorations: (node: HTMLElement | null) => boolean;
10
+ export declare const isRowControlsButton: (node: HTMLElement | null) => boolean;
11
+ export declare const isResizeHandleDecoration: (node: HTMLElement | null) => boolean;
12
+ export declare const isTableControlsButton: (node: HTMLElement | null) => boolean;
13
+ export declare const isTableContainerOrWrapper: (node: HTMLElement | null) => boolean;
14
+ export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, elementContentRects?: ElementContentRects, gapInPixels?: number) => 'left' | 'right' | null;
15
+ export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => 'top' | 'bottom' | null;
16
+ export declare const updateResizeHandles: (tableRef?: HTMLElement) => void;
17
+ export declare const hasResizeHandler: ({ columnEndIndexTarget, target, }: {
18
+ columnEndIndexTarget: number;
19
+ target: HTMLElement;
20
+ }) => boolean;
@@ -0,0 +1,2 @@
1
+ import { EditorState } from '@atlaskit/editor-prosemirror/state';
2
+ export declare function getAllowAddColumnCustomStep(state: EditorState): boolean;
@@ -0,0 +1,2 @@
1
+ import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
2
+ export declare const defaultGuidelines: GuidelineConfig[];
@@ -0,0 +1,11 @@
1
+ export { getSelectedColumnIndexes, getSelectedRowIndexes, normalizeSelection, isSelectionUpdated, } from './selection';
2
+ export { findControlsHoverDecoration, createControlsHoverDecoration, createColumnControlsDecoration, createColumnSelectedDecoration, createCellHoverDecoration, updateDecorations, createResizeHandleDecoration, createColumnLineResize, } from './decoration';
3
+ export { isIsolating, containsHeaderColumn, containsHeaderRow, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isLayoutSupported, getTableWidth, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns, isTableNested, } from './nodes';
4
+ export { unwrapContentFromTable, removeTableFromFirstChild, removeTableFromLastChild, transformSliceToRemoveOpenTable, transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell, } from './paste';
5
+ export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowControlsButton, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler, } from './dom';
6
+ export { getColumnsWidths, isColumnDeleteButtonVisible, getColumnDeleteButtonParams, getColumnClassNames, } from './column-controls';
7
+ export { getRowHeights, isRowDeleteButtonVisible, getRowDeleteButtonParams, getRowsParams, getRowClassNames, copyPreviousRow, } from './row-controls';
8
+ export type { RowParams } from './row-controls';
9
+ export { getSelectedTableInfo, getSelectedCellInfo } from './analytics';
10
+ export { getMergedCellsPositions } from './table';
11
+ export { updatePluginStateDecorations } from './update-plugin-state-decorations';
@@ -0,0 +1,13 @@
1
+ import { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
2
+ import { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
3
+ export declare const isIsolating: (node: PmNode) => boolean;
4
+ export declare const containsHeaderColumn: (table: PmNode) => boolean;
5
+ export declare const containsHeaderRow: (table: PmNode) => boolean;
6
+ export declare const checkIfHeaderColumnEnabled: (selection: Selection) => boolean;
7
+ export declare const checkIfHeaderRowEnabled: (selection: Selection) => boolean;
8
+ export declare const checkIfNumberColumnEnabled: (selection: Selection) => boolean;
9
+ export declare const isLayoutSupported: (state: EditorState) => boolean;
10
+ export declare const getTableWidth: (node: PmNode) => number;
11
+ export declare const tablesHaveDifferentColumnWidths: (currentTable: PmNode, previousTable: PmNode) => boolean;
12
+ export declare const tablesHaveDifferentNoOfColumns: (currentTable: PmNode, previousTable: PmNode) => boolean;
13
+ export declare const isTableNested: (state: EditorState, tablePos?: number) => boolean;
@@ -0,0 +1,14 @@
1
+ import { Fragment, Node as PMNode, Schema, Slice } from '@atlaskit/editor-prosemirror/model';
2
+ import { EditorState } from '@atlaskit/editor-prosemirror/state';
3
+ export declare const unwrapContentFromTable: (maybeTable: PMNode) => PMNode | PMNode[];
4
+ export declare const removeTableFromFirstChild: (node: PMNode, i: number) => PMNode | PMNode[];
5
+ export declare const removeTableFromLastChild: (node: PMNode, i: number, fragment: Fragment) => PMNode | PMNode[];
6
+ /**
7
+ * When we copy from a table cell with a hardBreak at the end,
8
+ * the slice generated will come with a hardBreak outside of the table.
9
+ * This code will look for that pattern and fix it.
10
+ */
11
+ export declare const transformSliceToFixHardBreakProblemOnCopyFromCell: (slice: Slice, schema: Schema) => Slice;
12
+ export declare const transformSliceToRemoveOpenTable: (slice: Slice, schema: Schema) => Slice;
13
+ export declare const transformSliceToCorrectEmptyTableCells: (slice: Slice, schema: Schema) => Slice;
14
+ export declare function isHeaderRowRequired(state: EditorState): boolean | undefined;
@@ -0,0 +1,16 @@
1
+ import { Schema } from '@atlaskit/editor-prosemirror/model';
2
+ import { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
3
+ export interface RowParams {
4
+ startIndex: number;
5
+ endIndex: number;
6
+ height: number;
7
+ }
8
+ export declare const getRowHeights: (tableRef: HTMLTableElement) => number[];
9
+ export declare const isRowDeleteButtonVisible: (selection: Selection) => boolean;
10
+ export declare const getRowDeleteButtonParams: (rowsHeights: Array<number | undefined>, selection: Selection, offsetTop?: number) => {
11
+ top: number;
12
+ indexes: number[];
13
+ } | null;
14
+ export declare const getRowsParams: (rowsHeights: Array<number | undefined>) => RowParams[];
15
+ export declare const getRowClassNames: (index: number, selection: Selection, hoveredRows?: number[], isInDanger?: boolean, isResizing?: boolean) => string;
16
+ export declare const copyPreviousRow: (schema: Schema) => (insertNewRowIndex: number) => (tr: Transaction) => Transaction;
@@ -0,0 +1,6 @@
1
+ import { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
2
+ import { Rect } from '@atlaskit/editor-tables/table-map';
3
+ export declare const isSelectionUpdated: (oldSelection: Selection, newSelection?: Selection) => boolean;
4
+ export declare const normalizeSelection: (tr: Transaction) => Transaction;
5
+ export declare const getSelectedColumnIndexes: (selectionRect: Rect) => number[];
6
+ export declare const getSelectedRowIndexes: (selectionRect: Rect) => number[];
@@ -0,0 +1,10 @@
1
+ import { type GuidelineConfig } from '@atlaskit/editor-common/guideline';
2
+ export declare const calculateDefaultSnappings: (lengthOffset?: number) => number[];
3
+ export declare const defaultSnappingWidths: number[];
4
+ /**
5
+ * Returns keys of guidelines that are closest to the table and withthin the snapGap
6
+ */
7
+ export declare const findClosestSnap: (currentWidth: number, snapWidths: number[], guidelines: GuidelineConfig[], snapGap?: number, tolerance?: number) => {
8
+ gap: number;
9
+ keys: string[];
10
+ };
@@ -0,0 +1,4 @@
1
+ import { Transaction } from '@atlaskit/editor-prosemirror/state';
2
+ import { Rect } from '@atlaskit/editor-tables/table-map';
3
+ export declare const getMergedCellsPositions: (tr: Transaction) => number[];
4
+ export declare const colsToRect: (cols: Array<number>, noOfRows: number) => Rect;
@@ -0,0 +1,4 @@
1
+ import { EditorState } from '@atlaskit/editor-prosemirror/state';
2
+ import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
3
+ import { TableDecorations } from '../types';
4
+ export declare const updatePluginStateDecorations: (state: EditorState, decorations: Decoration[], key: TableDecorations) => DecorationSet;
@@ -0,0 +1,2 @@
1
+ import { default as tablesPlugin } from './table';
2
+ export default tablesPlugin;
@@ -0,0 +1,5 @@
1
+ export interface MessageDescriptor {
2
+ id: string;
3
+ description: string;
4
+ defaultMessage: string;
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "@atlaskit/adf-schema": "^32.0.0",
31
31
  "@atlaskit/custom-steps": "^0.0.2",
32
- "@atlaskit/editor-common": "^76.8.0",
32
+ "@atlaskit/editor-common": "^76.9.0",
33
33
  "@atlaskit/editor-palette": "1.5.1",
34
34
  "@atlaskit/editor-plugin-analytics": "^0.2.0",
35
35
  "@atlaskit/editor-plugin-content-insertion": "^0.1.0",
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/icon": "^21.12.0",
40
40
  "@atlaskit/platform-feature-flags": "^0.2.1",
41
41
  "@atlaskit/theme": "^12.6.0",
42
- "@atlaskit/tokens": "^1.25.0",
42
+ "@atlaskit/tokens": "^1.26.0",
43
43
  "@atlaskit/tooltip": "^17.8.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@emotion/react": "^11.7.1",
package/report.api.md CHANGED
@@ -19,12 +19,10 @@ import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
19
19
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
20
20
  import type { Command } from '@atlaskit/editor-common/types';
21
21
  import type { ContentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
22
- import type { EditorCommand } from '@atlaskit/editor-common/types';
23
- import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
24
22
  import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
25
23
  import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
26
24
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
27
- import type { OptionalPlugin } from '@atlaskit/editor-common/types';
25
+ import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
28
26
  import type { TableLayout } from '@atlaskit/adf-schema';
29
27
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
30
28
 
@@ -70,17 +68,6 @@ interface PluginConfig {
70
68
  stickyHeaders?: boolean;
71
69
  }
72
70
 
73
- // @public (undocumented)
74
- type SelectionPlugin = NextEditorPlugin<
75
- 'selection',
76
- {
77
- pluginConfiguration: unknown;
78
- commands: {
79
- displayGapCursor: (toggle: boolean) => EditorCommand;
80
- };
81
- }
82
- >;
83
-
84
71
  // @public (undocumented)
85
72
  export type TablePlugin = NextEditorPlugin<
86
73
  'table',
@@ -94,7 +81,7 @@ export type TablePlugin = NextEditorPlugin<
94
81
  ContentInsertionPlugin,
95
82
  WidthPlugin,
96
83
  GuidelinePlugin,
97
- OptionalPlugin<SelectionPlugin>,
84
+ SelectionPlugin,
98
85
  ];
99
86
  }
100
87
  >;
@@ -108,8 +95,6 @@ interface TablePluginOptions {
108
95
  // (undocumented)
109
96
  dragAndDropEnabled?: boolean;
110
97
  // (undocumented)
111
- editorSelectionAPI?: EditorSelectionAPI;
112
- // (undocumented)
113
98
  fullWidthEnabled?: boolean;
114
99
  // (undocumented)
115
100
  getEditorFeatureFlags?: GetEditorFeatureFlags;
@@ -43,6 +43,10 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
43
43
 
44
44
  import { pluginConfig } from './create-plugin-config';
45
45
  import { createPlugin as createDecorationsPlugin } from './pm-plugins/decorations/plugin';
46
+ import {
47
+ createPlugin as createDragAndDropPlugin,
48
+ pluginKey as dragAndDropPluginKey,
49
+ } from './pm-plugins/drag-and-drop';
46
50
  import { keymapPlugin } from './pm-plugins/keymap';
47
51
  import { createPlugin } from './pm-plugins/main';
48
52
  import { pluginKey } from './pm-plugins/plugin-key';
@@ -266,6 +270,13 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
266
270
  )
267
271
  : undefined,
268
272
  },
273
+ {
274
+ name: 'tableDragAndDrop',
275
+ plugin: ({ dispatch, eventDispatcher }) =>
276
+ options?.dragAndDropEnabled
277
+ ? createDragAndDropPlugin(dispatch, eventDispatcher)
278
+ : undefined,
279
+ },
269
280
  {
270
281
  name: 'tableLocalId',
271
282
  plugin: ({ dispatch }) => createTableLocalIdPlugin(dispatch),
@@ -343,6 +354,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
343
354
  tableWidthPluginState: tableWidthPluginKey,
344
355
  tableResizingPluginState: tableResizingPluginKey,
345
356
  stickyHeadersState: stickyHeadersPluginKey,
357
+ dragAndDropState: dragAndDropPluginKey,
346
358
  }}
347
359
  render={({
348
360
  tableResizingPluginState: resizingPluginState,
@@ -0,0 +1,29 @@
1
+ import type { DropTargetType } from './consts';
2
+
3
+ export interface DragAndDropAction<T, D> {
4
+ type: T;
5
+ data: D;
6
+ }
7
+
8
+ export const DragAndDropActionType = {
9
+ SET_DROP_TARGET: 'SET_DROP_TARGET',
10
+ CLEAR_DROP_TARGET: 'CLEAR_DROP_TARGET',
11
+ } as const;
12
+
13
+ export type DragAndDropSetDropTargetAction = DragAndDropAction<
14
+ typeof DragAndDropActionType.SET_DROP_TARGET,
15
+ {
16
+ type: DropTargetType;
17
+ index: number;
18
+ }
19
+ >;
20
+
21
+ export type DragAndDropClearDropTargetAction = DragAndDropAction<
22
+ typeof DragAndDropActionType.CLEAR_DROP_TARGET,
23
+ undefined
24
+ >;
25
+
26
+ // NOTE: This should be a Union of all possible actions
27
+ export type DragAndDropPluginAction =
28
+ | DragAndDropSetDropTargetAction
29
+ | DragAndDropClearDropTargetAction;