@atlaskit/editor-plugin-table 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/plugins/table/commands/misc.js +1 -2
  3. package/dist/cjs/plugins/table/index.js +25 -34
  4. package/dist/cjs/plugins/table/transforms/column-width.js +0 -17
  5. package/dist/cjs/plugins/table/transforms/delete-columns.js +4 -13
  6. package/dist/cjs/plugins/table/transforms/delete-rows.js +4 -13
  7. package/dist/cjs/plugins/table/transforms/fix-tables.js +6 -24
  8. package/dist/cjs/plugins/table/transforms/index.js +0 -13
  9. package/dist/cjs/plugins/table/transforms/merge.js +5 -20
  10. package/dist/cjs/version.json +1 -1
  11. package/dist/es2019/plugins/table/commands/misc.js +2 -3
  12. package/dist/es2019/plugins/table/index.js +21 -33
  13. package/dist/es2019/plugins/table/transforms/column-width.js +0 -17
  14. package/dist/es2019/plugins/table/transforms/delete-columns.js +4 -13
  15. package/dist/es2019/plugins/table/transforms/delete-rows.js +4 -13
  16. package/dist/es2019/plugins/table/transforms/fix-tables.js +0 -14
  17. package/dist/es2019/plugins/table/transforms/index.js +1 -2
  18. package/dist/es2019/plugins/table/transforms/merge.js +5 -21
  19. package/dist/es2019/version.json +1 -1
  20. package/dist/esm/plugins/table/commands/misc.js +2 -3
  21. package/dist/esm/plugins/table/index.js +25 -34
  22. package/dist/esm/plugins/table/transforms/column-width.js +0 -17
  23. package/dist/esm/plugins/table/transforms/delete-columns.js +4 -13
  24. package/dist/esm/plugins/table/transforms/delete-rows.js +4 -13
  25. package/dist/esm/plugins/table/transforms/fix-tables.js +0 -17
  26. package/dist/esm/plugins/table/transforms/index.js +1 -2
  27. package/dist/esm/plugins/table/transforms/merge.js +5 -21
  28. package/dist/esm/version.json +1 -1
  29. package/dist/types/plugins/table/index.d.ts +9 -0
  30. package/dist/types/plugins/table/transforms/fix-tables.d.ts +0 -1
  31. package/dist/types/plugins/table/transforms/index.d.ts +1 -2
  32. package/dist/types-ts4.5/i18n/cs.d.ts +35 -0
  33. package/dist/types-ts4.5/i18n/da.d.ts +33 -0
  34. package/dist/types-ts4.5/i18n/de.d.ts +33 -0
  35. package/dist/types-ts4.5/i18n/en.d.ts +35 -0
  36. package/dist/types-ts4.5/i18n/en_GB.d.ts +35 -0
  37. package/dist/types-ts4.5/i18n/es.d.ts +33 -0
  38. package/dist/types-ts4.5/i18n/fi.d.ts +33 -0
  39. package/dist/types-ts4.5/i18n/fr.d.ts +35 -0
  40. package/dist/types-ts4.5/i18n/hu.d.ts +35 -0
  41. package/dist/types-ts4.5/i18n/it.d.ts +35 -0
  42. package/dist/types-ts4.5/i18n/ja.d.ts +35 -0
  43. package/dist/types-ts4.5/i18n/ko.d.ts +33 -0
  44. package/dist/types-ts4.5/i18n/nb.d.ts +33 -0
  45. package/dist/types-ts4.5/i18n/nl.d.ts +35 -0
  46. package/dist/types-ts4.5/i18n/pl.d.ts +35 -0
  47. package/dist/types-ts4.5/i18n/pt_BR.d.ts +35 -0
  48. package/dist/types-ts4.5/i18n/ru.d.ts +35 -0
  49. package/dist/types-ts4.5/i18n/sv.d.ts +33 -0
  50. package/dist/types-ts4.5/i18n/th.d.ts +33 -0
  51. package/dist/types-ts4.5/i18n/tr.d.ts +35 -0
  52. package/dist/types-ts4.5/i18n/uk.d.ts +35 -0
  53. package/dist/types-ts4.5/i18n/vi.d.ts +33 -0
  54. package/dist/types-ts4.5/i18n/zh.d.ts +35 -0
  55. package/dist/types-ts4.5/i18n/zh_TW.d.ts +35 -0
  56. package/dist/types-ts4.5/index.d.ts +1 -0
  57. package/dist/types-ts4.5/plugins/table/commands/clear.d.ts +3 -0
  58. package/dist/types-ts4.5/plugins/table/commands/collapse.d.ts +2 -0
  59. package/dist/types-ts4.5/plugins/table/commands/go-to-next-cell.d.ts +4 -0
  60. package/dist/types-ts4.5/plugins/table/commands/hover.d.ts +8 -0
  61. package/dist/types-ts4.5/plugins/table/commands/index.d.ts +8 -0
  62. package/dist/types-ts4.5/plugins/table/commands/insert.d.ts +10 -0
  63. package/dist/types-ts4.5/plugins/table/commands/misc.d.ts +27 -0
  64. package/dist/types-ts4.5/plugins/table/commands/referentiality.d.ts +2 -0
  65. package/dist/types-ts4.5/plugins/table/commands/selection.d.ts +8 -0
  66. package/dist/types-ts4.5/plugins/table/commands/sort.d.ts +3 -0
  67. package/dist/types-ts4.5/plugins/table/commands/split-cell.d.ts +6 -0
  68. package/dist/types-ts4.5/plugins/table/commands/toggle.d.ts +12 -0
  69. package/dist/types-ts4.5/plugins/table/commands-with-analytics.d.ts +26 -0
  70. package/dist/types-ts4.5/plugins/table/create-plugin-config.d.ts +2 -0
  71. package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +16 -0
  72. package/dist/types-ts4.5/plugins/table/handlers.d.ts +3 -0
  73. package/dist/types-ts4.5/plugins/table/index.d.ts +30 -0
  74. package/dist/types-ts4.5/plugins/table/nodeviews/OverflowShadowsObserver.d.ts +25 -0
  75. package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +73 -0
  76. package/dist/types-ts4.5/plugins/table/nodeviews/__mocks__/OverflowShadowsObserver.d.ts +9 -0
  77. package/dist/types-ts4.5/plugins/table/nodeviews/__mocks__/OverridableMock.d.ts +9 -0
  78. package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +34 -0
  79. package/dist/types-ts4.5/plugins/table/nodeviews/tableCell.d.ts +19 -0
  80. package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +24 -0
  81. package/dist/types-ts4.5/plugins/table/nodeviews/update-overflow-shadows.d.ts +8 -0
  82. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/plugin.d.ts +7 -0
  83. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-controls.d.ts +3 -0
  84. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-resizing.d.ts +2 -0
  85. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/compose-decorations.d.ts +2 -0
  86. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/index.d.ts +3 -0
  87. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/types.d.ts +6 -0
  88. package/dist/types-ts4.5/plugins/table/pm-plugins/default-table-selection.d.ts +4 -0
  89. package/dist/types-ts4.5/plugins/table/pm-plugins/keymap.d.ts +5 -0
  90. package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +8 -0
  91. package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-factory.d.ts +1 -0
  92. package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
  93. package/dist/types-ts4.5/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +15 -0
  94. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/commands.d.ts +3 -0
  95. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/index.d.ts +6 -0
  96. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +6 -0
  97. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +72 -0
  98. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-key.d.ts +3 -0
  99. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-state.d.ts +3 -0
  100. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +4 -0
  101. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/types.d.ts +16 -0
  102. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/util.d.ts +2 -0
  103. package/dist/types-ts4.5/plugins/table/pm-plugins/table-local-id.d.ts +22 -0
  104. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/commands.d.ts +25 -0
  105. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +4 -0
  106. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/index.d.ts +4 -0
  107. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-factory.d.ts +4 -0
  108. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-key.d.ts +3 -0
  109. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin.d.ts +6 -0
  110. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/reducer.d.ts +3 -0
  111. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +15 -0
  112. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/column-state.d.ts +14 -0
  113. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/content-width.d.ts +4 -0
  114. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +13 -0
  115. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/index.d.ts +12 -0
  116. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +22 -0
  117. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -0
  118. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-logic.d.ts +4 -0
  119. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +29 -0
  120. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +17 -0
  121. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +22 -0
  122. package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.d.ts +1 -0
  123. package/dist/types-ts4.5/plugins/table/pm-plugins/table-selection-keymap.d.ts +4 -0
  124. package/dist/types-ts4.5/plugins/table/reducer.d.ts +3 -0
  125. package/dist/types-ts4.5/plugins/table/toolbar.d.ts +37 -0
  126. package/dist/types-ts4.5/plugins/table/transforms/column-width.d.ts +18 -0
  127. package/dist/types-ts4.5/plugins/table/transforms/delete-columns.d.ts +3 -0
  128. package/dist/types-ts4.5/plugins/table/transforms/delete-rows.d.ts +3 -0
  129. package/dist/types-ts4.5/plugins/table/transforms/fix-tables.d.ts +9 -0
  130. package/dist/types-ts4.5/plugins/table/transforms/index.d.ts +6 -0
  131. package/dist/types-ts4.5/plugins/table/transforms/merge.d.ts +5 -0
  132. package/dist/types-ts4.5/plugins/table/transforms/replace-table.d.ts +5 -0
  133. package/dist/types-ts4.5/plugins/table/transforms/split.d.ts +9 -0
  134. package/dist/types-ts4.5/plugins/table/types.d.ts +332 -0
  135. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/index.d.ts +29 -0
  136. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/styles.d.ts +3 -0
  137. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +88 -0
  138. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/index.d.ts +23 -0
  139. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/styles.d.ts +2 -0
  140. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +14 -0
  141. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.d.ts +10 -0
  142. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/index.d.ts +54 -0
  143. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/types.d.ts +1 -0
  144. package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +12 -0
  145. package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +3 -0
  146. package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/index.d.ts +35 -0
  147. package/dist/types-ts4.5/plugins/table/ui/LayoutButton/index.d.ts +21 -0
  148. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +16 -0
  149. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +21 -0
  150. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/index.d.ts +17 -0
  151. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +40 -0
  152. package/dist/types-ts4.5/plugins/table/ui/common-styles.d.ts +8 -0
  153. package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +39 -0
  154. package/dist/types-ts4.5/plugins/table/ui/messages.d.ts +58 -0
  155. package/dist/types-ts4.5/plugins/table/ui/ui-styles.d.ts +15 -0
  156. package/dist/types-ts4.5/plugins/table/utils/analytics.d.ts +18 -0
  157. package/dist/types-ts4.5/plugins/table/utils/collapse.d.ts +29 -0
  158. package/dist/types-ts4.5/plugins/table/utils/column-controls.d.ts +10 -0
  159. package/dist/types-ts4.5/plugins/table/utils/decoration.d.ts +16 -0
  160. package/dist/types-ts4.5/plugins/table/utils/dom.d.ts +20 -0
  161. package/dist/types-ts4.5/plugins/table/utils/get-allow-add-column-custom-step.d.ts +2 -0
  162. package/dist/types-ts4.5/plugins/table/utils/index.d.ts +11 -0
  163. package/dist/types-ts4.5/plugins/table/utils/nodes.d.ts +12 -0
  164. package/dist/types-ts4.5/plugins/table/utils/paste.d.ts +14 -0
  165. package/dist/types-ts4.5/plugins/table/utils/row-controls.d.ts +16 -0
  166. package/dist/types-ts4.5/plugins/table/utils/selection.d.ts +6 -0
  167. package/dist/types-ts4.5/plugins/table/utils/table.d.ts +4 -0
  168. package/dist/types-ts4.5/plugins/table/utils/update-plugin-state-decorations.d.ts +4 -0
  169. package/dist/types-ts4.5/plugins/table-plugin.d.ts +2 -0
  170. package/dist/types-ts4.5/types/i18n.d.ts +5 -0
  171. package/examples/99-testing.tsx +4 -94
  172. package/package.json +7 -5
  173. package/report.api.md +11 -0
  174. package/src/__tests__/unit/analytics.ts +6 -0
  175. package/src/__tests__/unit/collab.ts +6 -0
  176. package/src/__tests__/unit/color-picker.ts +4 -0
  177. package/src/__tests__/unit/commands/go-to-next-cell.ts +8 -1
  178. package/src/__tests__/unit/commands/insert.ts +6 -0
  179. package/src/__tests__/unit/commands/misc.ts +14 -6
  180. package/src/__tests__/unit/commands/sort.ts +19 -12
  181. package/src/__tests__/unit/commands.ts +10 -2
  182. package/src/__tests__/unit/copy-paste.ts +6 -0
  183. package/src/__tests__/unit/event-handlers/index.ts +13 -8
  184. package/src/__tests__/unit/event-handlers.ts +13 -1
  185. package/src/__tests__/unit/fix-tables.ts +8 -4
  186. package/src/__tests__/unit/get-toolbar-config.ts +4 -0
  187. package/src/__tests__/unit/handlers.ts +8 -1
  188. package/src/__tests__/unit/hover-selection.ts +8 -1
  189. package/src/__tests__/unit/index.ts +10 -2
  190. package/src/__tests__/unit/keymap.ts +10 -4
  191. package/src/__tests__/unit/layout.ts +4 -0
  192. package/src/__tests__/unit/nodeviews/cell.ts +6 -0
  193. package/src/__tests__/unit/nodeviews/table.ts +16 -9
  194. package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +14 -4
  195. package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +8 -1
  196. package/src/__tests__/unit/pm-plugins/main-with-allow-collapse.ts +4 -0
  197. package/src/__tests__/unit/pm-plugins/main.ts +6 -0
  198. package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +8 -4
  199. package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +13 -4
  200. package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +6 -0
  201. package/src/__tests__/unit/pm-plugins/table-selection-keymap.ts +6 -0
  202. package/src/__tests__/unit/sort-column.ts +6 -0
  203. package/src/__tests__/unit/toolbar.ts +16 -9
  204. package/src/__tests__/unit/transforms/delete-columns.ts +8 -1
  205. package/src/__tests__/unit/transforms/delete-rows.ts +8 -1
  206. package/src/__tests__/unit/transforms/merging.ts +8 -1
  207. package/src/__tests__/unit/ui/ContextualMenu.tsx +8 -4
  208. package/src/__tests__/unit/ui/CornerControls.tsx +8 -1
  209. package/src/__tests__/unit/ui/FloatingContextualButton.tsx +8 -1
  210. package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +8 -1
  211. package/src/__tests__/unit/ui/RowControls.tsx +8 -1
  212. package/src/__tests__/unit/ui/TableFloatingControls.tsx +8 -1
  213. package/src/__tests__/unit/undo-redo.ts +6 -0
  214. package/src/__tests__/unit/utils/collapse.ts +4 -0
  215. package/src/__tests__/unit/utils/nodes.ts +8 -1
  216. package/src/__tests__/unit/utils/row-controls.ts +8 -1
  217. package/src/__tests__/unit/utils.ts +8 -1
  218. package/src/plugins/table/commands/misc.ts +2 -4
  219. package/src/plugins/table/index.tsx +39 -40
  220. package/src/plugins/table/transforms/column-width.ts +0 -11
  221. package/src/plugins/table/transforms/delete-columns.ts +4 -5
  222. package/src/plugins/table/transforms/delete-rows.ts +4 -7
  223. package/src/plugins/table/transforms/fix-tables.ts +0 -17
  224. package/src/plugins/table/transforms/index.ts +1 -2
  225. package/src/plugins/table/transforms/merge.ts +9 -20
  226. package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +0 -79
  227. package/dist/cjs/plugins/table/transforms/metadata.js +0 -20
  228. package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +0 -71
  229. package/dist/es2019/plugins/table/transforms/metadata.js +0 -12
  230. package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +0 -71
  231. package/dist/esm/plugins/table/transforms/metadata.js +0 -14
  232. package/dist/types/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.d.ts +0 -4
  233. package/dist/types/plugins/table/transforms/metadata.d.ts +0 -21
  234. package/src/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.ts +0 -78
  235. package/src/plugins/table/transforms/metadata.ts +0 -35
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { EditorView } from 'prosemirror-view';
3
+ import type { WrappedComponentProps } from 'react-intl-next';
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,40 @@
1
+ import { Component } from 'react';
2
+ import { Selection } from 'prosemirror-state';
3
+ import { EditorView } from 'prosemirror-view';
4
+ import type { TableColumnOrdering } from '@atlaskit/adf-schema/steps';
5
+ import { RowStickyState } from '../../pm-plugins/sticky-headers';
6
+ import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
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
+ tableHeight?: number;
20
+ headerRowHeight?: number;
21
+ hoveredRows?: number[];
22
+ ordering?: TableColumnOrdering;
23
+ stickyHeader?: RowStickyState;
24
+ }
25
+ interface State {
26
+ tableHeight: number;
27
+ }
28
+ export default class TableFloatingControls extends Component<Props, State> {
29
+ static displayName: string;
30
+ private resizeObserver?;
31
+ componentDidMount(): void;
32
+ componentDidUpdate(): void;
33
+ private tryInitResizeObserver;
34
+ shouldComponentUpdate(nextProps: Props, nextState: State): boolean;
35
+ componentWillUnmount(): void;
36
+ render(): JSX.Element | null;
37
+ private selectRow;
38
+ private hoverRows;
39
+ }
40
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { FeatureFlags } from '@atlaskit/editor-common/types';
2
+ import { ThemeProps } from '@atlaskit/theme/types';
3
+ export declare const insertColumnButtonOffset: number;
4
+ export declare const tableStyles: (props: ThemeProps & {
5
+ featureFlags?: FeatureFlags;
6
+ }) => import("@emotion/react").SerializedStyles;
7
+ export declare const tableFullPageEditorStyles: import("@emotion/react").SerializedStyles;
8
+ export declare const tableCommentEditorStyles: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,39 @@
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 tableToolbarColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-neutral-subtle)">;
6
+ export declare const tableTextColor: import("@atlaskit/theme").ThemedValue<"var(--ds-text-subtlest)">;
7
+ export declare const tableBorderColor: import("@atlaskit/theme").ThemedValue<"var(--ds-border)">;
8
+ export declare const tableFloatingControlsColor: "var(--ds-background-neutral)";
9
+ export declare const tableCellSelectedColor: "var(--ds-blanket-selected)";
10
+ export declare const tableToolbarSelectedColor: "var(--ds-background-selected-bold)";
11
+ export declare const tableBorderSelectedColor: "var(--ds-border-selected)";
12
+ export declare const tableCellDeleteColor: "var(--ds-blanket-danger)";
13
+ export declare const tableBorderDeleteColor: "var(--ds-border-danger)";
14
+ export declare const tableToolbarDeleteColor: "var(--ds-background-danger-bold)";
15
+ export declare const tableBorderRadiusSize = 3;
16
+ export declare const tablePadding = 8;
17
+ export declare const tableScrollbarOffset = 15;
18
+ export declare const tableMarginFullWidthMode = 2;
19
+ export declare const tableInsertColumnButtonSize = 20;
20
+ export declare const tableDeleteButtonSize = 16;
21
+ export declare const tableDeleteButtonOffset = 6;
22
+ export declare const tableToolbarSize = 11;
23
+ export declare const tableControlsSpacing: number;
24
+ export declare const tableInsertColumnButtonOffset = 3;
25
+ export declare const layoutButtonSize = 32;
26
+ export declare const lineMarkerOffsetFromColumnControls = 13;
27
+ export declare const lineMarkerSize = 4;
28
+ export declare const columnControlsDecorationHeight = 25;
29
+ export declare const columnControlsZIndex: number;
30
+ export declare const columnControlsSelectedZIndex: number;
31
+ export declare const columnResizeHandleZIndex: number;
32
+ export declare const resizeHandlerAreaWidth: number;
33
+ export declare const resizeLineWidth = 2;
34
+ export declare const resizeHandlerZIndex: number;
35
+ export declare const contextualMenuTriggerSize = 16;
36
+ export declare const contextualMenuDropdownWidth = 180;
37
+ export declare const stickyRowZIndex: number;
38
+ export declare const stickyRowOffsetTop = 8;
39
+ export declare const stickyHeaderBorderBottomWidth = 1;
@@ -0,0 +1,58 @@
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
+ };
58
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import { 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: () => import("@emotion/react").SerializedStyles;
5
+ export declare const HeaderButtonDanger: () => import("@emotion/react").SerializedStyles;
6
+ export declare const insertColumnButtonWrapper: import("@emotion/react").SerializedStyles;
7
+ export declare const insertRowButtonWrapper: import("@emotion/react").SerializedStyles;
8
+ export declare const columnControlsLineMarker: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
9
+ export declare const DeleteButton: 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: import("@emotion/react").SerializedStyles;
13
+ export declare const hoveredCell: import("@emotion/react").SerializedStyles;
14
+ export declare const hoveredWarningCell: import("@emotion/react").SerializedStyles;
15
+ export declare const resizeHandle: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,18 @@
1
+ import { Selection } from 'prosemirror-state';
2
+ import { TableMap } from '@atlaskit/editor-tables/table-map';
3
+ import type { AnalyticsEventPayload, AnalyticsEventPayloadCallback, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
+ import { HigherOrderCommand } from '@atlaskit/editor-common/types';
5
+ export declare function getSelectedTableInfo(selection: Selection): {
6
+ table: import("prosemirror-utils").ContentNodeWithPos | undefined;
7
+ map: TableMap | undefined;
8
+ totalRowCount: number;
9
+ totalColumnCount: number;
10
+ };
11
+ export declare function getSelectedCellInfo(selection: Selection): {
12
+ totalRowCount: number;
13
+ totalColumnCount: number;
14
+ horizontalCells: number;
15
+ verticalCells: number;
16
+ totalCells: number;
17
+ };
18
+ export declare const withEditorAnalyticsAPI: (payload: AnalyticsEventPayload | AnalyticsEventPayloadCallback) => (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => HigherOrderCommand;
@@ -0,0 +1,29 @@
1
+ import { NodeType, NodeRange, Schema } from 'prosemirror-model';
2
+ import { Transaction, ReadonlyTransaction } from 'prosemirror-state';
3
+ interface IsTableCollapsibleResult<S extends Schema = any> {
4
+ tableIsCollapsible: boolean;
5
+ range?: NodeRange;
6
+ findWrappingRes?: Array<{
7
+ type: NodeType<S>;
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 'prosemirror-state';
2
+ import { EditorView } from '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: (colGroup: HTMLTableColElement | null, tr: HTMLTableRowElement) => string;
@@ -0,0 +1,16 @@
1
+ import { Node as PmNode } from 'prosemirror-model';
2
+ import { Selection, Transaction, ReadonlyTransaction } from 'prosemirror-state';
3
+ import { Decoration, DecorationSet } from 'prosemirror-view';
4
+ import { Cell, CellColumnPositioning, TableDecorations } from '../types';
5
+ export declare const findColumnControlSelectedDecoration: (decorationSet: DecorationSet) => Decoration[];
6
+ export declare const findControlsHoverDecoration: (decorationSet: DecorationSet) => Decoration[];
7
+ export declare const createCellHoverDecoration: (cells: Cell[], type: 'warning') => Decoration[];
8
+ export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row' | 'column' | 'table', tr: Transaction | ReadonlyTransaction, danger?: boolean, selected?: boolean) => Decoration[];
9
+ export declare const createColumnSelectedDecoration: (tr: Transaction | ReadonlyTransaction) => Decoration[];
10
+ export declare const createColumnControlsDecoration: (selection: Selection) => Decoration[];
11
+ export declare const updateDecorations: (node: PmNode, decorationSet: DecorationSet, decorations: Decoration[], key: TableDecorations) => DecorationSet;
12
+ export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, 'left'>) => [
13
+ Decoration[],
14
+ Decoration[]
15
+ ];
16
+ export declare const createColumnLineResize: (selection: Selection, cellColumnPositioning: Omit<CellColumnPositioning, 'left'>) => Decoration[];
@@ -0,0 +1,20 @@
1
+ import { 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, mouseMoveOptimization?: boolean, 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 'prosemirror-state';
2
+ export declare function getAllowAddColumnCustomStep(state: EditorState): boolean;
@@ -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, } 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,12 @@
1
+ import { Node as PmNode } from 'prosemirror-model';
2
+ import { EditorState, Selection } from '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;
@@ -0,0 +1,14 @@
1
+ import { Fragment, Node as PMNode, Schema, Slice } from 'prosemirror-model';
2
+ import { EditorState } from '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 'prosemirror-model';
2
+ import { Selection, Transaction } from '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<any>;
@@ -0,0 +1,6 @@
1
+ import { Selection, Transaction } from '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,4 @@
1
+ import { Transaction } from '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 'prosemirror-state';
2
+ import { Decoration, DecorationSet } from 'prosemirror-view';
3
+ import { TableDecorations } from '../types';
4
+ export declare const updatePluginStateDecorations: (state: EditorState<any>, 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
+ }
@@ -12,72 +12,14 @@ import {
12
12
  createEditorExampleForTests,
13
13
  mapProvidersToProps,
14
14
  } from '@atlaskit/editor-core/example-helpers/create-editor-example-for-tests';
15
- import { Editor, ContextPanel } from '@atlaskit/editor-core/src';
15
+ import {
16
+ EditorMigrationComponent as Editor,
17
+ ContextPanel,
18
+ } from '@atlaskit/editor-core/src';
16
19
  import { SaveAndCancelButtons } from '@atlaskit/editor-core/examples/5-full-page';
17
20
  import { TitleInput } from '@atlaskit/editor-core/example-helpers/PageElements';
18
21
  import { getDefaultLinkPickerOptions } from '@atlaskit/editor-core/example-helpers/link-picker';
19
22
  import { CollabEditOptions } from '@atlaskit/editor-core/src/plugins/collab-edit';
20
- import { tablesPlugin as createTablesPlugin } from '../src';
21
-
22
- import type { RelativeSelectionPos } from '@atlaskit/editor-common/selection';
23
- import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
24
- import type { FeatureFlags as EditorFeatureFlags } from '@atlaskit/editor-common/types';
25
- import type { Transaction, Selection, EditorState } from 'prosemirror-state';
26
- import type {
27
- EditorAnalyticsAPI,
28
- AnalyticsEventPayload,
29
- } from '@atlaskit/editor-common/analytics';
30
-
31
- const editorAnalyticsAPI: EditorAnalyticsAPI = {
32
- attachAnalyticsEvent: (payload: AnalyticsEventPayload) => {
33
- // You can send your payload to anyplace
34
- // It is recommend that you delay any blocking operation
35
- // with 'requestIdleCallback' or 'requestAnimationFrame'
36
- if (window.requestAnimationFrame) {
37
- window.requestAnimationFrame(() => {
38
- /* sending my data */
39
- console.log('Sending...', payload);
40
- });
41
- }
42
-
43
- return (_tr: Transaction) => {
44
- // Probably, you don't care about this.
45
- // just return true;
46
- return true;
47
- };
48
- },
49
- };
50
- const editorSelectionAPI = {
51
- getSelectionPluginState: (state: EditorState) => {
52
- // DO NOT COPY THIS KIND OF CODE OUTSIDE OF THIS API
53
- // IT IS DANGEROUS AND YOU WILL BREAK SOMETHING
54
- return (state as any)['selection$'];
55
- },
56
- setSelectionRelativeToNode:
57
- ({
58
- selectionRelativeToNode,
59
- selection,
60
- }: {
61
- selectionRelativeToNode?: RelativeSelectionPos;
62
- selection?: Selection | null;
63
- }) =>
64
- (state: EditorState) => {
65
- const tr = state.tr;
66
-
67
- // THE CODE BELOW IS REALLY WRONG
68
- // DO NOT EVEN THINK TO USE THIS ANYWHERE ELSE
69
- tr.setMeta('selection$', {
70
- type: 'SET_RELATIVE_SELECTION',
71
- selectionRelativeToNode,
72
- });
73
-
74
- if (selection) {
75
- tr.setSelection(selection);
76
- }
77
-
78
- return tr;
79
- },
80
- };
81
23
 
82
24
  export default function EditorExampleForIntegrationTests({ clipboard = true }) {
83
25
  return createEditorExampleForTests<any>(
@@ -152,37 +94,6 @@ export default function EditorExampleForIntegrationTests({ clipboard = true }) {
152
94
  };
153
95
  }
154
96
 
155
- const tableOptions =
156
- !props.allowTables || typeof props.allowTables === 'boolean'
157
- ? {}
158
- : props.allowTables;
159
-
160
- const getEditorFeatureFlags = (): EditorFeatureFlags => {
161
- const normalizedFeatureFlags = normalizeFeatureFlags(
162
- props.featureFlags,
163
- );
164
-
165
- return {
166
- ...normalizedFeatureFlags,
167
- };
168
- };
169
-
170
- const isMobile = props.appearance === 'mobile';
171
- const tablesPlugin = createTablesPlugin({
172
- tableOptions,
173
- breakoutEnabled: props.appearance === 'full-page',
174
- allowContextualMenu: !isMobile,
175
- fullWidthEnabled: props.appearance === 'full-width',
176
- editorAnalyticsAPI,
177
- editorSelectionAPI,
178
- getEditorFeatureFlags,
179
- });
180
-
181
- props.allowTables = false;
182
- const dangerouslyAppendPlugins = {
183
- __plugins: [tablesPlugin],
184
- };
185
-
186
97
  const createCollabEdit = (userId: string): CollabEditOptions => {
187
98
  return {
188
99
  provider: createCollabEditProvider({ userId }),
@@ -202,7 +113,6 @@ export default function EditorExampleForIntegrationTests({ clipboard = true }) {
202
113
  onChange={onChange}
203
114
  onDestroy={onDestroy}
204
115
  collabEdit={collabEdit}
205
- dangerouslyAppendPlugins={dangerouslyAppendPlugins}
206
116
  />
207
117
  </IntlProvider>
208
118
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -27,8 +27,10 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@atlaskit/adf-schema": "^25.6.0",
30
- "@atlaskit/editor-common": "^74.0.0",
30
+ "@atlaskit/editor-common": "^74.1.0",
31
31
  "@atlaskit/editor-palette": "1.4.1",
32
+ "@atlaskit/editor-plugin-analytics": "^0.0.1",
33
+ "@atlaskit/editor-plugin-content-insertion": "^0.0.1",
32
34
  "@atlaskit/editor-shared-styles": "^2.4.0",
33
35
  "@atlaskit/editor-tables": "^2.3.0",
34
36
  "@atlaskit/icon": "^21.12.0",
@@ -44,11 +46,11 @@
44
46
  "memoize-one": "^6.0.0",
45
47
  "prosemirror-commands": "1.1.11",
46
48
  "prosemirror-keymap": "1.1.4",
47
- "prosemirror-model": "1.14.3",
49
+ "prosemirror-model": "1.16.0",
48
50
  "prosemirror-state": "1.3.4",
49
51
  "prosemirror-transform": "1.3.2",
50
52
  "prosemirror-utils": "^1.0.0-0",
51
- "prosemirror-view": "1.23.2",
53
+ "prosemirror-view": "1.23.7",
52
54
  "raf-schd": "^4.0.3",
53
55
  "uuid": "^3.1.0"
54
56
  },
@@ -60,7 +62,7 @@
60
62
  "devDependencies": {
61
63
  "@atlaskit/analytics-next": "^9.1.0",
62
64
  "@atlaskit/button": "^16.7.0",
63
- "@atlaskit/editor-core": "^183.0.0",
65
+ "@atlaskit/editor-core": "^183.1.0",
64
66
  "@atlaskit/editor-plugin-feature-flags": "^0.1.0",
65
67
  "@atlaskit/editor-test-helpers": "^18.3.0",
66
68
  "@atlaskit/link-provider": "^1.6.0",
package/report.api.md CHANGED
@@ -15,12 +15,19 @@
15
15
  <!--SECTION START: Main Entry Types-->
16
16
 
17
17
  ```ts
18
+ import { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
19
+ import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
20
+ import type { Command } from '@atlaskit/editor-common/types';
21
+ import type { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
18
22
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
19
23
  import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
20
24
  import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
21
25
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
22
26
  import { TableLayout } from '@atlaskit/adf-schema';
23
27
 
28
+ // @public (undocumented)
29
+ type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
30
+
24
31
  // @public (undocumented)
25
32
  type PermittedLayoutsDescriptor = 'all' | TableLayout[];
26
33
 
@@ -97,6 +104,10 @@ export const tablesPlugin: NextEditorPlugin<
97
104
  'table',
98
105
  {
99
106
  pluginConfiguration: TablePluginOptions | undefined;
107
+ actions: {
108
+ insertTable: InsertTableAction;
109
+ };
110
+ dependencies: [typeof analyticsPlugin, typeof contentInsertionPlugin];
100
111
  }
101
112
  >;
102
113
 
@@ -43,6 +43,9 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
43
43
  import tablePlugin from '../../plugins/table-plugin';
44
44
  import typeAheadPlugin from '@atlaskit/editor-core/src/plugins/type-ahead';
45
45
  import quickInsertPlugin from '@atlaskit/editor-core/src/plugins/quick-insert';
46
+ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
47
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
48
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
46
49
 
47
50
  const defaultTableDoc = doc(
48
51
  table()(
@@ -78,7 +81,10 @@ describe('Table analytic events', () => {
78
81
  const _editor = createEditor({
79
82
  doc,
80
83
  preset: new Preset<LightEditorPlugin>()
84
+ .add([featureFlagsPlugin, {}])
85
+ .add([analyticsPlugin, {}])
81
86
  .add(typeAheadPlugin)
87
+ .add(contentInsertionPlugin)
82
88
  .add(quickInsertPlugin)
83
89
  .add([
84
90
  tablePlugin,
@@ -19,6 +19,9 @@ import {
19
19
  } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
20
20
  import tablePlugin from '../../plugins/table-plugin';
21
21
  import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
22
+ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
23
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
24
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
22
25
 
23
26
  const TABLE_LOCAL_ID = 'test-table-local-id';
24
27
 
@@ -36,6 +39,9 @@ describe('Tables with Collab editing', () => {
36
39
  return createEditor({
37
40
  doc,
38
41
  preset: new Preset<LightEditorPlugin>()
42
+ .add([featureFlagsPlugin, {}])
43
+ .add([analyticsPlugin, {}])
44
+ .add(contentInsertionPlugin)
39
45
  .add([tablePlugin, { tableOptions }])
40
46
  .add(widthPlugin),
41
47
  pluginKey: tablePluginKey,
@@ -24,6 +24,8 @@ import tablePlugin from '../../plugins/table';
24
24
  import { setEditorFocus, setTableRef } from '../../plugins/table/commands';
25
25
  import { getToolbarConfig } from '../../plugins/table/toolbar';
26
26
  import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
27
+ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
28
+ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
27
29
 
28
30
  const formatMessage: (t: { id: string }) => string = (message) =>
29
31
  `${message.id}`;
@@ -42,6 +44,8 @@ describe('color picker', () => {
42
44
  attachTo: document.body,
43
45
  preset: new Preset<LightEditorPlugin>()
44
46
  .add([featureFlagsPlugin, {}])
47
+ .add([analyticsPlugin, {}])
48
+ .add(contentInsertionPlugin)
45
49
  .add(dataConsumerPlugin)
46
50
  .add(extensionPlugin)
47
51
  .add(tablePlugin),