@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
@@ -1,5 +1,5 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23;
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25;
3
3
  import { css } from '@emotion/react';
4
4
  import { tableCellBorderWidth, tableMarginTop, tableMarginTopWithControl } from '@atlaskit/editor-common/styles';
5
5
  import { akEditorShadowZIndex, akEditorTableNumberColumnWidth, akEditorUnitZIndex } from '@atlaskit/editor-shared-styles';
@@ -51,29 +51,37 @@ export var OverflowShadow = function OverflowShadow(props) {
51
51
  return css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n .", ", .", " {\n display: block;\n height: calc(100% - ", "px);\n position: absolute;\n pointer-events: none;\n top: ", "px;\n z-index: ", ";\n width: ", "px;\n }\n .", " {\n background: linear-gradient(\n to left,\n transparent 0,\n ", "\n ", "%\n ),\n linear-gradient(\n to right,\n ", " 0px,\n transparent 1px\n );\n left: 0px;\n }\n .", "[data-number-column='true'] > :not(.", ").", " {\n left: ", "px;\n }\n .", " {\n background: linear-gradient(\n to right,\n transparent 0,\n ", "\n ", "%\n ),\n linear-gradient(\n to left,\n ", " 0px,\n transparent 1px\n );\n left: ", ";\n }\n .", " {\n .", ", .", " {\n height: calc(100% - ", "px);\n top: ", "px;\n }\n .", " {\n border-left: 1px solid ", ";\n }\n }\n"])), ClassName.TABLE_RIGHT_SHADOW, ClassName.TABLE_LEFT_SHADOW, tableMarginTop, tableMarginTop, akEditorShadowZIndex, getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? tableOverflowShadowWidthWide : tableOverflowShadowWidth, ClassName.TABLE_LEFT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(N40A, ")"), getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? 140 : 100, "var(--ds-shadow-overflow-perimeter, transparent)", ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY_SHADOW, ClassName.TABLE_LEFT_SHADOW, akEditorTableNumberColumnWidth - 1, ClassName.TABLE_RIGHT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(N40A, ")"), getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? 140 : 100, "var(--ds-shadow-overflow-perimeter, transparent)", getBooleanFF('platform.editor.custom-table-width') ? "calc(100% - ".concat(getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? tableOverflowShadowWidthWide : tableOverflowShadowWidth, "px)") : "calc(100% - ".concat(getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? tableOverflowShadowWidthWide - 10 : -2, "px)"), ClassName.WITH_CONTROLS, ClassName.TABLE_RIGHT_SHADOW, ClassName.TABLE_LEFT_SHADOW, tableMarginTopWithControl, tableMarginTopWithControl, ClassName.TABLE_LEFT_SHADOW, tableBorderColor(props));
52
52
  };
53
53
  var columnHeaderButton = function columnHeaderButton(props, cssString) {
54
- return css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n background: ", ";\n border: 1px solid ", ";\n display: block;\n box-sizing: border-box;\n padding: 0;\n\n :focus {\n outline: none;\n }\n\n ", "\n"])), tableHeaderCellBackgroundColor(props), tableBorderColor(props), cssString);
54
+ if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
55
+ return css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n background: ", ";\n display: block;\n box-sizing: border-box;\n padding: 0;\n\n :focus {\n outline: none;\n }\n\n ", "\n "])), tableHeaderCellBackgroundColor(props), cssString);
56
+ } else {
57
+ return css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n background: ", ";\n border: 1px solid ", ";\n display: block;\n box-sizing: border-box;\n padding: 0;\n\n :focus {\n outline: none;\n }\n\n ", "\n "])), tableHeaderCellBackgroundColor(props), tableBorderColor(props), cssString);
58
+ }
55
59
  };
56
60
  var columnHeaderButtonSelected = function columnHeaderButtonSelected(props) {
57
- return css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n z-index: ", ";\n"])), "var(--ds-text-inverse, ".concat(N0, ")"), tableToolbarSelectedColor(props), tableBorderSelectedColor(props), columnControlsSelectedZIndex);
61
+ return css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n z-index: ", ";\n"])), "var(--ds-text-inverse, ".concat(N0, ")"), tableToolbarSelectedColor(props), tableBorderSelectedColor(props), columnControlsSelectedZIndex);
58
62
  };
59
63
  var getFloatingDotOverrides = function getFloatingDotOverrides(props) {
60
- return getBooleanFF('platform.editor.custom-table-width') ? css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n tr\n th:last-child\n .", "::before,\n tr\n td:last-child\n .", "::before {\n content: '';\n background-color: ", ";\n position: absolute;\n height: ", "px;\n width: ", "px;\n border-radius: 50%;\n pointer-events: none;\n top: ", ";\n right: 0px;\n }\n "])), ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.COLUMN_CONTROLS_DECORATIONS, tableBorderColor(props), lineMarkerSize, lineMarkerSize, "var(--ds-space-025, 2px)") : '';
64
+ return getBooleanFF('platform.editor.custom-table-width') ? css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n tr\n th:last-child\n .", "::before,\n tr\n td:last-child\n .", "::before {\n content: '';\n background-color: ", ";\n position: absolute;\n height: ", "px;\n width: ", "px;\n border-radius: 50%;\n pointer-events: none;\n top: ", ";\n right: 0px;\n }\n "])), ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.COLUMN_CONTROLS_DECORATIONS, tableBorderColor(props), lineMarkerSize, lineMarkerSize, "var(--ds-space-025, 2px)") : '';
61
65
  };
