@atlaskit/editor-plugin-table 7.16.8 → 7.16.9

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 (121) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/nodeviews/ExternalDropTargets.js +4 -0
  3. package/dist/cjs/nodeviews/TableComponent.js +28 -5
  4. package/dist/cjs/nodeviews/TableContainer.js +32 -11
  5. package/dist/cjs/toolbar.js +17 -7
  6. package/dist/cjs/ui/ColumnResizeWidget/index.js +2 -0
  7. package/dist/cjs/ui/DragHandle/index.js +10 -3
  8. package/dist/cjs/ui/DragPreview/index.js +1 -0
  9. package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +12 -1
  10. package/dist/cjs/ui/FloatingContextualButton/index.js +3 -1
  11. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +7 -2
  12. package/dist/cjs/ui/FloatingDeleteButton/DeleteButton.js +7 -2
  13. package/dist/cjs/ui/FloatingDeleteButton/index.js +2 -0
  14. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +7 -2
  15. package/dist/cjs/ui/FloatingDragMenu/DropdownMenu.js +61 -57
  16. package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +36 -14
  17. package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +22 -4
  18. package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +2 -0
  19. package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
  20. package/dist/cjs/ui/TableFloatingColumnControls/index.js +3 -1
  21. package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +12 -3
  22. package/dist/cjs/ui/TableFloatingControls/CornerControls/DragCornerControls.js +2 -0
  23. package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +13 -4
  24. package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +50 -43
  25. package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +16 -2
  26. package/dist/cjs/ui/TableFloatingControls/RowDropTarget/index.js +3 -1
  27. package/dist/cjs/ui/TableFloatingControls/index.js +80 -76
  28. package/dist/cjs/ui/icons/DragHandleDisabledIcon.js +3 -1
  29. package/dist/cjs/ui/icons/DragInMotionIcon.js +3 -1
  30. package/dist/cjs/ui/icons/MinimisedHandle.js +1 -0
  31. package/dist/es2019/nodeviews/ExternalDropTargets.js +4 -0
  32. package/dist/es2019/nodeviews/TableComponent.js +28 -5
  33. package/dist/es2019/nodeviews/TableContainer.js +32 -11
  34. package/dist/es2019/toolbar.js +13 -3
  35. package/dist/es2019/ui/ColumnResizeWidget/index.js +2 -0
  36. package/dist/es2019/ui/DragHandle/index.js +10 -3
  37. package/dist/es2019/ui/DragPreview/index.js +1 -0
  38. package/dist/es2019/ui/FloatingContextualButton/FixedButton.js +12 -1
  39. package/dist/es2019/ui/FloatingContextualButton/index.js +3 -1
  40. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +7 -2
  41. package/dist/es2019/ui/FloatingDeleteButton/DeleteButton.js +7 -2
  42. package/dist/es2019/ui/FloatingDeleteButton/index.js +2 -0
  43. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +7 -2
  44. package/dist/es2019/ui/FloatingDragMenu/DropdownMenu.js +56 -52
  45. package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +36 -14
  46. package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +22 -4
  47. package/dist/es2019/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +2 -0
  48. package/dist/es2019/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
  49. package/dist/es2019/ui/TableFloatingColumnControls/index.js +3 -1
  50. package/dist/es2019/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +12 -3
  51. package/dist/es2019/ui/TableFloatingControls/CornerControls/DragCornerControls.js +2 -0
  52. package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +13 -4
  53. package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +47 -40
  54. package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +16 -2
  55. package/dist/es2019/ui/TableFloatingControls/RowDropTarget/index.js +3 -1
  56. package/dist/es2019/ui/TableFloatingControls/index.js +78 -74
  57. package/dist/es2019/ui/icons/DragHandleDisabledIcon.js +3 -1
  58. package/dist/es2019/ui/icons/DragInMotionIcon.js +3 -1
  59. package/dist/es2019/ui/icons/MinimisedHandle.js +1 -0
  60. package/dist/esm/nodeviews/ExternalDropTargets.js +4 -0
  61. package/dist/esm/nodeviews/TableComponent.js +28 -5
  62. package/dist/esm/nodeviews/TableContainer.js +32 -11
  63. package/dist/esm/toolbar.js +16 -4
  64. package/dist/esm/ui/ColumnResizeWidget/index.js +2 -0
  65. package/dist/esm/ui/DragHandle/index.js +10 -3
  66. package/dist/esm/ui/DragPreview/index.js +1 -0
  67. package/dist/esm/ui/FloatingContextualButton/FixedButton.js +12 -1
  68. package/dist/esm/ui/FloatingContextualButton/index.js +3 -1
  69. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +7 -2
  70. package/dist/esm/ui/FloatingDeleteButton/DeleteButton.js +7 -2
  71. package/dist/esm/ui/FloatingDeleteButton/index.js +2 -0
  72. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +7 -2
  73. package/dist/esm/ui/FloatingDragMenu/DropdownMenu.js +61 -57
  74. package/dist/esm/ui/FloatingInsertButton/InsertButton.js +36 -14
  75. package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +22 -4
  76. package/dist/esm/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +2 -0
  77. package/dist/esm/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
  78. package/dist/esm/ui/TableFloatingColumnControls/index.js +3 -1
  79. package/dist/esm/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +12 -3
  80. package/dist/esm/ui/TableFloatingControls/CornerControls/DragCornerControls.js +2 -0
  81. package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +13 -4
  82. package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +50 -43
  83. package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +16 -2
  84. package/dist/esm/ui/TableFloatingControls/RowDropTarget/index.js +3 -1
  85. package/dist/esm/ui/TableFloatingControls/index.js +80 -76
  86. package/dist/esm/ui/icons/DragHandleDisabledIcon.js +3 -1
  87. package/dist/esm/ui/icons/DragInMotionIcon.js +3 -1
  88. package/dist/esm/ui/icons/MinimisedHandle.js +1 -0
  89. package/dist/types/toolbar.d.ts +2 -1
  90. package/dist/types-ts4.5/toolbar.d.ts +2 -1
  91. package/docs/0-intro.tsx +1 -0
  92. package/package.json +1 -1
  93. package/src/nodeviews/ExternalDropTargets.tsx +4 -0
  94. package/src/nodeviews/TableComponent.tsx +18 -0
  95. package/src/nodeviews/TableContainer.tsx +12 -0
  96. package/src/toolbar.tsx +20 -1
  97. package/src/ui/ColumnResizeWidget/index.tsx +2 -0
  98. package/src/ui/DragHandle/index.tsx +3 -0
  99. package/src/ui/DragPreview/index.tsx +1 -0
  100. package/src/ui/FloatingContextualButton/FixedButton.tsx +10 -0
  101. package/src/ui/FloatingContextualButton/index.tsx +1 -0
  102. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +3 -0
  103. package/src/ui/FloatingDeleteButton/DeleteButton.tsx +4 -0
  104. package/src/ui/FloatingDeleteButton/index.tsx +2 -0
  105. package/src/ui/FloatingDragMenu/DragMenu.tsx +3 -0
  106. package/src/ui/FloatingDragMenu/DropdownMenu.tsx +3 -0
  107. package/src/ui/FloatingInsertButton/InsertButton.tsx +14 -0
  108. package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +16 -1
  109. package/src/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +2 -0
  110. package/src/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +2 -0
  111. package/src/ui/TableFloatingColumnControls/index.tsx +1 -0
  112. package/src/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +6 -0
  113. package/src/ui/TableFloatingControls/CornerControls/DragCornerControls.tsx +4 -0
  114. package/src/ui/TableFloatingControls/NumberColumn/index.tsx +5 -0
  115. package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +5 -0
  116. package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +15 -1
  117. package/src/ui/TableFloatingControls/RowDropTarget/index.tsx +1 -0
  118. package/src/ui/TableFloatingControls/index.tsx +1 -0
  119. package/src/ui/icons/DragHandleDisabledIcon.tsx +1 -0
  120. package/src/ui/icons/DragInMotionIcon.tsx +1 -0
  121. package/src/ui/icons/MinimisedHandle.tsx +1 -0
