@atlaskit/editor-plugin-table 12.2.5 → 12.2.7

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 (207) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +24 -2
  3. package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +23 -1
  4. package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +24 -2
  5. package/package.json +4 -4
  6. package/afm-cc/tsconfig.json +0 -123
  7. package/afm-dev-agents/tsconfig.json +0 -123
  8. package/afm-jira/tsconfig.json +0 -123
  9. package/afm-passionfruit/tsconfig.json +0 -123
  10. package/afm-post-office/tsconfig.json +0 -123
  11. package/afm-rovo-extension/tsconfig.json +0 -123
  12. package/afm-townsquare/tsconfig.json +0 -123
  13. package/afm-volt/tsconfig.json +0 -114
  14. package/build/tsconfig.json +0 -23
  15. package/docs/0-intro.tsx +0 -57
  16. package/src/index.ts +0 -21
  17. package/src/nodeviews/ExternalDropTargets.tsx +0 -91
  18. package/src/nodeviews/OverflowShadowsObserver.ts +0 -156
  19. package/src/nodeviews/TableCell.ts +0 -134
  20. package/src/nodeviews/TableComponent.tsx +0 -1590
  21. package/src/nodeviews/TableComponentWithSharedState.tsx +0 -278
  22. package/src/nodeviews/TableContainer.tsx +0 -926
  23. package/src/nodeviews/TableNodeViewBase.ts +0 -29
  24. package/src/nodeviews/TableResizer.tsx +0 -884
  25. package/src/nodeviews/TableRow.ts +0 -830
  26. package/src/nodeviews/TableStickyScrollbar.ts +0 -211
  27. package/src/nodeviews/__mocks__/OverflowShadowsObserver.ts +0 -15
  28. package/src/nodeviews/__mocks__/OverridableMock.ts +0 -26
  29. package/src/nodeviews/table-container-styles.ts +0 -9
  30. package/src/nodeviews/table-node-views.ts +0 -76
  31. package/src/nodeviews/table.tsx +0 -530
  32. package/src/nodeviews/toDOM.ts +0 -244
  33. package/src/nodeviews/types.ts +0 -36
  34. package/src/nodeviews/update-overflow-shadows.ts +0 -11
  35. package/src/pm-plugins/analytics/actions.ts +0 -21
  36. package/src/pm-plugins/analytics/commands.ts +0 -47
  37. package/src/pm-plugins/analytics/plugin-factory.ts +0 -9
  38. package/src/pm-plugins/analytics/plugin-key.ts +0 -5
  39. package/src/pm-plugins/analytics/plugin.ts +0 -80
  40. package/src/pm-plugins/analytics/reducer.ts +0 -27
  41. package/src/pm-plugins/analytics/types.ts +0 -20
  42. package/src/pm-plugins/analytics/utils/moved-event.ts +0 -51
  43. package/src/pm-plugins/commands/clear.ts +0 -43
  44. package/src/pm-plugins/commands/collapse.ts +0 -17
  45. package/src/pm-plugins/commands/column-resize.ts +0 -478
  46. package/src/pm-plugins/commands/commands-with-analytics.ts +0 -715
  47. package/src/pm-plugins/commands/delete.ts +0 -42
  48. package/src/pm-plugins/commands/display-mode.ts +0 -18
  49. package/src/pm-plugins/commands/go-to-next-cell.ts +0 -198
  50. package/src/pm-plugins/commands/hover.ts +0 -242
  51. package/src/pm-plugins/commands/index.ts +0 -51
  52. package/src/pm-plugins/commands/insert.ts +0 -438
  53. package/src/pm-plugins/commands/misc.ts +0 -811
  54. package/src/pm-plugins/commands/referentiality.ts +0 -15
  55. package/src/pm-plugins/commands/selection.ts +0 -537
  56. package/src/pm-plugins/commands/sort.ts +0 -102
  57. package/src/pm-plugins/commands/split-cell.ts +0 -28
  58. package/src/pm-plugins/commands/toggle.ts +0 -109
  59. package/src/pm-plugins/create-plugin-config.ts +0 -17
  60. package/src/pm-plugins/decorations/plugin.ts +0 -107
  61. package/src/pm-plugins/decorations/utils/column-controls.ts +0 -91
  62. package/src/pm-plugins/decorations/utils/column-resizing.ts +0 -71
  63. package/src/pm-plugins/decorations/utils/compose-decorations.ts +0 -9
  64. package/src/pm-plugins/decorations/utils/types.ts +0 -16
  65. package/src/pm-plugins/default-table-selection.ts +0 -14
  66. package/src/pm-plugins/drag-and-drop/actions.ts +0 -48
  67. package/src/pm-plugins/drag-and-drop/commands-with-analytics.ts +0 -222
  68. package/src/pm-plugins/drag-and-drop/commands.ts +0 -194
  69. package/src/pm-plugins/drag-and-drop/consts.ts +0 -7
  70. package/src/pm-plugins/drag-and-drop/plugin-factory.ts +0 -33
  71. package/src/pm-plugins/drag-and-drop/plugin-key.ts +0 -5
  72. package/src/pm-plugins/drag-and-drop/plugin.ts +0 -398
  73. package/src/pm-plugins/drag-and-drop/reducer.ts +0 -38
  74. package/src/pm-plugins/drag-and-drop/types.ts +0 -18
  75. package/src/pm-plugins/drag-and-drop/utils/autoscrollers.ts +0 -49
  76. package/src/pm-plugins/drag-and-drop/utils/getDragBehaviour.ts +0 -9
  77. package/src/pm-plugins/drag-and-drop/utils/monitor.ts +0 -73
  78. package/src/pm-plugins/handlers.ts +0 -161
  79. package/src/pm-plugins/keymap.ts +0 -436
  80. package/src/pm-plugins/main.ts +0 -433
  81. package/src/pm-plugins/plugin-factory.ts +0 -42
  82. package/src/pm-plugins/plugin-key.ts +0 -8
  83. package/src/pm-plugins/reducer.ts +0 -145
  84. package/src/pm-plugins/safari-delete-composition-text-issue-workaround.ts +0 -102
  85. package/src/pm-plugins/sticky-headers/commands.ts +0 -8
  86. package/src/pm-plugins/sticky-headers/plugin-key.ts +0 -5
  87. package/src/pm-plugins/sticky-headers/plugin-state.ts +0 -52
  88. package/src/pm-plugins/sticky-headers/plugin.ts +0 -12
  89. package/src/pm-plugins/sticky-headers/types.ts +0 -20
  90. package/src/pm-plugins/sticky-headers/util.ts +0 -18
  91. package/src/pm-plugins/table-analytics.ts +0 -100
  92. package/src/pm-plugins/table-local-id.ts +0 -213
  93. package/src/pm-plugins/table-resizing/commands.ts +0 -116
  94. package/src/pm-plugins/table-resizing/event-handlers.ts +0 -352
  95. package/src/pm-plugins/table-resizing/plugin-factory.ts +0 -29
  96. package/src/pm-plugins/table-resizing/plugin-key.ts +0 -5
  97. package/src/pm-plugins/table-resizing/plugin.ts +0 -94
  98. package/src/pm-plugins/table-resizing/reducer.ts +0 -37
  99. package/src/pm-plugins/table-resizing/utils/colgroup.ts +0 -306
  100. package/src/pm-plugins/table-resizing/utils/column-state.ts +0 -120
  101. package/src/pm-plugins/table-resizing/utils/consts.ts +0 -11
  102. package/src/pm-plugins/table-resizing/utils/content-width.ts +0 -118
  103. package/src/pm-plugins/table-resizing/utils/dom.ts +0 -132
  104. package/src/pm-plugins/table-resizing/utils/misc.ts +0 -282
  105. package/src/pm-plugins/table-resizing/utils/resize-column.ts +0 -34
  106. package/src/pm-plugins/table-resizing/utils/resize-logic.ts +0 -289
  107. package/src/pm-plugins/table-resizing/utils/resize-state.ts +0 -417
  108. package/src/pm-plugins/table-resizing/utils/scale-table.ts +0 -290
  109. package/src/pm-plugins/table-resizing/utils/types.ts +0 -25
  110. package/src/pm-plugins/table-resizing/utils/unit-to-number.ts +0 -1
  111. package/src/pm-plugins/table-selection-keymap.ts +0 -64
  112. package/src/pm-plugins/table-size-selector.ts +0 -39
  113. package/src/pm-plugins/table-width-in-comment-fix.ts +0 -113
  114. package/src/pm-plugins/table-width.ts +0 -153
  115. package/src/pm-plugins/transforms/column-width.ts +0 -249
  116. package/src/pm-plugins/transforms/delete-columns.ts +0 -281
  117. package/src/pm-plugins/transforms/delete-rows.ts +0 -154
  118. package/src/pm-plugins/transforms/fix-tables.ts +0 -249
  119. package/src/pm-plugins/transforms/merge.ts +0 -301
  120. package/src/pm-plugins/transforms/replace-table.ts +0 -38
  121. package/src/pm-plugins/transforms/split.ts +0 -90
  122. package/src/pm-plugins/utils/alignment.ts +0 -33
  123. package/src/pm-plugins/utils/analytics.ts +0 -238
  124. package/src/pm-plugins/utils/collapse.ts +0 -93
  125. package/src/pm-plugins/utils/column-controls.ts +0 -250
  126. package/src/pm-plugins/utils/create.ts +0 -64
  127. package/src/pm-plugins/utils/decoration.ts +0 -672
  128. package/src/pm-plugins/utils/dom.ts +0 -251
  129. package/src/pm-plugins/utils/drag-menu.tsx +0 -491
  130. package/src/pm-plugins/utils/get-allow-add-column-custom-step.ts +0 -10
  131. package/src/pm-plugins/utils/guidelines.ts +0 -30
  132. package/src/pm-plugins/utils/merged-cells.ts +0 -239
  133. package/src/pm-plugins/utils/nodes.ts +0 -162
  134. package/src/pm-plugins/utils/paste.ts +0 -386
  135. package/src/pm-plugins/utils/row-controls.ts +0 -211
  136. package/src/pm-plugins/utils/selection.ts +0 -17
  137. package/src/pm-plugins/utils/snapping.ts +0 -136
  138. package/src/pm-plugins/utils/table.ts +0 -60
  139. package/src/pm-plugins/utils/update-plugin-state-decorations.ts +0 -13
  140. package/src/pm-plugins/view-mode-sort/consts.ts +0 -3
  141. package/src/pm-plugins/view-mode-sort/index.ts +0 -291
  142. package/src/pm-plugins/view-mode-sort/plugin-key.ts +0 -7
  143. package/src/pm-plugins/view-mode-sort/types.ts +0 -23
  144. package/src/pm-plugins/view-mode-sort/utils.ts +0 -136
  145. package/src/tablePlugin.tsx +0 -971
  146. package/src/tablePluginType.ts +0 -102
  147. package/src/types/index.ts +0 -592
  148. package/src/ui/ColumnResizeWidget/index.tsx +0 -61
  149. package/src/ui/ContentComponent.tsx +0 -311
  150. package/src/ui/DragHandle/HandleIconComponent.tsx +0 -21
  151. package/src/ui/DragHandle/index.tsx +0 -391
  152. package/src/ui/DragPreview/index.tsx +0 -51
  153. package/src/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.tsx +0 -59
  154. package/src/ui/FloatingContextualButton/FixedButton.tsx +0 -203
  155. package/src/ui/FloatingContextualButton/index.tsx +0 -168
  156. package/src/ui/FloatingContextualButton/styles.ts +0 -69
  157. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +0 -931
  158. package/src/ui/FloatingContextualMenu/index.tsx +0 -141
  159. package/src/ui/FloatingContextualMenu/styles.ts +0 -77
  160. package/src/ui/FloatingDeleteButton/DeleteButton.tsx +0 -54
  161. package/src/ui/FloatingDeleteButton/getPopUpOptions.ts +0 -65
  162. package/src/ui/FloatingDeleteButton/index.tsx +0 -383
  163. package/src/ui/FloatingDeleteButton/types.ts +0 -3
  164. package/src/ui/FloatingDragMenu/DragMenu.tsx +0 -668
  165. package/src/ui/FloatingDragMenu/DropdownMenu.tsx +0 -221
  166. package/src/ui/FloatingDragMenu/index.tsx +0 -136
  167. package/src/ui/FloatingDragMenu/styles.ts +0 -83
  168. package/src/ui/FloatingInsertButton/InsertButton.tsx +0 -263
  169. package/src/ui/FloatingInsertButton/getPopupOptions.ts +0 -131
  170. package/src/ui/FloatingInsertButton/index.tsx +0 -314
  171. package/src/ui/FloatingToolbarLabel/FloatingToolbarLabel.tsx +0 -31
  172. package/src/ui/SizeSelector/index.tsx +0 -74
  173. package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +0 -397
  174. package/src/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +0 -105
  175. package/src/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +0 -63
  176. package/src/ui/TableFloatingColumnControls/index.tsx +0 -151
  177. package/src/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +0 -106
  178. package/src/ui/TableFloatingControls/CornerControls/DragCornerControls.tsx +0 -143
  179. package/src/ui/TableFloatingControls/CornerControls/types.ts +0 -12
  180. package/src/ui/TableFloatingControls/FloatingControlsWithSelection.tsx +0 -88
  181. package/src/ui/TableFloatingControls/NumberColumn/index.tsx +0 -150
  182. package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +0 -131
  183. package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +0 -429
  184. package/src/ui/TableFloatingControls/RowDropTarget/index.tsx +0 -96
  185. package/src/ui/TableFloatingControls/index.tsx +0 -275
  186. package/src/ui/TableFullWidthLabel/index.tsx +0 -38
  187. package/src/ui/common-styles.ts +0 -1218
  188. package/src/ui/consts.ts +0 -109
  189. package/src/ui/event-handlers.ts +0 -662
  190. package/src/ui/global-styles.tsx +0 -55
  191. package/src/ui/hooks/useInternalTablePluginStateSelector.ts +0 -38
  192. package/src/ui/icons/AddColLeftIcon.tsx +0 -37
  193. package/src/ui/icons/AddColRightIcon.tsx +0 -37
  194. package/src/ui/icons/AddRowAboveIcon.tsx +0 -22
  195. package/src/ui/icons/AddRowBelowIcon.tsx +0 -39
  196. package/src/ui/icons/DragHandleDisabledIcon.tsx +0 -25
  197. package/src/ui/icons/DragHandleIcon.tsx +0 -16
  198. package/src/ui/icons/DragInMotionIcon.tsx +0 -54
  199. package/src/ui/icons/MergeCellsIcon.tsx +0 -26
  200. package/src/ui/icons/MinimisedHandle.tsx +0 -15
  201. package/src/ui/icons/SortingIconWrapper.tsx +0 -43
  202. package/src/ui/icons/SplitCellIcon.tsx +0 -34
  203. package/src/ui/toolbar.tsx +0 -1153
  204. package/src/ui/ui-styles.ts +0 -960
  205. package/tsconfig.app.json +0 -135
  206. package/tsconfig.dev.json +0 -54
  207. package/tsconfig.json +0 -18
