@atlaskit/editor-plugin-table 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/plugins/table/commands/clear.js +4 -16
- package/dist/cjs/plugins/table/commands/collapse.js +0 -6
- package/dist/cjs/plugins/table/commands/go-to-next-cell.js +7 -18
- package/dist/cjs/plugins/table/commands/hover.js +7 -37
- package/dist/cjs/plugins/table/commands/index.js +0 -8
- package/dist/cjs/plugins/table/commands/insert.js +17 -56
- package/dist/cjs/plugins/table/commands/misc.js +36 -132
- package/dist/cjs/plugins/table/commands/referentiality.js +0 -4
- package/dist/cjs/plugins/table/commands/selection.js +21 -87
- package/dist/cjs/plugins/table/commands/sort.js +2 -23
- package/dist/cjs/plugins/table/commands/split-cell.js +3 -11
- package/dist/cjs/plugins/table/commands/toggle.js +8 -34
- package/dist/cjs/plugins/table/commands-with-analytics.js +50 -139
- package/dist/cjs/plugins/table/create-plugin-config.js +0 -6
- package/dist/cjs/plugins/table/event-handlers.js +58 -160
- package/dist/cjs/plugins/table/handlers.js +10 -39
- package/dist/cjs/plugins/table/index.js +47 -91
- package/dist/cjs/plugins/table/nodeviews/OverflowShadowsObserver.js +8 -41
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +82 -188
- package/dist/cjs/plugins/table/nodeviews/table.js +12 -70
- package/dist/cjs/plugins/table/nodeviews/tableCell.js +15 -39
- package/dist/cjs/plugins/table/nodeviews/update-overflow-shadows.js +3 -15
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +0 -18
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-controls.js +8 -27
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-resizing.js +8 -20
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/compose-decorations.js +1 -3
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/index.js +0 -3
- package/dist/cjs/plugins/table/pm-plugins/keymap.js +2 -15
- package/dist/cjs/plugins/table/pm-plugins/main.js +20 -72
- package/dist/cjs/plugins/table/pm-plugins/plugin-factory.js +25 -42
- package/dist/cjs/plugins/table/pm-plugins/plugin-key.js +0 -2
- package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +8 -8
- package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +4 -23
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/commands.js +0 -5
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/index.js +0 -5
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +4 -13
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +56 -138
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin-key.js +0 -2
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin-state.js +15 -30
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin.js +0 -6
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/util.js +0 -5
- package/dist/cjs/plugins/table/pm-plugins/table-local-id.js +13 -44
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/commands.js +12 -42
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +16 -52
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/index.js +0 -4
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin-factory.js +0 -10
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin-key.js +0 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin.js +5 -19
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/reducer.js +0 -10
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +0 -15
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/column-state.js +8 -28
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/content-width.js +3 -23
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/dom.js +4 -46
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/index.js +0 -9
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +15 -36
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-column.js +1 -4
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +15 -71
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +34 -82
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +12 -36
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.js +0 -2
- package/dist/cjs/plugins/table/pm-plugins/table-selection-keymap.js +0 -5
- package/dist/cjs/plugins/table/reducer.js +0 -24
- package/dist/cjs/plugins/table/toolbar.js +14 -94
- package/dist/cjs/plugins/table/transforms/column-width.js +12 -45
- package/dist/cjs/plugins/table/transforms/delete-columns.js +11 -76
- package/dist/cjs/plugins/table/transforms/delete-rows.js +4 -42
- package/dist/cjs/plugins/table/transforms/fix-tables.js +24 -61
- package/dist/cjs/plugins/table/transforms/index.js +0 -7
- package/dist/cjs/plugins/table/transforms/merge.js +14 -90
- package/dist/cjs/plugins/table/transforms/metadata.js +0 -5
- package/dist/cjs/plugins/table/transforms/replace-table.js +2 -13
- package/dist/cjs/plugins/table/transforms/split.js +18 -32
- package/dist/cjs/plugins/table/types.js +0 -11
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +10 -51
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +0 -12
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +46 -145
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +12 -35
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +0 -11
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +5 -12
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.js +3 -16
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/index.js +19 -89
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/InsertButton.js +6 -31
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +5 -22
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +25 -80
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +16 -64
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +14 -47
- package/dist/cjs/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +20 -48
- package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/index.js +10 -43
- package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +33 -74
- package/dist/cjs/plugins/table/ui/common-styles.js +6 -19
- package/dist/cjs/plugins/table/ui/consts.js +3 -8
- package/dist/cjs/plugins/table/ui/messages.js +0 -3
- package/dist/cjs/plugins/table/ui/ui-styles.js +0 -32
- package/dist/cjs/plugins/table/utils/analytics.js +4 -19
- package/dist/cjs/plugins/table/utils/collapse.js +4 -21
- package/dist/cjs/plugins/table/utils/column-controls.js +25 -61
- package/dist/cjs/plugins/table/utils/decoration.js +46 -114
- package/dist/cjs/plugins/table/utils/dom.js +4 -51
- package/dist/cjs/plugins/table/utils/get-allow-add-column-custom-step.js +0 -2
- package/dist/cjs/plugins/table/utils/index.js +0 -10
- package/dist/cjs/plugins/table/utils/nodes.js +5 -48
- package/dist/cjs/plugins/table/utils/paste.js +22 -47
- package/dist/cjs/plugins/table/utils/row-controls.js +6 -67
- package/dist/cjs/plugins/table/utils/selection.js +3 -36
- package/dist/cjs/plugins/table/utils/table.js +0 -11
- package/dist/cjs/plugins/table/utils/update-plugin-state-decorations.js +0 -4
- package/dist/cjs/plugins/table-plugin.js +0 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/commands/clear.js +3 -8
- package/dist/es2019/plugins/table/commands/collapse.js +0 -3
- package/dist/es2019/plugins/table/commands/go-to-next-cell.js +4 -7
- package/dist/es2019/plugins/table/commands/hover.js +7 -17
- package/dist/es2019/plugins/table/commands/insert.js +16 -36
- package/dist/es2019/plugins/table/commands/misc.js +37 -67
- package/dist/es2019/plugins/table/commands/selection.js +7 -62
- package/dist/es2019/plugins/table/commands/sort.js +0 -12
- package/dist/es2019/plugins/table/commands/split-cell.js +0 -4
- package/dist/es2019/plugins/table/commands/toggle.js +13 -15
- package/dist/es2019/plugins/table/commands-with-analytics.js +4 -14
- package/dist/es2019/plugins/table/event-handlers.js +14 -62
- package/dist/es2019/plugins/table/handlers.js +16 -26
- package/dist/es2019/plugins/table/index.js +12 -25
- package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +8 -40
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +27 -100
- package/dist/es2019/plugins/table/nodeviews/table.js +3 -33
- package/dist/es2019/plugins/table/nodeviews/tableCell.js +7 -16
- package/dist/es2019/plugins/table/nodeviews/update-overflow-shadows.js +3 -10
- package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +0 -5
- package/dist/es2019/plugins/table/pm-plugins/decorations/utils/column-controls.js +4 -13
- package/dist/es2019/plugins/table/pm-plugins/decorations/utils/column-resizing.js +0 -3
- package/dist/es2019/plugins/table/pm-plugins/keymap.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/main.js +19 -43
- package/dist/es2019/plugins/table/pm-plugins/plugin-factory.js +2 -6
- package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +8 -3
- package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +0 -12
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +4 -9
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +55 -130
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/plugin-state.js +2 -9
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/util.js +0 -3
- package/dist/es2019/plugins/table/pm-plugins/table-local-id.js +20 -39
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/commands.js +7 -15
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +9 -27
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin-factory.js +2 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/reducer.js +8 -8
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +0 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/column-state.js +8 -11
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/content-width.js +4 -21
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/dom.js +3 -22
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +10 -18
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +29 -59
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +54 -51
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +9 -14
- package/dist/es2019/plugins/table/reducer.js +26 -30
- package/dist/es2019/plugins/table/toolbar.js +5 -48
- package/dist/es2019/plugins/table/transforms/column-width.js +16 -28
- package/dist/es2019/plugins/table/transforms/delete-columns.js +17 -58
- package/dist/es2019/plugins/table/transforms/delete-rows.js +8 -25
- package/dist/es2019/plugins/table/transforms/fix-tables.js +25 -42
- package/dist/es2019/plugins/table/transforms/merge.js +22 -70
- package/dist/es2019/plugins/table/transforms/metadata.js +3 -2
- package/dist/es2019/plugins/table/transforms/replace-table.js +0 -2
- package/dist/es2019/plugins/table/transforms/split.js +16 -19
- package/dist/es2019/plugins/table/types.js +2 -4
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +2 -16
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +8 -54
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +4 -13
- package/dist/es2019/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +0 -2
- package/dist/es2019/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.js +2 -11
- package/dist/es2019/plugins/table/ui/FloatingDeleteButton/index.js +13 -49
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/InsertButton.js +0 -8
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +16 -24
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +3 -31
- package/dist/es2019/plugins/table/ui/LayoutButton/index.js +2 -29
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/index.js +0 -12
- package/dist/es2019/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +6 -12
- package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/index.js +0 -9
- package/dist/es2019/plugins/table/ui/TableFloatingControls/index.js +4 -19
- package/dist/es2019/plugins/table/ui/common-styles.js +6 -5
- package/dist/es2019/plugins/table/ui/consts.js +4 -3
- package/dist/es2019/plugins/table/ui/ui-styles.js +0 -10
- package/dist/es2019/plugins/table/utils/analytics.js +0 -8
- package/dist/es2019/plugins/table/utils/collapse.js +3 -14
- package/dist/es2019/plugins/table/utils/column-controls.js +22 -37
- package/dist/es2019/plugins/table/utils/decoration.js +13 -51
- package/dist/es2019/plugins/table/utils/dom.js +3 -19
- package/dist/es2019/plugins/table/utils/nodes.js +2 -15
- package/dist/es2019/plugins/table/utils/paste.js +17 -22
- package/dist/es2019/plugins/table/utils/row-controls.js +12 -45
- package/dist/es2019/plugins/table/utils/selection.js +0 -21
- package/dist/es2019/plugins/table/utils/table.js +0 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/commands/clear.js +3 -8
- package/dist/esm/plugins/table/commands/collapse.js +0 -3
- package/dist/esm/plugins/table/commands/go-to-next-cell.js +6 -9
- package/dist/esm/plugins/table/commands/hover.js +8 -18
- package/dist/esm/plugins/table/commands/insert.js +16 -36
- package/dist/esm/plugins/table/commands/misc.js +39 -78
- package/dist/esm/plugins/table/commands/selection.js +21 -78
- package/dist/esm/plugins/table/commands/sort.js +2 -14
- package/dist/esm/plugins/table/commands/split-cell.js +3 -8
- package/dist/esm/plugins/table/commands/toggle.js +11 -20
- package/dist/esm/plugins/table/commands-with-analytics.js +50 -85
- package/dist/esm/plugins/table/create-plugin-config.js +0 -3
- package/dist/esm/plugins/table/event-handlers.js +58 -123
- package/dist/esm/plugins/table/handlers.js +11 -29
- package/dist/esm/plugins/table/index.js +47 -60
- package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +8 -44
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +82 -181
- package/dist/esm/plugins/table/nodeviews/table.js +12 -52
- package/dist/esm/plugins/table/nodeviews/tableCell.js +15 -33
- package/dist/esm/plugins/table/nodeviews/update-overflow-shadows.js +3 -10
- package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +0 -5
- package/dist/esm/plugins/table/pm-plugins/decorations/utils/column-controls.js +8 -19
- package/dist/esm/plugins/table/pm-plugins/decorations/utils/column-resizing.js +8 -13
- package/dist/esm/plugins/table/pm-plugins/decorations/utils/compose-decorations.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/keymap.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/main.js +20 -47
- package/dist/esm/plugins/table/pm-plugins/plugin-factory.js +25 -37
- package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +8 -3
- package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +3 -15
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +4 -9
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +58 -147
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/plugin-state.js +15 -27
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/util.js +0 -3
- package/dist/esm/plugins/table/pm-plugins/table-local-id.js +14 -37
- package/dist/esm/plugins/table/pm-plugins/table-resizing/commands.js +12 -24
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +16 -36
- package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin-factory.js +0 -6
- package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin.js +5 -8
- package/dist/esm/plugins/table/pm-plugins/table-resizing/reducer.js +0 -7
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +0 -4
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/column-state.js +8 -12
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/content-width.js +5 -22
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/dom.js +4 -23
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +15 -23
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +15 -60
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +34 -55
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +12 -24
- package/dist/esm/plugins/table/reducer.js +0 -20
- package/dist/esm/plugins/table/toolbar.js +13 -63
- package/dist/esm/plugins/table/transforms/column-width.js +12 -32
- package/dist/esm/plugins/table/transforms/delete-columns.js +11 -62
- package/dist/esm/plugins/table/transforms/delete-rows.js +4 -30
- package/dist/esm/plugins/table/transforms/fix-tables.js +24 -49
- package/dist/esm/plugins/table/transforms/merge.js +16 -75
- package/dist/esm/plugins/table/transforms/metadata.js +3 -2
- package/dist/esm/plugins/table/transforms/replace-table.js +2 -6
- package/dist/esm/plugins/table/transforms/split.js +18 -29
- package/dist/esm/plugins/table/types.js +0 -6
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +10 -31
- package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +0 -2
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +46 -126
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +13 -24
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +0 -2
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +5 -7
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.js +3 -13
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/index.js +19 -68
- package/dist/esm/plugins/table/ui/FloatingInsertButton/InsertButton.js +6 -14
- package/dist/esm/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +5 -18
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +25 -57
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +16 -47
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/index.js +14 -35
- package/dist/esm/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +20 -38
- package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/index.js +10 -29
- package/dist/esm/plugins/table/ui/TableFloatingControls/index.js +33 -62
- package/dist/esm/plugins/table/ui/common-styles.js +6 -7
- package/dist/esm/plugins/table/ui/consts.js +4 -3
- package/dist/esm/plugins/table/ui/ui-styles.js +0 -12
- package/dist/esm/plugins/table/utils/analytics.js +4 -13
- package/dist/esm/plugins/table/utils/collapse.js +4 -15
- package/dist/esm/plugins/table/utils/column-controls.js +25 -41
- package/dist/esm/plugins/table/utils/decoration.js +46 -88
- package/dist/esm/plugins/table/utils/dom.js +4 -20
- package/dist/esm/plugins/table/utils/nodes.js +5 -18
- package/dist/esm/plugins/table/utils/paste.js +24 -29
- package/dist/esm/plugins/table/utils/row-controls.js +6 -46
- package/dist/esm/plugins/table/utils/selection.js +3 -26
- package/dist/esm/plugins/table/utils/table.js +0 -2
- package/dist/esm/version.json +1 -1
- package/package.json +2 -2
- package/src/__tests__/visual-regression/cell-options-menu.ts +1 -12
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
4
|
import { tableCellMinWidth, tableNewColumnMinWidth } from '@atlaskit/editor-common/styles';
|
|
8
5
|
import { calcTableColumnWidths } from '@atlaskit/editor-common/utils';
|
|
9
6
|
import { hasTableBeenResized, insertColgroupFromNode } from './colgroup';
|
|
@@ -13,12 +10,11 @@ import { getTableMaxWidth } from './misc';
|
|
|
13
10
|
import { getSelectedTableInfo } from '../../../utils';
|
|
14
11
|
export var getResizeState = function getResizeState(_ref) {
|
|
15
12
|
var minWidth = _ref.minWidth,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
maxSize = _ref.maxSize,
|
|
14
|
+
table = _ref.table,
|
|
15
|
+
tableRef = _ref.tableRef,
|
|
16
|
+
start = _ref.start,
|
|
17
|
+
domAtPos = _ref.domAtPos;
|
|
22
18
|
if (hasTableBeenResized(table)) {
|
|
23
19
|
var _cols = calcTableColumnWidths(table).map(function (width, index) {
|
|
24
20
|
return {
|
|
@@ -27,17 +23,13 @@ export var getResizeState = function getResizeState(_ref) {
|
|
|
27
23
|
index: index
|
|
28
24
|
};
|
|
29
25
|
});
|
|
30
|
-
|
|
31
26
|
var _widths = _cols.map(function (col) {
|
|
32
27
|
return col.width;
|
|
33
28
|
});
|
|
34
|
-
|
|
35
29
|
var _tableWidth = _widths.reduce(function (sum, width) {
|
|
36
30
|
return sum + width;
|
|
37
31
|
}, 0);
|
|
38
|
-
|
|
39
32
|
var _overflow = _tableWidth > maxSize;
|
|
40
|
-
|
|
41
33
|
return {
|
|
42
34
|
cols: _cols,
|
|
43
35
|
widths: _widths,
|
|
@@ -45,9 +37,9 @@ export var getResizeState = function getResizeState(_ref) {
|
|
|
45
37
|
tableWidth: _tableWidth,
|
|
46
38
|
overflow: _overflow
|
|
47
39
|
};
|
|
48
|
-
}
|
|
49
|
-
|
|
40
|
+
}
|
|
50
41
|
|
|
42
|
+
// Getting the resize state from DOM
|
|
51
43
|
var colgroupChildren = insertColgroupFromNode(tableRef, table);
|
|
52
44
|
var cols = Array.from(colgroupChildren).map(function (_, index) {
|
|
53
45
|
var cellsRefs = getCellsRefsInColumn(index, table, start, domAtPos);
|
|
@@ -67,8 +59,9 @@ export var getResizeState = function getResizeState(_ref) {
|
|
|
67
59
|
tableWidth: tableWidth,
|
|
68
60
|
overflow: overflow
|
|
69
61
|
};
|
|
70
|
-
};
|
|
62
|
+
};
|
|
71
63
|
|
|
64
|
+
// updates Colgroup DOM node with new widths
|
|
72
65
|
export var updateColgroup = function updateColgroup(state, tableRef) {
|
|
73
66
|
var cols = tableRef.querySelectorAll('col');
|
|
74
67
|
state.cols.filter(function (column) {
|
|
@@ -78,8 +71,9 @@ export var updateColgroup = function updateColgroup(state, tableRef) {
|
|
|
78
71
|
if (cols[i]) {
|
|
79
72
|
cols[i].style.width = "".concat(column.width, "px");
|
|
80
73
|
}
|
|
81
|
-
});
|
|
74
|
+
});
|
|
82
75
|
|
|
76
|
+
// colgroup has updated, reflect new widths in sticky header
|
|
83
77
|
syncStickyRowToTable(tableRef);
|
|
84
78
|
};
|
|
85
79
|
export var getTotalWidth = function getTotalWidth(_ref2) {
|
|
@@ -87,13 +81,13 @@ export var getTotalWidth = function getTotalWidth(_ref2) {
|
|
|
87
81
|
return cols.reduce(function (totalWidth, col) {
|
|
88
82
|
return totalWidth + col.width;
|
|
89
83
|
}, 0);
|
|
90
|
-
};
|
|
91
|
-
// difference in total columns widths vs table width happens due to the "Math.floor"
|
|
84
|
+
};
|
|
92
85
|
|
|
86
|
+
// adjust columns to take up the total width
|
|
87
|
+
// difference in total columns widths vs table width happens due to the "Math.floor"
|
|
93
88
|
export var adjustColumnsWidths = function adjustColumnsWidths(resizeState, maxSize) {
|
|
94
89
|
var totalWidth = getTotalWidth(resizeState);
|
|
95
90
|
var diff = maxSize - totalWidth;
|
|
96
|
-
|
|
97
91
|
if (diff > 0 || diff < 0 && Math.abs(diff) < tableCellMinWidth) {
|
|
98
92
|
var updated = false;
|
|
99
93
|
return _objectSpread(_objectSpread({}, resizeState), {}, {
|
|
@@ -104,12 +98,10 @@ export var adjustColumnsWidths = function adjustColumnsWidths(resizeState, maxSi
|
|
|
104
98
|
width: col.width + diff
|
|
105
99
|
});
|
|
106
100
|
}
|
|
107
|
-
|
|
108
101
|
return col;
|
|
109
102
|
})
|
|
110
103
|
});
|
|
111
104
|
}
|
|
112
|
-
|
|
113
105
|
return resizeState;
|
|
114
106
|
};
|
|
115
107
|
export var evenAllColumnsWidths = function evenAllColumnsWidths(resizeState) {
|
|
@@ -124,7 +116,6 @@ export var evenAllColumnsWidths = function evenAllColumnsWidths(resizeState) {
|
|
|
124
116
|
cols: cols
|
|
125
117
|
}), maxSize);
|
|
126
118
|
};
|
|
127
|
-
|
|
128
119
|
var getSpace = function getSpace(columns, start, end) {
|
|
129
120
|
return columns.slice(start, end).map(function (col) {
|
|
130
121
|
return col.width;
|
|
@@ -132,15 +123,15 @@ var getSpace = function getSpace(columns, start, end) {
|
|
|
132
123
|
return sum + width;
|
|
133
124
|
}, 0);
|
|
134
125
|
};
|
|
135
|
-
|
|
136
126
|
export var evenSelectedColumnsWidths = function evenSelectedColumnsWidths(resizeState, rect) {
|
|
137
127
|
var cols = resizeState.cols;
|
|
138
128
|
var selectedSpace = getSpace(cols, rect.left, rect.right);
|
|
139
129
|
var allSpace = getSpace(cols, 0, cols.length);
|
|
140
130
|
var allWidth = allSpace / cols.length;
|
|
141
|
-
var width = selectedSpace / (rect.right - rect.left);
|
|
142
|
-
// unset widths of all columns
|
|
131
|
+
var width = selectedSpace / (rect.right - rect.left);
|
|
143
132
|
|
|
133
|
+
// Result equals even distribution of all columns -
|
|
134
|
+
// unset widths of all columns
|
|
144
135
|
if (allWidth === width) {
|
|
145
136
|
return _objectSpread(_objectSpread({}, resizeState), {}, {
|
|
146
137
|
widths: cols.map(function () {
|
|
@@ -153,7 +144,6 @@ export var evenSelectedColumnsWidths = function evenSelectedColumnsWidths(resize
|
|
|
153
144
|
})
|
|
154
145
|
});
|
|
155
146
|
}
|
|
156
|
-
|
|
157
147
|
return _objectSpread(_objectSpread({}, resizeState), {}, {
|
|
158
148
|
widths: cols.map(function (col, i) {
|
|
159
149
|
return i >= rect.left && i < rect.right ? width : col.width;
|
|
@@ -174,31 +164,26 @@ export var bulkColumnsResize = function bulkColumnsResize(resizeState, columnsIn
|
|
|
174
164
|
var cols = resizeState.cols.map(function (col) {
|
|
175
165
|
if (columnsIndexes.indexOf(col.index) > -1) {
|
|
176
166
|
var diff = col.width - sourceCol.width;
|
|
177
|
-
|
|
178
167
|
if (diff !== 0) {
|
|
179
168
|
widthsDiffs.push(diff);
|
|
180
169
|
}
|
|
181
|
-
|
|
182
170
|
return _objectSpread(_objectSpread({}, col), {}, {
|
|
183
171
|
width: sourceCol.width
|
|
184
172
|
});
|
|
185
173
|
}
|
|
186
|
-
|
|
187
174
|
return col;
|
|
188
175
|
});
|
|
189
|
-
|
|
190
176
|
var newState = _objectSpread(_objectSpread({}, resizeState), {}, {
|
|
191
177
|
cols: cols.map(function (col) {
|
|
192
|
-
if (columnsIndexes.indexOf(col.index) > -1 ||
|
|
178
|
+
if (columnsIndexes.indexOf(col.index) > -1 ||
|
|
179
|
+
// take from prev columns only if dragging the first handle to the left
|
|
193
180
|
columnsIndexes.indexOf(sourceColumnIndex) > -1 && col.index < colIndex) {
|
|
194
181
|
return col;
|
|
195
182
|
}
|
|
196
|
-
|
|
197
183
|
while (widthsDiffs.length) {
|
|
198
184
|
var diff = widthsDiffs.shift() || 0;
|
|
199
185
|
var column = seenColumns[col.index] || col;
|
|
200
186
|
var maybeWidth = column.width + diff;
|
|
201
|
-
|
|
202
187
|
if (maybeWidth > column.minWidth) {
|
|
203
188
|
seenColumns[column.index] = _objectSpread(_objectSpread({}, column), {}, {
|
|
204
189
|
width: maybeWidth
|
|
@@ -211,21 +196,21 @@ export var bulkColumnsResize = function bulkColumnsResize(resizeState, columnsIn
|
|
|
211
196
|
break;
|
|
212
197
|
}
|
|
213
198
|
}
|
|
214
|
-
|
|
215
199
|
return seenColumns[col.index] || col;
|
|
216
200
|
})
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
var minTableWidth = resizeState.maxSize; // new table widths after bulk resize
|
|
221
|
-
|
|
222
|
-
var newTotalWidth = getTotalWidth(newState); // when all columns are selected, what do we do when sum of columns widths is lower than min possible table widths?
|
|
201
|
+
});
|
|
223
202
|
|
|
203
|
+
// minimum possible table widths at the current layout
|
|
204
|
+
var minTableWidth = resizeState.maxSize;
|
|
205
|
+
// new table widths after bulk resize
|
|
206
|
+
var newTotalWidth = getTotalWidth(newState);
|
|
207
|
+
// when all columns are selected, what do we do when sum of columns widths is lower than min possible table widths?
|
|
224
208
|
if (columnsIndexes.length === resizeState.cols.length && newTotalWidth < minTableWidth) {
|
|
225
209
|
// table is not in overflow -> normal resize of a single column
|
|
226
210
|
if (currentTableWidth === minTableWidth) {
|
|
227
211
|
return resizeState;
|
|
228
|
-
}
|
|
212
|
+
}
|
|
213
|
+
// table is in overflow: keep the dragged column at its widths and evenly distribute columns
|
|
229
214
|
// to recover from overflow state
|
|
230
215
|
else {
|
|
231
216
|
var columnWidth = Math.floor((minTableWidth - sourceCol.width) / (newState.cols.length - 1));
|
|
@@ -234,16 +219,15 @@ export var bulkColumnsResize = function bulkColumnsResize(resizeState, columnsIn
|
|
|
234
219
|
if (col.index === sourceCol.index) {
|
|
235
220
|
return col;
|
|
236
221
|
}
|
|
237
|
-
|
|
238
222
|
return _objectSpread(_objectSpread({}, col), {}, {
|
|
239
223
|
width: columnWidth
|
|
240
224
|
});
|
|
241
225
|
})
|
|
242
226
|
});
|
|
243
227
|
}
|
|
244
|
-
}
|
|
245
|
-
|
|
228
|
+
}
|
|
246
229
|
|
|
230
|
+
// fix total table widths by adding missing pixels to columns widths here and there
|
|
247
231
|
return adjustColumnsWidths(newState, resizeState.maxSize);
|
|
248
232
|
};
|
|
249
233
|
export var areColumnsEven = function areColumnsEven(resizeState) {
|
|
@@ -251,37 +235,32 @@ export var areColumnsEven = function areColumnsEven(resizeState) {
|
|
|
251
235
|
return newResizeState.cols.every(function (col, i) {
|
|
252
236
|
return col.width === resizeState.cols[i].width;
|
|
253
237
|
});
|
|
254
|
-
};
|
|
238
|
+
};
|
|
255
239
|
|
|
240
|
+
// Get the layout
|
|
256
241
|
export var normaliseTableLayout = function normaliseTableLayout(input) {
|
|
257
242
|
switch (input) {
|
|
258
243
|
case 'wide':
|
|
259
244
|
return input;
|
|
260
|
-
|
|
261
245
|
case 'full-width':
|
|
262
246
|
return input;
|
|
263
|
-
|
|
264
247
|
default:
|
|
265
248
|
return 'default';
|
|
266
249
|
}
|
|
267
250
|
};
|
|
268
251
|
export var getNewResizeStateFromSelectedColumns = function getNewResizeStateFromSelectedColumns(rect, state, domAtPos, getEditorContainerWidth) {
|
|
269
252
|
var _getSelectedTableInfo = getSelectedTableInfo(state.selection),
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
253
|
+
totalRowCount = _getSelectedTableInfo.totalRowCount,
|
|
254
|
+
totalColumnCount = _getSelectedTableInfo.totalColumnCount,
|
|
255
|
+
table = _getSelectedTableInfo.table;
|
|
274
256
|
if (!table) {
|
|
275
257
|
return;
|
|
276
258
|
}
|
|
277
|
-
|
|
278
259
|
var maybeTable = domAtPos(table.start).node;
|
|
279
260
|
var tableRef = maybeTable.closest('table');
|
|
280
|
-
|
|
281
261
|
if (!tableRef) {
|
|
282
262
|
return;
|
|
283
263
|
}
|
|
284
|
-
|
|
285
264
|
var layout = normaliseTableLayout(tableRef === null || tableRef === void 0 ? void 0 : tableRef.dataset.layout);
|
|
286
265
|
var maxSize = getTableMaxWidth({
|
|
287
266
|
table: table.node,
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
4
|
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
8
5
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
9
6
|
import { getTableWidth } from '../../../utils';
|
|
@@ -17,13 +14,14 @@ export var scale = function scale(tableRef, options, domAtPos) {
|
|
|
17
14
|
* isBreakoutEnabled === true -> default center aligned
|
|
18
15
|
* isBreakoutEnabled === false -> full width mode
|
|
19
16
|
*/
|
|
17
|
+
|
|
20
18
|
var node = options.node,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
containerWidth = options.containerWidth,
|
|
20
|
+
previousContainerWidth = options.previousContainerWidth,
|
|
21
|
+
prevNode = options.prevNode,
|
|
22
|
+
start = options.start,
|
|
23
|
+
isBreakoutEnabled = options.isBreakoutEnabled,
|
|
24
|
+
layoutChanged = options.layoutChanged;
|
|
27
25
|
var maxSize = getLayoutSize(node.attrs.layout, containerWidth, {
|
|
28
26
|
isBreakoutEnabled: isBreakoutEnabled
|
|
29
27
|
});
|
|
@@ -31,14 +29,13 @@ export var scale = function scale(tableRef, options, domAtPos) {
|
|
|
31
29
|
var previousMaxSize = getLayoutSize(prevNode.attrs.layout, previousContainerWidth, {
|
|
32
30
|
isBreakoutEnabled: isBreakoutEnabled
|
|
33
31
|
});
|
|
34
|
-
var newWidth = maxSize;
|
|
32
|
+
var newWidth = maxSize;
|
|
35
33
|
|
|
34
|
+
// adjust table width if layout is updated
|
|
36
35
|
var hasOverflow = prevTableWidth > previousMaxSize;
|
|
37
|
-
|
|
38
36
|
if (layoutChanged && hasOverflow) {
|
|
39
37
|
// No keep overflow if the old content can be in the new size
|
|
40
38
|
var canFitInNewSize = prevTableWidth < maxSize;
|
|
41
|
-
|
|
42
39
|
if (canFitInNewSize) {
|
|
43
40
|
newWidth = maxSize;
|
|
44
41
|
} else {
|
|
@@ -47,11 +44,9 @@ export var scale = function scale(tableRef, options, domAtPos) {
|
|
|
47
44
|
newWidth = Math.floor(newWidth * overflowScale);
|
|
48
45
|
}
|
|
49
46
|
}
|
|
50
|
-
|
|
51
47
|
if (node.attrs.isNumberColumnEnabled) {
|
|
52
48
|
newWidth -= akEditorTableNumberColumnWidth;
|
|
53
49
|
}
|
|
54
|
-
|
|
55
50
|
var resizeState = getResizeState({
|
|
56
51
|
minWidth: tableCellMinWidth,
|
|
57
52
|
maxSize: maxSize,
|
|
@@ -71,39 +66,32 @@ export var scaleWithParent = function scaleWithParent(tableRef, parentWidth, tab
|
|
|
71
66
|
start: start,
|
|
72
67
|
domAtPos: domAtPos
|
|
73
68
|
});
|
|
74
|
-
|
|
75
69
|
if (table.attrs.isNumberColumnEnabled) {
|
|
76
70
|
parentWidth -= akEditorTableNumberColumnWidth;
|
|
77
71
|
}
|
|
78
|
-
|
|
79
72
|
return scaleTableTo(resizeState, Math.floor(parentWidth));
|
|
80
|
-
};
|
|
73
|
+
};
|
|
81
74
|
|
|
75
|
+
// Scales the table to a given size and updates its colgroup DOM node
|
|
82
76
|
export function scaleTableTo(state, maxSize) {
|
|
83
77
|
var scaleFactor = maxSize / getTotalWidth(state);
|
|
84
|
-
|
|
85
78
|
var newState = _objectSpread(_objectSpread({}, state), {}, {
|
|
86
79
|
maxSize: maxSize,
|
|
87
80
|
cols: state.cols.map(function (col) {
|
|
88
81
|
var minWidth = col.minWidth,
|
|
89
|
-
|
|
82
|
+
width = col.width;
|
|
90
83
|
var newColWidth = Math.floor(width * scaleFactor);
|
|
91
|
-
|
|
92
84
|
if (newColWidth < minWidth) {
|
|
93
85
|
newColWidth = minWidth;
|
|
94
86
|
}
|
|
95
|
-
|
|
96
87
|
return _objectSpread(_objectSpread({}, col), {}, {
|
|
97
88
|
width: newColWidth
|
|
98
89
|
});
|
|
99
90
|
})
|
|
100
91
|
});
|
|
101
|
-
|
|
102
92
|
var newTotalWidth = getTotalWidth(newState);
|
|
103
|
-
|
|
104
93
|
if (newTotalWidth > maxSize) {
|
|
105
94
|
newState = reduceSpace(newState, newTotalWidth - maxSize);
|
|
106
95
|
}
|
|
107
|
-
|
|
108
96
|
return adjustColumnsWidths(newState, maxSize);
|
|
109
97
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
4
|
import { defaultTableSelection } from './pm-plugins/default-table-selection';
|
|
8
5
|
export default (function (pluginState, action) {
|
|
9
6
|
switch (action.type) {
|
|
@@ -11,51 +8,40 @@ export default (function (pluginState, action) {
|
|
|
11
8
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
12
9
|
isHeaderColumnEnabled: !pluginState.isHeaderColumnEnabled
|
|
13
10
|
});
|
|
14
|
-
|
|
15
11
|
case 'TOGGLE_HEADER_ROW':
|
|
16
12
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
17
13
|
isHeaderRowEnabled: !pluginState.isHeaderRowEnabled
|
|
18
14
|
});
|
|
19
|
-
|
|
20
15
|
case 'CLEAR_HOVER_SELECTION':
|
|
21
16
|
return _objectSpread(_objectSpread(_objectSpread({}, pluginState), action.data), defaultTableSelection);
|
|
22
|
-
|
|
23
17
|
case 'SELECT_COLUMN':
|
|
24
18
|
return _objectSpread(_objectSpread(_objectSpread({}, pluginState), action.data), {}, {
|
|
25
19
|
isContextualMenuOpen: false
|
|
26
20
|
});
|
|
27
|
-
|
|
28
21
|
case 'SET_TARGET_CELL_POSITION':
|
|
29
22
|
return _objectSpread(_objectSpread(_objectSpread({}, pluginState), action.data), {}, {
|
|
30
23
|
isContextualMenuOpen: false
|
|
31
24
|
});
|
|
32
|
-
|
|
33
25
|
case 'SET_TABLE_LAYOUT':
|
|
34
26
|
return _objectSpread(_objectSpread({}, pluginState), action.data);
|
|
35
|
-
|
|
36
27
|
case 'TOGGLE_CONTEXTUAL_MENU':
|
|
37
28
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
38
29
|
isContextualMenuOpen: !pluginState.isContextualMenuOpen
|
|
39
30
|
});
|
|
40
|
-
|
|
41
31
|
case 'SHOW_INSERT_ROW_BUTTON':
|
|
42
32
|
if (action.data.insertRowButtonIndex === pluginState.insertRowButtonIndex) {
|
|
43
33
|
return pluginState;
|
|
44
34
|
}
|
|
45
|
-
|
|
46
35
|
return _objectSpread(_objectSpread(_objectSpread({}, pluginState), action.data), {}, {
|
|
47
36
|
insertColumnButtonIndex: undefined // We need to assure that column is not shown
|
|
48
|
-
|
|
49
37
|
});
|
|
50
38
|
|
|
51
39
|
case 'SHOW_INSERT_COLUMN_BUTTON':
|
|
52
40
|
if (action.data.insertColumnButtonIndex === pluginState.insertColumnButtonIndex) {
|
|
53
41
|
return pluginState;
|
|
54
42
|
}
|
|
55
|
-
|
|
56
43
|
return _objectSpread(_objectSpread(_objectSpread({}, pluginState), action.data), {}, {
|
|
57
44
|
insertRowButtonIndex: undefined // We need to assure that row is not shown
|
|
58
|
-
|
|
59
45
|
});
|
|
60
46
|
|
|
61
47
|
case 'HIDE_INSERT_COLUMN_OR_ROW_BUTTON':
|
|
@@ -65,22 +51,17 @@ export default (function (pluginState, action) {
|
|
|
65
51
|
insertColumnButtonIndex: undefined
|
|
66
52
|
});
|
|
67
53
|
}
|
|
68
|
-
|
|
69
54
|
return pluginState;
|
|
70
|
-
|
|
71
55
|
case 'HIDE_RESIZE_HANDLE_LINE':
|
|
72
56
|
return _objectSpread(_objectSpread(_objectSpread({}, pluginState), action.data), {}, {
|
|
73
57
|
resizeHandleColumnIndex: undefined,
|
|
74
58
|
resizeHandleRowIndex: undefined
|
|
75
59
|
});
|
|
76
|
-
|
|
77
60
|
case 'ADD_RESIZE_HANDLE_DECORATIONS':
|
|
78
61
|
if (action.data.resizeHandleColumnIndex === pluginState.resizeHandleColumnIndex && action.data.resizeHandleRowIndex === pluginState.resizeHandleRowIndex) {
|
|
79
62
|
return pluginState;
|
|
80
63
|
}
|
|
81
|
-
|
|
82
64
|
return _objectSpread(_objectSpread({}, pluginState), action.data);
|
|
83
|
-
|
|
84
65
|
case 'SET_TABLE_REF':
|
|
85
66
|
case 'HOVER_ROWS':
|
|
86
67
|
case 'HOVER_COLUMNS':
|
|
@@ -89,7 +70,6 @@ export default (function (pluginState, action) {
|
|
|
89
70
|
case 'SHOW_RESIZE_HANDLE_LINE':
|
|
90
71
|
case 'SET_EDITOR_FOCUS':
|
|
91
72
|
return _objectSpread(_objectSpread({}, pluginState), action.data);
|
|
92
|
-
|
|
93
73
|
default:
|
|
94
74
|
return pluginState;
|
|
95
75
|
}
|