@atlaskit/editor-plugin-table 15.0.6 → 15.0.8
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 +16 -0
- package/dist/cjs/nodeviews/TableComponent.js +2 -58
- package/dist/cjs/nodeviews/TableContainer.js +2 -2
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +1 -1
- package/dist/es2019/nodeviews/TableComponent.js +2 -56
- package/dist/es2019/nodeviews/TableContainer.js +2 -2
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +1 -1
- package/dist/esm/nodeviews/TableComponent.js +2 -59
- package/dist/esm/nodeviews/TableContainer.js +2 -2
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 15.0.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`925eb6478e9a5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/925eb6478e9a5) -
|
|
8
|
+
Remove overflowY on tables to prevent Y axis scroll bar showing on Windows.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 15.0.7
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`02d5fa5dcc791`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/02d5fa5dcc791) -
|
|
16
|
+
Cleanup cc_editor_ufo_hold_table_till_resize_complete
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 15.0.6
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -29,7 +28,6 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
29
28
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
30
29
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
31
30
|
var _combine = require("@atlaskit/pragmatic-drag-and-drop/combine");
|
|
32
|
-
var _loadHold = _interopRequireDefault(require("@atlaskit/react-ufo/load-hold"));
|
|
33
31
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
34
32
|
var _commands = require("../pm-plugins/commands");
|
|
35
33
|
var _autoscrollers = require("../pm-plugins/drag-and-drop/utils/autoscrollers");
|
|
@@ -75,17 +73,6 @@ var isOverflowAnalyticsEnabled = false;
|
|
|
75
73
|
// Prevent unnecessary parentWidth updates when table is nested inside of a node that is nested itself.
|
|
76
74
|
var NESTED_TABLE_IN_NESTED_PARENT_WIDTH_DIFF_MIN_THRESHOLD = 2;
|
|
77
75
|
var NESTED_TABLE_IN_NESTED_PARENT_WIDTH_DIFF_MAX_THRESHOLD = 20;
|
|
78
|
-
// Generate a unique ID to prevent collisions when multiple plugin versions exist on the same page
|
|
79
|
-
var generateUniqueTableId = function generateUniqueTableId() {
|
|
80
|
-
// Use crypto.randomUUID() if available, fallback to Math.random() based approach
|
|
81
|
-
if (!globalThis.crypto || typeof globalThis.crypto.randomUUID !== 'function') {
|
|
82
|
-
// Fallback: for older environments (IE).
|
|
83
|
-
// Not the best fallback, but the crypto.randomUUID is widely available
|
|
84
|
-
return (Math.random() + 1).toString(36).substring(20);
|
|
85
|
-
}
|
|
86
|
-
return crypto.randomUUID();
|
|
87
|
-
};
|
|
88
|
-
|
|
89
76
|
// Ignored via go/ees005
|
|
90
77
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
91
78
|
var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
@@ -97,8 +84,6 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
97
84
|
scroll: 0,
|
|
98
85
|
parentWidth: undefined
|
|
99
86
|
}, _types.ShadowEvent.SHOW_BEFORE_SHADOW, false), _types.ShadowEvent.SHOW_AFTER_SHADOW, false), "tableWrapperWidth", undefined), "tableWrapperHeight", undefined), "windowResized", false));
|
|
100
|
-
(0, _defineProperty3.default)(_this, "holdCompleted", false);
|
|
101
|
-
(0, _defineProperty3.default)(_this, "dispatchEventName", "tableResized-".concat(generateUniqueTableId()));
|
|
102
87
|
(0, _defineProperty3.default)(_this, "handleMouseOut", function (event) {
|
|
103
88
|
if (!(0, _eventHandlers.isTableInFocus)(_this.props.view)) {
|
|
104
89
|
return false;
|
|
@@ -771,14 +756,6 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
771
756
|
// Ignored via go/ees005
|
|
772
757
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
773
758
|
_this4.table, tableNode, shouldScaleOnColgroupUpdate, scalePercent);
|
|
774
|
-
if ((0, _expValEquals.expValEquals)('cc_editor_ufo_hold_table_till_resize_complete', 'isEnabled', true)) {
|
|
775
|
-
// Mark table as updated for TableHold component (if no table exists yet, the colgroup update will not have done anything)
|
|
776
|
-
if (_this4.table && !_this4.holdCompleted) {
|
|
777
|
-
var customTableResizedEvent = new CustomEvent(_this4.dispatchEventName);
|
|
778
|
-
document.dispatchEvent(customTableResizedEvent);
|
|
779
|
-
_this4.holdCompleted = true;
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
759
|
});
|
|
783
760
|
}
|
|
784
761
|
}
|
|
@@ -1070,9 +1047,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1070
1047
|
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
|
|
1071
1048
|
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
1072
1049
|
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor
|
|
1073
|
-
},
|
|
1074
|
-
dispatchEventName: this.dispatchEventName
|
|
1075
|
-
}) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
1050
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1076
1051
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1077
1052
|
className: _types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
1078
1053
|
"data-testid": "sticky-sentinel-top"
|
|
@@ -1185,35 +1160,4 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1185
1160
|
}]);
|
|
1186
1161
|
}(_react.default.Component);
|
|
1187
1162
|
(0, _defineProperty3.default)(TableComponent, "displayName", 'TableComponent');
|
|
1188
|
-
var _default = exports.default = (0, _reactIntlNext.injectIntl)(TableComponent);
|
|
1189
|
-
/**
|
|
1190
|
-
* This is needed because of how currently the table is resized post client boot up with code that exists outside react
|
|
1191
|
-
*
|
|
1192
|
-
* This can be deleted once https://home.atlassian.com/o/2346a038-3c8c-498b-a79b-e7847859868d/s/a436116f-02ce-4520-8fbb-7301462a1674/project/ATLAS-97756/updates
|
|
1193
|
-
* is rolled out (and doesn't need to be used in the test arm of that change).
|
|
1194
|
-
*/
|
|
1195
|
-
var TableHold = /*#__PURE__*/_react.default.memo(function TableHold(_ref) {
|
|
1196
|
-
var dispatchEventName = _ref.dispatchEventName;
|
|
1197
|
-
var _React$useState = _react.default.useState(false),
|
|
1198
|
-
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
1199
|
-
tableUpdateConfirmed = _React$useState2[0],
|
|
1200
|
-
setTableUpdateConfirmed = _React$useState2[1];
|
|
1201
|
-
_react.default.useEffect(function () {
|
|
1202
|
-
var customEventListener = function customEventListener() {
|
|
1203
|
-
setTableUpdateConfirmed(true);
|
|
1204
|
-
};
|
|
1205
|
-
|
|
1206
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
1207
|
-
document.addEventListener(dispatchEventName, customEventListener);
|
|
1208
|
-
return function () {
|
|
1209
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
1210
|
-
document.removeEventListener(dispatchEventName, customEventListener);
|
|
1211
|
-
};
|
|
1212
|
-
}, [dispatchEventName]);
|
|
1213
|
-
if (tableUpdateConfirmed === false) {
|
|
1214
|
-
return /*#__PURE__*/_react.default.createElement(_loadHold.default, {
|
|
1215
|
-
name: "editor_table_resize"
|
|
1216
|
-
});
|
|
1217
|
-
}
|
|
1218
|
-
return null;
|
|
1219
|
-
});
|
|
1163
|
+
var _default = exports.default = (0, _reactIntlNext.injectIntl)(TableComponent);
|
|
@@ -254,7 +254,7 @@ var ResizableTableContainerLegacy = /*#__PURE__*/_react.default.memo(function (_
|
|
|
254
254
|
var calculatedWidth = !node.attrs.width && isCommentEditor ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
|
|
255
255
|
|
|
256
256
|
// Ensure minimum width for usability while respecting container constraints
|
|
257
|
-
var width =
|
|
257
|
+
var width = Math.max(calculatedWidth, Math.min(responsiveContainerWidth * 0.5, 300));
|
|
258
258
|
if (!isResizing) {
|
|
259
259
|
tableWidthRef.current = width;
|
|
260
260
|
}
|
|
@@ -457,7 +457,7 @@ var ResizableTableContainerNext = /*#__PURE__*/_react.default.memo(function (_re
|
|
|
457
457
|
var calculatedWidth = !node.attrs.width && isCommentEditor ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
|
|
458
458
|
|
|
459
459
|
// Ensure minimum width for usability while respecting container constraints
|
|
460
|
-
var width =
|
|
460
|
+
var width = Math.max(calculatedWidth, Math.min(responsiveContainerWidth * 0.5, 300));
|
|
461
461
|
var maxResizerWidth = isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, _consts.TABLE_MAX_WIDTH);
|
|
462
462
|
return {
|
|
463
463
|
width: width,
|
|
@@ -164,7 +164,7 @@ var NumberColumn = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
164
164
|
}
|
|
165
165
|
}, hasHeaderRow ? index > 0 ? index : null : index + 1) :
|
|
166
166
|
/*#__PURE__*/
|
|
167
|
-
// eslint-disable-next-line
|
|
167
|
+
// eslint-disable-next-line @atlassian/a11y/click-events-have-key-events, @atlassian/a11y/interactive-element-not-keyboard-focusable, @atlassian/a11y/no-static-element-interactions
|
|
168
168
|
_react.default.createElement("div", {
|
|
169
169
|
// Ignored via go/ees005
|
|
170
170
|
// eslint-disable-next-line react/no-array-index-key
|
|
@@ -15,7 +15,6 @@ import { akEditorTableNumberColumnWidth, akEditorTableToolbarSize as tableToolba
|
|
|
15
15
|
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
16
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
17
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
18
|
-
import UFOLoadHold from '@atlaskit/react-ufo/load-hold';
|
|
19
18
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
20
19
|
import { autoSizeTable, clearHoverSelection } from '../pm-plugins/commands';
|
|
21
20
|
import { autoScrollerFactory } from '../pm-plugins/drag-and-drop/utils/autoscrollers';
|
|
@@ -55,17 +54,6 @@ const isOverflowAnalyticsEnabled = false;
|
|
|
55
54
|
// Prevent unnecessary parentWidth updates when table is nested inside of a node that is nested itself.
|
|
56
55
|
const NESTED_TABLE_IN_NESTED_PARENT_WIDTH_DIFF_MIN_THRESHOLD = 2;
|
|
57
56
|
const NESTED_TABLE_IN_NESTED_PARENT_WIDTH_DIFF_MAX_THRESHOLD = 20;
|
|
58
|
-
// Generate a unique ID to prevent collisions when multiple plugin versions exist on the same page
|
|
59
|
-
const generateUniqueTableId = () => {
|
|
60
|
-
// Use crypto.randomUUID() if available, fallback to Math.random() based approach
|
|
61
|
-
if (!globalThis.crypto || typeof globalThis.crypto.randomUUID !== 'function') {
|
|
62
|
-
// Fallback: for older environments (IE).
|
|
63
|
-
// Not the best fallback, but the crypto.randomUUID is widely available
|
|
64
|
-
return (Math.random() + 1).toString(36).substring(20);
|
|
65
|
-
}
|
|
66
|
-
return crypto.randomUUID();
|
|
67
|
-
};
|
|
68
|
-
|
|
69
57
|
// Ignored via go/ees005
|
|
70
58
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
71
59
|
class TableComponent extends React.Component {
|
|
@@ -80,8 +68,6 @@ class TableComponent extends React.Component {
|
|
|
80
68
|
tableWrapperHeight: undefined,
|
|
81
69
|
windowResized: false
|
|
82
70
|
});
|
|
83
|
-
_defineProperty(this, "holdCompleted", false);
|
|
84
|
-
_defineProperty(this, "dispatchEventName", `tableResized-${generateUniqueTableId()}`);
|
|
85
71
|
_defineProperty(this, "handleMouseOut", event => {
|
|
86
72
|
if (!isTableInFocus(this.props.view)) {
|
|
87
73
|
return false;
|
|
@@ -741,14 +727,6 @@ class TableComponent extends React.Component {
|
|
|
741
727
|
// Ignored via go/ees005
|
|
742
728
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
743
729
|
this.table, tableNode, shouldScaleOnColgroupUpdate, scalePercent);
|
|
744
|
-
if (expValEquals('cc_editor_ufo_hold_table_till_resize_complete', 'isEnabled', true)) {
|
|
745
|
-
// Mark table as updated for TableHold component (if no table exists yet, the colgroup update will not have done anything)
|
|
746
|
-
if (this.table && !this.holdCompleted) {
|
|
747
|
-
const customTableResizedEvent = new CustomEvent(this.dispatchEventName);
|
|
748
|
-
document.dispatchEvent(customTableResizedEvent);
|
|
749
|
-
this.holdCompleted = true;
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
730
|
});
|
|
753
731
|
}
|
|
754
732
|
}
|
|
@@ -1043,9 +1021,7 @@ class TableComponent extends React.Component {
|
|
|
1043
1021
|
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
|
|
1044
1022
|
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
1045
1023
|
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor
|
|
1046
|
-
},
|
|
1047
|
-
dispatchEventName: this.dispatchEventName
|
|
1048
|
-
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
1024
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1049
1025
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1050
1026
|
className: ClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
1051
1027
|
"data-testid": "sticky-sentinel-top"
|
|
@@ -1157,34 +1133,4 @@ class TableComponent extends React.Component {
|
|
|
1157
1133
|
}
|
|
1158
1134
|
}
|
|
1159
1135
|
_defineProperty(TableComponent, "displayName", 'TableComponent');
|
|
1160
|
-
export default injectIntl(TableComponent);
|
|
1161
|
-
|
|
1162
|
-
/**
|
|
1163
|
-
* This is needed because of how currently the table is resized post client boot up with code that exists outside react
|
|
1164
|
-
*
|
|
1165
|
-
* This can be deleted once https://home.atlassian.com/o/2346a038-3c8c-498b-a79b-e7847859868d/s/a436116f-02ce-4520-8fbb-7301462a1674/project/ATLAS-97756/updates
|
|
1166
|
-
* is rolled out (and doesn't need to be used in the test arm of that change).
|
|
1167
|
-
*/
|
|
1168
|
-
const TableHold = /*#__PURE__*/React.memo(function TableHold({
|
|
1169
|
-
dispatchEventName
|
|
1170
|
-
}) {
|
|
1171
|
-
const [tableUpdateConfirmed, setTableUpdateConfirmed] = React.useState(false);
|
|
1172
|
-
React.useEffect(() => {
|
|
1173
|
-
const customEventListener = () => {
|
|
1174
|
-
setTableUpdateConfirmed(true);
|
|
1175
|
-
};
|
|
1176
|
-
|
|
1177
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
1178
|
-
document.addEventListener(dispatchEventName, customEventListener);
|
|
1179
|
-
return () => {
|
|
1180
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
1181
|
-
document.removeEventListener(dispatchEventName, customEventListener);
|
|
1182
|
-
};
|
|
1183
|
-
}, [dispatchEventName]);
|
|
1184
|
-
if (tableUpdateConfirmed === false) {
|
|
1185
|
-
return /*#__PURE__*/React.createElement(UFOLoadHold, {
|
|
1186
|
-
name: "editor_table_resize"
|
|
1187
|
-
});
|
|
1188
|
-
}
|
|
1189
|
-
return null;
|
|
1190
|
-
});
|
|
1136
|
+
export default injectIntl(TableComponent);
|
|
@@ -247,7 +247,7 @@ const ResizableTableContainerLegacy = /*#__PURE__*/React.memo(({
|
|
|
247
247
|
const calculatedWidth = !node.attrs.width && isCommentEditor ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
|
|
248
248
|
|
|
249
249
|
// Ensure minimum width for usability while respecting container constraints
|
|
250
|
-
const width =
|
|
250
|
+
const width = Math.max(calculatedWidth, Math.min(responsiveContainerWidth * 0.5, 300));
|
|
251
251
|
if (!isResizing) {
|
|
252
252
|
tableWidthRef.current = width;
|
|
253
253
|
}
|
|
@@ -452,7 +452,7 @@ const ResizableTableContainerNext = /*#__PURE__*/React.memo(({
|
|
|
452
452
|
const calculatedWidth = !node.attrs.width && isCommentEditor ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
|
|
453
453
|
|
|
454
454
|
// Ensure minimum width for usability while respecting container constraints
|
|
455
|
-
const width =
|
|
455
|
+
const width = Math.max(calculatedWidth, Math.min(responsiveContainerWidth * 0.5, 300));
|
|
456
456
|
const maxResizerWidth = isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, TABLE_MAX_WIDTH);
|
|
457
457
|
return {
|
|
458
458
|
width,
|
|
@@ -146,7 +146,7 @@ export default class NumberColumn extends Component {
|
|
|
146
146
|
onMouseOver: () => updateCellHoverLocation(index)
|
|
147
147
|
}, hasHeaderRow ? index > 0 ? index : null : index + 1) :
|
|
148
148
|
/*#__PURE__*/
|
|
149
|
-
// eslint-disable-next-line
|
|
149
|
+
// eslint-disable-next-line @atlassian/a11y/click-events-have-key-events, @atlassian/a11y/interactive-element-not-keyboard-focusable, @atlassian/a11y/no-static-element-interactions
|
|
150
150
|
React.createElement("div", {
|
|
151
151
|
// Ignored via go/ees005
|
|
152
152
|
// eslint-disable-next-line react/no-array-index-key
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -29,7 +28,6 @@ import { akEditorTableNumberColumnWidth, akEditorTableToolbarSize as tableToolba
|
|
|
29
28
|
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
30
29
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
31
30
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
32
|
-
import UFOLoadHold from '@atlaskit/react-ufo/load-hold';
|
|
33
31
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
34
32
|
import { autoSizeTable, clearHoverSelection } from '../pm-plugins/commands';
|
|
35
33
|
import { autoScrollerFactory } from '../pm-plugins/drag-and-drop/utils/autoscrollers';
|
|
@@ -69,17 +67,6 @@ var isOverflowAnalyticsEnabled = false;
|
|
|
69
67
|
// Prevent unnecessary parentWidth updates when table is nested inside of a node that is nested itself.
|
|
70
68
|
var NESTED_TABLE_IN_NESTED_PARENT_WIDTH_DIFF_MIN_THRESHOLD = 2;
|
|
71
69
|
var NESTED_TABLE_IN_NESTED_PARENT_WIDTH_DIFF_MAX_THRESHOLD = 20;
|
|
72
|
-
// Generate a unique ID to prevent collisions when multiple plugin versions exist on the same page
|
|
73
|
-
var generateUniqueTableId = function generateUniqueTableId() {
|
|
74
|
-
// Use crypto.randomUUID() if available, fallback to Math.random() based approach
|
|
75
|
-
if (!globalThis.crypto || typeof globalThis.crypto.randomUUID !== 'function') {
|
|
76
|
-
// Fallback: for older environments (IE).
|
|
77
|
-
// Not the best fallback, but the crypto.randomUUID is widely available
|
|
78
|
-
return (Math.random() + 1).toString(36).substring(20);
|
|
79
|
-
}
|
|
80
|
-
return crypto.randomUUID();
|
|
81
|
-
};
|
|
82
|
-
|
|
83
70
|
// Ignored via go/ees005
|
|
84
71
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
85
72
|
var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
@@ -91,8 +78,6 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
91
78
|
scroll: 0,
|
|
92
79
|
parentWidth: undefined
|
|
93
80
|
}, ShadowEvent.SHOW_BEFORE_SHADOW, false), ShadowEvent.SHOW_AFTER_SHADOW, false), "tableWrapperWidth", undefined), "tableWrapperHeight", undefined), "windowResized", false));
|
|
94
|
-
_defineProperty(_this, "holdCompleted", false);
|
|
95
|
-
_defineProperty(_this, "dispatchEventName", "tableResized-".concat(generateUniqueTableId()));
|
|
96
81
|
_defineProperty(_this, "handleMouseOut", function (event) {
|
|
97
82
|
if (!isTableInFocus(_this.props.view)) {
|
|
98
83
|
return false;
|
|
@@ -765,14 +750,6 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
765
750
|
// Ignored via go/ees005
|
|
766
751
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
767
752
|
_this4.table, tableNode, shouldScaleOnColgroupUpdate, scalePercent);
|
|
768
|
-
if (expValEquals('cc_editor_ufo_hold_table_till_resize_complete', 'isEnabled', true)) {
|
|
769
|
-
// Mark table as updated for TableHold component (if no table exists yet, the colgroup update will not have done anything)
|
|
770
|
-
if (_this4.table && !_this4.holdCompleted) {
|
|
771
|
-
var customTableResizedEvent = new CustomEvent(_this4.dispatchEventName);
|
|
772
|
-
document.dispatchEvent(customTableResizedEvent);
|
|
773
|
-
_this4.holdCompleted = true;
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
753
|
});
|
|
777
754
|
}
|
|
778
755
|
}
|
|
@@ -1064,9 +1041,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1064
1041
|
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
|
|
1065
1042
|
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
1066
1043
|
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor
|
|
1067
|
-
},
|
|
1068
|
-
dispatchEventName: this.dispatchEventName
|
|
1069
|
-
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
1044
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1070
1045
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1071
1046
|
className: ClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
1072
1047
|
"data-testid": "sticky-sentinel-top"
|
|
@@ -1179,36 +1154,4 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1179
1154
|
}]);
|
|
1180
1155
|
}(React.Component);
|
|
1181
1156
|
_defineProperty(TableComponent, "displayName", 'TableComponent');
|
|
1182
|
-
export default injectIntl(TableComponent);
|
|
1183
|
-
|
|
1184
|
-
/**
|
|
1185
|
-
* This is needed because of how currently the table is resized post client boot up with code that exists outside react
|
|
1186
|
-
*
|
|
1187
|
-
* This can be deleted once https://home.atlassian.com/o/2346a038-3c8c-498b-a79b-e7847859868d/s/a436116f-02ce-4520-8fbb-7301462a1674/project/ATLAS-97756/updates
|
|
1188
|
-
* is rolled out (and doesn't need to be used in the test arm of that change).
|
|
1189
|
-
*/
|
|
1190
|
-
var TableHold = /*#__PURE__*/React.memo(function TableHold(_ref) {
|
|
1191
|
-
var dispatchEventName = _ref.dispatchEventName;
|
|
1192
|
-
var _React$useState = React.useState(false),
|
|
1193
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1194
|
-
tableUpdateConfirmed = _React$useState2[0],
|
|
1195
|
-
setTableUpdateConfirmed = _React$useState2[1];
|
|
1196
|
-
React.useEffect(function () {
|
|
1197
|
-
var customEventListener = function customEventListener() {
|
|
1198
|
-
setTableUpdateConfirmed(true);
|
|
1199
|
-
};
|
|
1200
|
-
|
|
1201
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
1202
|
-
document.addEventListener(dispatchEventName, customEventListener);
|
|
1203
|
-
return function () {
|
|
1204
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
1205
|
-
document.removeEventListener(dispatchEventName, customEventListener);
|
|
1206
|
-
};
|
|
1207
|
-
}, [dispatchEventName]);
|
|
1208
|
-
if (tableUpdateConfirmed === false) {
|
|
1209
|
-
return /*#__PURE__*/React.createElement(UFOLoadHold, {
|
|
1210
|
-
name: "editor_table_resize"
|
|
1211
|
-
});
|
|
1212
|
-
}
|
|
1213
|
-
return null;
|
|
1214
|
-
});
|
|
1157
|
+
export default injectIntl(TableComponent);
|
|
@@ -245,7 +245,7 @@ var ResizableTableContainerLegacy = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
245
245
|
var calculatedWidth = !node.attrs.width && isCommentEditor ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
|
|
246
246
|
|
|
247
247
|
// Ensure minimum width for usability while respecting container constraints
|
|
248
|
-
var width =
|
|
248
|
+
var width = Math.max(calculatedWidth, Math.min(responsiveContainerWidth * 0.5, 300));
|
|
249
249
|
if (!isResizing) {
|
|
250
250
|
tableWidthRef.current = width;
|
|
251
251
|
}
|
|
@@ -448,7 +448,7 @@ var ResizableTableContainerNext = /*#__PURE__*/React.memo(function (_ref5) {
|
|
|
448
448
|
var calculatedWidth = !node.attrs.width && isCommentEditor ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
|
|
449
449
|
|
|
450
450
|
// Ensure minimum width for usability while respecting container constraints
|
|
451
|
-
var width =
|
|
451
|
+
var width = Math.max(calculatedWidth, Math.min(responsiveContainerWidth * 0.5, 300));
|
|
452
452
|
var maxResizerWidth = isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, TABLE_MAX_WIDTH);
|
|
453
453
|
return {
|
|
454
454
|
width: width,
|
|
@@ -155,7 +155,7 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
|
|
|
155
155
|
}
|
|
156
156
|
}, hasHeaderRow ? index > 0 ? index : null : index + 1) :
|
|
157
157
|
/*#__PURE__*/
|
|
158
|
-
// eslint-disable-next-line
|
|
158
|
+
// eslint-disable-next-line @atlassian/a11y/click-events-have-key-events, @atlassian/a11y/interactive-element-not-keyboard-focusable, @atlassian/a11y/no-static-element-interactions
|
|
159
159
|
React.createElement("div", {
|
|
160
160
|
// Ignored via go/ees005
|
|
161
161
|
// eslint-disable-next-line react/no-array-index-key
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.8",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
49
49
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
50
50
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
51
|
-
"@atlaskit/icon": "^28.
|
|
51
|
+
"@atlaskit/icon": "^28.5.0",
|
|
52
52
|
"@atlaskit/insm": "^0.1.0",
|
|
53
53
|
"@atlaskit/menu": "^8.4.0",
|
|
54
54
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/primitives": "^14.15.0",
|
|
60
60
|
"@atlaskit/react-ufo": "^4.11.0",
|
|
61
61
|
"@atlaskit/theme": "^21.0.0",
|
|
62
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
62
|
+
"@atlaskit/tmp-editor-statsig": "^13.6.0",
|
|
63
63
|
"@atlaskit/toggle": "^15.1.0",
|
|
64
64
|
"@atlaskit/tokens": "^6.4.0",
|
|
65
65
|
"@atlaskit/tooltip": "^20.5.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"uuid": "^3.1.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@atlaskit/editor-common": "^110.
|
|
75
|
+
"@atlaskit/editor-common": "^110.9.0",
|
|
76
76
|
"react": "^18.2.0",
|
|
77
77
|
"react-dom": "^18.2.0",
|
|
78
78
|
"react-intl-next": "npm:react-intl@^5.18.1"
|