@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
|
@@ -4,20 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.tableToolbarSize = exports.tableToolbarSelectedColor = exports.tableToolbarDeleteColor = exports.tableToolbarColor = exports.tableTextColor = exports.tableScrollbarOffset = exports.tablePadding = exports.tableMarginFullWidthMode = exports.tableInsertColumnButtonSize = exports.tableInsertColumnButtonOffset = exports.tableFloatingControlsColor = exports.tableDeleteButtonSize = exports.tableDeleteButtonOffset = exports.tableControlsSpacing = exports.tableCellSelectedColor = exports.tableCellDeleteColor = exports.tableCellBackgroundColor = exports.tableBorderSelectedColor = exports.tableBorderRadiusSize = exports.tableBorderDeleteColor = exports.tableBorderColor = exports.stickyRowZIndex = exports.stickyRowOffsetTop = exports.stickyHeaderBorderBottomWidth = exports.resizeLineWidth = exports.resizeHandlerZIndex = exports.resizeHandlerAreaWidth = exports.lineMarkerSize = exports.lineMarkerOffsetFromColumnControls = exports.layoutButtonSize = exports.contextualMenuTriggerSize = exports.contextualMenuDropdownWidth = exports.columnResizeHandleZIndex = exports.columnControlsZIndex = exports.columnControlsSelectedZIndex = exports.columnControlsDecorationHeight = void 0;
|
|
7
|
-
|
|
8
7
|
var _colors = require("@atlaskit/theme/colors");
|
|
9
|
-
|
|
10
8
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
11
|
-
|
|
12
9
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
13
|
-
|
|
14
10
|
var _types = require("../types");
|
|
15
|
-
|
|
16
11
|
var _components = require("@atlaskit/theme/components");
|
|
17
|
-
|
|
18
12
|
/**
|
|
19
13
|
* Basic colors added to prevent content overflow in table cells.
|
|
20
14
|
*/
|
|
15
|
+
|
|
21
16
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4135
|
|
22
17
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
23
18
|
var tableCellBackgroundColor = (0, _components.themed)({
|
|
@@ -40,8 +35,8 @@ var tableBorderColor = (0, _components.themed)({
|
|
|
40
35
|
dark: "var(--ds-border, ".concat(_editorSharedStyles.akEditorTableBorderDark, ")")
|
|
41
36
|
});
|
|
42
37
|
exports.tableBorderColor = tableBorderColor;
|
|
43
|
-
var tableFloatingControlsColor = "var(--ds-background-neutral, ".concat(_colors.N20, ")");
|
|
44
|
-
|
|
38
|
+
var tableFloatingControlsColor = "var(--ds-background-neutral, ".concat(_colors.N20, ")");
|
|
39
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-4461
|
|
45
40
|
exports.tableFloatingControlsColor = tableFloatingControlsColor;
|
|
46
41
|
var tableCellSelectedColor = "var(--ds-blanket-selected, rgba(179, 212, 255, 0.3))";
|
|
47
42
|
exports.tableCellSelectedColor = tableCellSelectedColor;
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _reactIntlNext = require("react-intl-next");
|
|
9
|
-
|
|
10
8
|
var _default = (0, _reactIntlNext.defineMessages)({
|
|
11
9
|
insertColumn: {
|
|
12
10
|
id: 'fabric.editor.insertColumn',
|
|
@@ -59,5 +57,4 @@ var _default = (0, _reactIntlNext.defineMessages)({
|
|
|
59
57
|
description: 'Title text for confirm modal when deleting an extension linked to a data consumer.'
|
|
60
58
|
}
|
|
61
59
|
});
|
|
62
|
-
|
|
63
60
|
exports.default = _default;
|
|
@@ -1,103 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.resizeHandle = exports.insertRowButtonWrapper = exports.insertColumnButtonWrapper = exports.hoveredWarningCell = exports.hoveredDeleteButton = exports.hoveredCell = exports.columnControlsLineMarker = exports.columnControlsDecoration = exports.OverflowShadow = exports.InsertMarker = exports.HeaderButtonHover = exports.HeaderButtonDanger = exports.HeaderButton = exports.DeleteButton = void 0;
|
|
9
|
-
|
|
10
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
9
|
var _react = require("@emotion/react");
|
|
13
|
-
|
|
14
10
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
15
|
-
|
|
16
11
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
17
|
-
|
|
18
12
|
var _colors = require("@atlaskit/theme/colors");
|
|
19
|
-
|
|
20
13
|
var _consts = require("./consts");
|
|
21
|
-
|
|
22
14
|
var _types = require("../types");
|
|
23
|
-
|
|
24
15
|
var _constants = require("@atlaskit/theme/constants");
|
|
25
|
-
|
|
26
16
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21;
|
|
27
|
-
|
|
28
17
|
var InsertLine = function InsertLine(cssString) {
|
|
29
18
|
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n background: ", ";\n display: none;\n position: absolute;\n z-index: ", ";\n ", "\n }\n"])), _types.TableCssClassName.CONTROLS_INSERT_LINE, _consts.tableBorderSelectedColor, _editorSharedStyles.akEditorUnitZIndex, cssString);
|
|
30
19
|
};
|
|
31
|
-
|
|
32
20
|
var Marker = function Marker(props) {
|
|
33
21
|
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n position: absolute;\n height: ", "px;\n width: ", "px;\n border-radius: 50%;\n pointer-events: none;\n"])), (0, _consts.tableBorderColor)(props), _consts.lineMarkerSize, _consts.lineMarkerSize);
|
|
34
22
|
};
|
|
35
|
-
|
|
36
23
|
var InsertMarker = function InsertMarker(props, cssString) {
|
|
37
24
|
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n ", ";\n ", "\n }\n"])), _types.TableCssClassName.CONTROLS_INSERT_MARKER, Marker(props), cssString);
|
|
38
25
|
};
|
|
39
|
-
|
|
40
26
|
exports.InsertMarker = InsertMarker;
|
|
41
|
-
|
|
42
27
|
var Button = function Button(cssString) {
|
|
43
28
|
return (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: ", "px;\n border-width: 0px;\n display: inline-flex;\n max-width: 100%;\n text-align: center;\n margin: 0px;\n padding: 0px;\n text-decoration: none;\n transition: background 0.1s ease-out 0s,\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\n outline: none !important;\n cursor: none;\n\n > .", " {\n display: inline-flex;\n max-height: 100%;\n max-width: 100%;\n }\n ", "\n"])), (0, _constants.borderRadius)(), _types.TableCssClassName.CONTROLS_BUTTON_ICON, cssString);
|
|
44
29
|
};
|
|
45
|
-
|
|
46
30
|
var HeaderButton = function HeaderButton(props, cssString) {
|
|
47
31
|
return (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\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\n .", "::after {\n content: ' ';\n background-color: transparent;\n left: -15px;\n top: 0;\n position: absolute;\n width: 15px;\n height: 100%;\n z-index: 1;\n }\n\n .active .", " {\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n }\n"])), _types.TableCssClassName.CONTROLS_BUTTON, (0, _consts.tableToolbarColor)(props), (0, _consts.tableBorderColor)(props), cssString, _types.TableCssClassName.ROW_CONTROLS_BUTTON, _types.TableCssClassName.CONTROLS_BUTTON, "var(--ds-icon-inverse, ".concat(_colors.N0, ")"), "var(--ds-background-selected, ".concat(_consts.tableToolbarSelectedColor, ")"), _consts.tableBorderSelectedColor);
|
|
48
32
|
};
|
|
49
|
-
|
|
50
33
|
exports.HeaderButton = HeaderButton;
|
|
51
|
-
|
|
52
34
|
var HeaderButtonHover = function HeaderButtonHover() {
|
|
53
35
|
return (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n .", ":hover {\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n cursor: pointer;\n }\n"])), _types.TableCssClassName.CONTROLS_BUTTON, "var(--ds-icon-inverse, ".concat(_colors.N0, ")"), "var(--ds-background-selected, ".concat(_consts.tableToolbarSelectedColor, ")"), _consts.tableBorderSelectedColor);
|
|
54
36
|
};
|
|
55
|
-
|
|
56
37
|
exports.HeaderButtonHover = HeaderButtonHover;
|
|
57
|
-
|
|
58
38
|
var HeaderButtonDanger = function HeaderButtonDanger() {
|
|
59
39
|
return (0, _react.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n .", " .", " {\n background-color: ", ";\n border-color: ", ";\n position: relative;\n z-index: ", ";\n }\n"])), _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _types.TableCssClassName.CONTROLS_BUTTON, "var(--ds-background-danger, ".concat(_consts.tableToolbarDeleteColor, ")"), _consts.tableBorderDeleteColor, _editorSharedStyles.akEditorUnitZIndex);
|
|
60
40
|
};
|
|
61
|
-
|
|
62
41
|
exports.HeaderButtonDanger = HeaderButtonDanger;
|
|
63
|
-
|
|
64
42
|
var InsertButton = function InsertButton() {
|
|
65
43
|
return (0, _react.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n position: absolute;\n z-index: ", ";\n bottom: 0;\n }\n .", ",\n .", " {\n height: ", "px;\n width: ", "px;\n }\n .", " {\n ", "\n }\n .", " {\n display: none;\n }\n &:hover .", " {\n display: flex;\n }\n"])), _types.TableCssClassName.CONTROLS_INSERT_BUTTON_INNER, _editorSharedStyles.akEditorUnitZIndex + 10, _types.TableCssClassName.CONTROLS_INSERT_BUTTON_INNER, _types.TableCssClassName.CONTROLS_INSERT_BUTTON, _consts.tableInsertColumnButtonSize, _consts.tableInsertColumnButtonSize, _types.TableCssClassName.CONTROLS_INSERT_BUTTON, Button("\n background: ".concat("var(--ds-surface-overlay, white)", ";\n box-shadow: ", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N60A, ", 0 0 1px ").concat(_colors.N60A), ")"), ";\n color: ", "var(--ds-icon, ".concat(_colors.N300, ")"), ";\n ")), _types.TableCssClassName.CONTROLS_INSERT_LINE, _types.TableCssClassName.CONTROLS_INSERT_LINE);
|
|
66
44
|
};
|
|
67
|
-
|
|
68
45
|
var InsertButtonHover = function InsertButtonHover() {
|
|
69
46
|
return (0, _react.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n .", ":hover {\n background: ", ";\n color: ", ";\n cursor: pointer;\n }\n"])), _types.TableCssClassName.CONTROLS_INSERT_BUTTON, "var(--ds-background-brand-bold, ".concat(_colors.B300, ")"), "var(--ds-icon-inverse, white)");
|
|
70
47
|
};
|
|
71
|
-
|
|
72
48
|
var insertColumnButtonWrapper = (0, _react.css)(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n ", "\n"])), InsertButton(), InsertButtonHover(), InsertLine("\n width: 2px;\n left: 9px;\n "));
|
|
73
49
|
exports.insertColumnButtonWrapper = insertColumnButtonWrapper;
|
|
74
50
|
var insertRowButtonWrapper = (0, _react.css)(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n ", "\n"])), InsertButton(), InsertButtonHover(), InsertLine("\n height: 2px;\n top: -11px;\n left: ".concat(_consts.tableInsertColumnButtonSize - 1, "px;\n ")));
|
|
75
51
|
exports.insertRowButtonWrapper = insertRowButtonWrapper;
|
|
76
|
-
|
|
77
52
|
var columnControlsLineMarker = function columnControlsLineMarker(props) {
|
|
78
53
|
return (0, _react.css)(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n .", ".", "\n table\n tr:first-of-type\n td,\n .", ".", "\n table\n tr:first-of-type\n th {\n position: relative;\n }\n"])), _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.WITH_CONTROLS);
|
|
79
54
|
};
|
|
80
|
-
|
|
81
55
|
exports.columnControlsLineMarker = columnControlsLineMarker;
|
|
82
56
|
var DeleteButton = (0, _react.css)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n .", ",\n .", " {\n height: ", "px;\n width: ", "px;\n }\n .", " {\n .", " {\n ", "\n }\n }\n\n .", ":hover {\n background: ", ";\n color: ", ";\n cursor: pointer;\n }\n"])), _types.TableCssClassName.CONTROLS_DELETE_BUTTON_WRAP, _types.TableCssClassName.CONTROLS_DELETE_BUTTON, _consts.tableDeleteButtonSize, _consts.tableDeleteButtonSize, _types.TableCssClassName.CONTROLS_DELETE_BUTTON_WRAP, _types.TableCssClassName.CONTROLS_DELETE_BUTTON, Button("\n background: ".concat("var(--ds-background-neutral, ".concat(_colors.N20A, ")"), ";\n color: ", "var(--ds-icon, ".concat(_colors.N300, ")"), ";\n ")), _types.TableCssClassName.CONTROLS_DELETE_BUTTON, "var(--ds-background-danger-bold, ".concat(_colors.R300, ")"), "var(--ds-icon-inverse, white)");
|
|
83
57
|
exports.DeleteButton = DeleteButton;
|
|
84
|
-
|
|
85
58
|
var OverflowShadow = function OverflowShadow(props) {
|
|
86
59
|
return (0, _react.css)(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n .", ", .", " {\n display: block;\n height: calc(100% - ", "px);\n position: absolute;\n pointer-events: none;\n top: ", "px;\n z-index: ", ";\n width: 8px;\n }\n .", " {\n background: linear-gradient(\n to left,\n transparent 0,\n ", " 100%\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 ", " 100%\n ),\n linear-gradient(\n to left,\n ", " 0px,\n transparent 1px\n );\n left: calc(100% + 2px);\n }\n .", " {\n .", ", .", " {\n height: calc(100% - ", "px);\n top: ", "px;\n }\n .", " {\n border-left: 1px solid ", ";\n }\n }\n"])), _types.TableCssClassName.TABLE_RIGHT_SHADOW, _types.TableCssClassName.TABLE_LEFT_SHADOW, _styles.tableMarginTop + _styles.tableMarginBottom, _styles.tableMarginTop, _editorSharedStyles.akEditorShadowZIndex, _types.TableCssClassName.TABLE_LEFT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(_colors.N40A, ")"), "var(--ds-shadow-overflow-perimeter, transparent)", _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.TABLE_STICKY_SHADOW, _types.TableCssClassName.TABLE_LEFT_SHADOW, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, _types.TableCssClassName.TABLE_RIGHT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(_colors.N40A, ")"), "var(--ds-shadow-overflow-perimeter, transparent)", _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_RIGHT_SHADOW, _types.TableCssClassName.TABLE_LEFT_SHADOW, _styles.tableMarginTop + _styles.tableMarginBottom, _styles.tableMarginTop, _types.TableCssClassName.TABLE_LEFT_SHADOW, (0, _consts.tableBorderColor)(props));
|
|
87
60
|
};
|
|
88
|
-
|
|
89
61
|
exports.OverflowShadow = OverflowShadow;
|
|
90
|
-
|
|
91
62
|
var columnHeaderButton = function columnHeaderButton(props, cssString) {
|
|
92
63
|
return (0, _react.css)(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2.default)(["\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"])), (0, _consts.tableToolbarColor)(props), (0, _consts.tableBorderColor)(props), cssString);
|
|
93
64
|
};
|
|
94
|
-
|
|
95
65
|
var columnHeaderButtonSelected = (0, _react.css)(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n z-index: ", ";\n"])), "var(--ds-text-inverse, ".concat(_colors.N0, ")"), "var(--ds-background-selected, ".concat(_consts.tableToolbarSelectedColor, ")"), _consts.tableBorderSelectedColor, _consts.columnControlsSelectedZIndex);
|
|
96
|
-
|
|
97
66
|
var columnControlsDecoration = function columnControlsDecoration(props) {
|
|
98
67
|
return (0, _react.css)(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2.default)(["\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\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 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"])), _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _styles.tableCellBorderWidth * 2, _consts.columnControlsDecorationHeight + _styles.tableCellBorderWidth, _consts.columnControlsDecorationHeight, (0, _consts.tableBorderColor)(props), _consts.lineMarkerSize, _consts.lineMarkerSize, columnHeaderButton(props, "\n border-right: ".concat(_styles.tableCellBorderWidth, "px solid ").concat((0, _consts.tableBorderColor)(props), ";\n border-bottom: none;\n height: ").concat(_consts.tableToolbarSize, "px;\n width: 100%;\n position: absolute;\n top: ").concat(_consts.columnControlsDecorationHeight - _consts.tableToolbarSize, "px;\n left: 0px;\n z-index: ").concat(_consts.columnControlsZIndex, ";\n ")), _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, (0, _consts.tableBorderColor)(props), _consts.lineMarkerSize, _consts.lineMarkerSize, _consts.tableToolbarSize + _styles.tableCellBorderWidth, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _types.TableCssClassName.TABLE_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.COLUMN_SELECTED, _types.TableCssClassName.HOVERED_COLUMN, _types.TableCssClassName.HOVERED_TABLE, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, "var(--ds-background-danger, ".concat(_consts.tableToolbarDeleteColor, ")"), _consts.tableBorderDeleteColor, _editorSharedStyles.akEditorUnitZIndex * 100, _types.TableCssClassName.TABLE_SELECTED, _types.TableCssClassName.TABLE_CELL, _types.TableCssClassName.TABLE_SELECTED, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected);
|
|
99
68
|
};
|
|
100
|
-
|
|
101
69
|
exports.columnControlsDecoration = columnControlsDecoration;
|
|
102
70
|
var hoveredDeleteButton = (0, _react.css)(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2.default)(["\n .", ".", " {\n .", ",\n .", ",\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n }\n }\n"])), _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.HOVERED_DELETE_BUTTON, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.COLUMN_SELECTED, _types.TableCssClassName.HOVERED_CELL, _consts.tableBorderDeleteColor, _types.TableCssClassName.SELECTED_CELL, _consts.tableCellDeleteColor);
|
|
103
71
|
exports.hoveredDeleteButton = hoveredDeleteButton;
|
|
@@ -6,23 +6,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getSelectedCellInfo = getSelectedCellInfo;
|
|
7
7
|
exports.getSelectedTableInfo = getSelectedTableInfo;
|
|
8
8
|
exports.withEditorAnalyticsAPI = void 0;
|
|
9
|
-
|
|
10
9
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
11
|
-
|
|
12
10
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
13
|
-
|
|
14
11
|
function getSelectedTableInfo(selection) {
|
|
15
12
|
var map;
|
|
16
13
|
var totalRowCount = 0;
|
|
17
14
|
var totalColumnCount = 0;
|
|
18
15
|
var table = (0, _utils.findTable)(selection);
|
|
19
|
-
|
|
20
16
|
if (table) {
|
|
21
17
|
map = _tableMap.TableMap.get(table.node);
|
|
22
18
|
totalRowCount = map.height;
|
|
23
19
|
totalColumnCount = map.width;
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
return {
|
|
27
22
|
table: table,
|
|
28
23
|
map: map,
|
|
@@ -30,28 +25,23 @@ function getSelectedTableInfo(selection) {
|
|
|
30
25
|
totalColumnCount: totalColumnCount
|
|
31
26
|
};
|
|
32
27
|
}
|
|
33
|
-
|
|
34
28
|
function getSelectedCellInfo(selection) {
|
|
35
29
|
var horizontalCells = 1;
|
|
36
30
|
var verticalCells = 1;
|
|
37
31
|
var totalCells = 1;
|
|
38
|
-
|
|
39
32
|
var _getSelectedTableInfo = getSelectedTableInfo(selection),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
table = _getSelectedTableInfo.table,
|
|
34
|
+
map = _getSelectedTableInfo.map,
|
|
35
|
+
totalRowCount = _getSelectedTableInfo.totalRowCount,
|
|
36
|
+
totalColumnCount = _getSelectedTableInfo.totalColumnCount;
|
|
45
37
|
if (table && map) {
|
|
46
38
|
var rect = (0, _utils.getSelectionRect)(selection);
|
|
47
|
-
|
|
48
39
|
if (rect) {
|
|
49
40
|
totalCells = map.cellsInRect(rect).length;
|
|
50
41
|
horizontalCells = rect.right - rect.left;
|
|
51
42
|
verticalCells = rect.bottom - rect.top;
|
|
52
43
|
}
|
|
53
44
|
}
|
|
54
|
-
|
|
55
45
|
return {
|
|
56
46
|
totalRowCount: totalRowCount,
|
|
57
47
|
totalColumnCount: totalColumnCount,
|
|
@@ -60,27 +50,22 @@ function getSelectedCellInfo(selection) {
|
|
|
60
50
|
totalCells: totalCells
|
|
61
51
|
};
|
|
62
52
|
}
|
|
63
|
-
|
|
64
53
|
var withEditorAnalyticsAPI = function withEditorAnalyticsAPI(payload) {
|
|
65
54
|
return function (editorAnalyticsAPI) {
|
|
66
55
|
return function (command) {
|
|
67
56
|
return function (state, dispatch, view) {
|
|
68
57
|
return command(state, function (tr) {
|
|
69
58
|
var dynamicPayload = payload instanceof Function ? payload(state) : payload;
|
|
70
|
-
|
|
71
59
|
if (dynamicPayload) {
|
|
72
60
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(dynamicPayload)(tr);
|
|
73
61
|
}
|
|
74
|
-
|
|
75
62
|
if (dispatch) {
|
|
76
63
|
dispatch(tr);
|
|
77
64
|
}
|
|
78
|
-
|
|
79
65
|
return true;
|
|
80
66
|
}, view);
|
|
81
67
|
};
|
|
82
68
|
};
|
|
83
69
|
};
|
|
84
70
|
};
|
|
85
|
-
|
|
86
71
|
exports.withEditorAnalyticsAPI = withEditorAnalyticsAPI;
|
|
@@ -4,53 +4,41 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.isTableCollapsible = exports.collapseSelectedTable = void 0;
|
|
7
|
-
|
|
8
7
|
var _prosemirrorModel = require("prosemirror-model");
|
|
9
|
-
|
|
10
8
|
var _prosemirrorTransform = require("prosemirror-transform");
|
|
11
|
-
|
|
12
9
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
13
|
-
|
|
14
10
|
var bail = function bail() {
|
|
15
11
|
return {
|
|
16
12
|
tableIsCollapsible: false
|
|
17
13
|
};
|
|
18
14
|
};
|
|
15
|
+
|
|
19
16
|
/**
|
|
20
17
|
* Checks whether we can wrap the selected table into an expand via
|
|
21
18
|
* prosemirror-transform's `findWrapping` helper
|
|
22
19
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
20
|
var isTableCollapsible = function isTableCollapsible(tr) {
|
|
26
21
|
var selection = tr.selection;
|
|
27
22
|
var schema = tr.doc.type.schema;
|
|
28
23
|
var nodePos = (0, _utils.findTable)(selection);
|
|
29
|
-
|
|
30
24
|
if (!nodePos) {
|
|
31
25
|
return bail();
|
|
32
26
|
}
|
|
33
|
-
|
|
34
27
|
var expand = schema.nodes.expand;
|
|
35
28
|
var node = nodePos.node,
|
|
36
|
-
|
|
29
|
+
pos = nodePos.pos;
|
|
37
30
|
var $pos = tr.doc.resolve(pos);
|
|
38
31
|
var range = new _prosemirrorModel.NodeRange($pos, tr.doc.resolve(pos + node.nodeSize), $pos.depth);
|
|
39
|
-
|
|
40
32
|
if (!range) {
|
|
41
33
|
return bail();
|
|
42
34
|
}
|
|
43
|
-
|
|
44
35
|
var canWrap = (0, _prosemirrorTransform.findWrapping)(range, expand);
|
|
45
|
-
|
|
46
36
|
if (canWrap === null) {
|
|
47
37
|
return bail();
|
|
48
38
|
}
|
|
49
|
-
|
|
50
39
|
return {
|
|
51
40
|
tableIsCollapsible: true,
|
|
52
41
|
range: range,
|
|
53
|
-
|
|
54
42
|
/**
|
|
55
43
|
* Do we ever want to deal with the result of `findWrapping`? Probably not,
|
|
56
44
|
* but we have it anyway.
|
|
@@ -58,6 +46,7 @@ var isTableCollapsible = function isTableCollapsible(tr) {
|
|
|
58
46
|
findWrappingRes: canWrap
|
|
59
47
|
};
|
|
60
48
|
};
|
|
49
|
+
|
|
61
50
|
/**
|
|
62
51
|
* Collapses the selected table into an expand given a transaction via
|
|
63
52
|
* `Transform.wrap`.
|
|
@@ -68,17 +57,14 @@ var isTableCollapsible = function isTableCollapsible(tr) {
|
|
|
68
57
|
* @param tr
|
|
69
58
|
* @returns Transaction | undefined
|
|
70
59
|
*/
|
|
71
|
-
|
|
72
|
-
|
|
73
60
|
exports.isTableCollapsible = isTableCollapsible;
|
|
74
|
-
|
|
75
61
|
var collapseSelectedTable = function collapseSelectedTable(tr) {
|
|
76
62
|
var canCollapse = isTableCollapsible(tr);
|
|
77
63
|
var expand = tr.doc.type.schema.nodes.expand;
|
|
78
|
-
|
|
79
64
|
if (!canCollapse.range || !canCollapse.tableIsCollapsible) {
|
|
80
65
|
return undefined;
|
|
81
66
|
}
|
|
67
|
+
|
|
82
68
|
/**
|
|
83
69
|
* TODO: add attrs: { __expanded: false } when
|
|
84
70
|
* - it is working with new collab (CEMS-1204)
|
|
@@ -87,12 +73,9 @@ var collapseSelectedTable = function collapseSelectedTable(tr) {
|
|
|
87
73
|
* (via confluence-frontend, "this feature" referencing allowInteractiveExpand)
|
|
88
74
|
* `we can NEVER allow this feature to be enabled for the synchrony-powered editor
|
|
89
75
|
*/
|
|
90
|
-
|
|
91
|
-
|
|
92
76
|
tr.wrap(canCollapse.range, [{
|
|
93
77
|
type: expand
|
|
94
78
|
}]).setMeta('scrollIntoView', true);
|
|
95
79
|
return tr;
|
|
96
80
|
};
|
|
97
|
-
|
|
98
81
|
exports.collapseSelectedTable = collapseSelectedTable;
|
|
@@ -1,46 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.isColumnDeleteButtonVisible = exports.getColumnsWidths = exports.getColumnDeleteButtonParams = exports.getColumnClassNames = exports.colWidthsForRow = void 0;
|
|
9
|
-
|
|
10
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
|
|
12
9
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
13
|
-
|
|
14
10
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
15
|
-
|
|
16
11
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
17
|
-
|
|
18
12
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
19
|
-
|
|
20
13
|
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
21
|
-
|
|
22
14
|
var _types = require("../types");
|
|
23
|
-
|
|
24
15
|
var _consts = require("../ui/consts");
|
|
25
|
-
|
|
26
16
|
var getColumnsWidths = function getColumnsWidths(view) {
|
|
27
17
|
var selection = view.state.selection;
|
|
28
18
|
var widths = [];
|
|
29
19
|
var table = (0, _utils.findTable)(selection);
|
|
30
|
-
|
|
31
20
|
if (table) {
|
|
32
21
|
var map = _tableMap.TableMap.get(table.node);
|
|
22
|
+
var domAtPos = view.domAtPos.bind(view);
|
|
33
23
|
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
// When there is no cell we need to fill it with undefined
|
|
36
25
|
widths = Array.from({
|
|
37
26
|
length: map.width
|
|
38
27
|
});
|
|
39
|
-
|
|
40
28
|
for (var i = 0; i < map.width; i++) {
|
|
41
29
|
var cells = (0, _utils.getCellsInColumn)(i)(selection);
|
|
42
30
|
var cell = cells[0];
|
|
43
|
-
|
|
44
31
|
if (cell) {
|
|
45
32
|
var cellRef = (0, _prosemirrorUtils.findDomRefAtPos)(cell.pos, domAtPos);
|
|
46
33
|
var rect = cellRef.getBoundingClientRect();
|
|
@@ -49,82 +36,63 @@ var getColumnsWidths = function getColumnsWidths(view) {
|
|
|
49
36
|
}
|
|
50
37
|
}
|
|
51
38
|
}
|
|
52
|
-
|
|
53
39
|
return widths;
|
|
54
40
|
};
|
|
55
|
-
|
|
56
41
|
exports.getColumnsWidths = getColumnsWidths;
|
|
57
|
-
|
|
58
42
|
var isColumnDeleteButtonVisible = function isColumnDeleteButtonVisible(selection) {
|
|
59
43
|
if (!(0, _utils.isTableSelected)(selection) && selection instanceof _cellSelection.CellSelection && selection.isColSelection()) {
|
|
60
44
|
return true;
|
|
61
45
|
}
|
|
62
|
-
|
|
63
46
|
return false;
|
|
64
47
|
};
|
|
65
|
-
|
|
66
48
|
exports.isColumnDeleteButtonVisible = isColumnDeleteButtonVisible;
|
|
67
|
-
|
|
68
49
|
var getColumnDeleteButtonParams = function getColumnDeleteButtonParams(columnsWidths, selection) {
|
|
69
50
|
var rect = (0, _utils.getSelectionRect)(selection);
|
|
70
|
-
|
|
71
51
|
if (!rect) {
|
|
72
52
|
return null;
|
|
73
53
|
}
|
|
74
|
-
|
|
75
54
|
var width = 0;
|
|
76
|
-
var offset = 0;
|
|
77
|
-
|
|
55
|
+
var offset = 0;
|
|
56
|
+
// find the columns before the selection
|
|
78
57
|
for (var i = 0; i < rect.left; i++) {
|
|
79
58
|
var colWidth = columnsWidths[i];
|
|
80
|
-
|
|
81
59
|
if (colWidth) {
|
|
82
60
|
offset += colWidth - 1;
|
|
83
61
|
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
62
|
+
}
|
|
63
|
+
// these are the selected columns widths
|
|
87
64
|
var indexes = [];
|
|
88
|
-
|
|
89
65
|
for (var _i = rect.left; _i < rect.right; _i++) {
|
|
90
66
|
var _colWidth = columnsWidths[_i];
|
|
91
|
-
|
|
92
67
|
if (_colWidth) {
|
|
93
68
|
width += _colWidth;
|
|
94
69
|
indexes.push(_i);
|
|
95
70
|
}
|
|
96
71
|
}
|
|
97
|
-
|
|
98
72
|
var left = offset + width / 2 - _consts.tableDeleteButtonSize / 2;
|
|
99
73
|
return {
|
|
100
74
|
left: left,
|
|
101
75
|
indexes: indexes
|
|
102
76
|
};
|
|
103
77
|
};
|
|
104
|
-
|
|
105
78
|
exports.getColumnDeleteButtonParams = getColumnDeleteButtonParams;
|
|
106
|
-
|
|
107
79
|
var getColumnClassNames = function getColumnClassNames(index, selection) {
|
|
108
80
|
var hoveredColumns = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
109
81
|
var isInDanger = arguments.length > 3 ? arguments[3] : undefined;
|
|
110
82
|
var isResizing = arguments.length > 4 ? arguments[4] : undefined;
|
|
111
83
|
var classNames = [];
|
|
112
|
-
|
|
113
84
|
if ((0, _utils.isColumnSelected)(index)(selection) || hoveredColumns.indexOf(index) > -1 && !isResizing) {
|
|
114
85
|
classNames.push(_types.TableCssClassName.HOVERED_CELL_ACTIVE);
|
|
115
|
-
|
|
116
86
|
if (isInDanger) {
|
|
117
87
|
classNames.push(_types.TableCssClassName.HOVERED_CELL_IN_DANGER);
|
|
118
88
|
}
|
|
119
89
|
}
|
|
120
|
-
|
|
121
90
|
return classNames.join(' ');
|
|
122
|
-
};
|
|
123
|
-
// and map to a row's colwidths
|
|
124
|
-
|
|
91
|
+
};
|
|
125
92
|
|
|
93
|
+
// give a row colspan and a colwidths
|
|
94
|
+
// and map to a row's colwidths
|
|
126
95
|
exports.getColumnClassNames = getColumnClassNames;
|
|
127
|
-
|
|
128
96
|
var mapTableColwidthsToRow = function mapTableColwidthsToRow(rowColSpans, tableColWidths) {
|
|
129
97
|
var curColIdx = 0;
|
|
130
98
|
var colWidths = [];
|
|
@@ -137,12 +105,10 @@ var mapTableColwidthsToRow = function mapTableColwidthsToRow(rowColSpans, tableC
|
|
|
137
105
|
});
|
|
138
106
|
return colWidths;
|
|
139
107
|
};
|
|
140
|
-
|
|
141
108
|
var getRelativeDomCellWidths = function getRelativeDomCellWidths(_ref) {
|
|
142
109
|
var width = _ref.width,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
110
|
+
colspan = _ref.colspan,
|
|
111
|
+
colwidth = _ref.colwidth;
|
|
146
112
|
// For cells with colSpan 1
|
|
147
113
|
// or
|
|
148
114
|
// for cells in a table with unchanged column widths,
|
|
@@ -150,20 +116,22 @@ var getRelativeDomCellWidths = function getRelativeDomCellWidths(_ref) {
|
|
|
150
116
|
// return equally partitioned total cell width in DOM for each cell.
|
|
151
117
|
if (colspan === 1 || !colwidth) {
|
|
152
118
|
return new Array(colspan).fill(width / colspan);
|
|
153
|
-
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// For cells that have colSpan > 1 and
|
|
154
122
|
// are part of a table with resized columns
|
|
155
123
|
// return the current total DOM width of the cell multiplied
|
|
156
124
|
// by the percentage of the each individual cell's size.
|
|
157
125
|
// The cell size percentage is calculated using individual colwidth of the cell,
|
|
158
126
|
// from data-colwidth attribute on the cell,
|
|
159
127
|
// divided by the total width of the cells from colwidths for merged cells.
|
|
128
|
+
|
|
160
129
|
// Ex:
|
|
161
130
|
// colwidth = ‘201,102’
|
|
162
131
|
// Total colWidth = 303
|
|
163
132
|
// returned cellWidths = [303 * (201/303), 303 * (102/303)]
|
|
164
|
-
// For merged cells we get back colwidth as `201,102`
|
|
165
|
-
|
|
166
133
|
|
|
134
|
+
// For merged cells we get back colwidth as `201,102`
|
|
167
135
|
var cellColWidths = colwidth.split(',').map(function (colwidth) {
|
|
168
136
|
return Number(colwidth);
|
|
169
137
|
});
|
|
@@ -174,14 +142,13 @@ var getRelativeDomCellWidths = function getRelativeDomCellWidths(_ref) {
|
|
|
174
142
|
return width * (cellColWidth / totalCalculatedCellWidth);
|
|
175
143
|
});
|
|
176
144
|
};
|
|
177
|
-
|
|
178
145
|
var colWidthsForRow = function colWidthsForRow(colGroup, tr) {
|
|
179
146
|
// get the colspans
|
|
180
147
|
var rowColSpans = (0, _utils2.maphElem)(tr, function (cell) {
|
|
181
|
-
return Number(cell.getAttribute('colspan') || 1
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
148
|
+
return Number(cell.getAttribute('colspan') || 1 /* default to span of 1 */);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// Chrome has trouble aligning borders with auto tables
|
|
185
152
|
// and the rest of the page grid. tables with defined
|
|
186
153
|
// column widths align fine.
|
|
187
154
|
//
|
|
@@ -189,9 +156,7 @@ var colWidthsForRow = function colWidthsForRow(colGroup, tr) {
|
|
|
189
156
|
//
|
|
190
157
|
// prefer copying the widths via the DOM
|
|
191
158
|
// or inferring from the next row if one exists
|
|
192
|
-
|
|
193
159
|
var copyTarget = tr.nextElementSibling || tr;
|
|
194
|
-
|
|
195
160
|
if (copyTarget) {
|
|
196
161
|
// either from the first row while it's still in the table
|
|
197
162
|
var cellInfos = (0, _utils2.maphElem)(copyTarget, function (cell) {
|
|
@@ -200,13 +165,13 @@ var colWidthsForRow = function colWidthsForRow(colGroup, tr) {
|
|
|
200
165
|
colspan: Number(cell.getAttribute('colspan') || 1),
|
|
201
166
|
colwidth: cell.dataset.colwidth
|
|
202
167
|
};
|
|
203
|
-
});
|
|
168
|
+
});
|
|
204
169
|
|
|
170
|
+
// reverse engineer cell widths from table widths
|
|
205
171
|
var domBasedCellWidths = [];
|
|
206
172
|
cellInfos.map(function (cell, idx) {
|
|
207
173
|
domBasedCellWidths.push.apply(domBasedCellWidths, (0, _toConsumableArray2.default)(getRelativeDomCellWidths(cell)));
|
|
208
174
|
});
|
|
209
|
-
|
|
210
175
|
if (cellInfos.reduce(function (acc, cell) {
|
|
211
176
|
return acc + cell.width;
|
|
212
177
|
}, 0) !== 0) {
|
|
@@ -215,10 +180,10 @@ var colWidthsForRow = function colWidthsForRow(colGroup, tr) {
|
|
|
215
180
|
return "".concat(px, "px");
|
|
216
181
|
}).join(' ');
|
|
217
182
|
}
|
|
218
|
-
}
|
|
219
|
-
// it aligns perfectly in the user's browser
|
|
220
|
-
|
|
183
|
+
}
|
|
221
184
|
|
|
185
|
+
// as a fallback, just calculate a %, and hope that
|
|
186
|
+
// it aligns perfectly in the user's browser
|
|
222
187
|
var visualColCount = rowColSpans.reduce(function (acc, val) {
|
|
223
188
|
return acc + val;
|
|
224
189
|
}, 0);
|
|
@@ -229,5 +194,4 @@ var colWidthsForRow = function colWidthsForRow(colGroup, tr) {
|
|
|
229
194
|
return "".concat(pct, "%");
|
|
230
195
|
}).join(' ');
|
|
231
196
|
};
|
|
232
|
-
|
|
233
197
|
exports.colWidthsForRow = colWidthsForRow;
|