@atlaskit/editor-plugin-table 7.25.21 → 7.25.23
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/nodeviews/TableComponent.js +1 -1
- package/dist/cjs/nodeviews/TableResizer.js +5 -1
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +0 -1
- package/dist/cjs/ui/global-styles.js +2 -3
- package/dist/es2019/nodeviews/TableComponent.js +1 -1
- package/dist/es2019/nodeviews/TableResizer.js +5 -1
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +0 -1
- package/dist/es2019/ui/global-styles.js +2 -3
- package/dist/esm/nodeviews/TableComponent.js +1 -1
- package/dist/esm/nodeviews/TableResizer.js +5 -1
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +0 -1
- package/dist/esm/ui/global-styles.js +2 -3
- package/dist/types/ui/global-styles.d.ts +1 -1
- package/dist/types-ts4.5/ui/global-styles.d.ts +1 -1
- package/package.json +2 -5
- package/src/nodeviews/TableComponent.tsx +5 -1
- package/src/nodeviews/TableResizer.tsx +5 -1
- package/src/pm-plugins/table-resizing/event-handlers.ts +1 -1
- package/src/ui/global-styles.tsx +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.25.23
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#139279](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/139279)
|
|
8
|
+
[`70db87daa2f22`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/70db87daa2f22) -
|
|
9
|
+
[ux] Fix for column resizing for table that were resized to full-width in comment editor.
|
|
10
|
+
|
|
11
|
+
## 7.25.22
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#138699](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/138699)
|
|
16
|
+
[`aa5140e59db5a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/aa5140e59db5a) -
|
|
17
|
+
Cleanup feature flag moving styles from editor-core to tables plugin.
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 7.25.21
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -636,7 +636,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
636
636
|
if (isInDanger && !table) {
|
|
637
637
|
(0, _commands.clearHoverSelection)()(view.state, view.dispatch);
|
|
638
638
|
}
|
|
639
|
-
if ((_this$props$options9 = this.props.options) !== null && _this$props$options9 !== void 0 && _this$props$options9.isCommentEditor && options !== null && options !== void 0 && options.isTableResizingEnabled) {
|
|
639
|
+
if ((_this$props$options9 = this.props.options) !== null && _this$props$options9 !== void 0 && _this$props$options9.isCommentEditor && options !== null && options !== void 0 && options.isTableResizingEnabled && !(options !== null && options !== void 0 && options.isTableScalingEnabled)) {
|
|
640
640
|
this.removeInlineTableWidth();
|
|
641
641
|
}
|
|
642
642
|
if ((_this$wrapper = this.wrapper) !== null && _this$wrapper !== void 0 && _this$wrapper.parentElement && this.table && !this.overflowShadowsObserver) {
|
|
@@ -294,6 +294,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
294
294
|
var _node$attrs$localId2, _node$attrs2;
|
|
295
295
|
isResizing.current = false;
|
|
296
296
|
var newWidth = originalState.width + delta.width;
|
|
297
|
+
var originalNewWidth = newWidth;
|
|
297
298
|
var state = editorView.state,
|
|
298
299
|
dispatch = editorView.dispatch;
|
|
299
300
|
var pos = getPos();
|
|
@@ -329,7 +330,10 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
329
330
|
node: newNode,
|
|
330
331
|
prevNode: node,
|
|
331
332
|
start: pos + 1,
|
|
332
|
-
|
|
333
|
+
// We use originalNewWidth in comment editor, because in comment editor
|
|
334
|
+
// newWidth can be underined when table is resized to 'full-width'
|
|
335
|
+
// scaleTable function needs number value to work correctly.
|
|
336
|
+
parentWidth: isCommentEditor ? originalNewWidth : newWidth
|
|
333
337
|
}, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, isCommentEditor)(tr);
|
|
334
338
|
var scaledNode = tr.doc.nodeAt(pos);
|
|
335
339
|
(_attachAnalyticsEvent2 = attachAnalyticsEvent((0, _analytics2.generateResizedPayload)({
|
|
@@ -307,7 +307,6 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
307
307
|
} else {
|
|
308
308
|
var _table$attrs2;
|
|
309
309
|
var scalePercent = isTableScalingEnabled && isCommentEditor && !((_table$attrs2 = table.attrs) !== null && _table$attrs2 !== void 0 && _table$attrs2.width) ? (0, _misc2.getScalingPercentForTableWithoutWidth)(table, dom) : (0, _misc2.getTableScalingPercent)(originalTable, dom, shouldUseIncreasedScalingPercent);
|
|
310
|
-
// This function is called for Full-page/Fixed-page tables and table that have width attr value in Comment editor
|
|
311
310
|
(0, _utils3.resizeColumn)(resizeState, colIndex, resizedDelta, dom, table, undefined, shouldScale, scalePercent);
|
|
312
311
|
}
|
|
313
312
|
(0, _utils3.updateControls)()(state);
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.GlobalStylesWrapper = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
8
|
var _commonStyles = require("./common-styles");
|
|
10
9
|
/**
|
|
11
10
|
* @jsxRuntime classic
|
|
@@ -15,9 +14,9 @@ var _commonStyles = require("./common-styles");
|
|
|
15
14
|
|
|
16
15
|
var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWrapper(_ref) {
|
|
17
16
|
var featureFlags = _ref.featureFlags;
|
|
18
|
-
return (0,
|
|
17
|
+
return (0, _react.jsx)(_react.Global, {
|
|
19
18
|
styles: (0, _commonStyles.tableStyles)({
|
|
20
19
|
featureFlags: featureFlags
|
|
21
20
|
})
|
|
22
|
-
})
|
|
21
|
+
});
|
|
23
22
|
};
|
|
@@ -616,7 +616,7 @@ class TableComponent extends React.Component {
|
|
|
616
616
|
if (isInDanger && !table) {
|
|
617
617
|
clearHoverSelection()(view.state, view.dispatch);
|
|
618
618
|
}
|
|
619
|
-
if ((_this$props$options11 = this.props.options) !== null && _this$props$options11 !== void 0 && _this$props$options11.isCommentEditor && options !== null && options !== void 0 && options.isTableResizingEnabled) {
|
|
619
|
+
if ((_this$props$options11 = this.props.options) !== null && _this$props$options11 !== void 0 && _this$props$options11.isCommentEditor && options !== null && options !== void 0 && options.isTableResizingEnabled && !(options !== null && options !== void 0 && options.isTableScalingEnabled)) {
|
|
620
620
|
this.removeInlineTableWidth();
|
|
621
621
|
}
|
|
622
622
|
if ((_this$wrapper = this.wrapper) !== null && _this$wrapper !== void 0 && _this$wrapper.parentElement && this.table && !this.overflowShadowsObserver) {
|
|
@@ -287,6 +287,7 @@ export const TableResizer = ({
|
|
|
287
287
|
var _node$attrs$localId2, _node$attrs2;
|
|
288
288
|
isResizing.current = false;
|
|
289
289
|
let newWidth = originalState.width + delta.width;
|
|
290
|
+
const originalNewWidth = newWidth;
|
|
290
291
|
const {
|
|
291
292
|
state,
|
|
292
293
|
dispatch
|
|
@@ -325,7 +326,10 @@ export const TableResizer = ({
|
|
|
325
326
|
node: newNode,
|
|
326
327
|
prevNode: node,
|
|
327
328
|
start: pos + 1,
|
|
328
|
-
|
|
329
|
+
// We use originalNewWidth in comment editor, because in comment editor
|
|
330
|
+
// newWidth can be underined when table is resized to 'full-width'
|
|
331
|
+
// scaleTable function needs number value to work correctly.
|
|
332
|
+
parentWidth: isCommentEditor ? originalNewWidth : newWidth
|
|
329
333
|
}, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, isCommentEditor)(tr);
|
|
330
334
|
const scaledNode = tr.doc.nodeAt(pos);
|
|
331
335
|
(_attachAnalyticsEvent2 = attachAnalyticsEvent(generateResizedPayload({
|
|
@@ -318,7 +318,6 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
|
|
|
318
318
|
} else {
|
|
319
319
|
var _table$attrs2;
|
|
320
320
|
const scalePercent = isTableScalingEnabled && isCommentEditor && !((_table$attrs2 = table.attrs) !== null && _table$attrs2 !== void 0 && _table$attrs2.width) ? getScalingPercentForTableWithoutWidth(table, dom) : getTableScalingPercent(originalTable, dom, shouldUseIncreasedScalingPercent);
|
|
321
|
-
// This function is called for Full-page/Fixed-page tables and table that have width attr value in Comment editor
|
|
322
321
|
resizeColumn(resizeState, colIndex, resizedDelta, dom, table, undefined, shouldScale, scalePercent);
|
|
323
322
|
}
|
|
324
323
|
updateControls()(state);
|
|
@@ -4,14 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { Global, jsx } from '@emotion/react';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { tableStyles } from './common-styles';
|
|
9
8
|
export const GlobalStylesWrapper = ({
|
|
10
9
|
featureFlags
|
|
11
10
|
}) => {
|
|
12
|
-
return
|
|
11
|
+
return jsx(Global, {
|
|
13
12
|
styles: tableStyles({
|
|
14
13
|
featureFlags
|
|
15
14
|
})
|
|
16
|
-
})
|
|
15
|
+
});
|
|
17
16
|
};
|
|
@@ -629,7 +629,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
629
629
|
if (isInDanger && !table) {
|
|
630
630
|
clearHoverSelection()(view.state, view.dispatch);
|
|
631
631
|
}
|
|
632
|
-
if ((_this$props$options9 = this.props.options) !== null && _this$props$options9 !== void 0 && _this$props$options9.isCommentEditor && options !== null && options !== void 0 && options.isTableResizingEnabled) {
|
|
632
|
+
if ((_this$props$options9 = this.props.options) !== null && _this$props$options9 !== void 0 && _this$props$options9.isCommentEditor && options !== null && options !== void 0 && options.isTableResizingEnabled && !(options !== null && options !== void 0 && options.isTableScalingEnabled)) {
|
|
633
633
|
this.removeInlineTableWidth();
|
|
634
634
|
}
|
|
635
635
|
if ((_this$wrapper = this.wrapper) !== null && _this$wrapper !== void 0 && _this$wrapper.parentElement && this.table && !this.overflowShadowsObserver) {
|
|
@@ -284,6 +284,7 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
284
284
|
var _node$attrs$localId2, _node$attrs2;
|
|
285
285
|
isResizing.current = false;
|
|
286
286
|
var newWidth = originalState.width + delta.width;
|
|
287
|
+
var originalNewWidth = newWidth;
|
|
287
288
|
var state = editorView.state,
|
|
288
289
|
dispatch = editorView.dispatch;
|
|
289
290
|
var pos = getPos();
|
|
@@ -319,7 +320,10 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
319
320
|
node: newNode,
|
|
320
321
|
prevNode: node,
|
|
321
322
|
start: pos + 1,
|
|
322
|
-
|
|
323
|
+
// We use originalNewWidth in comment editor, because in comment editor
|
|
324
|
+
// newWidth can be underined when table is resized to 'full-width'
|
|
325
|
+
// scaleTable function needs number value to work correctly.
|
|
326
|
+
parentWidth: isCommentEditor ? originalNewWidth : newWidth
|
|
323
327
|
}, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, isCommentEditor)(tr);
|
|
324
328
|
var scaledNode = tr.doc.nodeAt(pos);
|
|
325
329
|
(_attachAnalyticsEvent2 = attachAnalyticsEvent(generateResizedPayload({
|
|
@@ -300,7 +300,6 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
|
|
|
300
300
|
} else {
|
|
301
301
|
var _table$attrs2;
|
|
302
302
|
var scalePercent = isTableScalingEnabled && isCommentEditor && !((_table$attrs2 = table.attrs) !== null && _table$attrs2 !== void 0 && _table$attrs2.width) ? getScalingPercentForTableWithoutWidth(table, dom) : getTableScalingPercent(originalTable, dom, shouldUseIncreasedScalingPercent);
|
|
303
|
-
// This function is called for Full-page/Fixed-page tables and table that have width attr value in Comment editor
|
|
304
303
|
resizeColumn(resizeState, colIndex, resizedDelta, dom, table, undefined, shouldScale, scalePercent);
|
|
305
304
|
}
|
|
306
305
|
updateControls()(state);
|
|
@@ -4,13 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { Global, jsx } from '@emotion/react';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { tableStyles } from './common-styles';
|
|
9
8
|
export var GlobalStylesWrapper = function GlobalStylesWrapper(_ref) {
|
|
10
9
|
var featureFlags = _ref.featureFlags;
|
|
11
|
-
return
|
|
10
|
+
return jsx(Global, {
|
|
12
11
|
styles: tableStyles({
|
|
13
12
|
featureFlags: featureFlags
|
|
14
13
|
})
|
|
15
|
-
})
|
|
14
|
+
});
|
|
16
15
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.25.
|
|
3
|
+
"version": "7.25.23",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@atlaskit/adf-schema": "^40.9.0",
|
|
31
31
|
"@atlaskit/button": "^20.1.0",
|
|
32
32
|
"@atlaskit/custom-steps": "^0.7.0",
|
|
33
|
-
"@atlaskit/editor-common": "^88.
|
|
33
|
+
"@atlaskit/editor-common": "^88.13.0",
|
|
34
34
|
"@atlaskit/editor-palette": "1.6.0",
|
|
35
35
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
@@ -117,9 +117,6 @@
|
|
|
117
117
|
"platform_editor_dark_mode_cell_header_color_fix": {
|
|
118
118
|
"type": "boolean"
|
|
119
119
|
},
|
|
120
|
-
"platform_editor_move_table_styles_to_plugin": {
|
|
121
|
-
"type": "boolean"
|
|
122
|
-
},
|
|
123
120
|
"platform_editor_a11y_table_context_menu": {
|
|
124
121
|
"type": "boolean"
|
|
125
122
|
},
|
|
@@ -575,7 +575,11 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
575
575
|
clearHoverSelection()(view.state, view.dispatch);
|
|
576
576
|
}
|
|
577
577
|
|
|
578
|
-
if (
|
|
578
|
+
if (
|
|
579
|
+
this.props.options?.isCommentEditor &&
|
|
580
|
+
options?.isTableResizingEnabled &&
|
|
581
|
+
!options?.isTableScalingEnabled
|
|
582
|
+
) {
|
|
579
583
|
this.removeInlineTableWidth();
|
|
580
584
|
}
|
|
581
585
|
|
|
@@ -540,6 +540,7 @@ export const TableResizer = ({
|
|
|
540
540
|
(originalState, delta) => {
|
|
541
541
|
isResizing.current = false;
|
|
542
542
|
let newWidth: number | undefined = originalState.width + delta.width;
|
|
543
|
+
const originalNewWidth = newWidth;
|
|
543
544
|
const { state, dispatch } = editorView;
|
|
544
545
|
const pos = getPos();
|
|
545
546
|
const currentTableNodeLocalId = node?.attrs?.localId ?? '';
|
|
@@ -585,7 +586,10 @@ export const TableResizer = ({
|
|
|
585
586
|
node: newNode,
|
|
586
587
|
prevNode: node,
|
|
587
588
|
start: pos + 1,
|
|
588
|
-
|
|
589
|
+
// We use originalNewWidth in comment editor, because in comment editor
|
|
590
|
+
// newWidth can be underined when table is resized to 'full-width'
|
|
591
|
+
// scaleTable function needs number value to work correctly.
|
|
592
|
+
parentWidth: isCommentEditor ? originalNewWidth : newWidth,
|
|
589
593
|
},
|
|
590
594
|
editorView.domAtPos.bind(editorView),
|
|
591
595
|
pluginInjectionApi,
|
|
@@ -397,7 +397,7 @@ export const handleMouseDown = (
|
|
|
397
397
|
isTableScalingEnabled && isCommentEditor && !table.attrs?.width
|
|
398
398
|
? getScalingPercentForTableWithoutWidth(table, dom)
|
|
399
399
|
: getTableScalingPercent(originalTable, dom, shouldUseIncreasedScalingPercent);
|
|
400
|
-
|
|
400
|
+
|
|
401
401
|
resizeColumn(
|
|
402
402
|
resizeState,
|
|
403
403
|
colIndex,
|
package/src/ui/global-styles.tsx
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import { Global, jsx } from '@emotion/react';
|
|
7
7
|
|
|
8
8
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
|
|
11
10
|
import { tableStyles } from './common-styles';
|
|
12
11
|
|
|
@@ -15,7 +14,5 @@ export const GlobalStylesWrapper = ({
|
|
|
15
14
|
}: {
|
|
16
15
|
featureFlags: FeatureFlags | undefined;
|
|
17
16
|
}) => {
|
|
18
|
-
return
|
|
19
|
-
<Global styles={tableStyles({ featureFlags })} />
|
|
20
|
-
) : null;
|
|
17
|
+
return <Global styles={tableStyles({ featureFlags })} />;
|
|
21
18
|
};
|