@@ -70,7 +70,9 @@ var RowDropTarget = function RowDropTarget(_ref) {
70
70
  });
71
71
  }, [index, localId]);
72
72
  return /*#__PURE__*/React.createElement("div", {
73
- ref: dropTargetRef,
73
+ ref: dropTargetRef
74
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
75
+ ,
74
76
  style: style,
75
77
  "data-drop-target-index": index,
76
78
  "data-drop-target-localid": localId,
@@ -66,81 +66,85 @@ export var TableFloatingControls = function TableFloatingControls(_ref) {
66
66
  }
67
67
  var stickyTop = stickyHeader && stickyHeader.sticky && hasHeaderRow ? stickyHeader.top : undefined;
68
68
  var wrapperClassName = isDragAndDropEnabled ? ClassName.DRAG_ROW_CONTROLS_WRAPPER : ClassName.ROW_CONTROLS_WRAPPER;
69
- return /*#__PURE__*/React.createElement("div", {
70
- className: wrapperClassName
71
- }, /*#__PURE__*/React.createElement("div", {
72
- onMouseDown: function onMouseDown(e) {
73
- return !isDragAndDropEnabled && e.preventDefault();
74
- }
75
- }, isNumberColumnEnabled ? /*#__PURE__*/React.createElement(NumberColumn, {
76
- editorView: editorView,
77
- hoverRows: _hoverRows,
78
- tableRef: tableRef,
79
- tableActive: tableActive,
80
- hoveredRows: hoveredRows,
81
- hasHeaderRow: hasHeaderRow,
82
- isInDanger: isInDanger,
83
- isResizing: isResizing,
84
- selectRow: _selectRow,
85
- updateCellHoverLocation: updateCellHoverLocation,
86
- stickyTop: stickyTop,
87
- isDragAndDropEnabled: isDragAndDropEnabled
88
- }) : null, tableActive && /*#__PURE__*/React.createElement(React.Fragment, null, isDragAndDropEnabled ? /*#__PURE__*/React.createElement(React.Fragment, null, getBooleanFF('platform.editor.table.use-shared-state-hook') ? /*#__PURE__*/React.createElement(DragCornerControlsWithSelection, {
89
- editorView: editorView,
90
- tableRef: tableRef,
91
- isInDanger: isInDanger,
92
- isResizing: isResizing,
93
- api: api
94
- }) : /*#__PURE__*/React.createElement(DragCornerControls, {
95
- editorView: editorView,
96
- tableRef: tableRef,
97
- isInDanger: isInDanger,
98
- isResizing: isResizing
99
- }), /*#__PURE__*/React.createElement(DragControls, {
100
- tableRef: tableRef,
101
- tableNode: tableNode,
102
- hoveredCell: hoveredCell,
103
- isTableHovered: isTableHovered,
104
- editorView: editorView,
105
- tableActive: tableActive,
106
- isInDanger: isInDanger,
107
- isResizing: isResizing,
108
- tableWidth: tableWrapperWidth,
109
- hoverRows: _hoverRows,
110
- selectRow: _selectRow,
111
- selectRows: _selectRows,
112
- updateCellHoverLocation: updateCellHoverLocation
113
- })) : getBooleanFF('platform.editor.table.use-shared-state-hook') ? /*#__PURE__*/React.createElement(FloatingControlsWithSelection, {
114
- editorView: editorView,
115
- tableRef: tableRef,
116
- isInDanger: isInDanger,
117
- isResizing: isResizing,
118
- isHeaderRowEnabled: isHeaderRowEnabled,
119
- isHeaderColumnEnabled: isHeaderColumnEnabled,
120
- hoveredRows: hoveredRows,
121
- stickyTop: tableActive ? stickyTop : undefined,
122
- tableActive: tableActive,
123
- hoverRows: _hoverRows,
124
- selectRow: _selectRow,
125
- api: api
126
- }) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CornerControls, {
127
- editorView: editorView,
128
- tableRef: tableRef,
129
- isInDanger: isInDanger,
130
- isResizing: isResizing,
131
- isHeaderRowEnabled: isHeaderRowEnabled,
132
- isHeaderColumnEnabled: isHeaderColumnEnabled,
133
- hoveredRows: hoveredRows,
134
- stickyTop: tableActive ? stickyTop : undefined
135
- }), /*#__PURE__*/React.createElement(RowControls, {
136
- editorView: editorView,
137
- tableRef: tableRef,
138
- hoverRows: _hoverRows,
139
- hoveredRows: hoveredRows,
140
- isInDanger: isInDanger,
141
- isResizing: isResizing,
142
- selectRow: _selectRow,
143
- stickyTop: tableActive ? stickyTop : undefined
144
- })))));
69
+ return (
70
+ /*#__PURE__*/
71
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
72
+ React.createElement("div", {
73
+ className: wrapperClassName
74
+ }, /*#__PURE__*/React.createElement("div", {
75
+ onMouseDown: function onMouseDown(e) {
76
+ return !isDragAndDropEnabled && e.preventDefault();
77
+ }
78
+ }, isNumberColumnEnabled ? /*#__PURE__*/React.createElement(NumberColumn, {
79
+ editorView: editorView,
80
+ hoverRows: _hoverRows,
81
+ tableRef: tableRef,
82
+ tableActive: tableActive,
83
+ hoveredRows: hoveredRows,
84
+ hasHeaderRow: hasHeaderRow,
85
+ isInDanger: isInDanger,
86
+ isResizing: isResizing,
87
+ selectRow: _selectRow,
88
+ updateCellHoverLocation: updateCellHoverLocation,
89
+ stickyTop: stickyTop,
90
+ isDragAndDropEnabled: isDragAndDropEnabled
91
+ }) : null, tableActive && /*#__PURE__*/React.createElement(React.Fragment, null, isDragAndDropEnabled ? /*#__PURE__*/React.createElement(React.Fragment, null, getBooleanFF('platform.editor.table.use-shared-state-hook') ? /*#__PURE__*/React.createElement(DragCornerControlsWithSelection, {
92
+ editorView: editorView,
93
+ tableRef: tableRef,
94
+ isInDanger: isInDanger,
95
+ isResizing: isResizing,
96
+ api: api
97
+ }) : /*#__PURE__*/React.createElement(DragCornerControls, {
98
+ editorView: editorView,
99
+ tableRef: tableRef,
100
+ isInDanger: isInDanger,
101
+ isResizing: isResizing
102
+ }), /*#__PURE__*/React.createElement(DragControls, {
103
+ tableRef: tableRef,
104
+ tableNode: tableNode,
105
+ hoveredCell: hoveredCell,
106
+ isTableHovered: isTableHovered,
107
+ editorView: editorView,
108
+ tableActive: tableActive,
109
+ isInDanger: isInDanger,
110
+ isResizing: isResizing,
111
+ tableWidth: tableWrapperWidth,
112
+ hoverRows: _hoverRows,
113
+ selectRow: _selectRow,
114
+ selectRows: _selectRows,
115
+ updateCellHoverLocation: updateCellHoverLocation
116
+ })) : getBooleanFF('platform.editor.table.use-shared-state-hook') ? /*#__PURE__*/React.createElement(FloatingControlsWithSelection, {
117
+ editorView: editorView,
118
+ tableRef: tableRef,
119
+ isInDanger: isInDanger,
120
+ isResizing: isResizing,
121
+ isHeaderRowEnabled: isHeaderRowEnabled,
122
+ isHeaderColumnEnabled: isHeaderColumnEnabled,
123
+ hoveredRows: hoveredRows,
124
+ stickyTop: tableActive ? stickyTop : undefined,
125
+ tableActive: tableActive,
126
+ hoverRows: _hoverRows,
127
+ selectRow: _selectRow,
128
+ api: api
129
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CornerControls, {
130
+ editorView: editorView,
131
+ tableRef: tableRef,
132
+ isInDanger: isInDanger,
133
+ isResizing: isResizing,
134
+ isHeaderRowEnabled: isHeaderRowEnabled,
135
+ isHeaderColumnEnabled: isHeaderColumnEnabled,
136
+ hoveredRows: hoveredRows,
137
+ stickyTop: tableActive ? stickyTop : undefined
138
+ }), /*#__PURE__*/React.createElement(RowControls, {
139
+ editorView: editorView,
140
+ tableRef: tableRef,
141
+ hoverRows: _hoverRows,
142
+ hoveredRows: hoveredRows,
143
+ isInDanger: isInDanger,
144
+ isResizing: isResizing,
145
+ selectRow: _selectRow,
146
+ stickyTop: tableActive ? stickyTop : undefined
147
+ })))))
148
+ );
145
149
  };