62
66
  export var columnControlsDecoration = function columnControlsDecoration(props) {
63
- return css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n .", " {\n display: none;\n cursor: pointer;\n position: absolute;\n width: calc(100% + ", "px);\n left: -1px;\n top: -", "px;\n height: ", "px;\n // floating dot for adding column button\n &::before {\n content: ' ';\n background-color: ", ";\n position: absolute;\n height: ", "px;\n width: ", "px;\n border-radius: 50%;\n pointer-events: none;\n top: 2px;\n right: -1px;\n }\n\n &::after {\n content: ' ';\n\n ", "\n }\n }\n\n // floating dot for adding column button - overriding style on last column to avoid scroll\n ", "\n\n div.", ">.", "::after {\n content: ' ';\n background-color: ", ";\n position: absolute;\n height: ", "px;\n width: ", "px;\n border-radius: 50%;\n pointer-events: none;\n top: -", "px;\n right: -1px;\n }\n\n .", " .", " {\n display: block;\n }\n\n table\n tr:first-of-type\n td.", ",\n table\n tr:first-of-type\n th.", " {\n &.", ",\n &.", ",\n &.", " {\n .", "::after {\n ", ";\n }\n\n &.", "\n .", "::after {\n background-color: ", ";\n border: 1px solid ", ";\n border-bottom: none;\n z-index: ", ";\n }\n }\n }\n\n .", "\n table\n tr:first-of-type\n td.", ",\n .", "\n table\n tr:first-of-type\n th.", " {\n .", "::after {\n ", ";\n }\n }\n"])), ClassName.COLUMN_CONTROLS_DECORATIONS, tableCellBorderWidth * 2, columnControlsDecorationHeight + tableCellBorderWidth, columnControlsDecorationHeight, tableBorderColor(props), lineMarkerSize, lineMarkerSize, columnHeaderButton(props, "\n border-right: ".concat(tableCellBorderWidth, "px solid ").concat(tableBorderColor(props), ";\n border-bottom: none;\n height: ").concat(tableToolbarSize, "px;\n width: 100%;\n position: absolute;\n top: ").concat(columnControlsDecorationHeight - tableToolbarSize, "px;\n left: 0px;\n z-index: ").concat(columnControlsZIndex, ";\n ")), getFloatingDotOverrides(props), ClassName.WITH_CONTROLS, ClassName.ROW_CONTROLS_WRAPPER, tableBorderColor(props), lineMarkerSize, lineMarkerSize, tableToolbarSize + tableCellBorderWidth, ClassName.WITH_CONTROLS, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_COLUMN, ClassName.HOVERED_TABLE, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected(props), ClassName.HOVERED_CELL_IN_DANGER, ClassName.COLUMN_CONTROLS_DECORATIONS, tableToolbarDeleteColor(props), tableBorderDeleteColor(props), akEditorUnitZIndex * 100, ClassName.TABLE_SELECTED, ClassName.TABLE_CELL, ClassName.TABLE_SELECTED, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected(props));
67
+ if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
68
+ return css(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n .", " {\n display: none;\n cursor: pointer;\n position: absolute;\n width: 100%;\n left: 0;\n top: -", "px;\n height: ", "px;\n // floating dot for adding column button\n &::before {\n content: ' ';\n background-color: ", ";\n position: absolute;\n height: ", "px;\n width: ", "px;\n border-radius: 50%;\n pointer-events: none;\n top: 2px;\n right: -1px;\n }\n\n &::after {\n content: ' ';\n\n ", "\n }\n }\n\n // floating dot for adding column button - overriding style on last column to avoid scroll\n ", "\n\n div.", ">.", "::after {\n content: ' ';\n background-color: ", ";\n position: absolute;\n height: ", "px;\n width: ", "px;\n border-radius: 50%;\n pointer-events: none;\n top: -", "px;\n right: -1px;\n }\n\n .", " .", " {\n display: block;\n }\n\n table tr:first-of-type th.", " {\n &.", ", &.", " {\n .", "::after {\n ", ";\n }\n\n &.", "\n .", "::after {\n background-color: ", ";\n border-color: ", ";\n z-index: ", ";\n }\n }\n }\n\n table tr:first-of-type th.", " {\n &.", ", &.", " {\n .", "::after {\n ", ";\n border-left: ", "px solid\n ", ";\n left: -", "px;\n }\n }\n }\n\n table tr:first-of-type th.", " {\n &.", " {\n .", "::after {\n ", ";\n }\n\n &.", "\n .", "::after {\n background-color: ", ";\n border-color: ", ";\n border-left: ", "px solid\n ", ";\n left: -", "px;\n z-index: ", ";\n }\n }\n }\n\n .", "\n table\n tr:first-of-type\n td.", ",\n .", "\n table\n tr:first-of-type\n th.", " {\n .", "::after {\n ", ";\n }\n }\n "])), ClassName.COLUMN_CONTROLS_DECORATIONS, columnControlsDecorationHeight + tableCellBorderWidth, columnControlsDecorationHeight, tableBorderColor(props), lineMarkerSize, lineMarkerSize, columnHeaderButton(props, "\n border-right: ".concat(tableCellBorderWidth, "px solid ").concat(tableBorderColor(props), ";\n border-top: ").concat(tableCellBorderWidth, "px solid ").concat(tableBorderColor(props), ";\n border-bottom: ").concat(tableCellBorderWidth, "px solid ").concat(tableBorderColor(props), ";\n box-sizing: content-box;\n height: ").concat(tableToolbarSize - 1, "px;\n width: 100%;\n position: absolute;\n top: ").concat(columnControlsDecorationHeight - tableToolbarSize, "px;\n left: 0px;\n z-index: ").concat(columnControlsZIndex, ";\n ")), getFloatingDotOverrides(props), ClassName.WITH_CONTROLS, ClassName.ROW_CONTROLS_WRAPPER, tableBorderColor(props), lineMarkerSize, lineMarkerSize, tableToolbarSize + tableCellBorderWidth, ClassName.WITH_CONTROLS, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_TABLE, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected(props), ClassName.HOVERED_CELL_IN_DANGER, ClassName.COLUMN_CONTROLS_DECORATIONS, tableToolbarDeleteColor(props), tableBorderDeleteColor(props), akEditorUnitZIndex * 100, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_COLUMN, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected(props), tableCellBorderWidth, tableBorderSelectedColor(props), tableCellBorderWidth, ClassName.TABLE_HEADER_CELL, ClassName.HOVERED_COLUMN, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected(props), ClassName.HOVERED_CELL_IN_DANGER, ClassName.COLUMN_CONTROLS_DECORATIONS, tableToolbarDeleteColor(props), tableBorderDeleteColor(props), tableCellBorderWidth, tableBorderDeleteColor(props), tableCellBorderWidth, akEditorUnitZIndex * 100, ClassName.TABLE_SELECTED, ClassName.TABLE_CELL, ClassName.TABLE_SELECTED, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected(props));
69
+ } else {
70
+ return css(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n .", " {\n display: none;\n cursor: pointer;\n position: absolute;\n width: calc(100% + ", "px);\n left: -1px;\n top: -", "px;\n height: ", "px;\n // floating dot for adding column button\n &::before {\n content: ' ';\n background-color: ", ";\n position: absolute;\n height: ", "px;\n width: ", "px;\n border-radius: 50%;\n pointer-events: none;\n top: 2px;\n right: -1px;\n }\n\n &::after {\n content: ' ';\n\n ", "\n }\n }\n\n // floating dot for adding column button - overriding style on last column to avoid scroll\n ", "\n\n div.", ">.", "::after {\n content: ' ';\n background-color: ", ";\n position: absolute;\n height: ", "px;\n width: ", "px;\n border-radius: 50%;\n pointer-events: none;\n top: -", "px;\n right: -1px;\n }\n\n .", " .", " {\n display: block;\n }\n\n table\n tr:first-of-type\n td.", ",\n table\n tr:first-of-type\n th.", " {\n &.", ",\n &.", ",\n &.", " {\n .", "::after {\n ", ";\n }\n\n &.", "\n .", "::after {\n background-color: ", ";\n border: 1px solid ", ";\n border-bottom: none;\n z-index: ", ";\n }\n }\n }\n\n .", "\n table\n tr:first-of-type\n td.", ",\n .", "\n table\n tr:first-of-type\n th.", " {\n .", "::after {\n ", ";\n }\n }\n "])), ClassName.COLUMN_CONTROLS_DECORATIONS, tableCellBorderWidth * 2, columnControlsDecorationHeight + tableCellBorderWidth, columnControlsDecorationHeight, tableBorderColor(props), lineMarkerSize, lineMarkerSize, columnHeaderButton(props, "\n border-right: ".concat(tableCellBorderWidth, "px solid ").concat(tableBorderColor(props), ";\n border-bottom: none;\n height: ").concat(tableToolbarSize, "px;\n width: 100%;\n position: absolute;\n top: ").concat(columnControlsDecorationHeight - tableToolbarSize, "px;\n left: 0px;\n z-index: ").concat(columnControlsZIndex, ";\n ")), getFloatingDotOverrides(props), ClassName.WITH_CONTROLS, ClassName.ROW_CONTROLS_WRAPPER, tableBorderColor(props), lineMarkerSize, lineMarkerSize, tableToolbarSize + tableCellBorderWidth, ClassName.WITH_CONTROLS, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_COLUMN, ClassName.HOVERED_TABLE, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected(props), ClassName.HOVERED_CELL_IN_DANGER, ClassName.COLUMN_CONTROLS_DECORATIONS, tableToolbarDeleteColor(props), tableBorderDeleteColor(props), akEditorUnitZIndex * 100, ClassName.TABLE_SELECTED, ClassName.TABLE_CELL, ClassName.TABLE_SELECTED, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected(props));
71
+ }
64
72
  };
65
73
  export var hoveredDeleteButton = function hoveredDeleteButton(props) {
66
- return css(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n .", ".", " {\n .", ",\n .", ",\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.SELECTED_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_CELL, tableBorderDeleteColor(props), ClassName.SELECTED_CELL, tableCellDeleteColor(props));
74
+ return css(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n .", ".", " {\n .", ",\n .", ",\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.SELECTED_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_CELL, tableBorderDeleteColor(props), ClassName.SELECTED_CELL, tableCellDeleteColor(props));
67
75
  };
68
76
  export var hoveredCell = function hoveredCell(props) {
69
- return css(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n :not(.", ")\n .", ":not(.", ") {\n .", " {\n position: relative;\n border: 1px solid ", ";\n }\n }\n"])), ClassName.IS_RESIZING, ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.HOVERED_CELL, tableBorderSelectedColor(props));
77
+ return css(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n :not(.", ")\n .", ":not(.", ") {\n .", " {\n position: relative;\n border: 1px solid ", ";\n }\n }\n"])), ClassName.IS_RESIZING, ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.HOVERED_CELL, tableBorderSelectedColor(props));
70
78
  };
71
- export var hoveredWarningCell = css(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n :not(.", ")\n .", ":not(.", ") {\n td.", " {\n background-color: ", " !important; // We need to override the background-color added to the cell\n border: 1px solid ", ";\n }\n }\n"])), ClassName.IS_RESIZING, ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.HOVERED_CELL_WARNING, "var(--ds-background-warning, ".concat(Y50, ")"), "var(--ds-border-warning, ".concat(Y200, ")"));
79
+ export var hoveredWarningCell = css(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n :not(.", ")\n .", ":not(.", ") {\n td.", " {\n background-color: ", " !important; // We need to override the background-color added to the cell\n border: 1px solid ", ";\n }\n }\n"])), ClassName.IS_RESIZING, ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.HOVERED_CELL_WARNING, "var(--ds-background-warning, ".concat(Y50, ")"), "var(--ds-border-warning, ".concat(Y200, ")"));
72
80
 
73
81
  // move the resize handle zone completely inside the table cell to avoid overflow
74
82
  var getLastColumnResizerOverrides = function getLastColumnResizerOverrides() {
75
- return getBooleanFF('platform.editor.custom-table-width') ? css(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n tr\n th:last-child\n .", ",\n tr\n td:last-child\n .", " {\n background-color: transparent;\n position: absolute;\n width: ", "px;\n height: 100%;\n top: 0;\n right: 0;\n cursor: col-resize;\n z-index: ", ";\n }\n "])), ClassName.RESIZE_HANDLE_DECORATION, ClassName.RESIZE_HANDLE_DECORATION, resizeHandlerAreaWidth / 2, resizeHandlerZIndex) : '';
83
+ return getBooleanFF('platform.editor.custom-table-width') ? css(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n tr\n th:last-child\n .", ",\n tr\n td:last-child\n .", " {\n background-color: transparent;\n position: absolute;\n width: ", "px;\n height: 100%;\n top: 0;\n right: 0;\n cursor: col-resize;\n z-index: ", ";\n }\n "])), ClassName.RESIZE_HANDLE_DECORATION, ClassName.RESIZE_HANDLE_DECORATION, resizeHandlerAreaWidth / 2, resizeHandlerZIndex) : '';
76
84
  };
77
85
  export var resizeHandle = function resizeHandle(props) {
78
- return css(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n .", " {\n .", " {\n background-color: transparent;\n position: absolute;\n width: ", "px;\n height: 100%;\n top: 0;\n right: -", "px;\n cursor: col-resize;\n z-index: ", ";\n }\n\n ", "\n\n td.", "::before {\n content: ' ';\n position: absolute;\n left: ", ";\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n left: ", ";\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n td.", "::before {\n content: ' ';\n position: absolute;\n right: -1px;\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n right: -1px;\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n table\n tr:first-of-type\n th.", "\n .", "::after,\n table\n tr:first-of-type\n td.", "\n .", "::after {\n top: -", "px;\n height: calc(100% + ", "px);\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.RESIZE_HANDLE_DECORATION, resizeHandlerAreaWidth, resizeHandlerAreaWidth / 2, resizeHandlerZIndex, getLastColumnResizerOverrides(), ClassName.WITH_RESIZE_LINE, "var(--ds-space-negative-025, -2px)", resizeLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_RESIZE_LINE, "var(--ds-space-negative-025, -2px)", resizeLineWidth, tableToolbarSize + tableCellBorderWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableToolbarSize + tableCellBorderWidth, ClassName.WITH_RESIZE_LINE_LAST_COLUMN, resizeLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_RESIZE_LINE_LAST_COLUMN, resizeLineWidth, tableToolbarSize + tableCellBorderWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableToolbarSize + tableCellBorderWidth, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, tableToolbarSize + tableCellBorderWidth, tableToolbarSize + tableCellBorderWidth);
86
+ return css(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n .", " {\n .", " {\n background-color: transparent;\n position: absolute;\n width: ", "px;\n height: 100%;\n top: 0;\n right: -", "px;\n cursor: col-resize;\n z-index: ", ";\n }\n\n ", "\n\n td.", "::before {\n content: ' ';\n position: absolute;\n left: ", ";\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n left: ", ";\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n td.", "::before {\n content: ' ';\n position: absolute;\n right: -1px;\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n right: -1px;\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n table\n tr:first-of-type\n th.", "\n .", "::after,\n table\n tr:first-of-type\n td.", "\n .", "::after {\n top: -", "px;\n height: calc(100% + ", "px);\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.RESIZE_HANDLE_DECORATION, resizeHandlerAreaWidth, resizeHandlerAreaWidth / 2, resizeHandlerZIndex, getLastColumnResizerOverrides(), ClassName.WITH_RESIZE_LINE, "var(--ds-space-negative-025, -2px)", resizeLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_RESIZE_LINE, "var(--ds-space-negative-025, -2px)", resizeLineWidth, tableToolbarSize + tableCellBorderWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableToolbarSize + tableCellBorderWidth, ClassName.WITH_RESIZE_LINE_LAST_COLUMN, resizeLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_RESIZE_LINE_LAST_COLUMN, resizeLineWidth, tableToolbarSize + tableCellBorderWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableToolbarSize + tableCellBorderWidth, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, tableToolbarSize + tableCellBorderWidth, tableToolbarSize + tableCellBorderWidth);
79
87
  };
@@ -53,7 +53,7 @@ export var withEditorAnalyticsAPI = function withEditorAnalyticsAPI(payload) {
53
53
  return command(state, function (tr) {
54
54
  var dynamicPayload = payload instanceof Function ? payload(state) : payload;
55
55
  if (dynamicPayload) {
56
- editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(dynamicPayload)(tr);
56
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(dynamicPayload)(tr);
57
57
  }
58
58
  if (dispatch) {
59
59
  dispatch(tr);
@@ -91,7 +91,7 @@ export var getMousePositionHorizontalRelativeByElement = function getMousePositi
91
91
  var width, x;
92
92
  var closestCell = element.closest(SELECTOR_TABLE_LEAFS);
93
93
  var id = (_closestCell$id = closestCell === null || closestCell === void 0 ? void 0 : closestCell.id) !== null && _closestCell$id !== void 0 ? _closestCell$id : '';
94
- width = (_elementContentRects$ = elementContentRects === null || elementContentRects === void 0 ? void 0 : (_elementContentRects$2 = elementContentRects[id]) === null || _elementContentRects$2 === void 0 ? void 0 : _elementContentRects$2.width) !== null && _elementContentRects$ !== void 0 ? _elementContentRects$ : 0;
94
+ width = (_elementContentRects$ = elementContentRects === null || elementContentRects === void 0 || (_elementContentRects$2 = elementContentRects[id]) === null || _elementContentRects$2 === void 0 ? void 0 : _elementContentRects$2.width) !== null && _elementContentRects$ !== void 0 ? _elementContentRects$ : 0;
95
95
  x = mouseEvent.offsetX;
96
96
  if (width <= 0) {
97
97
  return null;
@@ -57,7 +57,7 @@ export var transformSliceToFixHardBreakProblemOnCopyFromCell = function transfor
57
57
  return slice;
58
58
  };
59
59
  export var transformSliceToRemoveOpenTable = function transformSliceToRemoveOpenTable(slice, schema) {
60
- var _slice$content$firstC6;
60
+ var _slice$content$firstC2;
61
61
  // we're removing the table, tableRow and tableCell reducing the open depth by 3
62
62
  var depthDecrement = 3;
63
63
 
@@ -67,14 +67,14 @@ export var transformSliceToRemoveOpenTable = function transformSliceToRemoveOpen
67
67
  slice.openStart >= 4 && slice.openEnd >= 4 &&
68
68
  // slice is a table node
69
69
  slice.content.childCount === 1 && slice.content.firstChild.type === schema.nodes.table) {
70
- var _slice$content$firstC, _slice$content$firstC2, _slice$content$firstC3, _slice$content$firstC4, _slice$content$firstC5;
70
+ var _slice$content$firstC;
71
71
  // prosemirror-view has a bug that it duplicates table entry when selecting multiple paragraphs in a table cell.
72
72
  // https://github.com/ProseMirror/prosemirror/issues/1270
73
73
  // The structure becomes
74
74
  // table(genuine) > tableRow(genuine) > table(duplicated) > tableRow(duplicated) > tableCell/tableHeader(genuine) > contents(genuine)
75
75
  // As we are removing wrapping table anyway, we keep duplicated table and tableRow for simplicity
76
76
  var cleaned = slice;
77
- if (((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : (_slice$content$firstC2 = _slice$content$firstC.content) === null || _slice$content$firstC2 === void 0 ? void 0 : (_slice$content$firstC3 = _slice$content$firstC2.firstChild) === null || _slice$content$firstC3 === void 0 ? void 0 : (_slice$content$firstC4 = _slice$content$firstC3.content) === null || _slice$content$firstC4 === void 0 ? void 0 : (_slice$content$firstC5 = _slice$content$firstC4.firstChild) === null || _slice$content$firstC5 === void 0 ? void 0 : _slice$content$firstC5.type) === schema.nodes.table) {
77
+ if (((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 || (_slice$content$firstC = _slice$content$firstC.content) === null || _slice$content$firstC === void 0 || (_slice$content$firstC = _slice$content$firstC.firstChild) === null || _slice$content$firstC === void 0 || (_slice$content$firstC = _slice$content$firstC.content) === null || _slice$content$firstC === void 0 || (_slice$content$firstC = _slice$content$firstC.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) === schema.nodes.table) {
78
78
  cleaned = new Slice(slice.content.firstChild.content.firstChild.content, slice.openStart - 2, slice.openEnd - 2);
79
79
  }
80
80
  return new Slice(flatmap(cleaned.content, unwrapContentFromTable), cleaned.openStart - depthDecrement, cleaned.openEnd - depthDecrement);
@@ -85,7 +85,7 @@ export var transformSliceToRemoveOpenTable = function transformSliceToRemoveOpen
85
85
  // starts inside of a cell but ends outside of the starting table
86
86
  slice.openStart >= 4 &&
87
87
  // slice starts from a table node (and spans across more than one node)
88
- slice.content.childCount > 1 && ((_slice$content$firstC6 = slice.content.firstChild) === null || _slice$content$firstC6 === void 0 ? void 0 : _slice$content$firstC6.type) === schema.nodes.table) {
88
+ slice.content.childCount > 1 && ((_slice$content$firstC2 = slice.content.firstChild) === null || _slice$content$firstC2 === void 0 ? void 0 : _slice$content$firstC2.type) === schema.nodes.table) {
89
89
  // repoint the slice's cutting depth so that cell content where the slice starts
90
90
  // does not get lifted out of the cell on paste
91
91
  return new Slice(slice.content, 1, slice.openEnd);
@@ -1,3 +1,3 @@
1
- import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
2
- import { Command } from '@atlaskit/editor-common/types';
1
+ import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
2
+ import type { Command } from '@atlaskit/editor-common/types';
3
3
  export declare const sortByColumn: (columnIndex: number, order?: SortOrder) => Command;
@@ -1,10 +1,10 @@
1
- import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
1
+ import type { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
4
  import type { Command, GetEditorContainerWidth } from '@atlaskit/editor-common/types';
5
- import { Rect } from '@atlaskit/editor-tables/table-map';
6
- import { ResizeStateWithAnalytics } from './pm-plugins/table-resizing/utils';
7
- import { InsertRowMethods, InsertRowOptions, RowInsertPosition } from './types';
5
+ import type { Rect } from '@atlaskit/editor-tables/table-map';
6
+ import type { ResizeStateWithAnalytics } from './pm-plugins/table-resizing/utils';
7
+ import type { InsertRowMethods, InsertRowOptions, RowInsertPosition } from './types';
8
8
  export declare const emptyMultipleCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB, targetCellPosition?: number) => Command;
9
9
  export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
10
10
  export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
@@ -1,3 +1,3 @@
1
- import { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
2
- import { TablePluginState } from './types';
1
+ import type { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
2
+ import type { TablePluginState } from './types';
3
3
  export declare const handleDocOrSelectionChanged: (tr: Transaction | ReadonlyTransaction, pluginState: TablePluginState) => TablePluginState;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { TableColumnOrdering } from '@atlaskit/adf-schema/steps';
2
+ import type { TableColumnOrdering } from '@atlaskit/custom-steps';
3
3
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
4
  import type { EditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
5
5
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
@@ -1,6 +1,6 @@
1
1
  import type { IntlShape } from 'react-intl-next';
2
2
  import type { TableLayout } from '@atlaskit/adf-schema';
3
- import type { TableColumnOrdering } from '@atlaskit/adf-schema/steps';
3
+ import type { TableColumnOrdering } from '@atlaskit/custom-steps';
4
4
  import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
5
5
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
6
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
@@ -1,9 +1,9 @@
1
1
  import { Component } from 'react';
2
- import type { TableColumnOrdering } from '@atlaskit/adf-schema/steps';
2
+ import type { TableColumnOrdering } from '@atlaskit/custom-steps';
3
3
  import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
- import { Selection } from '@atlaskit/editor-prosemirror/state';
5
- import { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- import { RowStickyState } from '../../pm-plugins/sticky-headers';
4
+ import type { Selection } from '@atlaskit/editor-prosemirror/state';
5
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
+ import type { RowStickyState } from '../../pm-plugins/sticky-headers';
7
7
  export interface Props {
8
8
  editorView: EditorView;
9
9
  getEditorFeatureFlags: GetEditorFeatureFlags;
@@ -1,3 +1,3 @@
1
- import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
2
- import { Command } from '@atlaskit/editor-common/types';
1
+ import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
2
+ import type { Command } from '@atlaskit/editor-common/types';
3
3
  export declare const sortByColumn: (columnIndex: number, order?: SortOrder) => Command;
@@ -1,10 +1,10 @@
1
- import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
1
+ import type { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
4
  import type { Command, GetEditorContainerWidth } from '@atlaskit/editor-common/types';
5
- import { Rect } from '@atlaskit/editor-tables/table-map';
6
- import { ResizeStateWithAnalytics } from './pm-plugins/table-resizing/utils';
7
- import { InsertRowMethods, InsertRowOptions, RowInsertPosition } from './types';
5
+ import type { Rect } from '@atlaskit/editor-tables/table-map';
6
+ import type { ResizeStateWithAnalytics } from './pm-plugins/table-resizing/utils';
7
+ import type { InsertRowMethods, InsertRowOptions, RowInsertPosition } from './types';
8
8
  export declare const emptyMultipleCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB, targetCellPosition?: number) => Command;
9
9
  export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
10
10
  export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
@@ -1,3 +1,3 @@
1
- import { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
2
- import { TablePluginState } from './types';
1
+ import type { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
2
+ import type { TablePluginState } from './types';
3
3
  export declare const handleDocOrSelectionChanged: (tr: Transaction | ReadonlyTransaction, pluginState: TablePluginState) => TablePluginState;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { TableColumnOrdering } from '@atlaskit/adf-schema/steps';
2
+ import type { TableColumnOrdering } from '@atlaskit/custom-steps';
3
3
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
4
  import type { EditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
5
5
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
@@ -1,6 +1,6 @@
1
1
  import type { IntlShape } from 'react-intl-next';
2
2
  import type { TableLayout } from '@atlaskit/adf-schema';
3
- import type { TableColumnOrdering } from '@atlaskit/adf-schema/steps';
3
+ import type { TableColumnOrdering } from '@atlaskit/custom-steps';
4
4
  import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
5
5
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
6
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
@@ -1,9 +1,9 @@
1
1
  import { Component } from 'react';
2
- import type { TableColumnOrdering } from '@atlaskit/adf-schema/steps';
2
+ import type { TableColumnOrdering } from '@atlaskit/custom-steps';
3
3
  import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
- import { Selection } from '@atlaskit/editor-prosemirror/state';
5
- import { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- import { RowStickyState } from '../../pm-plugins/sticky-headers';
4
+ import type { Selection } from '@atlaskit/editor-prosemirror/state';
5
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
+ import type { RowStickyState } from '../../pm-plugins/sticky-headers';
7
7
  export interface Props {
8
8
  editorView: EditorView;
9
9
  getEditorFeatureFlags: GetEditorFeatureFlags;
package/docs/0-intro.tsx CHANGED
@@ -49,5 +49,5 @@ type TablePlugin = NextEditorPlugin<
49
49
  For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
50
50
  ## License
51
51
  ---
52
- Please see [Atlassian Frontend - License](https://developer.atlassian.com/cloud/framework/atlassian-frontend/#license) for more licensing information.
52
+ Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#License) for more licensing information.
53
53
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -27,8 +27,9 @@
27
27
  "releaseModel": "continuous"
28
28
  },
29
29
  "dependencies": {
30
- "@atlaskit/adf-schema": "^29.1.0",
31
- "@atlaskit/editor-common": "^76.0.0",
30
+ "@atlaskit/adf-schema": "^32.0.0",
31
+ "@atlaskit/custom-steps": "^0.0.2",
32
+ "@atlaskit/editor-common": "^76.5.0",
32
33
  "@atlaskit/editor-palette": "1.5.1",
33
34
  "@atlaskit/editor-plugin-analytics": "^0.2.0",
34
35
  "@atlaskit/editor-plugin-content-insertion": "^0.1.0",
@@ -57,7 +58,7 @@
57
58
  "@atlaskit/analytics-next": "^9.1.0",
58
59
  "@atlaskit/editor-plugin-decorations": "^0.2.0",
59
60
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
60
- "@atlaskit/editor-plugin-grid": "^0.2.0",
61
+ "@atlaskit/editor-plugin-grid": "^0.3.0",
61
62
  "@atlaskit/editor-plugin-guideline": "^0.5.0",
62
63
  "@atlaskit/editor-plugin-hyperlink": "^0.5.0",
63
64
  "@atlaskit/editor-plugin-width": "^0.2.0",
@@ -105,6 +106,9 @@
105
106
  "platform.editor.table-sticky-scrollbar": {
106
107
  "type": "boolean"
107
108
  },
109
+ "platform.editor.table.column-controls-styles-updated": {
110
+ "type": "boolean"
111
+ },
108
112
  "platform.editor.update-table-cell-width-via-step": {
109
113
  "type": "boolean"
110
114
  },
@@ -9,6 +9,7 @@ Object {
9
9
  "isNumberColumnEnabled": false,
10
10
  "layout": "default",
11
11
  "localId": "abc-123",
12
+ "width": null,
12
13
  },
13
14
  "content": Array [
14
15
  Object {
@@ -215,6 +216,7 @@ Object {
215
216
  "isNumberColumnEnabled": false,
216
217
  "layout": "full-width",
217
218
  "localId": "abc-123",
219
+ "width": null,
218
220
  },
219
221
  "content": Array [
220
222
  Object {
@@ -411,6 +413,7 @@ Object {
411
413
  "isNumberColumnEnabled": false,
412
414
  "layout": "wide",
413
415
  "localId": "abc-123",
416
+ "width": null,
414
417
  },
415
418
  "content": Array [
416
419
  Object {
@@ -9,6 +9,7 @@ Object {
9
9
  "isNumberColumnEnabled": false,
10
10
  "layout": "default",
11
11
  "localId": "abc-123",
12
+ "width": null,
12
13
  },
13
14
  "content": Array [
14
15
  Object {
@@ -215,6 +216,7 @@ Object {
215
216
  "isNumberColumnEnabled": false,
216
217
  "layout": "default",
217
218
  "localId": "abc-123",
219
+ "width": null,
218
220
  },
219
221
  "content": Array [
220
222
  Object {
@@ -9,6 +9,7 @@ Object {
9
9
  "isNumberColumnEnabled": false,
10
10
  "layout": "default",
11
11
  "localId": "abc-123",
12
+ "width": null,
12
13
  },
13
14
  "content": Array [
14
15
  Object {
@@ -457,6 +458,7 @@ Object {
457
458
  "isNumberColumnEnabled": false,
458
459
  "layout": "default",
459
460
  "localId": "abc-123",
461
+ "width": null,
460
462
  },
461
463
  "content": Array [
462
464
  Object {
@@ -9,6 +9,7 @@ Object {
9
9
  "isNumberColumnEnabled": false,
10
10
  "layout": "full-width",
11
11
  "localId": "abc-123",
12
+ "width": null,
12
13
  },
13
14
  "content": Array [
14
15
  Object {
@@ -9,6 +9,7 @@ Object {
9
9
  "isNumberColumnEnabled": false,
10
10
  "layout": "default",
11
11
  "localId": "abc-123",
12
+ "width": null,
12
13
  },
13
14
  "content": Array [
14
15
  Object {
@@ -9,6 +9,7 @@ Object {
9
9
  "isNumberColumnEnabled": false,
10
10
  "layout": "default",
11
11
  "localId": "abc-123",
12
+ "width": null,
12
13
  },
13
14
  "content": Array [
14
15
  Object {
@@ -122,6 +123,7 @@ Object {
122
123
  "isNumberColumnEnabled": false,
123
124
  "layout": "default",
124
125
  "localId": "abc-123",
126
+ "width": null,
125
127
  },
126
128
  "content": Array [
127
129
  Object {
@@ -31,6 +31,7 @@ Object {
31
31
  "isNumberColumnEnabled": false,
32
32
  "layout": "default",
33
33
  "localId": "abc-123",
34
+ "width": null,
34
35
  },
35
36
  "content": Array [
36
37
  Object {
@@ -159,6 +160,7 @@ Object {
159
160
  "isNumberColumnEnabled": false,
160
161
  "layout": "default",
161
162
  "localId": "abc-123",
163
+ "width": null,
162
164
  },
163
165
  "content": Array [
164
166
  Object {
@@ -602,6 +604,7 @@ Object {
602
604
  "isNumberColumnEnabled": false,
603
605
  "layout": "default",
604
606
  "localId": "abc-123",
607
+ "width": null,
605
608
  },
606
609
  "content": Array [
607
610
  Object {
@@ -10,6 +10,7 @@ Object {
10
10
  "isNumberColumnEnabled": false,
11
11
  "layout": "default",
12
12
  "localId": "abc-123",
13
+ "width": null,
13
14
  },
14
15
  "content": Array [
15
16
  Object {
@@ -174,6 +175,7 @@ Object {
174
175
  "isNumberColumnEnabled": false,
175
176
  "layout": "default",
176
177
  "localId": "abc-123",
178
+ "width": null,
177
179
  },
178
180
  "content": Array [
179
181
  Object {
@@ -338,6 +340,7 @@ Object {
338
340
  "isNumberColumnEnabled": false,
339
341
  "layout": "default",
340
342
  "localId": "abc-123",
343
+ "width": null,
341
344
  },
342
345
  "content": Array [
343
346
  Object {
@@ -9,6 +9,7 @@ Object {
9
9
  "isNumberColumnEnabled": false,
10
10
  "layout": "default",
11
11
  "localId": "abc-123",
12
+ "width": null,
12
13
  },
13
14
  "content": Array [
14
15
  Object {
@@ -379,6 +380,7 @@ Object {
379
380
  "isNumberColumnEnabled": false,
380
381
  "layout": "default",
381
382
  "localId": "abc-123",
383
+ "width": null,
382
384
  },
383
385
  "content": Array [
384
386
  Object {
@@ -9,6 +9,7 @@ Object {
9
9
  "isNumberColumnEnabled": false,
10
10
  "layout": "default",
11
11
  "localId": "abc-123",
12
+ "width": null,
12
13
  },
13
14
  "content": Array [
14
15
  Object {
@@ -27,6 +27,7 @@ Object {
27
27
  "isNumberColumnEnabled": false,
28
28
  "layout": "default",
29
29
  "localId": "abc-123",
30
+ "width": null,
30
31
  },
31
32
  "content": Array [
32
33
  Object {
@@ -9,6 +9,7 @@ Object {
9
9
  "isNumberColumnEnabled": false,
10
10
  "layout": "full-width",
11
11
  "localId": "abc-123",
12
+ "width": null,
12
13
  },
13
14
  "content": Array [
14
15
  Object {
@@ -187,6 +188,7 @@ Object {
187
188
  "isNumberColumnEnabled": false,
188
189
  "layout": "wide",
189
190
  "localId": "abc-123",
191
+ "width": null,
190
192
  },
191
193
  "content": Array [
192
194
  Object {
@@ -365,6 +367,7 @@ Object {
365
367
  "isNumberColumnEnabled": false,
366
368
  "layout": "default",
367
369
  "localId": "abc-123",
370
+ "width": null,
368
371
  },
369
372
  "content": Array [
370
373
  Object {
@@ -519,6 +522,7 @@ Object {
519
522
  "isNumberColumnEnabled": false,
520
523
  "layout": "full-width",
521
524
  "localId": "abc-123",
525
+ "width": null,
522
526
  },
523
527
  "content": Array [
524
528
  Object {
@@ -673,6 +677,7 @@ Object {
673
677
  "isNumberColumnEnabled": false,
674
678
  "layout": "wide",
675
679
  "localId": "abc-123",
680
+ "width": null,
676
681
  },
677
682
  "content": Array [
678
683
  Object {
@@ -843,6 +848,7 @@ Object {
843
848
  "isNumberColumnEnabled": false,
844
849
  "layout": "default",
845
850
  "localId": "abc-123",
851
+ "width": null,
846
852
  },
847
853
  "content": Array [
848
854
  Object {
@@ -1063,6 +1069,7 @@ Object {
1063
1069
  "isNumberColumnEnabled": false,
1064
1070
  "layout": "default",
1065
1071
  "localId": "abc-123",
1072
+ "width": null,
1066
1073
  },
1067
1074
  "content": Array [
1068
1075
  Object {
@@ -1260,6 +1267,7 @@ Object {
1260
1267
  "isNumberColumnEnabled": false,
1261
1268
  "layout": "default",
1262
1269
  "localId": "abc-123",
1270
+ "width": null,
1263
1271
  },
1264
1272
  "content": Array [
1265
1273
  Object {
@@ -1472,6 +1480,7 @@ Object {
1472
1480
  "isNumberColumnEnabled": false,
1473
1481
  "layout": "default",
1474
1482
  "localId": "abc-123",
1483
+ "width": null,
1475
1484
  },
1476
1485
  "content": Array [
1477
1486
  Object {