@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
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import uuid from 'uuid';
|
|
5
|
-
import { getCellAttrs, getCellDomAttrs } from '@atlaskit/adf-schema';
|
|
6
|
-
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
var DEFAULT_COL_SPAN = 1;
|
|
8
|
-
var DEFAULT_ROW_SPAN = 1;
|
|
9
|
-
var TableCellNodeView = /*#__PURE__*/function () {
|
|
10
|
-
function TableCellNodeView(node, view, getPos, observer) {
|
|
11
|
-
_classCallCheck(this, TableCellNodeView);
|
|
12
|
-
this.view = view;
|
|
13
|
-
this.node = node;
|
|
14
|
-
var _DOMSerializer$render = DOMSerializer.renderSpec(document, node.type.spec.toDOM(node)),
|
|
15
|
-
dom = _DOMSerializer$render.dom,
|
|
16
|
-
contentDOM = _DOMSerializer$render.contentDOM;
|
|
17
|
-
this.getPos = getPos;
|
|
18
|
-
this.dom = dom;
|
|
19
|
-
this.contentDOM = contentDOM;
|
|
20
|
-
if (observer) {
|
|
21
|
-
this.contentDOM.id = uuid();
|
|
22
|
-
this.observer = observer;
|
|
23
|
-
observer.observe(this.contentDOM);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
_createClass(TableCellNodeView, [{
|
|
27
|
-
key: "updateNodeView",
|
|
28
|
-
value: function updateNodeView(node) {
|
|
29
|
-
var _this = this;
|
|
30
|
-
if (this.node.type !== node.type) {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
var attrs = getCellDomAttrs(this.node);
|
|
34
|
-
var nextAttrs = getCellDomAttrs(node);
|
|
35
|
-
var _getCellAttrs = getCellAttrs(this.dom),
|
|
36
|
-
colspan = _getCellAttrs.colspan,
|
|
37
|
-
rowspan = _getCellAttrs.rowspan;
|
|
38
|
-
|
|
39
|
-
// need to rerender when colspan/rowspan in dom are different from the node attrs
|
|
40
|
-
// this can happen when undoing merge cells
|
|
41
|
-
if (colspan !== (node.attrs.colspan || DEFAULT_COL_SPAN) || rowspan !== (node.attrs.rowspan || DEFAULT_ROW_SPAN)) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// added + changed attributes
|
|
46
|
-
var addedAttrs = Object.entries(nextAttrs).filter(function (_ref) {
|
|
47
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
48
|
-
key = _ref2[0],
|
|
49
|
-
value = _ref2[1];
|
|
50
|
-
return attrs[key] !== value;
|
|
51
|
-
});
|
|
52
|
-
var removedAttrs = Object.keys(attrs).filter(function (key) {
|
|
53
|
-
return !nextAttrs.hasOwnProperty(key);
|
|
54
|
-
});
|
|
55
|
-
if (addedAttrs.length || removedAttrs.length) {
|
|
56
|
-
addedAttrs.forEach(function (_ref3) {
|
|
57
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
58
|
-
key = _ref4[0],
|
|
59
|
-
value = _ref4[1];
|
|
60
|
-
return _this.dom.setAttribute(key, value || '');
|
|
61
|
-
});
|
|
62
|
-
removedAttrs.forEach(function (key) {
|
|
63
|
-
return _this.dom.removeAttribute(key);
|
|
64
|
-
});
|
|
65
|
-
return true;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Return true to not re-render this node view
|
|
69
|
-
if (this.node.sameMarkup(node)) {
|
|
70
|
-
return true;
|
|
71
|
-
}
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
}, {
|
|
75
|
-
key: "update",
|
|
76
|
-
value: function update(node) {
|
|
77
|
-
var didUpdate = this.updateNodeView(node);
|
|
78
|
-
if (didUpdate) {
|
|
79
|
-
this.node = node;
|
|
80
|
-
}
|
|
81
|
-
return didUpdate;
|
|
82
|
-
}
|
|
83
|
-
}, {
|
|
84
|
-
key: "destroy",
|
|
85
|
-
value: function destroy() {
|
|
86
|
-
if (this.observer) {
|
|
87
|
-
this.observer.unobserve(this.contentDOM);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}]);
|
|
91
|
-
return TableCellNodeView;
|
|
92
|
-
}();
|
|
93
|
-
export { TableCellNodeView as default };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export var getTree = function getTree(tr) {
|
|
2
|
-
// pm renders into tbody, owned by react
|
|
3
|
-
var tbody = tr.parentElement;
|
|
4
|
-
if (!tbody) {
|
|
5
|
-
return null;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
// rendered by react
|
|
9
|
-
var table = tbody.parentElement;
|
|
10
|
-
if (!table) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// rendered by react
|
|
15
|
-
var wrapper = table.parentElement;
|
|
16
|
-
if (!wrapper) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
return {
|
|
20
|
-
wrapper: wrapper,
|
|
21
|
-
table: table
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export var getTop = function getTop(element) {
|
|
25
|
-
if (!element || element instanceof Window) {
|
|
26
|
-
return 0;
|
|
27
|
-
}
|
|
28
|
-
return element.getBoundingClientRect().top;
|
|
29
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
-
import type { getPosHandler } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
export default class TableCellNodeView implements NodeView {
|
|
6
|
-
node: Node;
|
|
7
|
-
dom: HTMLElement;
|
|
8
|
-
contentDOM: HTMLElement;
|
|
9
|
-
getPos: getPosHandler;
|
|
10
|
-
view: EditorView;
|
|
11
|
-
providerFactory?: ProviderFactory;
|
|
12
|
-
observer?: ResizeObserver;
|
|
13
|
-
constructor(node: Node, view: EditorView, getPos: any, observer?: ResizeObserver);
|
|
14
|
-
private updateNodeView;
|
|
15
|
-
update(node: Node): boolean;
|
|
16
|
-
destroy(): void;
|
|
17
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
|
-
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
-
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { TablePluginState } from '../../../types';
|
|
6
|
-
import type { TableDOMElements } from './dom';
|
|
7
|
-
/**
|
|
8
|
-
* Check if a given node is a header row with this definition:
|
|
9
|
-
* - all children are tableHeader cells
|
|
10
|
-
* - no table cells have been have merged with other table row cells
|
|
11
|
-
*
|
|
12
|
-
* @param node ProseMirror node
|
|
13
|
-
* @return boolean if it meets definition
|
|
14
|
-
*/
|
|
15
|
-
export declare const supportedHeaderRow: (node: PmNode) => boolean;
|
|
16
|
-
export declare class TableRowNodeView implements NodeView {
|
|
17
|
-
view: EditorView;
|
|
18
|
-
node: PmNode;
|
|
19
|
-
getPos: () => number;
|
|
20
|
-
eventDispatcher: EventDispatcher;
|
|
21
|
-
dom: HTMLTableRowElement;
|
|
22
|
-
contentDOM: HTMLElement;
|
|
23
|
-
isHeaderRow: boolean;
|
|
24
|
-
editorScrollableElement?: HTMLElement | Window;
|
|
25
|
-
colControlsOffset: number;
|
|
26
|
-
focused: boolean;
|
|
27
|
-
topPosEditorElement: number;
|
|
28
|
-
isSticky: boolean;
|
|
29
|
-
lastStickyTimestamp: number | undefined;
|
|
30
|
-
lastTimePainted: number;
|
|
31
|
-
private intersectionObserver?;
|
|
32
|
-
private resizeObserver?;
|
|
33
|
-
private sentinels;
|
|
34
|
-
private stickyRowHeight?;
|
|
35
|
-
get tree(): TableDOMElements | null | undefined;
|
|
36
|
-
constructor(node: PmNode, view: EditorView, getPos: any, eventDispatcher: EventDispatcher);
|
|
37
|
-
listening: boolean;
|
|
38
|
-
headerRowMouseScrollEnd: import("lodash").DebouncedFunc<() => void>;
|
|
39
|
-
headerRowMouseScroll: import("lodash").DebouncedFunc<() => void>;
|
|
40
|
-
subscribe(): void;
|
|
41
|
-
unsubscribe(): void;
|
|
42
|
-
private initObservers;
|
|
43
|
-
private createResizeObserver;
|
|
44
|
-
private createIntersectionObserver;
|
|
45
|
-
previousDomTop: number | undefined;
|
|
46
|
-
previousPadding: number | undefined;
|
|
47
|
-
latestDomTop: number | undefined;
|
|
48
|
-
nextFrame: number | undefined;
|
|
49
|
-
update(node: PmNode, ..._args: any[]): boolean;
|
|
50
|
-
destroy(): void;
|
|
51
|
-
ignoreMutation(mutationRecord: MutationRecord | {
|
|
52
|
-
type: 'selection';
|
|
53
|
-
target: Element;
|
|
54
|
-
}): boolean;
|
|
55
|
-
onTablePluginState: (state: TablePluginState) => void;
|
|
56
|
-
updateStickyHeaderWidth: () => void;
|
|
57
|
-
shouldHeaderStick: (tree: TableDOMElements) => boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Manually refire the intersection observers.
|
|
60
|
-
* Useful when the header may have detached from the table.
|
|
61
|
-
*/
|
|
62
|
-
refireIntersectionObservers: () => void;
|
|
63
|
-
makeHeaderRowSticky: (tree: TableDOMElements, scrollTop?: number) => void;
|
|
64
|
-
makeRowHeaderNotSticky: (table: HTMLElement, isEditorDestroyed?: boolean) => void;
|
|
65
|
-
getWrapperoffset: (inverse?: boolean) => number;
|
|
66
|
-
getWrapperRefTop: (wrapper: HTMLElement) => number;
|
|
67
|
-
getScrolledTableTop: (wrapper: HTMLElement) => number;
|
|
68
|
-
getCurrentTableTop: (tree: TableDOMElements) => number;
|
|
69
|
-
padding: number;
|
|
70
|
-
top: number;
|
|
71
|
-
emitOn: (top: number, padding: number) => void;
|
|
72
|
-
emitOff: (isEditorDestroyed: boolean) => void;
|
|
73
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export type TableDOMElements = {
|
|
2
|
-
wrapper: HTMLDivElement;
|
|
3
|
-
table: HTMLTableElement;
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
export const getTree = (tr: HTMLTableRowElement): TableDOMElements | null => {
|
|
7
|
-
// pm renders into tbody, owned by react
|
|
8
|
-
const tbody = tr.parentElement;
|
|
9
|
-
if (!tbody) {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// rendered by react
|
|
14
|
-
const table = tbody.parentElement;
|
|
15
|
-
if (!table) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// rendered by react
|
|
20
|
-
const wrapper = table.parentElement;
|
|
21
|
-
if (!wrapper) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
wrapper: wrapper as HTMLDivElement,
|
|
27
|
-
table: table as HTMLTableElement,
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const getTop = (element: HTMLElement | Window | undefined): number => {
|
|
32
|
-
if (!element || element instanceof Window) {
|
|
33
|
-
return 0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return element.getBoundingClientRect().top;
|
|
37
|
-
};
|