@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,24 @@
1
+ import { ShadowEvent } from '../types';
2
+ export declare class OverflowShadowsObserver {
3
+ private tableIntersectionObserver?;
4
+ private updateShadowState;
5
+ private table;
6
+ private wrapper;
7
+ private leftShadowSentinel;
8
+ private rightShadowSentinel;
9
+ private shadowsObserved;
10
+ private isSticky;
11
+ private stickyRowHeight;
12
+ constructor(updateShadowState: (shadowKey: ShadowEvent, value: boolean) => void, table: HTMLElement, wrapper: HTMLDivElement);
13
+ private init;
14
+ private updateStickyShadowsHeightIfChanged;
15
+ private getStickyCell;
16
+ observeShadowSentinels: (isSticky?: boolean) => void;
17
+ /**
18
+ * Takes a heightStyle if it can be computed in a less expensive manner,
19
+ * e.g. bounds on an IntersectionObserverEntry, otherwise proceed with
20
+ * reading it from sticky cell
21
+ */
22
+ updateStickyShadows: (stickyRowHeight?: number) => void;
23
+ dispose(): void;
24
+ }
@@ -0,0 +1,73 @@
1
+ import React from 'react';
2
+ import type { TableColumnOrdering } from '@atlaskit/custom-steps';
3
+ import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
+ import type { EditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
5
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
6
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
7
+ import type { RowStickyState, StickyPluginState } from '../pm-plugins/sticky-headers';
8
+ import type { PluginInjectionAPI } from '../types';
9
+ import { ShadowEvent } from '../types';
10
+ import type { TableOptions } from './types';
11
+ export interface ComponentProps {
12
+ view: EditorView;
13
+ getNode: () => PmNode;
14
+ allowColumnResizing?: boolean;
15
+ eventDispatcher: EventDispatcher;
16
+ getPos: () => number | undefined;
17
+ options?: TableOptions;
18
+ contentDOM: (node: HTMLElement | null) => void;
19
+ containerWidth: EditorContainerWidth;
20
+ allowControls: boolean;
21
+ isHeaderRowEnabled: boolean;
22
+ isHeaderColumnEnabled: boolean;
23
+ isMediaFullscreen?: boolean;
24
+ tableActive: boolean;
25
+ ordering: TableColumnOrdering;
26
+ isResizing?: boolean;
27
+ getEditorFeatureFlags: GetEditorFeatureFlags;
28
+ pluginInjectionApi?: PluginInjectionAPI;
29
+ }
30
+ interface TableState {
31
+ scroll: number;
32
+ parentWidth?: number;
33
+ stickyHeader?: RowStickyState;
34
+ [ShadowEvent.SHOW_BEFORE_SHADOW]: boolean;
35
+ [ShadowEvent.SHOW_AFTER_SHADOW]: boolean;
36
+ }
37
+ declare class TableComponent extends React.Component<ComponentProps, TableState> {
38
+ static displayName: string;
39
+ state: TableState;
40
+ private wrapper?;
41
+ private table?;
42
+ private node;
43
+ private containerWidth?;
44
+ private layoutSize?;
45
+ private overflowShadowsObserver?;
46
+ private stickyScrollbar?;
47
+ private isInitialOverflowSent;
48
+ private initialOverflowCaptureTimerId?;
49
+ constructor(props: ComponentProps);
50
+ componentDidMount(): void;
51
+ componentWillUnmount(): void;
52
+ componentDidUpdate(_: any, prevState: TableState): void;
53
+ private updateShadowState;
54
+ private createShadowSentinels;
55
+ onStickyState: (state: StickyPluginState) => void;
56
+ prevTableState: any;
57
+ render(): JSX.Element;
58
+ private handleScroll;
59
+ private handleTableResizing;
60
+ private scaleTable;
61
+ private setTimerToSendInitialOverflowCaptured;
62
+ private handleAutoSize;
63
+ private handleWindowResize;
64
+ private getParentNodeWidth;
65
+ private updateParentWidth;
66
+ private tableNodeLayoutSize;
67
+ private scaleTableDebounced;
68
+ private handleTableResizingDebounced;
69
+ private handleScrollDebounced;
70
+ private handleAutoSizeDebounced;
71
+ private handleWindowResizeDebounced;
72
+ }
73
+ export default TableComponent;
@@ -0,0 +1,44 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ import React from 'react';
3
+ import type { EditorContainerWidth } from '@atlaskit/editor-common/types';
4
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
5
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
+ import type { PluginInjectionAPI } from '../types';
7
+ type InnerContainerProps = {
8
+ className: string;
9
+ style?: {
10
+ width: number | 'inherit';
11
+ marginLeft?: number;
12
+ };
13
+ node: PMNode;
14
+ };
15
+ export declare const InnerContainer: React.ForwardRefExoticComponent<InnerContainerProps & {
16
+ children?: React.ReactNode;
17
+ } & React.RefAttributes<HTMLDivElement>>;
18
+ type ResizableTableContainerProps = {
19
+ containerWidth: number;
20
+ lineLength?: number;
21
+ node: PMNode;
22
+ className: string;
23
+ editorView: EditorView;
24
+ getPos: () => number | undefined;
25
+ tableRef: HTMLTableElement;
26
+ isResizing?: boolean;
27
+ pluginInjectionApi?: PluginInjectionAPI;
28
+ };
29
+ export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, lineLength, containerWidth, editorView, getPos, tableRef, isResizing, pluginInjectionApi, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
30
+ type TableContainerProps = {
31
+ node: PMNode;
32
+ className: string;
33
+ containerWidth: EditorContainerWidth;
34
+ isTableResizingEnabled: boolean | undefined;
35
+ isBreakoutEnabled: boolean | undefined;
36
+ editorView: EditorView;
37
+ getPos: () => number | undefined;
38
+ tableRef: HTMLTableElement;
39
+ isNested: boolean;
40
+ isResizing?: boolean;
41
+ pluginInjectionApi?: PluginInjectionAPI;
42
+ };
43
+ export declare const TableContainer: ({ children, node, className, containerWidth: { lineLength, width: editorWidth }, isTableResizingEnabled, isBreakoutEnabled, editorView, getPos, tableRef, isNested, isResizing, pluginInjectionApi, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
44
+ export {};
@@ -0,0 +1,25 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ import type { TableEventPayload } from '@atlaskit/editor-common/analytics';
3
+ import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
4
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
5
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
6
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
7
+ interface TableResizerProps {
8
+ width: number;
9
+ maxWidth: number;
10
+ containerWidth: number;
11
+ updateWidth: (width: number) => void;
12
+ editorView: EditorView;
13
+ getPos: () => number | undefined;
14
+ node: PMNode;
15
+ tableRef: HTMLTableElement;
16
+ displayGuideline: (guideline: GuidelineConfig[]) => boolean;
17
+ attachAnalyticsEvent: (payload: TableEventPayload) => ((tr: Transaction) => boolean) | undefined;
18
+ displayGapCursor: (toggle: boolean) => boolean;
19
+ }
20
+ export interface TableResizerImprovementProps extends TableResizerProps {
21
+ onResizeStop?: () => void;
22
+ onResizeStart?: () => void;
23
+ }
24
+ export declare const TableResizer: ({ children, width, maxWidth, containerWidth, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
25
+ export {};
@@ -0,0 +1,24 @@
1
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
+ export declare class TableStickyScrollbar {
3
+ private wrapper;
4
+ private view;
5
+ private editorScrollableElement?;
6
+ private intersectionObserver?;
7
+ private stickyScrollbarContainerElement?;
8
+ private sentinels;
9
+ private topSentinelState?;
10
+ private bottomSentinelState?;
11
+ constructor(wrapper: HTMLDivElement, view: EditorView);
12
+ dispose(): void;
13
+ scrollLeft(left: number): void;
14
+ private init;
15
+ private createIntersectionObserver;
16
+ private deleteIntesactionObserver;
17
+ private sentenialBottomCallback;
18
+ private sentenialTopCallback;
19
+ private toggle;
20
+ private hide;
21
+ private show;
22
+ private handleScroll;
23
+ private handleScrollDebounced;
24
+ }
@@ -0,0 +1,9 @@
1
+ import { OverridableMock } from './OverridableMock';
2
+ export declare class OverflowShadowsObserver extends OverridableMock {
3
+ leftShadowSentinel: HTMLElement | null;
4
+ rightShadowSentinel: HTMLElement | null;
5
+ constructor(...inputs: any[]);
6
+ observeShadowSentinels: any;
7
+ updateStickyShadows: any;
8
+ dispose: any;
9
+ }
@@ -0,0 +1,9 @@
1
+ export declare abstract class OverridableMock {
2
+ static mockOverrides: {
3
+ [key: string]: any;
4
+ };
5
+ constructor(...inputs: any[]);
6
+ getMock(key: string): any;
7
+ static setMock(thisKey: string, value: any): void;
8
+ static resetMocks(): void;
9
+ }
@@ -0,0 +1,33 @@
1
+ /// <reference types="react" />
2
+ import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
3
+ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
4
+ import ReactNodeView from '@atlaskit/editor-common/react-node-view';
5
+ import type { GetEditorContainerWidth, GetEditorFeatureFlags, getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
6
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
7
+ import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
8
+ import type { PluginInjectionAPI } from '../types';
9
+ import type { Props } from './types';
10
+ type ForwardRef = (node: HTMLElement | null) => void;
11
+ export default class TableView extends ReactNodeView<Props> {
12
+ private table;
13
+ private resizeObserver?;
14
+ eventDispatcher?: EventDispatcher;
15
+ getPos: getPosHandlerNode;
16
+ constructor(props: Props);
17
+ getContentDOM(): {
18
+ dom: HTMLElement;
19
+ contentDOM?: HTMLElement | undefined;
20
+ };
21
+ setDomAttrs(node: PmNode): void;
22
+ getNode: () => PmNode;
23
+ render(props: Props, forwardRef: ForwardRef): JSX.Element;
24
+ private hasHoveredRows;
25
+ viewShouldUpdate(nextNode: PmNode): boolean;
26
+ ignoreMutation(mutation: MutationRecord | {
27
+ type: 'selection';
28
+ target: Element;
29
+ }): boolean;
30
+ destroy(): void;
31
+ }
32
+ export declare const createTableView: (node: PmNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, pluginInjectionApi?: PluginInjectionAPI) => NodeView;
33
+ export {};
@@ -0,0 +1,17 @@
1
+ import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
2
+ import type { getPosHandler } from '@atlaskit/editor-common/types';
3
+ import { Node } from '@atlaskit/editor-prosemirror/model';
4
+ import { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
5
+ export default class TableCellNodeView implements NodeView {
6
+ node: Node;
7
+ dom: HTMLElement;
8
+ contentDOM: HTMLElement;
9
+ getPos: getPosHandler;
10
+ view: EditorView;
11
+ providerFactory?: ProviderFactory;
12
+ observer?: ResizeObserver;
13
+ constructor(node: Node, view: EditorView, getPos: any, observer?: ResizeObserver);
14
+ private updateNodeView;
15
+ update(node: Node): boolean;
16
+ destroy(): void;
17
+ }
@@ -0,0 +1,26 @@
1
+ import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
2
+ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
3
+ import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
+ import { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
5
+ import { EditorView } from '@atlaskit/editor-prosemirror/view';
6
+ import type { PluginInjectionAPI } from '../types';
7
+ export type TableOptions = {
8
+ isBreakoutEnabled?: boolean;
9
+ isFullWidthModeEnabled?: boolean;
10
+ wasFullWidthModeEnabled?: boolean;
11
+ isTableResizingEnabled?: boolean;
12
+ };
13
+ export interface Props {
14
+ node: PmNode;
15
+ view: EditorView;
16
+ allowColumnResizing?: boolean;
17
+ cellMinWidth?: number;
18
+ portalProviderAPI: PortalProviderAPI;
19
+ eventDispatcher: EventDispatcher;
20
+ getPos: () => number | undefined;
21
+ options?: TableOptions;
22
+ getEditorContainerWidth: GetEditorContainerWidth;
23
+ getEditorFeatureFlags: GetEditorFeatureFlags;
24
+ hasIntlContext: boolean;
25
+ pluginInjectionApi?: PluginInjectionAPI;
26
+ }
@@ -0,0 +1 @@
1
+ export declare const updateShadowListForStickyStyles: (heightStyle: string, shadows: HTMLCollection) => void;
@@ -0,0 +1,7 @@
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import { EditorState, PluginKey, ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
3
+ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
+ export declare const pluginKey: PluginKey<any>;
5
+ export declare const getDecorations: (state: EditorState) => DecorationSet;
6
+ export declare const handleDocOrSelectionChanged: (tr: Transaction | ReadonlyTransaction, decorationSet: DecorationSet, oldState: EditorState, newState: EditorState) => DecorationSet;
7
+ export declare const createPlugin: () => SafePlugin<DecorationSet>;
@@ -0,0 +1,3 @@
1
+ import { DecorationTransformer } from './types';
2
+ export declare const maybeUpdateColumnControlsSelectedDecoration: DecorationTransformer;
3
+ export declare const buildColumnControlsDecorations: DecorationTransformer;
@@ -0,0 +1,4 @@
1
+ import type { IntlShape } from 'react-intl-next';
2
+ import type { DecorationTransformer } from './types';
3
+ export declare const buildColumnResizingDecorations: (rowEndIndex: number, columnEndIndex: number, includeTooltip: boolean, getIntl: () => IntlShape) => DecorationTransformer;
4
+ export declare const clearColumnResizingDecorations: () => DecorationTransformer;
@@ -0,0 +1,2 @@
1
+ import { DecorationTransformer } from './types';
2
+ export declare const composeDecorations: (transformers: Array<DecorationTransformer>) => DecorationTransformer;
@@ -0,0 +1,3 @@
1
+ export { buildColumnControlsDecorations, maybeUpdateColumnControlsSelectedDecoration, } from './column-controls';
2
+ export { buildColumnResizingDecorations, clearColumnResizingDecorations, } from './column-resizing';
3
+ export { composeDecorations } from './compose-decorations';
@@ -0,0 +1,6 @@
1
+ import { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
2
+ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
3
+ export type DecorationTransformer = ({ decorationSet, tr, }: {
4
+ decorationSet: DecorationSet;
5
+ tr: Transaction | ReadonlyTransaction;
6
+ }) => DecorationSet;
@@ -0,0 +1,4 @@
1
+ export declare const defaultTableSelection: {
2
+ hoveredColumns: never[];
3
+ hoveredRows: never[];
4
+ };
@@ -0,0 +1,15 @@
1
+ import type { DropTargetType } from './consts';
2
+ export interface DragAndDropAction<T, D> {
3
+ type: T;
4
+ data: D;
5
+ }
6
+ export declare const DragAndDropActionType: {
7
+ readonly SET_DROP_TARGET: "SET_DROP_TARGET";
8
+ readonly CLEAR_DROP_TARGET: "CLEAR_DROP_TARGET";
9
+ };
10
+ export type DragAndDropSetDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.SET_DROP_TARGET, {
11
+ type: DropTargetType;
12
+ index: number;
13
+ }>;
14
+ export type DragAndDropClearDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.CLEAR_DROP_TARGET, undefined>;
15
+ export type DragAndDropPluginAction = DragAndDropSetDropTargetAction | DragAndDropClearDropTargetAction;
@@ -0,0 +1,4 @@
1
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
+ import type { DropTargetType } from './consts';
3
+ export declare const setDropTarget: (type: DropTargetType, index: number, tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
4
+ export declare const clearDropTarget: (tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
@@ -0,0 +1,6 @@
1
+ export declare const DropTargetType: {
2
+ readonly NONE: "none";
3
+ readonly ROW: "row";
4
+ readonly COLUMN: "column";
5
+ };
6
+ export type DropTargetType = (typeof DropTargetType)[keyof typeof DropTargetType];
@@ -0,0 +1,4 @@
1
+ export { createPlugin } from './plugin';
2
+ export { pluginKey } from './plugin-key';
3
+ export type { DragAndDropPluginState } from './types';
4
+ export { setDropTarget, clearDropTarget } from './commands';
@@ -0,0 +1,2 @@
1
+ declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("./types").DragAndDropPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState)) => import("prosemirror-state").SafeStateField<import("./types").DragAndDropPluginState>, createCommand: <A = import("./actions").DragAndDropPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
2
+ export { createPluginState, createCommand };
@@ -0,0 +1,3 @@
1
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
+ import type { DragAndDropPluginState } from './types';
3
+ export declare const pluginKey: PluginKey<DragAndDropPluginState>;
@@ -0,0 +1,3 @@
1
+ import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
2
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
+ export declare const createPlugin: (dispatch: Dispatch, eventDispatcher: EventDispatcher) => SafePlugin<import("./types").DragAndDropPluginState>;
@@ -0,0 +1,4 @@
1
+ import type { DragAndDropPluginAction } from './actions';
2
+ import type { DragAndDropPluginState } from './types';
3
+ declare const _default: (pluginState: DragAndDropPluginState, action: DragAndDropPluginAction) => DragAndDropPluginState;
4
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import type { DropTargetType } from './consts';
2
+ export interface DragAndDropPluginState {
3
+ dropTargetType: DropTargetType;
4
+ dropTargetIndex: number;
5
+ }
@@ -0,0 +1,5 @@
1
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
+ import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
+ import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
4
+ export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null): SafePlugin;
5
+ export default keymapPlugin;
@@ -0,0 +1,8 @@
1
+ import type { IntlShape } from 'react-intl-next';
2
+ import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
+ import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
+ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
5
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
6
+ import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
7
+ import type { PluginConfig, PluginInjectionAPI } from '../types';
8
+ export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, breakoutEnabled?: boolean, fullWidthModeEnabled?: boolean, tableResizingEnabled?: boolean, previousFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI) => SafePlugin<import("../types").TablePluginState>;
@@ -0,0 +1 @@
1
+ export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("../types").TablePluginState | ((state: import("prosemirror-state").EditorState) => import("../types").TablePluginState)) => import("prosemirror-state").SafeStateField<import("../types").TablePluginState>, createCommand: <A = import("../types").TablePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("../types").TablePluginState;
@@ -0,0 +1,3 @@
1
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
+ import { TablePluginState } from '../types';
3
+ export declare const pluginKey: PluginKey<TablePluginState>;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Fix an issue that composition text replacement in Safari removes empty nodes during text composition text deletion.
3
+ * https://github.com/ProseMirror/prosemirror/issues/934
4
+ * We will remove this plugin when Webkit fix the problem itself.
5
+ */
6
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
7
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
8
+ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
9
+ interface SafariDeleteCompositionTextIssueWorkaroundPluginState {
10
+ renderSpan: boolean;
11
+ decorations: DecorationSet;
12
+ }
13
+ export declare const tableSafariDeleteCompositionTextIssueWorkaroundKey: PluginKey<SafariDeleteCompositionTextIssueWorkaroundPluginState>;
14
+ export declare const createPlugin: () => SafePlugin<SafariDeleteCompositionTextIssueWorkaroundPluginState>;
15
+ export {};
@@ -0,0 +1,3 @@
1
+ import { RowStickyState } from './types';
2
+ export declare const updateStickyState: (rowState: RowStickyState) => import("@atlaskit/editor-common/types").Command;
3
+ export declare const removeStickyState: (pos: number) => import("@atlaskit/editor-common/types").Command;
@@ -0,0 +1,6 @@
1
+ export { createPlugin } from './plugin';
2
+ export { pluginKey } from './plugin-key';
3
+ export type { StickyPluginState, RowStickyState } from './types';
4
+ export { findStickyHeaderForTable } from './util';
5
+ export { updateStickyState, removeStickyState } from './commands';
6
+ export { TableRowNodeView } from './nodeviews/tableRow';
@@ -0,0 +1,6 @@
1
+ export type TableDOMElements = {
2
+ wrapper: HTMLDivElement;
3
+ table: HTMLTableElement;
4
+ };
5
+ export declare const getTree: (tr: HTMLTableRowElement) => TableDOMElements | null;
6
+ export declare const getTop: (element: HTMLElement | Window | undefined) => number;
@@ -0,0 +1,73 @@
1
+ /// <reference types="lodash" />
2
+ import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
3
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
4
+ import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { TablePluginState } from '../../../types';
6
+ import type { TableDOMElements } from './dom';
7
+ /**
8
+ * Check if a given node is a header row with this definition:
9
+ * - all children are tableHeader cells
10
+ * - no table cells have been have merged with other table row cells
11
+ *
12
+ * @param node ProseMirror node
13
+ * @return boolean if it meets definition
14
+ */
15
+ export declare const supportedHeaderRow: (node: PmNode) => boolean;
16
+ export declare class TableRowNodeView implements NodeView {
17
+ view: EditorView;
18
+ node: PmNode;
19
+ getPos: () => number;
20
+ eventDispatcher: EventDispatcher;
21
+ dom: HTMLTableRowElement;
22
+ contentDOM: HTMLElement;
23
+ isHeaderRow: boolean;
24
+ editorScrollableElement?: HTMLElement | Window;
25
+ colControlsOffset: number;
26
+ focused: boolean;
27
+ topPosEditorElement: number;
28
+ isSticky: boolean;
29
+ lastStickyTimestamp: number | undefined;
30
+ lastTimePainted: number;
31
+ private intersectionObserver?;
32
+ private resizeObserver?;
33
+ private sentinels;
34
+ private stickyRowHeight?;
35
+ get tree(): TableDOMElements | null | undefined;
36
+ constructor(node: PmNode, view: EditorView, getPos: any, eventDispatcher: EventDispatcher);
37
+ listening: boolean;
38
+ headerRowMouseScrollEnd: import("lodash").DebouncedFunc<() => void>;
39
+ headerRowMouseScroll: import("lodash").DebouncedFunc<() => void>;
40
+ subscribe(): void;
41
+ unsubscribe(): void;
42
+ private initObservers;
43
+ private createResizeObserver;
44
+ private createIntersectionObserver;
45
+ previousDomTop: number | undefined;
46
+ previousPadding: number | undefined;
47
+ latestDomTop: number | undefined;
48
+ nextFrame: number | undefined;
49
+ update(node: PmNode, ..._args: any[]): boolean;
50
+ destroy(): void;
51
+ ignoreMutation(mutationRecord: MutationRecord | {
52
+ type: 'selection';
53
+ target: Element;
54
+ }): boolean;
55
+ onTablePluginState: (state: TablePluginState) => void;
56
+ updateStickyHeaderWidth: () => void;
57
+ shouldHeaderStick: (tree: TableDOMElements) => boolean;
58
+ /**
59
+ * Manually refire the intersection observers.
60
+ * Useful when the header may have detached from the table.
61
+ */
62
+ refireIntersectionObservers: () => void;
63
+ makeHeaderRowSticky: (tree: TableDOMElements, scrollTop?: number) => void;
64
+ makeRowHeaderNotSticky: (table: HTMLElement, isEditorDestroyed?: boolean) => void;
65
+ getWrapperoffset: (inverse?: boolean) => number;
66
+ getWrapperRefTop: (wrapper: HTMLElement) => number;
67
+ getScrolledTableTop: (wrapper: HTMLElement) => number;
68
+ getCurrentTableTop: (tree: TableDOMElements) => number;
69
+ padding: number;
70
+ top: number;
71
+ emitOn: (top: number, padding: number) => void;
72
+ emitOff: (isEditorDestroyed: boolean) => void;
73
+ }
@@ -0,0 +1,3 @@
1
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
+ import { StickyPluginState } from './types';
3
+ export declare const pluginKey: PluginKey<StickyPluginState>;
@@ -0,0 +1,3 @@
1
+ import { StickyPluginAction, StickyPluginState } from './types';
2
+ declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: StickyPluginState | ((state: import("prosemirror-state").EditorState) => StickyPluginState)) => import("prosemirror-state").SafeStateField<StickyPluginState>, createCommand: <A = StickyPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
3
+ export { createPluginState, createCommand };
@@ -0,0 +1,4 @@
1
+ import { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
2
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
+ import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
+ export declare const createPlugin: (dispatch: Dispatch, eventDispatcher: EventDispatcher, initialState: (() => never[]) | undefined, getEditorFeatureFlags: GetEditorFeatureFlags) => SafePlugin<import("./types").StickyPluginState>;
@@ -0,0 +1,16 @@
1
+ export type RowStickyState = {
2
+ pos: number;
3
+ top: number;
4
+ padding: number;
5
+ sticky: boolean;
6
+ };
7
+ export type StickyPluginState = RowStickyState[];
8
+ export type UpdateSticky = {
9
+ name: 'UPDATE';
10
+ state: RowStickyState;
11
+ };
12
+ export type RemoveSticky = {
13
+ name: 'REMOVE';
14
+ pos: number;
15
+ };
16
+ export type StickyPluginAction = UpdateSticky | RemoveSticky;
@@ -0,0 +1,2 @@
1
+ import type { StickyPluginState } from './types';
2
+ export declare const findStickyHeaderForTable: (state: StickyPluginState, tablePos: number | undefined) => import("./types").RowStickyState | undefined;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * A plugin is created for collecting payload data for tableOverflowChanged analytics event
3
+ */
4
+ import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
5
+ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
6
+ import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
7
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
8
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
9
+ interface LastTrigger {
10
+ name: TABLE_OVERFLOW_CHANGE_TRIGGER;
11
+ }
12
+ type TableAnalyticsPluginState = {
13
+ lastTrigger: LastTrigger | undefined;
14
+ };
15
+ export declare const pluginKey: PluginKey<TableAnalyticsPluginState>;
16
+ export declare const META_KEYS: {
17
+ OVERFLOW_TRIGGER: string;
18
+ OVERFLOW_STATE_CHANGED: string;
19
+ };
20
+ declare const createPlugin: (dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, tableResizingEnabled: boolean) => SafePlugin<{
21
+ lastTrigger: undefined;
22
+ }>;
23
+ export { createPlugin };
@@ -0,0 +1,10 @@
1
+ import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
2
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
+ interface TableLocalIdPluginState {
4
+ parsedForLocalIds: boolean;
5
+ }
6
+ /**
7
+ * Ensures uniqueness of `localId`s on tables being created or edited
8
+ */
9
+ declare const createPlugin: (dispatch: Dispatch) => SafePlugin<TableLocalIdPluginState>;
10
+ export { createPlugin };