@atlaskit/editor-plugin-table 10.9.22 → 10.9.24

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,20 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 10.9.24
4
+
5
+ ### Patch Changes
6
+
7
+ - [#154343](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/154343)
8
+ [`65a57af636614`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/65a57af636614) -
9
+ [ux] ED-27894: add platform_editor_table_fw_numcol_overflow_fix to stop first-paint flash and
10
+ overflow on full-width numbered-column tables when refreshing page
11
+
12
+ ## 10.9.23
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 10.9.22
4
19
 
5
20
  ### Patch Changes
@@ -238,6 +238,22 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
238
238
  // When: Always -> containerWidth = akEditorGutterPadding * 2 + lineLength + scrollbarWidth;
239
239
  // scrollbarWidth can vary. Values can be 14, 15, 16 and up to 20px;
240
240
  responsiveContainerWidth = isTableScalingEnabled ? lineLength : containerWidth - (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() * 2 - resizeHandleSpacing;
241
+
242
+ // platform_editor_table_fw_numcol_overflow_fix:
243
+ // lineLength is undefined on first paint → width: NaN → wrapper expands to page
244
+ // width. rAF col-sizing then runs before the number-column padding and
245
+ // the final shrink, so column widths are locked in wrong.
246
+ // With the flag ON, if the value isn’t finite we fall back to gutterWidth
247
+ // for that first frame—no flash, no premature rAF.
248
+ //
249
+ // Type clean-up comes later:
250
+ // 1) ship this runtime guard (quick fix, no breakage);
251
+ // 2) TODO: widen lineLength to `number|undefined` and remove this block.
252
+ if ((0, _platformFeatureFlags.fg)('platform_editor_table_fw_numcol_overflow_fix')) {
253
+ if (isTableScalingEnabled && !Number.isFinite(responsiveContainerWidth)) {
254
+ responsiveContainerWidth = containerWidth - (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() * 2 - resizeHandleSpacing;
255
+ }
256
+ }
241
257
  } else if (isCommentEditor) {
242
258
  responsiveContainerWidth = containerWidth - _consts.TABLE_OFFSET_IN_COMMENT_EDITOR;
243
259
  } else {
@@ -234,6 +234,22 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
234
234
  // When: Always -> containerWidth = akEditorGutterPadding * 2 + lineLength + scrollbarWidth;
235
235
  // scrollbarWidth can vary. Values can be 14, 15, 16 and up to 20px;
236
236
  responsiveContainerWidth = isTableScalingEnabled ? lineLength : containerWidth - akEditorGutterPaddingDynamic() * 2 - resizeHandleSpacing;
237
+
238
+ // platform_editor_table_fw_numcol_overflow_fix:
239
+ // lineLength is undefined on first paint → width: NaN → wrapper expands to page
240
+ // width. rAF col-sizing then runs before the number-column padding and
241
+ // the final shrink, so column widths are locked in wrong.
242
+ // With the flag ON, if the value isn’t finite we fall back to gutterWidth
243
+ // for that first frame—no flash, no premature rAF.
244
+ //
245
+ // Type clean-up comes later:
246
+ // 1) ship this runtime guard (quick fix, no breakage);
247
+ // 2) TODO: widen lineLength to `number|undefined` and remove this block.
248
+ if (fg('platform_editor_table_fw_numcol_overflow_fix')) {
249
+ if (isTableScalingEnabled && !Number.isFinite(responsiveContainerWidth)) {
250
+ responsiveContainerWidth = containerWidth - akEditorGutterPaddingDynamic() * 2 - resizeHandleSpacing;
251
+ }
252
+ }
237
253
  } else if (isCommentEditor) {
238
254
  responsiveContainerWidth = containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR;
239
255
  } else {
@@ -228,6 +228,22 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
228
228
  // When: Always -> containerWidth = akEditorGutterPadding * 2 + lineLength + scrollbarWidth;
229
229
  // scrollbarWidth can vary. Values can be 14, 15, 16 and up to 20px;
230
230
  responsiveContainerWidth = isTableScalingEnabled ? lineLength : containerWidth - akEditorGutterPaddingDynamic() * 2 - resizeHandleSpacing;
231
+
232
+ // platform_editor_table_fw_numcol_overflow_fix:
233
+ // lineLength is undefined on first paint → width: NaN → wrapper expands to page
234
+ // width. rAF col-sizing then runs before the number-column padding and
235
+ // the final shrink, so column widths are locked in wrong.
236
+ // With the flag ON, if the value isn’t finite we fall back to gutterWidth
237
+ // for that first frame—no flash, no premature rAF.
238
+ //
239
+ // Type clean-up comes later:
240
+ // 1) ship this runtime guard (quick fix, no breakage);
241
+ // 2) TODO: widen lineLength to `number|undefined` and remove this block.
242
+ if (fg('platform_editor_table_fw_numcol_overflow_fix')) {
243
+ if (isTableScalingEnabled && !Number.isFinite(responsiveContainerWidth)) {
244
+ responsiveContainerWidth = containerWidth - akEditorGutterPaddingDynamic() * 2 - resizeHandleSpacing;
245
+ }
246
+ }
231
247
  } else if (isCommentEditor) {
232
248
  responsiveContainerWidth = containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR;
233
249
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "10.9.22",
3
+ "version": "10.9.24",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/editor-plugin-batch-attribute-updates": "^2.1.0",
40
40
  "@atlaskit/editor-plugin-content-insertion": "^2.1.0",
41
41
  "@atlaskit/editor-plugin-editor-viewmode": "^3.1.0",
42
- "@atlaskit/editor-plugin-extension": "5.3.7",
42
+ "@atlaskit/editor-plugin-extension": "5.3.8",
43
43
  "@atlaskit/editor-plugin-guideline": "^2.0.0",
44
44
  "@atlaskit/editor-plugin-selection": "^2.2.0",
45
45
  "@atlaskit/editor-plugin-width": "^3.0.0",
@@ -51,7 +51,7 @@
51
51
  "@atlaskit/platform-feature-flags": "^1.1.0",
52
52
  "@atlaskit/pragmatic-drag-and-drop": "^1.6.0",
53
53
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
54
- "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
54
+ "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
55
55
  "@atlaskit/primitives": "^14.7.0",
56
56
  "@atlaskit/theme": "^18.0.0",
57
57
  "@atlaskit/tmp-editor-statsig": "^4.21.0",
@@ -209,6 +209,9 @@
209
209
  },
210
210
  "platform_editor_controls_patch_8": {
211
211
  "type": "boolean"
212
+ },
213
+ "platform_editor_table_fw_numcol_overflow_fix": {
214
+ "type": "boolean"
212
215
  }
213
216
  }
214
217
  }
