@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,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,24 @@
|
|
|
1
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
export declare class TableStickyScrollbar {
|
|
3
|
+
private wrapper;
|
|
4
|
+
private view;
|
|
5
|
+
private editorScrollableElement?;
|
|
6
|
+
private intersectionObserver?;
|
|
7
|
+
private stickyScrollbarContainerElement?;
|
|
8
|
+
private sentinels;
|
|
9
|
+
private topSentinelState?;
|
|
10
|
+
private bottomSentinelState?;
|
|
11
|
+
constructor(wrapper: HTMLDivElement, view: EditorView);
|
|
12
|
+
dispose(): void;
|
|
13
|
+
scrollLeft(left: number): void;
|
|
14
|
+
private init;
|
|
15
|
+
private createIntersectionObserver;
|
|
16
|
+
private deleteIntesactionObserver;
|
|
17
|
+
private sentenialBottomCallback;
|
|
18
|
+
private sentenialTopCallback;
|
|
19
|
+
private toggle;
|
|
20
|
+
private hide;
|
|
21
|
+
private show;
|
|
22
|
+
private handleScroll;
|
|
23
|
+
private handleScrollDebounced;
|
|
24
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OverridableMock } from './OverridableMock';
|
|
2
|
+
export declare class OverflowShadowsObserver extends OverridableMock {
|
|
3
|
+
leftShadowSentinel: HTMLElement | null;
|
|
4
|
+
rightShadowSentinel: HTMLElement | null;
|
|
5
|
+
constructor(...inputs: any[]);
|
|
6
|
+
observeShadowSentinels: any;
|
|
7
|
+
updateStickyShadows: any;
|
|
8
|
+
dispose: any;
|
|
9
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
4
|
+
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
5
|
+
import type { GetEditorContainerWidth, GetEditorFeatureFlags, getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
6
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
+
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
+
import type { PluginInjectionAPI } from '../types';
|
|
9
|
+
import type { Props } from './types';
|
|
10
|
+
type ForwardRef = (node: HTMLElement | null) => void;
|
|
11
|
+
export default class TableView extends ReactNodeView<Props> {
|
|
12
|
+
private table;
|
|
13
|
+
private resizeObserver?;
|
|
14
|
+
eventDispatcher?: EventDispatcher;
|
|
15
|
+
getPos: getPosHandlerNode;
|
|
16
|
+
constructor(props: Props);
|
|
17
|
+
getContentDOM(): {
|
|
18
|
+
dom: HTMLElement;
|
|
19
|
+
contentDOM?: HTMLElement | undefined;
|
|
20
|
+
};
|
|
21
|
+
setDomAttrs(node: PmNode): void;
|
|
22
|
+
getNode: () => PmNode;
|
|
23
|
+
render(props: Props, forwardRef: ForwardRef): JSX.Element;
|
|
24
|
+
private hasHoveredRows;
|
|
25
|
+
viewShouldUpdate(nextNode: PmNode): boolean;
|
|
26
|
+
ignoreMutation(mutation: MutationRecord | {
|
|
27
|
+
type: 'selection';
|
|
28
|
+
target: Element;
|
|
29
|
+
}): boolean;
|
|
30
|
+
destroy(): void;
|
|
31
|
+
}
|
|
32
|
+
export declare const createTableView: (node: PmNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, pluginInjectionApi?: PluginInjectionAPI) => NodeView;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
3
|
+
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
|
+
import { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import type { PluginInjectionAPI } from '../types';
|
|
7
|
+
export type TableOptions = {
|
|
8
|
+
isBreakoutEnabled?: boolean;
|
|
9
|
+
isFullWidthModeEnabled?: boolean;
|
|
10
|
+
wasFullWidthModeEnabled?: boolean;
|
|
11
|
+
isTableResizingEnabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export interface Props {
|
|
14
|
+
node: PmNode;
|
|
15
|
+
view: EditorView;
|
|
16
|
+
allowColumnResizing?: boolean;
|
|
17
|
+
cellMinWidth?: number;
|
|
18
|
+
portalProviderAPI: PortalProviderAPI;
|
|
19
|
+
eventDispatcher: EventDispatcher;
|
|
20
|
+
getPos: () => number | undefined;
|
|
21
|
+
options?: TableOptions;
|
|
22
|
+
getEditorContainerWidth: GetEditorContainerWidth;
|
|
23
|
+
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
24
|
+
hasIntlContext: boolean;
|
|
25
|
+
pluginInjectionApi?: PluginInjectionAPI;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const updateShadowListForStickyStyles: (heightStyle: string, shadows: HTMLCollection) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import { EditorState, PluginKey, ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
export declare const pluginKey: PluginKey<any>;
|
|
5
|
+
export declare const getDecorations: (state: EditorState) => DecorationSet;
|
|
6
|
+
export declare const handleDocOrSelectionChanged: (tr: Transaction | ReadonlyTransaction, decorationSet: DecorationSet, oldState: EditorState, newState: EditorState) => DecorationSet;
|
|
7
|
+
export declare const createPlugin: () => SafePlugin<DecorationSet>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { DecorationTransformer } from './types';
|
|
3
|
+
export declare const buildColumnResizingDecorations: (rowEndIndex: number, columnEndIndex: number, includeTooltip: boolean, getIntl: () => IntlShape) => DecorationTransformer;
|
|
4
|
+
export declare const clearColumnResizingDecorations: () => DecorationTransformer;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { buildColumnControlsDecorations, maybeUpdateColumnControlsSelectedDecoration, } from './column-controls';
|
|
2
|
+
export { buildColumnResizingDecorations, clearColumnResizingDecorations, } from './column-resizing';
|
|
3
|
+
export { composeDecorations } from './compose-decorations';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
+
export type DecorationTransformer = ({ decorationSet, tr, }: {
|
|
4
|
+
decorationSet: DecorationSet;
|
|
5
|
+
tr: Transaction | ReadonlyTransaction;
|
|
6
|
+
}) => DecorationSet;
|
|
@@ -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>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
4
|
+
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null): SafePlugin;
|
|
5
|
+
export default keymapPlugin;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
5
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
|
+
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
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, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI) => SafePlugin<import("../types").TablePluginState>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("../types").TablePluginState | ((state: import("prosemirror-state").EditorState) => import("../types").TablePluginState)) => import("prosemirror-state").SafeStateField<import("../types").TablePluginState>, createCommand: <A = import("../types").TablePluginAction>(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, getPluginState: (state: import("prosemirror-state").EditorState) => import("../types").TablePluginState;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fix an issue that composition text replacement in Safari removes empty nodes during text composition text deletion.
|
|
3
|
+
* https://github.com/ProseMirror/prosemirror/issues/934
|
|
4
|
+
* We will remove this plugin when Webkit fix the problem itself.
|
|
5
|
+
*/
|
|
6
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
8
|
+
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
+
interface SafariDeleteCompositionTextIssueWorkaroundPluginState {
|
|
10
|
+
renderSpan: boolean;
|
|
11
|
+
decorations: DecorationSet;
|
|
12
|
+
}
|
|
13
|
+
export declare const tableSafariDeleteCompositionTextIssueWorkaroundKey: PluginKey<SafariDeleteCompositionTextIssueWorkaroundPluginState>;
|
|
14
|
+
export declare const createPlugin: () => SafePlugin<SafariDeleteCompositionTextIssueWorkaroundPluginState>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { createPlugin } from './plugin';
|
|
2
|
+
export { pluginKey } from './plugin-key';
|
|
3
|
+
export type { StickyPluginState, RowStickyState } from './types';
|
|
4
|
+
export { findStickyHeaderForTable } from './util';
|
|
5
|
+
export { updateStickyState, removeStickyState } from './commands';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { StickyPluginAction, StickyPluginState } from './types';
|
|
2
|
+
declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: StickyPluginState | ((state: import("prosemirror-state").EditorState) => StickyPluginState)) => import("prosemirror-state").SafeStateField<StickyPluginState>, createCommand: <A = StickyPluginAction>(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;
|
|
3
|
+
export { createPluginState, createCommand };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
|
+
export declare const createPlugin: (dispatch: Dispatch, eventDispatcher: EventDispatcher, initialState: (() => never[]) | undefined, getEditorFeatureFlags: GetEditorFeatureFlags) => SafePlugin<import("./types").StickyPluginState>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type RowStickyState = {
|
|
2
|
+
pos: number;
|
|
3
|
+
top: number;
|
|
4
|
+
padding: number;
|
|
5
|
+
sticky: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type StickyPluginState = RowStickyState[];
|
|
8
|
+
export type UpdateSticky = {
|
|
9
|
+
name: 'UPDATE';
|
|
10
|
+
state: RowStickyState;
|
|
11
|
+
};
|
|
12
|
+
export type RemoveSticky = {
|
|
13
|
+
name: 'REMOVE';
|
|
14
|
+
pos: number;
|
|
15
|
+
};
|
|
16
|
+
export type StickyPluginAction = UpdateSticky | RemoveSticky;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A plugin is created for collecting payload data for tableOverflowChanged analytics event
|
|
3
|
+
*/
|
|
4
|
+
import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
6
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
7
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
8
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
9
|
+
interface LastTrigger {
|
|
10
|
+
name: TABLE_OVERFLOW_CHANGE_TRIGGER;
|
|
11
|
+
}
|
|
12
|
+
type TableAnalyticsPluginState = {
|
|
13
|
+
lastTrigger: LastTrigger | undefined;
|
|
14
|
+
};
|
|
15
|
+
export declare const pluginKey: PluginKey<TableAnalyticsPluginState>;
|
|
16
|
+
export declare const META_KEYS: {
|
|
17
|
+
OVERFLOW_TRIGGER: string;
|
|
18
|
+
OVERFLOW_STATE_CHANGED: string;
|
|
19
|
+
};
|
|
20
|
+
declare const createPlugin: (dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, tableResizingEnabled: boolean) => SafePlugin<{
|
|
21
|
+
lastTrigger: undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export { createPlugin };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
interface TableLocalIdPluginState {
|
|
4
|
+
parsedForLocalIds: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Ensures uniqueness of `localId`s on tables being created or edited
|
|
8
|
+
*/
|
|
9
|
+
declare const createPlugin: (dispatch: Dispatch) => SafePlugin<TableLocalIdPluginState>;
|
|
10
|
+
export { createPlugin };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Command } 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 { ResizeState } from './utils';
|
|
6
|
+
export declare const evenColumns: ({ resizeState, table, start, event, }: {
|
|
7
|
+
resizeState: ResizeState;
|
|
8
|
+
table: PMNode;
|
|
9
|
+
start: number;
|
|
10
|
+
event: MouseEvent;
|
|
11
|
+
}) => Command;
|
|
12
|
+
export declare const distributeColumnsWidths: (newResizeState: ResizeState, table: ContentNodeWithPos) => Command;
|
|
13
|
+
export declare const setResizeHandlePos: (resizeHandlePos: number | null) => Command;
|
|
14
|
+
export declare const stopResizing: (tr?: Transaction) => Command;
|
|
15
|
+
export declare const setDragging: (dragging: {
|
|
16
|
+
startX: number;
|
|
17
|
+
startWidth: number;
|
|
18
|
+
} | null, tr?: Transaction) => Command;
|
|
19
|
+
export declare const setLastClick: (lastClick: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
time: number;
|
|
23
|
+
} | null, transform?: ((tr: Transaction) => Transaction) | undefined) => Command;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
export declare const handleMouseDown: (view: EditorView, event: MouseEvent, localResizeHandlePos: number, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI) => boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ColumnResizingPluginState } from '../../types';
|
|
2
|
+
export declare const createCommand: <A = import("../../types").ColumnResizingPluginAction>(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;
|
|
3
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: ColumnResizingPluginState | ((state: import("prosemirror-state").EditorState) => ColumnResizingPluginState)) => import("prosemirror-state").SafeStateField<ColumnResizingPluginState>;
|
|
4
|
+
export declare const getPluginState: (state: import("prosemirror-state").EditorState) => ColumnResizingPluginState;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
|
+
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
|
+
import type { ColumnResizingPluginState } from '../../types';
|
|
6
|
+
export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI): SafePlugin<ColumnResizingPluginState>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
type Col = Array<string | {
|
|
3
|
+
[name: string]: string;
|
|
4
|
+
}>;
|
|
5
|
+
/**
|
|
6
|
+
* This ensures the combined width of the columns (and tbody) of table is always smaller or equal
|
|
7
|
+
* than the table and table wrapper elements. This is necessary as there is no longer
|
|
8
|
+
* padding on the .pm-table-wrapper, so all elements need to be the same width to avoid
|
|
9
|
+
* overflow.
|
|
10
|
+
*/
|
|
11
|
+
export declare const getColWidthFix: (colwidth: number, tableColumnCount: number) => number;
|
|
12
|
+
export declare const generateColgroup: (table: PmNode) => Col[];
|
|
13
|
+
export declare const insertColgroupFromNode: (tableRef: HTMLTableElement, table: PmNode) => HTMLCollection;
|
|
14
|
+
export declare const hasTableBeenResized: (table: PmNode) => boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Check if a table has all the column width set to tableCellMinWidth(48px) or null
|
|
17
|
+
*
|
|
18
|
+
* @param table
|
|
19
|
+
* @returns true if all column width is equal to tableCellMinWidth or null, false otherwise
|
|
20
|
+
*/
|
|
21
|
+
export declare const isMinCellWidthTable: (table: PmNode) => boolean;
|
|
22
|
+
export declare const getColgroupChildrenLength: (table: PmNode) => number;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
export interface ColumnState {
|
|
3
|
+
index: number;
|
|
4
|
+
width: number;
|
|
5
|
+
minWidth: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const getColumnStateFromDOM: (cells: HTMLElement[], index: number, minWidth: number) => ColumnState;
|
|
8
|
+
export declare const getFreeSpace: (state: ColumnState) => number;
|
|
9
|
+
export declare const getCellsRefsInColumn: (columnIndex: number, table: PMNode, tableStart: number, domAtPos: (pos: number) => {
|
|
10
|
+
node: Node;
|
|
11
|
+
offset: number;
|
|
12
|
+
}) => HTMLElement[];
|
|
13
|
+
export declare const calculateColumnWidth: (cells: HTMLElement[], calculateColumnWidthCb: (css: CSSStyleDeclaration, cellRef: HTMLElement, colSpan: number) => number) => number;
|
|
14
|
+
export declare const addContainerLeftRightPadding: (amount: number, css: CSSStyleDeclaration) => number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
+
export declare const updateControls: () => (state: EditorState) => void;
|
|
4
|
+
export declare const isClickNear: (event: MouseEvent, click: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
export declare const getResizeCellPos: (view: EditorView, event: MouseEvent) => number | null;
|
|
9
|
+
export declare const updateStickyMargins: (table: HTMLElement) => void;
|
|
10
|
+
export declare const applyColWidthsToStickyRow: (colGroup: HTMLTableColElement | null, headerRow: HTMLTableRowElement) => void;
|
|
11
|
+
export declare const syncStickyRowToTable: (tableRef?: HTMLElement | null) => void;
|
|
12
|
+
export declare const applyTableWidthToStickyRow: (tableRef: HTMLElement, headerRow: HTMLTableRowElement) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { generateColgroup, insertColgroupFromNode, hasTableBeenResized, getColgroupChildrenLength, } from './colgroup';
|
|
2
|
+
export { contentWidth } from './content-width';
|
|
3
|
+
export { getColumnStateFromDOM, getFreeSpace, getCellsRefsInColumn, calculateColumnWidth, addContainerLeftRightPadding, } from './column-state';
|
|
4
|
+
export type { ColumnState } from './column-state';
|
|
5
|
+
export { growColumn, shrinkColumn, reduceSpace } from './resize-logic';
|
|
6
|
+
export { getResizeState, updateColgroup, getTotalWidth, evenAllColumnsWidths, bulkColumnsResize, areColumnsEven, adjustColumnsWidths, } from './resize-state';
|
|
7
|
+
export { getLayoutSize, getDefaultLayoutMaxWidth, pointsAtCell, currentColWidth, domCellAround, } from './misc';
|
|
8
|
+
export { updateControls, isClickNear, getResizeCellPos } from './dom';
|
|
9
|
+
export { scale, scaleWithParent, scaleTable, previewScaleTable, } from './scale-table';
|
|
10
|
+
export type { ScaleOptions } from './scale-table';
|
|
11
|
+
export type { ResizeState, ResizeStateWithAnalytics } from './types';
|
|
12
|
+
export { resizeColumn } from './resize-column';
|
|
13
|
+
export { COLUMN_MIN_WIDTH, TABLE_MAX_WIDTH } from './consts';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CellAttributes, TableLayout } from '@atlaskit/adf-schema';
|
|
2
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import type { TableOptions } from '../../../nodeviews/types';
|
|
7
|
+
export declare function getLayoutSize(tableLayout: TableLayout, containerWidth: number | undefined, options: TableOptions): number;
|
|
8
|
+
export declare function getDefaultLayoutMaxWidth(containerWidth?: number): number;
|
|
9
|
+
export declare function pointsAtCell($pos: ResolvedPos): false | PMNode | null;
|
|
10
|
+
export declare function currentColWidth(view: EditorView, cellPos: number, { colspan, colwidth }: CellAttributes): number;
|
|
11
|
+
export declare function domCellAround(target: HTMLElement | null): HTMLElement | null;
|
|
12
|
+
interface getTableMaxWidthProps {
|
|
13
|
+
table: PMNode;
|
|
14
|
+
tableStart: number;
|
|
15
|
+
state: EditorState;
|
|
16
|
+
layout: TableLayout;
|
|
17
|
+
getEditorContainerWidth: GetEditorContainerWidth;
|
|
18
|
+
}
|
|
19
|
+
export declare const getTableMaxWidth: ({ table, tableStart, state, layout, getEditorContainerWidth, }: getTableMaxWidthProps) => number;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ResizeState } from './types';
|
|
2
|
+
export declare const growColumn: (state: ResizeState, colIndex: number, amount: number, selectedColumns?: number[]) => ResizeState;
|
|
3
|
+
export declare const shrinkColumn: (state: ResizeState, colIndex: number, amount: number, selectedColumns?: number[]) => ResizeState;
|
|
4
|
+
export declare function reduceSpace(state: ResizeState, amount: number, ignoreCols?: number[]): ResizeState;
|