@atlaskit/editor-plugin-table 5.0.0 → 5.1.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 +6 -0
- package/dist/cjs/plugins/table/index.js +44 -35
- 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/es2019/plugins/table/index.js +9 -1
- 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/esm/plugins/table/index.js +44 -35
- 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/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-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/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/TableResizer.d.ts +25 -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/tableCell.d.ts +17 -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 +6 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +73 -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 +342 -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 +20 -0
- package/dist/types-ts4.5/plugins/table/utils/get-allow-add-column-custom-step.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/utils/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 +13 -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/plugins/table/index.tsx +12 -0
- 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/tmp/api-report-tmp.d.ts +100 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
|
|
3
|
+
import { DragAndDropActionType } from './actions';
|
|
4
|
+
import type { DropTargetType } from './consts';
|
|
5
|
+
import { createCommand } from './plugin-factory';
|
|
6
|
+
|
|
7
|
+
// TODO: This command is a placeholder example. Please replace this if required.
|
|
8
|
+
export const setDropTarget = (
|
|
9
|
+
type: DropTargetType,
|
|
10
|
+
index: number,
|
|
11
|
+
tr?: Transaction,
|
|
12
|
+
) =>
|
|
13
|
+
createCommand(
|
|
14
|
+
{
|
|
15
|
+
type: DragAndDropActionType.SET_DROP_TARGET,
|
|
16
|
+
data: {
|
|
17
|
+
type,
|
|
18
|
+
index,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
(originalTr: Transaction) =>
|
|
22
|
+
(tr || originalTr).setMeta('addToHistory', false),
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export const clearDropTarget = (tr?: Transaction) =>
|
|
26
|
+
createCommand(
|
|
27
|
+
{
|
|
28
|
+
type: DragAndDropActionType.CLEAR_DROP_TARGET,
|
|
29
|
+
},
|
|
30
|
+
(originalTr: Transaction) =>
|
|
31
|
+
(tr || originalTr).setMeta('addToHistory', false),
|
|
32
|
+
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
2
|
+
|
|
3
|
+
import { pluginKey } from './plugin-key';
|
|
4
|
+
import reducer from './reducer';
|
|
5
|
+
|
|
6
|
+
const { createPluginState, createCommand } = pluginFactory(pluginKey, reducer);
|
|
7
|
+
|
|
8
|
+
export { createPluginState, createCommand };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Dispatch,
|
|
3
|
+
EventDispatcher,
|
|
4
|
+
} from '@atlaskit/editor-common/event-dispatcher';
|
|
5
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
+
|
|
8
|
+
import { DropTargetType } from './consts';
|
|
9
|
+
import { createPluginState } from './plugin-factory';
|
|
10
|
+
import { pluginKey } from './plugin-key';
|
|
11
|
+
|
|
12
|
+
export const createPlugin = (
|
|
13
|
+
dispatch: Dispatch,
|
|
14
|
+
eventDispatcher: EventDispatcher,
|
|
15
|
+
) => {
|
|
16
|
+
return new SafePlugin({
|
|
17
|
+
state: createPluginState(dispatch, {
|
|
18
|
+
// TODO: This is example placeholder state. We could use this to track which row/col is currently set as the drop target
|
|
19
|
+
// This would result in a blue highlight being displayed on the corrisponding row/column to single the drop target location.
|
|
20
|
+
dropTargetType: DropTargetType.NONE,
|
|
21
|
+
dropTargetIndex: 0,
|
|
22
|
+
}),
|
|
23
|
+
key: pluginKey,
|
|
24
|
+
view: (editorView: EditorView) => {
|
|
25
|
+
// TODO: Add Pragmatic DnD monitor when the view is constructed.
|
|
26
|
+
return {
|
|
27
|
+
// TODO: Cleanup monitor instance
|
|
28
|
+
// destroy: cleanup,
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { DragAndDropPluginAction } from './actions';
|
|
2
|
+
import { DragAndDropActionType } from './actions';
|
|
3
|
+
import { DropTargetType } from './consts';
|
|
4
|
+
import type { DragAndDropPluginState } from './types';
|
|
5
|
+
|
|
6
|
+
export default (
|
|
7
|
+
pluginState: DragAndDropPluginState,
|
|
8
|
+
action: DragAndDropPluginAction,
|
|
9
|
+
): DragAndDropPluginState => {
|
|
10
|
+
switch (action.type) {
|
|
11
|
+
case DragAndDropActionType.SET_DROP_TARGET:
|
|
12
|
+
return {
|
|
13
|
+
...pluginState,
|
|
14
|
+
dropTargetType: action.data.type,
|
|
15
|
+
dropTargetIndex: action.data.index,
|
|
16
|
+
};
|
|
17
|
+
case DragAndDropActionType.CLEAR_DROP_TARGET:
|
|
18
|
+
return {
|
|
19
|
+
...pluginState,
|
|
20
|
+
dropTargetType: DropTargetType.NONE,
|
|
21
|
+
dropTargetIndex: 0,
|
|
22
|
+
};
|
|
23
|
+
default:
|
|
24
|
+
return pluginState;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/editor-plugin-table"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
8
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
9
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
10
|
+
import type { ContentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
11
|
+
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
12
|
+
import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
13
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
14
|
+
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
15
|
+
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
16
|
+
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
17
|
+
|
|
18
|
+
// @public (undocumented)
|
|
19
|
+
type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
|
|
20
|
+
|
|
21
|
+
// @public (undocumented)
|
|
22
|
+
type PermittedLayoutsDescriptor = 'all' | TableLayout[];
|
|
23
|
+
|
|
24
|
+
// @public (undocumented)
|
|
25
|
+
interface PluginConfig {
|
|
26
|
+
// (undocumented)
|
|
27
|
+
advanced?: boolean;
|
|
28
|
+
// (undocumented)
|
|
29
|
+
allowAddColumnWithCustomStep?: boolean;
|
|
30
|
+
// (undocumented)
|
|
31
|
+
allowBackgroundColor?: boolean;
|
|
32
|
+
// (undocumented)
|
|
33
|
+
allowCellOptionsInFloatingToolbar?: boolean;
|
|
34
|
+
// (undocumented)
|
|
35
|
+
allowCollapse?: boolean;
|
|
36
|
+
// (undocumented)
|
|
37
|
+
allowColumnResizing?: boolean;
|
|
38
|
+
// (undocumented)
|
|
39
|
+
allowColumnSorting?: boolean;
|
|
40
|
+
// (undocumented)
|
|
41
|
+
allowControls?: boolean;
|
|
42
|
+
// (undocumented)
|
|
43
|
+
allowDistributeColumns?: boolean;
|
|
44
|
+
// (undocumented)
|
|
45
|
+
allowHeaderColumn?: boolean;
|
|
46
|
+
// (undocumented)
|
|
47
|
+
allowHeaderRow?: boolean;
|
|
48
|
+
// (undocumented)
|
|
49
|
+
allowMergeCells?: boolean;
|
|
50
|
+
// (undocumented)
|
|
51
|
+
allowNumberColumn?: boolean;
|
|
52
|
+
// (undocumented)
|
|
53
|
+
isHeaderRowRequired?: boolean;
|
|
54
|
+
// (undocumented)
|
|
55
|
+
permittedLayouts?: PermittedLayoutsDescriptor;
|
|
56
|
+
// (undocumented)
|
|
57
|
+
stickyHeaders?: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// @public (undocumented)
|
|
61
|
+
export type TablePlugin = NextEditorPlugin<'table', {
|
|
62
|
+
pluginConfiguration: TablePluginOptions | undefined;
|
|
63
|
+
actions: {
|
|
64
|
+
insertTable: InsertTableAction;
|
|
65
|
+
};
|
|
66
|
+
dependencies: [
|
|
67
|
+
AnalyticsPlugin,
|
|
68
|
+
ContentInsertionPlugin,
|
|
69
|
+
WidthPlugin,
|
|
70
|
+
GuidelinePlugin,
|
|
71
|
+
SelectionPlugin
|
|
72
|
+
];
|
|
73
|
+
}>;
|
|
74
|
+
|
|
75
|
+
// @public (undocumented)
|
|
76
|
+
interface TablePluginOptions {
|
|
77
|
+
// (undocumented)
|
|
78
|
+
allowContextualMenu?: boolean;
|
|
79
|
+
// (undocumented)
|
|
80
|
+
breakoutEnabled?: boolean;
|
|
81
|
+
// (undocumented)
|
|
82
|
+
dragAndDropEnabled?: boolean;
|
|
83
|
+
// (undocumented)
|
|
84
|
+
fullWidthEnabled?: boolean;
|
|
85
|
+
// (undocumented)
|
|
86
|
+
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
87
|
+
// (undocumented)
|
|
88
|
+
tableOptions: PluginConfig;
|
|
89
|
+
// (undocumented)
|
|
90
|
+
tableResizingEnabled?: boolean;
|
|
91
|
+
// (undocumented)
|
|
92
|
+
wasFullWidthEnabled?: boolean;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// @public
|
|
96
|
+
export const tablesPlugin: TablePlugin;
|
|
97
|
+
|
|
98
|
+
// (No @packageDocumentation comment for this package)
|
|
99
|
+
|
|
100
|
+
```
|