@atlaskit/editor-plugin-table 2.1.7 → 2.3.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 +20 -0
- package/dist/cjs/plugins/table/handlers.js +1 -0
- package/dist/cjs/plugins/table/index.js +41 -35
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +5 -4
- package/dist/cjs/plugins/table/nodeviews/TableContainer.js +50 -47
- package/dist/cjs/plugins/table/nodeviews/TableResizer.js +72 -28
- package/dist/cjs/plugins/table/nodeviews/table.js +12 -5
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +14 -5
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-controls.js +2 -0
- package/dist/cjs/plugins/table/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin-factory.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/{table-add-width.js → table-width.js} +27 -4
- package/dist/cjs/plugins/table/toolbar.js +6 -1
- package/dist/cjs/plugins/table/ui/consts.js +6 -2
- package/dist/cjs/plugins/table/utils/collapse.js +2 -0
- package/dist/cjs/plugins/table/utils/decoration.js +2 -0
- package/dist/cjs/plugins/table/utils/guidelines.js +12 -0
- package/dist/cjs/plugins/table/utils/snapping.js +37 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/handlers.js +1 -0
- package/dist/es2019/plugins/table/index.js +19 -10
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +5 -4
- package/dist/es2019/plugins/table/nodeviews/TableContainer.js +25 -23
- package/dist/es2019/plugins/table/nodeviews/TableResizer.js +71 -29
- package/dist/es2019/plugins/table/nodeviews/table.js +12 -5
- package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +18 -6
- package/dist/es2019/plugins/table/pm-plugins/decorations/utils/column-controls.js +2 -0
- package/dist/es2019/plugins/table/pm-plugins/main.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin-factory.js +2 -0
- package/dist/es2019/plugins/table/pm-plugins/{table-add-width.js → table-width.js} +25 -3
- package/dist/es2019/plugins/table/toolbar.js +6 -1
- package/dist/es2019/plugins/table/ui/consts.js +3 -1
- package/dist/es2019/plugins/table/utils/collapse.js +2 -0
- package/dist/es2019/plugins/table/utils/decoration.js +2 -0
- package/dist/es2019/plugins/table/utils/guidelines.js +4 -0
- package/dist/es2019/plugins/table/utils/snapping.js +27 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/handlers.js +1 -0
- package/dist/esm/plugins/table/index.js +41 -35
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +5 -4
- package/dist/esm/plugins/table/nodeviews/TableContainer.js +50 -47
- package/dist/esm/plugins/table/nodeviews/TableResizer.js +69 -28
- package/dist/esm/plugins/table/nodeviews/table.js +12 -5
- package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +18 -6
- package/dist/esm/plugins/table/pm-plugins/decorations/utils/column-controls.js +2 -0
- package/dist/esm/plugins/table/pm-plugins/main.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin-factory.js +2 -0
- package/dist/esm/plugins/table/pm-plugins/{table-add-width.js → table-width.js} +25 -3
- package/dist/esm/plugins/table/toolbar.js +6 -1
- package/dist/esm/plugins/table/ui/consts.js +3 -1
- package/dist/esm/plugins/table/utils/collapse.js +2 -0
- package/dist/esm/plugins/table/utils/decoration.js +2 -0
- package/dist/esm/plugins/table/utils/guidelines.js +4 -0
- package/dist/esm/plugins/table/utils/snapping.js +30 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/index.d.ts +3 -1
- package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +3 -2
- package/dist/types/plugins/table/nodeviews/TableContainer.d.ts +5 -2
- package/dist/types/plugins/table/nodeviews/TableResizer.d.ts +3 -1
- package/dist/types/plugins/table/nodeviews/table.d.ts +2 -1
- package/dist/types/plugins/table/nodeviews/types.d.ts +2 -0
- package/dist/types/plugins/table/pm-plugins/decorations/plugin.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/table-width.d.ts +16 -0
- package/dist/types/plugins/table/types.d.ts +3 -0
- package/dist/types/plugins/table/ui/consts.d.ts +2 -0
- package/dist/types/plugins/table/utils/guidelines.d.ts +3 -0
- package/dist/types/plugins/table/utils/snapping.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +3 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/TableContainer.d.ts +5 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/TableResizer.d.ts +3 -1
- package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +2 -1
- package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/plugin.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-width.d.ts +16 -0
- package/dist/types-ts4.5/plugins/table/types.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/utils/guidelines.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/utils/snapping.d.ts +8 -0
- package/package.json +4 -3
- package/report.api.md +2 -0
- package/src/__tests__/unit/analytics.ts +2 -0
- package/src/__tests__/unit/collab.ts +2 -0
- package/src/__tests__/unit/commands/go-to-next-cell.ts +2 -0
- package/src/__tests__/unit/commands/insert.ts +2 -0
- package/src/__tests__/unit/commands/misc.ts +2 -0
- package/src/__tests__/unit/commands/sort.ts +4 -0
- package/src/__tests__/unit/commands.ts +2 -0
- package/src/__tests__/unit/copy-paste.ts +2 -0
- package/src/__tests__/unit/event-handlers/index.ts +3 -0
- package/src/__tests__/unit/event-handlers.ts +3 -0
- package/src/__tests__/unit/fix-tables.ts +2 -0
- package/src/__tests__/unit/get-toolbar-config.ts +2 -0
- package/src/__tests__/unit/handlers.ts +2 -0
- package/src/__tests__/unit/hover-selection.ts +2 -0
- package/src/__tests__/unit/index.ts +2 -0
- package/src/__tests__/unit/layout.ts +2 -0
- package/src/__tests__/unit/nodeviews/cell.ts +2 -0
- package/src/__tests__/unit/nodeviews/table.ts +2 -0
- package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +2 -0
- package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +68 -0
- package/src/__tests__/unit/pm-plugins/main.ts +2 -0
- package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +2 -0
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +3 -0
- package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +2 -0
- package/src/__tests__/unit/sort-column.ts +2 -0
- package/src/__tests__/unit/toolbar.ts +2 -0
- package/src/__tests__/unit/transforms/delete-columns.ts +2 -0
- package/src/__tests__/unit/transforms/delete-rows.ts +2 -0
- package/src/__tests__/unit/transforms/merging.ts +2 -0
- package/src/__tests__/unit/ui/ContextualMenu.tsx +2 -0
- package/src/__tests__/unit/ui/CornerControls.tsx +2 -0
- package/src/__tests__/unit/ui/FloatingContextualButton.tsx +2 -0
- package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +2 -0
- package/src/__tests__/unit/ui/RowControls.tsx +2 -0
- package/src/__tests__/unit/ui/TableFloatingControls.tsx +2 -0
- package/src/__tests__/unit/undo-redo.ts +2 -0
- package/src/__tests__/unit/utils/collapse.ts +2 -0
- package/src/__tests__/unit/utils/nodes.ts +2 -0
- package/src/__tests__/unit/utils/row-controls.ts +2 -0
- package/src/__tests__/unit/utils.ts +2 -0
- package/src/plugins/table/handlers.ts +1 -0
- package/src/plugins/table/index.tsx +38 -23
- package/src/plugins/table/nodeviews/TableComponent.tsx +6 -5
- package/src/plugins/table/nodeviews/TableContainer.tsx +31 -22
- package/src/plugins/table/nodeviews/TableResizer.tsx +107 -34
- package/src/plugins/table/nodeviews/table.tsx +16 -2
- package/src/plugins/table/nodeviews/types.ts +2 -0
- package/src/plugins/table/pm-plugins/decorations/plugin.ts +27 -4
- package/src/plugins/table/pm-plugins/decorations/utils/column-controls.ts +1 -0
- package/src/plugins/table/pm-plugins/decorations/utils/types.ts +1 -0
- package/src/plugins/table/pm-plugins/main.ts +3 -0
- package/src/plugins/table/pm-plugins/table-resizing/plugin-factory.ts +1 -0
- package/src/plugins/table/pm-plugins/table-resizing/utils/dom.ts +1 -0
- package/src/plugins/table/pm-plugins/{table-add-width.ts → table-width.ts} +33 -3
- package/src/plugins/table/toolbar.tsx +7 -1
- package/src/plugins/table/types.ts +4 -0
- package/src/plugins/table/ui/consts.ts +3 -0
- package/src/plugins/table/utils/collapse.ts +1 -0
- package/src/plugins/table/utils/decoration.ts +1 -0
- package/src/plugins/table/utils/guidelines.ts +17 -0
- package/src/plugins/table/utils/snapping.ts +38 -0
- package/tmp/api-report-tmp.d.ts +3 -1
- package/dist/types/plugins/table/pm-plugins/table-add-width.d.ts +0 -7
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-add-width.d.ts +0 -7
|
@@ -4,7 +4,7 @@ import { EditorView } from 'prosemirror-view';
|
|
|
4
4
|
import type { EditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
5
|
import { RowStickyState, StickyPluginState } from '../pm-plugins/sticky-headers';
|
|
6
6
|
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
|
-
import {
|
|
7
|
+
import { PluginInjectionAPI, ShadowEvent } from '../types';
|
|
8
8
|
import type { TableColumnOrdering } from '@atlaskit/adf-schema/steps';
|
|
9
9
|
import type { TableOptions } from './types';
|
|
10
10
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
@@ -23,8 +23,9 @@ export interface ComponentProps {
|
|
|
23
23
|
isMediaFullscreen?: boolean;
|
|
24
24
|
tableActive: boolean;
|
|
25
25
|
ordering: TableColumnOrdering;
|
|
26
|
-
|
|
26
|
+
isResizing?: boolean;
|
|
27
27
|
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
28
|
+
pluginInjectionApi?: PluginInjectionAPI;
|
|
28
29
|
}
|
|
29
30
|
interface TableState {
|
|
30
31
|
scroll: number;
|
|
@@ -2,6 +2,7 @@ import React, { PropsWithChildren } from 'react';
|
|
|
2
2
|
import { Node as PMNode } from 'prosemirror-model';
|
|
3
3
|
import { EditorView } from 'prosemirror-view';
|
|
4
4
|
import { EditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
|
+
import { PluginInjectionAPI } from '../types';
|
|
5
6
|
type InnerContainerProps = {
|
|
6
7
|
className: string;
|
|
7
8
|
style?: {
|
|
@@ -21,8 +22,9 @@ type ResizableTableContainerProps = {
|
|
|
21
22
|
editorView: EditorView;
|
|
22
23
|
getPos: () => number | undefined;
|
|
23
24
|
tableRef: HTMLTableElement;
|
|
25
|
+
pluginInjectionApi?: PluginInjectionAPI;
|
|
24
26
|
};
|
|
25
|
-
export declare const ResizableTableContainer: ({ children, className, node, lineLength, containerWidth, editorView, getPos, tableRef, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element;
|
|
27
|
+
export declare const ResizableTableContainer: ({ children, className, node, lineLength, containerWidth, editorView, getPos, tableRef, pluginInjectionApi, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element;
|
|
26
28
|
type TableContainerProps = {
|
|
27
29
|
node: PMNode;
|
|
28
30
|
className: string;
|
|
@@ -33,6 +35,7 @@ type TableContainerProps = {
|
|
|
33
35
|
getPos: () => number | undefined;
|
|
34
36
|
tableRef: HTMLTableElement;
|
|
35
37
|
isNested: boolean;
|
|
38
|
+
pluginInjectionApi?: PluginInjectionAPI;
|
|
36
39
|
};
|
|
37
|
-
export declare const TableContainer: ({ children, node, className, containerWidth: { lineLength, width: editorWidth }, isFullWidthModeEnabled, isBreakoutEnabled, editorView, getPos, tableRef, isNested, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
40
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { lineLength, width: editorWidth }, isFullWidthModeEnabled, isBreakoutEnabled, editorView, getPos, tableRef, isNested, pluginInjectionApi, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
38
41
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { Node as PMNode } from 'prosemirror-model';
|
|
4
|
+
import type { GuidelineConfig } from '@atlaskit/editor-plugin-guideline';
|
|
4
5
|
interface TableResizerProps {
|
|
5
6
|
width: number;
|
|
6
7
|
maxWidth: number;
|
|
@@ -9,6 +10,7 @@ interface TableResizerProps {
|
|
|
9
10
|
getPos: () => number | undefined;
|
|
10
11
|
node: PMNode;
|
|
11
12
|
tableRef: HTMLTableElement;
|
|
13
|
+
displayGuideline: (guideline: GuidelineConfig[]) => boolean;
|
|
12
14
|
}
|
|
13
|
-
export declare const TableResizer: ({ children, width, maxWidth, updateWidth, editorView, getPos, node, tableRef, }: PropsWithChildren<TableResizerProps>) => JSX.Element;
|
|
15
|
+
export declare const TableResizer: ({ children, width, maxWidth, updateWidth, editorView, getPos, node, tableRef, displayGuideline, }: PropsWithChildren<TableResizerProps>) => JSX.Element;
|
|
14
16
|
export {};
|
|
@@ -7,6 +7,7 @@ import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
|
7
7
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
8
8
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
9
9
|
import { Props, TableOptions } from './types';
|
|
10
|
+
import { PluginInjectionAPI } from '../types';
|
|
10
11
|
type ForwardRef = (node: HTMLElement | null) => void;
|
|
11
12
|
export default class TableView extends ReactNodeView<Props> {
|
|
12
13
|
private table;
|
|
@@ -30,5 +31,5 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
30
31
|
}): boolean;
|
|
31
32
|
destroy(): void;
|
|
32
33
|
}
|
|
33
|
-
export declare const createTableView: (node: PmNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, options: TableOptions, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags) => NodeView;
|
|
34
|
+
export declare const createTableView: (node: PmNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, options: TableOptions, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, pluginInjectionApi?: PluginInjectionAPI) => NodeView;
|
|
34
35
|
export {};
|
|
@@ -3,6 +3,7 @@ import { EditorView } from 'prosemirror-view';
|
|
|
3
3
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
4
|
import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
5
5
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
6
|
+
import type { PluginInjectionAPI } from '../types';
|
|
6
7
|
export type TableOptions = {
|
|
7
8
|
isBreakoutEnabled?: boolean;
|
|
8
9
|
isFullWidthModeEnabled?: boolean;
|
|
@@ -21,4 +22,5 @@ export interface Props {
|
|
|
21
22
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
22
23
|
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
23
24
|
hasIntlContext: boolean;
|
|
25
|
+
pluginInjectionApi?: PluginInjectionAPI;
|
|
24
26
|
}
|
|
@@ -3,5 +3,5 @@ import { EditorState, PluginKey, Transaction, ReadonlyTransaction } from 'prosem
|
|
|
3
3
|
import { DecorationSet } from 'prosemirror-view';
|
|
4
4
|
export declare const pluginKey: PluginKey<any>;
|
|
5
5
|
export declare const getDecorations: (state: EditorState) => DecorationSet;
|
|
6
|
-
export declare const handleDocOrSelectionChanged: (tr: Transaction | ReadonlyTransaction, decorationSet: DecorationSet, oldState: EditorState) => DecorationSet;
|
|
6
|
+
export declare const handleDocOrSelectionChanged: (tr: Transaction | ReadonlyTransaction, decorationSet: DecorationSet, oldState: EditorState, newState: EditorState) => DecorationSet;
|
|
7
7
|
export declare const createPlugin: () => SafePlugin<any>;
|
|
@@ -5,4 +5,5 @@ import { PluginConfig } from '../types';
|
|
|
5
5
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
7
7
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
8
|
-
|
|
8
|
+
import type { PluginInjectionAPI } from '../types';
|
|
9
|
+
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, breakoutEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI) => SafePlugin<import("../types").TablePluginState>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A plugin for handle table custom widths
|
|
3
|
+
* Has login to scan the document, add width value to table's width attribute when necessary
|
|
4
|
+
* Also holds resizing state to hide / show table controls
|
|
5
|
+
*/
|
|
6
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
|
+
import { PluginKey } from 'prosemirror-state';
|
|
8
|
+
import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
9
|
+
type TableWidthPluginState = {
|
|
10
|
+
resizing: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const pluginKey: PluginKey<TableWidthPluginState>;
|
|
13
|
+
declare const createPlugin: (dispatch: Dispatch, fullWidthEnabled: boolean) => SafePlugin<{
|
|
14
|
+
resizing: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
export { createPlugin };
|
|
@@ -6,6 +6,8 @@ import { IntlShape } from 'react-intl-next';
|
|
|
6
6
|
import { TableLayout } from '@atlaskit/adf-schema';
|
|
7
7
|
import { TableColumnOrdering } from '@atlaskit/adf-schema/steps';
|
|
8
8
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
9
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
10
|
+
import type tablePlugin from './index';
|
|
9
11
|
export declare const RESIZE_HANDLE_AREA_DECORATION_GAP = 30;
|
|
10
12
|
export type RowInsertPosition = 'TOP' | 'BOTTOM';
|
|
11
13
|
export type PermittedLayoutsDescriptor = TableLayout[] | 'all';
|
|
@@ -19,6 +21,7 @@ export interface InsertRowOptions {
|
|
|
19
21
|
index: number;
|
|
20
22
|
moveCursorToInsertedRow: boolean;
|
|
21
23
|
}
|
|
24
|
+
export type PluginInjectionAPI = ExtractInjectionAPI<typeof tablePlugin>;
|
|
22
25
|
export type InsertRowMethods = INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB;
|
|
23
26
|
export interface PluginConfig {
|
|
24
27
|
advanced?: boolean;
|
|
@@ -38,3 +38,5 @@ export declare const contextualMenuDropdownWidth = 180;
|
|
|
38
38
|
export declare const stickyRowZIndex: number;
|
|
39
39
|
export declare const stickyRowOffsetTop = 8;
|
|
40
40
|
export declare const stickyHeaderBorderBottomWidth = 1;
|
|
41
|
+
export declare const TABLE_SNAP_GAP = 5;
|
|
42
|
+
export declare const TABLE_HIGHLIGHT_GAP = 10;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GuidelineConfig } from '@atlaskit/editor-plugin-guideline';
|
|
2
|
+
/**
|
|
3
|
+
* Returns keys of guidelines that are closest to the table and withthin the snapGap
|
|
4
|
+
*/
|
|
5
|
+
export declare const findClosestSnap: (currentWidth: number, snapWidths: number[], guidelines: GuidelineConfig[], snapGap?: number) => {
|
|
6
|
+
gap: number;
|
|
7
|
+
keys: string[];
|
|
8
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/adf-schema": "^26.2.0",
|
|
31
|
-
"@atlaskit/editor-common": "^74.
|
|
31
|
+
"@atlaskit/editor-common": "^74.23.0",
|
|
32
32
|
"@atlaskit/editor-palette": "1.5.1",
|
|
33
33
|
"@atlaskit/editor-plugin-analytics": "^0.1.0",
|
|
34
34
|
"@atlaskit/editor-plugin-content-insertion": "^0.0.6",
|
|
@@ -64,7 +64,8 @@
|
|
|
64
64
|
"@atlaskit/editor-plugin-decorations": "^0.1.0",
|
|
65
65
|
"@atlaskit/editor-plugin-feature-flags": "^0.1.0",
|
|
66
66
|
"@atlaskit/editor-plugin-grid": "^0.1.0",
|
|
67
|
-
"@atlaskit/editor-plugin-
|
|
67
|
+
"@atlaskit/editor-plugin-guideline": "^0.3.4",
|
|
68
|
+
"@atlaskit/editor-plugin-hyperlink": "^0.2.0",
|
|
68
69
|
"@atlaskit/editor-plugin-width": "^0.1.0",
|
|
69
70
|
"@atlaskit/editor-test-helpers": "^18.10.0",
|
|
70
71
|
"@atlaskit/visual-regression": "*",
|
package/report.api.md
CHANGED
|
@@ -21,6 +21,7 @@ import type { Command } from '@atlaskit/editor-common/types';
|
|
|
21
21
|
import type { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
22
22
|
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
23
23
|
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
24
|
+
import type { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
24
25
|
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
25
26
|
import { TableLayout } from '@atlaskit/adf-schema';
|
|
26
27
|
import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
@@ -109,6 +110,7 @@ export const tablesPlugin: NextEditorPlugin<
|
|
|
109
110
|
typeof analyticsPlugin,
|
|
110
111
|
typeof contentInsertionPlugin,
|
|
111
112
|
typeof widthPlugin,
|
|
113
|
+
typeof guidelinePlugin,
|
|
112
114
|
];
|
|
113
115
|
}
|
|
114
116
|
>;
|
|
@@ -44,6 +44,7 @@ import tablePlugin from '../../plugins/table-plugin';
|
|
|
44
44
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
45
45
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
46
46
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
47
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
47
48
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
48
49
|
|
|
49
50
|
const defaultTableDoc = doc(
|
|
@@ -97,6 +98,7 @@ describe('Table analytic events', () => {
|
|
|
97
98
|
])
|
|
98
99
|
.add(contentInsertionPlugin)
|
|
99
100
|
.add(widthPlugin)
|
|
101
|
+
.add(guidelinePlugin)
|
|
100
102
|
.add([tablePlugin, { tableOptions }]),
|
|
101
103
|
pluginKey,
|
|
102
104
|
});
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
} from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
20
20
|
import tablePlugin from '../../plugins/table-plugin';
|
|
21
21
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
22
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
22
23
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
23
24
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
24
25
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
@@ -43,6 +44,7 @@ describe('Tables with Collab editing', () => {
|
|
|
43
44
|
.add([analyticsPlugin, {}])
|
|
44
45
|
.add(contentInsertionPlugin)
|
|
45
46
|
.add(widthPlugin)
|
|
47
|
+
.add(guidelinePlugin)
|
|
46
48
|
.add([tablePlugin, { tableOptions }]),
|
|
47
49
|
pluginKey: tablePluginKey,
|
|
48
50
|
});
|
|
@@ -24,6 +24,7 @@ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
|
24
24
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
25
25
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
26
26
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
27
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
27
28
|
|
|
28
29
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
29
30
|
|
|
@@ -39,6 +40,7 @@ describe('table plugin: goToNextCell', () => {
|
|
|
39
40
|
.add([analyticsPlugin, {}])
|
|
40
41
|
.add(contentInsertionPlugin)
|
|
41
42
|
.add(widthPlugin)
|
|
43
|
+
.add(guidelinePlugin)
|
|
42
44
|
.add(tablePlugin);
|
|
43
45
|
const editor = (doc: DocBuilder) =>
|
|
44
46
|
createEditor<TablePluginState, PluginKey>({
|
|
@@ -21,6 +21,7 @@ import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
|
21
21
|
import { TablePluginState } from '../../../plugins/table/types';
|
|
22
22
|
import { addColumnAt } from '../../../plugins/table/commands/insert';
|
|
23
23
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
24
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
24
25
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
25
26
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
26
27
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
@@ -45,6 +46,7 @@ describe('table plugin: insert', () => {
|
|
|
45
46
|
.add([analyticsPlugin, {}])
|
|
46
47
|
.add(contentInsertionPlugin)
|
|
47
48
|
.add(widthPlugin)
|
|
49
|
+
.add(guidelinePlugin)
|
|
48
50
|
.add([
|
|
49
51
|
tablePlugin,
|
|
50
52
|
{
|
|
@@ -31,6 +31,7 @@ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
|
31
31
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
32
32
|
import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
33
33
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
34
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
34
35
|
|
|
35
36
|
describe('table plugin: commands', () => {
|
|
36
37
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -40,6 +41,7 @@ describe('table plugin: commands', () => {
|
|
|
40
41
|
.add(decorationsPlugin)
|
|
41
42
|
.add(contentInsertionPlugin)
|
|
42
43
|
.add(widthPlugin)
|
|
44
|
+
.add(guidelinePlugin)
|
|
43
45
|
.add([
|
|
44
46
|
tablePlugin,
|
|
45
47
|
{
|
|
@@ -19,6 +19,7 @@ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
|
19
19
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
20
20
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
21
21
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
22
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
22
23
|
|
|
23
24
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
24
25
|
|
|
@@ -39,6 +40,7 @@ describe('Sort Table', () => {
|
|
|
39
40
|
.add([analyticsPlugin, {}])
|
|
40
41
|
.add(contentInsertionPlugin)
|
|
41
42
|
.add(widthPlugin)
|
|
43
|
+
.add(guidelinePlugin)
|
|
42
44
|
.add([tablePlugin, { tableOptions: { allowHeaderRow: true } }]),
|
|
43
45
|
doc: doc(
|
|
44
46
|
table()(
|
|
@@ -70,6 +72,7 @@ describe('Sort Table', () => {
|
|
|
70
72
|
.add([analyticsPlugin, {}])
|
|
71
73
|
.add(contentInsertionPlugin)
|
|
72
74
|
.add(widthPlugin)
|
|
75
|
+
.add(guidelinePlugin)
|
|
73
76
|
.add([tablePlugin, { tableOptions: { allowHeaderRow: true } }]),
|
|
74
77
|
doc: doc(
|
|
75
78
|
table()(tr(td({})(p('2{<>}'))), tr(td({})(p('5'))), tr(td({})(p('4')))),
|
|
@@ -95,6 +98,7 @@ describe('Sort Table', () => {
|
|
|
95
98
|
.add([analyticsPlugin, {}])
|
|
96
99
|
.add(contentInsertionPlugin)
|
|
97
100
|
.add(widthPlugin)
|
|
101
|
+
.add(guidelinePlugin)
|
|
98
102
|
.add([tablePlugin, { tableOptions: { allowHeaderRow: true } }]),
|
|
99
103
|
doc: doc(
|
|
100
104
|
table()(tr(td({})(p('2{<>}'))), tr(td({})(p('5'))), tr(td({})(p('4')))),
|
|
@@ -46,6 +46,7 @@ import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
|
46
46
|
import tablePlugin from '../../plugins/table';
|
|
47
47
|
|
|
48
48
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
49
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
49
50
|
import { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
50
51
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
51
52
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
@@ -74,6 +75,7 @@ describe('table plugin: actions', () => {
|
|
|
74
75
|
.add(contentInsertionPlugin)
|
|
75
76
|
.add(decorationsPlugin)
|
|
76
77
|
.add(widthPlugin)
|
|
78
|
+
.add(guidelinePlugin)
|
|
77
79
|
.add(gridPlugin)
|
|
78
80
|
.add(tablePlugin),
|
|
79
81
|
pluginKey,
|
|
@@ -45,6 +45,7 @@ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
|
45
45
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
46
46
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
47
47
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
48
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
48
49
|
|
|
49
50
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
50
51
|
const array = (...args: any): Node[] => args.map((i: any) => i(defaultSchema));
|
|
@@ -107,6 +108,7 @@ describe('table plugin', () => {
|
|
|
107
108
|
.add([analyticsPlugin, {}])
|
|
108
109
|
.add(contentInsertionPlugin)
|
|
109
110
|
.add(widthPlugin)
|
|
111
|
+
.add(guidelinePlugin)
|
|
110
112
|
.add([tablePlugin, { tableOptions }]);
|
|
111
113
|
|
|
112
114
|
const editor = (doc: DocBuilder) => {
|
|
@@ -21,6 +21,7 @@ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
|
21
21
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
22
22
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
23
23
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
24
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
24
25
|
|
|
25
26
|
describe('event-handlers', () => {
|
|
26
27
|
let editor: any;
|
|
@@ -34,6 +35,7 @@ describe('event-handlers', () => {
|
|
|
34
35
|
.add([analyticsPlugin, {}])
|
|
35
36
|
.add(contentInsertionPlugin)
|
|
36
37
|
.add(widthPlugin)
|
|
38
|
+
.add(guidelinePlugin)
|
|
37
39
|
.add([tablePlugin, { tableOptions: { allowColumnResizing: false } }]);
|
|
38
40
|
editor = (doc: DocBuilder) =>
|
|
39
41
|
createEditor<TablePluginState, PluginKey>({
|
|
@@ -66,6 +68,7 @@ describe('event-handlers', () => {
|
|
|
66
68
|
.add([analyticsPlugin, {}])
|
|
67
69
|
.add(contentInsertionPlugin)
|
|
68
70
|
.add(widthPlugin)
|
|
71
|
+
.add(guidelinePlugin)
|
|
69
72
|
.add([tablePlugin, { tableOptions: { allowColumnResizing: false } }]);
|
|
70
73
|
editor = (doc: DocBuilder) =>
|
|
71
74
|
createEditor<TablePluginState, PluginKey>({
|
|
@@ -30,6 +30,7 @@ import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
|
30
30
|
import { TableCssClassName as ClassName } from '../../plugins/table/types';
|
|
31
31
|
import tablePlugin from '../../plugins/table-plugin';
|
|
32
32
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
33
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
33
34
|
import { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
34
35
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
35
36
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
@@ -46,6 +47,7 @@ describe('table plugin: decorations', () => {
|
|
|
46
47
|
.add([analyticsPlugin, {}])
|
|
47
48
|
.add(contentInsertionPlugin)
|
|
48
49
|
.add(widthPlugin)
|
|
50
|
+
.add(guidelinePlugin)
|
|
49
51
|
.add(tablePlugin),
|
|
50
52
|
pluginKey,
|
|
51
53
|
});
|
|
@@ -164,6 +166,7 @@ describe('table event handlers', () => {
|
|
|
164
166
|
.add(contentInsertionPlugin)
|
|
165
167
|
.add(decorationsPlugin)
|
|
166
168
|
.add(widthPlugin)
|
|
169
|
+
.add(guidelinePlugin)
|
|
167
170
|
.add(gridPlugin)
|
|
168
171
|
.add(tablePlugin),
|
|
169
172
|
pluginKey,
|
|
@@ -20,6 +20,7 @@ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
|
20
20
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
21
21
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
22
22
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
23
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
23
24
|
|
|
24
25
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
25
26
|
|
|
@@ -45,6 +46,7 @@ describe('fix tables', () => {
|
|
|
45
46
|
.add([analyticsPlugin, {}])
|
|
46
47
|
.add(contentInsertionPlugin)
|
|
47
48
|
.add(widthPlugin)
|
|
49
|
+
.add(guidelinePlugin)
|
|
48
50
|
.add([tablePlugin, { tableOptions }]),
|
|
49
51
|
pluginKey: tablePluginKey,
|
|
50
52
|
});
|
|
@@ -28,6 +28,7 @@ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
|
28
28
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
29
29
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
30
30
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
31
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
31
32
|
import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
32
33
|
|
|
33
34
|
const formatMessage: (t: { id: string }) => string = (message) =>
|
|
@@ -79,6 +80,7 @@ describe('getToolbarConfig', () => {
|
|
|
79
80
|
.add(contentInsertionPlugin)
|
|
80
81
|
.add(decorationsPlugin)
|
|
81
82
|
.add(widthPlugin)
|
|
83
|
+
.add(guidelinePlugin)
|
|
82
84
|
.add(tablePlugin),
|
|
83
85
|
});
|
|
84
86
|
|
|
@@ -22,6 +22,7 @@ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
|
22
22
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
23
23
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
24
24
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
25
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
25
26
|
|
|
26
27
|
describe('table action handlers', () => {
|
|
27
28
|
let editor: any;
|
|
@@ -34,6 +35,7 @@ describe('table action handlers', () => {
|
|
|
34
35
|
.add([analyticsPlugin, {}])
|
|
35
36
|
.add(contentInsertionPlugin)
|
|
36
37
|
.add(widthPlugin)
|
|
38
|
+
.add(guidelinePlugin)
|
|
37
39
|
.add(tablePlugin);
|
|
38
40
|
|
|
39
41
|
editor = (doc: DocBuilder) =>
|
|
@@ -35,6 +35,7 @@ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
|
35
35
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
36
36
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
37
37
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
38
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
38
39
|
|
|
39
40
|
describe('table hover selection plugin', () => {
|
|
40
41
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -43,6 +44,7 @@ describe('table hover selection plugin', () => {
|
|
|
43
44
|
.add([analyticsPlugin, {}])
|
|
44
45
|
.add(contentInsertionPlugin)
|
|
45
46
|
.add(widthPlugin)
|
|
47
|
+
.add(guidelinePlugin)
|
|
46
48
|
.add(tablePlugin);
|
|
47
49
|
|
|
48
50
|
const editor = (doc: DocBuilder) =>
|
|
@@ -49,6 +49,7 @@ import {
|
|
|
49
49
|
|
|
50
50
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
51
51
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
52
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
52
53
|
import { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
53
54
|
import { getPluginState } from '../../plugins/table/pm-plugins/plugin-factory';
|
|
54
55
|
import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
@@ -88,6 +89,7 @@ describe('table plugin', () => {
|
|
|
88
89
|
.add([featureFlagsPlugin, {}])
|
|
89
90
|
.add([analyticsPlugin, {}])
|
|
90
91
|
.add(widthPlugin)
|
|
92
|
+
.add(guidelinePlugin)
|
|
91
93
|
.add(gridPlugin)
|
|
92
94
|
.add(contentInsertionPlugin)
|
|
93
95
|
.add([tablePlugin, { tableOptions }]);
|
|
@@ -28,6 +28,7 @@ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
|
28
28
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
29
29
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
30
30
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
31
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
31
32
|
import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
32
33
|
|
|
33
34
|
describe('table toolbar', () => {
|
|
@@ -45,6 +46,7 @@ describe('table toolbar', () => {
|
|
|
45
46
|
.add(contentInsertionPlugin)
|
|
46
47
|
.add(decorationsPlugin)
|
|
47
48
|
.add(widthPlugin)
|
|
49
|
+
.add(guidelinePlugin)
|
|
48
50
|
.add([tablePlugin, { tableOptions }]);
|
|
49
51
|
|
|
50
52
|
const editor = (doc: DocBuilder) => {
|
|
@@ -29,6 +29,7 @@ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
|
29
29
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
30
30
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
31
31
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
32
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
32
33
|
|
|
33
34
|
jest.mock('@atlaskit/editor-common/utils', () => ({
|
|
34
35
|
...jest.requireActual<Object>('@atlaskit/editor-common/utils'),
|
|
@@ -50,6 +51,7 @@ describe('table -> nodeviews -> tableCell.tsx', () => {
|
|
|
50
51
|
.add([analyticsPlugin, {}])
|
|
51
52
|
.add(contentInsertionPlugin)
|
|
52
53
|
.add(widthPlugin)
|
|
54
|
+
.add(guidelinePlugin)
|
|
53
55
|
.add([tablePlugin, { tableOptions: { advanced: true, ...props } }]),
|
|
54
56
|
pluginKey,
|
|
55
57
|
});
|
|
@@ -25,6 +25,7 @@ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
|
25
25
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
26
26
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
27
27
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
28
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
28
29
|
|
|
29
30
|
describe('table -> nodeviews -> table.tsx', () => {
|
|
30
31
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -43,6 +44,7 @@ describe('table -> nodeviews -> table.tsx', () => {
|
|
|
43
44
|
.add([analyticsPlugin, {}])
|
|
44
45
|
.add(contentInsertionPlugin)
|
|
45
46
|
.add(widthPlugin)
|
|
47
|
+
.add(guidelinePlugin)
|
|
46
48
|
.add([
|
|
47
49
|
tablePlugin,
|
|
48
50
|
{
|
|
@@ -36,6 +36,7 @@ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
|
36
36
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
37
37
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
38
38
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
39
|
+
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
39
40
|
|
|
40
41
|
describe('tables: column resizing decorations', () => {
|
|
41
42
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -48,6 +49,7 @@ describe('tables: column resizing decorations', () => {
|
|
|
48
49
|
.add([analyticsPlugin, {}])
|
|
49
50
|
.add(contentInsertionPlugin)
|
|
50
51
|
.add(widthPlugin)
|
|
52
|
+
.add(guidelinePlugin)
|
|
51
53
|
.add([
|
|
52
54
|
tablePlugin,
|
|
53
55
|
{
|