@@ -352,6 +352,23 @@ export const ResizableTableContainer = React.memo(
352
352
  responsiveContainerWidth = isTableScalingEnabled
353
353
  ? lineLength
354
354
  : containerWidth - akEditorGutterPaddingDynamic() * 2 - resizeHandleSpacing;
355
+
356
+ // platform_editor_table_fw_numcol_overflow_fix:
357
+ // lineLength is undefined on first paint → width: NaN → wrapper expands to page
358
+ // width. rAF col-sizing then runs before the number-column padding and
359
+ // the final shrink, so column widths are locked in wrong.
360
+ // With the flag ON, if the value isn’t finite we fall back to gutterWidth
361
+ // for that first frame—no flash, no premature rAF.
362
+ //
363
+ // Type clean-up comes later:
364
+ // 1) ship this runtime guard (quick fix, no breakage);
365
+ // 2) TODO: widen lineLength to `number|undefined` and remove this block.
366
+ if (fg('platform_editor_table_fw_numcol_overflow_fix')) {
367
+ if (isTableScalingEnabled && !Number.isFinite(responsiveContainerWidth)) {
368
+ responsiveContainerWidth =
369
+ containerWidth - akEditorGutterPaddingDynamic() * 2 - resizeHandleSpacing;
370
+ }
371
+ }
355
372
  } else if (isCommentEditor) {
356
373
  responsiveContainerWidth = containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR;
357
374
  } else {