@atlaskit/editor-plugin-table 0.0.2 → 0.0.4
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 +13 -0
- package/dist/cjs/plugins/table/index.js +5 -1
- 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 +3 -4
- 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 +5 -4
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +2 -2
- package/dist/esm/version.json +1 -1
- 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 +18 -5
- 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/index.tsx +3 -3
- package/src/plugins/table/ui/FloatingContextualButton/index.tsx +2 -2
- package/types/package.json +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 0.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`06ae7af103f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/06ae7af103f) - [ux][ed-15739] Bring back the table icon to the typeahead menu by moving IconTable component to shared package
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 0.0.3
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
15
|
+
|
|
3
16
|
## 0.0.2
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -27,6 +27,8 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
27
27
|
|
|
28
28
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
29
29
|
|
|
30
|
+
var _icons = require("@atlaskit/editor-common/icons");
|
|
31
|
+
|
|
30
32
|
var _createPluginConfig = require("./create-plugin-config");
|
|
31
33
|
|
|
32
34
|
var _tableLocalId = require("./pm-plugins/table-local-id");
|
|
@@ -345,7 +347,9 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
345
347
|
keywords: ['cell', 'table'],
|
|
346
348
|
priority: 600,
|
|
347
349
|
keyshortcut: (0, _keymaps.tooltip)(_keymaps.toggleTable),
|
|
348
|
-
|
|
350
|
+
icon: function icon() {
|
|
351
|
+
return /*#__PURE__*/_react.default.createElement(_icons.IconTable, null);
|
|
352
|
+
},
|
|
349
353
|
action: function action(insert, state) {
|
|
350
354
|
var _options$editorAnalyt;
|
|
351
355
|
|
|
@@ -118,8 +118,8 @@ var FloatingContextualButtonInner = /*#__PURE__*/function (_React$Component) {
|
|
|
118
118
|
selection: editorView.state.selection.toJSON(),
|
|
119
119
|
position: targetCellPosition,
|
|
120
120
|
docSize: editorView.state.doc.nodeSize,
|
|
121
|
-
error: error.
|
|
122
|
-
errorStack: error.stack
|
|
121
|
+
error: error instanceof Error ? error.message : String(error),
|
|
122
|
+
errorStack: error instanceof Error ? error.stack : undefined
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
125
|
dispatchAnalyticsEvent(payload);
|
package/dist/cjs/version.json
CHANGED
|
@@ -7,9 +7,8 @@ import { table, tableCell, tableHeader, tableRow } from '@atlaskit/adf-schema';
|
|
|
7
7
|
import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
8
8
|
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
9
9
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
10
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
|
+
import { IconTable } from '@atlaskit/editor-common/icons';
|
|
13
12
|
import { pluginConfig } from './create-plugin-config';
|
|
14
13
|
import { createPlugin as createTableLocalIdPlugin } from './pm-plugins/table-local-id';
|
|
15
14
|
import { createPlugin as createTableSafariDelayedDomSelectionSyncingWorkaroundPlugin } from './pm-plugins/safari-delayed-dom-selection-syncing-workaround';
|
|
@@ -311,8 +310,8 @@ const tablesPlugin = options => {
|
|
|
311
310
|
keywords: ['cell', 'table'],
|
|
312
311
|
priority: 600,
|
|
313
312
|
keyshortcut: tooltip(toggleTable),
|
|
313
|
+
icon: () => /*#__PURE__*/React.createElement(IconTable, null),
|
|
314
314
|
|
|
315
|
-
// icon: () => <IconTable />,
|
|
316
315
|
action(insert, state) {
|
|
317
316
|
var _options$editorAnalyt;
|
|
318
317
|
|
|
@@ -69,8 +69,8 @@ export class FloatingContextualButtonInner extends React.Component {
|
|
|
69
69
|
selection: editorView.state.selection.toJSON(),
|
|
70
70
|
position: targetCellPosition,
|
|
71
71
|
docSize: editorView.state.doc.nodeSize,
|
|
72
|
-
error: error.
|
|
73
|
-
errorStack: error.stack
|
|
72
|
+
error: error instanceof Error ? error.message : String(error),
|
|
73
|
+
errorStack: error instanceof Error ? error.stack : undefined
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
dispatchAnalyticsEvent(payload);
|
package/dist/es2019/version.json
CHANGED
|
@@ -7,9 +7,8 @@ import { table, tableCell, tableHeader, tableRow } from '@atlaskit/adf-schema';
|
|
|
7
7
|
import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
8
8
|
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
9
9
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
10
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
|
+
import { IconTable } from '@atlaskit/editor-common/icons';
|
|
13
12
|
import { pluginConfig } from './create-plugin-config';
|
|
14
13
|
import { createPlugin as createTableLocalIdPlugin } from './pm-plugins/table-local-id';
|
|
15
14
|
import { createPlugin as createTableSafariDelayedDomSelectionSyncingWorkaroundPlugin } from './pm-plugins/safari-delayed-dom-selection-syncing-workaround';
|
|
@@ -310,7 +309,9 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
310
309
|
keywords: ['cell', 'table'],
|
|
311
310
|
priority: 600,
|
|
312
311
|
keyshortcut: tooltip(toggleTable),
|
|
313
|
-
|
|
312
|
+
icon: function icon() {
|
|
313
|
+
return /*#__PURE__*/React.createElement(IconTable, null);
|
|
314
|
+
},
|
|
314
315
|
action: function action(insert, state) {
|
|
315
316
|
var _options$editorAnalyt;
|
|
316
317
|
|
|
@@ -91,8 +91,8 @@ export var FloatingContextualButtonInner = /*#__PURE__*/function (_React$Compone
|
|
|
91
91
|
selection: editorView.state.selection.toJSON(),
|
|
92
92
|
position: targetCellPosition,
|
|
93
93
|
docSize: editorView.state.doc.nodeSize,
|
|
94
|
-
error: error.
|
|
95
|
-
errorStack: error.stack
|
|
94
|
+
error: error instanceof Error ? error.message : String(error),
|
|
95
|
+
errorStack: error instanceof Error ? error.stack : undefined
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
dispatchAnalyticsEvent(payload);
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as tablesPlugin } from './plugins/table-plugin';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { EditorState, PluginKey } from 'prosemirror-state';
|
|
2
|
+
import { TablePluginState } from '../types';
|
|
3
|
+
export declare const pluginKey: PluginKey<TablePluginState, any>;
|
|
4
|
+
export declare const getPluginState: (state: EditorState) => TablePluginState | undefined | null;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Direction } from '@atlaskit/editor-tables/types';
|
|
2
|
+
import { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
export declare const goToNextCell: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (direction: Direction) => Command;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CellColumnPositioning } from '../types';
|
|
2
|
+
export declare const hoverMergedCells: () => import("@atlaskit/editor-common/types").Command;
|
|
3
|
+
export declare const hoverColumns: (hoveredColumns: number[], isInDanger?: boolean | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
4
|
+
export declare const hoverRows: (hoveredRows: number[], isInDanger?: boolean | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
5
|
+
export declare const hoverTable: (isInDanger?: boolean | undefined, isSelected?: boolean | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
6
|
+
export declare const clearHoverSelection: () => import("@atlaskit/editor-common/types").Command;
|
|
7
|
+
export declare const showResizeHandleLine: (cellColumnPositioning: CellColumnPositioning) => import("@atlaskit/editor-common/types").Command;
|
|
8
|
+
export declare const hideResizeHandleLine: () => import("@atlaskit/editor-common/types").Command;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { hoverColumns, hoverRows, hoverTable, hoverMergedCells, clearHoverSelection, showResizeHandleLine, hideResizeHandleLine, } from './hover';
|
|
2
|
+
export { insertColumn, insertRow, createTable } from './insert';
|
|
3
|
+
export { getNextLayout, toggleContextualMenu, toggleHeaderColumn, toggleHeaderRow, toggleNumberColumn, toggleTableLayout, } from './toggle';
|
|
4
|
+
export { clearMultipleCells } from './clear';
|
|
5
|
+
export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectRow, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations, } from './misc';
|
|
6
|
+
export { sortByColumn } from './sort';
|
|
7
|
+
export { goToNextCell } from './go-to-next-cell';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Transaction } from 'prosemirror-state';
|
|
2
|
+
import { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
import { EditorView } from 'prosemirror-view';
|
|
4
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
|
+
export declare function addColumnAt(getEditorContainerWidth: GetEditorContainerWidth): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction<any>;
|
|
6
|
+
export declare const addColumnBefore: (getEditorContainerWidth: GetEditorContainerWidth) => Command;
|
|
7
|
+
export declare const addColumnAfter: (getEditorContainerWidth: GetEditorContainerWidth) => Command;
|
|
8
|
+
export declare const insertColumn: (getEditorContainerWidth: GetEditorContainerWidth) => (column: number) => Command;
|
|
9
|
+
export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean) => Command;
|
|
10
|
+
export declare const createTable: () => Command;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Node as PMNode, Schema, Slice } from 'prosemirror-model';
|
|
2
|
+
import { Transaction } from 'prosemirror-state';
|
|
3
|
+
import { ContentNodeWithPos } from 'prosemirror-utils';
|
|
4
|
+
import { EditorView } from 'prosemirror-view';
|
|
5
|
+
import { Command } from '@atlaskit/editor-common/types';
|
|
6
|
+
export declare const setEditorFocus: (editorHasFocus: boolean) => Command;
|
|
7
|
+
export declare const setTableRef: (ref?: HTMLTableElement | undefined) => Command;
|
|
8
|
+
export declare const setCellAttr: (name: string, value: any) => Command;
|
|
9
|
+
export declare const triggerUnlessTableHeader: (command: Command) => Command;
|
|
10
|
+
export declare const transformSliceRemoveCellBackgroundColor: (slice: Slice, schema: Schema) => Slice;
|
|
11
|
+
export declare const transformSliceToAddTableHeaders: (slice: Slice, schema: Schema) => Slice;
|
|
12
|
+
export declare const transformSliceToRemoveColumnsWidths: (slice: Slice, schema: Schema) => Slice;
|
|
13
|
+
export declare const deleteTable: Command;
|
|
14
|
+
export declare const deleteTableIfSelected: Command;
|
|
15
|
+
export declare const convertFirstRowToHeader: (schema: Schema) => (tr: Transaction) => Transaction;
|
|
16
|
+
export declare const moveCursorBackward: Command;
|
|
17
|
+
export declare const setMultipleCellAttrs: (attrs: Object, targetCellPosition?: number | undefined) => Command;
|
|
18
|
+
export declare const selectColumn: (column: number, expand?: boolean | undefined) => Command;
|
|
19
|
+
export declare const selectRow: (row: number, expand?: boolean | undefined) => Command;
|
|
20
|
+
export declare const showInsertColumnButton: (columnIndex: number) => Command;
|
|
21
|
+
export declare const showInsertRowButton: (rowIndex: number) => Command;
|
|
22
|
+
export declare const hideInsertColumnOrRowButton: () => Command;
|
|
23
|
+
export declare const addResizeHandleDecorations: (columnIndex: number) => Command;
|
|
24
|
+
export declare const autoSizeTable: (view: EditorView, node: PMNode, table: HTMLTableElement, basePos: number, opts: {
|
|
25
|
+
containerWidth: number;
|
|
26
|
+
}) => boolean;
|
|
27
|
+
export declare const addBoldInEmptyHeaderCells: (tableCellHeader: ContentNodeWithPos) => Command;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
|
+
import { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
3
|
+
export declare enum TableSelectionDirection {
|
|
4
|
+
TopToBottom = "TopToBottom",
|
|
5
|
+
BottomToTop = "BottomToTop"
|
|
6
|
+
}
|
|
7
|
+
export declare const arrowLeftFromTable: (editorSelectionAPI: EditorSelectionAPI | undefined | null) => () => Command;
|
|
8
|
+
export declare const arrowRightFromTable: (editorSelectionAPI: EditorSelectionAPI | undefined | null) => () => Command;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Command } from '@atlaskit/editor-common/types';
|
|
2
|
+
/**
|
|
3
|
+
* We need to split cell keeping the right type of cell given current table configuration.
|
|
4
|
+
* We are using editor-tables splitCellWithType that allows you to choose what cell type should be.
|
|
5
|
+
*/
|
|
6
|
+
export declare const splitCell: Command;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TableLayout } from '@atlaskit/adf-schema';
|
|
2
|
+
import { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
/**
|
|
4
|
+
* Table layout toggle logic
|
|
5
|
+
* default -> wide -> full-width -> default
|
|
6
|
+
*/
|
|
7
|
+
export declare const getNextLayout: (currentLayout: TableLayout) => TableLayout;
|
|
8
|
+
export declare const toggleHeaderRow: Command;
|
|
9
|
+
export declare const toggleHeaderColumn: Command;
|
|
10
|
+
export declare const toggleNumberColumn: Command;
|
|
11
|
+
export declare const toggleTableLayout: Command;
|
|
12
|
+
export declare const toggleContextualMenu: () => Command;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import { InsertRowMethods, InsertRowOptions, RowInsertPosition } from './types';
|
|
6
|
+
import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
|
|
7
|
+
import { ResizeStateWithAnalytics } from './pm-plugins/table-resizing/utils';
|
|
8
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
9
|
+
export declare const emptyMultipleCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB, targetCellPosition?: number | undefined) => Command;
|
|
10
|
+
export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => Command;
|
|
11
|
+
export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
12
|
+
export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (cellColor: string, targetCellPosition?: number | undefined) => Command;
|
|
13
|
+
export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
|
|
14
|
+
export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
|
|
15
|
+
export declare const insertColumnWithAnalytics: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB, position: number) => Command;
|
|
16
|
+
export declare const deleteRowsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB, rect: Rect, isHeaderRowRequired: boolean) => Command;
|
|
17
|
+
export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB, rect: Rect) => Command;
|
|
18
|
+
export declare const deleteTableWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
19
|
+
export declare const deleteTableIfSelectedWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.FLOATING_TB | INPUT_METHOD.KEYBOARD) => Command;
|
|
20
|
+
export declare const toggleHeaderRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
21
|
+
export declare const toggleHeaderColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
22
|
+
export declare const toggleNumberColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
23
|
+
export declare const toggleTableLayoutWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
24
|
+
export declare const sortColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU, columnIndex: number, sortOrder: SortOrder) => Command;
|
|
25
|
+
export declare const distributeColumnsWidthsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU, { resizeState, table, attributes }: ResizeStateWithAnalytics) => Command;
|
|
26
|
+
export declare const wrapTableInExpandWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EditorState, Transaction } from 'prosemirror-state';
|
|
2
|
+
import { EditorView } from 'prosemirror-view';
|
|
3
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import { ElementContentRects } from './types';
|
|
5
|
+
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
6
|
+
export declare const handleBlur: (view: EditorView, event: Event) => boolean;
|
|
7
|
+
export declare const handleFocus: (view: EditorView, event: Event) => boolean;
|
|
8
|
+
export declare const handleClick: (view: EditorView, event: Event) => boolean;
|
|
9
|
+
export declare const handleMouseOver: (view: EditorView, mouseEvent: Event) => boolean;
|
|
10
|
+
export declare const handleMouseDown: (_: EditorView, event: Event) => boolean;
|
|
11
|
+
export declare const handleMouseOut: (view: EditorView, mouseEvent: Event) => boolean;
|
|
12
|
+
export declare const handleMouseLeave: (view: EditorView, event: Event) => boolean;
|
|
13
|
+
export declare const handleMouseMove: (getEditorFeatureFlags: GetEditorFeatureFlags) => (view: EditorView, event: Event, tableCellOptimization?: boolean | undefined, elementContentRects?: ElementContentRects | undefined) => boolean;
|
|
14
|
+
export declare function handleTripleClick(view: EditorView, pos: number): boolean;
|
|
15
|
+
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => Transaction;
|
|
16
|
+
export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event, tableCellOptimization?: boolean | undefined, elementContentRects?: ElementContentRects | undefined) => boolean, elementContentRects?: ElementContentRects | undefined) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { EditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
4
|
+
import { PluginConfig } from './types';
|
|
5
|
+
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
6
|
+
interface TablePluginOptions {
|
|
7
|
+
tableOptions: PluginConfig;
|
|
8
|
+
breakoutEnabled?: boolean;
|
|
9
|
+
allowContextualMenu?: boolean;
|
|
10
|
+
fullWidthEnabled?: boolean;
|
|
11
|
+
wasFullWidthEnabled?: boolean;
|
|
12
|
+
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
13
|
+
editorSelectionAPI?: EditorSelectionAPI;
|
|
14
|
+
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
15
|
+
}
|
|
16
|
+
declare const tablesPlugin: (options?: TablePluginOptions | undefined) => EditorPlugin;
|
|
17
|
+
export default tablesPlugin;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ShadowEvent } from '../types';
|
|
2
|
+
export declare class OverflowShadowsObserver {
|
|
3
|
+
private tableIntersectionObserver?;
|
|
4
|
+
private updateShadowState;
|
|
5
|
+
private table;
|
|
6
|
+
private wrapper;
|
|
7
|
+
private firstCell;
|
|
8
|
+
private lastCell;
|
|
9
|
+
private getFirstCell;
|
|
10
|
+
private getLastCell;
|
|
11
|
+
private isSticky;
|
|
12
|
+
private stickyRowHeight;
|
|
13
|
+
constructor(updateShadowState: (shadowKey: ShadowEvent, value: boolean) => void, table: HTMLElement, wrapper: HTMLDivElement);
|
|
14
|
+
private init;
|
|
15
|
+
private checkIntersectionEvent;
|
|
16
|
+
private updateStickyShadowsHeightIfChanged;
|
|
17
|
+
private getStickyCell;
|
|
18
|
+
observeCells: (isSticky?: boolean | undefined, hasHeaderRow?: boolean | undefined) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Takes a heightStyle if it can be computed in a less expensive manner,
|
|
21
|
+
* e.g. bounds on an IntersectionObserverEntry, otherwise proceed with
|
|
22
|
+
* reading it from sticky cell
|
|
23
|
+
*/
|
|
24
|
+
updateStickyShadows: (stickyRowHeight?: number | undefined) => void;
|
|
25
|
+
dispose(): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Node as PmNode } from 'prosemirror-model';
|
|
3
|
+
import { EditorView } from 'prosemirror-view';
|
|
4
|
+
import type { EditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
|
+
import { RowStickyState, StickyPluginState } from '../pm-plugins/sticky-headers';
|
|
6
|
+
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
|
+
import { ColumnResizingPluginState, ShadowEvent } from '../types';
|
|
8
|
+
import type { TableColumnOrdering } from '@atlaskit/adf-schema/steps';
|
|
9
|
+
import type { TableOptions } from './types';
|
|
10
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
11
|
+
export interface ComponentProps {
|
|
12
|
+
view: EditorView;
|
|
13
|
+
getNode: () => PmNode;
|
|
14
|
+
allowColumnResizing?: boolean;
|
|
15
|
+
eventDispatcher: EventDispatcher;
|
|
16
|
+
getPos: () => number;
|
|
17
|
+
options?: TableOptions;
|
|
18
|
+
contentDOM: (node: HTMLElement | null) => void;
|
|
19
|
+
containerWidth: EditorContainerWidth;
|
|
20
|
+
allowControls: boolean;
|
|
21
|
+
isHeaderRowEnabled: boolean;
|
|
22
|
+
isHeaderColumnEnabled: boolean;
|
|
23
|
+
isMediaFullscreen?: boolean;
|
|
24
|
+
tableActive: boolean;
|
|
25
|
+
ordering: TableColumnOrdering;
|
|
26
|
+
tableResizingPluginState?: ColumnResizingPluginState;
|
|
27
|
+
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
28
|
+
}
|
|
29
|
+
interface TableState {
|
|
30
|
+
scroll: number;
|
|
31
|
+
tableContainerWidth: string;
|
|
32
|
+
parentWidth?: number;
|
|
33
|
+
isLoading: boolean;
|
|
34
|
+
stickyHeader?: RowStickyState;
|
|
35
|
+
[ShadowEvent.SHOW_BEFORE_SHADOW]: boolean;
|
|
36
|
+
[ShadowEvent.SHOW_AFTER_SHADOW]: boolean;
|
|
37
|
+
}
|
|
38
|
+
declare class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
39
|
+
static displayName: string;
|
|
40
|
+
state: TableState;
|
|
41
|
+
private wrapper?;
|
|
42
|
+
private table?;
|
|
43
|
+
private node;
|
|
44
|
+
private containerWidth?;
|
|
45
|
+
private layoutSize?;
|
|
46
|
+
private overflowShadowsObserver?;
|
|
47
|
+
constructor(props: ComponentProps);
|
|
48
|
+
componentDidMount(): void;
|
|
49
|
+
componentWillUnmount(): void;
|
|
50
|
+
componentDidUpdate(prevProps: ComponentProps): void;
|
|
51
|
+
private updateShadows;
|
|
52
|
+
private updateShadowState;
|
|
53
|
+
onStickyState: (state: StickyPluginState) => void;
|
|
54
|
+
prevTableState: any;
|
|
55
|
+
render(): JSX.Element;
|
|
56
|
+
private getMarginLeft;
|
|
57
|
+
private handleScroll;
|
|
58
|
+
private handleTableResizing;
|
|
59
|
+
private scaleTable;
|
|
60
|
+
private handleAutoSize;
|
|
61
|
+
private handleWindowResize;
|
|
62
|
+
private updateTableContainerWidth;
|
|
63
|
+
private getParentNodeWidth;
|
|
64
|
+
private updateParentWidth;
|
|
65
|
+
private tableNodeLayoutSize;
|
|
66
|
+
private scaleTableDebounced;
|
|
67
|
+
private handleTableResizingDebounced;
|
|
68
|
+
private handleScrollDebounced;
|
|
69
|
+
private handleAutoSizeDebounced;
|
|
70
|
+
private handleWindowResizeDebounced;
|
|
71
|
+
}
|
|
72
|
+
export default TableComponent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OverridableMock } from './OverridableMock';
|
|
2
|
+
export declare class OverflowShadowsObserver extends OverridableMock {
|
|
3
|
+
firstCell: HTMLElement | null;
|
|
4
|
+
lastCell: HTMLElement | null;
|
|
5
|
+
constructor(...inputs: any[]);
|
|
6
|
+
observeCells: any;
|
|
7
|
+
updateStickyShadows: any;
|
|
8
|
+
dispose: any;
|
|
9
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Node as PmNode } from 'prosemirror-model';
|
|
3
|
+
import { EditorView, NodeView } from 'prosemirror-view';
|
|
4
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
5
|
+
import type { getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
6
|
+
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
7
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
8
|
+
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
9
|
+
import { Props, TableOptions } from './types';
|
|
10
|
+
declare type ForwardRef = (node: HTMLElement | null) => void;
|
|
11
|
+
export default class TableView extends ReactNodeView<Props> {
|
|
12
|
+
private table;
|
|
13
|
+
private resizeObserver?;
|
|
14
|
+
private tableRenderOptimization?;
|
|
15
|
+
eventDispatcher?: EventDispatcher;
|
|
16
|
+
getPos: getPosHandlerNode;
|
|
17
|
+
constructor(props: Props);
|
|
18
|
+
getContentDOM(): {
|
|
19
|
+
dom: Node;
|
|
20
|
+
contentDOM?: Node | null | undefined;
|
|
21
|
+
};
|
|
22
|
+
setDomAttrs(node: PmNode): void;
|
|
23
|
+
getNode: () => PmNode<any>;
|
|
24
|
+
render(props: Props, forwardRef: ForwardRef): JSX.Element;
|
|
25
|
+
private hasHoveredRows;
|
|
26
|
+
viewShouldUpdate(nextNode: PmNode): boolean;
|
|
27
|
+
ignoreMutation(): boolean;
|
|
28
|
+
destroy(): void;
|
|
29
|
+
}
|
|
30
|
+
export declare const createTableView: (node: PmNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, options: TableOptions, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags) => NodeView;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Node } from 'prosemirror-model';
|
|
2
|
+
import { EditorView, NodeView } from 'prosemirror-view';
|
|
3
|
+
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
+
import type { getPosHandler } from '@atlaskit/editor-common/types';
|
|
5
|
+
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
6
|
+
export default class TableCellNodeView implements NodeView {
|
|
7
|
+
node: Node;
|
|
8
|
+
dom: HTMLElement;
|
|
9
|
+
contentDOM: HTMLElement;
|
|
10
|
+
getPos: getPosHandler;
|
|
11
|
+
view: EditorView;
|
|
12
|
+
providerFactory?: ProviderFactory;
|
|
13
|
+
observer?: ResizeObserver;
|
|
14
|
+
mouseMoveOptimization?: boolean;
|
|
15
|
+
constructor(node: Node, view: EditorView, getPos: any, getEditorFeatureFlags: GetEditorFeatureFlags, observer?: ResizeObserver);
|
|
16
|
+
private updateNodeView;
|
|
17
|
+
update(node: Node): boolean;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Node as PmNode } from 'prosemirror-model';
|
|
2
|
+
import { EditorView } from 'prosemirror-view';
|
|
3
|
+
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
|
+
import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
5
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
6
|
+
export declare type TableOptions = {
|
|
7
|
+
isBreakoutEnabled?: boolean;
|
|
8
|
+
isFullWidthModeEnabled?: boolean;
|
|
9
|
+
wasFullWidthModeEnabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export interface Props {
|
|
12
|
+
node: PmNode;
|
|
13
|
+
view: EditorView;
|
|
14
|
+
allowColumnResizing?: boolean;
|
|
15
|
+
cellMinWidth?: number;
|
|
16
|
+
portalProviderAPI: PortalProviderAPI;
|
|
17
|
+
eventDispatcher: EventDispatcher;
|
|
18
|
+
getPos: () => number;
|
|
19
|
+
options?: TableOptions;
|
|
20
|
+
tableRenderOptimization?: boolean;
|
|
21
|
+
getEditorContainerWidth: GetEditorContainerWidth;
|
|
22
|
+
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
23
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EditorState } from 'prosemirror-state';
|
|
2
|
+
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
|
+
export declare const updateShadowListForStickyStyles: (heightStyle: string, shadows: HTMLCollection) => void;
|
|
4
|
+
/**
|
|
5
|
+
* Update overflow shadows for a given wrapper & table.
|
|
6
|
+
* if `overflowShadowOptimization` is enabled, this will exit early.
|
|
7
|
+
*/
|
|
8
|
+
export declare const updateOverflowShadows: (getEditorFeatureFlags: GetEditorFeatureFlags) => (editorState: EditorState, wrapper?: HTMLElement | null | undefined, table?: HTMLElement | null | undefined, rightShadows?: NodeListOf<HTMLElement> | null | undefined, leftShadows?: NodeListOf<HTMLElement> | null | undefined) => false | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import { EditorState, PluginKey, Transaction, ReadonlyTransaction } from 'prosemirror-state';
|
|
3
|
+
import { DecorationSet } from 'prosemirror-view';
|
|
4
|
+
export declare const pluginKey: PluginKey<any, any>;
|
|
5
|
+
export declare const getDecorations: (state: EditorState) => DecorationSet;
|
|
6
|
+
export declare const handleDocOrSelectionChanged: (tr: Transaction | ReadonlyTransaction, decorationSet: DecorationSet, oldState: EditorState) => DecorationSet;
|
|
7
|
+
export declare const createPlugin: () => SafePlugin<any, any>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReadonlyTransaction, Transaction } from 'prosemirror-state';
|
|
2
|
+
import { DecorationSet } from 'prosemirror-view';
|
|
3
|
+
export declare type DecorationTransformer = ({ decorationSet, tr, }: {
|
|
4
|
+
decorationSet: DecorationSet;
|
|
5
|
+
tr: Transaction | ReadonlyTransaction;
|
|
6
|
+
}) => DecorationSet;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null): SafePlugin;
|
|
5
|
+
export default keymapPlugin;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
4
|
+
import { PluginConfig } from '../types';
|
|
5
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
6
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
8
|
+
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, breakoutEnabled?: boolean | undefined, fullWidthModeEnabled?: boolean | undefined, previousFullWidthModeEnabled?: boolean | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => SafePlugin<import("../types").TablePluginState, import("prosemirror-model").Schema<any, any>>;
|
|
@@ -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<any>) => import("../types").TablePluginState)) => import("prosemirror-state").SafeStateField<import("../types").TablePluginState, import("prosemirror-model").Schema<any, any>>, createCommand: <A = import("../types").TablePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState<any>>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction<any>, state: import("prosemirror-state").EditorState<any>) => import("prosemirror-state").Transaction<any>) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState<any>) => import("../types").TablePluginState;
|