146
150
  export default TableFloatingControls;
@@ -6,7 +6,9 @@ export var DragHandleDisabledIcon = function DragHandleDisabledIcon(_ref) {
6
6
  height: "16",
7
7
  viewBox: "0 0 24 16",
8
8
  fill: "none",
9
- xmlns: "http://www.w3.org/2000/svg",
9
+ xmlns: "http://www.w3.org/2000/svg"
10
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
11
+ ,
10
12
  style: style,
11
13
  "data-testid": "drag-icon-disabled"
12
14
  }, /*#__PURE__*/React.createElement("rect", {
@@ -6,7 +6,9 @@ export var DragInMotionIcon = function DragInMotionIcon(_ref) {
6
6
  height: "20",
7
7
  viewBox: "0 0 28 20",
8
8
  fill: "none",
9
- xmlns: "http://www.w3.org/2000/svg",
9
+ xmlns: "http://www.w3.org/2000/svg"
10
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
11
+ ,
10
12
  style: style
11
13
  }, /*#__PURE__*/React.createElement("rect", {
12
14
  x: "1",
@@ -7,6 +7,7 @@ export var MinimisedHandleIcon = function MinimisedHandleIcon() {
7
7
  height: "5",
8
8
  fill: "none"
9
9
  }, /*#__PURE__*/React.createElement("rect", {
10
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
10
11
  className: ClassName.DRAG_HANDLE_MINIMISED,
11
12
  width: "24",
12
13
  height: "5",
@@ -19,6 +19,7 @@ type AlignmentIcon = {
19
19
  value: AlignmentOptions;
20
20
  icon: React.ComponentClass<any>;
21
21
  };
22
- export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Array<FloatingToolbarDropdown<Command>>;
22
+ export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorContainerWidth: GetEditorContainerWidth) => Array<FloatingToolbarDropdown<Command>>;
23
23
  export declare const getSelectedAlignmentIcon: (alignmentIcons: AlignmentIcon[], selectedNode: PMNode) => AlignmentIcon | undefined;
24
+ export declare const isLayoutOptionDisabled: (selectedNode: PMNode, getEditorContainerWidth: GetEditorContainerWidth) => boolean;
24
25
  export {};
@@ -19,6 +19,7 @@ type AlignmentIcon = {
19
19
  value: AlignmentOptions;
20
20
  icon: React.ComponentClass<any>;
21
21
  };
22
- export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Array<FloatingToolbarDropdown<Command>>;
22
+ export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorContainerWidth: GetEditorContainerWidth) => Array<FloatingToolbarDropdown<Command>>;
23
23
  export declare const getSelectedAlignmentIcon: (alignmentIcons: AlignmentIcon[], selectedNode: PMNode) => AlignmentIcon | undefined;
24
+ export declare const isLayoutOptionDisabled: (selectedNode: PMNode, getEditorContainerWidth: GetEditorContainerWidth) => boolean;
24
25
  export {};
package/docs/0-intro.tsx CHANGED
@@ -13,6 +13,7 @@ ${createEditorUseOnlyNotice('Editor Plugin Table', [
13
13
 
14
14
 
15
15
  ${(
16
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
16
17
  <div style={{ marginTop: token('space.100', '8px') }}>
17
18
  <AtlassianInternalWarning />
18
19
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "7.16.8",
3
+ "version": "7.16.9",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -54,10 +54,13 @@ export const ExternalDropTargets = ({
54
54
  <div
55
55
  style={{
56
56
  width: getTableWrapperWidth(),
57
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
57
58
  overflow: 'hidden',
59
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
58
60
  position: 'absolute',
59
61
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
60
62
  top: `-${dropTargetExtendedWidth - tableMarginTop}px`,
63
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
61
64
  pointerEvents: 'auto',
62
65
  zIndex: `${dropTargetsZIndex}`,
63
66
  }}
@@ -65,6 +68,7 @@ export const ExternalDropTargets = ({
65
68
  >
66
69
  <div
67
70
  style={{
71
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
68
72
  display: 'flex',
69
73
  // move drop targets based on table wrapper scroll
70
74
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
@@ -804,6 +804,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
804
804
 
805
805
  return (
806
806
  <TableContainer
807
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
807
808
  className={classnames(ClassName.TABLE_CONTAINER, {
808
809
  [ClassName.WITH_CONTROLS]: allowControls && tableActive,
809
810
  [ClassName.TABLE_STICKY]: this.state.stickyHeader && hasHeaderRow,
@@ -825,11 +826,13 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
825
826
  isTableAlignmentEnabled={isTableAlignmentEnabled}
826
827
  >
827
828
  <div
829
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
828
830
  className={ClassName.TABLE_STICKY_SENTINEL_TOP}
829
831
  data-testid="sticky-sentinel-top"
830
832
  />
831
833
  {stickyScrollbar && (
832
834
  <div
835
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
833
836
  className={ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP}
834
837
  data-testid="sticky-scrollbar-sentinel-top"
835
838
  />
@@ -850,11 +853,14 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
850
853
  )}
851
854
  <div
852
855
  contentEditable={false}
856
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
853
857
  style={shadowStyle(showBeforeShadow)}
858
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
854
859
  className={ClassName.TABLE_LEFT_SHADOW}
855
860
  />
856
861
  {this.state.stickyHeader && (
857
862
  <div
863
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
858
864
  className={`${ClassName.TABLE_LEFT_SHADOW} ${ClassName.TABLE_STICKY_SHADOW}`}
859
865
  style={{
860
866
  visibility:
@@ -867,6 +873,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
867
873
  />
868
874
  )}
869
875
  <div
876
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
870
877
  className={classnames(ClassName.TABLE_NODE_WRAPPER)}
871
878
  ref={(elem) => {
872
879
  this.wrapper = elem;
@@ -885,9 +892,12 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
885
892
  </div>
886
893
  {stickyScrollbar && (
887
894
  <div
895
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
888
896
  className={ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER}
889
897
  style={{
898
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
890
899
  height: token('space.250', '20px'), // MAX_BROWSER_SCROLLBAR_HEIGHT
900
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
891
901
  display: 'none',
892
902
  // prevent unwanted scroll during table resize without removing scrollbar container from the dom
893
903
  width: isResizing ? token('space.0', '0px') : '100%',
@@ -896,6 +906,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
896
906
  <div
897
907
  style={{
898
908
  width: tableRef?.clientWidth,
909
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
899
910
  height: '100%',
900
911
  }}
901
912
  ></div>
@@ -903,17 +914,22 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
903
914
  )}
904
915
  <div
905
916
  contentEditable={false}
917
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
906
918
  style={shadowStyle(showAfterShadow)}
919
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
907
920
  className={ClassName.TABLE_RIGHT_SHADOW}
908
921
  />
909
922
  {this.state.stickyHeader && (
910
923
  <div
911
924
  style={{
925
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
912
926
  position: 'absolute',
927
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
913
928
  right: token('space.400', '32px'), // tableOverflowShadowWidthWide
914
929
  }}
915
930
  >
916
931
  <div
932
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
917
933
  className={`${ClassName.TABLE_RIGHT_SHADOW} ${ClassName.TABLE_STICKY_SHADOW}`}
918
934
  style={{
919
935
  visibility:
@@ -927,11 +943,13 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
927
943
  </div>
928
944
  )}
929
945
  <div
946
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
930
947
  className={ClassName.TABLE_STICKY_SENTINEL_BOTTOM}
931
948
  data-testid="sticky-sentinel-bottom"
932
949
  />
933
950
  {stickyScrollbar && (
934
951
  <div
952
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
935
953
  className={ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM}
936
954
  data-testid="sticky-scrollbar-sentinel-bottom"
937
955
  />
@@ -45,7 +45,9 @@ export const InnerContainer = forwardRef<
45
45
  return (
46
46
  <div
47
47
  ref={ref}
48
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
48
49
  style={style}
50
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
49
51
  className={className}
50
52
  data-number-column={node.attrs.isNumberColumnEnabled}
51
53
  data-layout={node.attrs.layout}
@@ -75,6 +77,7 @@ const AlignmentTableContainer = ({
75
77
  }, [alignment]);
76
78
 
77
79
  return (
80
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
78
81
  <div data-testid="table-alignment-container" style={style}>
79
82
  {children}
80
83
  </div>
@@ -93,7 +96,9 @@ const AlignmentTableContainerWrapper = ({
93
96
  <div
94
97
  data-testid="table-alignment-container"
95
98
  style={{
99
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
96
100
  display: 'flex',
101
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
97
102
  justifyContent: 'center',
98
103
  }}
99
104
  >
@@ -280,19 +285,23 @@ export const ResizableTableContainer = React.memo(
280
285
  : 'auto',
281
286
  position: isLivePageViewMode ? 'relative' : 'unset',
282
287
  }}
288
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
283
289
  className={ClassName.TABLE_RESIZER_CONTAINER}
284
290
  ref={containerRef}
285
291
  >
286
292
  {isLivePageViewMode ? (
287
293
  <InnerContainer
294
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
288
295
  className={className}
289
296
  node={node}
297
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
290
298
  style={{ width: 'inherit' }}
291
299
  >
292
300
  {children}
293
301
  </InnerContainer>
294
302
  ) : (
295
303
  <TableResizer {...tableResizerProps}>
304
+ {/* eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766 */}
296
305
  <InnerContainer className={className} node={node}>
297
306
  {children}
298
307
  </InnerContainer>
@@ -342,6 +351,7 @@ export const TableContainer = ({
342
351
  if (isTableResizingEnabled && !isNested) {
343
352
  return (
344
353
  <ResizableTableContainer
354
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
345
355
  className={className}
346
356
  node={node}
347
357
  containerWidth={editorWidth!}
@@ -364,10 +374,12 @@ export const TableContainer = ({
364
374
  return (
365
375
  <InnerContainer
366
376
  node={node}
377
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
367
378
  className={classNames(className, {
368
379
  'less-padding': editorWidth < akEditorMobileBreakoutPoint && !isNested,
369
380
  })}
370
381
  style={{
382
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
371
383
  width: 'inherit',
372
384
  }}
373
385
  >
package/src/toolbar.tsx CHANGED
@@ -487,7 +487,7 @@ export const getToolbarConfig =
487
487
 
488
488
  alignmentMenu =
489
489
  options?.isTableAlignmentEnabled && !isNested
490
- ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI)
490
+ ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth)
491
491
  : [];
492
492
 
493
493
  let cellItems: Array<FloatingToolbarItem<Command>>;
@@ -900,6 +900,7 @@ export const getAlignmentOptionsConfig = (
900
900
  editorState: EditorState,
901
901
  { formatMessage }: ToolbarMenuContext,
902
902
  editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
903
+ getEditorContainerWidth: GetEditorContainerWidth
903
904
  ): Array<FloatingToolbarDropdown<Command>> => {
904
905
  const tableObject = findTable(editorState.selection);
905
906
 
@@ -942,6 +943,7 @@ export const getAlignmentOptionsConfig = (
942
943
  currentLayout,
943
944
  INPUT_METHOD.FLOATING_TB
944
945
  ),
946
+ ...(isLayoutOptionDisabled(tableObject.node, getEditorContainerWidth) && { disabled: value !== 'center' }),
945
947
  };
946
948
  },
947
949
  );
@@ -988,3 +990,20 @@ export const getSelectedAlignmentIcon = (
988
990
  (icon) => icon.value === normaliseAlignment(selectedAlignment),
989
991
  );
990
992
  };
993
+
994
+ export const isLayoutOptionDisabled = (
995
+ selectedNode: PMNode,
996
+ getEditorContainerWidth: GetEditorContainerWidth
997
+ ) => {
998
+ const lineLength = getEditorContainerWidth().lineLength;
999
+
1000
+ if (
1001
+ selectedNode &&
1002
+ lineLength &&
1003
+ selectedNode.attrs.width > lineLength
1004
+ ) {
1005
+ return true;
1006
+ }
1007
+
1008
+ return false;
1009
+ };
@@ -27,6 +27,7 @@ export const ColumnResizeWidget = ({
27
27
  if (!includeTooltip) {
28
28
  return (
29
29
  <div
30
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
30
31
  className={TableCssClassName.RESIZE_HANDLE_DECORATION}
31
32
  data-start-index={startIndex}
32
33
  data-end-index={endIndex}
@@ -49,6 +50,7 @@ export const ColumnResizeWidget = ({
49
50
  >
50
51
  {(tooltipProps) => (
51
52
  <div
53
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
52
54
  className={TableCssClassName.RESIZE_HANDLE_DECORATION}
53
55
  data-start-index={startIndex}
54
56
  data-end-index={endIndex}
@@ -213,6 +213,7 @@ const DragHandleComponent = ({
213
213
  <>
214
214
  <button
215
215
  type="button"
216
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
216
217
  className={ClassName.DRAG_HANDLE_BUTTON_CLICKABLE_ZONE}
217
218
  data-testid="table-drag-handle-clickable-zone-button"
218
219
  style={{
@@ -241,6 +242,7 @@ const DragHandleComponent = ({
241
242
  <button
242
243
  type="button"
243
244
  id={isDragMenuTarget ? showDragMenuAnchorId : undefined}
245
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
244
246
  className={classnames(
245
247
  ClassName.DRAG_HANDLE_BUTTON_CONTAINER,
246
248
  appearance,
@@ -279,6 +281,7 @@ const DragHandleComponent = ({
279
281
  browser.gecko ? (
280
282
  <HandleIconComponent {...handleIconProps} />
281
283
  ) : (
284
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
282
285
  <span style={{ pointerEvents: 'none' }}>
283
286
  <HandleIconComponent {...handleIconProps} />
284
287
  </span>
@@ -35,6 +35,7 @@ export const DragPreview = ({
35
35
  >
36
36
  <DragInMotionIcon
37
37
  style={{
38
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
38
39
  position: 'absolute',
39
40
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
40
41
  marginLeft: `${marginLeft}px`,
@@ -144,19 +144,26 @@ export const FixedButton = ({
144
144
  <div
145
145
  ref={observerTargetRef}
146
146
  style={{
147
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
147
148
  position: 'absolute',
149
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
148
150
  top: token('space.0', '0px'),
151
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
149
152
  left: token('space.0', '0px'),
153
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
150
154
  width: token('space.250', '20px'), // BUTTON_WIDTH
155
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
151
156
  height: token('space.250', '20px'), // BUTTON_WIDTH
152
157
  }}
153
158
  >
154
159
  <div
155
160
  ref={fixedButtonRef}
156
161
  style={{
162
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
157
163
  position: 'fixed',
158
164
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
159
165
  top: stickyHeader.top + stickyHeader.padding + offset * 2,
166
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
160
167
  zIndex: akEditorTableCellOnStickyHeaderZIndex,
161
168
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
162
169
  left: calcLeftPos({
@@ -165,9 +172,12 @@ export const FixedButton = ({
165
172
  cellRefWidth: targetCellRef.clientWidth,
166
173
  offset,
167
174
  }),
175
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
168
176
  width: token('space.250', '20px'), // BUTTON_WIDTH
177
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
169
178
  height: token('space.250', '20px'), // BUTTON_WIDTH
170
179
  }}
180
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
171
181
  className={ClassName.CONTEXTUAL_MENU_BUTTON_FIXED}
172
182
  >
173
183
  {children}
@@ -86,6 +86,7 @@ const FloatingContextualButtonInner = React.memo(
86
86
  ]}
87
87
  >
88
88
  <ToolbarButton
89
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
89
90
  className={ClassName.CONTEXTUAL_MENU_BUTTON}
90
91
  selected={isContextualMenuOpen}
91
92
  title={labelCellOptions}
@@ -212,9 +212,11 @@ export class ContextualMenu extends Component<
212
212
  </span>
213
213
  ) : undefined,
214
214
  elemAfter: (
215
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
215
216
  <div className={DropdownMenuSharedCssClassName.SUBMENU}>
216
217
  <div
217
218
  css={cellColourPreviewStyles(background)}
219
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
218
220
  className={
219
221
  isDragAndDropEnabled
220
222
  ? ClassName.CONTEXTUAL_MENU_ICON_SMALL
@@ -223,6 +225,7 @@ export class ContextualMenu extends Component<
223
225
  />
224
226
  {isSubmenuOpen && (
225
227
  <div
228
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
226
229
  className={ClassName.CONTEXTUAL_SUBMENU}
227
230
  ref={this.handleSubMenuRef}
228
231
  >
@@ -23,7 +23,9 @@ const DeleteButton = ({
23
23
  intl: { formatMessage },
24
24
  }: ButtonProps & WrappedComponentProps) => (
25
25
  <div
26
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
26
27
  className={ClassName.CONTROLS_DELETE_BUTTON_WRAP}
28
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
27
29
  style={style}
28
30
  onMouseEnter={onMouseEnter}
29
31
  onMouseLeave={onMouseLeave}
@@ -31,10 +33,12 @@ const DeleteButton = ({
31
33
  <button
32
34
  type="button"
33
35
  aria-label={formatMessage(removeLabel, { 0: 1 })}
36
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
34
37
  className={ClassName.CONTROLS_DELETE_BUTTON}
35
38
  onMouseDown={onClick}
36
39
  onMouseMove={(e) => e.preventDefault()}
37
40
  >
41
+ {/* eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766 */}
38
42
  <svg className={ClassName.CONTROLS_BUTTON_ICON}>
39
43
  <path
40
44
  d="M12.242 10.828L9.414 8l2.828-2.829a.999.999 0 1 0-1.414-1.414L8 6.587l-2.829-2.83a1 1 0 0 0-1.414 1.414l2.83 2.83-2.83 2.827a1 1 0 0 0 1.414 1.414l2.83-2.828 2.827 2.828a.999.999 0 1 0 1.414-1.414"