@atlaskit/editor-plugin-table 4.0.1 → 4.0.3

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 (209) hide show
  1. package/CHANGELOG.md +146 -133
  2. package/README.md +1 -1
  3. package/dist/cjs/i18n/cs.js +2 -3
  4. package/dist/cjs/i18n/da.js +2 -3
  5. package/dist/cjs/i18n/de.js +2 -3
  6. package/dist/cjs/i18n/en.js +2 -3
  7. package/dist/cjs/i18n/en_GB.js +2 -3
  8. package/dist/cjs/i18n/en_ZZ.js +2 -3
  9. package/dist/cjs/i18n/es.js +2 -3
  10. package/dist/cjs/i18n/fi.js +2 -3
  11. package/dist/cjs/i18n/fr.js +2 -3
  12. package/dist/cjs/i18n/hu.js +2 -3
  13. package/dist/cjs/i18n/it.js +2 -3
  14. package/dist/cjs/i18n/ja.js +2 -3
  15. package/dist/cjs/i18n/ko.js +2 -3
  16. package/dist/cjs/i18n/nb.js +2 -3
  17. package/dist/cjs/i18n/nl.js +2 -3
  18. package/dist/cjs/i18n/pl.js +2 -3
  19. package/dist/cjs/i18n/pt_BR.js +2 -3
  20. package/dist/cjs/i18n/ru.js +2 -3
  21. package/dist/cjs/i18n/sv.js +2 -3
  22. package/dist/cjs/i18n/th.js +2 -3
  23. package/dist/cjs/i18n/tr.js +2 -3
  24. package/dist/cjs/i18n/uk.js +2 -3
  25. package/dist/cjs/i18n/vi.js +2 -3
  26. package/dist/cjs/i18n/zh.js +2 -3
  27. package/dist/cjs/i18n/zh_TW.js +2 -3
  28. package/dist/cjs/plugins/table/commands/clear.js +3 -5
  29. package/dist/cjs/plugins/table/commands/collapse.js +2 -3
  30. package/dist/cjs/plugins/table/commands/go-to-next-cell.js +2 -3
  31. package/dist/cjs/plugins/table/commands/hover.js +8 -15
  32. package/dist/cjs/plugins/table/commands/insert.js +8 -13
  33. package/dist/cjs/plugins/table/commands/misc.js +23 -45
  34. package/dist/cjs/plugins/table/commands/referentiality.js +2 -3
  35. package/dist/cjs/plugins/table/commands/selection.js +3 -6
  36. package/dist/cjs/plugins/table/commands/sort.js +5 -6
  37. package/dist/cjs/plugins/table/commands/split-cell.js +2 -3
  38. package/dist/cjs/plugins/table/commands/toggle.js +7 -13
  39. package/dist/cjs/plugins/table/commands-with-analytics.js +19 -37
  40. package/dist/cjs/plugins/table/create-plugin-config.js +2 -3
  41. package/dist/cjs/plugins/table/event-handlers.js +12 -22
  42. package/dist/cjs/plugins/table/handlers.js +4 -5
  43. package/dist/cjs/plugins/table/index.js +8 -9
  44. package/dist/cjs/plugins/table/nodeviews/OverflowShadowsObserver.js +5 -6
  45. package/dist/cjs/plugins/table/nodeviews/TableComponent.js +2 -3
  46. package/dist/cjs/plugins/table/nodeviews/TableContainer.js +10 -13
  47. package/dist/cjs/plugins/table/nodeviews/TableResizer.js +4 -5
  48. package/dist/cjs/plugins/table/nodeviews/TableStickyScrollbar.js +5 -10
  49. package/dist/cjs/plugins/table/nodeviews/table.js +4 -6
  50. package/dist/cjs/plugins/table/nodeviews/tableCell.js +2 -3
  51. package/dist/cjs/plugins/table/nodeviews/update-overflow-shadows.js +2 -3
  52. package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +5 -9
  53. package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-controls.js +3 -5
  54. package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-resizing.js +3 -5
  55. package/dist/cjs/plugins/table/pm-plugins/decorations/utils/compose-decorations.js +2 -3
  56. package/dist/cjs/plugins/table/pm-plugins/default-table-selection.js +2 -3
  57. package/dist/cjs/plugins/table/pm-plugins/keymap.js +1 -2
  58. package/dist/cjs/plugins/table/pm-plugins/main.js +2 -3
  59. package/dist/cjs/plugins/table/pm-plugins/plugin-factory.js +3 -6
  60. package/dist/cjs/plugins/table/pm-plugins/plugin-key.js +1 -2
  61. package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +3 -5
  62. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/commands.js +3 -5
  63. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +3 -5
  64. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +6 -8
  65. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin-key.js +1 -2
  66. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin-state.js +2 -4
  67. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin.js +2 -3
  68. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/util.js +2 -3
  69. package/dist/cjs/plugins/table/pm-plugins/table-analytics.js +5 -8
  70. package/dist/cjs/plugins/table/pm-plugins/table-local-id.js +2 -3
  71. package/dist/cjs/plugins/table/pm-plugins/table-resizing/commands.js +7 -13
  72. package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +3 -4
  73. package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin-factory.js +3 -6
  74. package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin-key.js +1 -2
  75. package/dist/cjs/plugins/table/pm-plugins/table-resizing/reducer.js +2 -3
  76. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +7 -13
  77. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/column-state.js +5 -10
  78. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/consts.js +2 -4
  79. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/dom.js +8 -15
  80. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -3
  81. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-column.js +2 -3
  82. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +70 -71
  83. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +11 -21
  84. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +5 -9
  85. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.js +2 -3
  86. package/dist/cjs/plugins/table/pm-plugins/table-selection-keymap.js +1 -2
  87. package/dist/cjs/plugins/table/pm-plugins/table-width.js +3 -5
  88. package/dist/cjs/plugins/table/reducer.js +2 -3
  89. package/dist/cjs/plugins/table/toolbar.js +8 -12
  90. package/dist/cjs/plugins/table/transforms/column-width.js +4 -6
  91. package/dist/cjs/plugins/table/transforms/delete-columns.js +60 -60
  92. package/dist/cjs/plugins/table/transforms/delete-rows.js +52 -52
  93. package/dist/cjs/plugins/table/transforms/fix-tables.js +3 -6
  94. package/dist/cjs/plugins/table/transforms/replace-table.js +3 -4
  95. package/dist/cjs/plugins/table/types.js +5 -9
  96. package/dist/cjs/plugins/table/ui/ColumnResizeWidget/index.js +2 -3
  97. package/dist/cjs/plugins/table/ui/FloatingContextualButton/FixedButton.js +5 -10
  98. package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +3 -5
  99. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +7 -10
  100. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +1 -2
  101. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +2 -4
  102. package/dist/cjs/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +1 -2
  103. package/dist/cjs/plugins/table/ui/FloatingDeleteButton/index.js +1 -2
  104. package/dist/cjs/plugins/table/ui/FloatingInsertButton/InsertButton.js +1 -2
  105. package/dist/cjs/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +1 -2
  106. package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +2 -4
  107. package/dist/cjs/plugins/table/ui/LayoutButton/index.js +1 -2
  108. package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -2
  109. package/dist/cjs/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +2 -3
  110. package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/index.js +1 -2
  111. package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +1 -2
  112. package/dist/cjs/plugins/table/ui/common-styles.js +23 -14
  113. package/dist/cjs/plugins/table/ui/consts.js +47 -94
  114. package/dist/cjs/plugins/table/ui/messages.js +2 -3
  115. package/dist/cjs/plugins/table/ui/ui-styles.js +32 -38
  116. package/dist/cjs/plugins/table/utils/analytics.js +7 -12
  117. package/dist/cjs/plugins/table/utils/collapse.js +3 -5
  118. package/dist/cjs/plugins/table/utils/column-controls.js +6 -11
  119. package/dist/cjs/plugins/table/utils/decoration.js +10 -19
  120. package/dist/cjs/plugins/table/utils/dom.js +16 -28
  121. package/dist/cjs/plugins/table/utils/guidelines.js +1 -2
  122. package/dist/cjs/plugins/table/utils/nodes.js +12 -23
  123. package/dist/cjs/plugins/table/utils/paste.js +10 -16
  124. package/dist/cjs/plugins/table/utils/row-controls.js +7 -13
  125. package/dist/cjs/plugins/table/utils/selection.js +5 -9
  126. package/dist/cjs/plugins/table/utils/snapping.js +4 -7
  127. package/dist/cjs/plugins/table/utils/table.js +3 -5
  128. package/dist/cjs/plugins/table/utils/update-plugin-state-decorations.js +2 -3
  129. package/dist/cjs/plugins/table-plugin.js +1 -2
  130. package/dist/es2019/plugins/table/commands/insert.js +1 -1
  131. package/dist/es2019/plugins/table/commands/sort.js +1 -1
  132. package/dist/es2019/plugins/table/handlers.js +1 -1
  133. package/dist/es2019/plugins/table/toolbar.js +1 -1
  134. package/dist/es2019/plugins/table/transforms/delete-columns.js +1 -1
  135. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -1
  136. package/dist/es2019/plugins/table/ui/common-styles.js +40 -4
  137. package/dist/es2019/plugins/table/ui/ui-styles.js +223 -85
  138. package/dist/esm/plugins/table/commands/insert.js +1 -1
  139. package/dist/esm/plugins/table/commands/sort.js +1 -1
  140. package/dist/esm/plugins/table/event-handlers.js +1 -1
  141. package/dist/esm/plugins/table/handlers.js +1 -1
  142. package/dist/esm/plugins/table/index.js +7 -7
  143. package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +3 -3
  144. package/dist/esm/plugins/table/nodeviews/TableComponent.js +1 -1
  145. package/dist/esm/plugins/table/nodeviews/TableContainer.js +6 -6
  146. package/dist/esm/plugins/table/nodeviews/TableResizer.js +2 -2
  147. package/dist/esm/plugins/table/nodeviews/TableStickyScrollbar.js +3 -7
  148. package/dist/esm/plugins/table/nodeviews/table.js +1 -1
  149. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +3 -3
  150. package/dist/esm/plugins/table/pm-plugins/table-analytics.js +1 -1
  151. package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +1 -1
  152. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +68 -67
  153. package/dist/esm/plugins/table/toolbar.js +2 -2
  154. package/dist/esm/plugins/table/transforms/column-width.js +1 -1
  155. package/dist/esm/plugins/table/transforms/delete-columns.js +57 -56
  156. package/dist/esm/plugins/table/transforms/delete-rows.js +51 -50
  157. package/dist/esm/plugins/table/transforms/replace-table.js +1 -1
  158. package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +2 -2
  159. package/dist/esm/plugins/table/ui/common-styles.js +20 -6
  160. package/dist/esm/plugins/table/ui/ui-styles.js +18 -10
  161. package/dist/esm/plugins/table/utils/analytics.js +1 -1
  162. package/dist/esm/plugins/table/utils/dom.js +1 -1
  163. package/dist/esm/plugins/table/utils/paste.js +4 -4
  164. package/dist/types/plugins/table/commands/sort.d.ts +2 -2
  165. package/dist/types/plugins/table/commands-with-analytics.d.ts +4 -4
  166. package/dist/types/plugins/table/handlers.d.ts +2 -2
  167. package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +1 -1
  168. package/dist/types/plugins/table/types.d.ts +1 -1
  169. package/dist/types/plugins/table/ui/TableFloatingControls/index.d.ts +4 -4
  170. package/dist/types-ts4.5/plugins/table/commands/sort.d.ts +2 -2
  171. package/dist/types-ts4.5/plugins/table/commands-with-analytics.d.ts +4 -4
  172. package/dist/types-ts4.5/plugins/table/handlers.d.ts +2 -2
  173. package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +1 -1
  174. package/dist/types-ts4.5/plugins/table/types.d.ts +1 -1
  175. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +4 -4
  176. package/docs/0-intro.tsx +1 -1
  177. package/package.json +8 -4
  178. package/src/__tests__/integration/__snapshots__/auto-size.ts.snap +3 -0
  179. package/src/__tests__/integration/__snapshots__/copy-button.ts.snap +2 -0
  180. package/src/__tests__/integration/__snapshots__/delete-columns.ts.snap +2 -0
  181. package/src/__tests__/integration/__snapshots__/delete-last-column-in-full-width.ts.snap +1 -0
  182. package/src/__tests__/integration/__snapshots__/delete-last-column-with-empty-action.ts.snap +1 -0
  183. package/src/__tests__/integration/__snapshots__/delete-last-row-with-empty-action.ts.snap +2 -0
  184. package/src/__tests__/integration/__snapshots__/delete-rows.ts.snap +3 -0
  185. package/src/__tests__/integration/__snapshots__/deleting-empty-paragraph-under-table.ts.snap +3 -0
  186. package/src/__tests__/integration/__snapshots__/even-columns.ts.snap +2 -0
  187. package/src/__tests__/integration/__snapshots__/insert-cell-header-with-strong-mark.ts.snap +1 -0
  188. package/src/__tests__/integration/__snapshots__/insert-row-inside-layout.ts.snap +1 -0
  189. package/src/__tests__/integration/__snapshots__/layout.ts.snap +9 -0
  190. package/src/__tests__/integration/__snapshots__/resize.ts.snap +11 -0
  191. package/src/__tests__/integration/__snapshots__/scale.ts.snap +2 -0
  192. package/src/__tests__/unit/commands/sort.ts +1 -1
  193. package/src/__tests__/unit/pm-plugins/table-width.ts +190 -1
  194. package/src/__tests__/unit/sort-column.ts +1 -1
  195. package/src/plugins/table/commands/insert.ts +1 -1
  196. package/src/plugins/table/commands/sort.ts +7 -7
  197. package/src/plugins/table/commands-with-analytics.ts +11 -6
  198. package/src/plugins/table/handlers.ts +7 -8
  199. package/src/plugins/table/nodeviews/TableComponent.tsx +1 -1
  200. package/src/plugins/table/nodeviews/table.tsx +1 -1
  201. package/src/plugins/table/toolbar.tsx +1 -1
  202. package/src/plugins/table/transforms/delete-columns.ts +1 -1
  203. package/src/plugins/table/types.ts +1 -1
  204. package/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx +1 -1
  205. package/src/plugins/table/ui/TableFloatingControls/index.tsx +4 -4
  206. package/src/plugins/table/ui/common-styles.ts +46 -4
  207. package/src/plugins/table/ui/ui-styles.ts +235 -90
  208. package/tsconfig.app.json +3 -0
  209. package/tsconfig.dev.json +3 -0
