@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
|
@@ -10,44 +10,36 @@ import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
|
10
10
|
import { toggleTableLayoutWithAnalytics } from '../../commands-with-analytics';
|
|
11
11
|
import { TableCssClassName as ClassName } from '../../types';
|
|
12
12
|
import { findDomRefAtPos } from 'prosemirror-utils';
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const addPopupOffset = pos => ({
|
|
14
|
+
...pos,
|
|
15
15
|
// add 12 pixels to align y position with
|
|
16
16
|
//the columns controls
|
|
17
17
|
top: pos.top ? pos.top + 12 : undefined
|
|
18
18
|
});
|
|
19
|
-
|
|
20
19
|
const getMessage = layout => {
|
|
21
20
|
switch (layout) {
|
|
22
21
|
case 'default':
|
|
23
22
|
return commonMessages.layoutWide;
|
|
24
|
-
|
|
25
23
|
case 'wide':
|
|
26
24
|
return commonMessages.layoutFullWidth;
|
|
27
|
-
|
|
28
25
|
default:
|
|
29
26
|
return commonMessages.layoutFixedWidth;
|
|
30
27
|
}
|
|
31
28
|
};
|
|
32
|
-
|
|
33
29
|
class LayoutButton extends React.Component {
|
|
34
30
|
constructor(...args) {
|
|
35
31
|
super(...args);
|
|
36
|
-
|
|
37
32
|
_defineProperty(this, "stickyButtonRef", /*#__PURE__*/createRef());
|
|
38
|
-
|
|
39
33
|
_defineProperty(this, "resizeObserver", new ResizeObserver(entries => {
|
|
40
34
|
entries.forEach(entry => {
|
|
41
35
|
const resizeButton = this.stickyButtonRef.current;
|
|
42
36
|
const tableWrapper = this.props.targetRef;
|
|
43
|
-
|
|
44
37
|
if (resizeButton && tableWrapper) {
|
|
45
38
|
const clientRect = tableWrapper.getBoundingClientRect();
|
|
46
39
|
resizeButton.style.left = `${clientRect.right}px`;
|
|
47
40
|
}
|
|
48
41
|
});
|
|
49
42
|
}));
|
|
50
|
-
|
|
51
43
|
_defineProperty(this, "handleClick", () => {
|
|
52
44
|
const {
|
|
53
45
|
state,
|
|
@@ -56,7 +48,6 @@ class LayoutButton extends React.Component {
|
|
|
56
48
|
toggleTableLayoutWithAnalytics(this.props.editorAnalyticsAPI)(state, dispatch);
|
|
57
49
|
});
|
|
58
50
|
}
|
|
59
|
-
|
|
60
51
|
getTitle() {
|
|
61
52
|
const {
|
|
62
53
|
intl: {
|
|
@@ -66,7 +57,6 @@ class LayoutButton extends React.Component {
|
|
|
66
57
|
} = this.props;
|
|
67
58
|
return formatMessage(getMessage(layout));
|
|
68
59
|
}
|
|
69
|
-
|
|
70
60
|
toolbarButton() {
|
|
71
61
|
const {
|
|
72
62
|
isResizing,
|
|
@@ -87,7 +77,6 @@ class LayoutButton extends React.Component {
|
|
|
87
77
|
})
|
|
88
78
|
}));
|
|
89
79
|
}
|
|
90
|
-
|
|
91
80
|
getStickyTargetRef(pos) {
|
|
92
81
|
const {
|
|
93
82
|
editorView
|
|
@@ -96,14 +85,11 @@ class LayoutButton extends React.Component {
|
|
|
96
85
|
const node = findDomRefAtPos(pos, domAtPos);
|
|
97
86
|
return node.dataset['headerRow'] && node.classList.contains('sticky') ? node : null;
|
|
98
87
|
}
|
|
99
|
-
|
|
100
88
|
renderSticky(button, targetRef, tableRef) {
|
|
101
89
|
const title = this.getTitle();
|
|
102
|
-
|
|
103
90
|
if (!(targetRef instanceof HTMLElement) || !(tableRef instanceof HTMLElement)) {
|
|
104
91
|
return null;
|
|
105
92
|
}
|
|
106
|
-
|
|
107
93
|
const pos = targetRef.getBoundingClientRect();
|
|
108
94
|
const tablePos = tableRef.getBoundingClientRect();
|
|
109
95
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -116,7 +102,6 @@ class LayoutButton extends React.Component {
|
|
|
116
102
|
}
|
|
117
103
|
}, button);
|
|
118
104
|
}
|
|
119
|
-
|
|
120
105
|
renderPopup(button) {
|
|
121
106
|
const {
|
|
122
107
|
mountPoint,
|
|
@@ -124,11 +109,9 @@ class LayoutButton extends React.Component {
|
|
|
124
109
|
scrollableElement,
|
|
125
110
|
targetRef
|
|
126
111
|
} = this.props;
|
|
127
|
-
|
|
128
112
|
if (!targetRef) {
|
|
129
113
|
return null;
|
|
130
114
|
}
|
|
131
|
-
|
|
132
115
|
const title = this.getTitle();
|
|
133
116
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
134
117
|
ariaLabel: title,
|
|
@@ -143,39 +126,32 @@ class LayoutButton extends React.Component {
|
|
|
143
126
|
forcePlacement: true
|
|
144
127
|
}, button);
|
|
145
128
|
}
|
|
146
|
-
|
|
147
129
|
render() {
|
|
148
130
|
const {
|
|
149
131
|
stickyHeader
|
|
150
132
|
} = this.props;
|
|
151
133
|
const button = this.toolbarButton();
|
|
152
134
|
const stickyTargetRef = stickyHeader && stickyHeader.sticky && stickyHeader.pos ? this.getStickyTargetRef(stickyHeader.pos) : null;
|
|
153
|
-
|
|
154
135
|
if (stickyTargetRef && this.props.targetRef) {
|
|
155
136
|
return this.renderSticky(button, stickyTargetRef, this.props.targetRef);
|
|
156
137
|
} else {
|
|
157
138
|
return this.renderPopup(button);
|
|
158
139
|
}
|
|
159
140
|
}
|
|
160
|
-
|
|
161
141
|
componentDidMount() {
|
|
162
142
|
const dom = this.props.editorView.dom;
|
|
163
143
|
const scrollPanel = dom.closest('.fabric-editor-popup-scroll-parent');
|
|
164
|
-
|
|
165
144
|
if (scrollPanel instanceof HTMLElement) {
|
|
166
145
|
this.resizeObserver.observe(scrollPanel);
|
|
167
146
|
}
|
|
168
147
|
}
|
|
169
|
-
|
|
170
148
|
componentWillUnmount() {
|
|
171
149
|
const dom = this.props.editorView.dom;
|
|
172
150
|
const scrollPanel = dom.closest('.fabric-editor-popup-scroll-parent');
|
|
173
|
-
|
|
174
151
|
if (scrollPanel instanceof HTMLElement) {
|
|
175
152
|
this.resizeObserver.unobserve(scrollPanel);
|
|
176
153
|
}
|
|
177
154
|
}
|
|
178
|
-
|
|
179
155
|
shouldComponentUpdate(nextProps) {
|
|
180
156
|
const {
|
|
181
157
|
targetRef,
|
|
@@ -185,9 +161,6 @@ class LayoutButton extends React.Component {
|
|
|
185
161
|
} = this.props;
|
|
186
162
|
return stickyHeader !== nextProps.stickyHeader || targetRef !== nextProps.targetRef || layout !== nextProps.layout || isResizing !== nextProps.isResizing;
|
|
187
163
|
}
|
|
188
|
-
|
|
189
164
|
}
|
|
190
|
-
|
|
191
165
|
_defineProperty(LayoutButton, "displayName", 'LayoutButton');
|
|
192
|
-
|
|
193
166
|
export default injectIntl(LayoutButton);
|
|
@@ -13,11 +13,9 @@ const messages = defineMessages({
|
|
|
13
13
|
description: 'A button on the upper left corner of the table that shows up when the table is in focus. Clicking on it will select the entire table.'
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
|
|
17
16
|
class CornerControlComponent extends Component {
|
|
18
17
|
constructor(...args) {
|
|
19
18
|
super(...args);
|
|
20
|
-
|
|
21
19
|
_defineProperty(this, "isActive", () => {
|
|
22
20
|
const {
|
|
23
21
|
editorView,
|
|
@@ -28,14 +26,11 @@ class CornerControlComponent extends Component {
|
|
|
28
26
|
selection
|
|
29
27
|
} = editorView.state;
|
|
30
28
|
const table = findTable(selection);
|
|
31
|
-
|
|
32
29
|
if (!table) {
|
|
33
30
|
return false;
|
|
34
31
|
}
|
|
35
|
-
|
|
36
32
|
return isTableSelected(selection) || hoveredRows && hoveredRows.length === TableMap.get(table.node).height && !isResizing;
|
|
37
33
|
});
|
|
38
|
-
|
|
39
34
|
_defineProperty(this, "clearHoverSelection", () => {
|
|
40
35
|
const {
|
|
41
36
|
state,
|
|
@@ -43,7 +38,6 @@ class CornerControlComponent extends Component {
|
|
|
43
38
|
} = this.props.editorView;
|
|
44
39
|
clearHoverSelection()(state, dispatch);
|
|
45
40
|
});
|
|
46
|
-
|
|
47
41
|
_defineProperty(this, "selectTable", () => {
|
|
48
42
|
const {
|
|
49
43
|
state,
|
|
@@ -51,7 +45,6 @@ class CornerControlComponent extends Component {
|
|
|
51
45
|
} = this.props.editorView;
|
|
52
46
|
dispatch(selectTable(state.tr).setMeta('addToHistory', false));
|
|
53
47
|
});
|
|
54
|
-
|
|
55
48
|
_defineProperty(this, "hoverTable", () => {
|
|
56
49
|
const {
|
|
57
50
|
state,
|
|
@@ -60,7 +53,6 @@ class CornerControlComponent extends Component {
|
|
|
60
53
|
hoverTable()(state, dispatch);
|
|
61
54
|
});
|
|
62
55
|
}
|
|
63
|
-
|
|
64
56
|
render() {
|
|
65
57
|
const {
|
|
66
58
|
isInDanger,
|
|
@@ -71,11 +63,9 @@ class CornerControlComponent extends Component {
|
|
|
71
63
|
formatMessage
|
|
72
64
|
}
|
|
73
65
|
} = this.props;
|
|
74
|
-
|
|
75
66
|
if (!tableRef) {
|
|
76
67
|
return null;
|
|
77
68
|
}
|
|
78
|
-
|
|
79
69
|
const isActive = this.isActive();
|
|
80
70
|
return /*#__PURE__*/React.createElement("div", {
|
|
81
71
|
className: classnames(ClassName.CORNER_CONTROLS, {
|
|
@@ -105,7 +95,5 @@ class CornerControlComponent extends Component {
|
|
|
105
95
|
className: ClassName.CONTROLS_INSERT_MARKER
|
|
106
96
|
})));
|
|
107
97
|
}
|
|
108
|
-
|
|
109
98
|
}
|
|
110
|
-
|
|
111
99
|
export const CornerControls = injectIntl(CornerControlComponent);
|
|
@@ -8,16 +8,14 @@ import { getRowHeights } from '../../../utils';
|
|
|
8
8
|
export default class NumberColumn extends Component {
|
|
9
9
|
constructor(...args) {
|
|
10
10
|
super(...args);
|
|
11
|
-
|
|
12
11
|
_defineProperty(this, "hoverRows", index => this.props.tableActive ? this.props.hoverRows([index]) : null);
|
|
13
|
-
|
|
14
12
|
_defineProperty(this, "selectRow", (index, event) => {
|
|
15
13
|
const {
|
|
16
14
|
tableActive,
|
|
17
15
|
editorView,
|
|
18
16
|
selectRow
|
|
19
|
-
} = this.props;
|
|
20
|
-
|
|
17
|
+
} = this.props;
|
|
18
|
+
// If selection is outside the table then first reset the selection inside table
|
|
21
19
|
if (!tableActive && event.target && event.target instanceof Node) {
|
|
22
20
|
const {
|
|
23
21
|
doc,
|
|
@@ -26,22 +24,21 @@ export default class NumberColumn extends Component {
|
|
|
26
24
|
} = editorView.state;
|
|
27
25
|
const pos = editorView.posAtDOM(event.target, 1);
|
|
28
26
|
const $pos = doc.resolve(pos);
|
|
29
|
-
const newPos = selection.head > pos ?
|
|
27
|
+
const newPos = selection.head > pos ?
|
|
28
|
+
// Selection is after table
|
|
30
29
|
// nodeSize - 3 will move the position inside last table cell
|
|
31
|
-
Selection.near(doc.resolve(pos + ($pos.parent.nodeSize - 3)), -1) :
|
|
30
|
+
Selection.near(doc.resolve(pos + ($pos.parent.nodeSize - 3)), -1) :
|
|
31
|
+
// Selection is before table
|
|
32
32
|
Selection.near($pos);
|
|
33
33
|
editorView.dispatch(tr.setSelection(newPos));
|
|
34
34
|
}
|
|
35
|
-
|
|
36
35
|
selectRow(index, event.shiftKey);
|
|
37
36
|
});
|
|
38
|
-
|
|
39
37
|
_defineProperty(this, "clearHoverSelection", () => {
|
|
40
38
|
const {
|
|
41
39
|
tableActive,
|
|
42
40
|
editorView
|
|
43
41
|
} = this.props;
|
|
44
|
-
|
|
45
42
|
if (tableActive) {
|
|
46
43
|
const {
|
|
47
44
|
state,
|
|
@@ -50,7 +47,6 @@ export default class NumberColumn extends Component {
|
|
|
50
47
|
clearHoverSelection()(state, dispatch);
|
|
51
48
|
}
|
|
52
49
|
});
|
|
53
|
-
|
|
54
50
|
_defineProperty(this, "getClassNames", index => {
|
|
55
51
|
const {
|
|
56
52
|
hoveredRows,
|
|
@@ -62,7 +58,6 @@ export default class NumberColumn extends Component {
|
|
|
62
58
|
return [ClassName.NUMBERED_COLUMN_BUTTON, isActive ? ClassName.HOVERED_CELL_ACTIVE : '', isActive && isInDanger ? ClassName.HOVERED_CELL_IN_DANGER : ''].join(' ');
|
|
63
59
|
});
|
|
64
60
|
}
|
|
65
|
-
|
|
66
61
|
render() {
|
|
67
62
|
const {
|
|
68
63
|
tableRef,
|
|
@@ -88,5 +83,4 @@ export default class NumberColumn extends Component {
|
|
|
88
83
|
onMouseOut: this.clearHoverSelection
|
|
89
84
|
}, hasHeaderRow ? index > 0 ? index : null : index + 1)));
|
|
90
85
|
}
|
|
91
|
-
|
|
92
86
|
}
|
|
@@ -12,11 +12,9 @@ const messages = defineMessages({
|
|
|
12
12
|
description: 'A button on the left of each row that shows up when the table is in focus. Clicking on it will select the entire row.'
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
-
|
|
16
15
|
class RowControlsComponent extends Component {
|
|
17
16
|
constructor(...args) {
|
|
18
17
|
super(...args);
|
|
19
|
-
|
|
20
18
|
_defineProperty(this, "clearHoverSelection", () => {
|
|
21
19
|
const {
|
|
22
20
|
state,
|
|
@@ -25,7 +23,6 @@ class RowControlsComponent extends Component {
|
|
|
25
23
|
clearHoverSelection()(state, dispatch);
|
|
26
24
|
});
|
|
27
25
|
}
|
|
28
|
-
|
|
29
26
|
render() {
|
|
30
27
|
const {
|
|
31
28
|
editorView,
|
|
@@ -37,11 +34,9 @@ class RowControlsComponent extends Component {
|
|
|
37
34
|
formatMessage
|
|
38
35
|
}
|
|
39
36
|
} = this.props;
|
|
40
|
-
|
|
41
37
|
if (!tableRef) {
|
|
42
38
|
return null;
|
|
43
39
|
}
|
|
44
|
-
|
|
45
40
|
const {
|
|
46
41
|
selection
|
|
47
42
|
} = editorView.state;
|
|
@@ -60,11 +55,9 @@ class RowControlsComponent extends Component {
|
|
|
60
55
|
}, index) => {
|
|
61
56
|
// if previous row was header row, add its height to our margin
|
|
62
57
|
let marginTop = -1;
|
|
63
|
-
|
|
64
58
|
if (index === 1 && hasHeaderRow && this.props.stickyTop !== undefined) {
|
|
65
59
|
marginTop += rowHeights[index - 1] + tableToolbarSize;
|
|
66
60
|
}
|
|
67
|
-
|
|
68
61
|
const thisRowSticky = this.props.stickyTop !== undefined && index === 0 && hasHeaderRow;
|
|
69
62
|
return /*#__PURE__*/React.createElement("div", {
|
|
70
63
|
className: `${ClassName.ROW_CONTROLS_BUTTON_WRAP} ${getRowClassNames(startIndex, selection, hoveredRows, isInDanger, isResizing)} ${thisRowSticky ? 'sticky' : ''}`,
|
|
@@ -91,7 +84,5 @@ class RowControlsComponent extends Component {
|
|
|
91
84
|
}));
|
|
92
85
|
})));
|
|
93
86
|
}
|
|
94
|
-
|
|
95
87
|
}
|
|
96
|
-
|
|
97
88
|
export const RowControls = injectIntl(RowControlsComponent);
|
|
@@ -9,7 +9,6 @@ import { RowControls } from './RowControls';
|
|
|
9
9
|
export default class TableFloatingControls extends Component {
|
|
10
10
|
constructor(...args) {
|
|
11
11
|
super(...args);
|
|
12
|
-
|
|
13
12
|
_defineProperty(this, "selectRow", (row, expand) => {
|
|
14
13
|
const {
|
|
15
14
|
editorView
|
|
@@ -17,15 +16,13 @@ export default class TableFloatingControls extends Component {
|
|
|
17
16
|
const {
|
|
18
17
|
state,
|
|
19
18
|
dispatch
|
|
20
|
-
} = editorView;
|
|
21
|
-
|
|
19
|
+
} = editorView;
|
|
20
|
+
// fix for issue ED-4665
|
|
22
21
|
if (browser.ie_version === 11) {
|
|
23
22
|
editorView.dom.blur();
|
|
24
23
|
}
|
|
25
|
-
|
|
26
24
|
selectRow(row, expand)(state, dispatch);
|
|
27
25
|
});
|
|
28
|
-
|
|
29
26
|
_defineProperty(this, "hoverRows", (rows, danger) => {
|
|
30
27
|
const {
|
|
31
28
|
state,
|
|
@@ -34,27 +31,23 @@ export default class TableFloatingControls extends Component {
|
|
|
34
31
|
hoverRows(rows, danger)(state, dispatch);
|
|
35
32
|
});
|
|
36
33
|
}
|
|
37
|
-
|
|
38
34
|
componentDidMount() {
|
|
39
35
|
this.tryInitResizeObserver();
|
|
40
36
|
}
|
|
41
|
-
|
|
42
37
|
componentDidUpdate() {
|
|
43
38
|
// tableRef prop is not guaranteed to be defined after componentDidMount, so retry to init resize observer on update
|
|
44
39
|
this.tryInitResizeObserver();
|
|
45
|
-
}
|
|
46
|
-
|
|
40
|
+
}
|
|
47
41
|
|
|
42
|
+
// tracking the table height changes to update floating controls
|
|
48
43
|
tryInitResizeObserver() {
|
|
49
44
|
var _window;
|
|
50
|
-
|
|
51
45
|
let {
|
|
52
46
|
tableRef
|
|
53
47
|
} = this.props;
|
|
54
48
|
const {
|
|
55
49
|
tableRenderOptimization
|
|
56
50
|
} = this.props.getEditorFeatureFlags();
|
|
57
|
-
|
|
58
51
|
if (tableRenderOptimization && tableRef && !this.resizeObserver && (_window = window) !== null && _window !== void 0 && _window.ResizeObserver) {
|
|
59
52
|
this.resizeObserver = new ResizeObserver(entries => {
|
|
60
53
|
for (let entry of entries) {
|
|
@@ -67,10 +60,8 @@ export default class TableFloatingControls extends Component {
|
|
|
67
60
|
this.resizeObserver.observe(tableRef);
|
|
68
61
|
}
|
|
69
62
|
}
|
|
70
|
-
|
|
71
63
|
shouldComponentUpdate(nextProps, nextState) {
|
|
72
64
|
var _this$state;
|
|
73
|
-
|
|
74
65
|
const {
|
|
75
66
|
tableRef,
|
|
76
67
|
isInDanger,
|
|
@@ -92,13 +83,11 @@ export default class TableFloatingControls extends Component {
|
|
|
92
83
|
const nextTableHeight = tableRenderOptimization ? nextState === null || nextState === void 0 ? void 0 : nextState.tableHeight : nextProps.tableHeight;
|
|
93
84
|
return ordering !== nextProps.ordering || tableRef !== nextProps.tableRef || tableHeight !== nextTableHeight || tableActive !== nextProps.tableActive || isInDanger !== nextProps.isInDanger || isResizing !== nextProps.isResizing || hoveredRows !== nextProps.hoveredRows || isHeaderRowEnabled !== nextProps.isHeaderRowEnabled || isHeaderColumnEnabled !== nextProps.isHeaderColumnEnabled || isNumberColumnEnabled !== nextProps.isNumberColumnEnabled || isSelectionUpdated(selection, nextProps.selection) || headerRowHeight !== nextProps.headerRowHeight || stickyHeader !== nextProps.stickyHeader;
|
|
94
85
|
}
|
|
95
|
-
|
|
96
86
|
componentWillUnmount() {
|
|
97
87
|
if (this.resizeObserver) {
|
|
98
88
|
this.resizeObserver.disconnect();
|
|
99
89
|
}
|
|
100
90
|
}
|
|
101
|
-
|
|
102
91
|
render() {
|
|
103
92
|
const {
|
|
104
93
|
editorView,
|
|
@@ -113,11 +102,9 @@ export default class TableFloatingControls extends Component {
|
|
|
113
102
|
hoveredRows,
|
|
114
103
|
stickyHeader
|
|
115
104
|
} = this.props;
|
|
116
|
-
|
|
117
105
|
if (!tableRef) {
|
|
118
106
|
return null;
|
|
119
107
|
}
|
|
120
|
-
|
|
121
108
|
const stickyTop = stickyHeader && stickyHeader.sticky && hasHeaderRow ? stickyHeader.top : undefined;
|
|
122
109
|
return /*#__PURE__*/React.createElement("div", {
|
|
123
110
|
onMouseDown: e => e.preventDefault()
|
|
@@ -152,7 +139,5 @@ export default class TableFloatingControls extends Component {
|
|
|
152
139
|
stickyTop: tableActive ? stickyTop : undefined
|
|
153
140
|
})));
|
|
154
141
|
}
|
|
155
|
-
|
|
156
142
|
}
|
|
157
|
-
|
|
158
143
|
_defineProperty(TableFloatingControls, "displayName", 'TableFloatingControls');
|
|
@@ -8,12 +8,12 @@ import { TableCssClassName as ClassName } from '../types';
|
|
|
8
8
|
import { tableCellBackgroundColor, tableToolbarColor, tableBorderColor, tableCellSelectedColor, tableToolbarSelectedColor, tableBorderSelectedColor, tableCellDeleteColor, tableBorderDeleteColor, tableToolbarDeleteColor, tableBorderRadiusSize, tablePadding, tableScrollbarOffset, resizeHandlerAreaWidth, resizeLineWidth, tableToolbarSize, tableInsertColumnButtonSize, tableControlsSpacing, tableTextColor, stickyRowZIndex, columnControlsDecorationHeight, stickyRowOffsetTop, stickyHeaderBorderBottomWidth } from './consts';
|
|
9
9
|
import { HeaderButton, HeaderButtonHover, HeaderButtonDanger, insertColumnButtonWrapper, insertRowButtonWrapper, columnControlsLineMarker, DeleteButton, OverflowShadow, columnControlsDecoration, hoveredDeleteButton, hoveredCell, hoveredWarningCell, resizeHandle, InsertMarker } from './ui-styles';
|
|
10
10
|
const cornerControlHeight = tableToolbarSize + 1;
|
|
11
|
+
|
|
11
12
|
/*
|
|
12
13
|
compensating for half of the insert column button
|
|
13
14
|
that is aligned to the right edge initially on hover of the top right column control when table overflown,
|
|
14
15
|
its center should be aligned with the edge
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
17
|
const insertColumnButtonOffset = tableInsertColumnButtonSize / 2;
|
|
18
18
|
const rangeSelectionStyles = `
|
|
19
19
|
.${ClassName.NODEVIEW_WRAPPER}.${akEditorSelectedNodeClassName} table tbody tr {
|
|
@@ -46,18 +46,19 @@ const sentinelStyles = `.${ClassName.TABLE_CONTAINER} {
|
|
|
46
46
|
margin-bottom: ${columnControlsDecorationHeight}px;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
}`;
|
|
50
|
-
// large item markers (e.g. 101, 102, ...) when nested inside tables
|
|
49
|
+
}`;
|
|
51
50
|
|
|
51
|
+
// previous styles to add spacing to numbered lists with
|
|
52
|
+
// large item markers (e.g. 101, 102, ...) when nested inside tables
|
|
52
53
|
const listLargeNumericMarkersOldStyles = `
|
|
53
54
|
.ProseMirror .pm-table-cell-content-wrap ol[data-child-count='100+'] {
|
|
54
55
|
padding-left: revert;
|
|
55
56
|
}
|
|
56
|
-
`;
|
|
57
|
+
`;
|
|
57
58
|
|
|
59
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-4139
|
|
58
60
|
export const tableStyles = props => {
|
|
59
61
|
var _props$featureFlags, _props$featureFlags2;
|
|
60
|
-
|
|
61
62
|
return css`
|
|
62
63
|
.${ClassName.LAYOUT_BUTTON} button {
|
|
63
64
|
background: ${`var(--ds-background-neutral, ${N20A})`};
|
|
@@ -3,12 +3,13 @@ import { tableCellBorderWidth, tableMarginTop } from '@atlaskit/editor-common/st
|
|
|
3
3
|
import { akEditorTableBorder, akEditorTableBorderDark, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableToolbarSize, akEditorUnitZIndex, akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { RESIZE_HANDLE_AREA_DECORATION_GAP } from '../types';
|
|
5
5
|
import { themed } from '@atlaskit/theme/components';
|
|
6
|
+
|
|
6
7
|
/**
|
|
7
8
|
* Basic colors added to prevent content overflow in table cells.
|
|
8
9
|
*/
|
|
10
|
+
|
|
9
11
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4135
|
|
10
12
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
11
|
-
|
|
12
13
|
export const tableCellBackgroundColor = themed({
|
|
13
14
|
light: `var(--ds-surface, ${N0})`,
|
|
14
15
|
dark: `var(--ds-surface, ${DN30})`
|
|
@@ -25,8 +26,8 @@ export const tableBorderColor = themed({
|
|
|
25
26
|
light: `var(--ds-border, ${akEditorTableBorder})`,
|
|
26
27
|
dark: `var(--ds-border, ${akEditorTableBorderDark})`
|
|
27
28
|
});
|
|
28
|
-
export const tableFloatingControlsColor = `var(--ds-background-neutral, ${N20})`;
|
|
29
|
-
|
|
29
|
+
export const tableFloatingControlsColor = `var(--ds-background-neutral, ${N20})`;
|
|
30
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-4461
|
|
30
31
|
export const tableCellSelectedColor = "var(--ds-blanket-selected, rgba(179, 212, 255, 0.3))";
|
|
31
32
|
export const tableToolbarSelectedColor = `var(--ds-background-selected-bold, ${B200})`;
|
|
32
33
|
export const tableBorderSelectedColor = `var(--ds-border-selected, ${B300})`;
|
|
@@ -5,7 +5,6 @@ import { N40A, B300, N300, R300, N20A, N60A, N0, Y50, Y200 } from '@atlaskit/the
|
|
|
5
5
|
import { tableToolbarColor, tableBorderColor, tableToolbarSelectedColor, tableBorderSelectedColor, tableCellDeleteColor, tableBorderDeleteColor, tableToolbarDeleteColor, lineMarkerSize, columnControlsDecorationHeight, columnControlsZIndex, columnControlsSelectedZIndex, resizeHandlerAreaWidth, resizeLineWidth, resizeHandlerZIndex, tableToolbarSize, tableInsertColumnButtonSize, tableDeleteButtonSize } from './consts';
|
|
6
6
|
import { TableCssClassName as ClassName } from '../types';
|
|
7
7
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
8
|
-
|
|
9
8
|
const InsertLine = cssString => css`
|
|
10
9
|
.${ClassName.CONTROLS_INSERT_LINE} {
|
|
11
10
|
background: ${tableBorderSelectedColor};
|
|
@@ -15,7 +14,6 @@ const InsertLine = cssString => css`
|
|
|
15
14
|
${cssString}
|
|
16
15
|
}
|
|
17
16
|
`;
|
|
18
|
-
|
|
19
17
|
const Marker = props => css`
|
|
20
18
|
background-color: ${tableBorderColor(props)};
|
|
21
19
|
position: absolute;
|
|
@@ -24,14 +22,12 @@ const Marker = props => css`
|
|
|
24
22
|
border-radius: 50%;
|
|
25
23
|
pointer-events: none;
|
|
26
24
|
`;
|
|
27
|
-
|
|
28
25
|
export const InsertMarker = (props, cssString) => css`
|
|
29
26
|
.${ClassName.CONTROLS_INSERT_MARKER} {
|
|
30
27
|
${Marker(props)};
|
|
31
28
|
${cssString}
|
|
32
29
|
}
|
|
33
30
|
`;
|
|
34
|
-
|
|
35
31
|
const Button = cssString => css`
|
|
36
32
|
border-radius: ${borderRadius()}px;
|
|
37
33
|
border-width: 0px;
|
|
@@ -53,7 +49,6 @@ const Button = cssString => css`
|
|
|
53
49
|
}
|
|
54
50
|
${cssString}
|
|
55
51
|
`;
|
|
56
|
-
|
|
57
52
|
export const HeaderButton = (props, cssString) => css`
|
|
58
53
|
.${ClassName.CONTROLS_BUTTON} {
|
|
59
54
|
background: ${tableToolbarColor(props)};
|
|
@@ -101,7 +96,6 @@ export const HeaderButtonDanger = () => css`
|
|
|
101
96
|
z-index: ${akEditorUnitZIndex};
|
|
102
97
|
}
|
|
103
98
|
`;
|
|
104
|
-
|
|
105
99
|
const InsertButton = () => css`
|
|
106
100
|
.${ClassName.CONTROLS_INSERT_BUTTON_INNER} {
|
|
107
101
|
position: absolute;
|
|
@@ -127,7 +121,6 @@ const InsertButton = () => css`
|
|
|
127
121
|
display: flex;
|
|
128
122
|
}
|
|
129
123
|
`;
|
|
130
|
-
|
|
131
124
|
const InsertButtonHover = () => css`
|
|
132
125
|
.${ClassName.CONTROLS_INSERT_BUTTON}:hover {
|
|
133
126
|
background: ${`var(--ds-background-brand-bold, ${B300})`};
|
|
@@ -135,7 +128,6 @@ const InsertButtonHover = () => css`
|
|
|
135
128
|
cursor: pointer;
|
|
136
129
|
}
|
|
137
130
|
`;
|
|
138
|
-
|
|
139
131
|
export const insertColumnButtonWrapper = css`
|
|
140
132
|
${InsertButton()}
|
|
141
133
|
${InsertButtonHover()}
|
|
@@ -235,7 +227,6 @@ export const OverflowShadow = props => css`
|
|
|
235
227
|
}
|
|
236
228
|
}
|
|
237
229
|
`;
|
|
238
|
-
|
|
239
230
|
const columnHeaderButton = (props, cssString) => css`
|
|
240
231
|
background: ${tableToolbarColor(props)};
|
|
241
232
|
border: 1px solid ${tableBorderColor(props)};
|
|
@@ -249,7 +240,6 @@ const columnHeaderButton = (props, cssString) => css`
|
|
|
249
240
|
|
|
250
241
|
${cssString}
|
|
251
242
|
`;
|
|
252
|
-
|
|
253
243
|
const columnHeaderButtonSelected = css`
|
|
254
244
|
color: ${`var(--ds-text-inverse, ${N0})`};
|
|
255
245
|
background-color: ${`var(--ds-background-selected, ${tableToolbarSelectedColor})`};
|
|
@@ -5,13 +5,11 @@ export function getSelectedTableInfo(selection) {
|
|
|
5
5
|
let totalRowCount = 0;
|
|
6
6
|
let totalColumnCount = 0;
|
|
7
7
|
const table = findTable(selection);
|
|
8
|
-
|
|
9
8
|
if (table) {
|
|
10
9
|
map = TableMap.get(table.node);
|
|
11
10
|
totalRowCount = map.height;
|
|
12
11
|
totalColumnCount = map.width;
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
return {
|
|
16
14
|
table,
|
|
17
15
|
map,
|
|
@@ -29,17 +27,14 @@ export function getSelectedCellInfo(selection) {
|
|
|
29
27
|
totalRowCount,
|
|
30
28
|
totalColumnCount
|
|
31
29
|
} = getSelectedTableInfo(selection);
|
|
32
|
-
|
|
33
30
|
if (table && map) {
|
|
34
31
|
const rect = getSelectionRect(selection);
|
|
35
|
-
|
|
36
32
|
if (rect) {
|
|
37
33
|
totalCells = map.cellsInRect(rect).length;
|
|
38
34
|
horizontalCells = rect.right - rect.left;
|
|
39
35
|
verticalCells = rect.bottom - rect.top;
|
|
40
36
|
}
|
|
41
37
|
}
|
|
42
|
-
|
|
43
38
|
return {
|
|
44
39
|
totalRowCount,
|
|
45
40
|
totalColumnCount,
|
|
@@ -51,15 +46,12 @@ export function getSelectedCellInfo(selection) {
|
|
|
51
46
|
export const withEditorAnalyticsAPI = payload => editorAnalyticsAPI => {
|
|
52
47
|
return command => (state, dispatch, view) => command(state, tr => {
|
|
53
48
|
const dynamicPayload = payload instanceof Function ? payload(state) : payload;
|
|
54
|
-
|
|
55
49
|
if (dynamicPayload) {
|
|
56
50
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(dynamicPayload)(tr);
|
|
57
51
|
}
|
|
58
|
-
|
|
59
52
|
if (dispatch) {
|
|
60
53
|
dispatch(tr);
|
|
61
54
|
}
|
|
62
|
-
|
|
63
55
|
return true;
|
|
64
56
|
}, view);
|
|
65
57
|
};
|