@atlaskit/editor-plugin-table 0.0.9 → 0.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/.eslintrc.js +35 -0
- package/CHANGELOG.md +29 -0
- package/commands/package.json +14 -0
- package/dist/cjs/plugins/table/commands/hover.js +4 -4
- package/dist/cjs/plugins/table/commands-with-analytics.js +59 -58
- package/dist/cjs/plugins/table/event-handlers.js +0 -1
- package/dist/cjs/plugins/table/index.js +54 -37
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/index.js +9 -1
- package/dist/cjs/plugins/table/toolbar.js +150 -22
- package/dist/cjs/plugins/table/transforms/fix-tables.js +7 -7
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +1 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +4 -6
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +1 -1
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +3 -5
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
- package/dist/cjs/plugins/table/utils/column-controls.js +0 -1
- package/dist/cjs/plugins/table/utils/decoration.js +53 -4
- package/dist/cjs/plugins/table/utils/dom.js +0 -2
- package/dist/cjs/plugins/table/utils/paste.js +0 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/commands/hover.js +4 -4
- package/dist/es2019/plugins/table/commands-with-analytics.js +6 -9
- package/dist/es2019/plugins/table/event-handlers.js +1 -2
- package/dist/es2019/plugins/table/handlers.js +1 -2
- package/dist/es2019/plugins/table/index.js +23 -5
- package/dist/es2019/plugins/table/pm-plugins/keymap.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-local-id.js +1 -3
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/index.js +2 -1
- package/dist/es2019/plugins/table/toolbar.js +133 -16
- package/dist/es2019/plugins/table/transforms/fix-tables.js +2 -4
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +1 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +4 -6
- package/dist/es2019/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +2 -3
- package/dist/es2019/plugins/table/ui/FloatingDeleteButton/index.js +1 -2
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +1 -2
- package/dist/es2019/plugins/table/ui/LayoutButton/index.js +3 -5
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
- package/dist/es2019/plugins/table/utils/column-controls.js +0 -1
- package/dist/es2019/plugins/table/utils/decoration.js +60 -25
- package/dist/es2019/plugins/table/utils/dom.js +0 -2
- package/dist/es2019/plugins/table/utils/paste.js +1 -2
- package/dist/es2019/plugins/table/utils/row-controls.js +1 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/commands/hover.js +4 -4
- package/dist/esm/plugins/table/commands-with-analytics.js +56 -55
- package/dist/esm/plugins/table/event-handlers.js +1 -2
- package/dist/esm/plugins/table/handlers.js +1 -2
- package/dist/esm/plugins/table/index.js +55 -38
- package/dist/esm/plugins/table/pm-plugins/keymap.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-local-id.js +1 -3
- package/dist/esm/plugins/table/pm-plugins/table-resizing/index.js +2 -1
- package/dist/esm/plugins/table/toolbar.js +139 -17
- package/dist/esm/plugins/table/transforms/fix-tables.js +2 -4
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +1 -2
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +4 -6
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +2 -3
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/index.js +1 -2
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +1 -2
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +3 -5
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
- package/dist/esm/plugins/table/utils/column-controls.js +0 -1
- package/dist/esm/plugins/table/utils/decoration.js +50 -4
- package/dist/esm/plugins/table/utils/dom.js +0 -2
- package/dist/esm/plugins/table/utils/paste.js +1 -2
- package/dist/esm/plugins/table/utils/row-controls.js +1 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/commands-with-analytics.d.ts +5 -5
- package/dist/types/plugins/table/pm-plugins/table-resizing/index.d.ts +1 -0
- package/dist/types/plugins/table/toolbar.d.ts +2 -2
- package/dist/types/plugins/table/transforms/fix-tables.d.ts +1 -1
- package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
- package/dist/types-ts4.0/plugins/table/commands-with-analytics.d.ts +5 -5
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/index.d.ts +1 -0
- package/dist/types-ts4.0/plugins/table/toolbar.d.ts +2 -2
- package/dist/types-ts4.0/plugins/table/transforms/fix-tables.d.ts +1 -1
- package/dist/types-ts4.0/plugins/table/utils/decoration.d.ts +1 -1
- package/examples/config.jsonc +14 -0
- package/package.json +15 -11
- package/plugin-key/package.json +14 -0
- package/report.api.md +1 -1
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/auto-size-documents.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/basic-table.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/empty-paragraph-underneath-table.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/even-columns.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/layout-documents.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/merged-rows-and-cols-document.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/nested-in-extension.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/paragraph-and-table-adf.json +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/resize-documents.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/scale.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/table-inside-layout.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/table-with-min-width-columns-document.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/table-with-multiline-date.adf.json +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/table-with-text-and-empty-row.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/auto-size.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/change-date-inside-table.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/copy-button.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-columns.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-last-column-in-full-width.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-last-column-with-empty-action.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-last-row-with-empty-action.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-rows.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-table-when-selected.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/deleting-empty-paragraph-under-table.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/even-columns.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/insert-cell-header-with-strong-mark.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/insert-row-inside-layout.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/layout.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/resize.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/scale.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/arrow-down-into-table.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/auto-size.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/block-node-selection.ts +1 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/cell-selection.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/change-date-inside-table.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/copy-button.ts +1 -1
- package/src/{plugins/table/__tests__ → __tests__}/integration/delete-columns.ts +2 -2
- package/src/{plugins/table/__tests__ → __tests__}/integration/delete-last-column-in-full-width.ts +1 -1
- package/src/{plugins/table/__tests__ → __tests__}/integration/delete-last-column-with-empty-action.ts +1 -1
- package/src/{plugins/table/__tests__ → __tests__}/integration/delete-last-row-with-empty-action.ts +1 -1
- package/src/{plugins/table/__tests__ → __tests__}/integration/delete-rows.ts +2 -2
- package/src/{plugins/table/__tests__ → __tests__}/integration/delete-table-when-selected.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/deleting-empty-paragraph-under-table.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/even-columns.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/insert-cell-header-with-strong-mark.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/insert-long-smart-link.ts +1 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/insert-row-inside-layout.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/layout.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/resize-handler.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/resize.ts +1 -1
- package/src/{plugins/table/__tests__ → __tests__}/integration/scale.ts +0 -0
- package/src/__tests__/integration/table-controls-selection.ts +71 -0
- package/src/__tests__/unit/analytics.ts +8 -9
- package/src/{plugins/table/__tests__ → __tests__}/unit/commands/go-to-next-cell.ts +4 -4
- package/src/{plugins/table/__tests__ → __tests__}/unit/commands/insert.ts +4 -4
- package/src/{plugins/table/__tests__ → __tests__}/unit/commands/misc.ts +12 -6
- package/src/{plugins/table/__tests__ → __tests__}/unit/commands.ts +7 -7
- package/src/__tests__/unit/copy-button.ts +22 -0
- package/src/__tests__/unit/event-handlers.ts +120 -1
- package/src/{plugins/table/__tests__ → __tests__}/unit/get-toolbar-config.ts +8 -3
- package/src/{plugins/table/__tests__ → __tests__}/unit/nodeviews/OverflowShadowsObserver.ts +2 -2
- package/src/{plugins/table/__tests__ → __tests__}/unit/nodeviews/TableComponent.tsx +11 -11
- package/src/{plugins/table/__tests__ → __tests__}/unit/nodeviews/table.ts +5 -5
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/decorations/column-controls.ts +2 -2
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/decorations/column-resizing.ts +9 -6
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/decorations/plugin.ts +5 -5
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/main-with-allow-collapse.ts +4 -4
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/main.ts +6 -6
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +2 -2
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/sticky-headers/tableRow.tsx +16 -13
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/table-local-id.ts +3 -6
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/table-resizing/colgroup.ts +1 -1
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/table-resizing/event-handlers.ts +3 -3
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/table-selection-keymap.ts +3 -3
- package/src/{plugins/table/__tests__ → __tests__}/unit/toolbar.ts +5 -9
- package/src/__tests__/unit/ui/DeleteButton.tsx +35 -0
- package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +26 -64
- package/src/{plugins/table/__tests__ → __tests__}/unit/utils/collapse.ts +2 -2
- package/src/{plugins/table/__tests__ → __tests__}/unit/utils/column-controls.ts +1 -1
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__fixtures__/table-with-100-numbered-list-items.json +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-column-menu-item-should-remove-the-table-column-on-click-1-snap.png +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-column-menu-item-visual-hints-should-be-added-to-the-table-column-on-hover-1-snap.png +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-row-menu-item-should-remove-the-table-row-on-click-1-snap.png +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-row-menu-item-visual-hints-should-be-added-to-the-table-row-on-hover-1-snap.png +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/copy-button-ts-floating-toolbar-copy-button-table-target-node-displays-blue-border-when-copy-button-is-hovered-1-snap.png +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/index-ts-snapshot-test-table-numbered-list-should-not-overflow-table-cell-when-there-are-more-than-100-ordered-list-items-1-snap.png +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/index-ts-snapshot-test-table-numbered-list-should-not-overflow-table-cell-when-there-are-more-than-100-ordered-list-items-2-snap.png +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/index-ts-snapshot-test-table-numbered-list-should-not-overflow-table-cell-when-there-are-more-than-100-ordered-list-items-3-snap.png +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/cell-options-menu.ts +2 -0
- package/src/__tests__/visual-regression/copy-button.ts +181 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/index.ts +3 -1
- package/src/plugins/table/commands/hover.ts +4 -1
- package/src/plugins/table/commands-with-analytics.ts +12 -8
- package/src/plugins/table/event-handlers.ts +0 -1
- package/src/plugins/table/handlers.ts +0 -1
- package/src/plugins/table/index.tsx +28 -2
- package/src/plugins/table/pm-plugins/keymap.ts +1 -1
- package/src/plugins/table/pm-plugins/table-local-id.ts +0 -2
- package/src/plugins/table/pm-plugins/table-resizing/index.ts +1 -0
- package/src/plugins/table/{toolbar.ts → toolbar.tsx} +186 -14
- package/src/plugins/table/transforms/fix-tables.ts +2 -3
- package/src/plugins/table/ui/FloatingContextualButton/index.tsx +0 -1
- package/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx +13 -10
- package/src/plugins/table/ui/FloatingContextualMenu/__tests__/ContextualMenu.tsx +1 -0
- package/src/plugins/table/ui/FloatingContextualMenu/__tests__/FloatingContextualMenu.tsx +1 -0
- package/src/plugins/table/ui/FloatingDeleteButton/DeleteButton.tsx +1 -2
- package/src/plugins/table/ui/FloatingDeleteButton/index.tsx +0 -1
- package/src/plugins/table/ui/FloatingInsertButton/index.tsx +0 -1
- package/src/plugins/table/ui/LayoutButton/index.tsx +2 -4
- package/src/plugins/table/ui/TableFloatingControls/CornerControls/index.tsx +1 -0
- package/src/plugins/table/utils/column-controls.ts +0 -1
- package/src/plugins/table/utils/decoration.ts +44 -5
- package/src/plugins/table/utils/dom.ts +0 -2
- package/src/plugins/table/utils/paste.ts +0 -1
- package/src/plugins/table/utils/row-controls.ts +0 -1
- package/types/package.json +5 -5
- package/ui/common-styles/package.json +14 -0
- package/ui/consts/package.json +14 -0
- package/dist/cjs/plugins/plugin-key.js +0 -17
- package/dist/cjs/plugins/table/todo-stubs.js +0 -10
- package/dist/cjs/types.js +0 -5
- package/dist/es2019/plugins/plugin-key.js +0 -3
- package/dist/es2019/plugins/table/todo-stubs.js +0 -1
- package/dist/es2019/types.js +0 -1
- package/dist/esm/plugins/plugin-key.js +0 -5
- package/dist/esm/plugins/table/todo-stubs.js +0 -1
- package/dist/esm/types.js +0 -1
- package/dist/types/plugins/plugin-key.d.ts +0 -4
- package/dist/types/plugins/table/todo-stubs.d.ts +0 -1
- package/dist/types/types.d.ts +0 -3
- package/dist/types-ts4.0/plugins/plugin-key.d.ts +0 -4
- package/dist/types-ts4.0/plugins/table/todo-stubs.d.ts +0 -1
- package/dist/types-ts4.0/types.d.ts +0 -3
- package/src/plugins/plugin-key.ts +0 -7
- package/src/plugins/table/__tests__/integration/table-controls-selection.ts +0 -70
- package/src/plugins/table/__tests__/unit/event-handlers.ts +0 -130
- package/src/plugins/table/todo-stubs.ts +0 -1
- package/src/types.ts +0 -3
- package/tmp/api-report-tmp.d.ts +0 -91
|
@@ -5,10 +5,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
7
|
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
8
|
-
import { akEditorDefaultLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import { sendLogs } from '../todo-stubs';
|
|
8
|
+
import { akEditorDefaultLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
9
|
+
import { sendLogs } from '@atlaskit/editor-common/utils';
|
|
12
10
|
import { calculateColumnWidth, contentWidth, getCellsRefsInColumn, getLayoutSize } from '../pm-plugins/table-resizing/utils';
|
|
13
11
|
export var fireAnalytics = function fireAnalytics() {
|
|
14
12
|
var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -148,8 +148,7 @@ export var FloatingContextualButtonInner = /*#__PURE__*/function (_React$Compone
|
|
|
148
148
|
key: "shouldComponentUpdate",
|
|
149
149
|
value: function shouldComponentUpdate(nextProps) {
|
|
150
150
|
return this.props.tableNode !== nextProps.tableNode || this.props.targetCellPosition !== nextProps.targetCellPosition || this.props.layout !== nextProps.layout || this.props.isContextualMenuOpen !== nextProps.isContextualMenuOpen || this.props.isNumberColumnEnabled !== nextProps.isNumberColumnEnabled || this.props.stickyHeader !== nextProps.stickyHeader;
|
|
151
|
-
}
|
|
152
|
-
|
|
151
|
+
}
|
|
153
152
|
}]);
|
|
154
153
|
|
|
155
154
|
return FloatingContextualButtonInner;
|
|
@@ -293,14 +293,14 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
293
293
|
break;
|
|
294
294
|
|
|
295
295
|
case 'merge':
|
|
296
|
-
mergeCellsWithAnalytics(editorAnalyticsAPI)(state, dispatch);
|
|
296
|
+
mergeCellsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU)(state, dispatch);
|
|
297
297
|
|
|
298
298
|
_this.toggleOpen();
|
|
299
299
|
|
|
300
300
|
break;
|
|
301
301
|
|
|
302
302
|
case 'split':
|
|
303
|
-
splitCellWithAnalytics(editorAnalyticsAPI)(state, dispatch);
|
|
303
|
+
splitCellWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU)(state, dispatch);
|
|
304
304
|
|
|
305
305
|
_this.toggleOpen();
|
|
306
306
|
|
|
@@ -447,10 +447,8 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
447
447
|
targetCellPosition = _getPluginState4.targetCellPosition;
|
|
448
448
|
|
|
449
449
|
var state = editorView.state,
|
|
450
|
-
dispatch = editorView.dispatch;
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
setColorWithAnalytics(editorAnalyticsAPI)(color, targetCellPosition)(state, dispatch);
|
|
450
|
+
dispatch = editorView.dispatch;
|
|
451
|
+
setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, color, targetCellPosition)(state, dispatch);
|
|
454
452
|
|
|
455
453
|
_this.toggleOpen();
|
|
456
454
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { injectIntl } from 'react-intl-next';
|
|
3
|
-
|
|
2
|
+
import { injectIntl } from 'react-intl-next';
|
|
4
3
|
import { TableCssClassName as ClassName } from '../../types';
|
|
5
4
|
|
|
6
5
|
var DeleteButton = function DeleteButton(_ref) {
|
|
@@ -17,7 +16,7 @@ var DeleteButton = function DeleteButton(_ref) {
|
|
|
17
16
|
onMouseLeave: onMouseLeave
|
|
18
17
|
}, /*#__PURE__*/React.createElement("button", {
|
|
19
18
|
type: "button",
|
|
20
|
-
|
|
19
|
+
"aria-label": formatMessage(removeLabel, {
|
|
21
20
|
0: 1
|
|
22
21
|
}),
|
|
23
22
|
className: ClassName.CONTROLS_DELETE_BUTTON,
|
|
@@ -20,8 +20,7 @@ import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
|
20
20
|
import { getSelectionRect, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
21
21
|
import { createPortal } from 'react-dom';
|
|
22
22
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
23
|
-
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
24
|
-
|
|
23
|
+
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
25
24
|
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
26
25
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
27
26
|
import { clearHoverSelection, hoverColumns, hoverRows } from '../../commands';
|
|
@@ -17,8 +17,7 @@ import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
|
17
17
|
import { findDomRefAtPos } from 'prosemirror-utils';
|
|
18
18
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
19
19
|
import { injectIntl } from 'react-intl-next';
|
|
20
|
-
import { Popup } from '@atlaskit/editor-common/ui';
|
|
21
|
-
|
|
20
|
+
import { Popup } from '@atlaskit/editor-common/ui';
|
|
22
21
|
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
23
22
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
24
23
|
import { insertColumnWithAnalytics, insertRowWithAnalytics } from '../../commands-with-analytics';
|
|
@@ -127,8 +127,7 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
|
127
127
|
}, {
|
|
128
128
|
key: "renderSticky",
|
|
129
129
|
value: function renderSticky(button, targetRef, tableRef) {
|
|
130
|
-
|
|
131
|
-
var title = 'TODO MISSING TITLE';
|
|
130
|
+
var title = this.getTitle();
|
|
132
131
|
|
|
133
132
|
if (!(targetRef instanceof HTMLElement) || !(tableRef instanceof HTMLElement)) {
|
|
134
133
|
return null;
|
|
@@ -157,10 +156,9 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
|
157
156
|
|
|
158
157
|
if (!targetRef) {
|
|
159
158
|
return null;
|
|
160
|
-
}
|
|
161
|
-
|
|
159
|
+
}
|
|
162
160
|
|
|
163
|
-
var title =
|
|
161
|
+
var title = this.getTitle();
|
|
164
162
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
165
163
|
ariaLabel: title,
|
|
166
164
|
target: targetRef,
|
|
@@ -102,7 +102,8 @@ var CornerControlComponent = /*#__PURE__*/function (_Component) {
|
|
|
102
102
|
}),
|
|
103
103
|
style: {
|
|
104
104
|
top: this.props.stickyTop !== undefined ? "".concat(this.props.stickyTop, "px") : undefined
|
|
105
|
-
}
|
|
105
|
+
},
|
|
106
|
+
contentEditable: false
|
|
106
107
|
}, /*#__PURE__*/React.createElement("button", {
|
|
107
108
|
"aria-label": formatMessage(messages.cornerControl),
|
|
108
109
|
type: "button",
|
|
@@ -3,7 +3,6 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
|
3
3
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
4
4
|
import { findDomRefAtPos } from 'prosemirror-utils';
|
|
5
5
|
import { findTable, getCellsInColumn, getSelectionRect, isColumnSelected, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
6
|
-
// import { maphElem } from '@atlaskit/editor-core/src/utils/dom';
|
|
7
6
|
import { maphElem } from '@atlaskit/editor-common/utils';
|
|
8
7
|
import { TableCssClassName as ClassName } from '../types';
|
|
9
8
|
import { tableDeleteButtonSize } from '../ui/consts';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
2
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
2
3
|
import { findTable, getCellsInRow, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
3
4
|
import { Decoration } from 'prosemirror-view';
|
|
4
|
-
// import { nonNullable } from '@atlaskit/editor-core/src/utils';
|
|
5
5
|
import { nonNullable } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { TableCssClassName as ClassName, TableDecorations } from '../types';
|
|
7
7
|
|
|
@@ -26,8 +26,54 @@ export var createCellHoverDecoration = function createCellHoverDecoration(cells,
|
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
|
-
export var createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, danger, selected) {
|
|
30
|
-
|
|
29
|
+
export var createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, tr, danger, selected) {
|
|
30
|
+
var table = findTable(tr.selection);
|
|
31
|
+
|
|
32
|
+
if (!table) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var map = TableMap.get(table.node);
|
|
37
|
+
|
|
38
|
+
var _cells$reduce = cells.reduce(function (_ref, cell) {
|
|
39
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
40
|
+
min = _ref2[0],
|
|
41
|
+
max = _ref2[1];
|
|
42
|
+
|
|
43
|
+
if (min === null || cell.pos < min) {
|
|
44
|
+
min = cell.pos;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (max === null || cell.pos > max) {
|
|
48
|
+
max = cell.pos;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return [min, max];
|
|
52
|
+
}, [null, null]),
|
|
53
|
+
_cells$reduce2 = _slicedToArray(_cells$reduce, 2),
|
|
54
|
+
min = _cells$reduce2[0],
|
|
55
|
+
max = _cells$reduce2[1];
|
|
56
|
+
|
|
57
|
+
if (min === null || max === null) {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
var updatedCells = cells.map(function (x) {
|
|
62
|
+
return x.pos;
|
|
63
|
+
}); // ED-15246 fixed trello card table overflow issue
|
|
64
|
+
// If columns / rows have been merged the hovered selection is different to the actual selection
|
|
65
|
+
// So If the table cells are in danger we want to create a "rectangle" selection
|
|
66
|
+
// to match the "clicked" selection
|
|
67
|
+
|
|
68
|
+
if (danger) {
|
|
69
|
+
var rect = map.rectBetween(min - table.start, max - table.start);
|
|
70
|
+
updatedCells = map.cellsInRect(rect).map(function (x) {
|
|
71
|
+
return x + table.start;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return updatedCells.map(function (pos) {
|
|
76
|
+
var cell = tr.doc.nodeAt(pos);
|
|
31
77
|
var classes = [ClassName.HOVERED_CELL];
|
|
32
78
|
|
|
33
79
|
if (danger) {
|
|
@@ -55,7 +101,7 @@ export var createControlsHoverDecoration = function createControlsHoverDecoratio
|
|
|
55
101
|
break;
|
|
56
102
|
}
|
|
57
103
|
|
|
58
|
-
return Decoration.node(
|
|
104
|
+
return Decoration.node(pos, pos + cell.nodeSize, {
|
|
59
105
|
class: classes.join(' ')
|
|
60
106
|
}, {
|
|
61
107
|
key: key
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// import { containsClassName } from '@atlaskit/editor-core/src/utils';
|
|
2
|
-
// import { closestElement } from '@atlaskit/editor-core/src/utils/dom';
|
|
3
1
|
import { closestElement, containsClassName } from '@atlaskit/editor-common/utils';
|
|
4
2
|
import { TableCssClassName as ClassName } from '../types';
|
|
5
3
|
import { tableToolbarSize } from '../ui/consts';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import { Fragment, Slice } from 'prosemirror-model';
|
|
3
|
-
import { flatten } from 'prosemirror-utils';
|
|
4
|
-
|
|
3
|
+
import { flatten } from 'prosemirror-utils';
|
|
5
4
|
import { flatmap, mapSlice } from '@atlaskit/editor-common/utils';
|
|
6
5
|
import { getPluginState } from '../pm-plugins/plugin-factory'; // lifts up the content of each cell, returning an array of nodes
|
|
7
6
|
|
|
@@ -7,8 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
8
8
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
9
9
|
import { safeInsert } from 'prosemirror-utils';
|
|
10
|
-
import { findTable, getSelectionRect, isRowSelected, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
11
|
-
|
|
10
|
+
import { findTable, getSelectionRect, isRowSelected, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
12
11
|
import { parsePx } from '@atlaskit/editor-common/utils';
|
|
13
12
|
import { TableCssClassName as ClassName } from '../types';
|
|
14
13
|
import { tableDeleteButtonSize } from '../ui/consts';
|
package/dist/esm/version.json
CHANGED
|
@@ -7,9 +7,9 @@ import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
|
|
|
7
7
|
import { ResizeStateWithAnalytics } from './pm-plugins/table-resizing/utils';
|
|
8
8
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
9
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;
|
|
10
|
+
export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
|
|
11
|
+
export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
|
|
12
|
+
export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB, cellColor: string, targetCellPosition?: number | undefined) => Command;
|
|
13
13
|
export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
|
|
14
14
|
export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
|
|
15
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;
|
|
@@ -21,6 +21,6 @@ export declare const toggleHeaderRowWithAnalytics: (editorAnalyticsAPI: EditorAn
|
|
|
21
21
|
export declare const toggleHeaderColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
22
22
|
export declare const toggleNumberColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
23
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;
|
|
24
|
+
export declare const sortColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB, columnIndex: number, sortOrder: SortOrder) => Command;
|
|
25
|
+
export declare const distributeColumnsWidthsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB, { resizeState, table, attributes }: ResizeStateWithAnalytics) => Command;
|
|
26
26
|
export declare const wrapTableInExpandWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Command, FloatingToolbarDropdown, FloatingToolbarHandler, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { Command, FloatingToolbarDropdown, FloatingToolbarHandler, FloatingToolbarItem, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { ToolbarMenuConfig, ToolbarMenuState, ToolbarMenuContext, PluginConfig } from './types';
|
|
4
4
|
import { EditorState } from 'prosemirror-state';
|
|
@@ -33,4 +33,4 @@ export declare const messages: {
|
|
|
33
33
|
};
|
|
34
34
|
export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarItem<Command>;
|
|
35
35
|
export declare const getToolbarCellOptionsConfig: (editorState: EditorState, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarDropdown<Command>;
|
|
36
|
-
export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
36
|
+
export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
@@ -2,7 +2,7 @@ import { Node as PMNode } from 'prosemirror-model';
|
|
|
2
2
|
import { Transaction } from 'prosemirror-state';
|
|
3
3
|
import { EditorView } from 'prosemirror-view';
|
|
4
4
|
import { ReportInvalidNodeAttrs } from '../types';
|
|
5
|
-
export declare const fireAnalytics: (properties?: {}) =>
|
|
5
|
+
export declare const fireAnalytics: (properties?: {}) => Promise<Response>;
|
|
6
6
|
export declare const removeExtraneousColumnWidths: (node: PMNode, basePos: number, tr: Transaction, reportInvalidTableCellSpanAttrs?: ReportInvalidNodeAttrs | undefined) => boolean;
|
|
7
7
|
export declare const fixTables: (tr: Transaction, reportInvalidTableCellSpanAttrs?: ReportInvalidNodeAttrs | undefined) => Transaction | undefined;
|
|
8
8
|
export declare const fixAutoSizedTable: (view: EditorView, tableNode: PMNode, tableRef: HTMLTableElement, tablePos: number, opts: {
|
|
@@ -5,7 +5,7 @@ import { Cell, CellColumnPositioning, TableDecorations } from '../types';
|
|
|
5
5
|
export declare const findColumnControlSelectedDecoration: (decorationSet: DecorationSet) => Decoration[];
|
|
6
6
|
export declare const findControlsHoverDecoration: (decorationSet: DecorationSet) => Decoration[];
|
|
7
7
|
export declare const createCellHoverDecoration: (cells: Cell[], type: 'warning') => Decoration[];
|
|
8
|
-
export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row' | 'column' | 'table', danger?: boolean | undefined, selected?: boolean | undefined) => Decoration[];
|
|
8
|
+
export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row' | 'column' | 'table', tr: Transaction | ReadonlyTransaction, danger?: boolean | undefined, selected?: boolean | undefined) => Decoration[];
|
|
9
9
|
export declare const createColumnSelectedDecoration: (tr: Transaction | ReadonlyTransaction) => Decoration[];
|
|
10
10
|
export declare const createColumnControlsDecoration: (selection: Selection) => Decoration[];
|
|
11
11
|
export declare const updateDecorations: (node: PmNode, decorationSet: DecorationSet, decorations: Decoration[], key: TableDecorations) => DecorationSet;
|
|
@@ -7,9 +7,9 @@ import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
|
|
|
7
7
|
import { ResizeStateWithAnalytics } from './pm-plugins/table-resizing/utils';
|
|
8
8
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
9
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;
|
|
10
|
+
export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
|
|
11
|
+
export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
|
|
12
|
+
export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB, cellColor: string, targetCellPosition?: number | undefined) => Command;
|
|
13
13
|
export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
|
|
14
14
|
export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
|
|
15
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;
|
|
@@ -21,6 +21,6 @@ export declare const toggleHeaderRowWithAnalytics: (editorAnalyticsAPI: EditorAn
|
|
|
21
21
|
export declare const toggleHeaderColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
22
22
|
export declare const toggleNumberColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
23
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;
|
|
24
|
+
export declare const sortColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB, columnIndex: number, sortOrder: SortOrder) => Command;
|
|
25
|
+
export declare const distributeColumnsWidthsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB, { resizeState, table, attributes }: ResizeStateWithAnalytics) => Command;
|
|
26
26
|
export declare const wrapTableInExpandWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Command, FloatingToolbarDropdown, FloatingToolbarHandler, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { Command, FloatingToolbarDropdown, FloatingToolbarHandler, FloatingToolbarItem, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { ToolbarMenuConfig, ToolbarMenuState, ToolbarMenuContext, PluginConfig } from './types';
|
|
4
4
|
import { EditorState } from 'prosemirror-state';
|
|
@@ -33,4 +33,4 @@ export declare const messages: {
|
|
|
33
33
|
};
|
|
34
34
|
export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarItem<Command>;
|
|
35
35
|
export declare const getToolbarCellOptionsConfig: (editorState: EditorState, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarDropdown<Command>;
|
|
36
|
-
export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
36
|
+
export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
@@ -2,7 +2,7 @@ import { Node as PMNode } from 'prosemirror-model';
|
|
|
2
2
|
import { Transaction } from 'prosemirror-state';
|
|
3
3
|
import { EditorView } from 'prosemirror-view';
|
|
4
4
|
import { ReportInvalidNodeAttrs } from '../types';
|
|
5
|
-
export declare const fireAnalytics: (properties?: {}) =>
|
|
5
|
+
export declare const fireAnalytics: (properties?: {}) => Promise<Response>;
|
|
6
6
|
export declare const removeExtraneousColumnWidths: (node: PMNode, basePos: number, tr: Transaction, reportInvalidTableCellSpanAttrs?: ReportInvalidNodeAttrs | undefined) => boolean;
|
|
7
7
|
export declare const fixTables: (tr: Transaction, reportInvalidTableCellSpanAttrs?: ReportInvalidNodeAttrs | undefined) => Transaction | undefined;
|
|
8
8
|
export declare const fixAutoSizedTable: (view: EditorView, tableNode: PMNode, tableRef: HTMLTableElement, tablePos: number, opts: {
|
|
@@ -5,7 +5,7 @@ import { Cell, CellColumnPositioning, TableDecorations } from '../types';
|
|
|
5
5
|
export declare const findColumnControlSelectedDecoration: (decorationSet: DecorationSet) => Decoration[];
|
|
6
6
|
export declare const findControlsHoverDecoration: (decorationSet: DecorationSet) => Decoration[];
|
|
7
7
|
export declare const createCellHoverDecoration: (cells: Cell[], type: 'warning') => Decoration[];
|
|
8
|
-
export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row' | 'column' | 'table', danger?: boolean | undefined, selected?: boolean | undefined) => Decoration[];
|
|
8
|
+
export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row' | 'column' | 'table', tr: Transaction | ReadonlyTransaction, danger?: boolean | undefined, selected?: boolean | undefined) => Decoration[];
|
|
9
9
|
export declare const createColumnSelectedDecoration: (tr: Transaction | ReadonlyTransaction) => Decoration[];
|
|
10
10
|
export declare const createColumnControlsDecoration: (selection: Selection) => Decoration[];
|
|
11
11
|
export declare const updateDecorations: (node: PmNode, decorationSet: DecorationSet, decorations: Decoration[], key: TableDecorations) => DecorationSet;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is used by the test scaling project to optimise test result caching
|
|
3
|
+
* Examples that are used by tests affect the outcome of tests so must be included when hashing
|
|
4
|
+
* They are defined here so the hashing algorithm doesn't need to search test files for example usage each time
|
|
5
|
+
*/
|
|
6
|
+
{
|
|
7
|
+
"exampleDependencies": [
|
|
8
|
+
"@atlaskit/button",
|
|
9
|
+
"@atlaskit/link-provider",
|
|
10
|
+
"@atlaskit/logo",
|
|
11
|
+
"@atlaskit/media-integration-test-helpers",
|
|
12
|
+
"@atlaskit/synchrony-test-helpers"
|
|
13
|
+
]
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -14,18 +14,19 @@
|
|
|
14
14
|
"typesVersions": {
|
|
15
15
|
">=4.0 <4.5": {
|
|
16
16
|
"*": [
|
|
17
|
-
"dist/types-ts4.0/*"
|
|
17
|
+
"dist/types-ts4.0/*",
|
|
18
|
+
"dist/types-ts4.0/index.d.ts"
|
|
18
19
|
]
|
|
19
20
|
}
|
|
20
21
|
},
|
|
21
22
|
"atlaskit:src": "src/index.ts",
|
|
22
23
|
"atlassian": {
|
|
23
24
|
"team": "Editor",
|
|
24
|
-
"releaseModel": "
|
|
25
|
+
"releaseModel": "scheduled"
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {
|
|
27
28
|
"@atlaskit/adf-schema": "^24.0.0",
|
|
28
|
-
"@atlaskit/editor-common": "^70.
|
|
29
|
+
"@atlaskit/editor-common": "^70.2.0",
|
|
29
30
|
"@atlaskit/editor-shared-styles": "^2.2.0",
|
|
30
31
|
"@atlaskit/editor-tables": "^2.2.0",
|
|
31
32
|
"@atlaskit/icon": "^21.11.0",
|
|
@@ -52,15 +53,14 @@
|
|
|
52
53
|
"peerDependencies": {
|
|
53
54
|
"react": "^16.8.0",
|
|
54
55
|
"react-dom": "^16.8.0",
|
|
55
|
-
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
56
|
-
"styled-components": "^3.2.6"
|
|
56
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@atlaskit/analytics-next": "^8.3.3",
|
|
60
|
-
"@atlaskit/button": "^16.
|
|
61
|
-
"@atlaskit/editor-core": "^
|
|
60
|
+
"@atlaskit/button": "^16.4.0",
|
|
61
|
+
"@atlaskit/editor-core": "^175.0.0",
|
|
62
62
|
"@atlaskit/editor-test-helpers": "^17.2.0",
|
|
63
|
-
"@atlaskit/link-provider": "^1.
|
|
63
|
+
"@atlaskit/link-provider": "^1.3.0",
|
|
64
64
|
"@atlaskit/logo": "^13.10.0",
|
|
65
65
|
"@atlaskit/media-integration-test-helpers": "^2.6.0",
|
|
66
66
|
"@atlaskit/synchrony-test-helpers": "^2.3.0",
|
|
@@ -76,8 +76,12 @@
|
|
|
76
76
|
"typescript": "4.5.5"
|
|
77
77
|
},
|
|
78
78
|
"af:exports": {
|
|
79
|
-
"./types": "./src/types.ts",
|
|
80
|
-
".": "./src/index.ts"
|
|
79
|
+
"./types": "./src/plugins/table/types.ts",
|
|
80
|
+
".": "./src/index.ts",
|
|
81
|
+
"./ui/common-styles": "./src/plugins/table/ui/common-styles.ts",
|
|
82
|
+
"./ui/consts": "./src/plugins/table/ui/consts.ts",
|
|
83
|
+
"./plugin-key": "./src/plugins/table/pm-plugins/plugin-key.ts",
|
|
84
|
+
"./commands": "./src/plugins/table/commands/index.ts"
|
|
81
85
|
},
|
|
82
86
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|
|
83
87
|
"techstack": {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-plugin-table/plugin-key",
|
|
3
|
+
"main": "../dist/cjs/plugins/table/pm-plugins/plugin-key.js",
|
|
4
|
+
"module": "../dist/esm/plugins/table/pm-plugins/plugin-key.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/plugins/table/pm-plugins/plugin-key.js",
|
|
6
|
+
"types": "../dist/types/plugins/table/pm-plugins/plugin-key.d.ts",
|
|
7
|
+
"typesVersions": {
|
|
8
|
+
">=4.0 <4.5": {
|
|
9
|
+
"*": [
|
|
10
|
+
"../dist/types-ts4.0/plugins/table/pm-plugins/plugin-key.d.ts"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
package/report.api.md
CHANGED
package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/auto-size-documents.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/layout-documents.ts
RENAMED
|
File without changes
|
|
File without changes
|
package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/nested-in-extension.ts
RENAMED
|
File without changes
|
|
File without changes
|
package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/resize-documents.ts
RENAMED
|
File without changes
|
|
File without changes
|
package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/table-inside-layout.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/auto-size.ts.snap
RENAMED
|
File without changes
|
|
File without changes
|
package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/copy-button.ts.snap
RENAMED
|
File without changes
|
package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-columns.ts.snap
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-rows.ts.snap
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/even-columns.ts.snap
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//import { runBlockNodeSelectionTestSuite } from '@atlaskit/editor-test-helpers/integration/selection';
|
|
2
2
|
// import { _getCopyButtonTestSuite } from '@atlaskit/editor-core/src/plugins/copy-button/__tests__/integration/_getCopyButtonTestSuite';
|
|
3
|
-
|
|
3
|
+
export {};
|
|
4
4
|
test.todo('TODO: ED-15706 We disabled the copy button');
|
|
5
5
|
// _getCopyButtonTestSuite({
|
|
6
6
|
// nodeName: 'Table',
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
fullpage,
|
|
8
8
|
} from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
9
9
|
import { documentWithMergedCells } from './__fixtures__/merged-rows-and-cols-document';
|
|
10
|
-
import { TableCssClassName as ClassName } from '
|
|
10
|
+
import { TableCssClassName as ClassName } from '../../plugins/table/types';
|
|
11
11
|
import {
|
|
12
12
|
goToEditorTestingWDExample,
|
|
13
13
|
mountEditor,
|
|
14
14
|
} from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
15
|
-
import messages from '
|
|
15
|
+
import messages from '../../plugins/table/ui/messages';
|
|
16
16
|
|
|
17
17
|
BrowserTestCase(
|
|
18
18
|
'Should delete merged columns from contextual menu and append missing cells to the table',
|