@@ -230,19 +230,36 @@ export const OverflowShadow = props => css`
230
230
  }
231
231
  }
232
232
  `;
233
- const columnHeaderButton = (props, cssString) => css`
234
- background: ${tableHeaderCellBackgroundColor(props)};
235
- border: 1px solid ${tableBorderColor(props)};
236
- display: block;
237
- box-sizing: border-box;
238
- padding: 0;
239
-
240
- :focus {
241
- outline: none;
242
- }
233
+ const columnHeaderButton = (props, cssString) => {
234
+ if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
235
+ return css`
236
+ background: ${tableHeaderCellBackgroundColor(props)};
237
+ display: block;
238
+ box-sizing: border-box;
239
+ padding: 0;
243
240
 
244
- ${cssString}
245
- `;
241
+ :focus {
242
+ outline: none;
243
+ }
244
+
245
+ ${cssString}
246
+ `;
247
+ } else {
248
+ return css`
249
+ background: ${tableHeaderCellBackgroundColor(props)};
250
+ border: 1px solid ${tableBorderColor(props)};
251
+ display: block;
252
+ box-sizing: border-box;
253
+ padding: 0;
254
+
255
+ :focus {
256
+ outline: none;
257
+ }
258
+
259
+ ${cssString}
260
+ `;
261
+ }
262
+ };
246
263
  const columnHeaderButtonSelected = props => css`
247
264
  color: ${`var(--ds-text-inverse, ${N0})`};
248
265
  background-color: ${tableToolbarSelectedColor(props)};
@@ -269,99 +286,220 @@ const getFloatingDotOverrides = props => {
269
286
  }
270
287
  ` : '';