@@ -1,102 +0,0 @@
1
- import type { AnalyticsEventPayload, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import type {
3
- Command,
4
- EditorCommand,
5
- GetEditorFeatureFlags,
6
- NextEditorPlugin,
7
- OptionalPlugin,
8
- } from '@atlaskit/editor-common/types';
9
- import type { AccessibilityUtilsPlugin } from '@atlaskit/editor-plugin-accessibility-utils';
10
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
11
- import type { BatchAttributeUpdatesPlugin } from '@atlaskit/editor-plugin-batch-attribute-updates';
12
- import type { ContentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
13
- import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
14
- import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
15
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
16
- import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
17
- import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
18
- import type { LimitedModePlugin } from '@atlaskit/editor-plugin-limited-mode';
19
- import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
20
- import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
21
- import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
22
-
23
- import type { PluginConfig, TableSharedState } from './types';
24
-
25
- export interface TablePluginOptions {
26
- tableOptions: PluginConfig;
27
- // this option will eventually be removed, and enabled by default
28
- dragAndDropEnabled?: boolean;
29
- // this option will eventually be removed, and enabled by default
30
- isTableScalingEnabled?: boolean;
31
- allowContextualMenu?: boolean;
32
- // TODO: ED-26961 - these two need to be rethought
33
- fullWidthEnabled?: boolean;
34
- wasFullWidthEnabled?: boolean;
35
- getEditorFeatureFlags?: GetEditorFeatureFlags;
36
- isCommentEditor?: boolean;
37
- isChromelessEditor?: boolean;
38
- }
39
-
40
- type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
41
-
42
- // TODO: ED-26961 - duplicating type instead of importing media plugin causing a circular dependency
43
- type MediaPlugin = NextEditorPlugin<
44
- 'media',
45
- {
46
- // Ignored via go/ees005
47
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
- pluginConfiguration: any;
49
- // Ignored via go/ees005
50
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
51
- dependencies: any;
52
- // Ignored via go/ees005
53
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
54
- sharedState: any;
55
- // Ignored via go/ees005
56
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
- actions: any;
58
- // Ignored via go/ees005
59
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
60
- commands: any;
61
- }
62
- >;
63
-
64
- export type TablePluginActions = {
65
- insertTable: InsertTableAction;
66
- };
67
-
68
- export type TablePluginCommands = {
69
- insertTableWithSize: (
70
- rowsCount: number,
71
- colsCount: number,
72
- inputMethod?: INPUT_METHOD.PICKER,
73
- ) => EditorCommand;
74
- };
75
-
76
- export type TablePluginDependencies = [
77
- AnalyticsPlugin,
78
- ContentInsertionPlugin,
79
- WidthPlugin,
80
- SelectionPlugin,
81
- OptionalPlugin<LimitedModePlugin>,
82
- OptionalPlugin<GuidelinePlugin>,
83
- OptionalPlugin<BatchAttributeUpdatesPlugin>,
84
- OptionalPlugin<AccessibilityUtilsPlugin>,
85
- OptionalPlugin<MediaPlugin>,
86
- OptionalPlugin<EditorViewModePlugin>,
87
- OptionalPlugin<FeatureFlagsPlugin>,
88
- OptionalPlugin<ExtensionPlugin>,
89
- OptionalPlugin<InteractionPlugin>,
90
- OptionalPlugin<UserIntentPlugin>,
91
- ];
92
-
93
- export type TablePlugin = NextEditorPlugin<
94
- 'table',
95
- {
96
- pluginConfiguration: TablePluginOptions | undefined;
97
- actions: TablePluginActions;
98
- sharedState?: TableSharedState;
99
- commands: TablePluginCommands;
100
- dependencies: TablePluginDependencies;
101
- }
102
- >;
@@ -1,592 +0,0 @@
1
- /* eslint-disable @atlaskit/editor/no-re-export */
2
- // Entry file in package.json
3
-
4
- import type { IntlShape } from 'react-intl-next';
5
-
6
- import type { TableLayout } from '@atlaskit/adf-schema';
7
- import { tableCellSelector, tableHeaderSelector, tablePrefixSelector } from '@atlaskit/adf-schema';
8
- import type { TableColumnOrdering } from '@atlaskit/custom-steps';
9
- import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
10
- import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
11
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
12
- import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
13
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
14
- import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
15
- import type { Rect } from '@atlaskit/editor-tables/table-map';
16
- import type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
17
-
18
- import type { RowStickyState } from '../pm-plugins/sticky-headers/types';
19
- import type { TablePlugin } from '../tablePluginType';
20
-
21
- export const RESIZE_HANDLE_AREA_DECORATION_GAP = 30;
22
- export type RowInsertPosition = 'TOP' | 'BOTTOM';
23
-
24
- /**
25
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-6877 Internal documentation for deprecation (no external access)}
26
- **/
27
- export type PermittedLayoutsDescriptor = TableLayout[] | 'all';
28
- export type Cell = { pos: number; start: number; node: PmNode };
29
- export type CellTransform = (cell: Cell) => (tr: Transaction) => Transaction;
30
-
31
- export interface InsertRowOptions {
32
- index: number;
33
- moveCursorToInsertedRow: boolean;
34
- }
35
-
36
- export type PluginInjectionAPI = ExtractInjectionAPI<TablePlugin>;
37
-
38
- export type PluginInjectionAPIWithA11y = ExtractInjectionAPI<TablePlugin> & {
39
- accessibilityUtils?: {
40
- actions: {
41
- ariaNotify: (message: string) => void | undefined;
42
- };
43
- };
44
- };
45
-
46
- // override getPluginState but do not expose publicly as this type is experimental and will change
47
- // in the future
48
- export type TableSharedStateInternal = Pick<
49
- TablePluginState,
50
- | 'isFullWidthModeEnabled'
51
- | 'wasFullWidthModeEnabled'
52
- | 'isHeaderRowEnabled'
53
- | 'isHeaderColumnEnabled'
54
- | 'ordering'
55
- | 'isInDanger'
56
- | 'hoveredRows'
57
- | 'hoveredColumns'
58
- | 'hoveredCell'
59
- | 'isTableHovered'
60
- | 'tableNode'
61
- | 'widthToWidest'
62
- | 'tableRef'
63
- | 'tablePos'
64
- | 'targetCellPosition'
65
- | 'isContextualMenuOpen'
66
- | 'pluginConfig'
67
- | 'insertColumnButtonIndex'
68
- | 'insertRowButtonIndex'
69
- | 'isDragAndDropEnabled'
70
- | 'tableWrapperTarget'
71
- | 'isCellMenuOpenByKeyboard'
72
- > & {
73
- isResizing: boolean;
74
- isTableResizing?: boolean;
75
- isWholeTableInDanger?: boolean;
76
- resizingTableRef?: HTMLTableElement;
77
- resizingTableLocalId?: string;
78
- stickyHeader?: RowStickyState;
79
- dragMenuDirection?: TableDirection;
80
- dragMenuIndex?: number;
81
- isDragMenuOpen?: boolean;
82
- isSizeSelectorOpen?: boolean;
83
- sizeSelectorTargetRef?: HTMLElement;
84
- };
85
-
86
- export type TableSharedState = Pick<
87
- TablePluginState,
88
- 'isFullWidthModeEnabled' | 'wasFullWidthModeEnabled'
89
- >;
90
-
91
- export type AlignmentOptions = 'center' | 'align-start';
92
-
93
- export type InsertRowMethods =
94
- | INPUT_METHOD.CONTEXT_MENU
95
- | INPUT_METHOD.BUTTON
96
- | INPUT_METHOD.SHORTCUT
97
- | INPUT_METHOD.KEYBOARD
98
- | INPUT_METHOD.FLOATING_TB
99
- | INPUT_METHOD.TABLE_CONTEXT_MENU;
100
-
101
- export interface PluginConfig {
102
- advanced?: boolean;
103
- allowBackgroundColor?: boolean;
104
- allowColumnResizing?: boolean;
105
- allowTableResizing?: boolean;
106
- allowTableAlignment?: boolean;
107
- allowHeaderColumn?: boolean;
108
- allowHeaderRow?: boolean;
109
- allowMergeCells?: boolean;
110
- allowNumberColumn?: boolean;
111
- allowColumnSorting?: boolean;
112
- allowAddColumnWithCustomStep?: boolean;
113
- allowCollapse?: boolean;
114
- allowNestedTables?: boolean;
115
- isHeaderRowRequired?: boolean;
116
- /**
117
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-6877 Internal documentation for deprecation (no external access)}
118
- **/
119
- permittedLayouts?: PermittedLayoutsDescriptor;
120
- allowControls?: boolean;
121
- stickyHeaders?: boolean;
122
- allowCellOptionsInFloatingToolbar?: boolean;
123
- allowDistributeColumns?: boolean;
124
- }
125
-
126
- export type { ColumnResizingPluginState } from '@atlaskit/editor-common/types';
127
-
128
- /*
129
- * This type represents the start and end from a cell in a column,
130
- * for example, on this table the cell C1 will have
131
- * `left: 1` and `right: 3`.
132
- *
133
- * ```
134
- * left right
135
- * 1 3
136
- * | |
137
- * | |
138
- * | |
139
- * _______∨_____________∨_______
140
- * | | | |
141
- * | B1 | C1 | A1 |
142
- * |______|______ ______|______|
143
- * | | | |
144
- * | B2 | D1 | A2 |
145
- * |______ ______|______|______|
146
- * | | | |
147
- * | B3 | C2 | D2 |
148
- * |______|______|_____________|
149
- * ```
150
- *
151
- */
152
- export type CellColumnPositioning = Pick<Rect, 'right' | 'left'>;
153
- export interface CellHoverMeta {
154
- colIndex?: number;
155
- rowIndex?: number;
156
- }
157
- export interface WidthToWidest {
158
- [tableLocalId: string]: boolean;
159
- }
160
-
161
- export interface TablePluginState {
162
- editorHasFocus?: boolean;
163
- hoveredColumns: number[];
164
- hoveredRows: number[];
165
- hoveredCell: CellHoverMeta;
166
- pluginConfig: PluginConfig;
167
- isHeaderColumnEnabled: boolean;
168
- isHeaderRowEnabled: boolean;
169
- isNumberColumnEnabled?: boolean;
170
- // position of a cell PM node that has cursor
171
- targetCellPosition?: number;
172
- // controls need to be re-rendered when table content changes
173
- // e.g. when pressing enter inside of a cell, it creates a new p and we need to update row controls
174
- tableNode?: PmNode;
175
- tableRef?: HTMLTableElement;
176
- tablePos?: number;
177
- tableWrapperTarget?: HTMLElement;
178
- isContextualMenuOpen?: boolean;
179
- isInDanger?: boolean;
180
- isWholeTableInDanger?: boolean;
181
- insertColumnButtonIndex?: number;
182
- insertRowButtonIndex?: number;
183
- isFullWidthModeEnabled?: boolean;
184
- ordering?: TableColumnOrdering;
185
- isResizeHandleWidgetAdded?: boolean;
186
- resizeHandleRowIndex?: number;
187
- resizeHandleColumnIndex?: number;
188
- resizeHandleIncludeTooltip?: boolean;
189
- isKeyboardResize?: boolean;
190
- // for table wrap/collapse
191
- isTableCollapsed?: boolean; // is the current table already in an expand?
192
- canCollapseTable?: boolean; // enabled/disabled state of collapse option
193
- widthToWidest?: WidthToWidest; // is the current table set to the widest width regarding view port
194
-
195
- getIntl: () => IntlShape;
196
-
197
- wasFullWidthModeEnabled?: boolean;
198
- isDragAndDropEnabled?: boolean;
199
- isTableHovered?: boolean;
200
-
201
- // Currently isTableScalingEnabled is the same as options.isTableScalingEnabled from TablePluginOptions.
202
- // However, if you want to learn if tablePlugin is configured to enable Preserve Table Widths feature,
203
- // use options.isTableScalingEnabled and avoid using pluginState.isTableScalingEnabled or
204
- // const { isTableScalingEnabled } = getPluginState(state) for that purpose.
205
- isTableScalingEnabled?: boolean;
206
- isCellMenuOpenByKeyboard?: boolean;
207
- }
208
-
209
- export type TablePluginAction =
210
- | { type: 'SET_EDITOR_FOCUS'; data: { editorHasFocus: boolean } }
211
- | { type: 'TOGGLE_HEADER_ROW' }
212
- | { type: 'TOGGLE_HEADER_COLUMN' }
213
- | { type: 'SORT_TABLE'; data: { ordering: TableColumnOrdering } }
214
- | {
215
- type: 'SET_TABLE_REF';
216
- data: {
217
- tableRef?: HTMLTableElement;
218
- tableNode?: PmNode;
219
- tableWrapperTarget?: HTMLElement;
220
- isHeaderRowEnabled: boolean;
221
- isHeaderColumnEnabled: boolean;
222
- };
223
- }
224
- | {
225
- type: 'HOVER_ROWS';
226
- data: {
227
- decorationSet: DecorationSet;
228
- hoveredRows: number[];
229
- isInDanger?: boolean;
230
- };
231
- }
232
- | {
233
- type: 'HOVER_MERGED_CELLS';
234
- data: {
235
- decorationSet: DecorationSet;
236
- };
237
- }
238
- | {
239
- type: 'HOVER_COLUMNS';
240
- data: {
241
- decorationSet: DecorationSet;
242
- hoveredColumns: number[];
243
- isInDanger?: boolean;
244
- };
245
- }
246
- | {
247
- type: 'HOVER_TABLE';
248
- data: {
249
- decorationSet: DecorationSet;
250
- hoveredRows: number[];
251
- hoveredColumns: number[];
252
- isInDanger?: boolean;
253
- };
254
- }
255
- | {
256
- type: 'START_KEYBOARD_COLUMN_RESIZE';
257
- data: {
258
- decorationSet: DecorationSet;
259
- resizeHandleRowIndex: number;
260
- resizeHandleColumnIndex: number;
261
- resizeHandleIncludeTooltip: boolean;
262
- isKeyboardResize?: boolean;
263
- };
264
- }
265
- | {
266
- type: 'ADD_RESIZE_HANDLE_DECORATIONS';
267
- data: {
268
- decorationSet: DecorationSet;
269
- resizeHandleRowIndex: number;
270
- resizeHandleColumnIndex: number;
271
- resizeHandleIncludeTooltip: boolean;
272
- isKeyboardResize?: boolean;
273
- };
274
- }
275
- | {
276
- type: 'UPDATE_RESIZE_HANDLE_DECORATIONS';
277
- data: {
278
- decorationSet: DecorationSet;
279
- resizeHandleRowIndex: number | undefined;
280
- resizeHandleColumnIndex: number | undefined;
281
- resizeHandleIncludeTooltip: boolean | undefined;
282
- };
283
- }
284
- | {
285
- type: 'UPDATE_TABLE_WIDTH_TO_WIDEST';
286
- data: {
287
- widthToWidest: WidthToWidest | undefined;
288
- };
289
- }
290
- | {
291
- type: 'REMOVE_RESIZE_HANDLE_DECORATIONS';
292
- data: { decorationSet: DecorationSet };
293
- }
294
- | {
295
- type: 'STOP_KEYBOARD_COLUMN_RESIZE';
296
- data: { decorationSet: DecorationSet };
297
- }
298
- | { type: 'CLEAR_HOVER_SELECTION'; data: { decorationSet: DecorationSet } }
299
- | { type: 'SHOW_RESIZE_HANDLE_LINE'; data: { decorationSet: DecorationSet } }
300
- | { type: 'HIDE_RESIZE_HANDLE_LINE'; data: { decorationSet: DecorationSet } }
301
- | {
302
- type: 'HOVER_CELL';
303
- data: {
304
- hoveredCell: CellHoverMeta;
305
- };
306
- }
307
- | {
308
- type: 'TABLE_HOVERED';
309
- data: {
310
- isTableHovered: boolean;
311
- };
312
- }
313
- | { type: 'SET_TARGET_CELL_POSITION'; data: { targetCellPosition?: number } }
314
- | {
315
- type: 'SELECT_COLUMN';
316
- data: { targetCellPosition: number; decorationSet: DecorationSet };
317
- }
318
- | { type: 'SHOW_INSERT_ROW_BUTTON'; data: { insertRowButtonIndex: number } }
319
- | {
320
- type: 'SHOW_INSERT_COLUMN_BUTTON';
321
- data: { insertColumnButtonIndex: number };
322
- }
323
- | {
324
- type: 'HIDE_INSERT_COLUMN_OR_ROW_BUTTON';
325
- }
326
- | { type: 'TOGGLE_CONTEXTUAL_MENU' }
327
- | {
328
- type: 'SET_CELL_MENU_OPEN';
329
- data: {
330
- isCellMenuOpenByKeyboard: boolean;
331
- };
332
- };
333
-
334
- export type ColumnResizingPluginAction =
335
- | {
336
- type: 'SET_RESIZE_HANDLE_POSITION';
337
- data: { resizeHandlePos: number | null };
338
- }
339
- | { type: 'STOP_RESIZING' }
340
- | {
341
- type: 'SET_DRAGGING';
342
- data: { dragging: { startX: number; startWidth: number } | null };
343
- }
344
- | {
345
- type: 'SET_LAST_CLICK';
346
- data: { lastClick: { x: number; y: number; time: number } | null };
347
- };
348
-
349
- export enum TableDecorations {
350
- /** Classic controls */
351
- ALL_CONTROLS_HOVER = 'CONTROLS_HOVER',
352
- ROW_CONTROLS_HOVER = 'ROW_CONTROLS_HOVER',
353
- COLUMN_CONTROLS_HOVER = 'COLUMN_CONTROLS_HOVER',
354
- TABLE_CONTROLS_HOVER = 'TABLE_CONTROLS_HOVER',
355
- CELL_CONTROLS_HOVER = 'CELL_CONTROLS_HOVER',
356
-
357
- COLUMN_CONTROLS_DECORATIONS = 'COLUMN_CONTROLS_DECORATIONS',
358
- COLUMN_DROP_TARGET_DECORATIONS = 'COLUMN_DROP_TARGET_DECORATIONS',
359
- COLUMN_SELECTED = 'COLUMN_SELECTED',
360
- COLUMN_RESIZING_HANDLE = 'COLUMN_RESIZING_HANDLE',
361
- COLUMN_RESIZING_HANDLE_WIDGET = 'COLUMN_RESIZING_HANDLE_WIDGET',
362
- COLUMN_RESIZING_HANDLE_LINE = 'COLUMN_RESIZING_HANDLE_LINE',
363
-
364
- COLUMN_INSERT_LINE = 'COLUMN_INSERT_LINE',
365
- ROW_INSERT_LINE = 'ROW_INSERT_LINE',
366
-
367
- LAST_CELL_ELEMENT = 'LAST_CELL_ELEMENT',
368
- }
369
-
370
- export const TableCssClassName = {
371
- ...TableSharedCssClassName,
372
-
373
- /** Classic controls */
374
- COLUMN_CONTROLS: `${tablePrefixSelector}-column-controls`,
375
- COLUMN_CONTROLS_DECORATIONS: `${tablePrefixSelector}-column-controls-decoration`,
376
- COLUMN_SELECTED: `${tablePrefixSelector}-column__selected`,
377
-
378
- ROW_CONTROLS_WRAPPER: `${tablePrefixSelector}-row-controls-wrapper`,
379
- ROW_CONTROLS: `${tablePrefixSelector}-row-controls`,
380
- ROW_CONTROLS_INNER: `${tablePrefixSelector}-row-controls__inner`,
381
- ROW_CONTROLS_BUTTON_WRAP: `${tablePrefixSelector}-row-controls__button-wrap`,
382
- ROW_CONTROLS_BUTTON: `${tablePrefixSelector}-row-controls__button`,
383
-
384
- CONTROLS_BUTTON: `${tablePrefixSelector}-controls__button`,
385
- CONTROLS_BUTTON_ICON: `${tablePrefixSelector}-controls__button-icon`,
386
-
387
- CONTROLS_INSERT_BUTTON: `${tablePrefixSelector}-controls__insert-button`,
388
- CONTROLS_INSERT_BUTTON_INNER: `${tablePrefixSelector}-controls__insert-button-inner`,
389
- CONTROLS_INSERT_BUTTON_WRAP: `${tablePrefixSelector}-controls__insert-button-wrap`,
390
- CONTROLS_INSERT_LINE: `${tablePrefixSelector}-controls__insert-line`,
391
- CONTROLS_BUTTON_OVERLAY: `${tablePrefixSelector}-controls__button-overlay`,
392
-
393
- DRAG_CONTROLS_INSERT_BUTTON: `${tablePrefixSelector}-controls__drag-insert-button`,
394
- DRAG_CONTROLS_INSERT_BUTTON_INNER: `${tablePrefixSelector}-controls__drag-insert-button-inner`,
395
- DRAG_CONTROLS_INSERT_BUTTON_INNER_COLUMN: `${tablePrefixSelector}-controls__drag-insert-button-inner-column`,
396
- DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW: `${tablePrefixSelector}-controls__drag-insert-button-inner-row`,
397
- DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW_CHROMELESS: `${tablePrefixSelector}-controls__drag-insert-button-inner-row-chromeless`,
398
- DRAG_CONTROLS_INSERT_BUTTON_WRAP: `${tablePrefixSelector}-controls__drag-insert-button-wrap`,
399
-
400
- CONTROLS_INSERT_MARKER: `${tablePrefixSelector}-controls__insert-marker`,
401
- CONTROLS_INSERT_COLUMN: `${tablePrefixSelector}-controls__insert-column`,
402
- CONTROLS_INSERT_ROW: `${tablePrefixSelector}-controls__insert-row`,
403
- CONTROLS_DELETE_BUTTON_WRAP: `${tablePrefixSelector}-controls__delete-button-wrap`,
404
- CONTROLS_DELETE_BUTTON: `${tablePrefixSelector}-controls__delete-button`,
405
-
406
- CONTROLS_FLOATING_BUTTON_COLUMN: `${tablePrefixSelector}-controls-floating__button-column`,
407
- CONTROLS_FLOATING_BUTTON_ROW: `${tablePrefixSelector}-controls-floating__button-row`,
408
-
409
- CORNER_CONTROLS: `${tablePrefixSelector}-corner-controls`,
410
- CORNER_CONTROLS_INSERT_ROW_MARKER: `${tablePrefixSelector}-corner-controls__insert-row-marker`,
411
- CORNER_CONTROLS_INSERT_COLUMN_MARKER: `${tablePrefixSelector}-corner-controls__insert-column-marker`,
412
- CONTROLS_CORNER_BUTTON: `${tablePrefixSelector}-corner-button`,
413
-
414
- /** drag and drop controls */
415
- DRAG_ROW_CONTROLS_WRAPPER: `${tablePrefixSelector}-drag-row-controls-wrapper`,
416
- DRAG_ROW_CONTROLS: `${tablePrefixSelector}-drag-row-controls`,
417
- DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER: `${tablePrefixSelector}-drag-row-floating-insert-dot-wrapper`,
418
- DRAG_ROW_FLOATING_INSERT_DOT: `${tablePrefixSelector}-drag-row-floating-insert-dot`,
419
-
420
- DRAG_COLUMN_CONTROLS: `${tablePrefixSelector}-drag-column-controls`,
421
- DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER: `${tablePrefixSelector}-drag-columns-floating-insert-dot-wrapper`,
422
- DRAG_COLUMN_FLOATING_INSERT_DOT: `${tablePrefixSelector}-drag-columns-floating-insert-dot`,
423
-
424
- DRAG_COLUMN_CONTROLS_WRAPPER: `${tablePrefixSelector}-col-controls-wrapper`,
425
- DRAG_COLUMN_DROP_TARGET_CONTROLS: `${tablePrefixSelector}-col-drop-target-controls`,
426
- DRAG_COLUMN_CONTROLS_INNER: `${tablePrefixSelector}-col-controls__inner`,
427
-
428
- DRAG_HANDLE_BUTTON_CONTAINER: `${tablePrefixSelector}-drag-handle-button-container`,
429
- DRAG_HANDLE_BUTTON_CLICKABLE_ZONE: `${tablePrefixSelector}-drag-handle-button-clickable-zone`,
430
-
431
- DRAG_CORNER_BUTTON: `${tablePrefixSelector}-drag-corner-button`,
432
- DRAG_CORNER_BUTTON_INNER: `${tablePrefixSelector}-drag-corner-button-inner`,
433
-
434
- /** nested tables classes */
435
- NESTED_TABLE_WITH_CONTROLS: `${tablePrefixSelector}-nested-table-with-controls`,
436
-
437
- /** disabled classes */
438
- DRAG_HANDLE_DISABLED: `${tablePrefixSelector}-drag-handle-disabled`,
439
-
440
- /** minimised handle class */
441
- DRAG_HANDLE_MINIMISED: `${tablePrefixSelector}-drag-handle-minimised`,
442
-
443
- DRAG_SUBMENU: `${tablePrefixSelector}-drag-submenu`,
444
- DRAG_SUBMENU_ICON: `${tablePrefixSelector}-drag-submenu-icon`,
445
-
446
- /** Other classes */
447
- NUMBERED_COLUMN: `${tablePrefixSelector}-numbered-column`,
448
- NUMBERED_COLUMN_BUTTON: `${tablePrefixSelector}-numbered-column__button`,
449
- NUMBERED_COLUMN_BUTTON_DISABLED: `${tablePrefixSelector}-numbered-column__button-disabled`,
450
-
451
- HOVERED_COLUMN: `${tablePrefixSelector}-hovered-column`,
452
- HOVERED_ROW: `${tablePrefixSelector}-hovered-row`,
453
- HOVERED_TABLE: `${tablePrefixSelector}-hovered-table`,
454
- HOVERED_NO_HIGHLIGHT: `${tablePrefixSelector}-hovered-no-highlight`,
455
- HOVERED_CELL: `${tablePrefixSelector}-hovered-cell`,
456
- HOVERED_CELL_IN_DANGER: 'danger',
457
- HOVERED_CELL_ACTIVE: 'active',
458
- HOVERED_CELL_WARNING: `${tablePrefixSelector}-hovered-cell__warning`,
459
- HOVERED_DELETE_BUTTON: `${tablePrefixSelector}-hovered-delete-button`,
460
- WITH_CONTROLS: `${tablePrefixSelector}-with-controls`,
461
- RESIZING_PLUGIN: `${tablePrefixSelector}-resizing-plugin`,
462
- RESIZE_CURSOR: `${tablePrefixSelector}-resize-cursor`,
463
- IS_RESIZING: `${tablePrefixSelector}-is-resizing`,
464
-
465
- RESIZE_HANDLE_DECORATION: `${tablePrefixSelector}-resize-decoration`,
466
-
467
- CONTEXTUAL_SUBMENU: `${tablePrefixSelector}-contextual-submenu`,
468
- CONTEXTUAL_MENU_BUTTON_WRAP: `${tablePrefixSelector}-contextual-menu-button-wrap`,
469
- CONTEXTUAL_MENU_BUTTON: `${tablePrefixSelector}-contextual-menu-button`,
470
- CONTEXTUAL_MENU_BUTTON_FIXED: `${tablePrefixSelector}-contextual-menu-button-fixed`,
471
- CONTEXTUAL_MENU_ICON: `${tablePrefixSelector}-contextual-submenu-icon`,
472
- CONTEXTUAL_MENU_ICON_SMALL: `${tablePrefixSelector}-contextual-submenu-icon-small`,
473
-
474
- // come from prosemirror-table
475
- SELECTED_CELL: 'selectedCell',
476
-
477
- // defined in ReactNodeView based on PM node name
478
- NODEVIEW_WRAPPER: 'tableView-content-wrap',
479
-
480
- TABLE_SELECTED: `${tablePrefixSelector}-table__selected`,
481
- TABLE_CELL: tableCellSelector,
482
- TABLE_HEADER_CELL: tableHeaderSelector,
483
- TABLE_STICKY: `${tablePrefixSelector}-sticky`,
484
- TABLE_CHROMELESS: `${tablePrefixSelector}-chromeless`,
485
-
486
- TOP_LEFT_CELL: 'table > tbody > tr:nth-child(2) > td:nth-child(1)',
487
- LAST_ITEM_IN_CELL: `${tablePrefixSelector}-last-item-in-cell`,
488
-
489
- WITH_COLUMN_INSERT_LINE: `${tablePrefixSelector}-column-insert-line`,
490
- WITH_COLUMN_INSERT_LINE_INACTIVE: `${tablePrefixSelector}-column-insert-line__inactive`,
491
- WITH_FIRST_COLUMN_INSERT_LINE: `${tablePrefixSelector}-first-column-insert-line`,
492
- WITH_FIRST_COLUMN_INSERT_LINE_INACTIVE: `${tablePrefixSelector}-first-column-insert-line__inactive`,
493
-
494
- WITH_LAST_COLUMN_INSERT_LINE: `${tablePrefixSelector}-last-column-insert-line`,
495
- WITH_LAST_COLUMN_INSERT_LINE_INACTIVE: `${tablePrefixSelector}-last-column-insert-line__inactive`,
496
-
497
- WITH_RESIZE_LINE: `${tablePrefixSelector}-column-resize-line`,
498
- WITH_RESIZE_LINE_LAST_COLUMN: `${tablePrefixSelector}-column-resize-line-last-column`,
499
-
500
- WITH_DRAG_RESIZE_LINE: `${tablePrefixSelector}-drag-column-resize-line`,
501
- WITH_DRAG_RESIZE_LINE_LAST_COLUMN: `${tablePrefixSelector}-drag-column-resize-line-last-column`,
502
-
503
- WITH_ROW_INSERT_LINE: `${tablePrefixSelector}-row-insert-line`,
504
- WITH_ROW_INSERT_LINE_INACTIVE: `${tablePrefixSelector}-row-insert-line__inactive`,
505
- WITH_LAST_ROW_INSERT_LINE: `${tablePrefixSelector}-last-row-insert-line`,
506
- WITH_LAST_ROW_INSERT_LINE_INACTIVE: `${tablePrefixSelector}-last-row-insert-line__inactive`,
507
- };
508
-
509
- export interface ToolbarMenuConfig {
510
- allowHeaderRow?: boolean;
511
- allowHeaderColumn?: boolean;
512
- allowNumberColumn?: boolean;
513
- allowCollapse?: boolean;
514
- }
515
-
516
- export interface ToolbarMenuState {
517
- isHeaderRowEnabled?: boolean;
518
- isHeaderColumnEnabled?: boolean;
519
- isNumberColumnEnabled?: boolean;
520
- isTableCollapsed?: boolean;
521
- canCollapseTable?: boolean;
522
- isDragAndDropEnabled?: boolean;
523
- }
524
-
525
- export interface ToolbarMenuContext {
526
- formatMessage: IntlShape['formatMessage'];
527
- }
528
-
529
- export enum ShadowEvent {
530
- SHOW_BEFORE_SHADOW = 'showBeforeShadow',
531
- SHOW_AFTER_SHADOW = 'showAfterShadow',
532
- }
533
-
534
- export type ReportInvalidNodeAttrs = (invalidNodeAttrs: InvalidNodeAttr) => void;
535
-
536
- export type InvalidNodeAttr = {
537
- nodeType: string;
538
- attribute: string;
539
- reason: string;
540
- spanValue: number;
541
- tableLocalId: string;
542
- };
543
-
544
- export type TableDirection = 'row' | 'column';
545
-
546
- /**
547
- * Drag and Drop interfaces
548
- */
549
- export type DraggableType = 'table-row' | 'table-column';
550
- export type DraggableBehaviour = 'move' | 'clone';
551
-
552
- export interface DraggableSourceData extends Record<string, unknown> {
553
- type: DraggableType;
554
- localId: string;
555
- indexes: number[];
556
- }
557
-
558
- export interface DraggableTargetData extends Record<string | symbol, unknown> {
559
- type: DraggableType;
560
- localId: string;
561
- targetIndex: number;
562
- }
563
-
564
- export interface DraggableData {
565
- sourceType: DraggableType;
566
- sourceLocalId: string;
567
- sourceIndexes: number[];
568
- targetType: DraggableType;
569
- targetLocalId: string;
570
- targetIndex: number;
571
- targetAdjustedIndex: number;
572
- targetClosestEdge: Edge;
573
- /**
574
- * The target direction identifies where relative to the target index is the item being dropped. A value of 'start' would
575
- * mean that the item is being inserted before the index, and 'end would be after.
576
- */
577
- targetDirection: 'start' | 'end';
578
- /**
579
- * This represents a hollistic movement direction; a value of 1 means the source->target index would shift in a positive direction.
580
- * A value of 0 indicates that the target index is inside the the source indexes.
581
- */
582
- direction: 1 | -1 | 0;
583
- behaviour: DraggableBehaviour;
584
- }
585
-
586
- export type HandleTypes = 'hover' | 'selected';
587
-
588
- export interface MessageDescriptor {
589
- id: string;
590
- description: string;
591
- defaultMessage: string;
592
- }