@atlaskit/editor-plugin-table 9.1.2 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/afm-post-office/tsconfig.json +99 -0
- package/dist/cjs/nodeviews/TableComponent.js +5 -5
- package/dist/cjs/nodeviews/TableComponentWithSharedState.js +6 -4
- package/dist/cjs/nodeviews/table.js +1 -2
- package/dist/cjs/tablePlugin.js +1 -0
- package/dist/cjs/ui/DragHandle/index.js +55 -6
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +17 -2
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +1 -2
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +60 -7
- package/dist/cjs/ui/TableFloatingControls/index.js +24 -4
- package/dist/cjs/ui/common-styles.js +1 -2
- package/dist/es2019/nodeviews/TableComponent.js +5 -5
- package/dist/es2019/nodeviews/TableComponentWithSharedState.js +6 -4
- package/dist/es2019/nodeviews/table.js +1 -2
- package/dist/es2019/tablePlugin.js +1 -0
- package/dist/es2019/ui/DragHandle/index.js +57 -6
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +18 -3
- package/dist/es2019/ui/TableFloatingColumnControls/index.js +1 -2
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +62 -7
- package/dist/es2019/ui/TableFloatingControls/index.js +25 -5
- package/dist/es2019/ui/common-styles.js +1 -2
- package/dist/esm/nodeviews/TableComponent.js +5 -5
- package/dist/esm/nodeviews/TableComponentWithSharedState.js +6 -4
- package/dist/esm/nodeviews/table.js +1 -2
- package/dist/esm/tablePlugin.js +1 -0
- package/dist/esm/ui/DragHandle/index.js +54 -5
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +18 -3
- package/dist/esm/ui/TableFloatingColumnControls/index.js +1 -2
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +60 -7
- package/dist/esm/ui/TableFloatingControls/index.js +25 -5
- package/dist/esm/ui/common-styles.js +1 -2
- package/dist/types/nodeviews/TableComponent.d.ts +3 -1
- package/dist/types/tablePluginType.d.ts +21 -18
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/ui/DragHandle/index.d.ts +21 -0
- package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +4 -81
- package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +6 -160
- package/dist/types/ui/TableFloatingControls/RowControls/DragControls.d.ts +8 -5
- package/dist/types/ui/TableFloatingControls/index.d.ts +3 -80
- package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +3 -1
- package/dist/types-ts4.5/tablePluginType.d.ts +21 -18
- package/dist/types-ts4.5/types/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/DragHandle/index.d.ts +21 -0
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +4 -102
- package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +6 -202
- package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/DragControls.d.ts +8 -5
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +3 -101
- package/package.json +8 -5
- package/src/nodeviews/TableComponent.tsx +9 -7
- package/src/nodeviews/TableComponentWithSharedState.tsx +4 -2
- package/src/nodeviews/table.tsx +1 -2
- package/src/tablePlugin.tsx +1 -0
- package/src/tablePluginType.ts +28 -22
- package/src/types/index.ts +1 -0
- package/src/ui/DragHandle/index.tsx +67 -2
- package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +38 -19
- package/src/ui/TableFloatingColumnControls/index.tsx +2 -5
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +86 -25
- package/src/ui/TableFloatingControls/index.tsx +54 -27
- package/src/ui/common-styles.ts +1 -2
|
@@ -20,111 +20,13 @@ interface ColumnControlsProps {
|
|
|
20
20
|
isDragging?: boolean;
|
|
21
21
|
getScrollOffset?: () => number;
|
|
22
22
|
}
|
|
23
|
-
export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, stickyTop, localId, isInDanger, rowHeights, colWidths,
|
|
23
|
+
export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, stickyTop, localId, isInDanger, rowHeights, colWidths, isTableHovered, tableContainerWidth, isNumberColumnEnabled, isDragging, getScrollOffset, api, }: ColumnControlsProps & {
|
|
24
24
|
api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"table", {
|
|
25
25
|
pluginConfiguration: import("../../../tablePluginType").TablePluginOptions | undefined;
|
|
26
|
-
actions:
|
|
27
|
-
insertTable: (analyticsPayload: import("@atlaskit/editor-common/analytics").AnalyticsEventPayload) => import("@atlaskit/editor-common/types").Command;
|
|
28
|
-
};
|
|
26
|
+
actions: import("../../../tablePluginType").TablePluginActions;
|
|
29
27
|
sharedState?: import("../../../types").TableSharedState | undefined;
|
|
30
|
-
commands:
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
dependencies: [
|
|
34
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
35
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
36
|
-
sharedState: {
|
|
37
|
-
createAnalyticsEvent: import("packages/analytics/analytics-next/dist/types").CreateUIAnalyticsEvent | null;
|
|
38
|
-
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
39
|
-
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
40
|
-
};
|
|
41
|
-
dependencies: [
|
|
42
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
43
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
44
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
45
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
46
|
-
];
|
|
47
|
-
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
48
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>,
|
|
49
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"contentInsertion", {
|
|
50
|
-
dependencies: [
|
|
51
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
52
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
53
|
-
sharedState: {
|
|
54
|
-
createAnalyticsEvent: import("packages/analytics/analytics-next/dist/types").CreateUIAnalyticsEvent | null;
|
|
55
|
-
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
56
|
-
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
57
|
-
};
|
|
58
|
-
dependencies: [
|
|
59
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
60
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
61
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
62
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
63
|
-
];
|
|
64
|
-
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
65
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>
|
|
66
|
-
];
|
|
67
|
-
} & import("@atlaskit/editor-plugin-content-insertion").InsertNodeAPI, undefined>,
|
|
68
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
|
|
69
|
-
sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
70
|
-
}, undefined>,
|
|
71
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
|
|
72
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-selection").SelectionPluginOptions | undefined;
|
|
73
|
-
actions: import("@atlaskit/editor-plugin-selection").EditorSelectionAPI;
|
|
74
|
-
commands: {
|
|
75
|
-
displayGapCursor: (toggle: boolean) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
76
|
-
};
|
|
77
|
-
sharedState: import("@atlaskit/editor-common/selection").SelectionSharedState;
|
|
78
|
-
}, import("@atlaskit/editor-plugin-selection").SelectionPluginOptions | undefined>,
|
|
79
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"guideline", {
|
|
80
|
-
dependencies: [
|
|
81
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
|
|
82
|
-
sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
83
|
-
}, undefined>
|
|
84
|
-
];
|
|
85
|
-
sharedState: import("@atlaskit/editor-common/guideline").GuidelinePluginState | null;
|
|
86
|
-
actions: {
|
|
87
|
-
displayGuideline: import("@atlaskit/editor-common/guideline").DisplayGuideline;
|
|
88
|
-
};
|
|
89
|
-
}, undefined>>,
|
|
90
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"batchAttributeUpdates", {
|
|
91
|
-
actions: {
|
|
92
|
-
batchSteps: import("@atlaskit/editor-plugin-batch-attribute-updates").BatchStepsAction;
|
|
93
|
-
};
|
|
94
|
-
}, undefined>>,
|
|
95
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"accessibilityUtils", {
|
|
96
|
-
dependencies: [
|
|
97
|
-
];
|
|
98
|
-
actions: {
|
|
99
|
-
ariaNotify: (message: string, ariaLiveElementAttributes?: import("@atlaskit/editor-plugin-accessibility-utils").AriaLiveElementAttributes | undefined) => void;
|
|
100
|
-
};
|
|
101
|
-
sharedState: import("@atlaskit/editor-plugin-accessibility-utils").AccessibilityUtilsPluginState;
|
|
102
|
-
}, undefined>>,
|
|
103
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"media", {
|
|
104
|
-
pluginConfiguration: any;
|
|
105
|
-
dependencies: any;
|
|
106
|
-
sharedState: any;
|
|
107
|
-
actions: any;
|
|
108
|
-
commands: any;
|
|
109
|
-
}, any>>,
|
|
110
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
|
|
111
|
-
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
112
|
-
dependencies: [
|
|
113
|
-
];
|
|
114
|
-
pluginConfiguration?: {
|
|
115
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
116
|
-
} | undefined;
|
|
117
|
-
commands: {
|
|
118
|
-
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
119
|
-
};
|
|
120
|
-
}, {
|
|
121
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
122
|
-
} | undefined>>,
|
|
123
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
124
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
125
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
126
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
127
|
-
];
|
|
28
|
+
commands: import("../../../tablePluginType").TablePluginCommands;
|
|
29
|
+
dependencies: import("../../../tablePluginType").TablePluginDependencies;
|
|
128
30
|
}> | undefined;
|
|
129
31
|
}) => JSX.Element;
|
|
130
32
|
export {};
|
|
@@ -4,215 +4,19 @@ import type { CornerControlProps } from './types';
|
|
|
4
4
|
export declare const DragCornerControlsWithSelection: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps & {
|
|
5
5
|
api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"table", {
|
|
6
6
|
pluginConfiguration: import("../../../tablePluginType").TablePluginOptions | undefined;
|
|
7
|
-
actions:
|
|
8
|
-
insertTable: (analyticsPayload: import("@atlaskit/editor-common/analytics").AnalyticsEventPayload) => import("@atlaskit/editor-common/types").Command;
|
|
9
|
-
};
|
|
7
|
+
actions: import("../../../tablePluginType").TablePluginActions;
|
|
10
8
|
sharedState?: import("../../../types").TableSharedState | undefined;
|
|
11
|
-
commands:
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
dependencies: [
|
|
15
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
16
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
17
|
-
sharedState: {
|
|
18
|
-
createAnalyticsEvent: import("packages/analytics/analytics-next/dist/types").CreateUIAnalyticsEvent | null;
|
|
19
|
-
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
20
|
-
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
21
|
-
};
|
|
22
|
-
dependencies: [
|
|
23
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
24
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
25
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
26
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
27
|
-
];
|
|
28
|
-
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
29
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>,
|
|
30
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"contentInsertion", {
|
|
31
|
-
dependencies: [
|
|
32
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
33
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
34
|
-
sharedState: {
|
|
35
|
-
createAnalyticsEvent: import("packages/analytics/analytics-next/dist/types").CreateUIAnalyticsEvent | null;
|
|
36
|
-
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
37
|
-
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
38
|
-
};
|
|
39
|
-
dependencies: [
|
|
40
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
41
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
42
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
43
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
44
|
-
];
|
|
45
|
-
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
46
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>
|
|
47
|
-
];
|
|
48
|
-
} & import("@atlaskit/editor-plugin-content-insertion").InsertNodeAPI, undefined>,
|
|
49
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
|
|
50
|
-
sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
51
|
-
}, undefined>,
|
|
52
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
|
|
53
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-selection").SelectionPluginOptions | undefined;
|
|
54
|
-
actions: import("@atlaskit/editor-plugin-selection").EditorSelectionAPI;
|
|
55
|
-
commands: {
|
|
56
|
-
displayGapCursor: (toggle: boolean) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
57
|
-
};
|
|
58
|
-
sharedState: import("@atlaskit/editor-common/selection").SelectionSharedState;
|
|
59
|
-
}, import("@atlaskit/editor-plugin-selection").SelectionPluginOptions | undefined>,
|
|
60
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"guideline", {
|
|
61
|
-
dependencies: [
|
|
62
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
|
|
63
|
-
sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
64
|
-
}, undefined>
|
|
65
|
-
];
|
|
66
|
-
sharedState: import("@atlaskit/editor-common/guideline").GuidelinePluginState | null;
|
|
67
|
-
actions: {
|
|
68
|
-
displayGuideline: import("@atlaskit/editor-common/guideline").DisplayGuideline;
|
|
69
|
-
};
|
|
70
|
-
}, undefined>>,
|
|
71
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"batchAttributeUpdates", {
|
|
72
|
-
actions: {
|
|
73
|
-
batchSteps: import("@atlaskit/editor-plugin-batch-attribute-updates").BatchStepsAction;
|
|
74
|
-
};
|
|
75
|
-
}, undefined>>,
|
|
76
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"accessibilityUtils", {
|
|
77
|
-
dependencies: [
|
|
78
|
-
];
|
|
79
|
-
actions: {
|
|
80
|
-
ariaNotify: (message: string, ariaLiveElementAttributes?: import("@atlaskit/editor-plugin-accessibility-utils").AriaLiveElementAttributes | undefined) => void;
|
|
81
|
-
};
|
|
82
|
-
sharedState: import("@atlaskit/editor-plugin-accessibility-utils").AccessibilityUtilsPluginState;
|
|
83
|
-
}, undefined>>,
|
|
84
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"media", {
|
|
85
|
-
pluginConfiguration: any;
|
|
86
|
-
dependencies: any;
|
|
87
|
-
sharedState: any;
|
|
88
|
-
actions: any;
|
|
89
|
-
commands: any;
|
|
90
|
-
}, any>>,
|
|
91
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
|
|
92
|
-
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
93
|
-
dependencies: [
|
|
94
|
-
];
|
|
95
|
-
pluginConfiguration?: {
|
|
96
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
97
|
-
} | undefined;
|
|
98
|
-
commands: {
|
|
99
|
-
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
100
|
-
};
|
|
101
|
-
}, {
|
|
102
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
103
|
-
} | undefined>>,
|
|
104
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
105
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
106
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
107
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
108
|
-
];
|
|
9
|
+
commands: import("../../../tablePluginType").TablePluginCommands;
|
|
10
|
+
dependencies: import("../../../tablePluginType").TablePluginDependencies;
|
|
109
11
|
}> | undefined;
|
|
110
12
|
}>> & {
|
|
111
13
|
WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps & {
|
|
112
14
|
api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"table", {
|
|
113
15
|
pluginConfiguration: import("../../../tablePluginType").TablePluginOptions | undefined;
|
|
114
|
-
actions:
|
|
115
|
-
insertTable: (analyticsPayload: import("@atlaskit/editor-common/analytics").AnalyticsEventPayload) => import("@atlaskit/editor-common/types").Command;
|
|
116
|
-
};
|
|
16
|
+
actions: import("../../../tablePluginType").TablePluginActions;
|
|
117
17
|
sharedState?: import("../../../types").TableSharedState | undefined;
|
|
118
|
-
commands:
|
|
119
|
-
|
|
120
|
-
};
|
|
121
|
-
dependencies: [
|
|
122
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
123
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
124
|
-
sharedState: {
|
|
125
|
-
createAnalyticsEvent: import("packages/analytics/analytics-next/dist/types").CreateUIAnalyticsEvent | null;
|
|
126
|
-
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
127
|
-
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
128
|
-
};
|
|
129
|
-
dependencies: [
|
|
130
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
131
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
132
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
133
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
134
|
-
];
|
|
135
|
-
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
136
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>,
|
|
137
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"contentInsertion", {
|
|
138
|
-
dependencies: [
|
|
139
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
140
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
141
|
-
sharedState: {
|
|
142
|
-
createAnalyticsEvent: import("packages/analytics/analytics-next/dist/types").CreateUIAnalyticsEvent | null;
|
|
143
|
-
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
144
|
-
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
145
|
-
};
|
|
146
|
-
dependencies: [
|
|
147
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
148
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
149
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
150
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
151
|
-
];
|
|
152
|
-
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
153
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>
|
|
154
|
-
];
|
|
155
|
-
} & import("@atlaskit/editor-plugin-content-insertion").InsertNodeAPI, undefined>,
|
|
156
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
|
|
157
|
-
sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
158
|
-
}, undefined>,
|
|
159
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
|
|
160
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-selection").SelectionPluginOptions | undefined;
|
|
161
|
-
actions: import("@atlaskit/editor-plugin-selection").EditorSelectionAPI;
|
|
162
|
-
commands: {
|
|
163
|
-
displayGapCursor: (toggle: boolean) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
164
|
-
};
|
|
165
|
-
sharedState: import("@atlaskit/editor-common/selection").SelectionSharedState;
|
|
166
|
-
}, import("@atlaskit/editor-plugin-selection").SelectionPluginOptions | undefined>,
|
|
167
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"guideline", {
|
|
168
|
-
dependencies: [
|
|
169
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
|
|
170
|
-
sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
171
|
-
}, undefined>
|
|
172
|
-
];
|
|
173
|
-
sharedState: import("@atlaskit/editor-common/guideline").GuidelinePluginState | null;
|
|
174
|
-
actions: {
|
|
175
|
-
displayGuideline: import("@atlaskit/editor-common/guideline").DisplayGuideline;
|
|
176
|
-
};
|
|
177
|
-
}, undefined>>,
|
|
178
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"batchAttributeUpdates", {
|
|
179
|
-
actions: {
|
|
180
|
-
batchSteps: import("@atlaskit/editor-plugin-batch-attribute-updates").BatchStepsAction;
|
|
181
|
-
};
|
|
182
|
-
}, undefined>>,
|
|
183
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"accessibilityUtils", {
|
|
184
|
-
dependencies: [
|
|
185
|
-
];
|
|
186
|
-
actions: {
|
|
187
|
-
ariaNotify: (message: string, ariaLiveElementAttributes?: import("@atlaskit/editor-plugin-accessibility-utils").AriaLiveElementAttributes | undefined) => void;
|
|
188
|
-
};
|
|
189
|
-
sharedState: import("@atlaskit/editor-plugin-accessibility-utils").AccessibilityUtilsPluginState;
|
|
190
|
-
}, undefined>>,
|
|
191
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"media", {
|
|
192
|
-
pluginConfiguration: any;
|
|
193
|
-
dependencies: any;
|
|
194
|
-
sharedState: any;
|
|
195
|
-
actions: any;
|
|
196
|
-
commands: any;
|
|
197
|
-
}, any>>,
|
|
198
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
|
|
199
|
-
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
200
|
-
dependencies: [
|
|
201
|
-
];
|
|
202
|
-
pluginConfiguration?: {
|
|
203
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
204
|
-
} | undefined;
|
|
205
|
-
commands: {
|
|
206
|
-
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
207
|
-
};
|
|
208
|
-
}, {
|
|
209
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
210
|
-
} | undefined>>,
|
|
211
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
212
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
213
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
214
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
215
|
-
];
|
|
18
|
+
commands: import("../../../tablePluginType").TablePluginCommands;
|
|
19
|
+
dependencies: import("../../../tablePluginType").TablePluginDependencies;
|
|
216
20
|
}> | undefined;
|
|
217
21
|
}>;
|
|
218
22
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import type { TablePlugin } from '../../../tablePluginType';
|
|
5
7
|
import type { CellHoverMeta } from '../../../types';
|
|
6
8
|
type DragControlsProps = {
|
|
7
9
|
editorView: EditorView;
|
|
@@ -17,8 +19,9 @@ type DragControlsProps = {
|
|
|
17
19
|
selectRow: (row: number, expand: boolean) => void;
|
|
18
20
|
selectRows: (rowIndexes: number[]) => void;
|
|
19
21
|
updateCellHoverLocation: (rowIndex: number) => void;
|
|
22
|
+
api?: ExtractInjectionAPI<TablePlugin>;
|
|
23
|
+
selection?: Selection;
|
|
20
24
|
};
|
|
21
|
-
export declare const DragControls:
|
|
22
|
-
|
|
23
|
-
};
|
|
25
|
+
export declare const DragControls: ({ tableRef, tableNode, tableWidth, hoveredCell, tableActive, editorView, isInDanger, isResizing, isTableHovered, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, selection, }: DragControlsProps) => JSX.Element | null;
|
|
26
|
+
export declare const DragControlsWithSelection: ({ editorView, tableRef, tableNode, tableWidth, tableActive, hoveredCell, isInDanger, isTableHovered, isResizing, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, }: Exclude<DragControlsProps, 'selection'>) => JSX.Element;
|
|
24
27
|
export {};
|
|
@@ -33,108 +33,10 @@ interface TableFloatingControlsProps {
|
|
|
33
33
|
export declare const TableFloatingControls: ({ editorView, tableRef, tableNode, isInDanger, isResizing, isNumberColumnEnabled, isHeaderRowEnabled, isHeaderColumnEnabled, tableActive, hasHeaderRow, hoveredRows, stickyHeader, isDragAndDropEnabled, hoveredCell, isTableHovered, tableWrapperWidth, api, isChromelessEditor, }: TableFloatingControlsProps & {
|
|
34
34
|
api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"table", {
|
|
35
35
|
pluginConfiguration: import("../../tablePluginType").TablePluginOptions | undefined;
|
|
36
|
-
actions:
|
|
37
|
-
insertTable: (analyticsPayload: import("@atlaskit/editor-common/analytics").AnalyticsEventPayload) => import("@atlaskit/editor-common/types").Command;
|
|
38
|
-
};
|
|
36
|
+
actions: import("../../tablePluginType").TablePluginActions;
|
|
39
37
|
sharedState?: import("../../types").TableSharedState | undefined;
|
|
40
|
-
commands:
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
-
dependencies: [
|
|
44
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
45
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
46
|
-
sharedState: {
|
|
47
|
-
createAnalyticsEvent: import("packages/analytics/analytics-next/dist/types").CreateUIAnalyticsEvent | null;
|
|
48
|
-
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
49
|
-
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
50
|
-
};
|
|
51
|
-
dependencies: [
|
|
52
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
53
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
54
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
55
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
56
|
-
];
|
|
57
|
-
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
58
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>,
|
|
59
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"contentInsertion", {
|
|
60
|
-
dependencies: [
|
|
61
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
62
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
63
|
-
sharedState: {
|
|
64
|
-
createAnalyticsEvent: import("packages/analytics/analytics-next/dist/types").CreateUIAnalyticsEvent | null;
|
|
65
|
-
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
66
|
-
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
67
|
-
};
|
|
68
|
-
dependencies: [
|
|
69
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
70
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
71
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
72
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
73
|
-
];
|
|
74
|
-
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
75
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>
|
|
76
|
-
];
|
|
77
|
-
} & import("@atlaskit/editor-plugin-content-insertion").InsertNodeAPI, undefined>,
|
|
78
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
|
|
79
|
-
sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
80
|
-
}, undefined>,
|
|
81
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
|
|
82
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-selection").SelectionPluginOptions | undefined;
|
|
83
|
-
actions: import("@atlaskit/editor-plugin-selection").EditorSelectionAPI;
|
|
84
|
-
commands: {
|
|
85
|
-
displayGapCursor: (toggle: boolean) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
86
|
-
};
|
|
87
|
-
sharedState: import("@atlaskit/editor-common/selection").SelectionSharedState;
|
|
88
|
-
}, import("@atlaskit/editor-plugin-selection").SelectionPluginOptions | undefined>,
|
|
89
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"guideline", {
|
|
90
|
-
dependencies: [
|
|
91
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
|
|
92
|
-
sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
93
|
-
}, undefined>
|
|
94
|
-
];
|
|
95
|
-
sharedState: import("@atlaskit/editor-common/guideline").GuidelinePluginState | null;
|
|
96
|
-
actions: {
|
|
97
|
-
displayGuideline: import("@atlaskit/editor-common/guideline").DisplayGuideline;
|
|
98
|
-
};
|
|
99
|
-
}, undefined>>,
|
|
100
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"batchAttributeUpdates", {
|
|
101
|
-
actions: {
|
|
102
|
-
batchSteps: import("@atlaskit/editor-plugin-batch-attribute-updates").BatchStepsAction;
|
|
103
|
-
};
|
|
104
|
-
}, undefined>>,
|
|
105
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"accessibilityUtils", {
|
|
106
|
-
dependencies: [
|
|
107
|
-
];
|
|
108
|
-
actions: {
|
|
109
|
-
ariaNotify: (message: string, ariaLiveElementAttributes?: import("@atlaskit/editor-plugin-accessibility-utils").AriaLiveElementAttributes | undefined) => void;
|
|
110
|
-
};
|
|
111
|
-
sharedState: import("@atlaskit/editor-plugin-accessibility-utils").AccessibilityUtilsPluginState;
|
|
112
|
-
}, undefined>>,
|
|
113
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"media", {
|
|
114
|
-
pluginConfiguration: any;
|
|
115
|
-
dependencies: any;
|
|
116
|
-
sharedState: any;
|
|
117
|
-
actions: any;
|
|
118
|
-
commands: any;
|
|
119
|
-
}, any>>,
|
|
120
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
|
|
121
|
-
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
122
|
-
dependencies: [
|
|
123
|
-
];
|
|
124
|
-
pluginConfiguration?: {
|
|
125
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
126
|
-
} | undefined;
|
|
127
|
-
commands: {
|
|
128
|
-
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
129
|
-
};
|
|
130
|
-
}, {
|
|
131
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
132
|
-
} | undefined>>,
|
|
133
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
134
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
135
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
136
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
137
|
-
];
|
|
38
|
+
commands: import("../../tablePluginType").TablePluginCommands;
|
|
39
|
+
dependencies: import("../../tablePluginType").TablePluginDependencies;
|
|
138
40
|
}> | undefined;
|
|
139
41
|
}) => JSX.Element | null;
|
|
140
42
|
export default TableFloatingControls;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.2.0",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
31
31
|
"@atlaskit/button": "^20.3.0",
|
|
32
32
|
"@atlaskit/custom-steps": "^0.9.0",
|
|
33
|
-
"@atlaskit/editor-common": "^99.
|
|
33
|
+
"@atlaskit/editor-common": "^99.3.0",
|
|
34
34
|
"@atlaskit/editor-palette": "1.6.4",
|
|
35
35
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
44
44
|
"@atlaskit/editor-shared-styles": "^3.2.0",
|
|
45
45
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
46
|
-
"@atlaskit/icon": "^23.
|
|
46
|
+
"@atlaskit/icon": "^23.4.0",
|
|
47
47
|
"@atlaskit/menu": "^2.13.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
49
49
|
"@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
|
|
52
52
|
"@atlaskit/primitives": "^13.3.0",
|
|
53
53
|
"@atlaskit/theme": "^14.0.0",
|
|
54
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
54
|
+
"@atlaskit/tmp-editor-statsig": "^2.36.0",
|
|
55
55
|
"@atlaskit/toggle": "^14.0.0",
|
|
56
|
-
"@atlaskit/tokens": "^3.
|
|
56
|
+
"@atlaskit/tokens": "^3.1.0",
|
|
57
57
|
"@atlaskit/tooltip": "^19.0.0",
|
|
58
58
|
"@babel/runtime": "^7.0.0",
|
|
59
59
|
"@emotion/react": "^11.7.1",
|
|
@@ -134,6 +134,9 @@
|
|
|
134
134
|
},
|
|
135
135
|
"platform_editor_table_overflow_in_full_width_fix": {
|
|
136
136
|
"type": "boolean"
|
|
137
|
+
},
|
|
138
|
+
"platform_editor_table_use_shared_state_hook_fg": {
|
|
139
|
+
"type": "boolean"
|
|
137
140
|
}
|
|
138
141
|
}
|
|
139
142
|
}
|
|
@@ -17,6 +17,7 @@ import { tableMarginSides } from '@atlaskit/editor-common/styles';
|
|
|
17
17
|
import type { EditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
18
18
|
import { browser, isValidPosition } from '@atlaskit/editor-common/utils';
|
|
19
19
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
20
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
20
21
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
21
22
|
import {
|
|
22
23
|
akEditorTableNumberColumnWidth,
|
|
@@ -26,7 +27,6 @@ import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
|
26
27
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
27
28
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
28
29
|
import type { CleanupFn } from '@atlaskit/pragmatic-drag-and-drop/types';
|
|
29
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
30
30
|
import { token } from '@atlaskit/tokens';
|
|
31
31
|
|
|
32
32
|
import { autoSizeTable, clearHoverSelection } from '../pm-plugins/commands';
|
|
@@ -107,7 +107,7 @@ interface ComponentProps {
|
|
|
107
107
|
|
|
108
108
|
contentDOM: (node: HTMLElement | null) => void;
|
|
109
109
|
containerWidth: EditorContainerWidth;
|
|
110
|
-
allowControls
|
|
110
|
+
allowControls?: boolean;
|
|
111
111
|
|
|
112
112
|
allowTableResizing?: boolean;
|
|
113
113
|
allowTableAlignment?: boolean;
|
|
@@ -125,12 +125,13 @@ interface ComponentProps {
|
|
|
125
125
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
126
126
|
intl: IntlShape;
|
|
127
127
|
|
|
128
|
-
// marking props as
|
|
128
|
+
// marking props as optional to ensure backward compatibility when platform_editor_table_use_shared_state_hook_fg disabled
|
|
129
129
|
isInDanger?: boolean;
|
|
130
130
|
hoveredRows?: number[];
|
|
131
131
|
hoveredCell?: CellHoverMeta;
|
|
132
132
|
isTableHovered?: boolean;
|
|
133
133
|
isWholeTableInDanger?: boolean;
|
|
134
|
+
selection?: Selection;
|
|
134
135
|
}
|
|
135
136
|
|
|
136
137
|
interface TableState {
|
|
@@ -598,7 +599,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
598
599
|
|
|
599
600
|
const table = findTable(view.state.selection);
|
|
600
601
|
|
|
601
|
-
if (
|
|
602
|
+
if (!fg('platform_editor_table_use_shared_state_hook_fg')) {
|
|
602
603
|
const pluginState = getPluginState(view.state);
|
|
603
604
|
isInDanger = pluginState.isInDanger;
|
|
604
605
|
}
|
|
@@ -809,6 +810,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
809
810
|
isTableScalingEnabled, // here we can use options.isTableScalingEnabled
|
|
810
811
|
allowTableResizing,
|
|
811
812
|
allowTableAlignment,
|
|
813
|
+
selection,
|
|
812
814
|
} = this.props;
|
|
813
815
|
|
|
814
816
|
let { isInDanger, hoveredRows, hoveredCell, isTableHovered, isWholeTableInDanger } = this.props;
|
|
@@ -816,7 +818,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
816
818
|
const { showBeforeShadow, showAfterShadow } = this.state;
|
|
817
819
|
const node = getNode();
|
|
818
820
|
|
|
819
|
-
if (
|
|
821
|
+
if (!fg('platform_editor_table_use_shared_state_hook_fg')) {
|
|
820
822
|
const pluginState = getPluginState(view.state);
|
|
821
823
|
isInDanger = pluginState.isInDanger;
|
|
822
824
|
hoveredRows = pluginState.hoveredRows;
|
|
@@ -908,7 +910,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
908
910
|
const topShadowPadding = isDragAndDropEnabled ? 0 : shadowPadding;
|
|
909
911
|
const topOffset = fg('platform_editor_breakout_use_css')
|
|
910
912
|
? 0
|
|
911
|
-
: this.state.stickyHeader?.top ?? 0;
|
|
913
|
+
: (this.state.stickyHeader?.top ?? 0);
|
|
912
914
|
|
|
913
915
|
const topStickyShadowPosition =
|
|
914
916
|
this.state.stickyHeader && topOffset + this.state.stickyHeader.padding + topShadowPadding + 2;
|
|
@@ -926,7 +928,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
926
928
|
[ClassName.WITH_CONTROLS]: allowControls && tableActive,
|
|
927
929
|
[ClassName.TABLE_STICKY]: this.state.stickyHeader && hasHeaderRow,
|
|
928
930
|
[ClassName.HOVERED_DELETE_BUTTON]: isInDanger,
|
|
929
|
-
[ClassName.TABLE_SELECTED]: isTableSelected(view.state.selection),
|
|
931
|
+
[ClassName.TABLE_SELECTED]: isTableSelected(selection ?? view.state.selection),
|
|
930
932
|
})}
|
|
931
933
|
editorView={view}
|
|
932
934
|
getPos={getPos}
|