@atlaskit/editor-plugin-table 1.3.0 → 1.4.0
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 +22 -0
- package/commands/package.json +2 -2
- package/dist/cjs/plugins/table/commands/misc.js +1 -2
- package/dist/cjs/plugins/table/index.js +25 -34
- package/dist/cjs/plugins/table/transforms/column-width.js +0 -17
- package/dist/cjs/plugins/table/transforms/delete-columns.js +4 -13
- package/dist/cjs/plugins/table/transforms/delete-rows.js +4 -13
- package/dist/cjs/plugins/table/transforms/fix-tables.js +6 -24
- package/dist/cjs/plugins/table/transforms/index.js +0 -13
- package/dist/cjs/plugins/table/transforms/merge.js +5 -20
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/commands/misc.js +2 -3
- package/dist/es2019/plugins/table/index.js +21 -33
- package/dist/es2019/plugins/table/transforms/column-width.js +0 -17
- package/dist/es2019/plugins/table/transforms/delete-columns.js +4 -13
- package/dist/es2019/plugins/table/transforms/delete-rows.js +4 -13
- package/dist/es2019/plugins/table/transforms/fix-tables.js +0 -14
- package/dist/es2019/plugins/table/transforms/index.js +1 -2
- package/dist/es2019/plugins/table/transforms/merge.js +5 -21
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/commands/misc.js +2 -3
- package/dist/esm/plugins/table/index.js +25 -34
- package/dist/esm/plugins/table/transforms/column-width.js +0 -17
- package/dist/esm/plugins/table/transforms/delete-columns.js +4 -13
- package/dist/esm/plugins/table/transforms/delete-rows.js +4 -13
- package/dist/esm/plugins/table/transforms/fix-tables.js +0 -17
- package/dist/esm/plugins/table/transforms/index.js +1 -2
- package/dist/esm/plugins/table/transforms/merge.js +5 -21
- package/dist/esm/version.json +1 -1
- package/dist/types/i18n/cs.d.ts +6 -6
- package/dist/types/i18n/da.d.ts +6 -6
- package/dist/types/i18n/de.d.ts +6 -6
- package/dist/types/i18n/en.d.ts +6 -6
- package/dist/types/i18n/en_GB.d.ts +6 -6
- package/dist/types/i18n/es.d.ts +6 -6
- package/dist/types/i18n/fi.d.ts +6 -6
- package/dist/types/i18n/fr.d.ts +6 -6
- package/dist/types/i18n/hu.d.ts +6 -6
- package/dist/types/i18n/it.d.ts +6 -6
- package/dist/types/i18n/ja.d.ts +6 -6
- package/dist/types/i18n/ko.d.ts +6 -6
- package/dist/types/i18n/nb.d.ts +6 -6
- package/dist/types/i18n/nl.d.ts +6 -6
- package/dist/types/i18n/pl.d.ts +6 -6
- package/dist/types/i18n/pt_BR.d.ts +6 -6
- package/dist/types/i18n/ru.d.ts +6 -6
- package/dist/types/i18n/sv.d.ts +6 -6
- package/dist/types/i18n/th.d.ts +6 -6
- package/dist/types/i18n/tr.d.ts +6 -6
- package/dist/types/i18n/uk.d.ts +6 -6
- package/dist/types/i18n/vi.d.ts +6 -6
- package/dist/types/i18n/zh.d.ts +6 -6
- package/dist/types/i18n/zh_TW.d.ts +6 -6
- package/dist/types/plugins/table/commands/clear.d.ts +1 -1
- package/dist/types/plugins/table/commands/hover.d.ts +3 -3
- package/dist/types/plugins/table/commands/misc.d.ts +4 -4
- package/dist/types/plugins/table/commands-with-analytics.d.ts +2 -2
- package/dist/types/plugins/table/event-handlers.d.ts +3 -3
- package/dist/types/plugins/table/index.d.ts +9 -0
- package/dist/types/plugins/table/nodeviews/OverflowShadowsObserver.d.ts +2 -2
- package/dist/types/plugins/table/nodeviews/table.d.ts +1 -1
- package/dist/types/plugins/table/nodeviews/types.d.ts +1 -1
- package/dist/types/plugins/table/nodeviews/update-overflow-shadows.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/decorations/utils/types.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/types.d.ts +5 -5
- package/dist/types/plugins/table/pm-plugins/table-resizing/commands.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-column.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-logic.d.ts +2 -2
- package/dist/types/plugins/table/transforms/fix-tables.d.ts +2 -3
- package/dist/types/plugins/table/transforms/index.d.ts +1 -2
- package/dist/types/plugins/table/transforms/replace-table.d.ts +1 -1
- package/dist/types/plugins/table/types.d.ts +11 -11
- package/dist/types/plugins/table/ui/FloatingDeleteButton/types.d.ts +1 -1
- package/dist/types/plugins/table/ui/ui-styles.d.ts +2 -2
- package/dist/types/plugins/table/utils/column-controls.d.ts +1 -1
- package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
- package/dist/types/plugins/table/utils/dom.d.ts +2 -2
- package/dist/types/plugins/table/utils/row-controls.d.ts +1 -1
- package/dist/types/plugins/table/utils/selection.d.ts +1 -1
- package/dist/types-ts4.5/i18n/cs.d.ts +35 -0
- package/dist/types-ts4.5/i18n/da.d.ts +33 -0
- package/dist/types-ts4.5/i18n/de.d.ts +33 -0
- package/dist/types-ts4.5/i18n/en.d.ts +35 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +35 -0
- package/dist/types-ts4.5/i18n/es.d.ts +33 -0
- package/dist/types-ts4.5/i18n/fi.d.ts +33 -0
- package/dist/types-ts4.5/i18n/fr.d.ts +35 -0
- package/dist/types-ts4.5/i18n/hu.d.ts +35 -0
- package/dist/types-ts4.5/i18n/it.d.ts +35 -0
- package/dist/types-ts4.5/i18n/ja.d.ts +35 -0
- package/dist/types-ts4.5/i18n/ko.d.ts +33 -0
- package/dist/types-ts4.5/i18n/nb.d.ts +33 -0
- package/dist/types-ts4.5/i18n/nl.d.ts +35 -0
- package/dist/types-ts4.5/i18n/pl.d.ts +35 -0
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +35 -0
- package/dist/types-ts4.5/i18n/ru.d.ts +35 -0
- package/dist/types-ts4.5/i18n/sv.d.ts +33 -0
- package/dist/types-ts4.5/i18n/th.d.ts +33 -0
- package/dist/types-ts4.5/i18n/tr.d.ts +35 -0
- package/dist/types-ts4.5/i18n/uk.d.ts +35 -0
- package/dist/types-ts4.5/i18n/vi.d.ts +33 -0
- package/dist/types-ts4.5/i18n/zh.d.ts +35 -0
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +35 -0
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/commands/clear.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/commands/collapse.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/commands/go-to-next-cell.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/commands/hover.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/commands/index.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/commands/insert.d.ts +10 -0
- package/dist/types-ts4.5/plugins/table/commands/misc.d.ts +27 -0
- package/dist/types-ts4.5/plugins/table/commands/referentiality.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/commands/selection.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/commands/sort.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/commands/split-cell.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/commands/toggle.d.ts +12 -0
- package/dist/types-ts4.5/plugins/table/commands-with-analytics.d.ts +26 -0
- package/dist/types-ts4.5/plugins/table/create-plugin-config.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +16 -0
- package/dist/types-ts4.5/plugins/table/handlers.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/index.d.ts +30 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/OverflowShadowsObserver.d.ts +25 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +73 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/__mocks__/OverflowShadowsObserver.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/__mocks__/OverridableMock.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +34 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/tableCell.d.ts +19 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +24 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/update-overflow-shadows.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/plugin.d.ts +7 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-controls.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-resizing.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/compose-decorations.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/index.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/types.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/default-table-selection.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/keymap.d.ts +5 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-factory.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +15 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/commands.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/index.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +72 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-key.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-state.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/types.d.ts +16 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/util.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-local-id.d.ts +22 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/commands.d.ts +25 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-factory.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-key.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/reducer.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +15 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/column-state.d.ts +14 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/content-width.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +13 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/index.d.ts +12 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +22 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-logic.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +29 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +17 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +22 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-selection-keymap.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/reducer.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/toolbar.d.ts +37 -0
- package/dist/types-ts4.5/plugins/table/transforms/column-width.d.ts +18 -0
- package/dist/types-ts4.5/plugins/table/transforms/delete-columns.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/transforms/delete-rows.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/transforms/fix-tables.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/transforms/index.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/transforms/merge.d.ts +5 -0
- package/dist/types-ts4.5/plugins/table/transforms/replace-table.d.ts +5 -0
- package/dist/types-ts4.5/plugins/table/transforms/split.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/types.d.ts +332 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/index.d.ts +29 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/styles.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +88 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/index.d.ts +23 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/styles.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +14 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.d.ts +10 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/index.d.ts +54 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/types.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +12 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/index.d.ts +35 -0
- package/dist/types-ts4.5/plugins/table/ui/LayoutButton/index.d.ts +21 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +16 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +21 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/index.d.ts +17 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +40 -0
- package/dist/types-ts4.5/plugins/table/ui/common-styles.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +39 -0
- package/dist/types-ts4.5/plugins/table/ui/messages.d.ts +58 -0
- package/dist/types-ts4.5/plugins/table/ui/ui-styles.d.ts +15 -0
- package/dist/types-ts4.5/plugins/table/utils/analytics.d.ts +18 -0
- package/dist/types-ts4.5/plugins/table/utils/collapse.d.ts +29 -0
- package/dist/types-ts4.5/plugins/table/utils/column-controls.d.ts +10 -0
- package/dist/types-ts4.5/plugins/table/utils/decoration.d.ts +16 -0
- package/dist/types-ts4.5/plugins/table/utils/dom.d.ts +20 -0
- package/dist/types-ts4.5/plugins/table/utils/get-allow-add-column-custom-step.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/utils/index.d.ts +11 -0
- package/dist/types-ts4.5/plugins/table/utils/nodes.d.ts +12 -0
- package/dist/types-ts4.5/plugins/table/utils/paste.d.ts +14 -0
- package/dist/types-ts4.5/plugins/table/utils/row-controls.d.ts +16 -0
- package/dist/types-ts4.5/plugins/table/utils/selection.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/utils/table.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/utils/update-plugin-state-decorations.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table-plugin.d.ts +2 -0
- package/dist/types-ts4.5/types/i18n.d.ts +5 -0
- package/examples/99-testing.tsx +4 -94
- package/package.json +19 -9
- package/plugin-key/package.json +2 -2
- package/report.api.md +11 -0
- package/src/__tests__/unit/analytics.ts +6 -0
- package/src/__tests__/unit/collab.ts +6 -0
- package/src/__tests__/unit/color-picker.ts +4 -0
- package/src/__tests__/unit/commands/go-to-next-cell.ts +8 -1
- package/src/__tests__/unit/commands/insert.ts +6 -0
- package/src/__tests__/unit/commands/misc.ts +14 -6
- package/src/__tests__/unit/commands/sort.ts +19 -12
- package/src/__tests__/unit/commands.ts +10 -2
- package/src/__tests__/unit/copy-paste.ts +6 -0
- package/src/__tests__/unit/event-handlers/index.ts +13 -8
- package/src/__tests__/unit/event-handlers.ts +13 -1
- package/src/__tests__/unit/fix-tables.ts +8 -4
- package/src/__tests__/unit/get-toolbar-config.ts +4 -0
- package/src/__tests__/unit/handlers.ts +8 -1
- package/src/__tests__/unit/hover-selection.ts +8 -1
- package/src/__tests__/unit/index.ts +10 -2
- package/src/__tests__/unit/keymap.ts +10 -4
- package/src/__tests__/unit/layout.ts +4 -0
- package/src/__tests__/unit/nodeviews/cell.ts +6 -0
- package/src/__tests__/unit/nodeviews/table.ts +16 -9
- package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +14 -4
- package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +8 -1
- package/src/__tests__/unit/pm-plugins/main-with-allow-collapse.ts +4 -0
- package/src/__tests__/unit/pm-plugins/main.ts +6 -0
- package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +8 -4
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +13 -4
- package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +6 -0
- package/src/__tests__/unit/pm-plugins/table-selection-keymap.ts +6 -0
- package/src/__tests__/unit/sort-column.ts +6 -0
- package/src/__tests__/unit/toolbar.ts +16 -9
- package/src/__tests__/unit/transforms/delete-columns.ts +8 -1
- package/src/__tests__/unit/transforms/delete-rows.ts +8 -1
- package/src/__tests__/unit/transforms/merging.ts +8 -1
- package/src/__tests__/unit/ui/ContextualMenu.tsx +8 -4
- package/src/__tests__/unit/ui/CornerControls.tsx +8 -1
- package/src/__tests__/unit/ui/FloatingContextualButton.tsx +8 -1
- package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +8 -1
- package/src/__tests__/unit/ui/RowControls.tsx +8 -1
- package/src/__tests__/unit/ui/TableFloatingControls.tsx +8 -1
- package/src/__tests__/unit/undo-redo.ts +6 -0
- package/src/__tests__/unit/utils/collapse.ts +4 -0
- package/src/__tests__/unit/utils/nodes.ts +8 -1
- package/src/__tests__/unit/utils/row-controls.ts +8 -1
- package/src/__tests__/unit/utils.ts +8 -1
- package/src/plugins/table/commands/misc.ts +2 -4
- package/src/plugins/table/index.tsx +39 -40
- package/src/plugins/table/transforms/column-width.ts +0 -11
- package/src/plugins/table/transforms/delete-columns.ts +4 -5
- package/src/plugins/table/transforms/delete-rows.ts +4 -7
- package/src/plugins/table/transforms/fix-tables.ts +0 -17
- package/src/plugins/table/transforms/index.ts +1 -2
- package/src/plugins/table/transforms/merge.ts +9 -20
- package/types/package.json +2 -2
- package/ui/common-styles/package.json +2 -2
- package/ui/consts/package.json +2 -2
- package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +0 -79
- package/dist/cjs/plugins/table/transforms/metadata.js +0 -20
- package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +0 -71
- package/dist/es2019/plugins/table/transforms/metadata.js +0 -12
- package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +0 -71
- package/dist/esm/plugins/table/transforms/metadata.js +0 -14
- package/dist/types/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.d.ts +0 -4
- package/dist/types/plugins/table/transforms/metadata.d.ts +0 -21
- package/src/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.ts +0 -78
- package/src/plugins/table/transforms/metadata.ts +0 -35
package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { PluginKey } from 'prosemirror-state';
|
|
2
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
-
export const tableSafariDelayedDomSelectionSyncingWorkaroundKey = new PluginKey('tableSafariDelayedDomSelectionSyncingWorkaround');
|
|
4
|
-
export const createPlugin = () => {
|
|
5
|
-
// From a review of the prosemirror-view source code,
|
|
6
|
-
// the only places where a view relies on the presence
|
|
7
|
-
// of view.mouseDown are;
|
|
8
|
-
// - when checking it's presence in selectionToDOM
|
|
9
|
-
// to delay drag selections
|
|
10
|
-
// - to ensure it is cleaned up when the mouseup
|
|
11
|
-
// event is not fired in a previous mousedown event
|
|
12
|
-
|
|
13
|
-
// Because we are manually wiping the view.mouseDown,
|
|
14
|
-
// we manage this custom cleanup ourselves
|
|
15
|
-
let prevMouseDownDone = null;
|
|
16
|
-
return new SafePlugin({
|
|
17
|
-
key: tableSafariDelayedDomSelectionSyncingWorkaroundKey,
|
|
18
|
-
props: {
|
|
19
|
-
handleDOMEvents: {
|
|
20
|
-
mousedown: view => {
|
|
21
|
-
// Workaround issue in safari where table selections
|
|
22
|
-
// do not work correctly since prosemirror delayed
|
|
23
|
-
// DOM selection syncing during pointer drag.
|
|
24
|
-
//
|
|
25
|
-
// https://github.com/ProseMirror/prosemirror-view/commit/885258b80551ac87b81601d3ed25f552aeb22293
|
|
26
|
-
|
|
27
|
-
// NOTE: this workaround can be removed when next upgrading prosemirror as the issue will be fixed
|
|
28
|
-
// https://github.com/ProseMirror/prosemirror-view/pull/116
|
|
29
|
-
|
|
30
|
-
// This fix removes the selectionToDOM from the view
|
|
31
|
-
// prior to selectionToDOM being called.
|
|
32
|
-
// selectionToDOM checks if there is an "active"
|
|
33
|
-
// mouseDown, and if so, it delays running logic
|
|
34
|
-
// which causes the table selections issue.
|
|
35
|
-
|
|
36
|
-
// The handleDOMEvents are called before ProseMirror
|
|
37
|
-
// events fired on the editable DOM element.
|
|
38
|
-
// This means the view.mouseView will not yet be
|
|
39
|
-
// created when the mousedown event starts.
|
|
40
|
-
// https://prosemirror.net/docs/ref/#view.EditorProps.handleDOMEvents
|
|
41
|
-
//
|
|
42
|
-
// Because selectionToDOM is only added to the script
|
|
43
|
-
// tasks queue following the mousedown event, we can
|
|
44
|
-
// prepend a task which will clear the mouseDown from
|
|
45
|
-
// the view. We do this using a setTimout with no
|
|
46
|
-
// interval.
|
|
47
|
-
|
|
48
|
-
if (prevMouseDownDone) {
|
|
49
|
-
// avoid memory leaks when the mouseup event is not fired
|
|
50
|
-
// in a previous mousedown event
|
|
51
|
-
prevMouseDownDone();
|
|
52
|
-
}
|
|
53
|
-
setTimeout(() => {
|
|
54
|
-
// the ts-ignores here are required due to the
|
|
55
|
-
// view.mouseDown being an internal which is
|
|
56
|
-
// not part of the views type signature
|
|
57
|
-
|
|
58
|
-
// @ts-ignore
|
|
59
|
-
if (view.mouseDown) {
|
|
60
|
-
// @ts-ignore
|
|
61
|
-
prevMouseDownDone = view.mouseDown.done.bind(view.mouseDown);
|
|
62
|
-
// @ts-ignore
|
|
63
|
-
view.mouseDown = null;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
2
|
-
import { fireAnalytics } from './fix-tables';
|
|
3
|
-
|
|
4
|
-
// Set metadata on a ProseMirror transaction for debugging purposes in Synchrony
|
|
5
|
-
|
|
6
|
-
export const setMeta = meta => tr => {
|
|
7
|
-
if ('problem' in meta) {
|
|
8
|
-
// Send analytics event whenever we encounter with a problem
|
|
9
|
-
fireAnalytics(meta);
|
|
10
|
-
}
|
|
11
|
-
return tr.setMeta(pluginKey, meta);
|
|
12
|
-
};
|
package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { PluginKey } from 'prosemirror-state';
|
|
2
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
-
export var tableSafariDelayedDomSelectionSyncingWorkaroundKey = new PluginKey('tableSafariDelayedDomSelectionSyncingWorkaround');
|
|
4
|
-
export var createPlugin = function createPlugin() {
|
|
5
|
-
// From a review of the prosemirror-view source code,
|
|
6
|
-
// the only places where a view relies on the presence
|
|
7
|
-
// of view.mouseDown are;
|
|
8
|
-
// - when checking it's presence in selectionToDOM
|
|
9
|
-
// to delay drag selections
|
|
10
|
-
// - to ensure it is cleaned up when the mouseup
|
|
11
|
-
// event is not fired in a previous mousedown event
|
|
12
|
-
|
|
13
|
-
// Because we are manually wiping the view.mouseDown,
|
|
14
|
-
// we manage this custom cleanup ourselves
|
|
15
|
-
var prevMouseDownDone = null;
|
|
16
|
-
return new SafePlugin({
|
|
17
|
-
key: tableSafariDelayedDomSelectionSyncingWorkaroundKey,
|
|
18
|
-
props: {
|
|
19
|
-
handleDOMEvents: {
|
|
20
|
-
mousedown: function mousedown(view) {
|
|
21
|
-
// Workaround issue in safari where table selections
|
|
22
|
-
// do not work correctly since prosemirror delayed
|
|
23
|
-
// DOM selection syncing during pointer drag.
|
|
24
|
-
//
|
|
25
|
-
// https://github.com/ProseMirror/prosemirror-view/commit/885258b80551ac87b81601d3ed25f552aeb22293
|
|
26
|
-
|
|
27
|
-
// NOTE: this workaround can be removed when next upgrading prosemirror as the issue will be fixed
|
|
28
|
-
// https://github.com/ProseMirror/prosemirror-view/pull/116
|
|
29
|
-
|
|
30
|
-
// This fix removes the selectionToDOM from the view
|
|
31
|
-
// prior to selectionToDOM being called.
|
|
32
|
-
// selectionToDOM checks if there is an "active"
|
|
33
|
-
// mouseDown, and if so, it delays running logic
|
|
34
|
-
// which causes the table selections issue.
|
|
35
|
-
|
|
36
|
-
// The handleDOMEvents are called before ProseMirror
|
|
37
|
-
// events fired on the editable DOM element.
|
|
38
|
-
// This means the view.mouseView will not yet be
|
|
39
|
-
// created when the mousedown event starts.
|
|
40
|
-
// https://prosemirror.net/docs/ref/#view.EditorProps.handleDOMEvents
|
|
41
|
-
//
|
|
42
|
-
// Because selectionToDOM is only added to the script
|
|
43
|
-
// tasks queue following the mousedown event, we can
|
|
44
|
-
// prepend a task which will clear the mouseDown from
|
|
45
|
-
// the view. We do this using a setTimout with no
|
|
46
|
-
// interval.
|
|
47
|
-
|
|
48
|
-
if (prevMouseDownDone) {
|
|
49
|
-
// avoid memory leaks when the mouseup event is not fired
|
|
50
|
-
// in a previous mousedown event
|
|
51
|
-
prevMouseDownDone();
|
|
52
|
-
}
|
|
53
|
-
setTimeout(function () {
|
|
54
|
-
// the ts-ignores here are required due to the
|
|
55
|
-
// view.mouseDown being an internal which is
|
|
56
|
-
// not part of the views type signature
|
|
57
|
-
|
|
58
|
-
// @ts-ignore
|
|
59
|
-
if (view.mouseDown) {
|
|
60
|
-
// @ts-ignore
|
|
61
|
-
prevMouseDownDone = view.mouseDown.done.bind(view.mouseDown);
|
|
62
|
-
// @ts-ignore
|
|
63
|
-
view.mouseDown = null;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
2
|
-
import { fireAnalytics } from './fix-tables';
|
|
3
|
-
|
|
4
|
-
// Set metadata on a ProseMirror transaction for debugging purposes in Synchrony
|
|
5
|
-
|
|
6
|
-
export var setMeta = function setMeta(meta) {
|
|
7
|
-
return function (tr) {
|
|
8
|
-
if ('problem' in meta) {
|
|
9
|
-
// Send analytics event whenever we encounter with a problem
|
|
10
|
-
fireAnalytics(meta);
|
|
11
|
-
}
|
|
12
|
-
return tr.setMeta(pluginKey, meta);
|
|
13
|
-
};
|
|
14
|
-
};
|
package/dist/types/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { PluginKey } from 'prosemirror-state';
|
|
2
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
-
export declare const tableSafariDelayedDomSelectionSyncingWorkaroundKey: PluginKey<any, any>;
|
|
4
|
-
export declare const createPlugin: () => SafePlugin<any, any>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Transaction } from 'prosemirror-state';
|
|
2
|
-
declare type TableProblems = 'NEGATIVE_ROWSPAN' | 'REMOVE_EMPTY_ROWS' | 'REMOVE_EMPTY_COLUMNS' | 'EMPTY_TABLE' | 'FIX_ROWSPANS' | 'COLWIDTHS_BEFORE_UPDATE' | 'COLWIDTHS_AFTER_UPDATE';
|
|
3
|
-
export declare type TableMetaData = {
|
|
4
|
-
type: 'MERGE_CELLS';
|
|
5
|
-
problem?: TableProblems;
|
|
6
|
-
} | {
|
|
7
|
-
type: 'DELETE_ROWS';
|
|
8
|
-
problem?: TableProblems;
|
|
9
|
-
} | {
|
|
10
|
-
type: 'DELETE_COLUMNS';
|
|
11
|
-
problem?: TableProblems;
|
|
12
|
-
} | {
|
|
13
|
-
type: 'UPDATE_COLUMN_WIDTHS';
|
|
14
|
-
data: {
|
|
15
|
-
colwidths: number[];
|
|
16
|
-
colspan: number;
|
|
17
|
-
};
|
|
18
|
-
problem?: TableProblems;
|
|
19
|
-
};
|
|
20
|
-
export declare const setMeta: (meta: TableMetaData) => (tr: Transaction) => Transaction;
|
|
21
|
-
export {};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { PluginKey } from 'prosemirror-state';
|
|
2
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
-
|
|
4
|
-
export const tableSafariDelayedDomSelectionSyncingWorkaroundKey = new PluginKey(
|
|
5
|
-
'tableSafariDelayedDomSelectionSyncingWorkaround',
|
|
6
|
-
);
|
|
7
|
-
export const createPlugin = () => {
|
|
8
|
-
// From a review of the prosemirror-view source code,
|
|
9
|
-
// the only places where a view relies on the presence
|
|
10
|
-
// of view.mouseDown are;
|
|
11
|
-
// - when checking it's presence in selectionToDOM
|
|
12
|
-
// to delay drag selections
|
|
13
|
-
// - to ensure it is cleaned up when the mouseup
|
|
14
|
-
// event is not fired in a previous mousedown event
|
|
15
|
-
|
|
16
|
-
// Because we are manually wiping the view.mouseDown,
|
|
17
|
-
// we manage this custom cleanup ourselves
|
|
18
|
-
let prevMouseDownDone: null | (() => void) = null;
|
|
19
|
-
|
|
20
|
-
return new SafePlugin({
|
|
21
|
-
key: tableSafariDelayedDomSelectionSyncingWorkaroundKey,
|
|
22
|
-
|
|
23
|
-
props: {
|
|
24
|
-
handleDOMEvents: {
|
|
25
|
-
mousedown: (view) => {
|
|
26
|
-
// Workaround issue in safari where table selections
|
|
27
|
-
// do not work correctly since prosemirror delayed
|
|
28
|
-
// DOM selection syncing during pointer drag.
|
|
29
|
-
//
|
|
30
|
-
// https://github.com/ProseMirror/prosemirror-view/commit/885258b80551ac87b81601d3ed25f552aeb22293
|
|
31
|
-
|
|
32
|
-
// NOTE: this workaround can be removed when next upgrading prosemirror as the issue will be fixed
|
|
33
|
-
// https://github.com/ProseMirror/prosemirror-view/pull/116
|
|
34
|
-
|
|
35
|
-
// This fix removes the selectionToDOM from the view
|
|
36
|
-
// prior to selectionToDOM being called.
|
|
37
|
-
// selectionToDOM checks if there is an "active"
|
|
38
|
-
// mouseDown, and if so, it delays running logic
|
|
39
|
-
// which causes the table selections issue.
|
|
40
|
-
|
|
41
|
-
// The handleDOMEvents are called before ProseMirror
|
|
42
|
-
// events fired on the editable DOM element.
|
|
43
|
-
// This means the view.mouseView will not yet be
|
|
44
|
-
// created when the mousedown event starts.
|
|
45
|
-
// https://prosemirror.net/docs/ref/#view.EditorProps.handleDOMEvents
|
|
46
|
-
//
|
|
47
|
-
// Because selectionToDOM is only added to the script
|
|
48
|
-
// tasks queue following the mousedown event, we can
|
|
49
|
-
// prepend a task which will clear the mouseDown from
|
|
50
|
-
// the view. We do this using a setTimout with no
|
|
51
|
-
// interval.
|
|
52
|
-
|
|
53
|
-
if (prevMouseDownDone) {
|
|
54
|
-
// avoid memory leaks when the mouseup event is not fired
|
|
55
|
-
// in a previous mousedown event
|
|
56
|
-
prevMouseDownDone();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
setTimeout(() => {
|
|
60
|
-
// the ts-ignores here are required due to the
|
|
61
|
-
// view.mouseDown being an internal which is
|
|
62
|
-
// not part of the views type signature
|
|
63
|
-
|
|
64
|
-
// @ts-ignore
|
|
65
|
-
if (view.mouseDown) {
|
|
66
|
-
// @ts-ignore
|
|
67
|
-
prevMouseDownDone = view.mouseDown.done.bind(view.mouseDown);
|
|
68
|
-
// @ts-ignore
|
|
69
|
-
view.mouseDown = null;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
return false;
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Transaction } from 'prosemirror-state';
|
|
2
|
-
|
|
3
|
-
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
4
|
-
|
|
5
|
-
import { fireAnalytics } from './fix-tables';
|
|
6
|
-
|
|
7
|
-
// Set metadata on a ProseMirror transaction for debugging purposes in Synchrony
|
|
8
|
-
type TableProblems =
|
|
9
|
-
| 'NEGATIVE_ROWSPAN'
|
|
10
|
-
| 'REMOVE_EMPTY_ROWS'
|
|
11
|
-
| 'REMOVE_EMPTY_COLUMNS'
|
|
12
|
-
| 'EMPTY_TABLE'
|
|
13
|
-
| 'FIX_ROWSPANS'
|
|
14
|
-
| 'COLWIDTHS_BEFORE_UPDATE'
|
|
15
|
-
| 'COLWIDTHS_AFTER_UPDATE';
|
|
16
|
-
|
|
17
|
-
export type TableMetaData =
|
|
18
|
-
| { type: 'MERGE_CELLS'; problem?: TableProblems }
|
|
19
|
-
| { type: 'DELETE_ROWS'; problem?: TableProblems }
|
|
20
|
-
| { type: 'DELETE_COLUMNS'; problem?: TableProblems }
|
|
21
|
-
| {
|
|
22
|
-
type: 'UPDATE_COLUMN_WIDTHS';
|
|
23
|
-
data: { colwidths: number[]; colspan: number };
|
|
24
|
-
problem?: TableProblems;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const setMeta =
|
|
28
|
-
(meta: TableMetaData) =>
|
|
29
|
-
(tr: Transaction): Transaction => {
|
|
30
|
-
if ('problem' in meta) {
|
|
31
|
-
// Send analytics event whenever we encounter with a problem
|
|
32
|
-
fireAnalytics(meta);
|
|
33
|
-
}
|
|
34
|
-
return tr.setMeta(pluginKey, meta);
|
|
35
|
-
};
|