@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,29 @@
|
|
|
1
|
+
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
2
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
6
|
+
import type { ResizeState, ResizeStateWithAnalytics } from './types';
|
|
7
|
+
export declare const getResizeState: ({ minWidth, maxSize, table, tableRef, start, domAtPos, }: {
|
|
8
|
+
minWidth: number;
|
|
9
|
+
maxSize: number;
|
|
10
|
+
table: PMNode;
|
|
11
|
+
tableRef: HTMLTableElement;
|
|
12
|
+
start: number;
|
|
13
|
+
domAtPos: (pos: number) => {
|
|
14
|
+
node: Node;
|
|
15
|
+
offset: number;
|
|
16
|
+
};
|
|
17
|
+
}) => ResizeState;
|
|
18
|
+
export declare const updateColgroup: (state: ResizeState, tableRef: HTMLElement) => void;
|
|
19
|
+
export declare const getTotalWidth: ({ cols }: ResizeState) => number;
|
|
20
|
+
export declare const adjustColumnsWidths: (resizeState: ResizeState, maxSize: number) => ResizeState;
|
|
21
|
+
export declare const evenAllColumnsWidths: (resizeState: ResizeState) => ResizeState;
|
|
22
|
+
export declare const evenSelectedColumnsWidths: (resizeState: ResizeState, rect: Rect) => ResizeState;
|
|
23
|
+
export declare const bulkColumnsResize: (resizeState: ResizeState, columnsIndexes: number[], sourceColumnIndex: number) => ResizeState;
|
|
24
|
+
export declare const areColumnsEven: (resizeState: ResizeState) => boolean;
|
|
25
|
+
export declare const normaliseTableLayout: (input: string | undefined | null) => TableLayout;
|
|
26
|
+
export declare const getNewResizeStateFromSelectedColumns: (rect: Rect, state: EditorState, domAtPos: (pos: number) => {
|
|
27
|
+
node: Node;
|
|
28
|
+
offset: number;
|
|
29
|
+
}, getEditorContainerWidth: GetEditorContainerWidth) => ResizeStateWithAnalytics | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { DomAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
+
import type { ResizeState } from '../utils/types';
|
|
5
|
+
export interface ScaleOptions {
|
|
6
|
+
node: PMNode;
|
|
7
|
+
prevNode: PMNode;
|
|
8
|
+
start: number;
|
|
9
|
+
containerWidth?: number;
|
|
10
|
+
previousContainerWidth?: number;
|
|
11
|
+
parentWidth?: number;
|
|
12
|
+
layoutChanged?: boolean;
|
|
13
|
+
isBreakoutEnabled?: boolean;
|
|
14
|
+
isFullWidthModeEnabled?: boolean;
|
|
15
|
+
isTableResizingEnabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const scale: (tableRef: HTMLTableElement, options: ScaleOptions, domAtPos: DomAtPos) => ResizeState | undefined;
|
|
18
|
+
export declare const scaleWithParent: (tableRef: HTMLTableElement, parentWidth: number, table: PMNode, start: number, domAtPos: DomAtPos) => ResizeState;
|
|
19
|
+
export declare function scaleTableTo(state: ResizeState, maxSize: number): ResizeState;
|
|
20
|
+
export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos) => void;
|
|
21
|
+
export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos) => (tr: Transaction) => Transaction;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
2
|
+
import { ColumnState } from './column-state';
|
|
3
|
+
export interface ResizeState {
|
|
4
|
+
cols: ColumnState[];
|
|
5
|
+
widths: number[];
|
|
6
|
+
maxSize: number;
|
|
7
|
+
overflow: boolean;
|
|
8
|
+
tableWidth: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ResizeStateWithAnalytics {
|
|
11
|
+
resizeState: ResizeState;
|
|
12
|
+
table: ContentNodeWithPos;
|
|
13
|
+
changed: boolean;
|
|
14
|
+
attributes: {
|
|
15
|
+
position: number;
|
|
16
|
+
count: number;
|
|
17
|
+
totalRowCount: number;
|
|
18
|
+
totalColumnCount: number;
|
|
19
|
+
widthsBefore: number[];
|
|
20
|
+
widthsAfter: number[];
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const unitToNumber: (unit: string | null) => number;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type tablePlugin from '../index';
|
|
4
|
+
export declare function tableSelectionKeymapPlugin(editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined): SafePlugin;
|
|
5
|
+
export default tableSelectionKeymapPlugin;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A plugin for handle table custom widths
|
|
3
|
+
* Has login to scan the document, add width value to table's width attribute when necessary
|
|
4
|
+
* Also holds resizing state to hide / show table controls
|
|
5
|
+
*/
|
|
6
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
8
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
9
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
10
|
+
type TableWidthPluginState = {
|
|
11
|
+
resizing: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const pluginKey: PluginKey<TableWidthPluginState>;
|
|
14
|
+
declare const createPlugin: (dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, fullWidthEnabled: boolean) => SafePlugin<{
|
|
15
|
+
resizing: boolean;
|
|
16
|
+
}>;
|
|
17
|
+
export { createPlugin };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { Command, FloatingToolbarDropdown, FloatingToolbarHandler, FloatingToolbarItem, GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
6
|
+
import type { PluginConfig, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState } from './types';
|
|
7
|
+
export declare const messages: {
|
|
8
|
+
tableOptions: {
|
|
9
|
+
id: string;
|
|
10
|
+
defaultMessage: string;
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
headerRow: {
|
|
14
|
+
id: string;
|
|
15
|
+
defaultMessage: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
headerColumn: {
|
|
19
|
+
id: string;
|
|
20
|
+
defaultMessage: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
numberedColumn: {
|
|
24
|
+
id: string;
|
|
25
|
+
defaultMessage: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
collapseTable: {
|
|
29
|
+
id: string;
|
|
30
|
+
defaultMessage: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarItem<Command>;
|
|
35
|
+
export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarDropdown<Command>;
|
|
36
|
+
export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import type { ResizeState } from '../pm-plugins/table-resizing/utils';
|
|
7
|
+
/**
|
|
8
|
+
* Given a new ResizeState object, create a transaction that replaces and updates the table node based on new state.
|
|
9
|
+
* @param resizeState
|
|
10
|
+
* @param table
|
|
11
|
+
* @param start
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare const updateColumnWidths: (resizeState: ResizeState, table: PMNode, start: number) => (tr: Transaction) => Transaction;
|
|
15
|
+
/**
|
|
16
|
+
* This function is called when user inserts/deletes a column in a table to;
|
|
17
|
+
* - rescale all columns (if the table did not overflow before the insertion)
|
|
18
|
+
* - and update column widths.
|
|
19
|
+
*
|
|
20
|
+
* This is done manually to avoid a multi-dispatch in TableComponent. See [ED-8288].
|
|
21
|
+
* @param table
|
|
22
|
+
* @param view
|
|
23
|
+
* @returns Updated transaction with rescaled columns for a given table
|
|
24
|
+
*/
|
|
25
|
+
export declare const rescaleColumnsNew: () => (table: ContentNodeWithPos, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
26
|
+
/**
|
|
27
|
+
* This function is called when user inserts/deletes a column in a table to;
|
|
28
|
+
* - rescale all columns (if the table did not overflow before the insertion)
|
|
29
|
+
* - and update column widths.
|
|
30
|
+
*
|
|
31
|
+
* This is done manually to avoid a multi-dispatch in TableComponent. See [ED-8288].
|
|
32
|
+
* @param table
|
|
33
|
+
* @param view
|
|
34
|
+
* @returns Updated transaction with rescaled columns for a given table
|
|
35
|
+
*/
|
|
36
|
+
export declare const rescaleColumnsOld: (getEditorContainerWidth: GetEditorContainerWidth) => (table: ContentNodeWithPos, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
37
|
+
export declare const rescaleColumns: (getEditorContainerWidth?: GetEditorContainerWidth) => (table: ContentNodeWithPos, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
+
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
4
|
+
export declare const deleteColumns: (rect: Rect, allowCustomStep: boolean, view?: EditorView) => (tr: Transaction) => Transaction;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import { ReportInvalidNodeAttrs } from '../types';
|
|
5
|
+
export declare const removeExtraneousColumnWidths: (node: PMNode, basePos: number, tr: Transaction, reportInvalidTableCellSpanAttrs?: ReportInvalidNodeAttrs) => boolean;
|
|
6
|
+
export declare const fixTables: (tr: Transaction, reportInvalidTableCellSpanAttrs?: ReportInvalidNodeAttrs) => Transaction | undefined;
|
|
7
|
+
export declare const fixAutoSizedTable: (view: EditorView, tableNode: PMNode, tableRef: HTMLTableElement, tablePos: number, opts: {
|
|
8
|
+
containerWidth: number;
|
|
9
|
+
}) => Transaction;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { fixTables, fixAutoSizedTable } from './fix-tables';
|
|
2
|
+
export { mergeCells, canMergeCells, mergeEmptyColumns } from './merge';
|
|
3
|
+
export { deleteColumns } from './delete-columns';
|
|
4
|
+
export { deleteRows } from './delete-rows';
|
|
5
|
+
export { updateColumnWidths } from './column-width';
|
|
6
|
+
export { replaceSelectedTable } from './replace-table';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
export declare function mergeCells(tr: Transaction): Transaction;
|
|
4
|
+
export declare function canMergeCells(tr: Transaction): boolean;
|
|
5
|
+
export declare function mergeEmptyColumns(table: PMNode): PMNode | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
export declare const replaceSelectedTable: (state: EditorState, content: string | Slice, inputMethod: INPUT_METHOD.KEYBOARD | INPUT_METHOD.CLIPBOARD, editorAnalyticsAPI?: EditorAnalyticsAPI) => Transaction;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
/**
|
|
3
|
+
* Helper to split all the cells in a range of columns
|
|
4
|
+
* @param tr
|
|
5
|
+
* @param tablePos
|
|
6
|
+
* @param columnStart - Start of the rect included (rect.left)
|
|
7
|
+
* @param columnEnd - End of the rect not included (rect.right)
|
|
8
|
+
*/
|
|
9
|
+
export declare function splitCellsInColumns(tr: Transaction, tablePos: number, columnStart: number, columnEnd: number): Transaction;
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
3
|
+
import type { TableColumnOrdering } from '@atlaskit/custom-steps';
|
|
4
|
+
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
8
|
+
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
+
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
10
|
+
import type tablePlugin from './index';
|
|
11
|
+
export declare const RESIZE_HANDLE_AREA_DECORATION_GAP = 30;
|
|
12
|
+
export type RowInsertPosition = 'TOP' | 'BOTTOM';
|
|
13
|
+
export type PermittedLayoutsDescriptor = TableLayout[] | 'all';
|
|
14
|
+
export type Cell = {
|
|
15
|
+
pos: number;
|
|
16
|
+
start: number;
|
|
17
|
+
node: PmNode;
|
|
18
|
+
};
|
|
19
|
+
export type CellTransform = (cell: Cell) => (tr: Transaction) => Transaction;
|
|
20
|
+
export interface InsertRowOptions {
|
|
21
|
+
index: number;
|
|
22
|
+
moveCursorToInsertedRow: boolean;
|
|
23
|
+
}
|
|
24
|
+
export type PluginInjectionAPI = ExtractInjectionAPI<typeof tablePlugin>;
|
|
25
|
+
export type InsertRowMethods = INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB;
|
|
26
|
+
export interface PluginConfig {
|
|
27
|
+
advanced?: boolean;
|
|
28
|
+
allowBackgroundColor?: boolean;
|
|
29
|
+
allowColumnResizing?: boolean;
|
|
30
|
+
allowHeaderColumn?: boolean;
|
|
31
|
+
allowHeaderRow?: boolean;
|
|
32
|
+
allowMergeCells?: boolean;
|
|
33
|
+
allowNumberColumn?: boolean;
|
|
34
|
+
allowColumnSorting?: boolean;
|
|
35
|
+
allowAddColumnWithCustomStep?: boolean;
|
|
36
|
+
allowCollapse?: boolean;
|
|
37
|
+
isHeaderRowRequired?: boolean;
|
|
38
|
+
permittedLayouts?: PermittedLayoutsDescriptor;
|
|
39
|
+
allowControls?: boolean;
|
|
40
|
+
stickyHeaders?: boolean;
|
|
41
|
+
allowCellOptionsInFloatingToolbar?: boolean;
|
|
42
|
+
allowDistributeColumns?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export type { ColumnResizingPluginState } from '@atlaskit/editor-common/types';
|
|
45
|
+
export type CellColumnPositioning = Pick<Rect, 'right' | 'left'>;
|
|
46
|
+
export interface TablePluginState {
|
|
47
|
+
editorHasFocus?: boolean;
|
|
48
|
+
hoveredColumns: number[];
|
|
49
|
+
hoveredRows: number[];
|
|
50
|
+
pluginConfig: PluginConfig;
|
|
51
|
+
isHeaderColumnEnabled: boolean;
|
|
52
|
+
isHeaderRowEnabled: boolean;
|
|
53
|
+
isNumberColumnEnabled?: boolean;
|
|
54
|
+
targetCellPosition?: number;
|
|
55
|
+
tableNode?: PmNode;
|
|
56
|
+
tableRef?: HTMLTableElement;
|
|
57
|
+
tablePos?: number;
|
|
58
|
+
tableWrapperTarget?: HTMLElement;
|
|
59
|
+
isContextualMenuOpen?: boolean;
|
|
60
|
+
isInDanger?: boolean;
|
|
61
|
+
insertColumnButtonIndex?: number;
|
|
62
|
+
insertRowButtonIndex?: number;
|
|
63
|
+
isFullWidthModeEnabled?: boolean;
|
|
64
|
+
layout?: TableLayout;
|
|
65
|
+
ordering?: TableColumnOrdering;
|
|
66
|
+
isResizeHandleWidgetAdded?: boolean;
|
|
67
|
+
resizeHandleRowIndex?: number;
|
|
68
|
+
resizeHandleColumnIndex?: number;
|
|
69
|
+
resizeHandleIncludeTooltip?: boolean;
|
|
70
|
+
isTableCollapsed?: boolean;
|
|
71
|
+
canCollapseTable?: boolean;
|
|
72
|
+
getIntl: () => IntlShape;
|
|
73
|
+
isBreakoutEnabled?: boolean;
|
|
74
|
+
wasFullWidthModeEnabled?: boolean;
|
|
75
|
+
isTableResizingEnabled?: boolean;
|
|
76
|
+
isDragAndDropEnabled?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export type TablePluginAction = {
|
|
79
|
+
type: 'SET_EDITOR_FOCUS';
|
|
80
|
+
data: {
|
|
81
|
+
editorHasFocus: boolean;
|
|
82
|
+
};
|
|
83
|
+
} | {
|
|
84
|
+
type: 'TOGGLE_HEADER_ROW';
|
|
85
|
+
} | {
|
|
86
|
+
type: 'TOGGLE_HEADER_COLUMN';
|
|
87
|
+
} | {
|
|
88
|
+
type: 'SORT_TABLE';
|
|
89
|
+
data: {
|
|
90
|
+
ordering: TableColumnOrdering;
|
|
91
|
+
};
|
|
92
|
+
} | {
|
|
93
|
+
type: 'SET_TABLE_REF';
|
|
94
|
+
data: {
|
|
95
|
+
tableRef?: HTMLTableElement;
|
|
96
|
+
tableNode?: PmNode;
|
|
97
|
+
tableWrapperTarget?: HTMLElement;
|
|
98
|
+
layout: TableLayout;
|
|
99
|
+
isHeaderRowEnabled: boolean;
|
|
100
|
+
isHeaderColumnEnabled: boolean;
|
|
101
|
+
};
|
|
102
|
+
} | {
|
|
103
|
+
type: 'HOVER_ROWS';
|
|
104
|
+
data: {
|
|
105
|
+
decorationSet: DecorationSet;
|
|
106
|
+
hoveredRows: number[];
|
|
107
|
+
isInDanger?: boolean;
|
|
108
|
+
};
|
|
109
|
+
} | {
|
|
110
|
+
type: 'HOVER_CELLS';
|
|
111
|
+
data: {
|
|
112
|
+
decorationSet: DecorationSet;
|
|
113
|
+
};
|
|
114
|
+
} | {
|
|
115
|
+
type: 'HOVER_COLUMNS';
|
|
116
|
+
data: {
|
|
117
|
+
decorationSet: DecorationSet;
|
|
118
|
+
hoveredColumns: number[];
|
|
119
|
+
isInDanger?: boolean;
|
|
120
|
+
};
|
|
121
|
+
} | {
|
|
122
|
+
type: 'HOVER_TABLE';
|
|
123
|
+
data: {
|
|
124
|
+
decorationSet: DecorationSet;
|
|
125
|
+
hoveredRows: number[];
|
|
126
|
+
hoveredColumns: number[];
|
|
127
|
+
isInDanger?: boolean;
|
|
128
|
+
};
|
|
129
|
+
} | {
|
|
130
|
+
type: 'ADD_RESIZE_HANDLE_DECORATIONS';
|
|
131
|
+
data: {
|
|
132
|
+
decorationSet: DecorationSet;
|
|
133
|
+
resizeHandleRowIndex: number;
|
|
134
|
+
resizeHandleColumnIndex: number;
|
|
135
|
+
resizeHandleIncludeTooltip: boolean;
|
|
136
|
+
};
|
|
137
|
+
} | {
|
|
138
|
+
type: 'UPDATE_RESIZE_HANDLE_DECORATIONS';
|
|
139
|
+
data: {
|
|
140
|
+
decorationSet: DecorationSet;
|
|
141
|
+
resizeHandleRowIndex: number | undefined;
|
|
142
|
+
resizeHandleColumnIndex: number | undefined;
|
|
143
|
+
resizeHandleIncludeTooltip: boolean | undefined;
|
|
144
|
+
};
|
|
145
|
+
} | {
|
|
146
|
+
type: 'REMOVE_RESIZE_HANDLE_DECORATIONS';
|
|
147
|
+
data: {
|
|
148
|
+
decorationSet: DecorationSet;
|
|
149
|
+
};
|
|
150
|
+
} | {
|
|
151
|
+
type: 'CLEAR_HOVER_SELECTION';
|
|
152
|
+
data: {
|
|
153
|
+
decorationSet: DecorationSet;
|
|
154
|
+
};
|
|
155
|
+
} | {
|
|
156
|
+
type: 'SHOW_RESIZE_HANDLE_LINE';
|
|
157
|
+
data: {
|
|
158
|
+
decorationSet: DecorationSet;
|
|
159
|
+
};
|
|
160
|
+
} | {
|
|
161
|
+
type: 'HIDE_RESIZE_HANDLE_LINE';
|
|
162
|
+
data: {
|
|
163
|
+
decorationSet: DecorationSet;
|
|
164
|
+
};
|
|
165
|
+
} | {
|
|
166
|
+
type: 'SET_TARGET_CELL_POSITION';
|
|
167
|
+
data: {
|
|
168
|
+
targetCellPosition?: number;
|
|
169
|
+
};
|
|
170
|
+
} | {
|
|
171
|
+
type: 'SELECT_COLUMN';
|
|
172
|
+
data: {
|
|
173
|
+
targetCellPosition: number;
|
|
174
|
+
decorationSet: DecorationSet;
|
|
175
|
+
};
|
|
176
|
+
} | {
|
|
177
|
+
type: 'SET_TABLE_LAYOUT';
|
|
178
|
+
data: {
|
|
179
|
+
layout: TableLayout;
|
|
180
|
+
};
|
|
181
|
+
} | {
|
|
182
|
+
type: 'SHOW_INSERT_ROW_BUTTON';
|
|
183
|
+
data: {
|
|
184
|
+
insertRowButtonIndex: number;
|
|
185
|
+
};
|
|
186
|
+
} | {
|
|
187
|
+
type: 'SHOW_INSERT_COLUMN_BUTTON';
|
|
188
|
+
data: {
|
|
189
|
+
insertColumnButtonIndex: number;
|
|
190
|
+
};
|
|
191
|
+
} | {
|
|
192
|
+
type: 'HIDE_INSERT_COLUMN_OR_ROW_BUTTON';
|
|
193
|
+
} | {
|
|
194
|
+
type: 'TOGGLE_CONTEXTUAL_MENU';
|
|
195
|
+
};
|
|
196
|
+
export type ColumnResizingPluginAction = {
|
|
197
|
+
type: 'SET_RESIZE_HANDLE_POSITION';
|
|
198
|
+
data: {
|
|
199
|
+
resizeHandlePos: number | null;
|
|
200
|
+
};
|
|
201
|
+
} | {
|
|
202
|
+
type: 'STOP_RESIZING';
|
|
203
|
+
} | {
|
|
204
|
+
type: 'SET_DRAGGING';
|
|
205
|
+
data: {
|
|
206
|
+
dragging: {
|
|
207
|
+
startX: number;
|
|
208
|
+
startWidth: number;
|
|
209
|
+
} | null;
|
|
210
|
+
};
|
|
211
|
+
} | {
|
|
212
|
+
type: 'SET_LAST_CLICK';
|
|
213
|
+
data: {
|
|
214
|
+
lastClick: {
|
|
215
|
+
x: number;
|
|
216
|
+
y: number;
|
|
217
|
+
time: number;
|
|
218
|
+
} | null;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
export declare enum TableDecorations {
|
|
222
|
+
ALL_CONTROLS_HOVER = "CONTROLS_HOVER",
|
|
223
|
+
ROW_CONTROLS_HOVER = "ROW_CONTROLS_HOVER",
|
|
224
|
+
COLUMN_CONTROLS_HOVER = "COLUMN_CONTROLS_HOVER",
|
|
225
|
+
TABLE_CONTROLS_HOVER = "TABLE_CONTROLS_HOVER",
|
|
226
|
+
CELL_CONTROLS_HOVER = "CELL_CONTROLS_HOVER",
|
|
227
|
+
COLUMN_CONTROLS_DECORATIONS = "COLUMN_CONTROLS_DECORATIONS",
|
|
228
|
+
COLUMN_SELECTED = "COLUMN_SELECTED",
|
|
229
|
+
COLUMN_RESIZING_HANDLE = "COLUMN_RESIZING_HANDLE",
|
|
230
|
+
COLUMN_RESIZING_HANDLE_WIDGET = "COLUMN_RESIZING_HANDLE_WIDGET",
|
|
231
|
+
COLUMN_RESIZING_HANDLE_LINE = "COLUMN_RESIZING_HANDLE_LINE",
|
|
232
|
+
LAST_CELL_ELEMENT = "LAST_CELL_ELEMENT"
|
|
233
|
+
}
|
|
234
|
+
export declare const TableCssClassName: {
|
|
235
|
+
COLUMN_CONTROLS: string;
|
|
236
|
+
COLUMN_CONTROLS_DECORATIONS: string;
|
|
237
|
+
COLUMN_SELECTED: string;
|
|
238
|
+
ROW_CONTROLS_WRAPPER: string;
|
|
239
|
+
ROW_CONTROLS: string;
|
|
240
|
+
ROW_CONTROLS_INNER: string;
|
|
241
|
+
ROW_CONTROLS_BUTTON_WRAP: string;
|
|
242
|
+
ROW_CONTROLS_BUTTON: string;
|
|
243
|
+
CONTROLS_BUTTON: string;
|
|
244
|
+
CONTROLS_BUTTON_ICON: string;
|
|
245
|
+
CONTROLS_INSERT_BUTTON: string;
|
|
246
|
+
CONTROLS_INSERT_BUTTON_INNER: string;
|
|
247
|
+
CONTROLS_INSERT_BUTTON_WRAP: string;
|
|
248
|
+
CONTROLS_INSERT_LINE: string;
|
|
249
|
+
CONTROLS_BUTTON_OVERLAY: string;
|
|
250
|
+
LAYOUT_BUTTON: string;
|
|
251
|
+
CONTROLS_INSERT_MARKER: string;
|
|
252
|
+
CONTROLS_INSERT_COLUMN: string;
|
|
253
|
+
CONTROLS_INSERT_ROW: string;
|
|
254
|
+
CONTROLS_DELETE_BUTTON_WRAP: string;
|
|
255
|
+
CONTROLS_DELETE_BUTTON: string;
|
|
256
|
+
CONTROLS_FLOATING_BUTTON_COLUMN: string;
|
|
257
|
+
CONTROLS_FLOATING_BUTTON_ROW: string;
|
|
258
|
+
CORNER_CONTROLS: string;
|
|
259
|
+
CORNER_CONTROLS_INSERT_ROW_MARKER: string;
|
|
260
|
+
CORNER_CONTROLS_INSERT_COLUMN_MARKER: string;
|
|
261
|
+
CONTROLS_CORNER_BUTTON: string;
|
|
262
|
+
NUMBERED_COLUMN: string;
|
|
263
|
+
NUMBERED_COLUMN_BUTTON: string;
|
|
264
|
+
HOVERED_COLUMN: string;
|
|
265
|
+
HOVERED_ROW: string;
|
|
266
|
+
HOVERED_TABLE: string;
|
|
267
|
+
HOVERED_CELL: string;
|
|
268
|
+
HOVERED_CELL_IN_DANGER: string;
|
|
269
|
+
HOVERED_CELL_ACTIVE: string;
|
|
270
|
+
HOVERED_CELL_WARNING: string;
|
|
271
|
+
HOVERED_DELETE_BUTTON: string;
|
|
272
|
+
WITH_CONTROLS: string;
|
|
273
|
+
RESIZING_PLUGIN: string;
|
|
274
|
+
RESIZE_CURSOR: string;
|
|
275
|
+
IS_RESIZING: string;
|
|
276
|
+
RESIZE_HANDLE: string;
|
|
277
|
+
RESIZE_HANDLE_DECORATION: string;
|
|
278
|
+
CONTEXTUAL_SUBMENU: string;
|
|
279
|
+
CONTEXTUAL_MENU_BUTTON_WRAP: string;
|
|
280
|
+
CONTEXTUAL_MENU_BUTTON: string;
|
|
281
|
+
CONTEXTUAL_MENU_BUTTON_FIXED: string;
|
|
282
|
+
CONTEXTUAL_MENU_ICON: string;
|
|
283
|
+
SELECTED_CELL: string;
|
|
284
|
+
NODEVIEW_WRAPPER: string;
|
|
285
|
+
TABLE_SELECTED: string;
|
|
286
|
+
TABLE_CELL: string;
|
|
287
|
+
TABLE_HEADER_CELL: string;
|
|
288
|
+
TABLE_STICKY: string;
|
|
289
|
+
TOP_LEFT_CELL: string;
|
|
290
|
+
LAST_ITEM_IN_CELL: string;
|
|
291
|
+
WITH_RESIZE_LINE: string;
|
|
292
|
+
WITH_RESIZE_LINE_LAST_COLUMN: string;
|
|
293
|
+
TABLE_CONTAINER: string;
|
|
294
|
+
TABLE_NODE_WRAPPER: string;
|
|
295
|
+
TABLE_LEFT_SHADOW: string;
|
|
296
|
+
TABLE_RIGHT_SHADOW: string;
|
|
297
|
+
TABLE_STICKY_SHADOW: string;
|
|
298
|
+
TABLE_STICKY_WRAPPER: string;
|
|
299
|
+
TABLE_STICKY_SCROLLBAR_CONTAINER: string;
|
|
300
|
+
TABLE_STICKY_SENTINEL_TOP: string;
|
|
301
|
+
TABLE_STICKY_SENTINEL_BOTTOM: string;
|
|
302
|
+
TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: string;
|
|
303
|
+
TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: string;
|
|
304
|
+
TABLE_SHADOW_SENTINEL_LEFT: string;
|
|
305
|
+
TABLE_SHADOW_SENTINEL_RIGHT: string;
|
|
306
|
+
TABLE_CELL_NODEVIEW_CONTENT_DOM: string;
|
|
307
|
+
TABLE_CELL_WRAPPER: string;
|
|
308
|
+
TABLE_HEADER_CELL_WRAPPER: string;
|
|
309
|
+
TABLE_ROW_CONTROLS_WRAPPER: string;
|
|
310
|
+
TABLE_COLUMN_CONTROLS_DECORATIONS: string;
|
|
311
|
+
TABLE_RESIZER_CONTAINER: string;
|
|
312
|
+
};
|
|
313
|
+
export interface ToolbarMenuConfig {
|
|
314
|
+
allowHeaderRow?: boolean;
|
|
315
|
+
allowHeaderColumn?: boolean;
|
|
316
|
+
allowNumberColumn?: boolean;
|
|
317
|
+
allowCollapse?: boolean;
|
|
318
|
+
}
|
|
319
|
+
export interface ToolbarMenuState {
|
|
320
|
+
isHeaderRowEnabled?: boolean;
|
|
321
|
+
isHeaderColumnEnabled?: boolean;
|
|
322
|
+
isNumberColumnEnabled?: boolean;
|
|
323
|
+
isTableCollapsed?: boolean;
|
|
324
|
+
canCollapseTable?: boolean;
|
|
325
|
+
}
|
|
326
|
+
export interface ToolbarMenuContext {
|
|
327
|
+
formatMessage: IntlShape['formatMessage'];
|
|
328
|
+
}
|
|
329
|
+
export type ElementContentRects = {
|
|
330
|
+
[key: string]: ResizeObserverEntry['contentRect'];
|
|
331
|
+
};
|
|
332
|
+
export declare enum ShadowEvent {
|
|
333
|
+
SHOW_BEFORE_SHADOW = "showBeforeShadow",
|
|
334
|
+
SHOW_AFTER_SHADOW = "showAfterShadow"
|
|
335
|
+
}
|
|
336
|
+
export type ReportInvalidNodeAttrs = (invalidNodeAttrs: InvalidNodeAttr) => void;
|
|
337
|
+
export type InvalidNodeAttr = {
|
|
338
|
+
nodeType: string;
|
|
339
|
+
attribute: string;
|
|
340
|
+
reason: string;
|
|
341
|
+
spanValue: number;
|
|
342
|
+
tableLocalId: string;
|
|
343
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
3
|
+
export declare const BUTTON_WIDTH = 20;
|
|
4
|
+
export interface Props {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
mountTo: HTMLElement;
|
|
7
|
+
offset: number;
|
|
8
|
+
stickyHeader: RowStickyState;
|
|
9
|
+
targetCellPosition: number;
|
|
10
|
+
targetCellRef: HTMLElement;
|
|
11
|
+
tableWrapper: HTMLElement;
|
|
12
|
+
isContextualMenuOpen: boolean | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface CalcLeftPosData {
|
|
15
|
+
buttonWidth: number;
|
|
16
|
+
cellRectLeft: number;
|
|
17
|
+
cellRefWidth: number;
|
|
18
|
+
offset: number;
|
|
19
|
+
}
|
|
20
|
+
export declare const calcLeftPos: ({ buttonWidth, cellRectLeft, cellRefWidth, offset, }: CalcLeftPosData) => number;
|
|
21
|
+
export declare const calcObserverTargetMargin: (tableWrapper: HTMLElement, fixedButtonRefCurrent: HTMLElement) => number;
|
|
22
|
+
export declare const FixedButton: ({ children, isContextualMenuOpen, mountTo, offset, stickyHeader, tableWrapper, targetCellPosition, targetCellRef, }: Props) => React.ReactPortal;
|
|
23
|
+
export default FixedButton;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import { TableLayout } from '@atlaskit/adf-schema';
|
|
3
|
+
import { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
7
|
+
export interface Props {
|
|
8
|
+
editorView: EditorView;
|
|
9
|
+
tableWrapper?: HTMLElement;
|
|
10
|
+
tableNode?: PMNode;
|
|
11
|
+
targetCellPosition: number;
|
|
12
|
+
isContextualMenuOpen?: boolean;
|
|
13
|
+
mountPoint?: HTMLElement;
|
|
14
|
+
boundariesElement?: HTMLElement;
|
|
15
|
+
scrollableElement?: HTMLElement;
|
|
16
|
+
layout?: TableLayout;
|
|
17
|
+
isNumberColumnEnabled?: boolean;
|
|
18
|
+
stickyHeader?: RowStickyState;
|
|
19
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
20
|
+
}
|
|
21
|
+
export default function (props: Props): jsx.JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ThemeProps } from '@atlaskit/theme/types';
|
|
2
|
+
export declare const tableFloatingCellButtonStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const tableFloatingCellButtonSelectedStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|