@atlaskit/editor-plugin-table 0.0.1 → 0.0.3
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 +42 -15
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/index.js +287 -255
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +2 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/index.js +41 -15
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/index.d.ts +1 -2
- package/dist/types-ts4.0/index.d.ts +1 -0
- package/dist/types-ts4.0/plugins/plugin-key.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/commands/clear.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/commands/collapse.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/commands/go-to-next-cell.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/commands/hover.d.ts +8 -0
- package/dist/types-ts4.0/plugins/table/commands/index.d.ts +7 -0
- package/dist/types-ts4.0/plugins/table/commands/insert.d.ts +10 -0
- package/dist/types-ts4.0/plugins/table/commands/misc.d.ts +27 -0
- package/dist/types-ts4.0/plugins/table/commands/selection.d.ts +8 -0
- package/dist/types-ts4.0/plugins/table/commands/sort.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/commands/split-cell.d.ts +6 -0
- package/dist/types-ts4.0/plugins/table/commands/toggle.d.ts +12 -0
- package/dist/types-ts4.0/plugins/table/commands-with-analytics.d.ts +26 -0
- package/dist/types-ts4.0/plugins/table/create-plugin-config.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/event-handlers.d.ts +16 -0
- package/dist/types-ts4.0/plugins/table/handlers.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/index.d.ts +17 -0
- package/dist/types-ts4.0/plugins/table/nodeviews/OverflowShadowsObserver.d.ts +26 -0
- package/dist/types-ts4.0/plugins/table/nodeviews/TableComponent.d.ts +72 -0
- package/dist/types-ts4.0/plugins/table/nodeviews/__mocks__/OverflowShadowsObserver.d.ts +9 -0
- package/dist/types-ts4.0/plugins/table/nodeviews/__mocks__/OverridableMock.d.ts +9 -0
- package/dist/types-ts4.0/plugins/table/nodeviews/table.d.ts +31 -0
- package/dist/types-ts4.0/plugins/table/nodeviews/tableCell.d.ts +19 -0
- package/dist/types-ts4.0/plugins/table/nodeviews/types.d.ts +23 -0
- package/dist/types-ts4.0/plugins/table/nodeviews/update-overflow-shadows.d.ts +8 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/plugin.d.ts +7 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/column-controls.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/column-resizing.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/compose-decorations.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/index.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/types.d.ts +6 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/default-table-selection.d.ts +5 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/keymap.d.ts +5 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/main.d.ts +8 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/plugin-factory.d.ts +1 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +15 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/commands.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/index.d.ts +6 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +6 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +65 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/plugin-key.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/plugin-state.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/types.d.ts +16 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/util.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-local-id.d.ts +22 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/commands.d.ts +25 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/index.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/plugin-factory.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/plugin-key.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/plugin.d.ts +6 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/reducer.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +8 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/column-state.d.ts +14 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/content-width.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +13 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/index.d.ts +12 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +22 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/resize-logic.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +29 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +17 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +22 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.d.ts +1 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-selection-keymap.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/reducer.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/todo-stubs.d.ts +1 -0
- package/dist/types-ts4.0/plugins/table/toolbar.d.ts +36 -0
- package/dist/types-ts4.0/plugins/table/transforms/column-width.d.ts +18 -0
- package/dist/types-ts4.0/plugins/table/transforms/delete-columns.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/transforms/delete-rows.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/transforms/fix-tables.d.ts +10 -0
- package/dist/types-ts4.0/plugins/table/transforms/index.d.ts +7 -0
- package/dist/types-ts4.0/plugins/table/transforms/merge.d.ts +5 -0
- package/dist/types-ts4.0/plugins/table/transforms/metadata.d.ts +21 -0
- package/dist/types-ts4.0/plugins/table/transforms/replace-table.d.ts +5 -0
- package/dist/types-ts4.0/plugins/table/transforms/split.d.ts +9 -0
- package/dist/types-ts4.0/plugins/table/types.d.ts +328 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingContextualButton/index.d.ts +29 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingContextualButton/styles.d.ts +1 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +87 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingContextualMenu/index.d.ts +22 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingContextualMenu/styles.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +14 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.d.ts +10 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingDeleteButton/index.d.ts +54 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingDeleteButton/types.d.ts +1 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +12 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingInsertButton/index.d.ts +35 -0
- package/dist/types-ts4.0/plugins/table/ui/LayoutButton/index.d.ts +21 -0
- package/dist/types-ts4.0/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +19 -0
- package/dist/types-ts4.0/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +21 -0
- package/dist/types-ts4.0/plugins/table/ui/TableFloatingControls/RowControls/index.d.ts +17 -0
- package/dist/types-ts4.0/plugins/table/ui/TableFloatingControls/index.d.ts +40 -0
- package/dist/types-ts4.0/plugins/table/ui/common-styles.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/ui/consts.d.ts +39 -0
- package/dist/types-ts4.0/plugins/table/ui/messages.d.ts +38 -0
- package/dist/types-ts4.0/plugins/table/ui/ui-styles.d.ts +15 -0
- package/dist/types-ts4.0/plugins/table/utils/analytics.d.ts +18 -0
- package/dist/types-ts4.0/plugins/table/utils/collapse.d.ts +29 -0
- package/dist/types-ts4.0/plugins/table/utils/column-controls.d.ts +10 -0
- package/dist/types-ts4.0/plugins/table/utils/decoration.d.ts +16 -0
- package/dist/types-ts4.0/plugins/table/utils/dom.d.ts +20 -0
- package/dist/types-ts4.0/plugins/table/utils/get-allow-add-column-custom-step.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/utils/index.d.ts +11 -0
- package/dist/types-ts4.0/plugins/table/utils/nodes.d.ts +12 -0
- package/dist/types-ts4.0/plugins/table/utils/paste.d.ts +14 -0
- package/dist/types-ts4.0/plugins/table/utils/referentiality.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/utils/row-controls.d.ts +16 -0
- package/dist/types-ts4.0/plugins/table/utils/selection.d.ts +6 -0
- package/dist/types-ts4.0/plugins/table/utils/table.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/utils/update-plugin-state-decorations.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table-plugin.d.ts +2 -0
- package/dist/types-ts4.0/types.d.ts +3 -0
- package/examples/99-testing.tsx +227 -0
- package/package.json +16 -3
- package/report.api.md +61 -24
- package/src/plugins/table/__tests__/integration/__fixtures__/auto-size-documents.ts +439 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/basic-table.ts +120 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/empty-paragraph-underneath-table.ts +396 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/even-columns.ts +493 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/layout-documents.ts +607 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/merged-rows-and-cols-document.ts +343 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/nested-in-extension.ts +163 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/paragraph-and-table-adf.json +130 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/resize-documents.ts +1610 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/scale.ts +825 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/table-inside-layout.ts +145 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/table-with-min-width-columns-document.ts +175 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/table-with-multiline-date.adf.json +168 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/table-with-text-and-empty-row.ts +216 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/auto-size.ts.snap +609 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/change-date-inside-table.ts.snap +173 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/copy-button.ts.snap +421 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/delete-columns.ts.snap +818 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/delete-last-column-in-full-width.ts.snap +119 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/delete-last-column-with-empty-action.ts.snap +119 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/delete-last-row-with-empty-action.ts.snap +227 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/delete-rows.ts.snap +959 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/delete-table-when-selected.ts.snap +101 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/deleting-empty-paragraph-under-table.ts.snap +502 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/even-columns.ts.snap +645 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/insert-cell-header-with-strong-mark.ts.snap +172 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/insert-row-inside-layout.ts.snap +238 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/layout.ts.snap +1645 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/resize.ts.snap +2674 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/scale.ts.snap +1083 -0
- package/src/plugins/table/__tests__/integration/arrow-down-into-table.ts +38 -0
- package/src/plugins/table/__tests__/integration/auto-size.ts +87 -0
- package/src/plugins/table/__tests__/integration/block-node-selection.ts +162 -163
- package/src/plugins/table/__tests__/integration/cell-selection.ts +101 -0
- package/src/plugins/table/__tests__/integration/change-date-inside-table.ts +47 -0
- package/src/plugins/table/__tests__/integration/copy-button.ts +179 -0
- package/src/plugins/table/__tests__/integration/delete-columns.ts +95 -0
- package/src/plugins/table/__tests__/integration/delete-last-column-in-full-width.ts +70 -0
- package/src/plugins/table/__tests__/integration/delete-last-column-with-empty-action.ts +58 -0
- package/src/plugins/table/__tests__/integration/delete-last-row-with-empty-action.ts +97 -0
- package/src/plugins/table/__tests__/integration/delete-rows.ts +122 -0
- package/src/plugins/table/__tests__/integration/delete-table-when-selected.ts +110 -0
- package/src/plugins/table/__tests__/integration/deleting-empty-paragraph-under-table.ts +86 -0
- package/src/plugins/table/__tests__/integration/even-columns.ts +72 -0
- package/src/plugins/table/__tests__/integration/insert-cell-header-with-strong-mark.ts +40 -0
- package/src/plugins/table/__tests__/integration/insert-long-smart-link.ts +52 -0
- package/src/plugins/table/__tests__/integration/insert-row-inside-layout.ts +47 -0
- package/src/plugins/table/__tests__/integration/layout.ts +224 -0
- package/src/plugins/table/__tests__/integration/resize-handler.ts +101 -0
- package/src/plugins/table/__tests__/integration/resize.ts +342 -0
- package/src/plugins/table/__tests__/integration/scale.ts +67 -0
- package/src/plugins/table/__tests__/integration/table-controls-selection.ts +70 -0
- package/src/plugins/table/__tests__/unit/commands/insert.ts +0 -1
- package/src/plugins/table/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +2 -0
- package/src/plugins/table/index.tsx +322 -295
- package/src/plugins/table/ui/FloatingContextualButton/index.tsx +2 -2
- package/types/package.json +8 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import type { Schema } from 'prosemirror-model';
|
|
4
|
+
import type { EditorView } from 'prosemirror-view';
|
|
4
5
|
|
|
5
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
7
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
@@ -68,346 +69,372 @@ interface TablePluginOptions {
|
|
|
68
69
|
wasFullWidthEnabled?: boolean;
|
|
69
70
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
70
71
|
editorSelectionAPI?: EditorSelectionAPI;
|
|
71
|
-
getEditorContainerWidth?: GetEditorContainerWidth;
|
|
72
72
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
const defaultGetEditorContainerWidth = () => {
|
|
76
|
-
return {
|
|
77
|
-
width: document?.body?.offsetWidth || 500,
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
75
|
const defaultGetEditorFeatureFlags = () => ({});
|
|
81
76
|
|
|
82
|
-
const tablesPlugin = (options?: TablePluginOptions): EditorPlugin =>
|
|
83
|
-
|
|
77
|
+
const tablesPlugin = (options?: TablePluginOptions): EditorPlugin => {
|
|
78
|
+
const editorViewRef: Record<'current', EditorView | null> = { current: null };
|
|
79
|
+
const defaultGetEditorContainerWidth: GetEditorContainerWidth = () => {
|
|
80
|
+
if (!editorViewRef.current) {
|
|
81
|
+
return {
|
|
82
|
+
width: document?.body?.offsetWidth || 500,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const {
|
|
87
|
+
current: { state },
|
|
88
|
+
} = editorViewRef;
|
|
89
|
+
|
|
90
|
+
// TODO: ED-15663
|
|
91
|
+
// Please, do not copy or use this kind of code below
|
|
92
|
+
// @ts-ignore
|
|
93
|
+
return (state as any)['widthPlugin$'];
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
name: 'table',
|
|
84
98
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
nodes() {
|
|
100
|
+
return [
|
|
101
|
+
{ name: 'table', node: table },
|
|
102
|
+
{ name: 'tableHeader', node: tableHeader },
|
|
103
|
+
{ name: 'tableRow', node: tableRow },
|
|
104
|
+
{ name: 'tableCell', node: tableCell },
|
|
105
|
+
];
|
|
106
|
+
},
|
|
93
107
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
dispatchAnalyticsEvent,
|
|
100
|
-
dispatch,
|
|
101
|
-
portalProviderAPI,
|
|
102
|
-
eventDispatcher,
|
|
103
|
-
}) => {
|
|
104
|
-
const {
|
|
105
|
-
fullWidthEnabled,
|
|
106
|
-
wasFullWidthEnabled,
|
|
107
|
-
breakoutEnabled,
|
|
108
|
-
tableOptions,
|
|
109
|
-
editorAnalyticsAPI,
|
|
110
|
-
getEditorFeatureFlags,
|
|
111
|
-
} = options || ({} as TablePluginOptions);
|
|
112
|
-
return createPlugin(
|
|
108
|
+
pmPlugins() {
|
|
109
|
+
const plugins: ReturnType<NonNullable<EditorPlugin['pmPlugins']>> = [
|
|
110
|
+
{
|
|
111
|
+
name: 'table',
|
|
112
|
+
plugin: ({
|
|
113
113
|
dispatchAnalyticsEvent,
|
|
114
114
|
dispatch,
|
|
115
115
|
portalProviderAPI,
|
|
116
116
|
eventDispatcher,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
117
|
+
}) => {
|
|
118
|
+
const {
|
|
119
|
+
fullWidthEnabled,
|
|
120
|
+
wasFullWidthEnabled,
|
|
121
|
+
breakoutEnabled,
|
|
122
|
+
tableOptions,
|
|
123
|
+
editorAnalyticsAPI,
|
|
124
|
+
getEditorFeatureFlags,
|
|
125
|
+
} = options || ({} as TablePluginOptions);
|
|
126
|
+
return createPlugin(
|
|
127
|
+
dispatchAnalyticsEvent,
|
|
128
|
+
dispatch,
|
|
129
|
+
portalProviderAPI,
|
|
130
|
+
eventDispatcher,
|
|
131
|
+
pluginConfig(tableOptions),
|
|
132
|
+
|
|
133
|
+
defaultGetEditorContainerWidth,
|
|
134
|
+
getEditorFeatureFlags || defaultGetEditorFeatureFlags,
|
|
135
|
+
breakoutEnabled,
|
|
136
|
+
fullWidthEnabled,
|
|
137
|
+
wasFullWidthEnabled,
|
|
138
|
+
editorAnalyticsAPI,
|
|
139
|
+
);
|
|
140
|
+
},
|
|
125
141
|
},
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
: undefined;
|
|
142
|
+
{
|
|
143
|
+
name: 'tablePMColResizing',
|
|
144
|
+
plugin: ({ dispatch }) => {
|
|
145
|
+
const {
|
|
146
|
+
fullWidthEnabled,
|
|
147
|
+
tableOptions,
|
|
148
|
+
editorAnalyticsAPI,
|
|
149
|
+
getEditorFeatureFlags,
|
|
150
|
+
} = options || ({} as TablePluginOptions);
|
|
151
|
+
const { allowColumnResizing } = pluginConfig(tableOptions);
|
|
152
|
+
return allowColumnResizing
|
|
153
|
+
? createFlexiResizingPlugin(
|
|
154
|
+
dispatch,
|
|
155
|
+
{
|
|
156
|
+
lastColumnResizable: !fullWidthEnabled,
|
|
157
|
+
} as ColumnResizingPluginState,
|
|
158
|
+
defaultGetEditorContainerWidth,
|
|
159
|
+
getEditorFeatureFlags || defaultGetEditorFeatureFlags,
|
|
160
|
+
editorAnalyticsAPI,
|
|
161
|
+
)
|
|
162
|
+
: undefined;
|
|
163
|
+
},
|
|
149
164
|
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
{ name: 'tableEditing', plugin: () => tableEditing() as SafePlugin },
|
|
167
|
-
|
|
168
|
-
{
|
|
169
|
-
name: 'tableStickyHeaders',
|
|
170
|
-
plugin: ({ dispatch, eventDispatcher }) =>
|
|
171
|
-
options && options.tableOptions.stickyHeaders
|
|
172
|
-
? createStickyHeadersPlugin(
|
|
173
|
-
dispatch,
|
|
174
|
-
eventDispatcher,
|
|
175
|
-
() => [],
|
|
176
|
-
options?.getEditorFeatureFlags || defaultGetEditorFeatureFlags,
|
|
177
|
-
)
|
|
178
|
-
: undefined,
|
|
179
|
-
},
|
|
180
|
-
|
|
181
|
-
{
|
|
182
|
-
name: 'tableLocalId',
|
|
183
|
-
plugin: ({ dispatch }) => createTableLocalIdPlugin(dispatch),
|
|
184
|
-
},
|
|
185
|
-
];
|
|
165
|
+
{ name: 'tableEditing', plugin: () => createDecorationsPlugin() },
|
|
166
|
+
// Needs to be lower priority than editor-tables.tableEditing
|
|
167
|
+
// plugin as it is currently swallowing backspace events inside tables
|
|
168
|
+
{
|
|
169
|
+
name: 'tableKeymap',
|
|
170
|
+
plugin: () =>
|
|
171
|
+
keymapPlugin(
|
|
172
|
+
defaultGetEditorContainerWidth,
|
|
173
|
+
options?.editorAnalyticsAPI,
|
|
174
|
+
),
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: 'tableSelectionKeymap',
|
|
178
|
+
plugin: () => tableSelectionKeymapPlugin(options?.editorSelectionAPI),
|
|
179
|
+
},
|
|
180
|
+
{ name: 'tableEditing', plugin: () => tableEditing() as SafePlugin },
|
|
186
181
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
182
|
+
{
|
|
183
|
+
name: 'tableStickyHeaders',
|
|
184
|
+
plugin: ({ dispatch, eventDispatcher }) =>
|
|
185
|
+
options && options.tableOptions.stickyHeaders
|
|
186
|
+
? createStickyHeadersPlugin(
|
|
187
|
+
dispatch,
|
|
188
|
+
eventDispatcher,
|
|
189
|
+
() => [],
|
|
190
|
+
options?.getEditorFeatureFlags ||
|
|
191
|
+
defaultGetEditorFeatureFlags,
|
|
192
|
+
)
|
|
193
|
+
: undefined,
|
|
194
|
+
},
|
|
190
195
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
plugins.push({
|
|
195
|
-
name: 'tableSafariDelayedDomSelectionSyncingWorkaround',
|
|
196
|
-
plugin: () => {
|
|
197
|
-
return createTableSafariDelayedDomSelectionSyncingWorkaroundPlugin();
|
|
196
|
+
{
|
|
197
|
+
name: 'tableLocalId',
|
|
198
|
+
plugin: ({ dispatch }) => createTableLocalIdPlugin(dispatch),
|
|
198
199
|
},
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
200
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
201
|
+
{
|
|
202
|
+
name: 'tableGetEditorViewReferencePlugin',
|
|
203
|
+
plugin: () => {
|
|
204
|
+
return new SafePlugin({
|
|
205
|
+
view: (editorView) => {
|
|
206
|
+
editorViewRef.current = editorView;
|
|
207
|
+
return {
|
|
208
|
+
destroy: () => {
|
|
209
|
+
editorViewRef.current = null;
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
},
|
|
213
|
+
});
|
|
214
|
+
},
|
|
209
215
|
},
|
|
210
|
-
|
|
211
|
-
}
|
|
216
|
+
];
|
|
212
217
|
|
|
213
|
-
|
|
214
|
-
|
|
218
|
+
// workaround for prosemirrors delayed dom selection syncing during pointer drag
|
|
219
|
+
// causing issues with table selections in Safari
|
|
220
|
+
// https://github.com/ProseMirror/prosemirror-view/commit/885258b80551ac87b81601d3ed25f552aeb22293
|
|
215
221
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
dispatchAnalyticsEvent={dispatchAnalyticsEvent}
|
|
227
|
-
fallbackComponent={null}
|
|
228
|
-
>
|
|
229
|
-
<WithPluginState
|
|
230
|
-
plugins={{
|
|
231
|
-
tablePluginState: pluginKey,
|
|
232
|
-
tableResizingPluginState: tableResizingPluginKey,
|
|
233
|
-
stickyHeadersState: stickyHeadersPluginKey,
|
|
234
|
-
}}
|
|
235
|
-
render={({
|
|
236
|
-
tableResizingPluginState: resizingPluginState,
|
|
237
|
-
stickyHeadersState,
|
|
238
|
-
tablePluginState,
|
|
239
|
-
}) => {
|
|
240
|
-
const { state } = editorView;
|
|
241
|
-
const isDragging = resizingPluginState?.dragging;
|
|
242
|
-
const {
|
|
243
|
-
tableNode,
|
|
244
|
-
tablePos,
|
|
245
|
-
targetCellPosition,
|
|
246
|
-
isContextualMenuOpen,
|
|
247
|
-
layout,
|
|
248
|
-
tableRef,
|
|
249
|
-
pluginConfig,
|
|
250
|
-
insertColumnButtonIndex,
|
|
251
|
-
insertRowButtonIndex,
|
|
252
|
-
isHeaderColumnEnabled,
|
|
253
|
-
isHeaderRowEnabled,
|
|
254
|
-
tableWrapperTarget,
|
|
255
|
-
} = tablePluginState!;
|
|
222
|
+
// NOTE: this workaround can be removed when next upgrading prosemirror as the issue will be fixed
|
|
223
|
+
// https://github.com/ProseMirror/prosemirror-view/pull/116
|
|
224
|
+
if (browser.safari) {
|
|
225
|
+
plugins.push({
|
|
226
|
+
name: 'tableSafariDelayedDomSelectionSyncingWorkaround',
|
|
227
|
+
plugin: () => {
|
|
228
|
+
return createTableSafariDelayedDomSelectionSyncingWorkaroundPlugin();
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
}
|
|
256
232
|
|
|
257
|
-
|
|
233
|
+
// Workaround for table element breaking issue caused by composition event with an inputType of deleteCompositionText.
|
|
234
|
+
// https://github.com/ProseMirror/prosemirror/issues/934
|
|
235
|
+
if (browser.safari) {
|
|
236
|
+
plugins.push({
|
|
237
|
+
name: 'tableSafariDeleteCompositionTextIssueWorkaround',
|
|
238
|
+
plugin: () => {
|
|
239
|
+
return createTableSafariDeleteCompositionTextIssueWorkaroundPlugin();
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
}
|
|
258
243
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
: undefined;
|
|
244
|
+
return plugins;
|
|
245
|
+
},
|
|
262
246
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
247
|
+
contentComponent({
|
|
248
|
+
editorView,
|
|
249
|
+
popupsMountPoint,
|
|
250
|
+
popupsBoundariesElement,
|
|
251
|
+
popupsScrollableElement,
|
|
252
|
+
dispatchAnalyticsEvent,
|
|
253
|
+
}) {
|
|
254
|
+
return (
|
|
255
|
+
<ErrorBoundary
|
|
256
|
+
component={ACTION_SUBJECT.TABLES_PLUGIN}
|
|
257
|
+
dispatchAnalyticsEvent={dispatchAnalyticsEvent}
|
|
258
|
+
fallbackComponent={null}
|
|
259
|
+
>
|
|
260
|
+
<WithPluginState
|
|
261
|
+
plugins={{
|
|
262
|
+
tablePluginState: pluginKey,
|
|
263
|
+
tableResizingPluginState: tableResizingPluginKey,
|
|
264
|
+
stickyHeadersState: stickyHeadersPluginKey,
|
|
265
|
+
}}
|
|
266
|
+
render={({
|
|
267
|
+
tableResizingPluginState: resizingPluginState,
|
|
268
|
+
stickyHeadersState,
|
|
269
|
+
tablePluginState,
|
|
270
|
+
}) => {
|
|
271
|
+
const { state } = editorView;
|
|
272
|
+
const isDragging = resizingPluginState?.dragging;
|
|
273
|
+
const {
|
|
274
|
+
tableNode,
|
|
275
|
+
tablePos,
|
|
276
|
+
targetCellPosition,
|
|
277
|
+
isContextualMenuOpen,
|
|
278
|
+
layout,
|
|
279
|
+
tableRef,
|
|
280
|
+
pluginConfig,
|
|
281
|
+
insertColumnButtonIndex,
|
|
282
|
+
insertRowButtonIndex,
|
|
283
|
+
isHeaderColumnEnabled,
|
|
284
|
+
isHeaderRowEnabled,
|
|
285
|
+
tableWrapperTarget,
|
|
286
|
+
} = tablePluginState!;
|
|
287
|
+
|
|
288
|
+
const { allowControls } = pluginConfig;
|
|
289
|
+
|
|
290
|
+
const stickyHeader = stickyHeadersState
|
|
291
|
+
? findStickyHeaderForTable(stickyHeadersState, tablePos)
|
|
292
|
+
: undefined;
|
|
293
|
+
|
|
294
|
+
return (
|
|
295
|
+
<>
|
|
296
|
+
{targetCellPosition &&
|
|
297
|
+
tableRef &&
|
|
298
|
+
!isDragging &&
|
|
299
|
+
options &&
|
|
300
|
+
options.allowContextualMenu && (
|
|
301
|
+
<FloatingContextualButton
|
|
302
|
+
isNumberColumnEnabled={
|
|
303
|
+
tableNode && tableNode.attrs.isNumberColumnEnabled
|
|
304
|
+
}
|
|
305
|
+
editorView={editorView}
|
|
306
|
+
tableNode={tableNode}
|
|
307
|
+
mountPoint={popupsMountPoint}
|
|
308
|
+
targetCellPosition={targetCellPosition}
|
|
309
|
+
scrollableElement={popupsScrollableElement}
|
|
310
|
+
dispatchAnalyticsEvent={dispatchAnalyticsEvent}
|
|
311
|
+
isContextualMenuOpen={isContextualMenuOpen}
|
|
312
|
+
layout={layout}
|
|
313
|
+
stickyHeader={stickyHeader}
|
|
314
|
+
/>
|
|
315
|
+
)}
|
|
316
|
+
{allowControls && (
|
|
317
|
+
<FloatingInsertButton
|
|
275
318
|
tableNode={tableNode}
|
|
319
|
+
tableRef={tableRef}
|
|
320
|
+
insertColumnButtonIndex={insertColumnButtonIndex}
|
|
321
|
+
insertRowButtonIndex={insertRowButtonIndex}
|
|
322
|
+
isHeaderColumnEnabled={isHeaderColumnEnabled}
|
|
323
|
+
isHeaderRowEnabled={isHeaderRowEnabled}
|
|
324
|
+
editorView={editorView}
|
|
276
325
|
mountPoint={popupsMountPoint}
|
|
277
|
-
|
|
326
|
+
boundariesElement={popupsBoundariesElement}
|
|
278
327
|
scrollableElement={popupsScrollableElement}
|
|
328
|
+
hasStickyHeaders={stickyHeader && stickyHeader.sticky}
|
|
279
329
|
dispatchAnalyticsEvent={dispatchAnalyticsEvent}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
stickyHeader={stickyHeader}
|
|
330
|
+
editorAnalyticsAPI={options?.editorAnalyticsAPI}
|
|
331
|
+
getEditorContainerWidth={defaultGetEditorContainerWidth}
|
|
283
332
|
/>
|
|
284
333
|
)}
|
|
285
|
-
|
|
286
|
-
<FloatingInsertButton
|
|
287
|
-
tableNode={tableNode}
|
|
288
|
-
tableRef={tableRef}
|
|
289
|
-
insertColumnButtonIndex={insertColumnButtonIndex}
|
|
290
|
-
insertRowButtonIndex={insertRowButtonIndex}
|
|
291
|
-
isHeaderColumnEnabled={isHeaderColumnEnabled}
|
|
292
|
-
isHeaderRowEnabled={isHeaderRowEnabled}
|
|
293
|
-
editorView={editorView}
|
|
294
|
-
mountPoint={popupsMountPoint}
|
|
295
|
-
boundariesElement={popupsBoundariesElement}
|
|
296
|
-
scrollableElement={popupsScrollableElement}
|
|
297
|
-
hasStickyHeaders={stickyHeader && stickyHeader.sticky}
|
|
298
|
-
dispatchAnalyticsEvent={dispatchAnalyticsEvent}
|
|
299
|
-
editorAnalyticsAPI={options?.editorAnalyticsAPI}
|
|
300
|
-
getEditorContainerWidth={
|
|
301
|
-
options?.getEditorContainerWidth ||
|
|
302
|
-
defaultGetEditorContainerWidth
|
|
303
|
-
}
|
|
304
|
-
/>
|
|
305
|
-
)}
|
|
306
|
-
<FloatingContextualMenu
|
|
307
|
-
editorView={editorView}
|
|
308
|
-
mountPoint={popupsMountPoint}
|
|
309
|
-
boundariesElement={popupsBoundariesElement}
|
|
310
|
-
targetCellPosition={targetCellPosition}
|
|
311
|
-
isOpen={Boolean(isContextualMenuOpen)}
|
|
312
|
-
pluginConfig={pluginConfig}
|
|
313
|
-
editorAnalyticsAPI={options?.editorAnalyticsAPI}
|
|
314
|
-
getEditorContainerWidth={
|
|
315
|
-
options?.getEditorContainerWidth ||
|
|
316
|
-
defaultGetEditorContainerWidth
|
|
317
|
-
}
|
|
318
|
-
/>
|
|
319
|
-
{allowControls && (
|
|
320
|
-
<FloatingDeleteButton
|
|
334
|
+
<FloatingContextualMenu
|
|
321
335
|
editorView={editorView}
|
|
322
|
-
selection={editorView.state.selection}
|
|
323
|
-
tableRef={tableRef as HTMLTableElement}
|
|
324
336
|
mountPoint={popupsMountPoint}
|
|
325
337
|
boundariesElement={popupsBoundariesElement}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
tableNode && tableNode.attrs.isNumberColumnEnabled
|
|
330
|
-
}
|
|
338
|
+
targetCellPosition={targetCellPosition}
|
|
339
|
+
isOpen={Boolean(isContextualMenuOpen)}
|
|
340
|
+
pluginConfig={pluginConfig}
|
|
331
341
|
editorAnalyticsAPI={options?.editorAnalyticsAPI}
|
|
342
|
+
getEditorContainerWidth={defaultGetEditorContainerWidth}
|
|
332
343
|
/>
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
options &&
|
|
336
|
-
options.breakoutEnabled && (
|
|
337
|
-
<LayoutButton
|
|
344
|
+
{allowControls && (
|
|
345
|
+
<FloatingDeleteButton
|
|
338
346
|
editorView={editorView}
|
|
347
|
+
selection={editorView.state.selection}
|
|
348
|
+
tableRef={tableRef as HTMLTableElement}
|
|
339
349
|
mountPoint={popupsMountPoint}
|
|
340
350
|
boundariesElement={popupsBoundariesElement}
|
|
341
351
|
scrollableElement={popupsScrollableElement}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
!!resizingPluginState && !!resizingPluginState.dragging
|
|
352
|
+
stickyHeaders={stickyHeader}
|
|
353
|
+
isNumberColumnEnabled={
|
|
354
|
+
tableNode && tableNode.attrs.isNumberColumnEnabled
|
|
346
355
|
}
|
|
347
|
-
stickyHeader={stickyHeader}
|
|
348
356
|
editorAnalyticsAPI={options?.editorAnalyticsAPI}
|
|
349
357
|
/>
|
|
350
358
|
)}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
359
|
+
{isLayoutSupported(state) &&
|
|
360
|
+
options &&
|
|
361
|
+
options.breakoutEnabled && (
|
|
362
|
+
<LayoutButton
|
|
363
|
+
editorView={editorView}
|
|
364
|
+
mountPoint={popupsMountPoint}
|
|
365
|
+
boundariesElement={popupsBoundariesElement}
|
|
366
|
+
scrollableElement={popupsScrollableElement}
|
|
367
|
+
targetRef={tableWrapperTarget!}
|
|
368
|
+
layout={layout}
|
|
369
|
+
isResizing={
|
|
370
|
+
!!resizingPluginState &&
|
|
371
|
+
!!resizingPluginState.dragging
|
|
372
|
+
}
|
|
373
|
+
stickyHeader={stickyHeader}
|
|
374
|
+
editorAnalyticsAPI={options?.editorAnalyticsAPI}
|
|
375
|
+
/>
|
|
376
|
+
)}
|
|
377
|
+
</>
|
|
378
|
+
);
|
|
379
|
+
}}
|
|
380
|
+
/>
|
|
381
|
+
</ErrorBoundary>
|
|
382
|
+
);
|
|
383
|
+
},
|
|
373
384
|
|
|
374
|
-
|
|
385
|
+
pluginsOptions: {
|
|
386
|
+
// TODO: ED-14676 This is not the final API design
|
|
387
|
+
// For now, we are using this on (insert-api/api.ts) but we may create a proper place for it
|
|
388
|
+
createNodeHandler: ({
|
|
389
|
+
nodeName,
|
|
375
390
|
schema,
|
|
376
|
-
}
|
|
391
|
+
}: {
|
|
392
|
+
nodeName: string;
|
|
393
|
+
schema: Schema;
|
|
394
|
+
}) => {
|
|
395
|
+
// An EditorPlugin may manage more than one node.
|
|
396
|
+
if (nodeName !== 'table') {
|
|
397
|
+
return null;
|
|
398
|
+
}
|
|
377
399
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
title: formatMessage(messages.table),
|
|
384
|
-
description: formatMessage(messages.tableDescription),
|
|
385
|
-
keywords: ['cell', 'table'],
|
|
386
|
-
priority: 600,
|
|
387
|
-
keyshortcut: tooltip(toggleTable),
|
|
388
|
-
// icon: () => <IconTable />,
|
|
389
|
-
action(insert, state) {
|
|
390
|
-
const tr = insert(
|
|
391
|
-
createTable({
|
|
392
|
-
schema: state.schema,
|
|
393
|
-
}),
|
|
394
|
-
);
|
|
395
|
-
options?.editorAnalyticsAPI?.attachAnalyticsEvent({
|
|
396
|
-
action: ACTION.INSERTED,
|
|
397
|
-
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
398
|
-
actionSubjectId: ACTION_SUBJECT_ID.TABLE,
|
|
399
|
-
attributes: { inputMethod: INPUT_METHOD.QUICK_INSERT },
|
|
400
|
-
eventType: EVENT_TYPE.TRACK,
|
|
401
|
-
})(tr);
|
|
402
|
-
return tr;
|
|
403
|
-
},
|
|
400
|
+
const table = createTable({
|
|
401
|
+
schema,
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
return table;
|
|
404
405
|
},
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
406
|
+
quickInsert: ({ formatMessage }) => [
|
|
407
|
+
{
|
|
408
|
+
id: 'table',
|
|
409
|
+
title: formatMessage(messages.table),
|
|
410
|
+
description: formatMessage(messages.tableDescription),
|
|
411
|
+
keywords: ['cell', 'table'],
|
|
412
|
+
priority: 600,
|
|
413
|
+
keyshortcut: tooltip(toggleTable),
|
|
414
|
+
// icon: () => <IconTable />,
|
|
415
|
+
action(insert, state) {
|
|
416
|
+
const tr = insert(
|
|
417
|
+
createTable({
|
|
418
|
+
schema: state.schema,
|
|
419
|
+
}),
|
|
420
|
+
);
|
|
421
|
+
options?.editorAnalyticsAPI?.attachAnalyticsEvent({
|
|
422
|
+
action: ACTION.INSERTED,
|
|
423
|
+
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
424
|
+
actionSubjectId: ACTION_SUBJECT_ID.TABLE,
|
|
425
|
+
attributes: { inputMethod: INPUT_METHOD.QUICK_INSERT },
|
|
426
|
+
eventType: EVENT_TYPE.TRACK,
|
|
427
|
+
})(tr);
|
|
428
|
+
return tr;
|
|
429
|
+
},
|
|
430
|
+
},
|
|
431
|
+
],
|
|
432
|
+
floatingToolbar: getToolbarConfig(
|
|
433
|
+
defaultGetEditorContainerWidth,
|
|
434
|
+
options?.editorAnalyticsAPI,
|
|
435
|
+
)(pluginConfig(options?.tableOptions)),
|
|
436
|
+
},
|
|
437
|
+
};
|
|
438
|
+
};
|
|
412
439
|
|
|
413
440
|
export default tablesPlugin;
|