@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,11 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.composeDecorations = void 0;
|
|
7
|
-
|
|
8
7
|
var composeDecorations = function composeDecorations(transformers) {
|
|
9
8
|
return function (_ref) {
|
|
10
9
|
var decorationSet = _ref.decorationSet,
|
|
11
|
-
|
|
10
|
+
tr = _ref.tr;
|
|
12
11
|
return transformers.reduce(function (decorationSet, transform) {
|
|
13
12
|
return transform({
|
|
14
13
|
decorationSet: decorationSet,
|
|
@@ -17,5 +16,4 @@ var composeDecorations = function composeDecorations(transformers) {
|
|
|
17
16
|
}, decorationSet);
|
|
18
17
|
};
|
|
19
18
|
};
|
|
20
|
-
|
|
21
19
|
exports.composeDecorations = composeDecorations;
|
|
@@ -27,9 +27,6 @@ Object.defineProperty(exports, "maybeUpdateColumnControlsSelectedDecoration", {
|
|
|
27
27
|
return _columnControls.maybeUpdateColumnControlsSelectedDecoration;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
|
|
31
30
|
var _columnControls = require("./column-controls");
|
|
32
|
-
|
|
33
31
|
var _columnResizing = require("./column-resizing");
|
|
34
|
-
|
|
35
32
|
var _composeDecorations = require("./compose-decorations");
|
|
@@ -1,33 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
8
|
exports.keymapPlugin = keymapPlugin;
|
|
10
|
-
|
|
11
9
|
var _prosemirrorKeymap = require("prosemirror-keymap");
|
|
12
|
-
|
|
13
10
|
var _prosemirrorCommands = require("prosemirror-commands");
|
|
14
|
-
|
|
15
11
|
var keymaps = _interopRequireWildcard(require("@atlaskit/editor-common/keymaps"));
|
|
16
|
-
|
|
17
12
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
18
|
-
|
|
19
13
|
var _commands = require("../commands");
|
|
20
|
-
|
|
21
14
|
var _commandsWithAnalytics = require("../commands-with-analytics");
|
|
22
|
-
|
|
23
15
|
var _insert = require("../commands/insert");
|
|
24
|
-
|
|
25
16
|
var _analytics2 = require("../utils/analytics");
|
|
26
|
-
|
|
27
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
28
|
-
|
|
29
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
30
|
-
|
|
31
19
|
var createTableWithAnalytics = function createTableWithAnalytics(editorAnalyticsAPI) {
|
|
32
20
|
return (0, _analytics2.withEditorAnalyticsAPI)({
|
|
33
21
|
action: _analytics.ACTION.INSERTED,
|
|
@@ -39,21 +27,20 @@ var createTableWithAnalytics = function createTableWithAnalytics(editorAnalytics
|
|
|
39
27
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
40
28
|
})(editorAnalyticsAPI)((0, _commands.createTable)());
|
|
41
29
|
};
|
|
42
|
-
|
|
43
30
|
function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI) {
|
|
44
31
|
var list = {};
|
|
45
32
|
keymaps.bindKeymapWithCommand(keymaps.nextCell.common, (0, _commands.goToNextCell)(editorAnalyticsAPI)(1), list);
|
|
46
33
|
keymaps.bindKeymapWithCommand(keymaps.previousCell.common, (0, _commands.goToNextCell)(editorAnalyticsAPI)(-1), list);
|
|
47
34
|
keymaps.bindKeymapWithCommand(keymaps.toggleTable.common, createTableWithAnalytics(editorAnalyticsAPI), list);
|
|
48
35
|
keymaps.bindKeymapWithCommand(keymaps.backspace.common, (0, _prosemirrorCommands.chainCommands)((0, _commandsWithAnalytics.deleteTableIfSelectedWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD), (0, _commandsWithAnalytics.emptyMultipleCellsWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD)), list);
|
|
49
|
-
keymaps.bindKeymapWithCommand(keymaps.backspace.common, _commands.moveCursorBackward, list);
|
|
36
|
+
keymaps.bindKeymapWithCommand(keymaps.backspace.common, _commands.moveCursorBackward, list);
|
|
50
37
|
|
|
38
|
+
// Add row/column shortcuts
|
|
51
39
|
keymaps.bindKeymapWithCommand(keymaps.addRowBefore.common, (0, _commandsWithAnalytics.addRowAroundSelection)(editorAnalyticsAPI)('TOP'), list);
|
|
52
40
|
keymaps.bindKeymapWithCommand(keymaps.addRowAfter.common, (0, _commandsWithAnalytics.addRowAroundSelection)(editorAnalyticsAPI)('BOTTOM'), list);
|
|
53
41
|
keymaps.bindKeymapWithCommand(keymaps.addColumnBefore.common, (0, _commands.triggerUnlessTableHeader)((0, _insert.addColumnBefore)(getEditorContainerWidth)), list);
|
|
54
42
|
keymaps.bindKeymapWithCommand(keymaps.addColumnAfter.common, (0, _insert.addColumnAfter)(getEditorContainerWidth), list);
|
|
55
43
|
return (0, _prosemirrorKeymap.keymap)(list);
|
|
56
44
|
}
|
|
57
|
-
|
|
58
45
|
var _default = keymapPlugin;
|
|
59
46
|
exports.default = _default;
|
|
@@ -1,65 +1,38 @@
|
|
|
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.createPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
13
|
-
|
|
14
10
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
15
|
-
|
|
16
11
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
17
|
-
|
|
18
12
|
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
19
|
-
|
|
20
13
|
var _commands = require("../commands");
|
|
21
|
-
|
|
22
14
|
var _eventHandlers = require("../event-handlers");
|
|
23
|
-
|
|
24
15
|
var _table = require("../nodeviews/table");
|
|
25
|
-
|
|
26
16
|
var _plugin = require("../pm-plugins/decorations/plugin");
|
|
27
|
-
|
|
28
17
|
var _transforms = require("../transforms");
|
|
29
|
-
|
|
30
18
|
var _types = require("../types");
|
|
31
|
-
|
|
32
19
|
var _utils3 = require("../utils");
|
|
33
|
-
|
|
34
20
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
35
|
-
|
|
36
21
|
var _defaultTableSelection = require("./default-table-selection");
|
|
37
|
-
|
|
38
22
|
var _pluginFactory = require("./plugin-factory");
|
|
39
|
-
|
|
40
23
|
var _pluginKey = require("./plugin-key");
|
|
41
|
-
|
|
42
24
|
var _tableCell = _interopRequireDefault(require("../nodeviews/tableCell"));
|
|
43
|
-
|
|
44
25
|
var _misc = require("../commands/misc");
|
|
45
|
-
|
|
46
26
|
var _transforms2 = require("@atlaskit/editor-common/transforms");
|
|
47
|
-
|
|
48
27
|
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
49
|
-
|
|
50
28
|
var _paste = require("../utils/paste");
|
|
51
|
-
|
|
52
29
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
53
|
-
|
|
54
30
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
55
|
-
|
|
56
31
|
var isBreakoutEnabled;
|
|
57
32
|
var isFullWidthModeEnabled;
|
|
58
33
|
var wasFullWidthModeEnabled;
|
|
59
|
-
|
|
60
34
|
var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, breakoutEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled, editorAnalyticsAPI) {
|
|
61
35
|
var _window;
|
|
62
|
-
|
|
63
36
|
isBreakoutEnabled = breakoutEnabled;
|
|
64
37
|
isFullWidthModeEnabled = fullWidthModeEnabled;
|
|
65
38
|
wasFullWidthModeEnabled = previousFullWidthModeEnabled;
|
|
@@ -77,7 +50,6 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
|
|
|
77
50
|
if (!entry.target.id) {
|
|
78
51
|
return;
|
|
79
52
|
}
|
|
80
|
-
|
|
81
53
|
elementContentRects[entry.target.id] = entry.contentRect;
|
|
82
54
|
});
|
|
83
55
|
}) : undefined;
|
|
@@ -88,21 +60,18 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
|
|
|
88
60
|
tableHeader: function tableHeader(node, view, getPos) {
|
|
89
61
|
return new _tableCell.default(node, view, getPos, getEditorFeatureFlags, observer);
|
|
90
62
|
}
|
|
91
|
-
};
|
|
63
|
+
};
|
|
92
64
|
|
|
65
|
+
// Used to prevent invalid table cell spans being reported more than once per editor/document
|
|
93
66
|
var invalidTableIds = [];
|
|
94
67
|
var editorViewRef = null;
|
|
95
|
-
|
|
96
68
|
var getCurrentEditorState = function getCurrentEditorState() {
|
|
97
69
|
var editorView = editorViewRef;
|
|
98
|
-
|
|
99
70
|
if (!editorView) {
|
|
100
71
|
return null;
|
|
101
72
|
}
|
|
102
|
-
|
|
103
73
|
return editorView.state;
|
|
104
74
|
};
|
|
105
|
-
|
|
106
75
|
return new _safePlugin.SafePlugin({
|
|
107
76
|
state: state,
|
|
108
77
|
key: _pluginKey.pluginKey,
|
|
@@ -110,14 +79,12 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
|
|
|
110
79
|
var tr = transactions.find(function (tr) {
|
|
111
80
|
return tr.getMeta('uiEvent') === 'cut';
|
|
112
81
|
});
|
|
113
|
-
|
|
114
82
|
function reportInvalidTableCellSpanAttrs(invalidNodeAttr) {
|
|
115
83
|
if (invalidTableIds.find(function (id) {
|
|
116
84
|
return id === invalidNodeAttr.tableLocalId;
|
|
117
85
|
})) {
|
|
118
86
|
return;
|
|
119
87
|
}
|
|
120
|
-
|
|
121
88
|
invalidTableIds.push(invalidNodeAttr.tableLocalId);
|
|
122
89
|
dispatchAnalyticsEvent({
|
|
123
90
|
action: _analytics.ACTION.INVALID_DOCUMENT_ENCOUNTERED,
|
|
@@ -131,13 +98,11 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
|
|
|
131
98
|
}
|
|
132
99
|
});
|
|
133
100
|
}
|
|
134
|
-
|
|
135
101
|
if (tr) {
|
|
136
102
|
// "fixTables" removes empty rows as we don't allow that in schema
|
|
137
103
|
var updatedTr = (0, _eventHandlers.handleCut)(tr, oldState, newState, editorAnalyticsAPI);
|
|
138
104
|
return (0, _transforms.fixTables)(updatedTr) || updatedTr;
|
|
139
105
|
}
|
|
140
|
-
|
|
141
106
|
if (transactions.find(function (tr) {
|
|
142
107
|
return tr.docChanged;
|
|
143
108
|
})) {
|
|
@@ -150,38 +115,30 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
|
|
|
150
115
|
return {
|
|
151
116
|
update: function update(view) {
|
|
152
117
|
var state = view.state,
|
|
153
|
-
|
|
118
|
+
dispatch = view.dispatch;
|
|
154
119
|
var selection = state.selection;
|
|
155
120
|
var pluginState = (0, _pluginFactory.getPluginState)(state);
|
|
156
121
|
var tableRef;
|
|
157
122
|
var tableNode;
|
|
158
|
-
|
|
159
123
|
if (pluginState.editorHasFocus) {
|
|
160
124
|
var parent = (0, _prosemirrorUtils.findParentDomRefOfType)(state.schema.nodes.table, domAtPos)(selection);
|
|
161
|
-
|
|
162
125
|
if (parent) {
|
|
163
126
|
tableRef = parent.querySelector('table') || undefined;
|
|
164
127
|
}
|
|
165
|
-
|
|
166
128
|
tableNode = (0, _utils.findTable)(state.selection);
|
|
167
129
|
}
|
|
168
|
-
|
|
169
130
|
if (pluginState.tableRef !== tableRef) {
|
|
170
131
|
(0, _commands.setTableRef)(tableRef)(state, dispatch);
|
|
171
132
|
}
|
|
172
|
-
|
|
173
133
|
if (pluginState.tableNode !== tableNode) {
|
|
174
134
|
(0, _utils3.updateResizeHandles)(tableRef);
|
|
175
135
|
}
|
|
176
|
-
|
|
177
136
|
if (pluginState.editorHasFocus && pluginState.tableRef) {
|
|
178
137
|
var _ref = state.selection,
|
|
179
|
-
|
|
180
|
-
|
|
138
|
+
$cursor = _ref.$cursor;
|
|
181
139
|
if ($cursor) {
|
|
182
140
|
// Only update bold when it's a cursor
|
|
183
141
|
var tableCellHeader = (0, _prosemirrorUtils.findParentNodeOfType)(state.schema.nodes.tableHeader)(state.selection);
|
|
184
|
-
|
|
185
142
|
if (tableCellHeader) {
|
|
186
143
|
(0, _commands.addBoldInEmptyHeaderCells)(tableCellHeader)(state, dispatch);
|
|
187
144
|
}
|
|
@@ -198,67 +155,61 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
|
|
|
198
155
|
props: {
|
|
199
156
|
transformPasted: function transformPasted(slice) {
|
|
200
157
|
var editorState = getCurrentEditorState();
|
|
201
|
-
|
|
202
158
|
if (!editorState) {
|
|
203
159
|
return slice;
|
|
204
160
|
}
|
|
161
|
+
var schema = editorState.schema;
|
|
205
162
|
|
|
206
|
-
|
|
163
|
+
// if we're pasting to outside a table or outside a table
|
|
207
164
|
// header, ensure that we apply any table headers to the first
|
|
208
165
|
// row of content we see, if required
|
|
209
|
-
|
|
210
166
|
if (!(0, _coreUtils.insideTable)(editorState) && (0, _paste.isHeaderRowRequired)(editorState)) {
|
|
211
167
|
slice = (0, _misc.transformSliceToAddTableHeaders)(slice, schema);
|
|
212
168
|
}
|
|
169
|
+
slice = (0, _utils3.transformSliceToFixHardBreakProblemOnCopyFromCell)(slice, schema);
|
|
213
170
|
|
|
214
|
-
|
|
171
|
+
// We do this separately, so it also applies to drag/drop events
|
|
215
172
|
// This needs to go before `transformSliceToRemoveOpenExpand`
|
|
173
|
+
slice = (0, _transforms2.transformSliceToRemoveOpenLayoutNodes)(slice, schema);
|
|
216
174
|
|
|
217
|
-
|
|
175
|
+
// If a partial paste of expand, paste only the content
|
|
218
176
|
// This needs to go before `transformSliceToRemoveOpenTable`
|
|
219
|
-
|
|
220
177
|
slice = (0, _transforms2.transformSliceToRemoveOpenExpand)(slice, schema);
|
|
221
|
-
/** If a partial paste of table, paste only table's content */
|
|
222
178
|
|
|
179
|
+
/** If a partial paste of table, paste only table's content */
|
|
223
180
|
slice = (0, _utils3.transformSliceToRemoveOpenTable)(slice, schema);
|
|
224
|
-
/** If a partial paste of bodied extension, paste only text */
|
|
225
181
|
|
|
182
|
+
/** If a partial paste of bodied extension, paste only text */
|
|
226
183
|
slice = (0, _transforms2.transformSliceToRemoveOpenBodiedExtension)(slice, schema);
|
|
227
184
|
slice = (0, _utils3.transformSliceToCorrectEmptyTableCells)(slice, schema);
|
|
228
|
-
|
|
229
185
|
if (!pluginConfig.allowColumnResizing) {
|
|
230
186
|
slice = (0, _misc.transformSliceToRemoveColumnsWidths)(slice, schema);
|
|
231
|
-
}
|
|
232
|
-
// from the paste slice
|
|
233
|
-
|
|
187
|
+
}
|
|
234
188
|
|
|
189
|
+
// If we don't allow background on cells, we need to remove it
|
|
190
|
+
// from the paste slice
|
|
235
191
|
if (!pluginConfig.allowBackgroundColor) {
|
|
236
192
|
slice = (0, _misc.transformSliceRemoveCellBackgroundColor)(slice, schema);
|
|
237
193
|
}
|
|
238
|
-
|
|
239
194
|
return slice;
|
|
240
195
|
},
|
|
241
196
|
handleClick: function handleClick(_ref2, _pos, event) {
|
|
242
197
|
var state = _ref2.state,
|
|
243
|
-
|
|
244
|
-
|
|
198
|
+
dispatch = _ref2.dispatch;
|
|
245
199
|
var decorationSet = _plugin.pluginKey.getState(state);
|
|
246
|
-
|
|
247
200
|
if ((0, _utils3.findControlsHoverDecoration)(decorationSet).length) {
|
|
248
201
|
(0, _commands.clearHoverSelection)()(state, dispatch);
|
|
249
|
-
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// ED-6069: workaround for Chrome given a regression introduced in prosemirror-view@1.6.8
|
|
250
205
|
// Returning true prevents that updateSelection() is getting called in the commit below:
|
|
251
206
|
// @see https://github.com/ProseMirror/prosemirror-view/commit/33fe4a8b01584f6b4103c279033dcd33e8047b95
|
|
252
|
-
|
|
253
|
-
|
|
254
207
|
if (_utils2.browser.chrome && event.target) {
|
|
255
208
|
var targetClassList = event.target.classList;
|
|
256
|
-
|
|
257
209
|
if (targetClassList.contains(_types.TableCssClassName.CONTROLS_BUTTON) || targetClassList.contains(_types.TableCssClassName.CONTEXTUAL_MENU_BUTTON)) {
|
|
258
210
|
return true;
|
|
259
211
|
}
|
|
260
212
|
}
|
|
261
|
-
|
|
262
213
|
return false;
|
|
263
214
|
},
|
|
264
215
|
handleScrollToSelection: function handleScrollToSelection(view) {
|
|
@@ -271,14 +222,12 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
|
|
|
271
222
|
},
|
|
272
223
|
handleTextInput: function handleTextInput(_ref3, from, to, text) {
|
|
273
224
|
var state = _ref3.state,
|
|
274
|
-
|
|
225
|
+
dispatch = _ref3.dispatch;
|
|
275
226
|
var tr = (0, _transforms.replaceSelectedTable)(state, text, _analytics.INPUT_METHOD.KEYBOARD, editorAnalyticsAPI);
|
|
276
|
-
|
|
277
227
|
if (tr.selectionSet) {
|
|
278
228
|
dispatch(tr);
|
|
279
229
|
return true;
|
|
280
230
|
}
|
|
281
|
-
|
|
282
231
|
return false;
|
|
283
232
|
},
|
|
284
233
|
nodeViews: _objectSpread(_objectSpread({}, tableCellNodeview), {}, {
|
|
@@ -304,5 +253,4 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
|
|
|
304
253
|
}
|
|
305
254
|
});
|
|
306
255
|
};
|
|
307
|
-
|
|
308
256
|
exports.createPlugin = createPlugin;
|
|
@@ -1,65 +1,48 @@
|
|
|
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.getPluginState = exports.createPluginState = exports.createCommand = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
|
-
|
|
14
10
|
var _handlers = require("../handlers");
|
|
15
|
-
|
|
16
11
|
var _reducer = _interopRequireDefault(require("../reducer"));
|
|
17
|
-
|
|
18
12
|
var _pluginKey = require("./plugin-key");
|
|
19
|
-
|
|
20
13
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
-
|
|
22
14
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
-
|
|
24
15
|
var _pluginFactory = (0, _utils.pluginFactory)(_pluginKey.pluginKey, _reducer.default, {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var _tr$mapping$mapResult = tr.mapping.mapResult(pluginState.targetCellPosition),
|
|
16
|
+
mapping: function mapping(tr, pluginState) {
|
|
17
|
+
if (tr.docChanged) {
|
|
18
|
+
var updatedTargetCell = {};
|
|
19
|
+
if (pluginState.targetCellPosition) {
|
|
20
|
+
var _tr$mapping$mapResult = tr.mapping.mapResult(pluginState.targetCellPosition),
|
|
31
21
|
pos = _tr$mapping$mapResult.pos,
|
|
32
22
|
deleted = _tr$mapping$mapResult.deleted;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (pluginState.tablePos) {
|
|
42
|
-
var _tr$mapping$mapResult2 = tr.mapping.mapResult(pluginState.tablePos, -1),
|
|
23
|
+
updatedTargetCell = {
|
|
24
|
+
targetCellPosition: deleted ? undefined : pos
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
var updatedTablePos = {};
|
|
28
|
+
if (pluginState.tablePos) {
|
|
29
|
+
var _tr$mapping$mapResult2 = tr.mapping.mapResult(pluginState.tablePos, -1),
|
|
43
30
|
_pos = _tr$mapping$mapResult2.pos,
|
|
44
31
|
_deleted = _tr$mapping$mapResult2.deleted;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
32
|
+
updatedTablePos = {
|
|
33
|
+
tablePos: _deleted ? undefined : _pos
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return _objectSpread(_objectSpread(_objectSpread({}, pluginState), updatedTargetCell), updatedTablePos);
|
|
49
37
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}),
|
|
59
|
-
createPluginState = _pluginFactory.createPluginState,
|
|
60
|
-
createCommand = _pluginFactory.createCommand,
|
|
61
|
-
getPluginState = _pluginFactory.getPluginState;
|
|
62
|
-
|
|
38
|
+
return pluginState;
|
|
39
|
+
},
|
|
40
|
+
onDocChanged: _handlers.handleDocOrSelectionChanged,
|
|
41
|
+
onSelectionChanged: _handlers.handleDocOrSelectionChanged
|
|
42
|
+
}),
|
|
43
|
+
createPluginState = _pluginFactory.createPluginState,
|
|
44
|
+
createCommand = _pluginFactory.createCommand,
|
|
45
|
+
getPluginState = _pluginFactory.getPluginState;
|
|
63
46
|
exports.getPluginState = getPluginState;
|
|
64
47
|
exports.createCommand = createCommand;
|
|
65
48
|
exports.createPluginState = createPluginState;
|
package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js
CHANGED
|
@@ -4,14 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.tableSafariDelayedDomSelectionSyncingWorkaroundKey = exports.createPlugin = void 0;
|
|
7
|
-
|
|
8
7
|
var _prosemirrorState = require("prosemirror-state");
|
|
9
|
-
|
|
10
8
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
11
|
-
|
|
12
9
|
var tableSafariDelayedDomSelectionSyncingWorkaroundKey = new _prosemirrorState.PluginKey('tableSafariDelayedDomSelectionSyncingWorkaround');
|
|
13
10
|
exports.tableSafariDelayedDomSelectionSyncingWorkaroundKey = tableSafariDelayedDomSelectionSyncingWorkaroundKey;
|
|
14
|
-
|
|
15
11
|
var createPlugin = function createPlugin() {
|
|
16
12
|
// From a review of the prosemirror-view source code,
|
|
17
13
|
// the only places where a view relies on the presence
|
|
@@ -20,6 +16,7 @@ var createPlugin = function createPlugin() {
|
|
|
20
16
|
// to delay drag selections
|
|
21
17
|
// - to ensure it is cleaned up when the mouseup
|
|
22
18
|
// event is not fired in a previous mousedown event
|
|
19
|
+
|
|
23
20
|
// Because we are manually wiping the view.mouseDown,
|
|
24
21
|
// we manage this custom cleanup ourselves
|
|
25
22
|
var prevMouseDownDone = null;
|
|
@@ -33,13 +30,16 @@ var createPlugin = function createPlugin() {
|
|
|
33
30
|
// DOM selection syncing during pointer drag.
|
|
34
31
|
//
|
|
35
32
|
// https://github.com/ProseMirror/prosemirror-view/commit/885258b80551ac87b81601d3ed25f552aeb22293
|
|
33
|
+
|
|
36
34
|
// NOTE: this workaround can be removed when next upgrading prosemirror as the issue will be fixed
|
|
37
35
|
// https://github.com/ProseMirror/prosemirror-view/pull/116
|
|
36
|
+
|
|
38
37
|
// This fix removes the selectionToDOM from the view
|
|
39
38
|
// prior to selectionToDOM being called.
|
|
40
39
|
// selectionToDOM checks if there is an "active"
|
|
41
40
|
// mouseDown, and if so, it delays running logic
|
|
42
41
|
// which causes the table selections issue.
|
|
42
|
+
|
|
43
43
|
// The handleDOMEvents are called before ProseMirror
|
|
44
44
|
// events fired on the editable DOM element.
|
|
45
45
|
// This means the view.mouseView will not yet be
|
|
@@ -51,21 +51,22 @@ var createPlugin = function createPlugin() {
|
|
|
51
51
|
// prepend a task which will clear the mouseDown from
|
|
52
52
|
// the view. We do this using a setTimout with no
|
|
53
53
|
// interval.
|
|
54
|
+
|
|
54
55
|
if (prevMouseDownDone) {
|
|
55
56
|
// avoid memory leaks when the mouseup event is not fired
|
|
56
57
|
// in a previous mousedown event
|
|
57
58
|
prevMouseDownDone();
|
|
58
59
|
}
|
|
59
|
-
|
|
60
60
|
setTimeout(function () {
|
|
61
61
|
// the ts-ignores here are required due to the
|
|
62
62
|
// view.mouseDown being an internal which is
|
|
63
63
|
// not part of the views type signature
|
|
64
|
+
|
|
64
65
|
// @ts-ignore
|
|
65
66
|
if (view.mouseDown) {
|
|
66
67
|
// @ts-ignore
|
|
67
|
-
prevMouseDownDone = view.mouseDown.done.bind(view.mouseDown);
|
|
68
|
-
|
|
68
|
+
prevMouseDownDone = view.mouseDown.done.bind(view.mouseDown);
|
|
69
|
+
// @ts-ignore
|
|
69
70
|
view.mouseDown = null;
|
|
70
71
|
}
|
|
71
72
|
});
|
|
@@ -75,5 +76,4 @@ var createPlugin = function createPlugin() {
|
|
|
75
76
|
}
|
|
76
77
|
});
|
|
77
78
|
};
|
|
78
|
-
|
|
79
79
|
exports.createPlugin = createPlugin;
|
package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js
CHANGED
|
@@ -4,21 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.tableSafariDeleteCompositionTextIssueWorkaroundKey = exports.createPlugin = void 0;
|
|
7
|
-
|
|
8
7
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
9
|
-
|
|
10
8
|
var _prosemirrorState = require("prosemirror-state");
|
|
11
|
-
|
|
12
9
|
var _prosemirrorView = require("prosemirror-view");
|
|
13
|
-
|
|
14
10
|
/**
|
|
15
11
|
* Fix an issue that composition text replacement in Safari removes empty nodes during text composition text deletion.
|
|
16
12
|
* https://github.com/ProseMirror/prosemirror/issues/934
|
|
17
13
|
* We will remove this plugin when Webkit fix the problem itself.
|
|
18
14
|
*/
|
|
15
|
+
|
|
19
16
|
var tableSafariDeleteCompositionTextIssueWorkaroundKey = new _prosemirrorState.PluginKey('tableSafariDeleteCompositionTextIssueWorkaround');
|
|
20
17
|
exports.tableSafariDeleteCompositionTextIssueWorkaroundKey = tableSafariDeleteCompositionTextIssueWorkaroundKey;
|
|
21
|
-
|
|
22
18
|
var createPlugin = function createPlugin() {
|
|
23
19
|
return new _safePlugin.SafePlugin({
|
|
24
20
|
key: tableSafariDeleteCompositionTextIssueWorkaroundKey,
|
|
@@ -31,28 +27,22 @@ var createPlugin = function createPlugin() {
|
|
|
31
27
|
},
|
|
32
28
|
apply: function apply(tr, value) {
|
|
33
29
|
var renderSpan = tr.getMeta(tableSafariDeleteCompositionTextIssueWorkaroundKey);
|
|
34
|
-
|
|
35
30
|
if (typeof renderSpan === 'undefined') {
|
|
36
31
|
return value;
|
|
37
32
|
}
|
|
38
|
-
|
|
39
33
|
var decorations;
|
|
40
|
-
|
|
41
34
|
if (renderSpan) {
|
|
42
35
|
// Find position of the first text node in case it has multiple text nodes created by Japanese IME
|
|
43
36
|
var $from = tr.selection.$from;
|
|
44
37
|
var pos = $from.before($from.depth);
|
|
45
|
-
|
|
46
38
|
var spanDecoration = _prosemirrorView.Decoration.widget(pos, function () {
|
|
47
39
|
var spanElement = document.createElement('span');
|
|
48
40
|
return spanElement;
|
|
49
41
|
});
|
|
50
|
-
|
|
51
42
|
decorations = _prosemirrorView.DecorationSet.create(tr.doc, [spanDecoration]);
|
|
52
43
|
} else {
|
|
53
44
|
decorations = _prosemirrorView.DecorationSet.empty;
|
|
54
45
|
}
|
|
55
|
-
|
|
56
46
|
return {
|
|
57
47
|
renderSpan: renderSpan,
|
|
58
48
|
decorations: decorations
|
|
@@ -68,43 +58,35 @@ var createPlugin = function createPlugin() {
|
|
|
68
58
|
if ((event === null || event === void 0 ? void 0 : event.inputType) !== 'deleteCompositionText') {
|
|
69
59
|
return false;
|
|
70
60
|
}
|
|
71
|
-
|
|
72
61
|
var selection = window.getSelection();
|
|
73
|
-
|
|
74
62
|
if (!selection || selection.rangeCount <= 0 || selection.type !== 'Range') {
|
|
75
63
|
return false;
|
|
76
64
|
}
|
|
77
|
-
|
|
78
65
|
var range = selection.getRangeAt(0);
|
|
79
66
|
var startContainer = range.startContainer,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
67
|
+
endContainer = range.endContainer,
|
|
68
|
+
endOffset = range.endOffset,
|
|
69
|
+
startOffset = range.startOffset;
|
|
83
70
|
/**
|
|
84
71
|
* On Safari when composition text is deleted, it deletes any empty elements it finds up the dom tree. Prosemirror can sometimes be confused by this
|
|
85
72
|
* and will think that we meant to delete those elements. This fix forces the resulting node to not be empty.
|
|
86
73
|
* The condition here checks to see if the entire text node is about to be swapped inside of an element
|
|
87
74
|
*/
|
|
88
|
-
|
|
89
75
|
if (startContainer.nodeType === Node.TEXT_NODE && startContainer === endContainer && startOffset === 0 && endOffset === startContainer.length) {
|
|
90
76
|
var tr = view.state.tr;
|
|
91
77
|
tr.setMeta(tableSafariDeleteCompositionTextIssueWorkaroundKey, true);
|
|
92
78
|
view.dispatch(tr);
|
|
93
79
|
}
|
|
94
|
-
|
|
95
80
|
return false;
|
|
96
81
|
},
|
|
97
82
|
input: function input(view, event) {
|
|
98
83
|
if ((event === null || event === void 0 ? void 0 : event.inputType) !== 'deleteCompositionText') {
|
|
99
84
|
return false;
|
|
100
85
|
}
|
|
101
|
-
|
|
102
86
|
var selection = window.getSelection();
|
|
103
|
-
|
|
104
87
|
if (!selection) {
|
|
105
88
|
return false;
|
|
106
89
|
}
|
|
107
|
-
|
|
108
90
|
var tr = view.state.tr;
|
|
109
91
|
tr.setMeta(tableSafariDeleteCompositionTextIssueWorkaroundKey, false);
|
|
110
92
|
view.dispatch(tr);
|
|
@@ -114,5 +96,4 @@ var createPlugin = function createPlugin() {
|
|
|
114
96
|
}
|
|
115
97
|
});
|
|
116
98
|
};
|
|
117
|
-
|
|
118
99
|
exports.createPlugin = createPlugin;
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.updateStickyState = exports.removeStickyState = void 0;
|
|
7
|
-
|
|
8
7
|
var _pluginState = require("./plugin-state");
|
|
9
|
-
|
|
10
8
|
var updateStickyState = function updateStickyState(rowState) {
|
|
11
9
|
return (0, _pluginState.createCommand)({
|
|
12
10
|
name: 'UPDATE',
|
|
@@ -15,9 +13,7 @@ var updateStickyState = function updateStickyState(rowState) {
|
|
|
15
13
|
return tr.setMeta('addToHistory', false);
|
|
16
14
|
});
|
|
17
15
|
};
|
|
18
|
-
|
|
19
16
|
exports.updateStickyState = updateStickyState;
|
|
20
|
-
|
|
21
17
|
var removeStickyState = function removeStickyState(pos) {
|
|
22
18
|
return (0, _pluginState.createCommand)({
|
|
23
19
|
name: 'REMOVE',
|
|
@@ -26,5 +22,4 @@ var removeStickyState = function removeStickyState(pos) {
|
|
|
26
22
|
return tr.setMeta('addToHistory', false);
|
|
27
23
|
});
|
|
28
24
|
};
|
|
29
|
-
|
|
30
25
|
exports.removeStickyState = removeStickyState;
|