271
288
  };
272
- export const columnControlsDecoration = props => css`
273
- .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
274
- display: none;
275
- cursor: pointer;
276
- position: absolute;
277
- width: calc(100% + ${tableCellBorderWidth * 2}px);
278
- left: -1px;
279
- top: -${columnControlsDecorationHeight + tableCellBorderWidth}px;
280
- height: ${columnControlsDecorationHeight}px;
281
- // floating dot for adding column button
282
- &::before {
283
- content: ' ';
284
- background-color: ${tableBorderColor(props)};
285
- position: absolute;
286
- height: ${lineMarkerSize}px;
287
- width: ${lineMarkerSize}px;
288
- border-radius: 50%;
289
- pointer-events: none;
290
- top: 2px;
291
- right: -1px;
292
- }
289
+ export const columnControlsDecoration = props => {
290
+ if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
291
+ return css`
292
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
293
+ display: none;
294
+ cursor: pointer;
295
+ position: absolute;
296
+ width: 100%;
297
+ left: 0;
298
+ top: -${columnControlsDecorationHeight + tableCellBorderWidth}px;
299
+ height: ${columnControlsDecorationHeight}px;
300
+ // floating dot for adding column button
301
+ &::before {
302
+ content: ' ';
303
+ background-color: ${tableBorderColor(props)};
304
+ position: absolute;
305
+ height: ${lineMarkerSize}px;
306
+ width: ${lineMarkerSize}px;
307
+ border-radius: 50%;
308
+ pointer-events: none;
309
+ top: 2px;
310
+ right: -1px;
311
+ }
293
312
 
