@atlaskit/editor-plugin-table 0.1.0 → 0.1.1

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 (190) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/plugins/table/ui/FloatingDeleteButton/index.js +2 -1
  3. package/dist/cjs/version.json +1 -1
  4. package/dist/es2019/plugins/table/ui/FloatingDeleteButton/index.js +2 -1
  5. package/dist/es2019/version.json +1 -1
  6. package/dist/esm/plugins/table/ui/FloatingDeleteButton/index.js +2 -1
  7. package/dist/esm/version.json +1 -1
  8. package/examples/99-testing.tsx +35 -30
  9. package/package.json +2 -11
  10. package/src/__tests__/integration/__fixtures__/auto-size-documents.ts +5 -10
  11. package/src/__tests__/integration/__fixtures__/layout-documents.ts +1 -2
  12. package/src/__tests__/integration/__fixtures__/resize-documents.ts +5 -10
  13. package/src/__tests__/integration/resize.ts +1 -2
  14. package/src/__tests__/unit/analytics.ts +33 -32
  15. package/src/__tests__/unit/collab.ts +12 -9
  16. package/src/__tests__/unit/commands/sort.ts +28 -28
  17. package/src/__tests__/unit/copy-paste.ts +6 -8
  18. package/src/__tests__/unit/event-handlers.ts +7 -10
  19. package/src/__tests__/unit/fix-tables.ts +17 -23
  20. package/src/__tests__/unit/get-toolbar-config.ts +0 -5
  21. package/src/__tests__/unit/hover-selection.ts +1 -66
  22. package/src/__tests__/unit/index-with-fake-timers.ts +1 -1
  23. package/src/__tests__/unit/index.ts +5 -5
  24. package/src/__tests__/unit/nodeviews/TableComponent.tsx +11 -218
  25. package/src/__tests__/unit/nodeviews/cell.ts +12 -10
  26. package/src/__tests__/unit/nodeviews/table.ts +25 -26
  27. package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +11 -8
  28. package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +11 -12
  29. package/src/__tests__/unit/toolbar.ts +18 -5
  30. package/src/__tests__/unit/ui/ContextualMenu.tsx +55 -0
  31. package/src/__tests__/unit/ui/CornerControls.tsx +7 -7
  32. package/src/__tests__/unit/ui/FloatingContextualButton.tsx +45 -49
  33. package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +49 -0
  34. package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +30 -2
  35. package/src/__tests__/unit/ui/FloatingInsertButton.tsx +143 -111
  36. package/src/__tests__/unit/ui/RowControls.tsx +112 -141
  37. package/src/__tests__/unit/ui/TableFloatingControls.tsx +18 -15
  38. package/src/__tests__/unit/undo-redo.ts +10 -9
  39. package/src/__tests__/unit/utils/nodes.ts +8 -4
  40. package/src/__tests__/unit/utils/row-controls.ts +8 -4
  41. package/src/plugins/table/commands/clear.ts +30 -29
  42. package/src/plugins/table/commands/go-to-next-cell.ts +41 -38
  43. package/src/plugins/table/commands/insert.ts +91 -91
  44. package/src/plugins/table/commands/misc.ts +123 -125
  45. package/src/plugins/table/commands/selection.ts +329 -319
  46. package/src/plugins/table/commands-with-analytics.ts +299 -294
  47. package/src/plugins/table/event-handlers.ts +111 -111
  48. package/src/plugins/table/handlers.ts +95 -94
  49. package/src/plugins/table/nodeviews/OverflowShadowsObserver.ts +4 -3
  50. package/src/plugins/table/nodeviews/TableComponent.tsx +6 -9
  51. package/src/plugins/table/nodeviews/update-overflow-shadows.ts +39 -39
  52. package/src/plugins/table/pm-plugins/decorations/utils/column-controls.ts +7 -9
  53. package/src/plugins/table/pm-plugins/decorations/utils/column-resizing.ts +30 -30
  54. package/src/plugins/table/pm-plugins/decorations/utils/compose-decorations.ts +7 -7
  55. package/src/plugins/table/pm-plugins/plugin-factory.ts +33 -33
  56. package/src/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.ts +6 -9
  57. package/src/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.ts +3 -2
  58. package/src/plugins/table/pm-plugins/table-resizing/commands.ts +98 -90
  59. package/src/plugins/table/pm-plugins/table-resizing/utils/dom.ts +46 -47
  60. package/src/plugins/table/toolbar.tsx +116 -113
  61. package/src/plugins/table/transforms/column-width.ts +143 -146
  62. package/src/plugins/table/transforms/delete-columns.ts +144 -142
  63. package/src/plugins/table/transforms/delete-rows.ts +110 -111
  64. package/src/plugins/table/transforms/metadata.ts +9 -9
  65. package/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx +7 -6
  66. package/src/plugins/table/ui/FloatingDeleteButton/index.tsx +3 -2
  67. package/src/plugins/table/ui/FloatingInsertButton/index.tsx +2 -5
  68. package/src/plugins/table/ui/LayoutButton/index.tsx +2 -6
  69. package/src/plugins/table/ui/common-styles.ts +1 -3
  70. package/src/plugins/table/utils/analytics.ts +24 -25
  71. package/src/plugins/table/utils/dom.ts +3 -3
  72. package/src/plugins/table/utils/row-controls.ts +92 -93
  73. package/dist/types-ts4.0/index.d.ts +0 -1
  74. package/dist/types-ts4.0/plugins/table/commands/clear.d.ts +0 -3
  75. package/dist/types-ts4.0/plugins/table/commands/collapse.d.ts +0 -2
  76. package/dist/types-ts4.0/plugins/table/commands/go-to-next-cell.d.ts +0 -4
  77. package/dist/types-ts4.0/plugins/table/commands/hover.d.ts +0 -8
  78. package/dist/types-ts4.0/plugins/table/commands/index.d.ts +0 -7
  79. package/dist/types-ts4.0/plugins/table/commands/insert.d.ts +0 -10
  80. package/dist/types-ts4.0/plugins/table/commands/misc.d.ts +0 -27
  81. package/dist/types-ts4.0/plugins/table/commands/selection.d.ts +0 -8
  82. package/dist/types-ts4.0/plugins/table/commands/sort.d.ts +0 -3
  83. package/dist/types-ts4.0/plugins/table/commands/split-cell.d.ts +0 -6
  84. package/dist/types-ts4.0/plugins/table/commands/toggle.d.ts +0 -12
  85. package/dist/types-ts4.0/plugins/table/commands-with-analytics.d.ts +0 -26
  86. package/dist/types-ts4.0/plugins/table/create-plugin-config.d.ts +0 -2
  87. package/dist/types-ts4.0/plugins/table/event-handlers.d.ts +0 -16
  88. package/dist/types-ts4.0/plugins/table/handlers.d.ts +0 -3
  89. package/dist/types-ts4.0/plugins/table/index.d.ts +0 -17
  90. package/dist/types-ts4.0/plugins/table/nodeviews/OverflowShadowsObserver.d.ts +0 -26
  91. package/dist/types-ts4.0/plugins/table/nodeviews/TableComponent.d.ts +0 -72
  92. package/dist/types-ts4.0/plugins/table/nodeviews/__mocks__/OverflowShadowsObserver.d.ts +0 -9
  93. package/dist/types-ts4.0/plugins/table/nodeviews/__mocks__/OverridableMock.d.ts +0 -9
  94. package/dist/types-ts4.0/plugins/table/nodeviews/table.d.ts +0 -31
  95. package/dist/types-ts4.0/plugins/table/nodeviews/tableCell.d.ts +0 -19
  96. package/dist/types-ts4.0/plugins/table/nodeviews/types.d.ts +0 -24
  97. package/dist/types-ts4.0/plugins/table/nodeviews/update-overflow-shadows.d.ts +0 -8
  98. package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/plugin.d.ts +0 -7
  99. package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/column-controls.d.ts +0 -3
  100. package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/column-resizing.d.ts +0 -2
  101. package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/compose-decorations.d.ts +0 -2
  102. package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/index.d.ts +0 -3
  103. package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/types.d.ts +0 -6
  104. package/dist/types-ts4.0/plugins/table/pm-plugins/default-table-selection.d.ts +0 -5
  105. package/dist/types-ts4.0/plugins/table/pm-plugins/keymap.d.ts +0 -5
  106. package/dist/types-ts4.0/plugins/table/pm-plugins/main.d.ts +0 -8
  107. package/dist/types-ts4.0/plugins/table/pm-plugins/plugin-factory.d.ts +0 -1
  108. package/dist/types-ts4.0/plugins/table/pm-plugins/plugin-key.d.ts +0 -3
  109. package/dist/types-ts4.0/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.d.ts +0 -4
  110. package/dist/types-ts4.0/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +0 -15
  111. package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/commands.d.ts +0 -3
  112. package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/index.d.ts +0 -6
  113. package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +0 -6
  114. package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +0 -65
  115. package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/plugin-key.d.ts +0 -3
  116. package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/plugin-state.d.ts +0 -3
  117. package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +0 -4
  118. package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/types.d.ts +0 -16
  119. package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/util.d.ts +0 -2
  120. package/dist/types-ts4.0/plugins/table/pm-plugins/table-local-id.d.ts +0 -22
  121. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/commands.d.ts +0 -25
  122. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +0 -4
  123. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/index.d.ts +0 -4
  124. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/plugin-factory.d.ts +0 -4
  125. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/plugin-key.d.ts +0 -3
  126. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/plugin.d.ts +0 -6
  127. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/reducer.d.ts +0 -3
  128. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +0 -8
  129. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/column-state.d.ts +0 -14
  130. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/content-width.d.ts +0 -4
  131. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +0 -13
  132. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/index.d.ts +0 -12
  133. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +0 -22
  134. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/resize-column.d.ts +0 -2
  135. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/resize-logic.d.ts +0 -4
  136. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +0 -29
  137. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +0 -17
  138. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +0 -22
  139. package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.d.ts +0 -1
  140. package/dist/types-ts4.0/plugins/table/pm-plugins/table-selection-keymap.d.ts +0 -4
  141. package/dist/types-ts4.0/plugins/table/reducer.d.ts +0 -3
  142. package/dist/types-ts4.0/plugins/table/toolbar.d.ts +0 -36
  143. package/dist/types-ts4.0/plugins/table/transforms/column-width.d.ts +0 -18
  144. package/dist/types-ts4.0/plugins/table/transforms/delete-columns.d.ts +0 -3
  145. package/dist/types-ts4.0/plugins/table/transforms/delete-rows.d.ts +0 -3
  146. package/dist/types-ts4.0/plugins/table/transforms/fix-tables.d.ts +0 -10
  147. package/dist/types-ts4.0/plugins/table/transforms/index.d.ts +0 -7
  148. package/dist/types-ts4.0/plugins/table/transforms/merge.d.ts +0 -5
  149. package/dist/types-ts4.0/plugins/table/transforms/metadata.d.ts +0 -21
  150. package/dist/types-ts4.0/plugins/table/transforms/replace-table.d.ts +0 -5
  151. package/dist/types-ts4.0/plugins/table/transforms/split.d.ts +0 -9
  152. package/dist/types-ts4.0/plugins/table/types.d.ts +0 -328
  153. package/dist/types-ts4.0/plugins/table/ui/FloatingContextualButton/index.d.ts +0 -29
  154. package/dist/types-ts4.0/plugins/table/ui/FloatingContextualButton/styles.d.ts +0 -1
  155. package/dist/types-ts4.0/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +0 -87
  156. package/dist/types-ts4.0/plugins/table/ui/FloatingContextualMenu/index.d.ts +0 -22
  157. package/dist/types-ts4.0/plugins/table/ui/FloatingContextualMenu/styles.d.ts +0 -2
  158. package/dist/types-ts4.0/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +0 -14
  159. package/dist/types-ts4.0/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.d.ts +0 -10
  160. package/dist/types-ts4.0/plugins/table/ui/FloatingDeleteButton/index.d.ts +0 -54
  161. package/dist/types-ts4.0/plugins/table/ui/FloatingDeleteButton/types.d.ts +0 -1
  162. package/dist/types-ts4.0/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +0 -12
  163. package/dist/types-ts4.0/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +0 -3
  164. package/dist/types-ts4.0/plugins/table/ui/FloatingInsertButton/index.d.ts +0 -35
  165. package/dist/types-ts4.0/plugins/table/ui/LayoutButton/index.d.ts +0 -21
  166. package/dist/types-ts4.0/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +0 -16
  167. package/dist/types-ts4.0/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +0 -21
  168. package/dist/types-ts4.0/plugins/table/ui/TableFloatingControls/RowControls/index.d.ts +0 -17
  169. package/dist/types-ts4.0/plugins/table/ui/TableFloatingControls/index.d.ts +0 -40
  170. package/dist/types-ts4.0/plugins/table/ui/common-styles.d.ts +0 -4
  171. package/dist/types-ts4.0/plugins/table/ui/consts.d.ts +0 -39
  172. package/dist/types-ts4.0/plugins/table/ui/messages.d.ts +0 -38
  173. package/dist/types-ts4.0/plugins/table/ui/ui-styles.d.ts +0 -15
  174. package/dist/types-ts4.0/plugins/table/utils/analytics.d.ts +0 -18
  175. package/dist/types-ts4.0/plugins/table/utils/collapse.d.ts +0 -29
  176. package/dist/types-ts4.0/plugins/table/utils/column-controls.d.ts +0 -10
  177. package/dist/types-ts4.0/plugins/table/utils/decoration.d.ts +0 -16
  178. package/dist/types-ts4.0/plugins/table/utils/dom.d.ts +0 -20
  179. package/dist/types-ts4.0/plugins/table/utils/get-allow-add-column-custom-step.d.ts +0 -2
  180. package/dist/types-ts4.0/plugins/table/utils/index.d.ts +0 -11
  181. package/dist/types-ts4.0/plugins/table/utils/nodes.d.ts +0 -12
  182. package/dist/types-ts4.0/plugins/table/utils/paste.d.ts +0 -14
  183. package/dist/types-ts4.0/plugins/table/utils/referentiality.d.ts +0 -2
  184. package/dist/types-ts4.0/plugins/table/utils/row-controls.d.ts +0 -16
  185. package/dist/types-ts4.0/plugins/table/utils/selection.d.ts +0 -6
  186. package/dist/types-ts4.0/plugins/table/utils/table.d.ts +0 -4
  187. package/dist/types-ts4.0/plugins/table/utils/update-plugin-state-decorations.d.ts +0 -4
  188. package/dist/types-ts4.0/plugins/table-plugin.d.ts +0 -2
  189. package/src/plugins/table/ui/FloatingContextualMenu/__tests__/ContextualMenu.tsx +0 -56
  190. package/src/plugins/table/ui/FloatingContextualMenu/__tests__/FloatingContextualMenu.tsx +0 -50
