@atlaskit/editor-plugin-table 2.13.2 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/plugins/table/nodeviews/TableResizer.js +6 -1
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +2 -12
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +2 -4
- package/dist/es2019/plugins/table/nodeviews/TableResizer.js +6 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +2 -13
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +2 -4
- package/dist/esm/plugins/table/nodeviews/TableResizer.js +6 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +2 -12
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +2 -4
- package/dist/types/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +4 -5
- package/dist/types/plugins/table/ui/FloatingContextualMenu/index.d.ts +4 -4
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +4 -5
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/index.d.ts +4 -4
- package/package.json +2 -2
- package/src/__tests__/unit/ui/ContextualMenu.tsx +0 -2
- package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +0 -1
- package/src/plugins/table/nodeviews/TableResizer.tsx +6 -1
- package/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx +5 -22
- package/src/plugins/table/ui/FloatingContextualMenu/index.tsx +3 -5
- package/tsconfig.app.json +0 -3
- package/tsconfig.dev.json +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 2.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`6ccd72d2fe0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6ccd72d2fe0) - ED-18264: Clean up useSomewhatSemanticTextColorNames - default behaviour will be same as when FF was on.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [`69857bbbff0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/69857bbbff0) - [ED-20004] Capture errors in getPos due to prosemirror-view bump
|
|
12
|
+
|
|
13
|
+
## 2.13.3
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`aeb5c9a01e8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/aeb5c9a01e8) - Delete adf-schema from AFE and rely on npm package for adf-schema
|
|
18
|
+
- [`4b4dcfe0bba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4b4dcfe0bba) - Delete adf-schema, use published version
|
|
19
|
+
|
|
3
20
|
## 2.13.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -149,7 +149,12 @@ var TableResizer = function TableResizer(_ref) {
|
|
|
149
149
|
var handleResize = (0, _react.useCallback)(function (originalState, delta) {
|
|
150
150
|
countFrames();
|
|
151
151
|
var newWidth = originalState.width + delta.width;
|
|
152
|
-
var pos
|
|
152
|
+
var pos;
|
|
153
|
+
try {
|
|
154
|
+
pos = getPos();
|
|
155
|
+
} catch (e) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
153
158
|
if (typeof pos !== 'number') {
|
|
154
159
|
return;
|
|
155
160
|
}
|
|
@@ -115,12 +115,9 @@ var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
115
115
|
isOpen = _this$props.isOpen,
|
|
116
116
|
selectionRect = _this$props.selectionRect,
|
|
117
117
|
formatMessage = _this$props.intl.formatMessage,
|
|
118
|
-
editorView = _this$props.editorView
|
|
119
|
-
getEditorFeatureFlags = _this$props.getEditorFeatureFlags;
|
|
118
|
+
editorView = _this$props.editorView;
|
|
120
119
|
var items = [];
|
|
121
120
|
var isSubmenuOpen = _this.state.isSubmenuOpen;
|
|
122
|
-
var _getEditorFeatureFlag = getEditorFeatureFlags(),
|
|
123
|
-
useSomewhatSemanticTextColorNames = _getEditorFeatureFlag.useSomewhatSemanticTextColorNames;
|
|
124
121
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
125
122
|
var _getPluginState = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
126
123
|
targetCellPosition = _getPluginState.targetCellPosition,
|
|
@@ -149,14 +146,7 @@ var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
149
146
|
paletteOptions: {
|
|
150
147
|
palette: _uiColor.cellBackgroundColorPalette,
|
|
151
148
|
paletteColorTooltipMessages: _uiColor.backgroundPaletteTooltipMessages,
|
|
152
|
-
hexToPaletteColor: _editorPalette.hexToEditorBackgroundPaletteColor
|
|
153
|
-
// We did not want to create new FF or update
|
|
154
|
-
// useSomewhatSemanticTextColorNames name
|
|
155
|
-
// because it is temporary and require extra work.
|
|
156
|
-
// So even though it says text color names,
|
|
157
|
-
// we are going to use for all color pickers
|
|
158
|
-
// such as text, background and table charts.
|
|
159
|
-
showSomewhatSemanticTooltips: useSomewhatSemanticTextColorNames
|
|
149
|
+
hexToPaletteColor: _editorPalette.hexToEditorBackgroundPaletteColor
|
|
160
150
|
}
|
|
161
151
|
})))
|
|
162
152
|
});
|
|
@@ -24,8 +24,7 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
24
24
|
isOpen = _ref.isOpen,
|
|
25
25
|
pluginConfig = _ref.pluginConfig,
|
|
26
26
|
editorAnalyticsAPI = _ref.editorAnalyticsAPI,
|
|
27
|
-
getEditorContainerWidth = _ref.getEditorContainerWidth
|
|
28
|
-
getEditorFeatureFlags = _ref.getEditorFeatureFlags;
|
|
27
|
+
getEditorContainerWidth = _ref.getEditorContainerWidth;
|
|
29
28
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
30
29
|
var _getPluginState = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
31
30
|
targetCellPosition = _getPluginState.targetCellPosition;
|
|
@@ -72,8 +71,7 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
72
71
|
selectionRect: selectionRect,
|
|
73
72
|
boundariesElement: boundariesElement,
|
|
74
73
|
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
75
|
-
getEditorContainerWidth: getEditorContainerWidth
|
|
76
|
-
getEditorFeatureFlags: getEditorFeatureFlags
|
|
74
|
+
getEditorContainerWidth: getEditorContainerWidth
|
|
77
75
|
})));
|
|
78
76
|
};
|
|
79
77
|
FloatingContextualMenu.displayName = 'FloatingContextualMenu';
|
|
@@ -139,7 +139,12 @@ export const TableResizer = ({
|
|
|
139
139
|
const handleResize = useCallback((originalState, delta) => {
|
|
140
140
|
countFrames();
|
|
141
141
|
const newWidth = originalState.width + delta.width;
|
|
142
|
-
|
|
142
|
+
let pos;
|
|
143
|
+
try {
|
|
144
|
+
pos = getPos();
|
|
145
|
+
} catch (e) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
143
148
|
if (typeof pos !== 'number') {
|
|
144
149
|
return;
|
|
145
150
|
}
|
|
@@ -95,16 +95,12 @@ export class ContextualMenu extends Component {
|
|
|
95
95
|
intl: {
|
|
96
96
|
formatMessage
|
|
97
97
|
},
|
|
98
|
-
editorView
|
|
99
|
-
getEditorFeatureFlags
|
|
98
|
+
editorView
|
|
100
99
|
} = this.props;
|
|
101
100
|
const items = [];
|
|
102
101
|
const {
|
|
103
102
|
isSubmenuOpen
|
|
104
103
|
} = this.state;
|
|
105
|
-
const {
|
|
106
|
-
useSomewhatSemanticTextColorNames
|
|
107
|
-
} = getEditorFeatureFlags();
|
|
108
104
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
109
105
|
const {
|
|
110
106
|
targetCellPosition,
|
|
@@ -136,14 +132,7 @@ export class ContextualMenu extends Component {
|
|
|
136
132
|
paletteOptions: {
|
|
137
133
|
palette: cellBackgroundColorPalette,
|
|
138
134
|
paletteColorTooltipMessages: backgroundPaletteTooltipMessages,
|
|
139
|
-
hexToPaletteColor: hexToEditorBackgroundPaletteColor
|
|
140
|
-
// We did not want to create new FF or update
|
|
141
|
-
// useSomewhatSemanticTextColorNames name
|
|
142
|
-
// because it is temporary and require extra work.
|
|
143
|
-
// So even though it says text color names,
|
|
144
|
-
// we are going to use for all color pickers
|
|
145
|
-
// such as text, background and table charts.
|
|
146
|
-
showSomewhatSemanticTooltips: useSomewhatSemanticTextColorNames
|
|
135
|
+
hexToPaletteColor: hexToEditorBackgroundPaletteColor
|
|
147
136
|
}
|
|
148
137
|
})))
|
|
149
138
|
});
|
|
@@ -16,8 +16,7 @@ const FloatingContextualMenu = ({
|
|
|
16
16
|
isOpen,
|
|
17
17
|
pluginConfig,
|
|
18
18
|
editorAnalyticsAPI,
|
|
19
|
-
getEditorContainerWidth
|
|
20
|
-
getEditorFeatureFlags
|
|
19
|
+
getEditorContainerWidth
|
|
21
20
|
}) => {
|
|
22
21
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
23
22
|
const {
|
|
@@ -68,8 +67,7 @@ const FloatingContextualMenu = ({
|
|
|
68
67
|
selectionRect: selectionRect,
|
|
69
68
|
boundariesElement: boundariesElement,
|
|
70
69
|
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
71
|
-
getEditorContainerWidth: getEditorContainerWidth
|
|
72
|
-
getEditorFeatureFlags: getEditorFeatureFlags
|
|
70
|
+
getEditorContainerWidth: getEditorContainerWidth
|
|
73
71
|
})));
|
|
74
72
|
};
|
|
75
73
|
FloatingContextualMenu.displayName = 'FloatingContextualMenu';
|
|
@@ -139,7 +139,12 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
139
139
|
var handleResize = useCallback(function (originalState, delta) {
|
|
140
140
|
countFrames();
|
|
141
141
|
var newWidth = originalState.width + delta.width;
|
|
142
|
-
var pos
|
|
142
|
+
var pos;
|
|
143
|
+
try {
|
|
144
|
+
pos = getPos();
|
|
145
|
+
} catch (e) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
143
148
|
if (typeof pos !== 'number') {
|
|
144
149
|
return;
|
|
145
150
|
}
|
|
@@ -108,12 +108,9 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
108
108
|
isOpen = _this$props.isOpen,
|
|
109
109
|
selectionRect = _this$props.selectionRect,
|
|
110
110
|
formatMessage = _this$props.intl.formatMessage,
|
|
111
|
-
editorView = _this$props.editorView
|
|
112
|
-
getEditorFeatureFlags = _this$props.getEditorFeatureFlags;
|
|
111
|
+
editorView = _this$props.editorView;
|
|
113
112
|
var items = [];
|
|
114
113
|
var isSubmenuOpen = _this.state.isSubmenuOpen;
|
|
115
|
-
var _getEditorFeatureFlag = getEditorFeatureFlags(),
|
|
116
|
-
useSomewhatSemanticTextColorNames = _getEditorFeatureFlag.useSomewhatSemanticTextColorNames;
|
|
117
114
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
118
115
|
var _getPluginState = getPluginState(editorView.state),
|
|
119
116
|
targetCellPosition = _getPluginState.targetCellPosition,
|
|
@@ -142,14 +139,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
142
139
|
paletteOptions: {
|
|
143
140
|
palette: cellBackgroundColorPalette,
|
|
144
141
|
paletteColorTooltipMessages: backgroundPaletteTooltipMessages,
|
|
145
|
-
hexToPaletteColor: hexToEditorBackgroundPaletteColor
|
|
146
|
-
// We did not want to create new FF or update
|
|
147
|
-
// useSomewhatSemanticTextColorNames name
|
|
148
|
-
// because it is temporary and require extra work.
|
|
149
|
-
// So even though it says text color names,
|
|
150
|
-
// we are going to use for all color pickers
|
|
151
|
-
// such as text, background and table charts.
|
|
152
|
-
showSomewhatSemanticTooltips: useSomewhatSemanticTextColorNames
|
|
142
|
+
hexToPaletteColor: hexToEditorBackgroundPaletteColor
|
|
153
143
|
}
|
|
154
144
|
})))
|
|
155
145
|
});
|
|
@@ -16,8 +16,7 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
16
16
|
isOpen = _ref.isOpen,
|
|
17
17
|
pluginConfig = _ref.pluginConfig,
|
|
18
18
|
editorAnalyticsAPI = _ref.editorAnalyticsAPI,
|
|
19
|
-
getEditorContainerWidth = _ref.getEditorContainerWidth
|
|
20
|
-
getEditorFeatureFlags = _ref.getEditorFeatureFlags;
|
|
19
|
+
getEditorContainerWidth = _ref.getEditorContainerWidth;
|
|
21
20
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
22
21
|
var _getPluginState = getPluginState(editorView.state),
|
|
23
22
|
targetCellPosition = _getPluginState.targetCellPosition;
|
|
@@ -64,8 +63,7 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
64
63
|
selectionRect: selectionRect,
|
|
65
64
|
boundariesElement: boundariesElement,
|
|
66
65
|
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
67
|
-
getEditorContainerWidth: getEditorContainerWidth
|
|
68
|
-
getEditorFeatureFlags: getEditorFeatureFlags
|
|
66
|
+
getEditorContainerWidth: getEditorContainerWidth
|
|
69
67
|
})));
|
|
70
68
|
};
|
|
71
69
|
FloatingContextualMenu.displayName = 'FloatingContextualMenu';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
5
5
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
6
|
-
import type { GetEditorContainerWidth
|
|
7
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
6
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
7
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
+
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
9
9
|
export declare const messages: {
|
|
10
10
|
cellBackground: {
|
|
11
11
|
id: string;
|
|
@@ -61,7 +61,6 @@ export interface Props {
|
|
|
61
61
|
offset?: Array<number>;
|
|
62
62
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
63
63
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
64
|
-
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
65
64
|
}
|
|
66
65
|
export interface State {
|
|
67
66
|
isSubmenuOpen: boolean;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import { PluginConfig } from '../../types';
|
|
5
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import type { PluginConfig } from '../../types';
|
|
7
7
|
export interface Props {
|
|
8
8
|
editorView: EditorView;
|
|
9
9
|
isOpen: boolean;
|
|
10
10
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
11
|
-
getEditorFeatureFlags
|
|
11
|
+
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
12
12
|
targetCellPosition?: number;
|
|
13
13
|
mountPoint?: HTMLElement;
|
|
14
14
|
boundariesElement?: HTMLElement;
|
|
@@ -17,7 +17,7 @@ export interface Props {
|
|
|
17
17
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
18
18
|
}
|
|
19
19
|
declare const FloatingContextualMenu: {
|
|
20
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth,
|
|
20
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, }: Props): jsx.JSX.Element | null;
|
|
21
21
|
displayName: string;
|
|
22
22
|
};
|
|
23
23
|
export default FloatingContextualMenu;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
5
5
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
6
|
-
import type { GetEditorContainerWidth
|
|
7
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
6
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
7
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
+
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
9
9
|
export declare const messages: {
|
|
10
10
|
cellBackground: {
|
|
11
11
|
id: string;
|
|
@@ -61,7 +61,6 @@ export interface Props {
|
|
|
61
61
|
offset?: Array<number>;
|
|
62
62
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
63
63
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
64
|
-
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
65
64
|
}
|
|
66
65
|
export interface State {
|
|
67
66
|
isSubmenuOpen: boolean;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import { PluginConfig } from '../../types';
|
|
5
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import type { PluginConfig } from '../../types';
|
|
7
7
|
export interface Props {
|
|
8
8
|
editorView: EditorView;
|
|
9
9
|
isOpen: boolean;
|
|
10
10
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
11
|
-
getEditorFeatureFlags
|
|
11
|
+
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
12
12
|
targetCellPosition?: number;
|
|
13
13
|
mountPoint?: HTMLElement;
|
|
14
14
|
boundariesElement?: HTMLElement;
|
|
@@ -17,7 +17,7 @@ export interface Props {
|
|
|
17
17
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
18
18
|
}
|
|
19
19
|
declare const FloatingContextualMenu: {
|
|
20
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth,
|
|
20
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, }: Props): jsx.JSX.Element | null;
|
|
21
21
|
displayName: string;
|
|
22
22
|
};
|
|
23
23
|
export default FloatingContextualMenu;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.0",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"releaseModel": "continuous"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atlaskit/adf-schema": "
|
|
30
|
+
"@atlaskit/adf-schema": "^29.1.0",
|
|
31
31
|
"@atlaskit/editor-common": "^74.58.0",
|
|
32
32
|
"@atlaskit/editor-palette": "1.5.1",
|
|
33
33
|
"@atlaskit/editor-plugin-analytics": "^0.2.0",
|
|
@@ -30,7 +30,6 @@ import { ContextualMenu } from '../../../plugins/table/ui/FloatingContextualMenu
|
|
|
30
30
|
|
|
31
31
|
describe('ContextualMenu', () => {
|
|
32
32
|
const getEditorContainerWidth = () => ({ width: 500 });
|
|
33
|
-
const getEditorFeatureFlags = () => ({});
|
|
34
33
|
const createEditor = createProsemirrorEditorFactory();
|
|
35
34
|
describe('with right table cell position in plugin state', () => {
|
|
36
35
|
let editorView: EditorView;
|
|
@@ -57,7 +56,6 @@ describe('ContextualMenu', () => {
|
|
|
57
56
|
isOpen
|
|
58
57
|
selectionRect={{ bottom: 0, left: 0, right: 0, top: 0 }}
|
|
59
58
|
getEditorContainerWidth={getEditorContainerWidth}
|
|
60
|
-
getEditorFeatureFlags={getEditorFeatureFlags}
|
|
61
59
|
/>,
|
|
62
60
|
);
|
|
63
61
|
|
|
@@ -226,7 +226,12 @@ export const TableResizer = ({
|
|
|
226
226
|
(originalState, delta) => {
|
|
227
227
|
countFrames();
|
|
228
228
|
const newWidth = originalState.width + delta.width;
|
|
229
|
-
|
|
229
|
+
let pos: number | undefined;
|
|
230
|
+
try {
|
|
231
|
+
pos = getPos();
|
|
232
|
+
} catch (e) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
230
235
|
if (typeof pos !== 'number') {
|
|
231
236
|
return;
|
|
232
237
|
}
|
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
injectIntl,
|
|
8
|
-
WrappedComponentProps,
|
|
9
|
-
} from 'react-intl-next';
|
|
5
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
6
|
+
import { defineMessages, injectIntl } from 'react-intl-next';
|
|
10
7
|
|
|
11
8
|
type DropdownItem = MenuItem & {
|
|
12
9
|
value: {
|
|
@@ -24,10 +21,7 @@ import {
|
|
|
24
21
|
tooltip,
|
|
25
22
|
} from '@atlaskit/editor-common/keymaps';
|
|
26
23
|
import { DropdownMenuSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
27
|
-
import type {
|
|
28
|
-
GetEditorContainerWidth,
|
|
29
|
-
GetEditorFeatureFlags,
|
|
30
|
-
} from '@atlaskit/editor-common/types';
|
|
24
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
31
25
|
import {
|
|
32
26
|
backgroundPaletteTooltipMessages,
|
|
33
27
|
cellBackgroundColorPalette,
|
|
@@ -40,9 +34,9 @@ import {
|
|
|
40
34
|
} from '@atlaskit/editor-common/ui-menu';
|
|
41
35
|
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
42
36
|
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
43
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
37
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
44
38
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
45
|
-
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
39
|
+
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
46
40
|
import { splitCell } from '@atlaskit/editor-tables/utils';
|
|
47
41
|
|
|
48
42
|
import {
|
|
@@ -135,7 +129,6 @@ export interface Props {
|
|
|
135
129
|
offset?: Array<number>;
|
|
136
130
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
137
131
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
138
|
-
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
139
132
|
}
|
|
140
133
|
|
|
141
134
|
export interface State {
|
|
@@ -215,11 +208,9 @@ export class ContextualMenu extends Component<
|
|
|
215
208
|
selectionRect,
|
|
216
209
|
intl: { formatMessage },
|
|
217
210
|
editorView,
|
|
218
|
-
getEditorFeatureFlags,
|
|
219
211
|
} = this.props;
|
|
220
212
|
const items: any[] = [];
|
|
221
213
|
const { isSubmenuOpen } = this.state;
|
|
222
|
-
const { useSomewhatSemanticTextColorNames } = getEditorFeatureFlags();
|
|
223
214
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
224
215
|
const {
|
|
225
216
|
targetCellPosition,
|
|
@@ -256,14 +247,6 @@ export class ContextualMenu extends Component<
|
|
|
256
247
|
paletteColorTooltipMessages:
|
|
257
248
|
backgroundPaletteTooltipMessages,
|
|
258
249
|
hexToPaletteColor: hexToEditorBackgroundPaletteColor,
|
|
259
|
-
// We did not want to create new FF or update
|
|
260
|
-
// useSomewhatSemanticTextColorNames name
|
|
261
|
-
// because it is temporary and require extra work.
|
|
262
|
-
// So even though it says text color names,
|
|
263
|
-
// we are going to use for all color pickers
|
|
264
|
-
// such as text, background and table charts.
|
|
265
|
-
showSomewhatSemanticTooltips:
|
|
266
|
-
useSomewhatSemanticTextColorNames,
|
|
267
250
|
}}
|
|
268
251
|
/>
|
|
269
252
|
</div>
|
|
@@ -8,7 +8,7 @@ import type {
|
|
|
8
8
|
} from '@atlaskit/editor-common/types';
|
|
9
9
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
10
10
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
11
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
12
12
|
import {
|
|
13
13
|
akEditorFloatingDialogZIndex,
|
|
14
14
|
akEditorFloatingOverlapPanelZIndex,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from '@atlaskit/editor-tables/utils';
|
|
21
21
|
|
|
22
22
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
23
|
-
import { PluginConfig } from '../../types';
|
|
23
|
+
import type { PluginConfig } from '../../types';
|
|
24
24
|
import {
|
|
25
25
|
contextualMenuDropdownWidth,
|
|
26
26
|
contextualMenuTriggerSize,
|
|
@@ -33,7 +33,7 @@ export interface Props {
|
|
|
33
33
|
editorView: EditorView;
|
|
34
34
|
isOpen: boolean;
|
|
35
35
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
36
|
-
getEditorFeatureFlags
|
|
36
|
+
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
37
37
|
targetCellPosition?: number;
|
|
38
38
|
mountPoint?: HTMLElement;
|
|
39
39
|
boundariesElement?: HTMLElement;
|
|
@@ -51,7 +51,6 @@ const FloatingContextualMenu = ({
|
|
|
51
51
|
pluginConfig,
|
|
52
52
|
editorAnalyticsAPI,
|
|
53
53
|
getEditorContainerWidth,
|
|
54
|
-
getEditorFeatureFlags,
|
|
55
54
|
}: Props) => {
|
|
56
55
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
57
56
|
const { targetCellPosition } = getPluginState(editorView.state);
|
|
@@ -115,7 +114,6 @@ const FloatingContextualMenu = ({
|
|
|
115
114
|
boundariesElement={boundariesElement}
|
|
116
115
|
editorAnalyticsAPI={editorAnalyticsAPI}
|
|
117
116
|
getEditorContainerWidth={getEditorContainerWidth}
|
|
118
|
-
getEditorFeatureFlags={getEditorFeatureFlags}
|
|
119
117
|
/>
|
|
120
118
|
</div>
|
|
121
119
|
</Popup>
|
package/tsconfig.app.json
CHANGED