@atlaskit/editor-plugin-table 5.0.0 → 5.2.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 +12 -0
- package/dist/cjs/plugins/table/index.js +47 -37
- package/dist/cjs/plugins/table/nodeviews/TableCell.js +111 -0
- package/dist/cjs/plugins/table/nodeviews/TableNodeViewBase.js +30 -0
- package/dist/cjs/plugins/table/{pm-plugins/sticky-headers/nodeviews/tableRow.js → nodeviews/TableRow.js} +313 -307
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/actions.js +12 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/commands.js +27 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/consts.js +11 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/index.js +32 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin-factory.js +13 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin-key.js +8 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin.js +28 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/reducer.js +28 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/types.js +5 -0
- package/dist/cjs/plugins/table/pm-plugins/main.js +16 -13
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/index.js +1 -8
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin.js +1 -9
- package/dist/cjs/plugins/table/utils/dom.js +31 -1
- package/dist/cjs/plugins/table/utils/index.js +12 -0
- package/dist/cjs/plugins/table/utils/nodes.js +31 -7
- package/dist/es2019/plugins/table/index.js +12 -3
- package/dist/es2019/plugins/table/nodeviews/{tableCell.js → TableCell.js} +28 -24
- package/dist/es2019/plugins/table/nodeviews/TableNodeViewBase.js +22 -0
- package/dist/es2019/plugins/table/{pm-plugins/sticky-headers/nodeviews/tableRow.js → nodeviews/TableRow.js} +273 -284
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/actions.js +6 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/commands.js +14 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/consts.js +5 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/index.js +3 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin-factory.js +8 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin-key.js +2 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin.js +22 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/reducer.js +20 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/types.js +1 -0
- package/dist/es2019/plugins/table/pm-plugins/main.js +8 -8
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/index.js +1 -2
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/plugin.js +1 -9
- package/dist/es2019/plugins/table/utils/dom.js +30 -0
- package/dist/es2019/plugins/table/utils/index.js +1 -1
- package/dist/es2019/plugins/table/utils/nodes.js +16 -0
- package/dist/esm/plugins/table/index.js +47 -37
- package/dist/esm/plugins/table/nodeviews/TableCell.js +105 -0
- package/dist/esm/plugins/table/nodeviews/TableNodeViewBase.js +24 -0
- package/dist/esm/plugins/table/{pm-plugins/sticky-headers/nodeviews/tableRow.js → nodeviews/TableRow.js} +314 -307
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/actions.js +6 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/commands.js +22 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/consts.js +5 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/index.js +3 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin-factory.js +7 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin-key.js +2 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin.js +22 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/reducer.js +21 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/types.js +1 -0
- package/dist/esm/plugins/table/pm-plugins/main.js +16 -13
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/index.js +1 -2
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/plugin.js +1 -9
- package/dist/esm/plugins/table/utils/dom.js +30 -0
- package/dist/esm/plugins/table/utils/index.js +1 -1
- package/dist/esm/plugins/table/utils/nodes.js +24 -0
- package/dist/types/plugins/table/nodeviews/TableCell.d.ts +13 -0
- package/dist/types/plugins/table/nodeviews/TableNodeViewBase.d.ts +18 -0
- package/dist/types/plugins/table/nodeviews/TableRow.d.ts +60 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/actions.d.ts +15 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/commands.d.ts +4 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/consts.d.ts +6 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/index.d.ts +4 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/plugin-factory.d.ts +2 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/plugin-key.d.ts +3 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/plugin.d.ts +3 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/reducer.d.ts +4 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/types.d.ts +5 -0
- package/dist/types/plugins/table/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/index.d.ts +0 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +1 -1
- package/dist/types/plugins/table/types.d.ts +1 -0
- package/dist/types/plugins/table/utils/dom.d.ts +6 -0
- package/dist/types/plugins/table/utils/index.d.ts +1 -1
- package/dist/types/plugins/table/utils/nodes.d.ts +12 -2
- package/dist/types-ts4.5/i18n/cs.d.ts +37 -0
- package/dist/types-ts4.5/i18n/da.d.ts +35 -0
- package/dist/types-ts4.5/i18n/de.d.ts +35 -0
- package/dist/types-ts4.5/i18n/en.d.ts +37 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +37 -0
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +37 -0
- package/dist/types-ts4.5/i18n/es.d.ts +35 -0
- package/dist/types-ts4.5/i18n/fi.d.ts +35 -0
- package/dist/types-ts4.5/i18n/fr.d.ts +37 -0
- package/dist/types-ts4.5/i18n/hu.d.ts +37 -0
- package/dist/types-ts4.5/i18n/it.d.ts +37 -0
- package/dist/types-ts4.5/i18n/ja.d.ts +37 -0
- package/dist/types-ts4.5/i18n/ko.d.ts +35 -0
- package/dist/types-ts4.5/i18n/nb.d.ts +35 -0
- package/dist/types-ts4.5/i18n/nl.d.ts +37 -0
- package/dist/types-ts4.5/i18n/pl.d.ts +37 -0
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +37 -0
- package/dist/types-ts4.5/i18n/ru.d.ts +37 -0
- package/dist/types-ts4.5/i18n/sv.d.ts +35 -0
- package/dist/types-ts4.5/i18n/th.d.ts +35 -0
- package/dist/types-ts4.5/i18n/tr.d.ts +37 -0
- package/dist/types-ts4.5/i18n/uk.d.ts +37 -0
- package/dist/types-ts4.5/i18n/vi.d.ts +35 -0
- package/dist/types-ts4.5/i18n/zh.d.ts +37 -0
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +37 -0
- package/dist/types-ts4.5/index.d.ts +2 -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/delete.d.ts +3 -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 +9 -0
- package/dist/types-ts4.5/plugins/table/commands/misc.d.ts +29 -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 +25 -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 +15 -0
- package/dist/types-ts4.5/plugins/table/handlers.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/index.d.ts +38 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/OverflowShadowsObserver.d.ts +24 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableCell.d.ts +13 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +73 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableContainer.d.ts +44 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableNodeViewBase.d.ts +18 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableResizer.d.ts +25 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableRow.d.ts +60 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableStickyScrollbar.d.ts +24 -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 +33 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +26 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/update-overflow-shadows.d.ts +1 -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 +4 -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/drag-and-drop/actions.d.ts +15 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/commands.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/consts.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/plugin-factory.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/plugin-key.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/plugin.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/reducer.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/types.d.ts +5 -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 +5 -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-analytics.d.ts +23 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-local-id.d.ts +10 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/commands.d.ts +23 -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 +3 -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 +23 -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/consts.d.ts +2 -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 +12 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/index.d.ts +13 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +20 -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 +21 -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 +5 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-width.d.ts +17 -0
- package/dist/types-ts4.5/plugins/table/reducer.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/toolbar.d.ts +36 -0
- package/dist/types-ts4.5/plugins/table/transforms/column-width.d.ts +37 -0
- package/dist/types-ts4.5/plugins/table/transforms/delete-columns.d.ts +4 -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 +343 -0
- package/dist/types-ts4.5/plugins/table/ui/ColumnResizeWidget/index.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/FixedButton.d.ts +23 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/index.d.ts +21 -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 +87 -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 +13 -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 +13 -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 +39 -0
- package/dist/types-ts4.5/plugins/table/ui/common-styles.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +50 -0
- package/dist/types-ts4.5/plugins/table/ui/messages.d.ts +63 -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 +45 -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 +19 -0
- package/dist/types-ts4.5/plugins/table/utils/dom.d.ts +26 -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/guidelines.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 +23 -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/snapping.d.ts +10 -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/package.json +3 -3
- package/report.api.md +2 -17
- package/src/__tests__/unit/nodeviews/cell.ts +2 -2
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +25 -148
- package/src/plugins/table/index.tsx +14 -0
- package/src/plugins/table/nodeviews/{tableCell.tsx → TableCell.ts} +41 -46
- package/src/plugins/table/nodeviews/TableNodeViewBase.ts +32 -0
- package/src/plugins/table/{pm-plugins/sticky-headers/nodeviews/tableRow.ts → nodeviews/TableRow.ts} +193 -246
- package/src/plugins/table/pm-plugins/drag-and-drop/actions.ts +29 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/commands.ts +32 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/consts.ts +8 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/index.ts +5 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/plugin-factory.ts +8 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/plugin-key.ts +7 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/plugin.ts +32 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/reducer.ts +26 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/types.ts +6 -0
- package/src/plugins/table/pm-plugins/main.ts +10 -19
- package/src/plugins/table/pm-plugins/sticky-headers/index.ts +0 -1
- package/src/plugins/table/pm-plugins/sticky-headers/plugin.ts +1 -9
- package/src/plugins/table/types.ts +2 -0
- package/src/plugins/table/utils/dom.ts +38 -0
- package/src/plugins/table/utils/index.ts +2 -0
- package/src/plugins/table/utils/nodes.ts +30 -2
- package/tmp/api-report-tmp.d.ts +100 -0
- package/dist/cjs/plugins/table/nodeviews/tableCell.js +0 -99
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +0 -35
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +0 -29
- package/dist/esm/plugins/table/nodeviews/tableCell.js +0 -93
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +0 -29
- package/dist/types/plugins/table/nodeviews/tableCell.d.ts +0 -17
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +0 -6
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +0 -73
- package/src/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.ts +0 -37
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DragAndDropActionType } from './actions';
|
|
2
|
+
import { createCommand } from './plugin-factory';
|
|
3
|
+
|
|
4
|
+
// TODO: This command is a placeholder example. Please replace this if required.
|
|
5
|
+
export var setDropTarget = function setDropTarget(type, index, tr) {
|
|
6
|
+
return createCommand({
|
|
7
|
+
type: DragAndDropActionType.SET_DROP_TARGET,
|
|
8
|
+
data: {
|
|
9
|
+
type: type,
|
|
10
|
+
index: index
|
|
11
|
+
}
|
|
12
|
+
}, function (originalTr) {
|
|
13
|
+
return (tr || originalTr).setMeta('addToHistory', false);
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
export var clearDropTarget = function clearDropTarget(tr) {
|
|
17
|
+
return createCommand({
|
|
18
|
+
type: DragAndDropActionType.CLEAR_DROP_TARGET
|
|
19
|
+
}, function (originalTr) {
|
|
20
|
+
return (tr || originalTr).setMeta('addToHistory', false);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { pluginKey } from './plugin-key';
|
|
3
|
+
import reducer from './reducer';
|
|
4
|
+
var _pluginFactory = pluginFactory(pluginKey, reducer),
|
|
5
|
+
createPluginState = _pluginFactory.createPluginState,
|
|
6
|
+
createCommand = _pluginFactory.createCommand;
|
|
7
|
+
export { createPluginState, createCommand };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import { DropTargetType } from './consts';
|
|
3
|
+
import { createPluginState } from './plugin-factory';
|
|
4
|
+
import { pluginKey } from './plugin-key';
|
|
5
|
+
export var createPlugin = function createPlugin(dispatch, eventDispatcher) {
|
|
6
|
+
return new SafePlugin({
|
|
7
|
+
state: createPluginState(dispatch, {
|
|
8
|
+
// TODO: This is example placeholder state. We could use this to track which row/col is currently set as the drop target
|
|
9
|
+
// This would result in a blue highlight being displayed on the corrisponding row/column to single the drop target location.
|
|
10
|
+
dropTargetType: DropTargetType.NONE,
|
|
11
|
+
dropTargetIndex: 0
|
|
12
|
+
}),
|
|
13
|
+
key: pluginKey,
|
|
14
|
+
view: function view(editorView) {
|
|
15
|
+
// TODO: Add Pragmatic DnD monitor when the view is constructed.
|
|
16
|
+
return {
|
|
17
|
+
// TODO: Cleanup monitor instance
|
|
18
|
+
// destroy: cleanup,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import { DragAndDropActionType } from './actions';
|
|
5
|
+
import { DropTargetType } from './consts';
|
|
6
|
+
export default (function (pluginState, action) {
|
|
7
|
+
switch (action.type) {
|
|
8
|
+
case DragAndDropActionType.SET_DROP_TARGET:
|
|
9
|
+
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
10
|
+
dropTargetType: action.data.type,
|
|
11
|
+
dropTargetIndex: action.data.index
|
|
12
|
+
});
|
|
13
|
+
case DragAndDropActionType.CLEAR_DROP_TARGET:
|
|
14
|
+
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
15
|
+
dropTargetType: DropTargetType.NONE,
|
|
16
|
+
dropTargetIndex: 0
|
|
17
|
+
});
|
|
18
|
+
default:
|
|
19
|
+
return pluginState;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,7 +13,8 @@ import { addBoldInEmptyHeaderCells, clearHoverSelection, setTableRef } from '../
|
|
|
13
13
|
import { removeResizeHandleDecorations, transformSliceRemoveCellBackgroundColor, transformSliceToAddTableHeaders, transformSliceToRemoveColumnsWidths } from '../commands/misc';
|
|
14
14
|
import { handleBlur, handleClick, handleCut, handleFocus, handleMouseDown, handleMouseLeave, handleMouseMove, handleMouseOut, handleMouseOver, handleTripleClick, whenTableInFocus } from '../event-handlers';
|
|
15
15
|
import { createTableView } from '../nodeviews/table';
|
|
16
|
-
import
|
|
16
|
+
import TableCell from '../nodeviews/TableCell';
|
|
17
|
+
import TableRow from '../nodeviews/TableRow';
|
|
17
18
|
import { pluginKey as decorationsPluginKey } from '../pm-plugins/decorations/plugin';
|
|
18
19
|
import { fixTables, replaceSelectedTable } from '../transforms';
|
|
19
20
|
import { TableCssClassName as ClassName } from '../types';
|
|
@@ -22,7 +23,7 @@ import { isHeaderRowRequired } from '../utils/paste';
|
|
|
22
23
|
import { defaultTableSelection } from './default-table-selection';
|
|
23
24
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
24
25
|
import { pluginKey } from './plugin-key';
|
|
25
|
-
export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, breakoutEnabled, fullWidthModeEnabled, tableResizingEnabled, previousFullWidthModeEnabled, editorAnalyticsAPI, pluginInjectionApi) {
|
|
26
|
+
export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, breakoutEnabled, fullWidthModeEnabled, tableResizingEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi) {
|
|
26
27
|
var _window;
|
|
27
28
|
var state = createPluginState(dispatch, _objectSpread(_objectSpread({
|
|
28
29
|
pluginConfig: pluginConfig,
|
|
@@ -33,7 +34,8 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
33
34
|
wasFullWidthModeEnabled: previousFullWidthModeEnabled,
|
|
34
35
|
isTableResizingEnabled: tableResizingEnabled,
|
|
35
36
|
isHeaderRowEnabled: !!pluginConfig.allowHeaderRow,
|
|
36
|
-
isHeaderColumnEnabled: false
|
|
37
|
+
isHeaderColumnEnabled: false,
|
|
38
|
+
isDragAndDropEnabled: dragAndDropEnabled
|
|
37
39
|
}, defaultTableSelection), {}, {
|
|
38
40
|
getIntl: getIntl
|
|
39
41
|
}));
|
|
@@ -46,14 +48,6 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
46
48
|
elementContentRects[entry.target.id] = entry.contentRect;
|
|
47
49
|
});
|
|
48
50
|
}) : undefined;
|
|
49
|
-
var tableCellNodeview = {
|
|
50
|
-
tableCell: function tableCell(node, view, getPos) {
|
|
51
|
-
return new TableCellNodeView(node, view, getPos, observer);
|
|
52
|
-
},
|
|
53
|
-
tableHeader: function tableHeader(node, view, getPos) {
|
|
54
|
-
return new TableCellNodeView(node, view, getPos, observer);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
51
|
|
|
58
52
|
// Used to prevent invalid table cell spans being reported more than once per editor/document
|
|
59
53
|
var invalidTableIds = [];
|
|
@@ -229,11 +223,20 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
229
223
|
}
|
|
230
224
|
return false;
|
|
231
225
|
},
|
|
232
|
-
nodeViews:
|
|
226
|
+
nodeViews: {
|
|
233
227
|
table: function table(node, view, getPos) {
|
|
234
228
|
return createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, pluginInjectionApi);
|
|
229
|
+
},
|
|
230
|
+
tableRow: function tableRow(node, view, getPos) {
|
|
231
|
+
return new TableRow(node, view, getPos, eventDispatcher);
|
|
232
|
+
},
|
|
233
|
+
tableCell: function tableCell(node, view, getPos) {
|
|
234
|
+
return new TableCell(node, view, getPos, eventDispatcher, observer);
|
|
235
|
+
},
|
|
236
|
+
tableHeader: function tableHeader(node, view, getPos) {
|
|
237
|
+
return new TableCell(node, view, getPos, eventDispatcher, observer);
|
|
235
238
|
}
|
|
236
|
-
}
|
|
239
|
+
},
|
|
237
240
|
handleDOMEvents: {
|
|
238
241
|
focus: handleFocus,
|
|
239
242
|
blur: handleBlur,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { createPlugin } from './plugin';
|
|
2
2
|
export { pluginKey } from './plugin-key';
|
|
3
3
|
export { findStickyHeaderForTable } from './util';
|
|
4
|
-
export { updateStickyState, removeStickyState } from './commands';
|
|
5
|
-
export { TableRowNodeView } from './nodeviews/tableRow';
|
|
4
|
+
export { updateStickyState, removeStickyState } from './commands';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { TableRowNodeView } from './nodeviews/tableRow';
|
|
3
2
|
import { pluginKey } from './plugin-key';
|
|
4
3
|
import { createPluginState } from './plugin-state';
|
|
5
4
|
export var createPlugin = function createPlugin(dispatch, eventDispatcher) {
|
|
@@ -9,13 +8,6 @@ export var createPlugin = function createPlugin(dispatch, eventDispatcher) {
|
|
|
9
8
|
var getEditorFeatureFlags = arguments.length > 3 ? arguments[3] : undefined;
|
|
10
9
|
return new SafePlugin({
|
|
11
10
|
state: createPluginState(dispatch, initialState),
|
|
12
|
-
key: pluginKey
|
|
13
|
-
props: {
|
|
14
|
-
nodeViews: {
|
|
15
|
-
tableRow: function tableRow(node, view, getPos) {
|
|
16
|
-
return new TableRowNodeView(node, view, getPos, eventDispatcher);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
11
|
+
key: pluginKey
|
|
20
12
|
});
|
|
21
13
|
};
|
|
@@ -150,4 +150,34 @@ export var hasResizeHandler = function hasResizeHandler(_ref) {
|
|
|
150
150
|
return false;
|
|
151
151
|
}
|
|
152
152
|
return true;
|
|
153
|
+
};
|
|
154
|
+
export var getTree = function getTree(tr) {
|
|
155
|
+
// pm renders into tbody, owned by react
|
|
156
|
+
var tbody = tr.parentElement;
|
|
157
|
+
if (!tbody) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// rendered by react
|
|
162
|
+
var table = tbody.parentElement;
|
|
163
|
+
if (!table) {
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// rendered by react
|
|
168
|
+
var wrapper = table.parentElement;
|
|
169
|
+
if (!wrapper) {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
wrapper: wrapper,
|
|
174
|
+
table: table
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
export var getTop = function getTop(element) {
|
|
178
|
+
var _element$getBoundingC, _element$getBoundingC2;
|
|
179
|
+
if (!element || element instanceof Window) {
|
|
180
|
+
return 0;
|
|
181
|
+
}
|
|
182
|
+
return (_element$getBoundingC = element === null || element === void 0 || (_element$getBoundingC2 = element.getBoundingClientRect) === null || _element$getBoundingC2 === void 0 || (_element$getBoundingC2 = _element$getBoundingC2.call(element)) === null || _element$getBoundingC2 === void 0 ? void 0 : _element$getBoundingC2.top) !== null && _element$getBoundingC !== void 0 ? _element$getBoundingC : 0;
|
|
153
183
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { getSelectedColumnIndexes, getSelectedRowIndexes, normalizeSelection, isSelectionUpdated } from './selection';
|
|
2
2
|
export { findControlsHoverDecoration, createControlsHoverDecoration, createColumnControlsDecoration, createColumnSelectedDecoration, createCellHoverDecoration, updateDecorations, createResizeHandleDecoration, createColumnLineResize } from './decoration';
|
|
3
|
-
export { isIsolating, containsHeaderColumn, containsHeaderRow, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isLayoutSupported, getTableWidth, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns, isTableNested } from './nodes';
|
|
3
|
+
export { isIsolating, containsHeaderColumn, containsHeaderRow, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isLayoutSupported, getTableWidth, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns, isTableNested, anyChildCellMergedAcrossRow, supportedHeaderRow } from './nodes';
|
|
4
4
|
export { unwrapContentFromTable, removeTableFromFirstChild, removeTableFromLastChild, transformSliceToRemoveOpenTable, transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell } from './paste';
|
|
5
5
|
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowControlsButton, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler } from './dom';
|
|
6
6
|
export { getColumnsWidths, isColumnDeleteButtonVisible, getColumnDeleteButtonParams, getColumnClassNames } from './column-controls';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import { mapChildren } from '@atlaskit/editor-common/utils';
|
|
2
3
|
import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
3
4
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
4
5
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
@@ -104,4 +105,27 @@ export var isTableNested = function isTableNested(state) {
|
|
|
104
105
|
var parent = state.doc.resolve(tablePos).parent;
|
|
105
106
|
var nodeTypes = state.schema.nodes;
|
|
106
107
|
return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension;
|
|
108
|
+
};
|
|
109
|
+
export var anyChildCellMergedAcrossRow = function anyChildCellMergedAcrossRow(node) {
|
|
110
|
+
return mapChildren(node, function (child) {
|
|
111
|
+
return child.attrs.rowspan || 0;
|
|
112
|
+
}).some(function (rowspan) {
|
|
113
|
+
return rowspan > 1;
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Check if a given node is a header row with this definition:
|
|
119
|
+
* - all children are tableHeader cells
|
|
120
|
+
* - no table cells have been have merged with other table row cells
|
|
121
|
+
*
|
|
122
|
+
* @param node ProseMirror node
|
|
123
|
+
* @return boolean if it meets definition
|
|
124
|
+
*/
|
|
125
|
+
export var supportedHeaderRow = function supportedHeaderRow(node) {
|
|
126
|
+
var allHeaders = mapChildren(node, function (child) {
|
|
127
|
+
return child.type.name === 'tableHeader';
|
|
128
|
+
}).every(Boolean);
|
|
129
|
+
var someMerged = anyChildCellMergedAcrossRow(node);
|
|
130
|
+
return allHeaders && !someMerged;
|
|
107
131
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import TableNodeView from './TableNodeViewBase';
|
|
5
|
+
export default class TableCell extends TableNodeView<HTMLElement> implements NodeView {
|
|
6
|
+
private readonly observer?;
|
|
7
|
+
constructor(node: PMNode, view: EditorView, getPos: () => number | undefined, eventDispatcher: EventDispatcher, observer?: ResizeObserver | undefined);
|
|
8
|
+
private isStickyHeaderEnabled;
|
|
9
|
+
private isDragAndDropEnabled;
|
|
10
|
+
update(node: PMNode): boolean;
|
|
11
|
+
destroy(): void;
|
|
12
|
+
private updateNodeView;
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
export default abstract class TableNodeView<T extends HTMLElement> implements NodeView {
|
|
5
|
+
protected node: PmNode;
|
|
6
|
+
protected readonly view: EditorView;
|
|
7
|
+
protected readonly getPos: () => number | undefined;
|
|
8
|
+
protected readonly eventDispatcher: EventDispatcher;
|
|
9
|
+
/**
|
|
10
|
+
* @constructor
|
|
11
|
+
*/
|
|
12
|
+
constructor(node: PmNode, view: EditorView, getPos: () => number | undefined, eventDispatcher: EventDispatcher);
|
|
13
|
+
/**
|
|
14
|
+
* Variables
|
|
15
|
+
*/
|
|
16
|
+
dom: T;
|
|
17
|
+
contentDOM: T;
|
|
18
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import TableNodeView from './TableNodeViewBase';
|
|
5
|
+
export default class TableRow extends TableNodeView<HTMLTableRowElement> implements NodeView {
|
|
6
|
+
constructor(node: PMNode, view: EditorView, getPos: () => number | undefined, eventDispatcher: EventDispatcher);
|
|
7
|
+
/**
|
|
8
|
+
* Variables
|
|
9
|
+
*/
|
|
10
|
+
private isHeaderRow;
|
|
11
|
+
private isStickyHeaderEnabled;
|
|
12
|
+
private isDragAndDropEnabled;
|
|
13
|
+
private editorScrollableElement?;
|
|
14
|
+
private colControlsOffset;
|
|
15
|
+
private focused;
|
|
16
|
+
private topPosEditorElement;
|
|
17
|
+
private isSticky;
|
|
18
|
+
private lastStickyTimestamp;
|
|
19
|
+
private intersectionObserver?;
|
|
20
|
+
private resizeObserver?;
|
|
21
|
+
private sentinels;
|
|
22
|
+
private stickyRowHeight?;
|
|
23
|
+
private listening;
|
|
24
|
+
private padding;
|
|
25
|
+
private top;
|
|
26
|
+
/**
|
|
27
|
+
* Methods: Nodeview Lifecycle
|
|
28
|
+
*/
|
|
29
|
+
update(node: PMNode, ..._args: any[]): boolean;
|
|
30
|
+
destroy(): void;
|
|
31
|
+
ignoreMutation(mutationRecord: MutationRecord | {
|
|
32
|
+
type: 'selection';
|
|
33
|
+
target: Element;
|
|
34
|
+
}): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Methods
|
|
37
|
+
*/
|
|
38
|
+
private headerRowMouseScrollEnd;
|
|
39
|
+
private headerRowMouseScroll;
|
|
40
|
+
private subscribe;
|
|
41
|
+
private unsubscribe;
|
|
42
|
+
private initObservers;
|
|
43
|
+
private createResizeObserver;
|
|
44
|
+
private createIntersectionObserver;
|
|
45
|
+
private onTablePluginState;
|
|
46
|
+
private updateStickyHeaderWidth;
|
|
47
|
+
/**
|
|
48
|
+
* Manually refire the intersection observers.
|
|
49
|
+
* Useful when the header may have detached from the table.
|
|
50
|
+
*/
|
|
51
|
+
private refireIntersectionObservers;
|
|
52
|
+
private makeHeaderRowSticky;
|
|
53
|
+
private makeRowHeaderNotSticky;
|
|
54
|
+
private getWrapperoffset;
|
|
55
|
+
private getWrapperRefTop;
|
|
56
|
+
private getScrolledTableTop;
|
|
57
|
+
private getCurrentTableTop;
|
|
58
|
+
private emitOn;
|
|
59
|
+
private emitOff;
|
|
60
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DropTargetType } from './consts';
|
|
2
|
+
export interface DragAndDropAction<T, D> {
|
|
3
|
+
type: T;
|
|
4
|
+
data: D;
|
|
5
|
+
}
|
|
6
|
+
export declare const DragAndDropActionType: {
|
|
7
|
+
readonly SET_DROP_TARGET: "SET_DROP_TARGET";
|
|
8
|
+
readonly CLEAR_DROP_TARGET: "CLEAR_DROP_TARGET";
|
|
9
|
+
};
|
|
10
|
+
export type DragAndDropSetDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.SET_DROP_TARGET, {
|
|
11
|
+
type: DropTargetType;
|
|
12
|
+
index: number;
|
|
13
|
+
}>;
|
|
14
|
+
export type DragAndDropClearDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.CLEAR_DROP_TARGET, undefined>;
|
|
15
|
+
export type DragAndDropPluginAction = DragAndDropSetDropTargetAction | DragAndDropClearDropTargetAction;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { DropTargetType } from './consts';
|
|
3
|
+
export declare const setDropTarget: (type: DropTargetType, index: number, tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
|
|
4
|
+
export declare const clearDropTarget: (tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("./types").DragAndDropPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState)) => import("prosemirror-state").SafeStateField<import("./types").DragAndDropPluginState>, createCommand: <A = import("./actions").DragAndDropPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
2
|
+
export { createPluginState, createCommand };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
export declare const createPlugin: (dispatch: Dispatch, eventDispatcher: EventDispatcher) => SafePlugin<import("./types").DragAndDropPluginState>;
|
|
@@ -5,4 +5,4 @@ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider'
|
|
|
5
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
6
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { PluginConfig, PluginInjectionAPI } from '../types';
|
|
8
|
-
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, breakoutEnabled?: boolean, fullWidthModeEnabled?: boolean, tableResizingEnabled?: boolean, previousFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI) => SafePlugin<import("../types").TablePluginState>;
|
|
8
|
+
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, breakoutEnabled?: boolean, fullWidthModeEnabled?: boolean, tableResizingEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI) => SafePlugin<import("../types").TablePluginState>;
|
|
@@ -3,4 +3,3 @@ export { pluginKey } from './plugin-key';
|
|
|
3
3
|
export type { StickyPluginState, RowStickyState } from './types';
|
|
4
4
|
export { findStickyHeaderForTable } from './util';
|
|
5
5
|
export { updateStickyState, removeStickyState } from './commands';
|
|
6
|
-
export { TableRowNodeView } from './nodeviews/tableRow';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
1
|
+
import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
4
|
export declare const createPlugin: (dispatch: Dispatch, eventDispatcher: EventDispatcher, initialState: (() => never[]) | undefined, getEditorFeatureFlags: GetEditorFeatureFlags) => SafePlugin<import("./types").StickyPluginState>;
|
|
@@ -15,3 +15,9 @@ export declare const hasResizeHandler: ({ columnEndIndexTarget, target, }: {
|
|
|
15
15
|
columnEndIndexTarget: number;
|
|
16
16
|
target: HTMLElement;
|
|
17
17
|
}) => boolean;
|
|
18
|
+
export type TableDOMElements = {
|
|
19
|
+
wrapper: HTMLDivElement;
|
|
20
|
+
table: HTMLTableElement;
|
|
21
|
+
};
|
|
22
|
+
export declare const getTree: (tr: HTMLTableRowElement) => TableDOMElements | null;
|
|
23
|
+
export declare const getTop: (element: HTMLElement | Window | undefined) => number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { getSelectedColumnIndexes, getSelectedRowIndexes, normalizeSelection, isSelectionUpdated, } from './selection';
|
|
2
2
|
export { findControlsHoverDecoration, createControlsHoverDecoration, createColumnControlsDecoration, createColumnSelectedDecoration, createCellHoverDecoration, updateDecorations, createResizeHandleDecoration, createColumnLineResize, } from './decoration';
|
|
3
|
-
export { isIsolating, containsHeaderColumn, containsHeaderRow, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isLayoutSupported, getTableWidth, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns, isTableNested, } from './nodes';
|
|
3
|
+
export { isIsolating, containsHeaderColumn, containsHeaderRow, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isLayoutSupported, getTableWidth, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns, isTableNested, anyChildCellMergedAcrossRow, supportedHeaderRow, } from './nodes';
|
|
4
4
|
export { unwrapContentFromTable, removeTableFromFirstChild, removeTableFromLastChild, transformSliceToRemoveOpenTable, transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell, } from './paste';
|
|
5
5
|
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowControlsButton, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler, } from './dom';
|
|
6
6
|
export { getColumnsWidths, isColumnDeleteButtonVisible, getColumnDeleteButtonParams, getColumnClassNames, } from './column-controls';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
1
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare const isIsolating: (node: PmNode) => boolean;
|
|
4
4
|
export declare const containsHeaderColumn: (table: PmNode) => boolean;
|
|
5
5
|
export declare const containsHeaderRow: (table: PmNode) => boolean;
|
|
@@ -11,3 +11,13 @@ export declare const getTableWidth: (node: PmNode) => number;
|
|
|
11
11
|
export declare const tablesHaveDifferentColumnWidths: (currentTable: PmNode, previousTable: PmNode) => boolean;
|
|
12
12
|
export declare const tablesHaveDifferentNoOfColumns: (currentTable: PmNode, previousTable: PmNode) => boolean;
|
|
13
13
|
export declare const isTableNested: (state: EditorState, tablePos?: number) => boolean;
|
|
14
|
+
export declare const anyChildCellMergedAcrossRow: (node: PmNode) => boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Check if a given node is a header row with this definition:
|
|
17
|
+
* - all children are tableHeader cells
|
|
18
|
+
* - no table cells have been have merged with other table row cells
|
|
19
|
+
*
|
|
20
|
+
* @param node ProseMirror node
|
|
21
|
+
* @return boolean if it meets definition
|
|
22
|
+
*/
|
|
23
|
+
export declare const supportedHeaderRow: (node: PmNode) => boolean;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NOTE:
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by Traduki 2.0.
|
|
5
|
+
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: {
|
|
8
|
+
'fabric.editor.canNotSortTable': string;
|
|
9
|
+
'fabric.editor.cellBackground': string;
|
|
10
|
+
'fabric.editor.cellOptions': string;
|
|
11
|
+
'fabric.editor.clearCells': string;
|
|
12
|
+
'fabric.editor.collapseTable': string;
|
|
13
|
+
'fabric.editor.cornerControl': string;
|
|
14
|
+
'fabric.editor.distributeColumns': string;
|
|
15
|
+
'fabric.editor.extension.confirmDeleteLinkedModalMessagePrefix': string;
|
|
16
|
+
'fabric.editor.extension.deleteElementTitle': string;
|
|
17
|
+
'fabric.editor.extension.sourceNoTitledName': string;
|
|
18
|
+
'fabric.editor.floatingToolbar.confirmModalCheckboxLabel': string;
|
|
19
|
+
'fabric.editor.headerColumn': string;
|
|
20
|
+
'fabric.editor.headerRow': string;
|
|
21
|
+
'fabric.editor.insertColumn': string;
|
|
22
|
+
'fabric.editor.insertRow': string;
|
|
23
|
+
'fabric.editor.mergeCells': string;
|
|
24
|
+
'fabric.editor.numberedColumn': string;
|
|
25
|
+
'fabric.editor.removeColumns': string;
|
|
26
|
+
'fabric.editor.removeRows': string;
|
|
27
|
+
'fabric.editor.rowControl': string;
|
|
28
|
+
'fabric.editor.sortColumnASC': string;
|
|
29
|
+
'fabric.editor.sortColumnDESC': string;
|
|
30
|
+
'fabric.editor.splitCell': string;
|
|
31
|
+
'fabric.editor.tableOptions': string;
|
|
32
|
+
'fabric.editor.tables.adjustColumn': string;
|
|
33
|
+
'fabric.editor.tables.confirmDeleteLinkedModalMessage': string;
|
|
34
|
+
'fabric.editor.tables.confirmDeleteLinkedModalOKButton': string;
|
|
35
|
+
'fabric.editor.tables.resizeTable': string;
|
|
36
|
+
};
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NOTE:
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by Traduki 2.0.
|
|
5
|
+
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: {
|
|
8
|
+
'fabric.editor.canNotSortTable': string;
|
|
9
|
+
'fabric.editor.cellBackground': string;
|
|
10
|
+
'fabric.editor.cellOptions': string;
|
|
11
|
+
'fabric.editor.clearCells': string;
|
|
12
|
+
'fabric.editor.collapseTable': string;
|
|
13
|
+
'fabric.editor.cornerControl': string;
|
|
14
|
+
'fabric.editor.distributeColumns': string;
|
|
15
|
+
'fabric.editor.extension.deleteElementTitle': string;
|
|
16
|
+
'fabric.editor.floatingToolbar.confirmModalCheckboxLabel': string;
|
|
17
|
+
'fabric.editor.headerColumn': string;
|
|
18
|
+
'fabric.editor.headerRow': string;
|
|
19
|
+
'fabric.editor.insertColumn': string;
|
|
20
|
+
'fabric.editor.insertRow': string;
|
|
21
|
+
'fabric.editor.mergeCells': string;
|
|
22
|
+
'fabric.editor.numberedColumn': string;
|
|
23
|
+
'fabric.editor.removeColumns': string;
|
|
24
|
+
'fabric.editor.removeRows': string;
|
|
25
|
+
'fabric.editor.rowControl': string;
|
|
26
|
+
'fabric.editor.sortColumnASC': string;
|
|
27
|
+
'fabric.editor.sortColumnDESC': string;
|
|
28
|
+
'fabric.editor.splitCell': string;
|
|
29
|
+
'fabric.editor.tableOptions': string;
|
|
30
|
+
'fabric.editor.tables.adjustColumn': string;
|
|
31
|
+
'fabric.editor.tables.confirmDeleteLinkedModalMessage': string;
|
|
32
|
+
'fabric.editor.tables.confirmDeleteLinkedModalOKButton': string;
|
|
33
|
+
'fabric.editor.tables.resizeTable': string;
|
|
34
|
+
};
|
|
35
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NOTE:
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by Traduki 2.0.
|
|
5
|
+
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: {
|
|
8
|
+
'fabric.editor.canNotSortTable': string;
|
|
9
|
+
'fabric.editor.cellBackground': string;
|
|
10
|
+
'fabric.editor.cellOptions': string;
|
|
11
|
+
'fabric.editor.clearCells': string;
|
|
12
|
+
'fabric.editor.collapseTable': string;
|
|
13
|
+
'fabric.editor.cornerControl': string;
|
|
14
|
+
'fabric.editor.distributeColumns': string;
|
|
15
|
+
'fabric.editor.extension.deleteElementTitle': string;
|
|
16
|
+
'fabric.editor.floatingToolbar.confirmModalCheckboxLabel': string;
|
|
17
|
+
'fabric.editor.headerColumn': string;
|
|
18
|
+
'fabric.editor.headerRow': string;
|
|
19
|
+
'fabric.editor.insertColumn': string;
|
|
20
|
+
'fabric.editor.insertRow': string;
|
|
21
|
+
'fabric.editor.mergeCells': string;
|
|
22
|
+
'fabric.editor.numberedColumn': string;
|
|
23
|
+
'fabric.editor.removeColumns': string;
|
|
24
|
+
'fabric.editor.removeRows': string;
|
|
25
|
+
'fabric.editor.rowControl': string;
|
|
26
|
+
'fabric.editor.sortColumnASC': string;
|
|
27
|
+
'fabric.editor.sortColumnDESC': string;
|
|
28
|
+
'fabric.editor.splitCell': string;
|
|
29
|
+
'fabric.editor.tableOptions': string;
|
|
30
|
+
'fabric.editor.tables.adjustColumn': string;
|
|
31
|
+
'fabric.editor.tables.confirmDeleteLinkedModalMessage': string;
|
|
32
|
+
'fabric.editor.tables.confirmDeleteLinkedModalOKButton': string;
|
|
33
|
+
'fabric.editor.tables.resizeTable': string;
|
|
34
|
+
};
|
|
35
|
+
export default _default;
|