@atlaskit/editor-plugin-table 5.3.39 → 5.4.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.
Files changed (24) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/plugins/table/nodeviews/TableRow.js +158 -45
  3. package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/DragCornerControls.js +0 -6
  4. package/dist/cjs/plugins/table/ui/TableFloatingControls/RowDropTarget/index.js +3 -0
  5. package/dist/cjs/plugins/table/ui/common-styles.js +18 -7
  6. package/dist/cjs/plugins/table/ui/ui-styles.js +1 -1
  7. package/dist/es2019/plugins/table/nodeviews/TableRow.js +163 -50
  8. package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/DragCornerControls.js +1 -9
  9. package/dist/es2019/plugins/table/ui/TableFloatingControls/RowDropTarget/index.js +1 -0
  10. package/dist/es2019/plugins/table/ui/common-styles.js +17 -0
  11. package/dist/es2019/plugins/table/ui/ui-styles.js +25 -15
  12. package/dist/esm/plugins/table/nodeviews/TableRow.js +158 -46
  13. package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/DragCornerControls.js +1 -7
  14. package/dist/esm/plugins/table/ui/TableFloatingControls/RowDropTarget/index.js +3 -0
  15. package/dist/esm/plugins/table/ui/common-styles.js +18 -7
  16. package/dist/esm/plugins/table/ui/ui-styles.js +1 -1
  17. package/dist/types/plugins/table/nodeviews/TableRow.d.ts +3 -0
  18. package/dist/types-ts4.5/plugins/table/nodeviews/TableRow.d.ts +3 -0
  19. package/package.json +5 -2
  20. package/src/plugins/table/nodeviews/TableRow.ts +199 -52
  21. package/src/plugins/table/ui/TableFloatingControls/CornerControls/DragCornerControls.tsx +1 -7
  22. package/src/plugins/table/ui/TableFloatingControls/RowDropTarget/index.tsx +1 -0
  23. package/src/plugins/table/ui/common-styles.ts +23 -0
  24. package/src/plugins/table/ui/ui-styles.ts +28 -15
@@ -5,6 +5,7 @@ import {
5
5
  tableSharedStyle,
6
6
  } from '@atlaskit/editor-common/styles';
7
7
  import type { FeatureFlags } from '@atlaskit/editor-common/types';
8
+ import { browser } from '@atlaskit/editor-common/utils';
8
9
  import {
9
10
  akEditorSelectedNodeClassName,
10
11
  akEditorSmallZIndex,
@@ -246,6 +247,26 @@ const tableStickyHeaderColumnControlsDecorationsStyle = (
246
247
  }
247
248
  };
248
249
 
250
+ const tableStickyHeaderFirefoxFixStyle = (
251
+ props: ThemeProps & { featureFlags?: FeatureFlags },
252
+ ) => {
253
+ /*
254
+ This is MAGIC!
255
+ This fixes a bug which occurs in firefox when the first row becomes sticky.
256
+ see https://product-fabric.atlassian.net/browse/ED-19177
257
+ */
258
+ if (
259
+ browser.gecko &&
260
+ getBooleanFF('platform.editor.table.alternative-sticky-header-logic')
261
+ ) {
262
+ return css`
263
+ .${ClassName.TABLE_STICKY} > tbody::before {
264
+ content: '';
265
+ }
266
+ `;
267
+ }
268
+ };
269
+
249
270
  const tableRowControlStyles = () => {
250
271
  return getBooleanFF('platform.editor.table.drag-and-drop')
251
272
  ? css`
@@ -402,6 +423,8 @@ export const tableStyles = (
402
423
 
403
424
  ${tableStickyHeaderColumnControlsDecorationsStyle(props)}
404
425
 
426
+ ${tableStickyHeaderFirefoxFixStyle(props)}
427
+
405
428
  .${ClassName.TABLE_STICKY}
406
429
  .${ClassName.ROW_CONTROLS}
407
430
  .${ClassName.ROW_CONTROLS_BUTTON_WRAP}.sticky {
@@ -222,16 +222,15 @@ export const dragInsertButtonWrapper = (props: ThemeProps) => css`
222
222
 
223
223
  export const dragCornerControlButton = (props: ThemeProps) => css`
224
224
  .${ClassName.DRAG_CORNER_BUTTON} {
225
- width: 12px;
226
- height: 12px;
225
+ width: 24px;
226
+ height: 24px;
227
227
  display: flex;
228
- justify-content: center;
229
- align-items: center;
228
+ justify-content: flex-end;
229
+ align-items: flex-end;
230
230
  position: absolute;
231
- top: ${token('space.negative.075', '-6px')};
232
- left: ${token('space.075', '6px')};
233
- background-color: ${token('elevation.surface', '#FFF')};
234
- border-radius: 50%;
231
+ top: ${token('space.negative.250', '-20px')};
232
+ left: ${token('space.negative.100', '-8px')};
233
+ background-color: transparent;
235
234
  border: none;
236
235
  padding: 0;
237
236
  outline: none;
@@ -239,24 +238,38 @@ export const dragCornerControlButton = (props: ThemeProps) => css`
239
238
 
240
239
  &.active .${ClassName.DRAG_CORNER_BUTTON_INNER} {
241
240
  background-color: ${token('color.border.selected', '#0C66E4')};
242
- border-color: ${token('color.border.selected', '#0C66E4')};
241
+ width: 10px;
242
+ height: 10px;
243
+ border-width: 2px;
244
+ border-radius: 4px;
245
+ top: ${token('space.075', '6px')};
246
+ left: ${token('space.075', '6px')};
243
247
  }
244
248
 
245
249
  &:hover {
246
250
  cursor: pointer;
247
251
 
248
252
  .${ClassName.DRAG_CORNER_BUTTON_INNER} {
249
- border-color: ${token('color.border.selected', '#0C66E4')};
253
+ width: 10px;
254
+ height: 10px;
255
+ border-width: 2px;
256
+ border-radius: 4px;
257
+ top: ${token('space.075', '6px')};
258
+ left: ${token('space.075', '6px')};
250
259
  }
251
260
  }
252
261
  }
253
262
 
254
263
  .${ClassName.DRAG_CORNER_BUTTON_INNER} {
255
- border: 1px solid
256
- ${token('color.background.accent.gray.subtler', '#DCDFE4')};
257
- border-radius: 50%;
258
- width: 6px;
259
- height: 6px;
264
+ border: 1px solid ${token('color.border.inverse', '#FFF')};
265
+ background-color: ${token(
266
+ 'color.background.accent.gray.subtler',
267
+ '#DCDFE4',
268
+ )};
269
+ border-radius: 2px;
270
+ width: 5px;
271
+ height: 5px;
272
+ position: relative;
260
273
  }
261
274
  `;
262
275