@atlaskit/editor-plugin-table 18.1.13 → 18.1.15

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 18.1.15
4
+
5
+ ### Patch Changes
6
+
7
+ - [`12e112a137d5f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/12e112a137d5f) -
8
+ Clean up platform_editor_table_fw_numcol_overflow_fix feature flag
9
+ - Updated dependencies
10
+
11
+ ## 18.1.14
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 18.1.13
4
18
 
5
19
  ### Patch Changes
@@ -228,22 +228,14 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
228
228
  // When: Show scroll bars -> containerWidth = akEditorGutterPadding * 2 + lineLength;
229
229
  // When: Always -> containerWidth = akEditorGutterPadding * 2 + lineLength + scrollbarWidth;
230
230
  // scrollbarWidth can vary. Values can be 14, 15, 16 and up to 20px;
231
- responsiveContainerWidth = isTableScalingEnabled ? lineLength : containerWidth - padding * 2 - resizeHandleSpacing;
232
-
233
- // platform_editor_table_fw_numcol_overflow_fix:
234
231
  // lineLength is undefined on first paint → width: NaN → wrapper expands to page
235
232
  // width. rAF col-sizing then runs before the number-column padding and
236
233
  // the final shrink, so column widths are locked in wrong.
237
- // With the flag ON, if the value isnt finite we fall back to gutterWidth
238
- // for that first frame—no flash, no premature rAF.
239
- //
240
- // Type clean-up comes later:
241
- // 1) ship this runtime guard (quick fix, no breakage);
242
- // 2) TODO: widen lineLength to `number|undefined` and remove this block.
243
- if ((0, _platformFeatureFlags.fg)('platform_editor_table_fw_numcol_overflow_fix')) {
244
- if (isTableScalingEnabled && !Number.isFinite(responsiveContainerWidth)) {
245
- responsiveContainerWidth = containerWidth - padding * 2 - resizeHandleSpacing;
246
- }
234
+ // If the value isn't finite we fall back to gutterWidth for that first frame.
235
+ if (isTableScalingEnabled && Number.isFinite(lineLength) && lineLength !== undefined) {
236
+ responsiveContainerWidth = lineLength;
237
+ } else {
238
+ responsiveContainerWidth = containerWidth - padding * 2 - resizeHandleSpacing;
247
239
  }
248
240
  } else if (isCommentEditor) {
249
241
  responsiveContainerWidth = containerWidth - _consts.TABLE_OFFSET_IN_COMMENT_EDITOR;
@@ -288,6 +280,8 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
288
280
  // when not resizing, maxWidth is calculated based on the container width via CSS
289
281
  return !isResizing ? nonResizingMaxWidth : maxResizerWidth;
290
282
  }, [isCommentEditor, isChromelessEditor, isTableScalingEnabled, isResizing, maxResizerWidth]);
283
+
284
+ // TODO: EDITOR-1679 - Add support for lineLength being undefined at runtime.
291
285
  var tableResizerProps = {
292
286
  // The `width` is used for .resizer-item in <TableResizer>, and it has to be a number
293
287
  // So we can't use min(var(--ak-editor-table-width), ${tableWidth}px) here
@@ -295,6 +289,7 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
295
289
  width: width,
296
290
  maxWidth: tableResizerMaxWidth,
297
291
  containerWidth: containerWidth,
292
+ // oxlint-disable-next-line @typescript-eslint/no-non-null-assertion -- To be fixed in EDITOR-1679
298
293
  lineLength: lineLength,
299
294
  updateWidth: updateWidth,
300
295
  editorView: editorView,
@@ -224,22 +224,14 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
224
224
  // When: Show scroll bars -> containerWidth = akEditorGutterPadding * 2 + lineLength;
225
225
  // When: Always -> containerWidth = akEditorGutterPadding * 2 + lineLength + scrollbarWidth;
226
226
  // scrollbarWidth can vary. Values can be 14, 15, 16 and up to 20px;
227
- responsiveContainerWidth = isTableScalingEnabled ? lineLength : containerWidth - padding * 2 - resizeHandleSpacing;
228
-
229
- // platform_editor_table_fw_numcol_overflow_fix:
230
227
  // lineLength is undefined on first paint → width: NaN → wrapper expands to page
231
228
  // width. rAF col-sizing then runs before the number-column padding and
232
229
  // the final shrink, so column widths are locked in wrong.
233
- // With the flag ON, if the value isnt finite we fall back to gutterWidth
234
- // for that first frame—no flash, no premature rAF.
235
- //
236
- // Type clean-up comes later:
237
- // 1) ship this runtime guard (quick fix, no breakage);
238
- // 2) TODO: widen lineLength to `number|undefined` and remove this block.
239
- if (fg('platform_editor_table_fw_numcol_overflow_fix')) {
240
- if (isTableScalingEnabled && !Number.isFinite(responsiveContainerWidth)) {
241
- responsiveContainerWidth = containerWidth - padding * 2 - resizeHandleSpacing;
242
- }
230
+ // If the value isn't finite we fall back to gutterWidth for that first frame.
231
+ if (isTableScalingEnabled && Number.isFinite(lineLength) && lineLength !== undefined) {
232
+ responsiveContainerWidth = lineLength;
233
+ } else {
234
+ responsiveContainerWidth = containerWidth - padding * 2 - resizeHandleSpacing;
243
235
  }
244
236
  } else if (isCommentEditor) {
245
237
  responsiveContainerWidth = containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR;
@@ -282,6 +274,8 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
282
274
  // when not resizing, maxWidth is calculated based on the container width via CSS
283
275
  return !isResizing ? nonResizingMaxWidth : maxResizerWidth;
284
276
  }, [isCommentEditor, isChromelessEditor, isTableScalingEnabled, isResizing, maxResizerWidth]);
277
+
278
+ // TODO: EDITOR-1679 - Add support for lineLength being undefined at runtime.
285
279
  const tableResizerProps = {
286
280
  // The `width` is used for .resizer-item in <TableResizer>, and it has to be a number
287
281
  // So we can't use min(var(--ak-editor-table-width), ${tableWidth}px) here
@@ -289,7 +283,8 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
289
283
  width,
290
284
  maxWidth: tableResizerMaxWidth,
291
285
  containerWidth,
292
- lineLength,
286
+ // oxlint-disable-next-line @typescript-eslint/no-non-null-assertion -- To be fixed in EDITOR-1679
287
+ lineLength: lineLength,
293
288
  updateWidth,
294
289
  editorView,
295
290
  getPos,
@@ -219,22 +219,14 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
219
219
  // When: Show scroll bars -> containerWidth = akEditorGutterPadding * 2 + lineLength;
220
220
  // When: Always -> containerWidth = akEditorGutterPadding * 2 + lineLength + scrollbarWidth;
221
221
  // scrollbarWidth can vary. Values can be 14, 15, 16 and up to 20px;
222
- responsiveContainerWidth = isTableScalingEnabled ? lineLength : containerWidth - padding * 2 - resizeHandleSpacing;
223
-
224
- // platform_editor_table_fw_numcol_overflow_fix:
225
222
  // lineLength is undefined on first paint → width: NaN → wrapper expands to page
226
223
  // width. rAF col-sizing then runs before the number-column padding and
227
224
  // the final shrink, so column widths are locked in wrong.
228
- // With the flag ON, if the value isnt finite we fall back to gutterWidth
229
- // for that first frame—no flash, no premature rAF.
230
- //
231
- // Type clean-up comes later:
232
- // 1) ship this runtime guard (quick fix, no breakage);
233
- // 2) TODO: widen lineLength to `number|undefined` and remove this block.
234
- if (fg('platform_editor_table_fw_numcol_overflow_fix')) {
235
- if (isTableScalingEnabled && !Number.isFinite(responsiveContainerWidth)) {
236
- responsiveContainerWidth = containerWidth - padding * 2 - resizeHandleSpacing;
237
- }
225
+ // If the value isn't finite we fall back to gutterWidth for that first frame.
226
+ if (isTableScalingEnabled && Number.isFinite(lineLength) && lineLength !== undefined) {
227
+ responsiveContainerWidth = lineLength;
228
+ } else {
229
+ responsiveContainerWidth = containerWidth - padding * 2 - resizeHandleSpacing;
238
230
  }
239
231
  } else if (isCommentEditor) {
240
232
  responsiveContainerWidth = containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR;
@@ -279,6 +271,8 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
279
271
  // when not resizing, maxWidth is calculated based on the container width via CSS
280
272
  return !isResizing ? nonResizingMaxWidth : maxResizerWidth;
281
273
  }, [isCommentEditor, isChromelessEditor, isTableScalingEnabled, isResizing, maxResizerWidth]);
274
+
275
+ // TODO: EDITOR-1679 - Add support for lineLength being undefined at runtime.
282
276
  var tableResizerProps = {
283
277
  // The `width` is used for .resizer-item in <TableResizer>, and it has to be a number
284
278
  // So we can't use min(var(--ak-editor-table-width), ${tableWidth}px) here
@@ -286,6 +280,7 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
286
280
  width: width,
287
281
  maxWidth: tableResizerMaxWidth,
288
282
  containerWidth: containerWidth,
283
+ // oxlint-disable-next-line @typescript-eslint/no-non-null-assertion -- To be fixed in EDITOR-1679
289
284
  lineLength: lineLength,
290
285
  updateWidth: updateWidth,
291
286
  editorView: editorView,
@@ -16,7 +16,7 @@ type ResizableTableContainerProps = {
16
16
  isTableAlignmentEnabled?: boolean;
17
17
  isTableScalingEnabled?: boolean;
18
18
  isWholeTableInDanger?: boolean;
19
- lineLength: number;
19
+ lineLength: number | undefined;
20
20
  node: PMNode;
21
21
  pluginInjectionApi?: PluginInjectionAPI;
22
22
  shouldUseIncreasedScalingPercent?: boolean;
@@ -16,7 +16,7 @@ type ResizableTableContainerProps = {
16
16
  isTableAlignmentEnabled?: boolean;
17
17
  isTableScalingEnabled?: boolean;
18
18
  isWholeTableInDanger?: boolean;
19
- lineLength: number;
19
+ lineLength: number | undefined;
20
20
  node: PMNode;
21
21
  pluginInjectionApi?: PluginInjectionAPI;
22
22
  shouldUseIncreasedScalingPercent?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "18.1.13",
3
+ "version": "18.1.15",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -49,16 +49,16 @@
49
49
  "@atlaskit/editor-shared-styles": "^3.10.0",
50
50
  "@atlaskit/editor-tables": "^2.9.0",
51
51
  "@atlaskit/icon": "^33.1.0",
52
- "@atlaskit/insm": "^0.3.0",
52
+ "@atlaskit/insm": "^0.4.0",
53
53
  "@atlaskit/menu": "^8.4.0",
54
54
  "@atlaskit/platform-feature-flags": "^1.1.0",
55
55
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
56
56
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
57
57
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
58
58
  "@atlaskit/primitives": "^18.1.0",
59
- "@atlaskit/tmp-editor-statsig": "^48.0.0",
59
+ "@atlaskit/tmp-editor-statsig": "^48.2.0",
60
60
  "@atlaskit/toggle": "^15.2.0",
61
- "@atlaskit/tokens": "^11.3.0",
61
+ "@atlaskit/tokens": "^11.4.0",
62
62
  "@atlaskit/tooltip": "^21.0.0",
63
63
  "@babel/runtime": "^7.0.0",
64
64
  "@emotion/react": "^11.7.1",
@@ -69,7 +69,7 @@
69
69
  "uuid": "^3.1.0"
70
70
  },
71
71
  "peerDependencies": {
72
- "@atlaskit/editor-common": "^112.11.0",
72
+ "@atlaskit/editor-common": "^112.12.0",
73
73
  "react": "^18.2.0",
74
74
  "react-dom": "^18.2.0",
75
75
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -111,9 +111,6 @@
111
111
  "platform_editor_tables_table_selector": {
112
112
  "type": "boolean"
113
113
  },
114
- "platform_editor_table_fw_numcol_overflow_fix": {
115
- "type": "boolean"
116
- },
117
114
  "platform_editor_adf_with_localid": {
118
115
  "type": "boolean"
119
116
  },