294
- &::after {
295
- content: ' ';
313
+ &::after {
314
+ content: ' ';
296
315
 
297
- ${columnHeaderButton(props, `
316
+ ${columnHeaderButton(props, `
298
317
  border-right: ${tableCellBorderWidth}px solid ${tableBorderColor(props)};
299
- border-bottom: none;
300
- height: ${tableToolbarSize}px;
318
+ border-top: ${tableCellBorderWidth}px solid ${tableBorderColor(props)};
319
+ border-bottom: ${tableCellBorderWidth}px solid ${tableBorderColor(props)};
320
+ box-sizing: content-box;
321
+ height: ${tableToolbarSize - 1}px;
301
322
  width: 100%;
302
323
  position: absolute;
303
324
  top: ${columnControlsDecorationHeight - tableToolbarSize}px;
304
325
  left: 0px;
305
326
  z-index: ${columnControlsZIndex};
306
327
  `)}
307
- }
308
- }
328
+ }
329
+ }
309
330
 
310
- // floating dot for adding column button - overriding style on last column to avoid scroll
311
- ${getFloatingDotOverrides(props)}
331
+ // floating dot for adding column button - overriding style on last column to avoid scroll
332
+ ${getFloatingDotOverrides(props)}
312
333
 
313
- div.${ClassName.WITH_CONTROLS}>.${ClassName.ROW_CONTROLS_WRAPPER}::after {
314
- content: ' ';
315
- background-color: ${tableBorderColor(props)};
316
- position: absolute;
317
- height: ${lineMarkerSize}px;
318
- width: ${lineMarkerSize}px;
319
- border-radius: 50%;
320
- pointer-events: none;
321
- top: -${tableToolbarSize + tableCellBorderWidth}px;
322
- right: -1px;
323
- }
334
+ div.${ClassName.WITH_CONTROLS}>.${ClassName.ROW_CONTROLS_WRAPPER}::after {
335
+ content: ' ';
336
+ background-color: ${tableBorderColor(props)};
337
+ position: absolute;
338
+ height: ${lineMarkerSize}px;
339
+ width: ${lineMarkerSize}px;
340
+ border-radius: 50%;
341
+ pointer-events: none;
342
+ top: -${tableToolbarSize + tableCellBorderWidth}px;
343
+ right: -1px;
344
+ }
324
345
 
325
- .${ClassName.WITH_CONTROLS} .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
326
- display: block;
327
- }
346
+ .${ClassName.WITH_CONTROLS} .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
347
+ display: block;
348
+ }
328
349
 
329
- table
330
- tr:first-of-type
331
- td.${ClassName.TABLE_CELL},
332
- table
333
- tr:first-of-type
334
- th.${ClassName.TABLE_HEADER_CELL} {
335
- &.${ClassName.COLUMN_SELECTED},
336
- &.${ClassName.HOVERED_COLUMN},
337
- &.${ClassName.HOVERED_TABLE} {
338
- .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
339
- ${columnHeaderButtonSelected(props)};
350
+ table tr:first-of-type th.${ClassName.TABLE_HEADER_CELL} {
351
+ &.${ClassName.COLUMN_SELECTED}, &.${ClassName.HOVERED_TABLE} {
352
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
353
+ ${columnHeaderButtonSelected(props)};
354
+ }
355
+
356
+ &.${ClassName.HOVERED_CELL_IN_DANGER}
357
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
358
+ background-color: ${tableToolbarDeleteColor(props)};
359
+ border-color: ${tableBorderDeleteColor(props)};
360
+ z-index: ${akEditorUnitZIndex * 100};
361
+ }
362
+ }
363
+ }
364
+
365
+ table tr:first-of-type th.${ClassName.TABLE_HEADER_CELL} {
366
+ &.${ClassName.COLUMN_SELECTED}, &.${ClassName.HOVERED_COLUMN} {
367
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
368
+ ${columnHeaderButtonSelected(props)};
369
+ border-left: ${tableCellBorderWidth}px solid
370
+ ${tableBorderSelectedColor(props)};
371
+ left: -${tableCellBorderWidth}px;
372
+ }
373
+ }
340
374
  }
341
375
 
342
- &.${ClassName.HOVERED_CELL_IN_DANGER}
376
+ table tr:first-of-type th.${ClassName.TABLE_HEADER_CELL} {
377
+ &.${ClassName.HOVERED_COLUMN} {
378
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
379
+ ${columnHeaderButtonSelected(props)};
380
+ }
381
+
382
+ &.${ClassName.HOVERED_CELL_IN_DANGER}
383
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
384
+ background-color: ${tableToolbarDeleteColor(props)};
385
+ border-color: ${tableBorderDeleteColor(props)};
386
+ border-left: ${tableCellBorderWidth}px solid
387
+ ${tableBorderDeleteColor(props)};
388
+ left: -${tableCellBorderWidth}px;
389
+ z-index: ${akEditorUnitZIndex * 100};
390
+ }
391
+ }
392
+ }
393
+
394
+ .${ClassName.TABLE_SELECTED}
395
+ table
396
+ tr:first-of-type
397
+ td.${ClassName.TABLE_CELL},
398
+ .${ClassName.TABLE_SELECTED}
399
+ table
400
+ tr:first-of-type
401
+ th.${ClassName.TABLE_HEADER_CELL} {
343
402
  .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
344
- background-color: ${tableToolbarDeleteColor(props)};
345
- border: 1px solid ${tableBorderDeleteColor(props)};
403
+ ${columnHeaderButtonSelected(props)};
404
+ }
405
+ }
406
+ `;
407
+ } else {
408
+ return css`
409
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
410
+ display: none;
411
+ cursor: pointer;
412
+ position: absolute;
413
+ width: calc(100% + ${tableCellBorderWidth * 2}px);
414
+ left: -1px;
415
+ top: -${columnControlsDecorationHeight + tableCellBorderWidth}px;
416
+ height: ${columnControlsDecorationHeight}px;
417
+ // floating dot for adding column button
418
+ &::before {
419
+ content: ' ';
420
+ background-color: ${tableBorderColor(props)};
421
+ position: absolute;
422
+ height: ${lineMarkerSize}px;
423
+ width: ${lineMarkerSize}px;
424
+ border-radius: 50%;
425
+ pointer-events: none;
426
+ top: 2px;
427
+ right: -1px;
428
+ }
429
+
430
+ &::after {
431
+ content: ' ';
432
+
433
+ ${columnHeaderButton(props, `
434
+ border-right: ${tableCellBorderWidth}px solid ${tableBorderColor(props)};
346
435
  border-bottom: none;
347
- z-index: ${akEditorUnitZIndex * 100};
436
+ height: ${tableToolbarSize}px;
437
+ width: 100%;
438
+ position: absolute;
439
+ top: ${columnControlsDecorationHeight - tableToolbarSize}px;
440
+ left: 0px;
441
+ z-index: ${columnControlsZIndex};
442
+ `)}
443
+ }
348
444
  }
349
- }
350
- }
351
445
 
352
- .${ClassName.TABLE_SELECTED}
353
- table
354
- tr:first-of-type
355
- td.${ClassName.TABLE_CELL},
356
- .${ClassName.TABLE_SELECTED}
357
- table
358
- tr:first-of-type
359
- th.${ClassName.TABLE_HEADER_CELL} {
360
- .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
361
- ${columnHeaderButtonSelected(props)};
362
- }
446
+ // floating dot for adding column button - overriding style on last column to avoid scroll
447
+ ${getFloatingDotOverrides(props)}
448
+
449
+ div.${ClassName.WITH_CONTROLS}>.${ClassName.ROW_CONTROLS_WRAPPER}::after {
450
+ content: ' ';
451
+ background-color: ${tableBorderColor(props)};
452
+ position: absolute;
453
+ height: ${lineMarkerSize}px;
454
+ width: ${lineMarkerSize}px;
455
+ border-radius: 50%;
456
+ pointer-events: none;
457
+ top: -${tableToolbarSize + tableCellBorderWidth}px;
458
+ right: -1px;
459
+ }
460
+
461
+ .${ClassName.WITH_CONTROLS} .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
462
+ display: block;
463
+ }
464
+
465
+ table
466
+ tr:first-of-type
467
+ td.${ClassName.TABLE_CELL},
468
+ table
469
+ tr:first-of-type
470
+ th.${ClassName.TABLE_HEADER_CELL} {
471
+ &.${ClassName.COLUMN_SELECTED},
472
+ &.${ClassName.HOVERED_COLUMN},
473
+ &.${ClassName.HOVERED_TABLE} {
474
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
475
+ ${columnHeaderButtonSelected(props)};
476
+ }
477
+
478
+ &.${ClassName.HOVERED_CELL_IN_DANGER}
479
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
480
+ background-color: ${tableToolbarDeleteColor(props)};
481
+ border: 1px solid ${tableBorderDeleteColor(props)};
482
+ border-bottom: none;
483
+ z-index: ${akEditorUnitZIndex * 100};
484
+ }
485
+ }
486
+ }
487
+
488
+ .${ClassName.TABLE_SELECTED}
489
+ table
490
+ tr:first-of-type
491
+ td.${ClassName.TABLE_CELL},
492
+ .${ClassName.TABLE_SELECTED}
493
+ table
494
+ tr:first-of-type
495
+ th.${ClassName.TABLE_HEADER_CELL} {
496
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
497
+ ${columnHeaderButtonSelected(props)};
498
+ }
499
+ }
500
+ `;
363
501
  }
364
- `;
502
+ };
365
503
  export const hoveredDeleteButton = props => css`
366
504
  .${ClassName.TABLE_CONTAINER}.${ClassName.HOVERED_DELETE_BUTTON} {
367
505
  .${ClassName.SELECTED_CELL},
@@ -1,5 +1,5 @@
1
1
  // #region Imports
2
- import { AddColumnStep } from '@atlaskit/adf-schema/steps';
2
+ import { AddColumnStep } from '@atlaskit/custom-steps';
3
3
  import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
4
4
  import { Selection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
@@ -1,4 +1,4 @@
1
- import { TableSortOrder as SortOrder, TableSortStep } from '@atlaskit/adf-schema/steps';
1
+ import { TableSortOrder as SortOrder, TableSortStep } from '@atlaskit/custom-steps';
2
2
  import { createCompareNodes } from '@atlaskit/editor-common/utils';
3
3
  import { Selection } from '@atlaskit/editor-prosemirror/state';
4
4
  import { TableMap } from '@atlaskit/editor-tables/table-map';
@@ -269,7 +269,7 @@ export var handleCut = function handleCut(oldTr, oldState, newState, editorAnaly
269
269
  totalColumnCount = _getSelectedCellInfo.totalColumnCount;
270
270
 
271
271
  // Reassigning to make it more obvious and consistent
272
- editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
272
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
273
273
  action: TABLE_ACTION.CUT,
274
274
  actionSubject: ACTION_SUBJECT.TABLE,
275
275
  actionSubjectId: null,
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  // #region Imports
5
- import { TableSortStep } from '@atlaskit/adf-schema/steps';
5
+ import { TableSortStep } from '@atlaskit/custom-steps';
6
6
  import { isTextInput } from '@atlaskit/editor-common/utils';
7
7
 
8
8
  // @ts-ignore -- ReadonlyTransaction is a local declaration and will cause a TS2305 error in CCFE typecheck
@@ -48,23 +48,23 @@ var tablesPlugin = function tablesPlugin(_ref) {
48
48
  current: null
49
49
  };
50
50
  var defaultGetEditorContainerWidth = function defaultGetEditorContainerWidth() {
51
- var _document$body$offset, _document, _document$body, _api$width$sharedStat;
51
+ var _document$body$offset, _document, _api$width$sharedStat;
52
52
  var defaultState = {
53
- width: (_document$body$offset = (_document = document) === null || _document === void 0 ? void 0 : (_document$body = _document.body) === null || _document$body === void 0 ? void 0 : _document$body.offsetWidth) !== null && _document$body$offset !== void 0 ? _document$body$offset : 500
53
+ width: (_document$body$offset = (_document = document) === null || _document === void 0 || (_document = _document.body) === null || _document === void 0 ? void 0 : _document.offsetWidth) !== null && _document$body$offset !== void 0 ? _document$body$offset : 500
54
54
  };
55
55
  return (_api$width$sharedStat = api === null || api === void 0 ? void 0 : api.width.sharedState.currentState()) !== null && _api$width$sharedStat !== void 0 ? _api$width$sharedStat : defaultState;
56
56
  };
57
- var editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
57
+ var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
58
58
  return {
59
59
  name: 'table',
60
60
  actions: {
61
61
  insertTable: function insertTable(analyticsPayload) {
62
62
  return function (state, dispatch) {
63
- var _api$contentInsertion, _api$contentInsertion2, _api$contentInsertion3;
63
+ var _api$contentInsertion, _api$contentInsertion2;
64
64
  var node = createTable({
65
65
  schema: state.schema
66
66
  });
67
- return (_api$contentInsertion = api === null || api === void 0 ? void 0 : (_api$contentInsertion2 = api.contentInsertion) === null || _api$contentInsertion2 === void 0 ? void 0 : (_api$contentInsertion3 = _api$contentInsertion2.actions) === null || _api$contentInsertion3 === void 0 ? void 0 : _api$contentInsertion3.insert({
67
+ return (_api$contentInsertion = api === null || api === void 0 || (_api$contentInsertion2 = api.contentInsertion) === null || _api$contentInsertion2 === void 0 || (_api$contentInsertion2 = _api$contentInsertion2.actions) === null || _api$contentInsertion2 === void 0 ? void 0 : _api$contentInsertion2.insert({
68
68
  state: state,
69
69
  dispatch: dispatch,
70
70
  node: node,
@@ -149,7 +149,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
149
149
  reportFixedTable: function reportFixedTable(_ref6) {
150
150
  var tr = _ref6.tr,
151
151
  reason = _ref6.reason;
152
- editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
152
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
153
153
  action: TABLE_ACTION.FIXED,
154
154
  actionSubject: ACTION_SUBJECT.TABLE,
155
155
  actionSubjectId: null,
@@ -341,7 +341,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
341
341
  var tr = insert(createTable({
342
342
  schema: state.schema
343
343
  }));
344
- editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
344
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
345
345
  action: ACTION.INSERTED,
346
346
  actionSubject: ACTION_SUBJECT.DOCUMENT,
347
347
  actionSubjectId: ACTION_SUBJECT_ID.TABLE,
@@ -61,7 +61,7 @@ export var OverflowShadowsObserver = /*#__PURE__*/function () {
61
61
  * reading it from sticky cell
62
62
  */
63
63
  _defineProperty(this, "updateStickyShadows", function (stickyRowHeight) {
64
- var _this$wrapper, _this$wrapper2, _this$wrapper2$parent, _this$wrapper3, _this$wrapper3$parent;
64
+ var _this$wrapper, _this$wrapper2, _this$wrapper3;
65
65
  if (!_this.isSticky) {
66
66
  return;
67
67
  }
@@ -72,8 +72,8 @@ export var OverflowShadowsObserver = /*#__PURE__*/function () {
72
72
  var heightStyleOrCompute = "".concat(stickyRowHeight || stickyCell.clientHeight + 1, "px");
73
73
  // Use getElementsByClassName here for a live node list to capture
74
74
  // sticky shadows
75
- var liveRightShadows = (_this$wrapper2 = _this.wrapper) === null || _this$wrapper2 === void 0 ? void 0 : (_this$wrapper2$parent = _this$wrapper2.parentElement) === null || _this$wrapper2$parent === void 0 ? void 0 : _this$wrapper2$parent.getElementsByClassName("".concat(ClassName.TABLE_RIGHT_SHADOW));
76
- var liveLeftShadows = (_this$wrapper3 = _this.wrapper) === null || _this$wrapper3 === void 0 ? void 0 : (_this$wrapper3$parent = _this$wrapper3.parentElement) === null || _this$wrapper3$parent === void 0 ? void 0 : _this$wrapper3$parent.getElementsByClassName("".concat(ClassName.TABLE_LEFT_SHADOW));
75
+ var liveRightShadows = (_this$wrapper2 = _this.wrapper) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.parentElement) === null || _this$wrapper2 === void 0 ? void 0 : _this$wrapper2.getElementsByClassName("".concat(ClassName.TABLE_RIGHT_SHADOW));
76
+ var liveLeftShadows = (_this$wrapper3 = _this.wrapper) === null || _this$wrapper3 === void 0 || (_this$wrapper3 = _this$wrapper3.parentElement) === null || _this$wrapper3 === void 0 ? void 0 : _this$wrapper3.getElementsByClassName("".concat(ClassName.TABLE_LEFT_SHADOW));
77
77
  updateShadowListForStickyStyles(heightStyleOrCompute, liveLeftShadows);
78
78
  updateShadowListForStickyStyles(heightStyleOrCompute, liveRightShadows);
79
79
  });
@@ -235,7 +235,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
235
235
  var prevNode = _this.node;
236
236
  var layoutSize = _this.tableNodeLayoutSize(node);
237
237
  var prevAttrs = prevNode === null || prevNode === void 0 ? void 0 : prevNode.attrs;
238
- var layoutChanged = (prevAttrs === null || prevAttrs === void 0 ? void 0 : prevAttrs.layout) !== (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.layout) && (prevAttrs === null || prevAttrs === void 0 ? void 0 : prevAttrs.__autoSize) === (node === null || node === void 0 ? void 0 : (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.__autoSize);
238
+ var layoutChanged = (prevAttrs === null || prevAttrs === void 0 ? void 0 : prevAttrs.layout) !== (node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.layout) && (prevAttrs === null || prevAttrs === void 0 ? void 0 : prevAttrs.__autoSize) === (node === null || node === void 0 || (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.__autoSize);
239
239
  if (containerWidth.width > layoutSize) {
240
240
  return;
241
241
  }
@@ -61,11 +61,11 @@ export var ResizableTableContainer = function ResizableTableContainer(_ref2) {
61
61
  // 1px is border width but collapse make it 0.5.
62
62
  // -- When sticky header appear, we should add first row height but reduce
63
63
  // collapsed border
64
- (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.style.setProperty('height', typeof height === 'number' ? "".concat(height + 40.5, "px") : 'auto');
64
+ (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 || _containerRef$current2.style.setProperty('height', typeof height === 'number' ? "".concat(height + 40.5, "px") : 'auto');
65
65
  } else {
66
66
  var _containerRef$current3, _containerRef$current4;
67
67
  var stickyHeaderHeight = ((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.getElementsByTagName('th')[0].getBoundingClientRect().height) || 0;
68
- (_containerRef$current4 = containerRef.current) === null || _containerRef$current4 === void 0 ? void 0 : _containerRef$current4.style.setProperty('height', typeof height === 'number' ? "".concat(height + stickyHeaderHeight + 39.5, "px") : 'auto');
68
+ (_containerRef$current4 = containerRef.current) === null || _containerRef$current4 === void 0 || _containerRef$current4.style.setProperty('height', typeof height === 'number' ? "".concat(height + stickyHeaderHeight + 39.5, "px") : 'auto');
69
69
  }
70
70
  }, []);
71
71
  var resizeObserverRef = useRef(new ResizeObserver(function (entries) {
@@ -101,18 +101,18 @@ export var ResizableTableContainer = function ResizableTableContainer(_ref2) {
101
101
  }
102
102
  }, [lineLength]);
103
103
  var displayGuideline = useCallback(function (guidelines) {
104
- var _pluginInjectionApi$g, _pluginInjectionApi$g2, _pluginInjectionApi$g3;
105
- return (_pluginInjectionApi$g = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$g2 = pluginInjectionApi.guideline) === null || _pluginInjectionApi$g2 === void 0 ? void 0 : (_pluginInjectionApi$g3 = _pluginInjectionApi$g2.actions) === null || _pluginInjectionApi$g3 === void 0 ? void 0 : _pluginInjectionApi$g3.displayGuideline(editorView)({
104
+ var _pluginInjectionApi$g, _pluginInjectionApi$g2;
105
+ return (_pluginInjectionApi$g = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$g2 = pluginInjectionApi.guideline) === null || _pluginInjectionApi$g2 === void 0 || (_pluginInjectionApi$g2 = _pluginInjectionApi$g2.actions) === null || _pluginInjectionApi$g2 === void 0 ? void 0 : _pluginInjectionApi$g2.displayGuideline(editorView)({
106
106
  guidelines: guidelines
107
107
  })) !== null && _pluginInjectionApi$g !== void 0 ? _pluginInjectionApi$g : false;
108
108
  }, [pluginInjectionApi, editorView]);
109
109
  var attachAnalyticsEvent = useCallback(function (payload) {
110
110
  var _pluginInjectionApi$a;
111
- return pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.attachAnalyticsEvent(payload);
111
+ return pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.attachAnalyticsEvent(payload);
112
112
  }, [pluginInjectionApi]);
113
113
  var displayGapCursor = useCallback(function (toggle) {
114
114
  var _pluginInjectionApi$c, _pluginInjectionApi$c2, _pluginInjectionApi$s;
115
- return (_pluginInjectionApi$c = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c2 = pluginInjectionApi.core) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$s = pluginInjectionApi.selection) === null || _pluginInjectionApi$s === void 0 ? void 0 : _pluginInjectionApi$s.commands.displayGapCursor(toggle))) !== null && _pluginInjectionApi$c !== void 0 ? _pluginInjectionApi$c : false;
115
+ return (_pluginInjectionApi$c = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c2 = pluginInjectionApi.core) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$s = pluginInjectionApi.selection) === null || _pluginInjectionApi$s === void 0 ? void 0 : _pluginInjectionApi$s.commands.displayGapCursor(toggle))) !== null && _pluginInjectionApi$c !== void 0 ? _pluginInjectionApi$c : false;
116
116
  }, [pluginInjectionApi]);
117
117
  var tableWidth = getTableContainerWidth(node);
118
118
  // 76 is currently an accepted padding value considering the spacing for resizer handle
@@ -198,7 +198,7 @@ export var TableResizer = function TableResizer(_ref) {
198
198
  });
199
199
  resizeFrameRatePayloads.forEach(function (payload) {
200
200
  var _attachAnalyticsEvent;
201
- (_attachAnalyticsEvent = attachAnalyticsEvent(payload)) === null || _attachAnalyticsEvent === void 0 ? void 0 : _attachAnalyticsEvent(tr);
201
+ (_attachAnalyticsEvent = attachAnalyticsEvent(payload)) === null || _attachAnalyticsEvent === void 0 || _attachAnalyticsEvent(tr);
202
202
  });
203
203
  }
204
204
  if (typeof pos === 'number') {
@@ -217,7 +217,7 @@ export var TableResizer = function TableResizer(_ref) {
217
217
  (_attachAnalyticsEvent2 = attachAnalyticsEvent(generateResizedPayload({
218
218
  originalNode: node,
219
219
  resizedNode: scaledNode
220
- }))) === null || _attachAnalyticsEvent2 === void 0 ? void 0 : _attachAnalyticsEvent2(tr);
220
+ }))) === null || _attachAnalyticsEvent2 === void 0 || _attachAnalyticsEvent2(tr);
221
221
  }
222
222
  displayGapCursor(true);
223
223
  dispatch(tr);
@@ -56,11 +56,7 @@ export var TableStickyScrollbar = /*#__PURE__*/function () {
56
56
  value: function createIntersectionObserver() {
57
57
  var _this2 = this,
58
58
  _this$wrapper,
59
- _this$wrapper$parentE2,
60
- _this$wrapper$parentE3,
61
- _this$wrapper2,
62
- _this$wrapper2$parent,
63
- _this$wrapper2$parent2;
59
+ _this$wrapper2;
64
60
  this.editorScrollableElement = findOverflowScrollParent(this.view.dom) || window.document;
65
61
  if (!this.editorScrollableElement || !this.wrapper) {
66
62
  return;
@@ -86,8 +82,8 @@ export var TableStickyScrollbar = /*#__PURE__*/function () {
86
82
  }, {
87
83
  root: this.editorScrollableElement
88
84
  });
89
- this.sentinels.bottom = (_this$wrapper = this.wrapper) === null || _this$wrapper === void 0 ? void 0 : (_this$wrapper$parentE2 = _this$wrapper.parentElement) === null || _this$wrapper$parentE2 === void 0 ? void 0 : (_this$wrapper$parentE3 = _this$wrapper$parentE2.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) === null || _this$wrapper$parentE3 === void 0 ? void 0 : _this$wrapper$parentE3.item(0);
90
- this.sentinels.top = (_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0 ? void 0 : (_this$wrapper2$parent = _this$wrapper2.parentElement) === null || _this$wrapper2$parent === void 0 ? void 0 : (_this$wrapper2$parent2 = _this$wrapper2$parent.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper2$parent2 === void 0 ? void 0 : _this$wrapper2$parent2.item(0);
85
+ this.sentinels.bottom = (_this$wrapper = this.wrapper) === null || _this$wrapper === void 0 || (_this$wrapper = _this$wrapper.parentElement) === null || _this$wrapper === void 0 || (_this$wrapper = _this$wrapper.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) === null || _this$wrapper === void 0 ? void 0 : _this$wrapper.item(0);
86
+ this.sentinels.top = (_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.parentElement) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper2 === void 0 ? void 0 : _this$wrapper2.item(0);
91
87
  [this.sentinels.bottom, this.sentinels.top].forEach(function (el) {
92
88
  return _this2.intersectionObserver.observe(el);
93
89
  });
@@ -235,7 +235,7 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
235
235
  if (this.resizeObserver) {
236
236
  this.resizeObserver.disconnect();
237
237
  }
238
- (_this$eventDispatcher = this.eventDispatcher) === null || _this$eventDispatcher === void 0 ? void 0 : _this$eventDispatcher.emit('TABLE_DELETED', this.node);
238
+ (_this$eventDispatcher = this.eventDispatcher) === null || _this$eventDispatcher === void 0 || _this$eventDispatcher.emit('TABLE_DELETED', this.node);
239
239
  _get(_getPrototypeOf(TableView.prototype), "destroy", this).call(this);
240
240
  }
241
241
  }]);
@@ -167,7 +167,7 @@ export var TableRowNodeView = /*#__PURE__*/function () {
167
167
 
168
168
  // ED-16035 Make sure sticky header is only applied to first row
169
169
  var tbody = _this.dom.parentElement;
170
- var isFirstHeader = tbody === null || tbody === void 0 ? void 0 : (_tbody$firstChild = tbody.firstChild) === null || _tbody$firstChild === void 0 ? void 0 : _tbody$firstChild.isEqualNode(_this.dom);
170
+ var isFirstHeader = tbody === null || tbody === void 0 || (_tbody$firstChild = tbody.firstChild) === null || _tbody$firstChild === void 0 ? void 0 : _tbody$firstChild.isEqualNode(_this.dom);
171
171
  if (!isFirstHeader) {
172
172
  return;
173
173
  }
@@ -188,7 +188,7 @@ export var TableRowNodeView = /*#__PURE__*/function () {
188
188
  * detaches from the table. This typically happens during a fast scroll by the user which causes
189
189
  * the intersection observer logic to not fire as expected.
190
190
  */
191
- (_this$editorScrollabl = _this.editorScrollableElement) === null || _this$editorScrollabl === void 0 ? void 0 : _this$editorScrollabl.addEventListener('scrollend', _this.refireIntersectionObservers, {
191
+ (_this$editorScrollabl = _this.editorScrollableElement) === null || _this$editorScrollabl === void 0 || _this$editorScrollabl.addEventListener('scrollend', _this.refireIntersectionObservers, {
192
192
  passive: true,
193
193
  once: true
194
194
  });
@@ -439,7 +439,7 @@ export var TableRowNodeView = /*#__PURE__*/function () {
439
439
  }
440
440
  } else if (entry.isIntersecting && sentinelIsAboveScrollArea) {
441
441
  var _entry$rootBounds5;
442
- _this4.tree && _this4.makeHeaderRowSticky(_this4.tree, entry === null || entry === void 0 ? void 0 : (_entry$rootBounds5 = entry.rootBounds) === null || _entry$rootBounds5 === void 0 ? void 0 : _entry$rootBounds5.top);
442
+ _this4.tree && _this4.makeHeaderRowSticky(_this4.tree, entry === null || entry === void 0 || (_entry$rootBounds5 = entry.rootBounds) === null || _entry$rootBounds5 === void 0 ? void 0 : _entry$rootBounds5.top);
443
443
  _this4.lastStickyTimestamp = Date.now();
444
444
  }
445
445
  }
@@ -36,7 +36,7 @@ var createPlugin = function createPlugin(dispatch, dispatchAnalyticsEvent, table
36
36
  var _newPluginState$lastT;
37
37
  var newPluginState = pluginKey.getState(newState);
38
38
  var hasAnalyticsBeenDispatched = false;
39
- var lastTriggerName = (newPluginState === null || newPluginState === void 0 ? void 0 : (_newPluginState$lastT = newPluginState.lastTrigger) === null || _newPluginState$lastT === void 0 ? void 0 : _newPluginState$lastT.name) ||
39
+ var lastTriggerName = (newPluginState === null || newPluginState === void 0 || (_newPluginState$lastT = newPluginState.lastTrigger) === null || _newPluginState$lastT === void 0 ? void 0 : _newPluginState$lastT.name) ||
40
40
  // NOTE: We assume that we know and can correctly differentiate
41
41
  // between all triggers of table overflow state change.
42
42
  // The only trigger we can't identify is viewport width change.
@@ -114,7 +114,7 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
114
114
  tr = updateColumnWidths(newResizeState, table, start)(tr);
115
115
  if (colIndex === map.width - 1) {
116
116
  var mouseUpTime = event.timeStamp;
117
- editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
117
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
118
118
  action: TABLE_ACTION.ATTEMPTED_TABLE_WIDTH_CHANGE,
119
119
  actionSubject: ACTION_SUBJECT.TABLE,
120
120
  actionSubjectId: null,