@atlaskit/editor-plugin-table 1.7.2 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +2 -1
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +12 -12
- package/dist/cjs/plugins/table/utils/nodes.js +4 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +4 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +1 -1
- package/dist/es2019/plugins/table/utils/nodes.js +3 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +2 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +12 -12
- package/dist/esm/plugins/table/utils/nodes.js +4 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/commands/insert.d.ts +1 -1
- package/dist/types/plugins/table/nodeviews/table.d.ts +3 -3
- package/dist/types/plugins/table/pm-plugins/decorations/plugin.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/plugin-factory.d.ts +3 -1
- package/dist/types/plugins/table/pm-plugins/plugin-key.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/sticky-headers/plugin-key.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/plugin-state.d.ts +3 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-add-width.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-local-id.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/plugin-factory.d.ts +5 -3
- package/dist/types/plugins/table/pm-plugins/table-resizing/plugin-key.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/plugin.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +1 -1
- package/dist/types/plugins/table/utils/collapse.d.ts +3 -3
- package/dist/types/plugins/table/utils/row-controls.d.ts +1 -1
- package/dist/types/plugins/table/utils/update-plugin-state-decorations.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands/insert.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/plugin.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-factory.d.ts +3 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-key.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-key.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-state.d.ts +3 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-add-width.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-local-id.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-factory.d.ts +5 -3
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-key.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/utils/collapse.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/utils/row-controls.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/utils/update-plugin-state-decorations.d.ts +1 -1
- package/package.json +4 -11
- package/src/__tests__/integration/sticky-header.ts +0 -94
- package/src/__tests__/visual-regression/__image_snapshots__/sticky-header-ts-snapshot-test-table-sticky-header-should-align-with-table-cell-when-active-1-snap.png +2 -2
- package/src/__tests__/visual-regression/__image_snapshots__/sticky-header-ts-snapshot-test-table-sticky-header-should-align-with-table-cell-when-active-2-snap.png +2 -2
- package/src/__tests__/visual-regression/sticky-header.ts +3 -2
- package/src/plugins/table/nodeviews/table.tsx +5 -2
- package/src/plugins/table/pm-plugins/main.ts +1 -1
- package/src/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.ts +1 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/misc.ts +1 -1
- package/src/plugins/table/toolbar.tsx +1 -3
- package/src/plugins/table/ui/FloatingContextualMenu/index.tsx +1 -1
- package/src/plugins/table/utils/collapse.ts +3 -3
- package/src/plugins/table/utils/nodes.ts +3 -3
- package/src/plugins/table/utils/update-plugin-state-decorations.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 1.7.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5f5ba16de66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f5ba16de66) - [ED-13910] Fix prosemirror types
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 1.7.2
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js
CHANGED
|
@@ -51,7 +51,8 @@ var createPlugin = function createPlugin() {
|
|
|
51
51
|
},
|
|
52
52
|
props: {
|
|
53
53
|
decorations: function decorations(state) {
|
|
54
|
-
|
|
54
|
+
var _tableSafariDeleteCom;
|
|
55
|
+
return (_tableSafariDeleteCom = tableSafariDeleteCompositionTextIssueWorkaroundKey.getState(state)) === null || _tableSafariDeleteCom === void 0 ? void 0 : _tableSafariDeleteCom.decorations;
|
|
55
56
|
},
|
|
56
57
|
handleDOMEvents: {
|
|
57
58
|
beforeinput: function beforeinput(view, event) {
|
|
@@ -19,8 +19,8 @@ var _ContextualMenu = _interopRequireDefault(require("./ContextualMenu"));
|
|
|
19
19
|
|
|
20
20
|
// offset of the contextual menu dropdown
|
|
21
21
|
var calculateOffset = function calculateOffset(targetCellRef, state) {
|
|
22
|
-
var
|
|
23
|
-
tableRef =
|
|
22
|
+
var _ref = _pluginKey.pluginKey.getState(state) || {},
|
|
23
|
+
tableRef = _ref.tableRef;
|
|
24
24
|
var top = -_consts.contextualMenuTriggerSize;
|
|
25
25
|
if (tableRef && targetCellRef) {
|
|
26
26
|
var targetOffset = targetCellRef.getBoundingClientRect();
|
|
@@ -32,16 +32,16 @@ var calculateOffset = function calculateOffset(targetCellRef, state) {
|
|
|
32
32
|
}
|
|
33
33
|
return [_consts.contextualMenuTriggerSize / 2, top];
|
|
34
34
|
};
|
|
35
|
-
var FloatingContextualMenu = function FloatingContextualMenu(
|
|
36
|
-
var mountPoint =
|
|
37
|
-
boundariesElement =
|
|
38
|
-
scrollableElement =
|
|
39
|
-
editorView =
|
|
40
|
-
isOpen =
|
|
41
|
-
pluginConfig =
|
|
42
|
-
editorAnalyticsAPI =
|
|
43
|
-
getEditorContainerWidth =
|
|
44
|
-
getEditorFeatureFlags =
|
|
35
|
+
var FloatingContextualMenu = function FloatingContextualMenu(_ref2) {
|
|
36
|
+
var mountPoint = _ref2.mountPoint,
|
|
37
|
+
boundariesElement = _ref2.boundariesElement,
|
|
38
|
+
scrollableElement = _ref2.scrollableElement,
|
|
39
|
+
editorView = _ref2.editorView,
|
|
40
|
+
isOpen = _ref2.isOpen,
|
|
41
|
+
pluginConfig = _ref2.pluginConfig,
|
|
42
|
+
editorAnalyticsAPI = _ref2.editorAnalyticsAPI,
|
|
43
|
+
getEditorContainerWidth = _ref2.getEditorContainerWidth,
|
|
44
|
+
getEditorFeatureFlags = _ref2.getEditorFeatureFlags;
|
|
45
45
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
46
46
|
var _getPluginState = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
47
47
|
targetCellPosition = _getPluginState.targetCellPosition;
|
|
@@ -62,12 +62,14 @@ var checkIfNumberColumnEnabled = function checkIfNumberColumnEnabled(selection)
|
|
|
62
62
|
};
|
|
63
63
|
exports.checkIfNumberColumnEnabled = checkIfNumberColumnEnabled;
|
|
64
64
|
var isLayoutSupported = function isLayoutSupported(state) {
|
|
65
|
-
var
|
|
65
|
+
var _pluginKey$getState;
|
|
66
|
+
var _ref = ((_pluginKey$getState = _pluginKey.pluginKey.getState(state)) === null || _pluginKey$getState === void 0 ? void 0 : _pluginKey$getState.pluginConfig) || {},
|
|
67
|
+
permittedLayouts = _ref.permittedLayouts;
|
|
66
68
|
var _state$schema$nodes = state.schema.nodes,
|
|
67
69
|
bodiedExtension = _state$schema$nodes.bodiedExtension,
|
|
68
70
|
layoutSection = _state$schema$nodes.layoutSection,
|
|
69
71
|
expand = _state$schema$nodes.expand;
|
|
70
|
-
return !(0, _prosemirrorUtils.hasParentNodeOfType)([expand, layoutSection, bodiedExtension])(state.selection) && permittedLayouts && (permittedLayouts === 'all' || permittedLayouts.indexOf('default') > -1 && permittedLayouts.indexOf('wide') > -1 && permittedLayouts.indexOf('full-
|
|
72
|
+
return !(0, _prosemirrorUtils.hasParentNodeOfType)([expand, layoutSection, bodiedExtension])(state.selection) && !!permittedLayouts && (permittedLayouts === 'all' || permittedLayouts.indexOf('default') > -1 && permittedLayouts.indexOf('wide') > -1 && permittedLayouts.indexOf('full-width') > -1);
|
|
71
73
|
};
|
|
72
74
|
exports.isLayoutSupported = isLayoutSupported;
|
|
73
75
|
var getTableWidth = function getTableWidth(node) {
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js
CHANGED
|
@@ -42,7 +42,10 @@ export const createPlugin = () => {
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
props: {
|
|
45
|
-
decorations: state =>
|
|
45
|
+
decorations: state => {
|
|
46
|
+
var _tableSafariDeleteCom;
|
|
47
|
+
return (_tableSafariDeleteCom = tableSafariDeleteCompositionTextIssueWorkaroundKey.getState(state)) === null || _tableSafariDeleteCom === void 0 ? void 0 : _tableSafariDeleteCom.decorations;
|
|
48
|
+
},
|
|
46
49
|
handleDOMEvents: {
|
|
47
50
|
beforeinput: (view, event) => {
|
|
48
51
|
if ((event === null || event === void 0 ? void 0 : event.inputType) !== 'deleteCompositionText') {
|
|
@@ -14,7 +14,7 @@ import ContextualMenu from './ContextualMenu';
|
|
|
14
14
|
const calculateOffset = (targetCellRef, state) => {
|
|
15
15
|
const {
|
|
16
16
|
tableRef
|
|
17
|
-
} = pluginKey.getState(state);
|
|
17
|
+
} = pluginKey.getState(state) || {};
|
|
18
18
|
let top = -contextualMenuTriggerSize;
|
|
19
19
|
if (tableRef && targetCellRef) {
|
|
20
20
|
const targetOffset = targetCellRef.getBoundingClientRect();
|
|
@@ -40,15 +40,16 @@ export const checkIfHeaderColumnEnabled = selection => filterNearSelection(selec
|
|
|
40
40
|
export const checkIfHeaderRowEnabled = selection => filterNearSelection(selection, findTable, containsHeaderRow, false);
|
|
41
41
|
export const checkIfNumberColumnEnabled = selection => filterNearSelection(selection, findTable, table => !!table.attrs.isNumberColumnEnabled, false);
|
|
42
42
|
export const isLayoutSupported = state => {
|
|
43
|
+
var _pluginKey$getState;
|
|
43
44
|
const {
|
|
44
45
|
permittedLayouts
|
|
45
|
-
} = pluginKey.getState(state).pluginConfig;
|
|
46
|
+
} = ((_pluginKey$getState = pluginKey.getState(state)) === null || _pluginKey$getState === void 0 ? void 0 : _pluginKey$getState.pluginConfig) || {};
|
|
46
47
|
const {
|
|
47
48
|
bodiedExtension,
|
|
48
49
|
layoutSection,
|
|
49
50
|
expand
|
|
50
51
|
} = state.schema.nodes;
|
|
51
|
-
return !hasParentNodeOfType([expand, layoutSection, bodiedExtension])(state.selection) && permittedLayouts && (permittedLayouts === 'all' || permittedLayouts.indexOf('default') > -1 && permittedLayouts.indexOf('wide') > -1 && permittedLayouts.indexOf('full-
|
|
52
|
+
return !hasParentNodeOfType([expand, layoutSection, bodiedExtension])(state.selection) && !!permittedLayouts && (permittedLayouts === 'all' || permittedLayouts.indexOf('default') > -1 && permittedLayouts.indexOf('wide') > -1 && permittedLayouts.indexOf('full-width') > -1);
|
|
52
53
|
};
|
|
53
54
|
export const getTableWidth = node => {
|
|
54
55
|
return getTableWidths(node).reduce((acc, current) => acc + current, 0);
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js
CHANGED
|
@@ -43,7 +43,8 @@ export var createPlugin = function createPlugin() {
|
|
|
43
43
|
},
|
|
44
44
|
props: {
|
|
45
45
|
decorations: function decorations(state) {
|
|
46
|
-
|
|
46
|
+
var _tableSafariDeleteCom;
|
|
47
|
+
return (_tableSafariDeleteCom = tableSafariDeleteCompositionTextIssueWorkaroundKey.getState(state)) === null || _tableSafariDeleteCom === void 0 ? void 0 : _tableSafariDeleteCom.decorations;
|
|
47
48
|
},
|
|
48
49
|
handleDOMEvents: {
|
|
49
50
|
beforeinput: function beforeinput(view, event) {
|
|
@@ -12,8 +12,8 @@ import ContextualMenu from './ContextualMenu';
|
|
|
12
12
|
|
|
13
13
|
// offset of the contextual menu dropdown
|
|
14
14
|
var calculateOffset = function calculateOffset(targetCellRef, state) {
|
|
15
|
-
var
|
|
16
|
-
tableRef =
|
|
15
|
+
var _ref = pluginKey.getState(state) || {},
|
|
16
|
+
tableRef = _ref.tableRef;
|
|
17
17
|
var top = -contextualMenuTriggerSize;
|
|
18
18
|
if (tableRef && targetCellRef) {
|
|
19
19
|
var targetOffset = targetCellRef.getBoundingClientRect();
|
|
@@ -25,16 +25,16 @@ var calculateOffset = function calculateOffset(targetCellRef, state) {
|
|
|
25
25
|
}
|
|
26
26
|
return [contextualMenuTriggerSize / 2, top];
|
|
27
27
|
};
|
|
28
|
-
var FloatingContextualMenu = function FloatingContextualMenu(
|
|
29
|
-
var mountPoint =
|
|
30
|
-
boundariesElement =
|
|
31
|
-
scrollableElement =
|
|
32
|
-
editorView =
|
|
33
|
-
isOpen =
|
|
34
|
-
pluginConfig =
|
|
35
|
-
editorAnalyticsAPI =
|
|
36
|
-
getEditorContainerWidth =
|
|
37
|
-
getEditorFeatureFlags =
|
|
28
|
+
var FloatingContextualMenu = function FloatingContextualMenu(_ref2) {
|
|
29
|
+
var mountPoint = _ref2.mountPoint,
|
|
30
|
+
boundariesElement = _ref2.boundariesElement,
|
|
31
|
+
scrollableElement = _ref2.scrollableElement,
|
|
32
|
+
editorView = _ref2.editorView,
|
|
33
|
+
isOpen = _ref2.isOpen,
|
|
34
|
+
pluginConfig = _ref2.pluginConfig,
|
|
35
|
+
editorAnalyticsAPI = _ref2.editorAnalyticsAPI,
|
|
36
|
+
getEditorContainerWidth = _ref2.getEditorContainerWidth,
|
|
37
|
+
getEditorFeatureFlags = _ref2.getEditorFeatureFlags;
|
|
38
38
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
39
39
|
var _getPluginState = getPluginState(editorView.state),
|
|
40
40
|
targetCellPosition = _getPluginState.targetCellPosition;
|
|
@@ -49,12 +49,14 @@ export var checkIfNumberColumnEnabled = function checkIfNumberColumnEnabled(sele
|
|
|
49
49
|
}, false);
|
|
50
50
|
};
|
|
51
51
|
export var isLayoutSupported = function isLayoutSupported(state) {
|
|
52
|
-
var
|
|
52
|
+
var _pluginKey$getState;
|
|
53
|
+
var _ref = ((_pluginKey$getState = pluginKey.getState(state)) === null || _pluginKey$getState === void 0 ? void 0 : _pluginKey$getState.pluginConfig) || {},
|
|
54
|
+
permittedLayouts = _ref.permittedLayouts;
|
|
53
55
|
var _state$schema$nodes = state.schema.nodes,
|
|
54
56
|
bodiedExtension = _state$schema$nodes.bodiedExtension,
|
|
55
57
|
layoutSection = _state$schema$nodes.layoutSection,
|
|
56
58
|
expand = _state$schema$nodes.expand;
|
|
57
|
-
return !hasParentNodeOfType([expand, layoutSection, bodiedExtension])(state.selection) && permittedLayouts && (permittedLayouts === 'all' || permittedLayouts.indexOf('default') > -1 && permittedLayouts.indexOf('wide') > -1 && permittedLayouts.indexOf('full-
|
|
59
|
+
return !hasParentNodeOfType([expand, layoutSection, bodiedExtension])(state.selection) && !!permittedLayouts && (permittedLayouts === 'all' || permittedLayouts.indexOf('default') > -1 && permittedLayouts.indexOf('wide') > -1 && permittedLayouts.indexOf('full-width') > -1);
|
|
58
60
|
};
|
|
59
61
|
export var getTableWidth = function getTableWidth(node) {
|
|
60
62
|
return getTableWidths(node).reduce(function (acc, current) {
|
package/dist/esm/version.json
CHANGED
|
@@ -2,7 +2,7 @@ import { Transaction } from 'prosemirror-state';
|
|
|
2
2
|
import { Command } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { EditorView } from 'prosemirror-view';
|
|
4
4
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
|
-
export declare function addColumnAt(getEditorContainerWidth: GetEditorContainerWidth): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction
|
|
5
|
+
export declare function addColumnAt(getEditorContainerWidth: GetEditorContainerWidth): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
6
6
|
export declare const addColumnBefore: (getEditorContainerWidth: GetEditorContainerWidth) => Command;
|
|
7
7
|
export declare const addColumnAfter: (getEditorContainerWidth: GetEditorContainerWidth) => Command;
|
|
8
8
|
export declare const insertColumn: (getEditorContainerWidth: GetEditorContainerWidth) => (column: number) => Command;
|
|
@@ -16,11 +16,11 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
16
16
|
getPos: getPosHandlerNode;
|
|
17
17
|
constructor(props: Props);
|
|
18
18
|
getContentDOM(): {
|
|
19
|
-
dom:
|
|
20
|
-
contentDOM?:
|
|
19
|
+
dom: HTMLElement;
|
|
20
|
+
contentDOM?: HTMLElement | undefined;
|
|
21
21
|
};
|
|
22
22
|
setDomAttrs(node: PmNode): void;
|
|
23
|
-
getNode: () => PmNode
|
|
23
|
+
getNode: () => PmNode;
|
|
24
24
|
render(props: Props, forwardRef: ForwardRef): JSX.Element;
|
|
25
25
|
private hasHoveredRows;
|
|
26
26
|
viewShouldUpdate(nextNode: PmNode): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { EditorState, PluginKey, Transaction, ReadonlyTransaction } from 'prosemirror-state';
|
|
3
3
|
import { DecorationSet } from 'prosemirror-view';
|
|
4
|
-
export declare const pluginKey: PluginKey<any
|
|
4
|
+
export declare const pluginKey: PluginKey<any>;
|
|
5
5
|
export declare const getDecorations: (state: EditorState) => DecorationSet;
|
|
6
6
|
export declare const handleDocOrSelectionChanged: (tr: Transaction | ReadonlyTransaction, decorationSet: DecorationSet, oldState: EditorState) => DecorationSet;
|
|
7
|
-
export declare const createPlugin: () => SafePlugin<any
|
|
7
|
+
export declare const createPlugin: () => SafePlugin<any>;
|
|
@@ -5,4 +5,4 @@ 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
|
-
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) => SafePlugin<import("../types").TablePluginState
|
|
8
|
+
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) => SafePlugin<import("../types").TablePluginState>;
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference path="../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
+
/// <reference path="../../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("../types").TablePluginState | ((state: import("prosemirror-state").EditorState) => import("../types").TablePluginState)) => import("prosemirror-state").SafeStateField<import("../types").TablePluginState>, createCommand: <A = import("../types").TablePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("../types").TablePluginState;
|
package/dist/types/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts
CHANGED
|
@@ -10,6 +10,6 @@ interface SafariDeleteCompositionTextIssueWorkaroundPluginState {
|
|
|
10
10
|
renderSpan: boolean;
|
|
11
11
|
decorations: DecorationSet;
|
|
12
12
|
}
|
|
13
|
-
export declare const tableSafariDeleteCompositionTextIssueWorkaroundKey: PluginKey<SafariDeleteCompositionTextIssueWorkaroundPluginState
|
|
14
|
-
export declare const createPlugin: () => SafePlugin<SafariDeleteCompositionTextIssueWorkaroundPluginState
|
|
13
|
+
export declare const tableSafariDeleteCompositionTextIssueWorkaroundKey: PluginKey<SafariDeleteCompositionTextIssueWorkaroundPluginState>;
|
|
14
|
+
export declare const createPlugin: () => SafePlugin<SafariDeleteCompositionTextIssueWorkaroundPluginState>;
|
|
15
15
|
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference path="../../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
+
/// <reference path="../../../../../../../../../typings/prosemirror-state.d.ts" />
|
|
1
3
|
import { StickyPluginAction, StickyPluginState } from './types';
|
|
2
|
-
declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: StickyPluginState | ((state: import("prosemirror-state").EditorState
|
|
4
|
+
declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: StickyPluginState | ((state: import("prosemirror-state").EditorState) => StickyPluginState)) => import("prosemirror-state").SafeStateField<StickyPluginState>, createCommand: <A = StickyPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
3
5
|
export { createPluginState, createCommand };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { EventDispatcher, Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
|
-
export declare const createPlugin: (dispatch: Dispatch, eventDispatcher: EventDispatcher, initialState: (() => never[]) | undefined, getEditorFeatureFlags: GetEditorFeatureFlags) => SafePlugin<import("./types").StickyPluginState
|
|
4
|
+
export declare const createPlugin: (dispatch: Dispatch, eventDispatcher: EventDispatcher, initialState: (() => never[]) | undefined, getEditorFeatureFlags: GetEditorFeatureFlags) => SafePlugin<import("./types").StickyPluginState>;
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
6
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
|
-
declare const createPlugin: (dispatch: Dispatch, fullWidthEnabled: boolean) => SafePlugin<any
|
|
7
|
+
declare const createPlugin: (dispatch: Dispatch, fullWidthEnabled: boolean) => SafePlugin<any>;
|
|
8
8
|
export { createPlugin };
|
|
@@ -18,5 +18,5 @@ interface TableLocalIdPluginState {
|
|
|
18
18
|
/**
|
|
19
19
|
* Ensures uniqueness of `localId`s on tables being created or edited
|
|
20
20
|
*/
|
|
21
|
-
declare const createPlugin: (dispatch: Dispatch) => SafePlugin<TableLocalIdPluginState
|
|
21
|
+
declare const createPlugin: (dispatch: Dispatch) => SafePlugin<TableLocalIdPluginState>;
|
|
22
22
|
export { createPlugin };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/// <reference path="../../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
+
/// <reference path="../../../../../../../../../typings/prosemirror-state.d.ts" />
|
|
1
3
|
import { ColumnResizingPluginState } from '../../types';
|
|
2
|
-
export declare const createCommand: <A = import("../../types").ColumnResizingPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState
|
|
3
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: ColumnResizingPluginState | ((state: import("prosemirror-state").EditorState
|
|
4
|
-
export declare const getPluginState: (state: import("prosemirror-state").EditorState
|
|
4
|
+
export declare const createCommand: <A = import("../../types").ColumnResizingPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
5
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: ColumnResizingPluginState | ((state: import("prosemirror-state").EditorState) => ColumnResizingPluginState)) => import("prosemirror-state").SafeStateField<ColumnResizingPluginState>;
|
|
6
|
+
export declare const getPluginState: (state: import("prosemirror-state").EditorState) => ColumnResizingPluginState;
|
|
@@ -3,4 +3,4 @@ import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
|
3
3
|
import { ColumnResizingPluginState } from '../../types';
|
|
4
4
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
6
|
-
export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI): SafePlugin<ColumnResizingPluginState
|
|
6
|
+
export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI): SafePlugin<ColumnResizingPluginState>;
|
|
@@ -7,7 +7,7 @@ import { EditorState } from 'prosemirror-state';
|
|
|
7
7
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
8
8
|
export declare function getLayoutSize(tableLayout: TableLayout, containerWidth: number | undefined, options: TableOptions): number;
|
|
9
9
|
export declare function getDefaultLayoutMaxWidth(containerWidth?: number): number;
|
|
10
|
-
export declare function pointsAtCell($pos: ResolvedPos
|
|
10
|
+
export declare function pointsAtCell($pos: ResolvedPos): false | PMNode | null | undefined;
|
|
11
11
|
export declare function currentColWidth(view: EditorView, cellPos: number, { colspan, colwidth }: CellAttributes): number;
|
|
12
12
|
export declare function domCellAround(target: HTMLElement | null): HTMLElement | null;
|
|
13
13
|
interface getTableMaxWidthProps {
|
|
@@ -17,4 +17,4 @@ export declare const scale: (tableRef: HTMLTableElement, options: ScaleOptions,
|
|
|
17
17
|
export declare const scaleWithParent: (tableRef: HTMLTableElement, parentWidth: number, table: PMNode, start: number, domAtPos: DomAtPos) => ResizeState;
|
|
18
18
|
export declare function scaleTableTo(state: ResizeState, maxSize: number): ResizeState;
|
|
19
19
|
export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos) => void;
|
|
20
|
-
export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos) => (tr: Transaction) => Transaction
|
|
20
|
+
export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos) => (tr: Transaction) => Transaction;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { NodeType, NodeRange
|
|
1
|
+
import { NodeType, NodeRange } from 'prosemirror-model';
|
|
2
2
|
import { Transaction, ReadonlyTransaction } from 'prosemirror-state';
|
|
3
|
-
interface IsTableCollapsibleResult
|
|
3
|
+
interface IsTableCollapsibleResult {
|
|
4
4
|
tableIsCollapsible: boolean;
|
|
5
5
|
range?: NodeRange;
|
|
6
6
|
findWrappingRes?: Array<{
|
|
7
|
-
type: NodeType
|
|
7
|
+
type: NodeType;
|
|
8
8
|
attrs?: {
|
|
9
9
|
[key: string]: any;
|
|
10
10
|
} | null;
|
|
@@ -13,4 +13,4 @@ export declare const getRowDeleteButtonParams: (rowsHeights: Array<number | unde
|
|
|
13
13
|
} | null;
|
|
14
14
|
export declare const getRowsParams: (rowsHeights: Array<number | undefined>) => RowParams[];
|
|
15
15
|
export declare const getRowClassNames: (index: number, selection: Selection, hoveredRows?: number[], isInDanger?: boolean, isResizing?: boolean) => string;
|
|
16
|
-
export declare const copyPreviousRow: (schema: Schema) => (insertNewRowIndex: number) => (tr: Transaction) => Transaction
|
|
16
|
+
export declare const copyPreviousRow: (schema: Schema) => (insertNewRowIndex: number) => (tr: Transaction) => Transaction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { EditorState } from 'prosemirror-state';
|
|
2
2
|
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
3
3
|
import { TableDecorations } from '../types';
|
|
4
|
-
export declare const updatePluginStateDecorations: (state: EditorState
|
|
4
|
+
export declare const updatePluginStateDecorations: (state: EditorState, decorations: Decoration[], key: TableDecorations) => DecorationSet;
|
|
@@ -2,7 +2,7 @@ import { Transaction } from 'prosemirror-state';
|
|
|
2
2
|
import { Command } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { EditorView } from 'prosemirror-view';
|
|
4
4
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
|
-
export declare function addColumnAt(getEditorContainerWidth: GetEditorContainerWidth): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction
|
|
5
|
+
export declare function addColumnAt(getEditorContainerWidth: GetEditorContainerWidth): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
6
6
|
export declare const addColumnBefore: (getEditorContainerWidth: GetEditorContainerWidth) => Command;
|
|
7
7
|
export declare const addColumnAfter: (getEditorContainerWidth: GetEditorContainerWidth) => Command;
|
|
8
8
|
export declare const insertColumn: (getEditorContainerWidth: GetEditorContainerWidth) => (column: number) => Command;
|
|
@@ -16,11 +16,11 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
16
16
|
getPos: getPosHandlerNode;
|
|
17
17
|
constructor(props: Props);
|
|
18
18
|
getContentDOM(): {
|
|
19
|
-
dom:
|
|
20
|
-
contentDOM?:
|
|
19
|
+
dom: HTMLElement;
|
|
20
|
+
contentDOM?: HTMLElement | undefined;
|
|
21
21
|
};
|
|
22
22
|
setDomAttrs(node: PmNode): void;
|
|
23
|
-
getNode: () => PmNode
|
|
23
|
+
getNode: () => PmNode;
|
|
24
24
|
render(props: Props, forwardRef: ForwardRef): JSX.Element;
|
|
25
25
|
private hasHoveredRows;
|
|
26
26
|
viewShouldUpdate(nextNode: PmNode): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { EditorState, PluginKey, Transaction, ReadonlyTransaction } from 'prosemirror-state';
|
|
3
3
|
import { DecorationSet } from 'prosemirror-view';
|
|
4
|
-
export declare const pluginKey: PluginKey<any
|
|
4
|
+
export declare const pluginKey: PluginKey<any>;
|
|
5
5
|
export declare const getDecorations: (state: EditorState) => DecorationSet;
|
|
6
6
|
export declare const handleDocOrSelectionChanged: (tr: Transaction | ReadonlyTransaction, decorationSet: DecorationSet, oldState: EditorState) => DecorationSet;
|
|
7
|
-
export declare const createPlugin: () => SafePlugin<any
|
|
7
|
+
export declare const createPlugin: () => SafePlugin<any>;
|
|
@@ -5,4 +5,4 @@ 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
|
-
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) => SafePlugin<import("../types").TablePluginState
|
|
8
|
+
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) => SafePlugin<import("../types").TablePluginState>;
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference path="../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
+
/// <reference path="../../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("../types").TablePluginState | ((state: import("prosemirror-state").EditorState) => import("../types").TablePluginState)) => import("prosemirror-state").SafeStateField<import("../types").TablePluginState>, createCommand: <A = import("../types").TablePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("../types").TablePluginState;
|
|
@@ -10,6 +10,6 @@ interface SafariDeleteCompositionTextIssueWorkaroundPluginState {
|
|
|
10
10
|
renderSpan: boolean;
|
|
11
11
|
decorations: DecorationSet;
|
|
12
12
|
}
|
|
13
|
-
export declare const tableSafariDeleteCompositionTextIssueWorkaroundKey: PluginKey<SafariDeleteCompositionTextIssueWorkaroundPluginState
|
|
14
|
-
export declare const createPlugin: () => SafePlugin<SafariDeleteCompositionTextIssueWorkaroundPluginState
|
|
13
|
+
export declare const tableSafariDeleteCompositionTextIssueWorkaroundKey: PluginKey<SafariDeleteCompositionTextIssueWorkaroundPluginState>;
|
|
14
|
+
export declare const createPlugin: () => SafePlugin<SafariDeleteCompositionTextIssueWorkaroundPluginState>;
|
|
15
15
|
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference path="../../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
+
/// <reference path="../../../../../../../../../typings/prosemirror-state.d.ts" />
|
|
1
3
|
import { StickyPluginAction, StickyPluginState } from './types';
|
|
2
|
-
declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: StickyPluginState | ((state: import("prosemirror-state").EditorState
|
|
4
|
+
declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: StickyPluginState | ((state: import("prosemirror-state").EditorState) => StickyPluginState)) => import("prosemirror-state").SafeStateField<StickyPluginState>, createCommand: <A = StickyPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
3
5
|
export { createPluginState, createCommand };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { EventDispatcher, Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
|
-
export declare const createPlugin: (dispatch: Dispatch, eventDispatcher: EventDispatcher, initialState: (() => never[]) | undefined, getEditorFeatureFlags: GetEditorFeatureFlags) => SafePlugin<import("./types").StickyPluginState
|
|
4
|
+
export declare const createPlugin: (dispatch: Dispatch, eventDispatcher: EventDispatcher, initialState: (() => never[]) | undefined, getEditorFeatureFlags: GetEditorFeatureFlags) => SafePlugin<import("./types").StickyPluginState>;
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
6
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
|
-
declare const createPlugin: (dispatch: Dispatch, fullWidthEnabled: boolean) => SafePlugin<any
|
|
7
|
+
declare const createPlugin: (dispatch: Dispatch, fullWidthEnabled: boolean) => SafePlugin<any>;
|
|
8
8
|
export { createPlugin };
|
|
@@ -18,5 +18,5 @@ interface TableLocalIdPluginState {
|
|
|
18
18
|
/**
|
|
19
19
|
* Ensures uniqueness of `localId`s on tables being created or edited
|
|
20
20
|
*/
|
|
21
|
-
declare const createPlugin: (dispatch: Dispatch) => SafePlugin<TableLocalIdPluginState
|
|
21
|
+
declare const createPlugin: (dispatch: Dispatch) => SafePlugin<TableLocalIdPluginState>;
|
|
22
22
|
export { createPlugin };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/// <reference path="../../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
+
/// <reference path="../../../../../../../../../typings/prosemirror-state.d.ts" />
|
|
1
3
|
import { ColumnResizingPluginState } from '../../types';
|
|
2
|
-
export declare const createCommand: <A = import("../../types").ColumnResizingPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState
|
|
3
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: ColumnResizingPluginState | ((state: import("prosemirror-state").EditorState
|
|
4
|
-
export declare const getPluginState: (state: import("prosemirror-state").EditorState
|
|
4
|
+
export declare const createCommand: <A = import("../../types").ColumnResizingPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
5
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: ColumnResizingPluginState | ((state: import("prosemirror-state").EditorState) => ColumnResizingPluginState)) => import("prosemirror-state").SafeStateField<ColumnResizingPluginState>;
|
|
6
|
+
export declare const getPluginState: (state: import("prosemirror-state").EditorState) => ColumnResizingPluginState;
|
|
@@ -3,4 +3,4 @@ import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
|
3
3
|
import { ColumnResizingPluginState } from '../../types';
|
|
4
4
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
6
|
-
export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI): SafePlugin<ColumnResizingPluginState
|
|
6
|
+
export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI): SafePlugin<ColumnResizingPluginState>;
|
|
@@ -7,7 +7,7 @@ import { EditorState } from 'prosemirror-state';
|
|
|
7
7
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
8
8
|
export declare function getLayoutSize(tableLayout: TableLayout, containerWidth: number | undefined, options: TableOptions): number;
|
|
9
9
|
export declare function getDefaultLayoutMaxWidth(containerWidth?: number): number;
|
|
10
|
-
export declare function pointsAtCell($pos: ResolvedPos
|
|
10
|
+
export declare function pointsAtCell($pos: ResolvedPos): false | PMNode | null | undefined;
|
|
11
11
|
export declare function currentColWidth(view: EditorView, cellPos: number, { colspan, colwidth }: CellAttributes): number;
|
|
12
12
|
export declare function domCellAround(target: HTMLElement | null): HTMLElement | null;
|
|
13
13
|
interface getTableMaxWidthProps {
|
|
@@ -17,4 +17,4 @@ export declare const scale: (tableRef: HTMLTableElement, options: ScaleOptions,
|
|
|
17
17
|
export declare const scaleWithParent: (tableRef: HTMLTableElement, parentWidth: number, table: PMNode, start: number, domAtPos: DomAtPos) => ResizeState;
|
|
18
18
|
export declare function scaleTableTo(state: ResizeState, maxSize: number): ResizeState;
|
|
19
19
|
export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos) => void;
|
|
20
|
-
export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos) => (tr: Transaction) => Transaction
|
|
20
|
+
export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos) => (tr: Transaction) => Transaction;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { NodeType, NodeRange
|
|
1
|
+
import { NodeType, NodeRange } from 'prosemirror-model';
|
|
2
2
|
import { Transaction, ReadonlyTransaction } from 'prosemirror-state';
|
|
3
|
-
interface IsTableCollapsibleResult
|
|
3
|
+
interface IsTableCollapsibleResult {
|
|
4
4
|
tableIsCollapsible: boolean;
|
|
5
5
|
range?: NodeRange;
|
|
6
6
|
findWrappingRes?: Array<{
|
|
7
|
-
type: NodeType
|
|
7
|
+
type: NodeType;
|
|
8
8
|
attrs?: {
|
|
9
9
|
[key: string]: any;
|
|
10
10
|
} | null;
|
|
@@ -13,4 +13,4 @@ export declare const getRowDeleteButtonParams: (rowsHeights: Array<number | unde
|
|
|
13
13
|
} | null;
|
|
14
14
|
export declare const getRowsParams: (rowsHeights: Array<number | undefined>) => RowParams[];
|
|
15
15
|
export declare const getRowClassNames: (index: number, selection: Selection, hoveredRows?: number[], isInDanger?: boolean, isResizing?: boolean) => string;
|
|
16
|
-
export declare const copyPreviousRow: (schema: Schema) => (insertNewRowIndex: number) => (tr: Transaction) => Transaction
|
|
16
|
+
export declare const copyPreviousRow: (schema: Schema) => (insertNewRowIndex: number) => (tr: Transaction) => Transaction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { EditorState } from 'prosemirror-state';
|
|
2
2
|
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
3
3
|
import { TableDecorations } from '../types';
|
|
4
|
-
export declare const updatePluginStateDecorations: (state: EditorState
|
|
4
|
+
export declare const updatePluginStateDecorations: (state: EditorState, decorations: Decoration[], key: TableDecorations) => DecorationSet;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"atlaskit:src": "src/index.ts",
|
|
24
24
|
"atlassian": {
|
|
25
|
-
"team": "Editor",
|
|
25
|
+
"team": "Editor: Jenga",
|
|
26
26
|
"singleton": true,
|
|
27
27
|
"releaseModel": "continuous"
|
|
28
28
|
},
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@atlaskit/adf-schema": "^26.0.0",
|
|
31
31
|
"@atlaskit/editor-common": "^74.15.0",
|
|
32
32
|
"@atlaskit/editor-palette": "1.5.1",
|
|
33
|
-
"@atlaskit/editor-plugin-analytics": "^0.0.
|
|
34
|
-
"@atlaskit/editor-plugin-content-insertion": "^0.0.
|
|
33
|
+
"@atlaskit/editor-plugin-analytics": "^0.0.5",
|
|
34
|
+
"@atlaskit/editor-plugin-content-insertion": "^0.0.5",
|
|
35
35
|
"@atlaskit/editor-shared-styles": "^2.4.0",
|
|
36
36
|
"@atlaskit/editor-tables": "^2.3.0",
|
|
37
37
|
"@atlaskit/icon": "^21.12.0",
|
|
@@ -41,8 +41,6 @@
|
|
|
41
41
|
"@atlaskit/tooltip": "^17.8.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0",
|
|
43
43
|
"@emotion/react": "^11.7.1",
|
|
44
|
-
"@types/prosemirror-state": "^1.2.0",
|
|
45
|
-
"@types/prosemirror-view": "^1.9.0",
|
|
46
44
|
"classnames": "^2.2.5",
|
|
47
45
|
"lodash": "^4.17.21",
|
|
48
46
|
"memoize-one": "^6.0.0",
|
|
@@ -64,23 +62,18 @@
|
|
|
64
62
|
"devDependencies": {
|
|
65
63
|
"@af/editor-libra": "*",
|
|
66
64
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
67
|
-
"@atlaskit/button": "^16.8.0",
|
|
68
65
|
"@atlaskit/editor-core": "^185.8.0",
|
|
69
66
|
"@atlaskit/editor-plugin-decorations": "^0.1.0",
|
|
70
67
|
"@atlaskit/editor-plugin-feature-flags": "^0.1.0",
|
|
71
68
|
"@atlaskit/editor-plugin-grid": "^0.1.0",
|
|
72
69
|
"@atlaskit/editor-plugin-width": "^0.1.0",
|
|
73
70
|
"@atlaskit/editor-test-helpers": "^18.8.0",
|
|
74
|
-
"@atlaskit/link-provider": "^1.6.0",
|
|
75
|
-
"@atlaskit/logo": "^13.14.0",
|
|
76
71
|
"@atlaskit/media-integration-test-helpers": "^3.0.0",
|
|
77
|
-
"@atlaskit/synchrony-test-helpers": "^2.3.0",
|
|
78
72
|
"@atlaskit/visual-regression": "*",
|
|
79
73
|
"@atlaskit/webdriver-runner": "*",
|
|
80
74
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
81
75
|
"@atlassian/feature-flags-test-utils": "^0.1.2",
|
|
82
76
|
"@testing-library/react": "^12.1.5",
|
|
83
|
-
"@types/prosemirror-history": "^1.0.1",
|
|
84
77
|
"prosemirror-history": "^1.1.3",
|
|
85
78
|
"raf-stub": "^2.0.1",
|
|
86
79
|
"typescript": "~4.9.5"
|
|
@@ -3,7 +3,6 @@ import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
|
3
3
|
import {
|
|
4
4
|
fullpage,
|
|
5
5
|
tableSelectors,
|
|
6
|
-
toggleBreakout,
|
|
7
6
|
} from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
8
7
|
import {
|
|
9
8
|
goToEditorTestingWDExample,
|
|
@@ -129,96 +128,3 @@ BrowserTestCase(
|
|
|
129
128
|
expect(await page.waitForSelector(tableSelectors.stickyTr)).toBeTruthy();
|
|
130
129
|
},
|
|
131
130
|
);
|
|
132
|
-
|
|
133
|
-
// FIXME: This test was automatically skipped due to failure on 28/05/2023: https://product-fabric.atlassian.net/browse/ED-18110
|
|
134
|
-
BrowserTestCase(
|
|
135
|
-
'Sticky header should correctly toggle on and off, after table is scrolled to the bottom and a column has been added',
|
|
136
|
-
{
|
|
137
|
-
// skip: ['safari']
|
|
138
|
-
skip: ['*'],
|
|
139
|
-
},
|
|
140
|
-
async (client: any, testName: string) => {
|
|
141
|
-
const page = await goToEditorTestingWDExample(
|
|
142
|
-
client,
|
|
143
|
-
'editor-plugin-table',
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
await mountEditor(page, {
|
|
147
|
-
appearance: fullpage.appearance,
|
|
148
|
-
defaultValue: JSON.stringify(stickyTable),
|
|
149
|
-
allowTables: {
|
|
150
|
-
advanced: true,
|
|
151
|
-
stickyHeaders: true,
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
await page.waitForSelector('table');
|
|
156
|
-
|
|
157
|
-
await scrollTo(page, window.innerHeight * 100);
|
|
158
|
-
|
|
159
|
-
await insertColumn(page, 'last');
|
|
160
|
-
|
|
161
|
-
expect(
|
|
162
|
-
await page.waitForSelector(tableSelectors.stickyTable, {}, true),
|
|
163
|
-
).toBeTruthy();
|
|
164
|
-
expect(
|
|
165
|
-
await page.waitForSelector(tableSelectors.stickyTr, {}, true),
|
|
166
|
-
).toBeTruthy();
|
|
167
|
-
|
|
168
|
-
// ED-16817 This checks for a bug where the table row would become not sticky
|
|
169
|
-
// but the numbered column header would stay sticky
|
|
170
|
-
const numberedCol = await page.$(tableSelectors.numberedColumnTopLeftCell);
|
|
171
|
-
const numberedColStyle = await numberedCol.getAttribute('style');
|
|
172
|
-
expect(!numberedColStyle.includes('top')).toBeTruthy();
|
|
173
|
-
},
|
|
174
|
-
);
|
|
175
|
-
|
|
176
|
-
// FIXME: This test was automatically skipped due to failure on 10/06/2023: https://product-fabric.atlassian.net/browse/ED-18761
|
|
177
|
-
BrowserTestCase(
|
|
178
|
-
'Sticky header should resize when the width of parent scroll container changes',
|
|
179
|
-
{
|
|
180
|
-
skip: ['*'],
|
|
181
|
-
},
|
|
182
|
-
async (client: any, testName: string) => {
|
|
183
|
-
const page = await goToEditorTestingWDExample(
|
|
184
|
-
client,
|
|
185
|
-
'editor-plugin-table',
|
|
186
|
-
);
|
|
187
|
-
|
|
188
|
-
await mountEditor(page, {
|
|
189
|
-
appearance: fullpage.appearance,
|
|
190
|
-
defaultValue: JSON.stringify(stickyTable),
|
|
191
|
-
allowTables: {
|
|
192
|
-
advanced: true,
|
|
193
|
-
stickyHeaders: true,
|
|
194
|
-
},
|
|
195
|
-
featureFlags: {
|
|
196
|
-
stickyHeadersOptimization: true,
|
|
197
|
-
},
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
await page.waitForSelector('table');
|
|
201
|
-
|
|
202
|
-
await toggleBreakout(page, 2);
|
|
203
|
-
|
|
204
|
-
await scrollTo(page, window.innerHeight * 100);
|
|
205
|
-
|
|
206
|
-
await page.execute(() => {
|
|
207
|
-
const editorScrollParentSelector = '.fabric-editor-popup-scroll-parent';
|
|
208
|
-
const editor = document.querySelector(
|
|
209
|
-
editorScrollParentSelector,
|
|
210
|
-
) as HTMLElement;
|
|
211
|
-
if (editor) {
|
|
212
|
-
editor.style.flexGrow = '0';
|
|
213
|
-
editor.style.width = '750px';
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
const table = await page.$(tableSelectors.stickyTable);
|
|
218
|
-
const tableWidth = await table.getSize();
|
|
219
|
-
const stickyHeader = await page.$(tableSelectors.stickyTr);
|
|
220
|
-
const stickyHeaderWidth = await stickyHeader.getSize();
|
|
221
|
-
|
|
222
|
-
expect(tableWidth.width).toEqual(stickyHeaderWidth.width);
|
|
223
|
-
},
|
|
224
|
-
);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:ebb86471508f57976e27a1c2d32d7ef690f19699443550444ba6fabbb30b1d7c
|
|
3
|
+
size 20020
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:f24f89698026674f09e57abf0de63a7cba9490251e8238d670653d8ddc6bb077
|
|
3
|
+
size 19266
|
|
@@ -38,11 +38,12 @@ describe('Snapshot Test: Table', () => {
|
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
describe('sticky header', () => {
|
|
41
|
-
|
|
42
|
-
it.skip('should align with table cell when active', async () => {
|
|
41
|
+
it('should align with table cell when active', async () => {
|
|
43
42
|
await initEditor(page, stickyHeaderWithHorizontalScroll);
|
|
44
43
|
|
|
45
44
|
await clickFirstCell(page, true);
|
|
45
|
+
// Mouse was inside the table and would cause the column resizer to trigger occasionally
|
|
46
|
+
await page.mouse.move(0, 0);
|
|
46
47
|
|
|
47
48
|
// scroll to bottom center to see scroll shadows
|
|
48
49
|
await scrollToElement(page, 'ol > li');
|
|
@@ -87,10 +87,13 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
87
87
|
const rendered = DOMSerializer.renderSpec(
|
|
88
88
|
document,
|
|
89
89
|
toDOM(this.node, this.reactComponentProps as Props),
|
|
90
|
-
)
|
|
90
|
+
) as {
|
|
91
|
+
dom: HTMLElement;
|
|
92
|
+
contentDOM?: HTMLElement;
|
|
93
|
+
};
|
|
91
94
|
|
|
92
95
|
if (rendered.dom) {
|
|
93
|
-
this.table = rendered.dom
|
|
96
|
+
this.table = rendered.dom;
|
|
94
97
|
}
|
|
95
98
|
|
|
96
99
|
return rendered;
|
|
@@ -59,7 +59,7 @@ export const createPlugin = () => {
|
|
|
59
59
|
props: {
|
|
60
60
|
decorations: (state) =>
|
|
61
61
|
tableSafariDeleteCompositionTextIssueWorkaroundKey.getState(state)
|
|
62
|
-
|
|
62
|
+
?.decorations,
|
|
63
63
|
handleDOMEvents: {
|
|
64
64
|
beforeinput: (view: EditorView, event: Event): boolean => {
|
|
65
65
|
if ((event as InputEvent)?.inputType !== 'deleteCompositionText') {
|
|
@@ -57,7 +57,7 @@ export function getDefaultLayoutMaxWidth(containerWidth?: number): number {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
// Does the current position point at a cell.
|
|
60
|
-
export function pointsAtCell($pos: ResolvedPos
|
|
60
|
+
export function pointsAtCell($pos: ResolvedPos) {
|
|
61
61
|
return (
|
|
62
62
|
($pos.parent.type.spec as NodeSpec & { tableRole: string }).tableRole ===
|
|
63
63
|
'row' && $pos.nodeAfter
|
|
@@ -45,7 +45,6 @@ import {
|
|
|
45
45
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
46
46
|
import { pluginKey as tableResizingPluginKey } from './pm-plugins/table-resizing';
|
|
47
47
|
import {
|
|
48
|
-
ColumnResizingPluginState,
|
|
49
48
|
ToolbarMenuConfig,
|
|
50
49
|
ToolbarMenuState,
|
|
51
50
|
ToolbarMenuContext,
|
|
@@ -440,8 +439,7 @@ export const getToolbarConfig =
|
|
|
440
439
|
(state, intl) => {
|
|
441
440
|
const tableObject = findTable(state.selection);
|
|
442
441
|
const pluginState = getPluginState(state);
|
|
443
|
-
const resizeState
|
|
444
|
-
tableResizingPluginKey.getState(state);
|
|
442
|
+
const resizeState = tableResizingPluginKey.getState(state);
|
|
445
443
|
if (tableObject && pluginState.editorHasFocus) {
|
|
446
444
|
const nodeType = state.schema.nodes.table;
|
|
447
445
|
const menu = getToolbarMenuConfig(
|
|
@@ -31,7 +31,7 @@ import ContextualMenu from './ContextualMenu';
|
|
|
31
31
|
|
|
32
32
|
// offset of the contextual menu dropdown
|
|
33
33
|
const calculateOffset = (targetCellRef: HTMLElement, state: EditorState) => {
|
|
34
|
-
const { tableRef } = pluginKey.getState(state);
|
|
34
|
+
const { tableRef } = pluginKey.getState(state) || {};
|
|
35
35
|
let top = -contextualMenuTriggerSize;
|
|
36
36
|
|
|
37
37
|
if (tableRef && targetCellRef) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { NodeType, NodeRange
|
|
1
|
+
import { NodeType, NodeRange } from 'prosemirror-model';
|
|
2
2
|
import { Transaction, ReadonlyTransaction } from 'prosemirror-state';
|
|
3
3
|
import { findWrapping } from 'prosemirror-transform';
|
|
4
4
|
|
|
5
5
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
6
6
|
|
|
7
|
-
interface IsTableCollapsibleResult
|
|
7
|
+
interface IsTableCollapsibleResult {
|
|
8
8
|
tableIsCollapsible: boolean;
|
|
9
9
|
range?: NodeRange;
|
|
10
10
|
findWrappingRes?:
|
|
11
|
-
| Array<{ type: NodeType
|
|
11
|
+
| Array<{ type: NodeType; attrs?: { [key: string]: any } | null }>
|
|
12
12
|
| null
|
|
13
13
|
| undefined;
|
|
14
14
|
}
|
|
@@ -60,18 +60,18 @@ export const checkIfNumberColumnEnabled = (selection: Selection): boolean =>
|
|
|
60
60
|
);
|
|
61
61
|
|
|
62
62
|
export const isLayoutSupported = (state: EditorState): boolean => {
|
|
63
|
-
const { permittedLayouts } = pluginKey.getState(state)
|
|
63
|
+
const { permittedLayouts } = pluginKey.getState(state)?.pluginConfig || {};
|
|
64
64
|
const { bodiedExtension, layoutSection, expand } = state.schema.nodes;
|
|
65
65
|
|
|
66
66
|
return (
|
|
67
67
|
!hasParentNodeOfType([expand, layoutSection, bodiedExtension])(
|
|
68
68
|
state.selection,
|
|
69
69
|
) &&
|
|
70
|
-
permittedLayouts &&
|
|
70
|
+
!!permittedLayouts &&
|
|
71
71
|
(permittedLayouts === 'all' ||
|
|
72
72
|
(permittedLayouts.indexOf('default') > -1 &&
|
|
73
73
|
permittedLayouts.indexOf('wide') > -1 &&
|
|
74
|
-
permittedLayouts.indexOf('full-
|
|
74
|
+
permittedLayouts.indexOf('full-width') > -1))
|
|
75
75
|
);
|
|
76
76
|
};
|
|
77
77
|
|
|
@@ -7,7 +7,7 @@ import { TableDecorations } from '../types';
|
|
|
7
7
|
import { updateDecorations } from './decoration';
|
|
8
8
|
|
|
9
9
|
export const updatePluginStateDecorations = (
|
|
10
|
-
state: EditorState
|
|
10
|
+
state: EditorState,
|
|
11
11
|
decorations: Decoration[],
|
|
12
12
|
key: TableDecorations,
|
|
13
13
|
): DecorationSet =>
|