@atlaskit/editor-plugin-table 2.10.8 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +30 -0
- package/dist/cjs/plugins/table/commands/misc.js +60 -7
- package/dist/cjs/plugins/table/commands/toggle.js +2 -2
- package/dist/cjs/plugins/table/commands-with-analytics.js +2 -2
- package/dist/cjs/plugins/table/create-plugin-config.js +2 -2
- package/dist/cjs/plugins/table/event-handlers.js +3 -6
- package/dist/cjs/plugins/table/handlers.js +2 -2
- package/dist/cjs/plugins/table/index.js +7 -2
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/cjs/plugins/table/nodeviews/TableResizer.js +15 -21
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-resizing.js +18 -5
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/index.js +6 -0
- package/dist/cjs/plugins/table/pm-plugins/main.js +9 -5
- package/dist/cjs/plugins/table/pm-plugins/plugin-factory.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin-state.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-local-id.js +13 -13
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +5 -0
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin-factory.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/reducer.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +4 -2
- package/dist/cjs/plugins/table/pm-plugins/table-width.js +2 -2
- package/dist/cjs/plugins/table/reducer.js +28 -4
- package/dist/cjs/plugins/table/transforms/column-width.js +2 -2
- package/dist/cjs/plugins/table/transforms/delete-columns.js +2 -2
- package/dist/cjs/plugins/table/transforms/delete-rows.js +2 -2
- package/dist/cjs/plugins/table/transforms/fix-tables.js +2 -2
- package/dist/cjs/plugins/table/transforms/merge.js +2 -2
- package/dist/cjs/plugins/table/transforms/split.js +2 -2
- package/dist/cjs/plugins/table/types.js +3 -2
- package/dist/cjs/plugins/table/ui/ColumnResizeWidget/index.js +44 -0
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/index.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +2 -2
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +2 -2
- package/dist/cjs/plugins/table/ui/messages.js +5 -0
- package/dist/cjs/plugins/table/utils/decoration.js +17 -4
- package/dist/cjs/plugins/table/utils/row-controls.js +2 -2
- package/dist/es2019/plugins/table/commands/misc.js +49 -5
- package/dist/es2019/plugins/table/event-handlers.js +3 -6
- package/dist/es2019/plugins/table/index.js +7 -2
- package/dist/es2019/plugins/table/nodeviews/TableResizer.js +14 -17
- package/dist/es2019/plugins/table/pm-plugins/decorations/utils/column-resizing.js +12 -2
- package/dist/es2019/plugins/table/pm-plugins/decorations/utils/index.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/main.js +6 -3
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +5 -0
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -0
- package/dist/es2019/plugins/table/reducer.js +29 -2
- package/dist/es2019/plugins/table/types.js +1 -0
- package/dist/es2019/plugins/table/ui/ColumnResizeWidget/index.js +35 -0
- package/dist/es2019/plugins/table/ui/messages.js +5 -0
- package/dist/es2019/plugins/table/utils/decoration.js +16 -5
- package/dist/esm/plugins/table/commands/misc.js +58 -7
- package/dist/esm/plugins/table/commands/toggle.js +2 -2
- package/dist/esm/plugins/table/commands-with-analytics.js +2 -2
- package/dist/esm/plugins/table/create-plugin-config.js +2 -2
- package/dist/esm/plugins/table/event-handlers.js +3 -6
- package/dist/esm/plugins/table/handlers.js +2 -2
- package/dist/esm/plugins/table/index.js +7 -2
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/esm/plugins/table/nodeviews/TableResizer.js +15 -21
- package/dist/esm/plugins/table/pm-plugins/decorations/utils/column-resizing.js +15 -3
- package/dist/esm/plugins/table/pm-plugins/decorations/utils/index.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/main.js +10 -6
- package/dist/esm/plugins/table/pm-plugins/plugin-factory.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/plugin-state.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/table-local-id.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +5 -0
- package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin-factory.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/table-resizing/reducer.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +4 -2
- package/dist/esm/plugins/table/pm-plugins/table-width.js +2 -2
- package/dist/esm/plugins/table/reducer.js +28 -4
- package/dist/esm/plugins/table/transforms/column-width.js +2 -2
- package/dist/esm/plugins/table/transforms/delete-columns.js +2 -2
- package/dist/esm/plugins/table/transforms/delete-rows.js +2 -2
- package/dist/esm/plugins/table/transforms/fix-tables.js +2 -2
- package/dist/esm/plugins/table/transforms/merge.js +2 -2
- package/dist/esm/plugins/table/transforms/split.js +2 -2
- package/dist/esm/plugins/table/types.js +3 -2
- package/dist/esm/plugins/table/ui/ColumnResizeWidget/index.js +35 -0
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +2 -2
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.js +2 -2
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/index.js +2 -2
- package/dist/esm/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +2 -2
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +2 -2
- package/dist/esm/plugins/table/ui/messages.js +5 -0
- package/dist/esm/plugins/table/utils/decoration.js +17 -4
- package/dist/esm/plugins/table/utils/row-controls.js +2 -2
- package/dist/types/plugins/table/commands/misc.d.ts +8 -6
- package/dist/types/plugins/table/event-handlers.d.ts +3 -3
- package/dist/types/plugins/table/index.d.ts +4 -0
- package/dist/types/plugins/table/pm-plugins/decorations/utils/column-resizing.d.ts +4 -2
- package/dist/types/plugins/table/pm-plugins/decorations/utils/index.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/plugin.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +3 -3
- package/dist/types/plugins/table/reducer.d.ts +1 -1
- package/dist/types/plugins/table/types.d.ts +18 -0
- package/dist/types/plugins/table/ui/ColumnResizeWidget/index.d.ts +9 -0
- package/dist/types/plugins/table/ui/messages.d.ts +5 -0
- package/dist/types/plugins/table/utils/decoration.d.ts +2 -1
- package/dist/types-ts4.5/plugins/table/commands/misc.d.ts +8 -6
- package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-resizing.d.ts +4 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +2 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/reducer.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/types.d.ts +18 -0
- package/dist/types-ts4.5/plugins/table/ui/ColumnResizeWidget/index.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/ui/messages.d.ts +5 -0
- package/dist/types-ts4.5/plugins/table/utils/decoration.d.ts +2 -1
- package/docs/0-intro.tsx +53 -0
- package/package.json +11 -11
- package/report.api.md +1 -1
- package/src/__tests__/unit/event-handlers.ts +1 -1
- package/src/__tests__/unit/nodeviews/TableContainer.tsx +17 -8
- package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +2 -0
- package/src/plugins/table/commands/misc.ts +84 -7
- package/src/plugins/table/event-handlers.ts +11 -16
- package/src/plugins/table/index.tsx +6 -0
- package/src/plugins/table/nodeviews/TableResizer.tsx +12 -20
- package/src/plugins/table/pm-plugins/decorations/utils/column-resizing.ts +34 -7
- package/src/plugins/table/pm-plugins/decorations/utils/index.ts +4 -1
- package/src/plugins/table/pm-plugins/main.ts +7 -1
- package/src/plugins/table/pm-plugins/table-resizing/event-handlers.ts +5 -0
- package/src/plugins/table/pm-plugins/table-resizing/plugin.ts +3 -5
- package/src/plugins/table/pm-plugins/table-resizing/utils/scale-table.ts +5 -3
- package/src/plugins/table/reducer.ts +51 -3
- package/src/plugins/table/types.ts +19 -0
- package/src/plugins/table/ui/ColumnResizeWidget/index.tsx +53 -0
- package/src/plugins/table/ui/messages.ts +5 -0
- package/src/plugins/table/utils/decoration.ts +27 -5
- package/tmp/api-report-tmp.d.ts +1 -1
- package/tsconfig.app.json +82 -0
- package/tsconfig.dev.json +112 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
5
5
|
import { tableInsertColumnButtonOffset, tableInsertColumnButtonSize, tableToolbarSize } from '../consts';
|
|
6
6
|
var HORIZONTAL_ALIGN_COLUMN_BUTTON = -(tableInsertColumnButtonSize / 2);
|
|
@@ -7,8 +7,8 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
|
-
function ownKeys(
|
|
11
|
-
function _objectSpread(
|
|
10
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
12
|
import React, { createRef } from 'react';
|
|
13
13
|
import classnames from 'classnames';
|
|
14
14
|
import { injectIntl } from 'react-intl-next';
|
|
@@ -54,5 +54,10 @@ export default defineMessages({
|
|
|
54
54
|
id: 'fabric.editor.extension.sourceNoTitledName',
|
|
55
55
|
defaultMessage: 'this element',
|
|
56
56
|
description: 'The current element without preset name been selected'
|
|
57
|
+
},
|
|
58
|
+
adjustColumns: {
|
|
59
|
+
id: 'fabric.editor.tables.adjustColumn',
|
|
60
|
+
defaultMessage: 'Adjust column',
|
|
61
|
+
description: 'Tooltip displayed on table column resize handle'
|
|
57
62
|
}
|
|
58
63
|
});
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import { createElement } from 'react';
|
|
3
|
+
import ReactDOM from 'react-dom';
|
|
4
|
+
import { RawIntlProvider } from 'react-intl-next';
|
|
2
5
|
import { nonNullable } from '@atlaskit/editor-common/utils';
|
|
3
6
|
|
|
4
7
|
// @ts-ignore -- ReadonlyTransaction is a local declaration and will cause a TS2305 error in CCFE typecheck
|
|
@@ -7,6 +10,7 @@ import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
|
7
10
|
import { Rect, TableMap } from '@atlaskit/editor-tables/table-map';
|
|
8
11
|
import { findTable, getCellsInRow, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
9
12
|
import { TableCssClassName as ClassName, TableDecorations } from '../types';
|
|
13
|
+
import { ColumnResizeWidget } from '../ui/ColumnResizeWidget';
|
|
10
14
|
var filterDecorationByKey = function filterDecorationByKey(key, decorationSet) {
|
|
11
15
|
return decorationSet.find(undefined, undefined, function (spec) {
|
|
12
16
|
return spec.key.indexOf(key) > -1;
|
|
@@ -257,6 +261,8 @@ var makeArray = function makeArray(n) {
|
|
|
257
261
|
* hence the second media will receive this class `ClassName.LAST_ITEM_IN_CELL`
|
|
258
262
|
*/
|
|
259
263
|
export var createResizeHandleDecoration = function createResizeHandleDecoration(tr, rowIndexTarget, columnEndIndexTarget) {
|
|
264
|
+
var includeTooltip = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
265
|
+
var getIntl = arguments.length > 4 ? arguments[4] : undefined;
|
|
260
266
|
var emptyResult = [[], []];
|
|
261
267
|
var table = findTable(tr.selection);
|
|
262
268
|
if (!table || !table.node) {
|
|
@@ -270,12 +276,19 @@ export var createResizeHandleDecoration = function createResizeHandleDecoration(
|
|
|
270
276
|
var position = cellPos + cellNode.nodeSize - 1;
|
|
271
277
|
return Decoration.widget(position, function () {
|
|
272
278
|
var element = document.createElement('div');
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
279
|
+
ReactDOM.render( /*#__PURE__*/createElement(RawIntlProvider, {
|
|
280
|
+
value: getIntl()
|
|
281
|
+
}, /*#__PURE__*/createElement(ColumnResizeWidget, {
|
|
282
|
+
startIndex: cellColumnPositioning.left,
|
|
283
|
+
endIndex: cellColumnPositioning.right,
|
|
284
|
+
includeTooltip: includeTooltip
|
|
285
|
+
})), element);
|
|
276
286
|
return element;
|
|
277
287
|
}, {
|
|
278
|
-
key: "".concat(TableDecorations.
|
|
288
|
+
key: "".concat(TableDecorations.COLUMN_RESIZING_HANDLE_WIDGET, "_").concat(rowIndex, "_").concat(columnIndex, "_").concat(includeTooltip ? 'with' : 'no', "-tooltip"),
|
|
289
|
+
destroy: function destroy(node) {
|
|
290
|
+
ReactDOM.unmountComponentAtNode(node);
|
|
291
|
+
}
|
|
279
292
|
});
|
|
280
293
|
};
|
|
281
294
|
var createLastCellElementDecoration = function createLastCellElementDecoration(cellColumnPositioning, cellPos, cellNode) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { parsePx } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { Node as PMNode, Schema, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
1
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Node as PMNode, Schema, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
export declare const setEditorFocus: (editorHasFocus: boolean) => Command;
|
|
7
7
|
export declare const setTableRef: (ref?: HTMLTableElement) => Command;
|
|
8
8
|
export declare const setCellAttr: (name: string, value: any) => Command;
|
|
@@ -20,7 +20,9 @@ export declare const selectRow: (row: number, expand?: boolean) => Command;
|
|
|
20
20
|
export declare const showInsertColumnButton: (columnIndex: number) => Command;
|
|
21
21
|
export declare const showInsertRowButton: (rowIndex: number) => Command;
|
|
22
22
|
export declare const hideInsertColumnOrRowButton: () => Command;
|
|
23
|
-
export declare const addResizeHandleDecorations: (rowIndex: number, columnIndex: number) => Command;
|
|
23
|
+
export declare const addResizeHandleDecorations: (rowIndex: number, columnIndex: number, includeTooltip: boolean) => Command;
|
|
24
|
+
export declare const updateResizeHandleDecorations: (rowIndex?: number, columnIndex?: number, includeTooltip?: boolean) => Command;
|
|
25
|
+
export declare const removeResizeHandleDecorations: () => Command;
|
|
24
26
|
export declare const autoSizeTable: (view: EditorView, node: PMNode, table: HTMLTableElement, basePos: number | undefined, opts: {
|
|
25
27
|
containerWidth: number;
|
|
26
28
|
}) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import { ElementContentRects } from './types';
|
|
2
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import type { ElementContentRects } from './types';
|
|
5
5
|
export declare const handleBlur: (view: EditorView, event: Event) => boolean;
|
|
6
6
|
export declare const handleFocus: (view: EditorView, event: Event) => boolean;
|
|
7
7
|
export declare const handleClick: (view: EditorView, event: Event) => boolean;
|
|
@@ -29,5 +29,9 @@ export type TablePlugin = NextEditorPlugin<'table', {
|
|
|
29
29
|
GuidelinePlugin
|
|
30
30
|
];
|
|
31
31
|
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Table plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
34
|
+
* from `@atlaskit/editor-core`.
|
|
35
|
+
*/
|
|
32
36
|
declare const tablesPlugin: TablePlugin;
|
|
33
37
|
export default tablesPlugin;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { DecorationTransformer } from './types';
|
|
3
|
+
export declare const buildColumnResizingDecorations: (rowEndIndex: number, columnEndIndex: number, includeTooltip: boolean, getIntl: () => IntlShape) => DecorationTransformer;
|
|
4
|
+
export declare const clearColumnResizingDecorations: () => DecorationTransformer;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { buildColumnControlsDecorations, maybeUpdateColumnControlsSelectedDecoration, } from './column-controls';
|
|
2
|
-
export { buildColumnResizingDecorations } from './column-resizing';
|
|
2
|
+
export { buildColumnResizingDecorations, clearColumnResizingDecorations, } from './column-resizing';
|
|
3
3
|
export { composeDecorations } from './compose-decorations';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
1
2
|
import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
3
|
import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
4
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
4
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
6
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
6
7
|
import type { PluginConfig, PluginInjectionAPI } from '../types';
|
|
7
|
-
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, breakoutEnabled?: boolean, fullWidthModeEnabled?: boolean, tableResizingEnabled?: boolean, previousFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI) => SafePlugin<import("../types").TablePluginState>;
|
|
8
|
+
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, breakoutEnabled?: boolean, fullWidthModeEnabled?: boolean, tableResizingEnabled?: boolean, previousFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI) => SafePlugin<import("../types").TablePluginState>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
|
-
import { ColumnResizingPluginState } from '../../types';
|
|
5
|
+
import type { ColumnResizingPluginState } from '../../types';
|
|
6
6
|
export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI): SafePlugin<ColumnResizingPluginState>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { DomAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
-
import { ResizeState } from '../utils/types';
|
|
4
|
+
import type { ResizeState } from '../utils/types';
|
|
5
5
|
export interface ScaleOptions {
|
|
6
6
|
node: PMNode;
|
|
7
7
|
prevNode: PMNode;
|
|
@@ -69,10 +69,13 @@ export interface TablePluginState {
|
|
|
69
69
|
isFullWidthModeEnabled?: boolean;
|
|
70
70
|
layout?: TableLayout;
|
|
71
71
|
ordering?: TableColumnOrdering;
|
|
72
|
+
isResizeHandleWidgetAdded?: boolean;
|
|
72
73
|
resizeHandleRowIndex?: number;
|
|
73
74
|
resizeHandleColumnIndex?: number;
|
|
75
|
+
resizeHandleIncludeTooltip?: boolean;
|
|
74
76
|
isTableCollapsed?: boolean;
|
|
75
77
|
canCollapseTable?: boolean;
|
|
78
|
+
getIntl: () => IntlShape;
|
|
76
79
|
}
|
|
77
80
|
export type TablePluginAction = {
|
|
78
81
|
type: 'SET_EDITOR_FOCUS';
|
|
@@ -131,6 +134,20 @@ export type TablePluginAction = {
|
|
|
131
134
|
decorationSet: DecorationSet;
|
|
132
135
|
resizeHandleRowIndex: number;
|
|
133
136
|
resizeHandleColumnIndex: number;
|
|
137
|
+
resizeHandleIncludeTooltip: boolean;
|
|
138
|
+
};
|
|
139
|
+
} | {
|
|
140
|
+
type: 'UPDATE_RESIZE_HANDLE_DECORATIONS';
|
|
141
|
+
data: {
|
|
142
|
+
decorationSet: DecorationSet;
|
|
143
|
+
resizeHandleRowIndex: number | undefined;
|
|
144
|
+
resizeHandleColumnIndex: number | undefined;
|
|
145
|
+
resizeHandleIncludeTooltip: boolean | undefined;
|
|
146
|
+
};
|
|
147
|
+
} | {
|
|
148
|
+
type: 'REMOVE_RESIZE_HANDLE_DECORATIONS';
|
|
149
|
+
data: {
|
|
150
|
+
decorationSet: DecorationSet;
|
|
134
151
|
};
|
|
135
152
|
} | {
|
|
136
153
|
type: 'CLEAR_HOVER_SELECTION';
|
|
@@ -212,6 +229,7 @@ export declare enum TableDecorations {
|
|
|
212
229
|
COLUMN_CONTROLS_DECORATIONS = "COLUMN_CONTROLS_DECORATIONS",
|
|
213
230
|
COLUMN_SELECTED = "COLUMN_SELECTED",
|
|
214
231
|
COLUMN_RESIZING_HANDLE = "COLUMN_RESIZING_HANDLE",
|
|
232
|
+
COLUMN_RESIZING_HANDLE_WIDGET = "COLUMN_RESIZING_HANDLE_WIDGET",
|
|
215
233
|
COLUMN_RESIZING_HANDLE_LINE = "COLUMN_RESIZING_HANDLE_LINE",
|
|
216
234
|
LAST_CELL_ELEMENT = "LAST_CELL_ELEMENT"
|
|
217
235
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
1
2
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
3
|
import type { ReadonlyTransaction, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -11,5 +12,5 @@ export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row'
|
|
|
11
12
|
export declare const createColumnSelectedDecoration: (tr: Transaction | ReadonlyTransaction) => Decoration[];
|
|
12
13
|
export declare const createColumnControlsDecoration: (selection: Selection) => Decoration[];
|
|
13
14
|
export declare const updateDecorations: (node: PmNode, decorationSet: DecorationSet, decorations: Decoration[], key: TableDecorations) => DecorationSet;
|
|
14
|
-
export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, 'left'
|
|
15
|
+
export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, 'left'>, includeTooltip: boolean | undefined, getIntl: () => IntlShape) => [Decoration[], Decoration[]];
|
|
15
16
|
export declare const createColumnLineResize: (selection: Selection, cellColumnPositioning: Omit<CellColumnPositioning, 'left'>) => Decoration[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { Node as PMNode, Schema, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
1
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Node as PMNode, Schema, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
export declare const setEditorFocus: (editorHasFocus: boolean) => Command;
|
|
7
7
|
export declare const setTableRef: (ref?: HTMLTableElement) => Command;
|
|
8
8
|
export declare const setCellAttr: (name: string, value: any) => Command;
|
|
@@ -20,7 +20,9 @@ export declare const selectRow: (row: number, expand?: boolean) => Command;
|
|
|
20
20
|
export declare const showInsertColumnButton: (columnIndex: number) => Command;
|
|
21
21
|
export declare const showInsertRowButton: (rowIndex: number) => Command;
|
|
22
22
|
export declare const hideInsertColumnOrRowButton: () => Command;
|
|
23
|
-
export declare const addResizeHandleDecorations: (rowIndex: number, columnIndex: number) => Command;
|
|
23
|
+
export declare const addResizeHandleDecorations: (rowIndex: number, columnIndex: number, includeTooltip: boolean) => Command;
|
|
24
|
+
export declare const updateResizeHandleDecorations: (rowIndex?: number, columnIndex?: number, includeTooltip?: boolean) => Command;
|
|
25
|
+
export declare const removeResizeHandleDecorations: () => Command;
|
|
24
26
|
export declare const autoSizeTable: (view: EditorView, node: PMNode, table: HTMLTableElement, basePos: number | undefined, opts: {
|
|
25
27
|
containerWidth: number;
|
|
26
28
|
}) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import { ElementContentRects } from './types';
|
|
2
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import type { ElementContentRects } from './types';
|
|
5
5
|
export declare const handleBlur: (view: EditorView, event: Event) => boolean;
|
|
6
6
|
export declare const handleFocus: (view: EditorView, event: Event) => boolean;
|
|
7
7
|
export declare const handleClick: (view: EditorView, event: Event) => boolean;
|
|
@@ -29,5 +29,9 @@ export type TablePlugin = NextEditorPlugin<'table', {
|
|
|
29
29
|
GuidelinePlugin
|
|
30
30
|
];
|
|
31
31
|
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Table plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
34
|
+
* from `@atlaskit/editor-core`.
|
|
35
|
+
*/
|
|
32
36
|
declare const tablesPlugin: TablePlugin;
|
|
33
37
|
export default tablesPlugin;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { DecorationTransformer } from './types';
|
|
3
|
+
export declare const buildColumnResizingDecorations: (rowEndIndex: number, columnEndIndex: number, includeTooltip: boolean, getIntl: () => IntlShape) => DecorationTransformer;
|
|
4
|
+
export declare const clearColumnResizingDecorations: () => DecorationTransformer;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { buildColumnControlsDecorations, maybeUpdateColumnControlsSelectedDecoration, } from './column-controls';
|
|
2
|
-
export { buildColumnResizingDecorations } from './column-resizing';
|
|
2
|
+
export { buildColumnResizingDecorations, clearColumnResizingDecorations, } from './column-resizing';
|
|
3
3
|
export { composeDecorations } from './compose-decorations';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
1
2
|
import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
3
|
import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
4
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
4
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
6
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
6
7
|
import type { PluginConfig, PluginInjectionAPI } from '../types';
|
|
7
|
-
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, breakoutEnabled?: boolean, fullWidthModeEnabled?: boolean, tableResizingEnabled?: boolean, previousFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI) => SafePlugin<import("../types").TablePluginState>;
|
|
8
|
+
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, breakoutEnabled?: boolean, fullWidthModeEnabled?: boolean, tableResizingEnabled?: boolean, previousFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI) => SafePlugin<import("../types").TablePluginState>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
|
-
import { ColumnResizingPluginState } from '../../types';
|
|
5
|
+
import type { ColumnResizingPluginState } from '../../types';
|
|
6
6
|
export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI): SafePlugin<ColumnResizingPluginState>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { DomAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
-
import { ResizeState } from '../utils/types';
|
|
4
|
+
import type { ResizeState } from '../utils/types';
|
|
5
5
|
export interface ScaleOptions {
|
|
6
6
|
node: PMNode;
|
|
7
7
|
prevNode: PMNode;
|
|
@@ -69,10 +69,13 @@ export interface TablePluginState {
|
|
|
69
69
|
isFullWidthModeEnabled?: boolean;
|
|
70
70
|
layout?: TableLayout;
|
|
71
71
|
ordering?: TableColumnOrdering;
|
|
72
|
+
isResizeHandleWidgetAdded?: boolean;
|
|
72
73
|
resizeHandleRowIndex?: number;
|
|
73
74
|
resizeHandleColumnIndex?: number;
|
|
75
|
+
resizeHandleIncludeTooltip?: boolean;
|
|
74
76
|
isTableCollapsed?: boolean;
|
|
75
77
|
canCollapseTable?: boolean;
|
|
78
|
+
getIntl: () => IntlShape;
|
|
76
79
|
}
|
|
77
80
|
export type TablePluginAction = {
|
|
78
81
|
type: 'SET_EDITOR_FOCUS';
|
|
@@ -131,6 +134,20 @@ export type TablePluginAction = {
|
|
|
131
134
|
decorationSet: DecorationSet;
|
|
132
135
|
resizeHandleRowIndex: number;
|
|
133
136
|
resizeHandleColumnIndex: number;
|
|
137
|
+
resizeHandleIncludeTooltip: boolean;
|
|
138
|
+
};
|
|
139
|
+
} | {
|
|
140
|
+
type: 'UPDATE_RESIZE_HANDLE_DECORATIONS';
|
|
141
|
+
data: {
|
|
142
|
+
decorationSet: DecorationSet;
|
|
143
|
+
resizeHandleRowIndex: number | undefined;
|
|
144
|
+
resizeHandleColumnIndex: number | undefined;
|
|
145
|
+
resizeHandleIncludeTooltip: boolean | undefined;
|
|
146
|
+
};
|
|
147
|
+
} | {
|
|
148
|
+
type: 'REMOVE_RESIZE_HANDLE_DECORATIONS';
|
|
149
|
+
data: {
|
|
150
|
+
decorationSet: DecorationSet;
|
|
134
151
|
};
|
|
135
152
|
} | {
|
|
136
153
|
type: 'CLEAR_HOVER_SELECTION';
|
|
@@ -212,6 +229,7 @@ export declare enum TableDecorations {
|
|
|
212
229
|
COLUMN_CONTROLS_DECORATIONS = "COLUMN_CONTROLS_DECORATIONS",
|
|
213
230
|
COLUMN_SELECTED = "COLUMN_SELECTED",
|
|
214
231
|
COLUMN_RESIZING_HANDLE = "COLUMN_RESIZING_HANDLE",
|
|
232
|
+
COLUMN_RESIZING_HANDLE_WIDGET = "COLUMN_RESIZING_HANDLE_WIDGET",
|
|
215
233
|
COLUMN_RESIZING_HANDLE_LINE = "COLUMN_RESIZING_HANDLE_LINE",
|
|
216
234
|
LAST_CELL_ELEMENT = "LAST_CELL_ELEMENT"
|
|
217
235
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
1
2
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
3
|
import type { ReadonlyTransaction, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -11,7 +12,7 @@ export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row'
|
|
|
11
12
|
export declare const createColumnSelectedDecoration: (tr: Transaction | ReadonlyTransaction) => Decoration[];
|
|
12
13
|
export declare const createColumnControlsDecoration: (selection: Selection) => Decoration[];
|
|
13
14
|
export declare const updateDecorations: (node: PmNode, decorationSet: DecorationSet, decorations: Decoration[], key: TableDecorations) => DecorationSet;
|
|
14
|
-
export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, 'left'
|
|
15
|
+
export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, 'left'>, includeTooltip: boolean | undefined, getIntl: () => IntlShape) => [
|
|
15
16
|
Decoration[],
|
|
16
17
|
Decoration[]
|
|
17
18
|
];
|
package/docs/0-intro.tsx
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { AtlassianInternalWarning, code, md } from '@atlaskit/docs';
|
|
4
|
+
import { createEditorUseOnlyNotice } from '@atlaskit/editor-core/docs/editor-use-only';
|
|
5
|
+
import { token } from '@atlaskit/tokens';
|
|
6
|
+
|
|
7
|
+
export default md`
|
|
8
|
+
|
|
9
|
+
${createEditorUseOnlyNotice('Editor Plugin Table', [
|
|
10
|
+
{ name: 'Editor Core', link: '/packages/editor/editor-core' },
|
|
11
|
+
])}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
${(
|
|
15
|
+
<div style={{ marginTop: token('space.100', '8px') }}>
|
|
16
|
+
<AtlassianInternalWarning />
|
|
17
|
+
</div>
|
|
18
|
+
)}
|
|
19
|
+
|
|
20
|
+
This package includes the table plugin used by \`@atlaskit/editor-core\`.
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
The \`dependencies\`, \`configuration\`, \`state\`, \`actions\`, and \`commands\` of the plugin are defined
|
|
26
|
+
below:
|
|
27
|
+
|
|
28
|
+
${code`
|
|
29
|
+
type TablePlugin = NextEditorPlugin<
|
|
30
|
+
'table',
|
|
31
|
+
{
|
|
32
|
+
pluginConfiguration: TablePluginOptions | undefined;
|
|
33
|
+
actions: {
|
|
34
|
+
insertTable: InsertTableAction;
|
|
35
|
+
};
|
|
36
|
+
dependencies: [
|
|
37
|
+
AnalyticsPlugin,
|
|
38
|
+
ContentInsertionPlugin,
|
|
39
|
+
WidthPlugin,
|
|
40
|
+
GuidelinePlugin,
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
>;
|
|
44
|
+
`}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## Support
|
|
48
|
+
---
|
|
49
|
+
For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
|
|
50
|
+
## License
|
|
51
|
+
---
|
|
52
|
+
Please see [Atlassian Frontend - License](https://developer.atlassian.com/cloud/framework/atlassian-frontend/#license) for more licensing information.
|
|
53
|
+
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/adf-schema": "28.1.2",
|
|
31
|
-
"@atlaskit/editor-common": "^74.
|
|
31
|
+
"@atlaskit/editor-common": "^74.55.0",
|
|
32
32
|
"@atlaskit/editor-palette": "1.5.1",
|
|
33
|
-
"@atlaskit/editor-plugin-analytics": "^0.
|
|
34
|
-
"@atlaskit/editor-plugin-content-insertion": "^0.0
|
|
33
|
+
"@atlaskit/editor-plugin-analytics": "^0.2.0",
|
|
34
|
+
"@atlaskit/editor-plugin-content-insertion": "^0.1.0",
|
|
35
35
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
36
36
|
"@atlaskit/editor-shared-styles": "^2.6.0",
|
|
37
37
|
"@atlaskit/editor-tables": "^2.3.0",
|
|
38
38
|
"@atlaskit/icon": "^21.12.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
40
40
|
"@atlaskit/theme": "^12.5.0",
|
|
41
|
-
"@atlaskit/tokens": "^1.
|
|
41
|
+
"@atlaskit/tokens": "^1.18.0",
|
|
42
42
|
"@atlaskit/tooltip": "^17.8.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
44
44
|
"@emotion/react": "^11.7.1",
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
58
|
-
"@atlaskit/editor-plugin-decorations": "^0.
|
|
59
|
-
"@atlaskit/editor-plugin-feature-flags": "^0.
|
|
60
|
-
"@atlaskit/editor-plugin-grid": "^0.
|
|
61
|
-
"@atlaskit/editor-plugin-guideline": "^0.
|
|
62
|
-
"@atlaskit/editor-plugin-hyperlink": "^0.
|
|
63
|
-
"@atlaskit/editor-plugin-width": "^0.
|
|
58
|
+
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
59
|
+
"@atlaskit/editor-plugin-feature-flags": "^0.2.0",
|
|
60
|
+
"@atlaskit/editor-plugin-grid": "^0.2.0",
|
|
61
|
+
"@atlaskit/editor-plugin-guideline": "^0.5.0",
|
|
62
|
+
"@atlaskit/editor-plugin-hyperlink": "^0.4.0",
|
|
63
|
+
"@atlaskit/editor-plugin-width": "^0.2.0",
|
|
64
64
|
"@atlaskit/visual-regression": "*",
|
|
65
65
|
"@atlaskit/webdriver-runner": "*",
|
|
66
66
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
package/report.api.md
CHANGED
|
@@ -215,7 +215,7 @@ describe('table event handlers', () => {
|
|
|
215
215
|
);
|
|
216
216
|
const { state, dispatch } = editorView;
|
|
217
217
|
|
|
218
|
-
addResizeHandleDecorations(0, 0)(state, dispatch);
|
|
218
|
+
addResizeHandleDecorations(0, 0, false)(state, dispatch);
|
|
219
219
|
|
|
220
220
|
const firstCell = editorView.domAtPos(refs['<>']);
|
|
221
221
|
const event = {
|