@@ -1,31 +0,0 @@
1
- /// <reference types="react" />
2
- import { Node as PmNode } from 'prosemirror-model';
3
- import { EditorView, NodeView } from 'prosemirror-view';
4
- import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
5
- import type { getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
6
- import ReactNodeView from '@atlaskit/editor-common/react-node-view';
7
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
8
- import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
9
- import { Props, TableOptions } from './types';
10
- declare type ForwardRef = (node: HTMLElement | null) => void;
11
- export default class TableView extends ReactNodeView<Props> {
12
- private table;
13
- private resizeObserver?;
14
- private tableRenderOptimization?;
15
- eventDispatcher?: EventDispatcher;
16
- getPos: getPosHandlerNode;
17
- constructor(props: Props);
18
- getContentDOM(): {
19
- dom: Node;
20
- contentDOM?: Node | null | undefined;
21
- };
22
- setDomAttrs(node: PmNode): void;
23
- getNode: () => PmNode<any>;
24
- render(props: Props, forwardRef: ForwardRef): JSX.Element;
25
- private hasHoveredRows;
26
- viewShouldUpdate(nextNode: PmNode): boolean;
27
- ignoreMutation(): boolean;
28
- destroy(): void;
29
- }
30
- export declare const createTableView: (node: PmNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, options: TableOptions, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags) => NodeView;
31
- export {};
@@ -1,19 +0,0 @@
1
- import { Node } from 'prosemirror-model';
2
- import { EditorView, NodeView } from 'prosemirror-view';
3
- import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
4
- import type { getPosHandler } from '@atlaskit/editor-common/types';
5
- import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
6
- export default class TableCellNodeView implements NodeView {
7
- node: Node;
8
- dom: HTMLElement;
9
- contentDOM: HTMLElement;
10
- getPos: getPosHandler;
11
- view: EditorView;
12
- providerFactory?: ProviderFactory;
13
- observer?: ResizeObserver;
14
- mouseMoveOptimization?: boolean;
15
- constructor(node: Node, view: EditorView, getPos: any, getEditorFeatureFlags: GetEditorFeatureFlags, observer?: ResizeObserver);
16
- private updateNodeView;
17
- update(node: Node): boolean;
18
- destroy(): void;
19
- }
@@ -1,24 +0,0 @@
1
- import { Node as PmNode } from 'prosemirror-model';
2
- import { EditorView } from 'prosemirror-view';
3
- import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
- import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
5
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
6
- export declare type TableOptions = {
7
- isBreakoutEnabled?: boolean;
8
- isFullWidthModeEnabled?: boolean;
9
- wasFullWidthModeEnabled?: boolean;
10
- };
11
- export interface Props {
12
- node: PmNode;
13
- view: EditorView;
14
- allowColumnResizing?: boolean;
15
- cellMinWidth?: number;
16
- portalProviderAPI: PortalProviderAPI;
17
- eventDispatcher: EventDispatcher;
18
- getPos: () => number;
19
- options?: TableOptions;
20
- tableRenderOptimization?: boolean;
21
- getEditorContainerWidth: GetEditorContainerWidth;
22
- getEditorFeatureFlags: GetEditorFeatureFlags;
23
- hasIntlContext: boolean;
24
- }
@@ -1,8 +0,0 @@
1
- import { EditorState } from 'prosemirror-state';
2
- import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
3
- export declare const updateShadowListForStickyStyles: (heightStyle: string, shadows: HTMLCollection) => void;
4
- /**
5
- * Update overflow shadows for a given wrapper & table.
6
- * if `overflowShadowOptimization` is enabled, this will exit early.
7
- */
8
- export declare const updateOverflowShadows: (getEditorFeatureFlags: GetEditorFeatureFlags) => (editorState: EditorState, wrapper?: HTMLElement | null | undefined, table?: HTMLElement | null | undefined, rightShadows?: NodeListOf<HTMLElement> | null | undefined, leftShadows?: NodeListOf<HTMLElement> | null | undefined) => false | undefined;
@@ -1,7 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { EditorState, PluginKey, Transaction, ReadonlyTransaction } from 'prosemirror-state';
3
- import { DecorationSet } from 'prosemirror-view';
4
- export declare const pluginKey: PluginKey<any, any>;
5
- export declare const getDecorations: (state: EditorState) => DecorationSet;
6
- export declare const handleDocOrSelectionChanged: (tr: Transaction | ReadonlyTransaction, decorationSet: DecorationSet, oldState: EditorState) => DecorationSet;
7
- export declare const createPlugin: () => SafePlugin<any, any>;
@@ -1,3 +0,0 @@
1
- import { DecorationTransformer } from './types';
2
- export declare const maybeUpdateColumnControlsSelectedDecoration: DecorationTransformer;
3
- export declare const buildColumnControlsDecorations: DecorationTransformer;
@@ -1,2 +0,0 @@
1
- import { DecorationTransformer } from './types';
2
- export declare const buildColumnResizingDecorations: (columnEndIndex: number) => DecorationTransformer;
@@ -1,2 +0,0 @@
1
- import { DecorationTransformer } from './types';
2
- export declare const composeDecorations: (transformers: Array<DecorationTransformer>) => DecorationTransformer;
@@ -1,3 +0,0 @@
1
- export { buildColumnControlsDecorations, maybeUpdateColumnControlsSelectedDecoration, } from './column-controls';
2
- export { buildColumnResizingDecorations } from './column-resizing';
3
- export { composeDecorations } from './compose-decorations';
@@ -1,6 +0,0 @@
1
- import { ReadonlyTransaction, Transaction } from 'prosemirror-state';
2
- import { DecorationSet } from 'prosemirror-view';
3
- export declare type DecorationTransformer = ({ decorationSet, tr, }: {
4
- decorationSet: DecorationSet;
5
- tr: Transaction | ReadonlyTransaction;
6
- }) => DecorationSet;
@@ -1,5 +0,0 @@
1
- export declare const defaultTableSelection: {
2
- hoveredColumns: never[];
3
- hoveredRows: never[];
4
- isInDanger: boolean;
5
- };
@@ -1,5 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
3
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
- export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null): SafePlugin;
5
- export default keymapPlugin;
@@ -1,8 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
3
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
4
- import { PluginConfig } from '../types';
5
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
6
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
7
- import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
8
- export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, breakoutEnabled?: boolean | undefined, fullWidthModeEnabled?: boolean | undefined, previousFullWidthModeEnabled?: boolean | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => SafePlugin<import("../types").TablePluginState, import("prosemirror-model").Schema<any, any>>;
@@ -1 +0,0 @@
1
- export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("../types").TablePluginState | ((state: import("prosemirror-state").EditorState<any>) => import("../types").TablePluginState)) => import("prosemirror-state").SafeStateField<import("../types").TablePluginState, import("prosemirror-model").Schema<any, any>>, createCommand: <A = import("../types").TablePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState<any>>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction<any>, state: import("prosemirror-state").EditorState<any>) => import("prosemirror-state").Transaction<any>) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState<any>) => import("../types").TablePluginState;
@@ -1,3 +0,0 @@
1
- import { PluginKey } from 'prosemirror-state';
2
- import { TablePluginState } from '../types';
3
- export declare const pluginKey: PluginKey<TablePluginState, any>;
@@ -1,4 +0,0 @@
1
- import { PluginKey } from 'prosemirror-state';
2
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- export declare const tableSafariDelayedDomSelectionSyncingWorkaroundKey: PluginKey<any, any>;
4
- export declare const createPlugin: () => SafePlugin<any, any>;
@@ -1,15 +0,0 @@
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 'prosemirror-state';
8
- import { DecorationSet } from 'prosemirror-view';
9
- interface SafariDeleteCompositionTextIssueWorkaroundPluginState {
10
- renderSpan: boolean;
11
- decorations: DecorationSet;
12
- }
13
- export declare const tableSafariDeleteCompositionTextIssueWorkaroundKey: PluginKey<SafariDeleteCompositionTextIssueWorkaroundPluginState, any>;
14
- export declare const createPlugin: () => SafePlugin<SafariDeleteCompositionTextIssueWorkaroundPluginState, any>;
15
- export {};
@@ -1,3 +0,0 @@
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;
@@ -1,6 +0,0 @@
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';
@@ -1,6 +0,0 @@
1
- export declare 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;
@@ -1,65 +0,0 @@
1
- /// <reference types="lodash" />
2
- import { Node as PmNode } from 'prosemirror-model';
3
- import { EditorView, NodeView } from 'prosemirror-view';
4
- import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
5
- import { TablePluginState } from '../../../types';
6
- import { TableDOMElements } from './dom';
7
- import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
8
- export declare const supportedHeaderRow: (node: PmNode) => boolean;
9
- export declare class TableRowNodeView implements NodeView {
10
- view: EditorView;
11
- node: PmNode;
12
- getPos: () => number;
13
- eventDispatcher: EventDispatcher;
14
- dom: HTMLTableRowElement;
15
- contentDOM: HTMLElement;
16
- isHeaderRow: boolean;
17
- editorScrollableElement?: HTMLElement | Window;
18
- colControlsOffset: number;
19
- focused: boolean;
20
- topPosEditorElement: number;
21
- isSticky: boolean;
22
- isTableInit: boolean;
23
- lastTimePainted: number;
24
- private intersectionObserver?;
25
- private resizeObserver?;
26
- private stickyHeadersOptimization;
27
- private sentinels;
28
- private stickyRowHeight?;
29
- get tree(): TableDOMElements | null | undefined;
30
- constructor(node: PmNode, view: EditorView, getPos: any, eventDispatcher: EventDispatcher, getEditorFeatureFlags: GetEditorFeatureFlags);
31
- listening: boolean;
32
- headerRowMouseScrollEnd: import("lodash").DebouncedFunc<() => void>;
33
- headerRowMouseScroll: import("lodash").DebouncedFunc<() => void>;
34
- subscribe(): void;
35
- unsubscribe(): void;
36
- private initObservers;
37
- private createResizeObserver;
38
- private createIntersectionObserver;
39
- previousDomTop: number | undefined;
40
- previousPadding: number | undefined;
41
- latestDomTop: number | undefined;
42
- nextFrame: number | undefined;
43
- onScroll: () => void;
44
- loop: () => void;
45
- paint: (tree: TableDOMElements) => void;
46
- update(node: PmNode, ..._args: any[]): boolean;
47
- destroy(): void;
48
- ignoreMutation(mutationRecord: MutationRecord | {
49
- type: 'selection';
50
- target: Element;
51
- }): boolean;
52
- onTablePluginState: (state: TablePluginState) => void;
53
- onWidthPluginState: () => void;
54
- shouldHeaderStick: (tree: TableDOMElements) => boolean;
55
- makeHeaderRowSticky: (tree: TableDOMElements) => void;
56
- makeRowHeaderNotSticky: (table: HTMLElement, isEditorDestroyed?: boolean) => void;
57
- getWrapperoffset: (inverse?: boolean) => number;
58
- getWrapperRefTop: (wrapper: HTMLElement) => number;
59
- getScrolledTableTop: (wrapper: HTMLElement) => number;
60
- getCurrentTableTop: (tree: TableDOMElements) => number;
61
- padding: number;
62
- top: number;
63
- emitOn: (top: number, padding: number) => void;
64
- emitOff: (isEditorDestroyed: boolean) => void;
65
- }
@@ -1,3 +0,0 @@
1
- import { PluginKey } from 'prosemirror-state';
2
- import { StickyPluginState } from './types';
3
- export declare const pluginKey: PluginKey<StickyPluginState, any>;
@@ -1,3 +0,0 @@
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<any>) => StickyPluginState)) => import("prosemirror-state").SafeStateField<StickyPluginState, import("prosemirror-model").Schema<any, any>>, createCommand: <A = StickyPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState<any>>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction<any>, state: import("prosemirror-state").EditorState<any>) => import("prosemirror-state").Transaction<any>) | undefined) => import("@atlaskit/editor-common/types").Command;
3
- export { createPluginState, createCommand };
@@ -1,4 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
3
- import { EventDispatcher, Dispatch } from '@atlaskit/editor-common/event-dispatcher';
4
- export declare const createPlugin: (dispatch: Dispatch, eventDispatcher: EventDispatcher, initialState: (() => never[]) | undefined, getEditorFeatureFlags: GetEditorFeatureFlags) => SafePlugin<import("./types").StickyPluginState, import("prosemirror-model").Schema<any, any>>;
@@ -1,16 +0,0 @@
1
- export declare type RowStickyState = {
2
- pos: number;
3
- top: number;
4
- padding: number;
5
- sticky: boolean;
6
- };
7
- export declare type StickyPluginState = RowStickyState[];
8
- export declare type UpdateSticky = {
9
- name: 'UPDATE';
10
- state: RowStickyState;
11
- };
12
- export declare type RemoveSticky = {
13
- name: 'REMOVE';
14
- pos: number;
15
- };
16
- export declare type StickyPluginAction = UpdateSticky | RemoveSticky;
@@ -1,2 +0,0 @@
1
- import { StickyPluginState } from './types';
2
- export declare const findStickyHeaderForTable: (state: StickyPluginState, tablePos: number | undefined) => import("./types").RowStickyState | undefined;
@@ -1,22 +0,0 @@
1
- /**
2
- * A plugin for ensuring tables always have unique local IDs, and to
3
- * preserve/not regenerate them when they are being cut and paste around the
4
- * document.
5
- *
6
- * More broadly, this plugin should be generalised so it can solve this ‘unique
7
- * id’ problem across the codebase for any node, but for now this will live on
8
- * its own solving only for tables.
9
- *
10
- * TODO: https://product-fabric.atlassian.net/browse/ED-12714
11
- *
12
- */
13
- import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
14
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
15
- interface TableLocalIdPluginState {
16
- parsedForLocalIds: boolean;
17
- }
18
- /**
19
- * Ensures uniqueness of `localId`s on tables being created or edited
20
- */
21
- declare const createPlugin: (dispatch: Dispatch) => SafePlugin<TableLocalIdPluginState, any>;
22
- export { createPlugin };
@@ -1,25 +0,0 @@
1
- import { Node as PMNode } from 'prosemirror-model';
2
- import { Transaction } from 'prosemirror-state';
3
- import type { Command } from '@atlaskit/editor-common/types';
4
- import type { DomAtPos } from 'prosemirror-utils';
5
- import { ResizeState, ScaleOptions } from './utils';
6
- import { ContentNodeWithPos } from 'prosemirror-utils';
7
- export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos) => Command;
8
- export declare const evenColumns: ({ resizeState, table, start, event, }: {
9
- resizeState: ResizeState;
10
- table: PMNode;
11
- start: number;
12
- event: MouseEvent;
13
- }) => Command;
14
- export declare const distributeColumnsWidths: (newResizeState: ResizeState, table: ContentNodeWithPos) => Command;
15
- export declare const setResizeHandlePos: (resizeHandlePos: number | null) => Command;
16
- export declare const stopResizing: (tr?: Transaction<any> | undefined) => Command;
17
- export declare const setDragging: (dragging: {
18
- startX: number;
19
- startWidth: number;
20
- } | null, tr?: Transaction<any> | undefined) => Command;
21
- export declare const setLastClick: (lastClick: {
22
- x: number;
23
- y: number;
24
- time: number;
25
- } | null, transform?: ((tr: Transaction) => Transaction) | undefined) => Command;
@@ -1,4 +0,0 @@
1
- import { EditorView } from 'prosemirror-view';
2
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
- import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
- export declare const handleMouseDown: (view: EditorView, event: MouseEvent, localResizeHandlePos: number, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => boolean;
@@ -1,4 +0,0 @@
1
- export { createPlugin } from './plugin';
2
- export { scaleTable } from './commands';
3
- export { pluginKey } from './plugin-key';
4
- export { getPluginState } from './plugin-factory';
@@ -1,4 +0,0 @@
1
- import { ColumnResizingPluginState } from '../../types';
2
- export declare const createCommand: <A = import("../../types").ColumnResizingPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState<any>>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction<any>, state: import("prosemirror-state").EditorState<any>) => import("prosemirror-state").Transaction<any>) | undefined) => import("@atlaskit/editor-common/types").Command;
3
- export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: ColumnResizingPluginState | ((state: import("prosemirror-state").EditorState<any>) => ColumnResizingPluginState)) => import("prosemirror-state").SafeStateField<ColumnResizingPluginState, import("prosemirror-model").Schema<any, any>>;
4
- export declare const getPluginState: (state: import("prosemirror-state").EditorState<any>) => ColumnResizingPluginState;
@@ -1,3 +0,0 @@
1
- import { PluginKey } from 'prosemirror-state';
2
- import { ColumnResizingPluginState } from '../../types';
3
- export declare const pluginKey: PluginKey<ColumnResizingPluginState, any>;
@@ -1,6 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
3
- import { ColumnResizingPluginState } from '../../types';
4
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
- import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
6
- export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI): SafePlugin<ColumnResizingPluginState, import("prosemirror-model").Schema<any, any>>;
@@ -1,3 +0,0 @@
1
- import { ColumnResizingPluginAction, ColumnResizingPluginState } from '../../types';
2
- declare const _default: (pluginState: ColumnResizingPluginState, action: ColumnResizingPluginAction) => ColumnResizingPluginState;
3
- export default _default;
@@ -1,8 +0,0 @@
1
- import { Node as PmNode } from 'prosemirror-model';
2
- declare type Col = Array<string | {
3
- [name: string]: string;
4
- }>;
5
- export declare const generateColgroup: (table: PmNode) => Col[];
6
- export declare const insertColgroupFromNode: (tableRef: HTMLTableElement, table: PmNode) => HTMLCollection;
7
- export declare const hasTableBeenResized: (table: PmNode) => boolean;
8
- export {};
@@ -1,14 +0,0 @@
1
- import { Node as PMNode } from 'prosemirror-model';
2
- export interface ColumnState {
3
- index: number;
4
- width: number;
5
- minWidth: number;
6
- }
7
- export declare const getColumnStateFromDOM: (cells: HTMLElement[], index: number, minWidth: number) => ColumnState;
8
- export declare const getFreeSpace: (state: ColumnState) => number;
9
- export declare const getCellsRefsInColumn: (columnIndex: number, table: PMNode, tableStart: number, domAtPos: (pos: number) => {
10
- node: Node;
11
- offset: number;
12
- }) => HTMLElement[];
13
- export declare const calculateColumnWidth: (cells: HTMLElement[], calculateColumnWidthCb: (css: CSSStyleDeclaration, cellRef: HTMLElement, colSpan: number) => number) => number;
14
- export declare const addContainerLeftRightPadding: (amount: number, css: CSSStyleDeclaration) => number;
@@ -1,4 +0,0 @@
1
- export declare function contentWidth(elem: HTMLElement, container: HTMLElement, colWidths?: number[], canvas?: HTMLCanvasElement): {
2
- minWidth: number;
3
- width: number;
4
- };
@@ -1,13 +0,0 @@
1
- import { EditorState } from 'prosemirror-state';
2
- import { EditorView } from 'prosemirror-view';
3
- import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
- export declare const updateControls: (getEditorFeatureFlags: GetEditorFeatureFlags) => (state: EditorState) => void;
5
- export declare const isClickNear: (event: MouseEvent, click: {
6
- x: number;
7
- y: number;
8
- }) => boolean;
9
- export declare const getResizeCellPos: (view: EditorView, event: MouseEvent, lastColumnResizable: boolean) => number | null;
10
- export declare const updateStickyMargins: (table: HTMLElement) => void;
11
- export declare const applyColWidthsToStickyRow: (colGroup: HTMLTableColElement | null, headerRow: HTMLTableRowElement) => void;
12
- export declare const syncStickyRowToTable: (tableRef?: HTMLElement | null | undefined) => void;
13
- export declare const applyTableWidthToStickyRow: (tableRef: HTMLElement, headerRow: HTMLTableRowElement) => void;
@@ -1,12 +0,0 @@
1
- export { generateColgroup, insertColgroupFromNode, hasTableBeenResized, } from './colgroup';
2
- export { contentWidth } from './content-width';
3
- export { getColumnStateFromDOM, getFreeSpace, getCellsRefsInColumn, calculateColumnWidth, addContainerLeftRightPadding, } from './column-state';
4
- export type { ColumnState } from './column-state';
5
- export { growColumn, shrinkColumn, reduceSpace } from './resize-logic';
6
- export { getResizeState, updateColgroup, getTotalWidth, evenAllColumnsWidths, bulkColumnsResize, areColumnsEven, adjustColumnsWidths, } from './resize-state';
7
- export { tableLayoutToSize, getLayoutSize, getDefaultLayoutMaxWidth, pointsAtCell, currentColWidth, domCellAround, } from './misc';
8
- export { updateControls, isClickNear, getResizeCellPos } from './dom';
9
- export { scale, scaleWithParent } from './scale-table';
10
- export type { ScaleOptions } from './scale-table';
11
- export type { ResizeState, ResizeStateWithAnalytics } from './types';
12
- export { resizeColumn } from './resize-column';
@@ -1,22 +0,0 @@
1
- import { ResolvedPos } from 'prosemirror-model';
2
- import { EditorView } from 'prosemirror-view';
3
- import { CellAttributes, TableLayout } from '@atlaskit/adf-schema';
4
- import { TableOptions } from '../../../nodeviews/types';
5
- import { Node as PMNode } from 'prosemirror-model';
6
- import { EditorState } from 'prosemirror-state';
7
- import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
8
- export declare const tableLayoutToSize: Record<string, number>;
9
- export declare function getLayoutSize(tableLayout: TableLayout, containerWidth: number | undefined, options: TableOptions): number;
10
- export declare function getDefaultLayoutMaxWidth(containerWidth?: number): number;
11
- export declare function pointsAtCell($pos: ResolvedPos<any>): false | PMNode<any> | null | undefined;
12
- export declare function currentColWidth(view: EditorView, cellPos: number, { colspan, colwidth }: CellAttributes): number;
13
- export declare function domCellAround(target: HTMLElement | null): HTMLElement | null;
14
- interface getTableMaxWidthProps {
15
- table: PMNode;
16
- tableStart: number;
17
- state: EditorState;
18
- layout: TableLayout;
19
- getEditorContainerWidth: GetEditorContainerWidth;
20
- }
21
- export declare const getTableMaxWidth: ({ table, tableStart, state, layout, getEditorContainerWidth, }: getTableMaxWidthProps) => any;
22
- export {};
@@ -1,2 +0,0 @@
1
- import { ResizeState } from './types';
2
- export declare const resizeColumn: (resizeState: ResizeState, colIndex: number, amount: number, tableRef: HTMLElement, selectedColumns?: number[] | undefined) => ResizeState;
@@ -1,4 +0,0 @@
1
- import { ResizeState } from './types';
2
- export declare const growColumn: (state: ResizeState, colIndex: number, amount: number, selectedColumns?: number[] | undefined) => ResizeState;
3
- export declare const shrinkColumn: (state: ResizeState, colIndex: number, amount: number, selectedColumns?: number[] | undefined) => ResizeState;
4
- export declare function reduceSpace(state: ResizeState, amount: number, ignoreCols?: number[]): ResizeState;
@@ -1,29 +0,0 @@
1
- import { Node as PMNode } from 'prosemirror-model';
2
- import { Rect } from '@atlaskit/editor-tables/table-map';
3
- import { TableLayout } from '@atlaskit/adf-schema';
4
- import { ResizeState, ResizeStateWithAnalytics } from './types';
5
- import { EditorState } from 'prosemirror-state';
6
- import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
7
- export declare const getResizeState: ({ minWidth, maxSize, table, tableRef, start, domAtPos, }: {
8
- minWidth: number;
9
- maxSize: number;
10
- table: PMNode;
11
- tableRef: HTMLTableElement;
12
- start: number;
13
- domAtPos: (pos: number) => {
14
- node: Node;
15
- offset: number;
16
- };
17
- }) => ResizeState;
18
- export declare const updateColgroup: (state: ResizeState, tableRef: HTMLElement) => void;
19
- export declare const getTotalWidth: ({ cols }: ResizeState) => number;
20
- export declare const adjustColumnsWidths: (resizeState: ResizeState, maxSize: number) => ResizeState;
21
- export declare const evenAllColumnsWidths: (resizeState: ResizeState) => ResizeState;
22
- export declare const evenSelectedColumnsWidths: (resizeState: ResizeState, rect: Rect) => ResizeState;
23
- export declare const bulkColumnsResize: (resizeState: ResizeState, columnsIndexes: number[], sourceColumnIndex: number) => ResizeState;
24
- export declare const areColumnsEven: (resizeState: ResizeState) => boolean;
25
- export declare const normaliseTableLayout: (input: string | undefined | null) => TableLayout;
26
- export declare const getNewResizeStateFromSelectedColumns: (rect: Rect, state: EditorState, domAtPos: (pos: number) => {
27
- node: Node;
28
- offset: number;
29
- }, getEditorContainerWidth: GetEditorContainerWidth) => ResizeStateWithAnalytics | undefined;
@@ -1,17 +0,0 @@
1
- import { Node as PMNode } from 'prosemirror-model';
2
- import type { DomAtPos } from 'prosemirror-utils';
3
- import { ResizeState } from '../utils/types';
4
- export interface ScaleOptions {
5
- node: PMNode;
6
- prevNode: PMNode;
7
- start: number;
8
- containerWidth?: number;
9
- previousContainerWidth?: number;
10
- parentWidth?: number;
11
- layoutChanged?: boolean;
12
- isBreakoutEnabled?: boolean;
13
- isFullWidthModeEnabled?: boolean;
14
- }
15
- export declare const scale: (tableRef: HTMLTableElement, options: ScaleOptions, domAtPos: DomAtPos) => ResizeState | undefined;
16
- export declare const scaleWithParent: (tableRef: HTMLTableElement, parentWidth: number, table: PMNode, start: number, domAtPos: DomAtPos) => ResizeState;
17
- export declare function scaleTableTo(state: ResizeState, maxSize: number): ResizeState;
@@ -1,22 +0,0 @@
1
- import { ColumnState } from './column-state';
2
- import { ContentNodeWithPos } from 'prosemirror-utils';
3
- export interface ResizeState {
4
- cols: ColumnState[];
5
- widths: number[];
6
- maxSize: number;
7
- overflow: boolean;
8
- tableWidth: number;
9
- }
10
- export interface ResizeStateWithAnalytics {
11
- resizeState: ResizeState;
12
- table: ContentNodeWithPos;
13
- changed: boolean;
14
- attributes: {
15
- position: number;
16
- count: number;
17
- totalRowCount: number;
18
- totalColumnCount: number;
19
- widthsBefore: number[];
20
- widthsAfter: number[];
21
- };
22
- }
@@ -1 +0,0 @@
1
- export declare const unitToNumber: (unit: string | null) => number;
@@ -1,4 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
3
- export declare function tableSelectionKeymapPlugin(editorSelectionAPI: EditorSelectionAPI | undefined | null): SafePlugin;
4
- export default tableSelectionKeymapPlugin;
@@ -1,3 +0,0 @@
1
- import { TablePluginAction, TablePluginState } from './types';
2
- declare const _default: (pluginState: TablePluginState, action: TablePluginAction) => TablePluginState;
3
- export default _default;
@@ -1,36 +0,0 @@
1
- import type { Command, FloatingToolbarDropdown, FloatingToolbarHandler, FloatingToolbarItem, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
2
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
- import { ToolbarMenuConfig, ToolbarMenuState, ToolbarMenuContext, PluginConfig } from './types';
4
- import { EditorState } from 'prosemirror-state';
5
- import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
6
- import { Rect } from '@atlaskit/editor-tables/table-map';
7
- export declare const messages: {
8
- tableOptions: {
9
- id: string;
10
- defaultMessage: string;
11
- description: string;
12
- };
13
- headerRow: {
14
- id: string;
15
- defaultMessage: string;
16
- description: string;
17
- };
18
- headerColumn: {
19
- id: string;
20
- defaultMessage: string;
21
- description: string;
22
- };
23
- numberedColumn: {
24
- id: string;
25
- defaultMessage: string;
26
- description: string;
27
- };
28
- collapseTable: {
29
- id: string;
30
- defaultMessage: string;
31
- description: string;
32
- };
33
- };
34
- export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarItem<Command>;
35
- export declare const getToolbarCellOptionsConfig: (editorState: EditorState, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarDropdown<Command>;
36
- export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags) => (config: PluginConfig) => FloatingToolbarHandler;