@atlaskit/editor-plugin-table 7.24.0 → 7.24.2
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 +17 -0
- package/dist/cjs/nodeviews/TableComponent.js +76 -44
- package/dist/cjs/nodeviews/TableContainer.js +4 -2
- package/dist/cjs/nodeviews/TableResizer.js +6 -5
- package/dist/cjs/nodeviews/lazy-node-views.js +4 -3
- package/dist/cjs/nodeviews/table.js +3 -2
- package/dist/cjs/plugin.js +5 -3
- package/dist/cjs/pm-plugins/main.js +3 -2
- package/dist/cjs/types.js +2 -0
- package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +6 -5
- package/dist/cjs/ui/FloatingInsertButton/index.js +5 -3
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +4 -3
- package/dist/cjs/ui/TableFloatingControls/index.js +3 -2
- package/dist/cjs/ui/common-styles.js +1 -1
- package/dist/cjs/ui/ui-styles.js +1 -1
- package/dist/es2019/nodeviews/TableComponent.js +33 -4
- package/dist/es2019/nodeviews/TableContainer.js +4 -2
- package/dist/es2019/nodeviews/TableResizer.js +6 -5
- package/dist/es2019/nodeviews/lazy-node-views.js +4 -3
- package/dist/es2019/nodeviews/table.js +3 -2
- package/dist/es2019/plugin.js +5 -3
- package/dist/es2019/pm-plugins/main.js +3 -2
- package/dist/es2019/types.js +2 -0
- package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +8 -6
- package/dist/es2019/ui/FloatingInsertButton/index.js +6 -4
- package/dist/es2019/ui/TableFloatingColumnControls/index.js +5 -4
- package/dist/es2019/ui/TableFloatingControls/index.js +3 -2
- package/dist/es2019/ui/common-styles.js +8 -0
- package/dist/es2019/ui/ui-styles.js +4 -0
- package/dist/esm/nodeviews/TableComponent.js +76 -44
- package/dist/esm/nodeviews/TableContainer.js +4 -2
- package/dist/esm/nodeviews/TableResizer.js +6 -5
- package/dist/esm/nodeviews/lazy-node-views.js +4 -3
- package/dist/esm/nodeviews/table.js +3 -2
- package/dist/esm/plugin.js +5 -3
- package/dist/esm/pm-plugins/main.js +3 -2
- package/dist/esm/types.js +2 -0
- package/dist/esm/ui/FloatingInsertButton/InsertButton.js +6 -5
- package/dist/esm/ui/FloatingInsertButton/index.js +6 -4
- package/dist/esm/ui/TableFloatingColumnControls/index.js +5 -4
- package/dist/esm/ui/TableFloatingControls/index.js +3 -2
- package/dist/esm/ui/common-styles.js +1 -1
- package/dist/esm/ui/ui-styles.js +1 -1
- package/dist/types/nodeviews/TableContainer.d.ts +2 -1
- package/dist/types/nodeviews/lazy-node-views.d.ts +1 -0
- package/dist/types/nodeviews/table.d.ts +1 -1
- package/dist/types/nodeviews/types.d.ts +1 -0
- package/dist/types/plugin.d.ts +1 -0
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/types.d.ts +2 -0
- package/dist/types/ui/FloatingInsertButton/InsertButton.d.ts +2 -1
- package/dist/types/ui/FloatingInsertButton/index.d.ts +1 -0
- package/dist/types/ui/TableFloatingColumnControls/index.d.ts +2 -1
- package/dist/types/ui/TableFloatingControls/index.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/lazy-node-views.d.ts +1 -0
- package/dist/types-ts4.5/nodeviews/table.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/types.d.ts +1 -0
- package/dist/types-ts4.5/plugin.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +2 -0
- package/dist/types-ts4.5/ui/FloatingInsertButton/InsertButton.d.ts +2 -1
- package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +2 -1
- package/package.json +2 -2
- package/src/nodeviews/TableComponent.tsx +31 -0
- package/src/nodeviews/TableContainer.tsx +3 -0
- package/src/nodeviews/TableResizer.tsx +5 -6
- package/src/nodeviews/lazy-node-views.ts +4 -0
- package/src/nodeviews/table.tsx +2 -0
- package/src/nodeviews/types.ts +1 -0
- package/src/plugin.tsx +4 -0
- package/src/pm-plugins/main.ts +2 -0
- package/src/types.ts +2 -0
- package/src/ui/FloatingInsertButton/InsertButton.tsx +12 -4
- package/src/ui/FloatingInsertButton/index.tsx +5 -2
- package/src/ui/TableFloatingColumnControls/index.tsx +8 -3
- package/src/ui/TableFloatingControls/index.tsx +5 -1
- package/src/ui/common-styles.ts +8 -0
- package/src/ui/ui-styles.ts +4 -0
package/dist/esm/ui/ui-styles.js
CHANGED
|
@@ -49,7 +49,7 @@ var InsertButtonHover = function InsertButtonHover() {
|
|
|
49
49
|
return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n\t.", ":hover {\n\t\tbackground: ", ";\n\t\tcolor: ", ";\n\t\tcursor: pointer;\n\t}\n"])), ClassName.CONTROLS_INSERT_BUTTON, "var(--ds-background-brand-bold, ".concat(B300, ")"), "var(--ds-icon-inverse, white)");
|
|
50
50
|
};
|
|
51
51
|
export var dragInsertButtonWrapper = function dragInsertButtonWrapper() {
|
|
52
|
-
return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n\t.", " {\n\t\tposition: absolute;\n\t\tz-index: ", ";\n\t}\n\n\t.", " {\n\t\tbottom: -3px;\n\t\tleft: 2px;\n\t}\n\n\t.", " {\n\t\tleft: -3px;\n\t\tbottom: -2px;\n\t}\n\n\t.", " {\n\t\t", "\n\t}\n\n\t.", ":hover {\n\t\tbackground: ", ";\n\t\tborder: 1px solid ", ";\n\t\tcolor: ", ";\n\t\tcursor: pointer;\n\t}\n"])), ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER, akEditorUnitZIndex + 10, ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_COLUMN, ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW, ClassName.DRAG_CONTROLS_INSERT_BUTTON, Button("\n background: ".concat("var(--ds-surface-overlay, white)", ";\n color: ", "var(--ds-icon, ".concat(N300, ")"), ";\n border: 1px solid ", "var(--ds-background-accent-gray-subtler, #C1C7D0)", ";\n border-radius: 50%;\n height: ", dragTableInsertColumnButtonSize, "px;\n width: ").concat(dragTableInsertColumnButtonSize, "px;\n ")), ClassName.DRAG_CONTROLS_INSERT_BUTTON, "var(--ds-background-brand-bold, ".concat(B300, ")"), "var(--ds-background-brand-bold, ".concat(B300, ")"), "var(--ds-icon-inverse, white)");
|
|
52
|
+
return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n\t.", " {\n\t\tposition: absolute;\n\t\tz-index: ", ";\n\t}\n\n\t.", " {\n\t\tbottom: -3px;\n\t\tleft: 2px;\n\t}\n\n\t.", " {\n\t\tleft: -3px;\n\t\tbottom: -2px;\n\t}\n\t.", " {\n\t\tleft: 6px;\n\t\tbottom: -2px;\n\t}\n\n\t.", " {\n\t\t", "\n\t}\n\n\t.", ":hover {\n\t\tbackground: ", ";\n\t\tborder: 1px solid ", ";\n\t\tcolor: ", ";\n\t\tcursor: pointer;\n\t}\n"])), ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER, akEditorUnitZIndex + 10, ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_COLUMN, ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW, ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW_CHROMELESS, ClassName.DRAG_CONTROLS_INSERT_BUTTON, Button("\n background: ".concat("var(--ds-surface-overlay, white)", ";\n color: ", "var(--ds-icon, ".concat(N300, ")"), ";\n border: 1px solid ", "var(--ds-background-accent-gray-subtler, #C1C7D0)", ";\n border-radius: 50%;\n height: ", dragTableInsertColumnButtonSize, "px;\n width: ").concat(dragTableInsertColumnButtonSize, "px;\n ")), ClassName.DRAG_CONTROLS_INSERT_BUTTON, "var(--ds-background-brand-bold, ".concat(B300, ")"), "var(--ds-background-brand-bold, ".concat(B300, ")"), "var(--ds-icon-inverse, white)");
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
// Explicit pixel values required here to ensure corner button aligns correctly
|
|
@@ -52,6 +52,7 @@ type TableContainerProps = {
|
|
|
52
52
|
isTableAlignmentEnabled?: boolean;
|
|
53
53
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
54
54
|
isCommentEditor?: boolean;
|
|
55
|
+
isChromelessEditor?: boolean;
|
|
55
56
|
};
|
|
56
|
-
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
57
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
57
58
|
export {};
|
|
@@ -16,6 +16,7 @@ type TableViewOptions = {
|
|
|
16
16
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
17
17
|
isTableAlignmentEnabled?: boolean;
|
|
18
18
|
isCommentEditor?: boolean;
|
|
19
|
+
isChromelessEditor?: boolean;
|
|
19
20
|
};
|
|
20
21
|
export declare const lazyTableView: (options: TableViewOptions) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
|
|
21
22
|
type TableCellViewOptions = {
|
|
@@ -32,5 +32,5 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
32
32
|
}): boolean;
|
|
33
33
|
destroy(): void;
|
|
34
34
|
}
|
|
35
|
-
export declare const createTableView: (node: PmNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, dispatchAnalyticsEvent: DispatchAnalyticsEvent, pluginInjectionApi?: PluginInjectionAPI, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean) => NodeView;
|
|
35
|
+
export declare const createTableView: (node: PmNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, dispatchAnalyticsEvent: DispatchAnalyticsEvent, pluginInjectionApi?: PluginInjectionAPI, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean) => NodeView;
|
|
36
36
|
export {};
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export interface TablePluginOptions {
|
|
|
22
22
|
isTableAlignmentEnabled?: boolean;
|
|
23
23
|
isNewColumnResizingEnabled?: boolean;
|
|
24
24
|
isCommentEditor?: boolean;
|
|
25
|
+
isChromelessEditor?: boolean;
|
|
25
26
|
}
|
|
26
27
|
type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
|
|
27
28
|
type MediaPlugin = NextEditorPlugin<'media', {
|
|
@@ -5,4 +5,4 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
5
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
6
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { PluginConfig, PluginInjectionAPI } from '../types';
|
|
8
|
-
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
8
|
+
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -318,6 +318,7 @@ export declare const TableCssClassName: {
|
|
|
318
318
|
DRAG_CONTROLS_INSERT_BUTTON_INNER: string;
|
|
319
319
|
DRAG_CONTROLS_INSERT_BUTTON_INNER_COLUMN: string;
|
|
320
320
|
DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW: string;
|
|
321
|
+
DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW_CHROMELESS: string;
|
|
321
322
|
DRAG_CONTROLS_INSERT_BUTTON_WRAP: string;
|
|
322
323
|
CONTROLS_INSERT_MARKER: string;
|
|
323
324
|
CONTROLS_INSERT_COLUMN: string;
|
|
@@ -333,6 +334,7 @@ export declare const TableCssClassName: {
|
|
|
333
334
|
/** drag and drop controls */
|
|
334
335
|
DRAG_ROW_CONTROLS_WRAPPER: string;
|
|
335
336
|
DRAG_ROW_CONTROLS: string;
|
|
337
|
+
DRAG_CONTROLS_CHROMELESS: string;
|
|
336
338
|
DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER: string;
|
|
337
339
|
DRAG_ROW_FLOATING_INSERT_DOT: string;
|
|
338
340
|
DRAG_COLUMN_CONTROLS: string;
|
|
@@ -7,8 +7,9 @@ export interface ButtonProps {
|
|
|
7
7
|
tableRef: HTMLElement;
|
|
8
8
|
onMouseDown: (event: SyntheticEvent<HTMLButtonElement>) => void;
|
|
9
9
|
hasStickyHeaders: boolean;
|
|
10
|
+
isChromelessEditor?: boolean;
|
|
10
11
|
}
|
|
11
|
-
export declare const InsertButtonForDragAndDrop: ({ onMouseDown, tableRef, type, intl: { formatMessage }, hasStickyHeaders, }: ButtonProps & WrappedComponentProps) => JSX.Element;
|
|
12
|
+
export declare const InsertButtonForDragAndDrop: ({ onMouseDown, tableRef, type, intl: { formatMessage }, hasStickyHeaders, isChromelessEditor, }: ButtonProps & WrappedComponentProps) => JSX.Element;
|
|
12
13
|
export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
|
|
13
14
|
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
|
|
14
15
|
};
|
|
@@ -22,6 +22,7 @@ export interface Props {
|
|
|
22
22
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
23
23
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
24
24
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
25
|
+
isChromelessEditor?: boolean;
|
|
25
26
|
}
|
|
26
27
|
export declare class FloatingInsertButton extends React.Component<Props & WrappedComponentProps, any> {
|
|
27
28
|
static displayName: string;
|
|
@@ -27,6 +27,7 @@ export interface Props {
|
|
|
27
27
|
getScrollOffset?: () => number;
|
|
28
28
|
tableWrapperHeight?: number;
|
|
29
29
|
api?: PluginInjectionAPI;
|
|
30
|
+
isChromelessEditor?: boolean;
|
|
30
31
|
}
|
|
31
|
-
export declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, api, }: Props) => JSX.Element | null;
|
|
32
|
+
export declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, api, isChromelessEditor, }: Props) => JSX.Element | null;
|
|
32
33
|
export default TableFloatingColumnControls;
|
|
@@ -28,8 +28,9 @@ export interface TableFloatingControlsProps {
|
|
|
28
28
|
stickyHeader?: RowStickyState;
|
|
29
29
|
insertRowButtonIndex?: number;
|
|
30
30
|
tableWrapperWidth?: number;
|
|
31
|
+
isChromelessEditor?: boolean;
|
|
31
32
|
}
|
|
32
|
-
export declare const TableFloatingControls: ({ editorView, tableRef, tableNode, isInDanger, isResizing, isNumberColumnEnabled, isHeaderRowEnabled, isHeaderColumnEnabled, tableActive, hasHeaderRow, hoveredRows, stickyHeader, isDragAndDropEnabled, hoveredCell, isTableHovered, tableWrapperWidth, api, }: TableFloatingControlsProps & {
|
|
33
|
+
export declare const TableFloatingControls: ({ editorView, tableRef, tableNode, isInDanger, isResizing, isNumberColumnEnabled, isHeaderRowEnabled, isHeaderColumnEnabled, tableActive, hasHeaderRow, hoveredRows, stickyHeader, isDragAndDropEnabled, hoveredCell, isTableHovered, tableWrapperWidth, api, isChromelessEditor, }: TableFloatingControlsProps & {
|
|
33
34
|
api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"table", {
|
|
34
35
|
pluginConfiguration: import("../../plugin").TablePluginOptions | undefined;
|
|
35
36
|
actions: {
|
|
@@ -52,6 +52,7 @@ type TableContainerProps = {
|
|
|
52
52
|
isTableAlignmentEnabled?: boolean;
|
|
53
53
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
54
54
|
isCommentEditor?: boolean;
|
|
55
|
+
isChromelessEditor?: boolean;
|
|
55
56
|
};
|
|
56
|
-
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
57
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
57
58
|
export {};
|
|
@@ -16,6 +16,7 @@ type TableViewOptions = {
|
|
|
16
16
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
17
17
|
isTableAlignmentEnabled?: boolean;
|
|
18
18
|
isCommentEditor?: boolean;
|
|
19
|
+
isChromelessEditor?: boolean;
|
|
19
20
|
};
|
|
20
21
|
export declare const lazyTableView: (options: TableViewOptions) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
|
|
21
22
|
type TableCellViewOptions = {
|
|
@@ -32,5 +32,5 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
32
32
|
}): boolean;
|
|
33
33
|
destroy(): void;
|
|
34
34
|
}
|
|
35
|
-
export declare const createTableView: (node: PmNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, dispatchAnalyticsEvent: DispatchAnalyticsEvent, pluginInjectionApi?: PluginInjectionAPI, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean) => NodeView;
|
|
35
|
+
export declare const createTableView: (node: PmNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, dispatchAnalyticsEvent: DispatchAnalyticsEvent, pluginInjectionApi?: PluginInjectionAPI, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean) => NodeView;
|
|
36
36
|
export {};
|
|
@@ -22,6 +22,7 @@ export interface TablePluginOptions {
|
|
|
22
22
|
isTableAlignmentEnabled?: boolean;
|
|
23
23
|
isNewColumnResizingEnabled?: boolean;
|
|
24
24
|
isCommentEditor?: boolean;
|
|
25
|
+
isChromelessEditor?: boolean;
|
|
25
26
|
}
|
|
26
27
|
type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
|
|
27
28
|
type MediaPlugin = NextEditorPlugin<'media', {
|
|
@@ -5,4 +5,4 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
5
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
6
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { PluginConfig, PluginInjectionAPI } from '../types';
|
|
8
|
-
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
8
|
+
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
@@ -318,6 +318,7 @@ export declare const TableCssClassName: {
|
|
|
318
318
|
DRAG_CONTROLS_INSERT_BUTTON_INNER: string;
|
|
319
319
|
DRAG_CONTROLS_INSERT_BUTTON_INNER_COLUMN: string;
|
|
320
320
|
DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW: string;
|
|
321
|
+
DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW_CHROMELESS: string;
|
|
321
322
|
DRAG_CONTROLS_INSERT_BUTTON_WRAP: string;
|
|
322
323
|
CONTROLS_INSERT_MARKER: string;
|
|
323
324
|
CONTROLS_INSERT_COLUMN: string;
|
|
@@ -333,6 +334,7 @@ export declare const TableCssClassName: {
|
|
|
333
334
|
/** drag and drop controls */
|
|
334
335
|
DRAG_ROW_CONTROLS_WRAPPER: string;
|
|
335
336
|
DRAG_ROW_CONTROLS: string;
|
|
337
|
+
DRAG_CONTROLS_CHROMELESS: string;
|
|
336
338
|
DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER: string;
|
|
337
339
|
DRAG_ROW_FLOATING_INSERT_DOT: string;
|
|
338
340
|
DRAG_COLUMN_CONTROLS: string;
|
|
@@ -7,8 +7,9 @@ export interface ButtonProps {
|
|
|
7
7
|
tableRef: HTMLElement;
|
|
8
8
|
onMouseDown: (event: SyntheticEvent<HTMLButtonElement>) => void;
|
|
9
9
|
hasStickyHeaders: boolean;
|
|
10
|
+
isChromelessEditor?: boolean;
|
|
10
11
|
}
|
|
11
|
-
export declare const InsertButtonForDragAndDrop: ({ onMouseDown, tableRef, type, intl: { formatMessage }, hasStickyHeaders, }: ButtonProps & WrappedComponentProps) => JSX.Element;
|
|
12
|
+
export declare const InsertButtonForDragAndDrop: ({ onMouseDown, tableRef, type, intl: { formatMessage }, hasStickyHeaders, isChromelessEditor, }: ButtonProps & WrappedComponentProps) => JSX.Element;
|
|
12
13
|
export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
|
|
13
14
|
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
|
|
14
15
|
};
|
|
@@ -22,6 +22,7 @@ export interface Props {
|
|
|
22
22
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
23
23
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
24
24
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
25
|
+
isChromelessEditor?: boolean;
|
|
25
26
|
}
|
|
26
27
|
export declare class FloatingInsertButton extends React.Component<Props & WrappedComponentProps, any> {
|
|
27
28
|
static displayName: string;
|
|
@@ -27,6 +27,7 @@ export interface Props {
|
|
|
27
27
|
getScrollOffset?: () => number;
|
|
28
28
|
tableWrapperHeight?: number;
|
|
29
29
|
api?: PluginInjectionAPI;
|
|
30
|
+
isChromelessEditor?: boolean;
|
|
30
31
|
}
|
|
31
|
-
export declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, api, }: Props) => JSX.Element | null;
|
|
32
|
+
export declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, api, isChromelessEditor, }: Props) => JSX.Element | null;
|
|
32
33
|
export default TableFloatingColumnControls;
|
|
@@ -28,8 +28,9 @@ export interface TableFloatingControlsProps {
|
|
|
28
28
|
stickyHeader?: RowStickyState;
|
|
29
29
|
insertRowButtonIndex?: number;
|
|
30
30
|
tableWrapperWidth?: number;
|
|
31
|
+
isChromelessEditor?: boolean;
|
|
31
32
|
}
|
|
32
|
-
export declare const TableFloatingControls: ({ editorView, tableRef, tableNode, isInDanger, isResizing, isNumberColumnEnabled, isHeaderRowEnabled, isHeaderColumnEnabled, tableActive, hasHeaderRow, hoveredRows, stickyHeader, isDragAndDropEnabled, hoveredCell, isTableHovered, tableWrapperWidth, api, }: TableFloatingControlsProps & {
|
|
33
|
+
export declare const TableFloatingControls: ({ editorView, tableRef, tableNode, isInDanger, isResizing, isNumberColumnEnabled, isHeaderRowEnabled, isHeaderColumnEnabled, tableActive, hasHeaderRow, hoveredRows, stickyHeader, isDragAndDropEnabled, hoveredCell, isTableHovered, tableWrapperWidth, api, isChromelessEditor, }: TableFloatingControlsProps & {
|
|
33
34
|
api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"table", {
|
|
34
35
|
pluginConfiguration: import("../../plugin").TablePluginOptions | undefined;
|
|
35
36
|
actions: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.24.
|
|
3
|
+
"version": "7.24.2",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@atlaskit/editor-prosemirror": "5.0.1",
|
|
44
44
|
"@atlaskit/editor-shared-styles": "^2.13.0",
|
|
45
45
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
46
|
-
"@atlaskit/icon": "^22.
|
|
46
|
+
"@atlaskit/icon": "^22.8.0",
|
|
47
47
|
"@atlaskit/menu": "^2.8.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
49
49
|
"@atlaskit/pragmatic-drag-and-drop": "^1.2.0",
|
|
@@ -343,6 +343,28 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
343
343
|
this.props.view.dispatch(tr);
|
|
344
344
|
};
|
|
345
345
|
|
|
346
|
+
// Should be called only when table node width is reset to undefined in Comment Editor
|
|
347
|
+
// Maybe replaced by handleColgroupUpdates as we implement new table's support in Comment Editor.
|
|
348
|
+
removeInlineTableWidth() {
|
|
349
|
+
const { isResizing, getNode, view, getPos } = this.props;
|
|
350
|
+
if (!this.table) {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const tableNode = getNode();
|
|
355
|
+
const newTableWidth = tableNode.attrs.width;
|
|
356
|
+
|
|
357
|
+
const start = getPos() || 0;
|
|
358
|
+
const depth = view.state.doc.resolve(start).depth;
|
|
359
|
+
if (depth !== 0) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if (!isResizing && newTableWidth === null) {
|
|
364
|
+
this.table.style.width = '';
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
346
368
|
handleColgroupUpdates(force = false) {
|
|
347
369
|
const { getNode, containerWidth, isResizing, view, getPos, getEditorFeatureFlags } = this.props;
|
|
348
370
|
|
|
@@ -498,6 +520,10 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
498
520
|
clearHoverSelection()(view.state, view.dispatch);
|
|
499
521
|
}
|
|
500
522
|
|
|
523
|
+
if (this.props.options?.isCommentEditor && options?.isTableResizingEnabled) {
|
|
524
|
+
this.removeInlineTableWidth();
|
|
525
|
+
}
|
|
526
|
+
|
|
501
527
|
if (this.wrapper?.parentElement && this.table && !this.overflowShadowsObserver) {
|
|
502
528
|
if (this.props.isDragAndDropEnabled) {
|
|
503
529
|
// requestAnimationFrame is used here to fix a race condition issue
|
|
@@ -533,6 +559,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
533
559
|
{ priority: 'important' },
|
|
534
560
|
);
|
|
535
561
|
}
|
|
562
|
+
|
|
536
563
|
if (currentTable.attrs.__autoSize) {
|
|
537
564
|
// Wait for next tick to handle auto sizing, gives the browser time to do layout calc etc.
|
|
538
565
|
this.handleAutoSizeDebounced();
|
|
@@ -566,6 +593,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
566
593
|
|
|
567
594
|
this.handleTableResizingDebounced();
|
|
568
595
|
}
|
|
596
|
+
|
|
569
597
|
if (isOverflowAnalyticsEnabled) {
|
|
570
598
|
const newIsOverflowing =
|
|
571
599
|
this.state[ShadowEvent.SHOW_BEFORE_SHADOW] || this.state[ShadowEvent.SHOW_AFTER_SHADOW];
|
|
@@ -703,6 +731,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
703
731
|
stickyHeader={this.state.stickyHeader}
|
|
704
732
|
tableWrapperWidth={this.state.tableWrapperWidth}
|
|
705
733
|
api={pluginInjectionApi}
|
|
734
|
+
isChromelessEditor={options?.isChromelessEditor}
|
|
706
735
|
/>
|
|
707
736
|
);
|
|
708
737
|
const tableContainerWidth = getTableContainerWidth(node);
|
|
@@ -729,6 +758,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
729
758
|
getScrollOffset={() => this.wrapper?.scrollLeft || 0}
|
|
730
759
|
tableWrapperHeight={this.state.tableWrapperHeight}
|
|
731
760
|
api={pluginInjectionApi}
|
|
761
|
+
isChromelessEditor={options?.isChromelessEditor}
|
|
732
762
|
/>
|
|
733
763
|
) : null;
|
|
734
764
|
|
|
@@ -789,6 +819,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
789
819
|
isTableAlignmentEnabled={isTableAlignmentEnabled}
|
|
790
820
|
shouldUseIncreasedScalingPercent={shouldUseIncreasedScalingPercent}
|
|
791
821
|
isCommentEditor={options?.isCommentEditor}
|
|
822
|
+
isChromelessEditor={options?.isChromelessEditor}
|
|
792
823
|
>
|
|
793
824
|
<div
|
|
794
825
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -405,6 +405,7 @@ type TableContainerProps = {
|
|
|
405
405
|
isTableAlignmentEnabled?: boolean;
|
|
406
406
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
407
407
|
isCommentEditor?: boolean;
|
|
408
|
+
isChromelessEditor?: boolean;
|
|
408
409
|
};
|
|
409
410
|
|
|
410
411
|
export const TableContainer = ({
|
|
@@ -426,6 +427,7 @@ export const TableContainer = ({
|
|
|
426
427
|
isTableAlignmentEnabled,
|
|
427
428
|
shouldUseIncreasedScalingPercent,
|
|
428
429
|
isCommentEditor,
|
|
430
|
+
isChromelessEditor,
|
|
429
431
|
}: PropsWithChildren<TableContainerProps>) => {
|
|
430
432
|
if (isTableResizingEnabled && !isNested) {
|
|
431
433
|
return (
|
|
@@ -463,6 +465,7 @@ export const TableContainer = ({
|
|
|
463
465
|
style={{
|
|
464
466
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
465
467
|
width: 'inherit',
|
|
468
|
+
marginLeft: isChromelessEditor ? 18 : undefined,
|
|
466
469
|
}}
|
|
467
470
|
>
|
|
468
471
|
{children}
|
|
@@ -533,13 +533,13 @@ export const TableResizer = ({
|
|
|
533
533
|
const handleResizeStop = useCallback<HandleResize>(
|
|
534
534
|
(originalState, delta) => {
|
|
535
535
|
isResizing.current = false;
|
|
536
|
-
let newWidth = originalState.width + delta.width;
|
|
536
|
+
let newWidth: number | undefined = originalState.width + delta.width;
|
|
537
537
|
const { state, dispatch } = editorView;
|
|
538
538
|
const pos = getPos();
|
|
539
539
|
const currentTableNodeLocalId = node?.attrs?.localId ?? '';
|
|
540
540
|
|
|
541
541
|
const tableMaxWidth = isCommentEditor
|
|
542
|
-
?
|
|
542
|
+
? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
|
|
543
543
|
: TABLE_MAX_WIDTH;
|
|
544
544
|
|
|
545
545
|
newWidth =
|
|
@@ -598,13 +598,13 @@ export const TableResizer = ({
|
|
|
598
598
|
displayGapCursor(true);
|
|
599
599
|
dispatch(tr);
|
|
600
600
|
|
|
601
|
-
if (delta.width < 0) {
|
|
601
|
+
if (delta.width < 0 && newWidth !== undefined) {
|
|
602
602
|
pluginInjectionApi?.accessibilityUtils?.actions.ariaNotify(
|
|
603
603
|
formatMessage(messages.tableSizeDecreaseScreenReaderInformation, {
|
|
604
604
|
newWidth: newWidth,
|
|
605
605
|
}),
|
|
606
606
|
);
|
|
607
|
-
} else if (delta.width > 0) {
|
|
607
|
+
} else if (delta.width > 0 && newWidth !== undefined) {
|
|
608
608
|
pluginInjectionApi?.accessibilityUtils?.actions.ariaNotify(
|
|
609
609
|
formatMessage(messages.tableSizeIncreaseScreenReaderInformation, {
|
|
610
610
|
newWidth: newWidth,
|
|
@@ -614,7 +614,7 @@ export const TableResizer = ({
|
|
|
614
614
|
|
|
615
615
|
// Hide guidelines when resizing stops
|
|
616
616
|
displayGuideline([]);
|
|
617
|
-
updateWidth(newWidth);
|
|
617
|
+
newWidth !== undefined && updateWidth(newWidth);
|
|
618
618
|
scheduleResize.cancel();
|
|
619
619
|
|
|
620
620
|
if (onResizeStop) {
|
|
@@ -632,7 +632,6 @@ export const TableResizer = ({
|
|
|
632
632
|
tableRef,
|
|
633
633
|
scheduleResize,
|
|
634
634
|
displayGuideline,
|
|
635
|
-
containerWidth,
|
|
636
635
|
attachAnalyticsEvent,
|
|
637
636
|
endMeasure,
|
|
638
637
|
onResizeStop,
|
|
@@ -23,6 +23,7 @@ type TableViewOptions = {
|
|
|
23
23
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
24
24
|
isTableAlignmentEnabled?: boolean;
|
|
25
25
|
isCommentEditor?: boolean;
|
|
26
|
+
isChromelessEditor?: boolean;
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
export const lazyTableView = (options: TableViewOptions) => {
|
|
@@ -40,6 +41,7 @@ export const lazyTableView = (options: TableViewOptions) => {
|
|
|
40
41
|
options.pluginInjectionApi,
|
|
41
42
|
options.isTableAlignmentEnabled,
|
|
42
43
|
options.isCommentEditor,
|
|
44
|
+
options.isChromelessEditor,
|
|
43
45
|
);
|
|
44
46
|
};
|
|
45
47
|
}
|
|
@@ -65,6 +67,7 @@ export const lazyTableView = (options: TableViewOptions) => {
|
|
|
65
67
|
pluginInjectionApi,
|
|
66
68
|
isTableAlignmentEnabled,
|
|
67
69
|
isCommentEditor,
|
|
70
|
+
isChromelessEditor,
|
|
68
71
|
} = getNodeViewOptions();
|
|
69
72
|
|
|
70
73
|
return createTableView(
|
|
@@ -79,6 +82,7 @@ export const lazyTableView = (options: TableViewOptions) => {
|
|
|
79
82
|
pluginInjectionApi,
|
|
80
83
|
isTableAlignmentEnabled,
|
|
81
84
|
isCommentEditor,
|
|
85
|
+
isChromelessEditor,
|
|
82
86
|
);
|
|
83
87
|
};
|
|
84
88
|
});
|
package/src/nodeviews/table.tsx
CHANGED
|
@@ -365,6 +365,7 @@ export const createTableView = (
|
|
|
365
365
|
pluginInjectionApi?: PluginInjectionAPI,
|
|
366
366
|
isTableAlignmentEnabled?: boolean,
|
|
367
367
|
isCommentEditor?: boolean,
|
|
368
|
+
isChromelessEditor?: boolean,
|
|
368
369
|
): NodeView => {
|
|
369
370
|
const {
|
|
370
371
|
pluginConfig,
|
|
@@ -392,6 +393,7 @@ export const createTableView = (
|
|
|
392
393
|
isTableScalingEnabled, // same as options.isTableScalingEnabled
|
|
393
394
|
isTableAlignmentEnabled,
|
|
394
395
|
isCommentEditor,
|
|
396
|
+
isChromelessEditor,
|
|
395
397
|
},
|
|
396
398
|
getEditorContainerWidth,
|
|
397
399
|
getEditorFeatureFlags,
|
package/src/nodeviews/types.ts
CHANGED
package/src/plugin.tsx
CHANGED
|
@@ -98,6 +98,7 @@ export interface TablePluginOptions {
|
|
|
98
98
|
isTableAlignmentEnabled?: boolean;
|
|
99
99
|
isNewColumnResizingEnabled?: boolean;
|
|
100
100
|
isCommentEditor?: boolean;
|
|
101
|
+
isChromelessEditor?: boolean;
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
|
|
@@ -329,6 +330,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
329
330
|
isTableScalingEnabled,
|
|
330
331
|
isTableAlignmentEnabled,
|
|
331
332
|
isCommentEditor,
|
|
333
|
+
isChromelessEditor,
|
|
332
334
|
} = options || ({} as TablePluginOptions);
|
|
333
335
|
|
|
334
336
|
return createPlugin(
|
|
@@ -350,6 +352,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
350
352
|
isTableAlignmentEnabled,
|
|
351
353
|
shouldUseIncreasedScalingPercent,
|
|
352
354
|
isCommentEditor,
|
|
355
|
+
isChromelessEditor,
|
|
353
356
|
);
|
|
354
357
|
},
|
|
355
358
|
},
|
|
@@ -632,6 +635,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
632
635
|
getEditorFeatureFlags={
|
|
633
636
|
options?.getEditorFeatureFlags || defaultGetEditorFeatureFlags
|
|
634
637
|
}
|
|
638
|
+
isChromelessEditor={options?.isChromelessEditor}
|
|
635
639
|
/>
|
|
636
640
|
)}
|
|
637
641
|
{options?.allowContextualMenu && (
|
package/src/pm-plugins/main.ts
CHANGED
|
@@ -97,6 +97,7 @@ export const createPlugin = (
|
|
|
97
97
|
isTableAlignmentEnabled?: boolean,
|
|
98
98
|
shouldUseIncreasedScalingPercent?: boolean,
|
|
99
99
|
isCommentEditor?: boolean,
|
|
100
|
+
isChromelessEditor?: boolean,
|
|
100
101
|
) => {
|
|
101
102
|
const state = createPluginState(dispatch, {
|
|
102
103
|
pluginConfig,
|
|
@@ -360,6 +361,7 @@ export const createPlugin = (
|
|
|
360
361
|
pluginInjectionApi,
|
|
361
362
|
isTableAlignmentEnabled,
|
|
362
363
|
isCommentEditor,
|
|
364
|
+
isChromelessEditor,
|
|
363
365
|
}),
|
|
364
366
|
tableRow: lazyTableRowView({ eventDispatcher }),
|
|
365
367
|
tableCell: lazyTableCellView({ eventDispatcher }),
|
package/src/types.ts
CHANGED
|
@@ -369,6 +369,7 @@ export const TableCssClassName = {
|
|
|
369
369
|
DRAG_CONTROLS_INSERT_BUTTON_INNER: `${tablePrefixSelector}-controls__drag-insert-button-inner`,
|
|
370
370
|
DRAG_CONTROLS_INSERT_BUTTON_INNER_COLUMN: `${tablePrefixSelector}-controls__drag-insert-button-inner-column`,
|
|
371
371
|
DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW: `${tablePrefixSelector}-controls__drag-insert-button-inner-row`,
|
|
372
|
+
DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW_CHROMELESS: `${tablePrefixSelector}-controls__drag-insert-button-inner-row-chromeless`,
|
|
372
373
|
DRAG_CONTROLS_INSERT_BUTTON_WRAP: `${tablePrefixSelector}-controls__drag-insert-button-wrap`,
|
|
373
374
|
|
|
374
375
|
CONTROLS_INSERT_MARKER: `${tablePrefixSelector}-controls__insert-marker`,
|
|
@@ -388,6 +389,7 @@ export const TableCssClassName = {
|
|
|
388
389
|
/** drag and drop controls */
|
|
389
390
|
DRAG_ROW_CONTROLS_WRAPPER: `${tablePrefixSelector}-drag-row-controls-wrapper`,
|
|
390
391
|
DRAG_ROW_CONTROLS: `${tablePrefixSelector}-drag-row-controls`,
|
|
392
|
+
DRAG_CONTROLS_CHROMELESS: `drag-controls-chromeless`,
|
|
391
393
|
DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER: `${tablePrefixSelector}-drag-row-floating-insert-dot-wrapper`,
|
|
392
394
|
DRAG_ROW_FLOATING_INSERT_DOT: `${tablePrefixSelector}-drag-row-floating-insert-dot`,
|
|
393
395
|
|
|
@@ -23,6 +23,7 @@ export interface ButtonProps {
|
|
|
23
23
|
tableRef: HTMLElement;
|
|
24
24
|
onMouseDown: (event: SyntheticEvent<HTMLButtonElement>) => void;
|
|
25
25
|
hasStickyHeaders: boolean;
|
|
26
|
+
isChromelessEditor?: boolean;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
const getInsertLineHeight = (
|
|
@@ -64,12 +65,16 @@ const getNumberColumnWidth = (tableRef: HTMLElement, isDragAndDropEnabled?: bool
|
|
|
64
65
|
return 0;
|
|
65
66
|
};
|
|
66
67
|
|
|
67
|
-
const getInsertLineWidth = (
|
|
68
|
+
const getInsertLineWidth = (
|
|
69
|
+
tableRef: HTMLElement,
|
|
70
|
+
isDragAndDropEnabled?: boolean,
|
|
71
|
+
isChromelessEditor?: boolean,
|
|
72
|
+
) => {
|
|
68
73
|
// The line gets width 100% from the table,
|
|
69
74
|
// but since we have an overflow on the left,
|
|
70
75
|
// we should add an offset to make up for it.
|
|
71
76
|
const LINE_OFFSET = 4;
|
|
72
|
-
const DRAG_LINE_OFFSET = 6;
|
|
77
|
+
const DRAG_LINE_OFFSET = isChromelessEditor ? 14 : 6;
|
|
73
78
|
const { parentElement, offsetWidth } = tableRef;
|
|
74
79
|
const parentOffsetWidth = parentElement!.offsetWidth;
|
|
75
80
|
const { scrollLeft } = parentElement!;
|
|
@@ -97,6 +102,7 @@ export const InsertButtonForDragAndDrop = ({
|
|
|
97
102
|
type,
|
|
98
103
|
intl: { formatMessage },
|
|
99
104
|
hasStickyHeaders,
|
|
105
|
+
isChromelessEditor,
|
|
100
106
|
}: ButtonProps & WrappedComponentProps) => {
|
|
101
107
|
const isRow = type === 'row';
|
|
102
108
|
|
|
@@ -114,8 +120,10 @@ export const InsertButtonForDragAndDrop = ({
|
|
|
114
120
|
<div
|
|
115
121
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
116
122
|
className={classnames(ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER, {
|
|
117
|
-
[ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW]: isRow,
|
|
123
|
+
[ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW]: isRow && !isChromelessEditor,
|
|
118
124
|
[ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_COLUMN]: !isRow,
|
|
125
|
+
[ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW_CHROMELESS]:
|
|
126
|
+
isRow && isChromelessEditor,
|
|
119
127
|
})}
|
|
120
128
|
>
|
|
121
129
|
<button
|
|
@@ -147,7 +155,7 @@ export const InsertButtonForDragAndDrop = ({
|
|
|
147
155
|
style={
|
|
148
156
|
type === 'row'
|
|
149
157
|
? {
|
|
150
|
-
width: getInsertLineWidth(tableRef, true),
|
|
158
|
+
width: getInsertLineWidth(tableRef, true, isChromelessEditor),
|
|
151
159
|
left: token('space.150', '12px'),
|
|
152
160
|
}
|
|
153
161
|
: {
|
|
@@ -25,7 +25,7 @@ import { akEditorTableCellOnStickyHeaderZIndex } from '@atlaskit/editor-shared-s
|
|
|
25
25
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
26
26
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
27
27
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
28
|
-
import {
|
|
28
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
29
29
|
|
|
30
30
|
import { insertColumnWithAnalytics, insertRowWithAnalytics } from '../../commands-with-analytics';
|
|
31
31
|
import { TableCssClassName as ClassName } from '../../types';
|
|
@@ -52,6 +52,7 @@ export interface Props {
|
|
|
52
52
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
53
53
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
54
54
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
55
|
+
isChromelessEditor?: boolean;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
export class FloatingInsertButton extends React.Component<Props & WrappedComponentProps, any> {
|
|
@@ -76,6 +77,7 @@ export class FloatingInsertButton extends React.Component<Props & WrappedCompone
|
|
|
76
77
|
isHeaderRowEnabled,
|
|
77
78
|
isDragAndDropEnabled,
|
|
78
79
|
dispatchAnalyticsEvent,
|
|
80
|
+
isChromelessEditor,
|
|
79
81
|
} = this.props;
|
|
80
82
|
|
|
81
83
|
// TODO: temporarily disable insert button for first column and row https://atlassian.slack.com/archives/C05U8HRQM50/p1698363744682219?thread_ts=1698209039.104909&cid=C05U8HRQM50
|
|
@@ -199,6 +201,7 @@ export class FloatingInsertButton extends React.Component<Props & WrappedCompone
|
|
|
199
201
|
tableRef={tableRef}
|
|
200
202
|
onMouseDown={type === 'column' ? this.insertColumn : this.insertRow}
|
|
201
203
|
hasStickyHeaders={this.props.hasStickyHeaders || false}
|
|
204
|
+
isChromelessEditor={isChromelessEditor}
|
|
202
205
|
/>
|
|
203
206
|
) : (
|
|
204
207
|
<InsertButton
|
|
@@ -273,7 +276,7 @@ export class FloatingInsertButton extends React.Component<Props & WrappedCompone
|
|
|
273
276
|
const shouldUseIncreasedScalingPercent =
|
|
274
277
|
isTableScalingEnabled &&
|
|
275
278
|
tableWithFixedColumnWidthsOption &&
|
|
276
|
-
|
|
279
|
+
fg('platform.editor.table.use-increased-scaling-percent');
|
|
277
280
|
|
|
278
281
|
const { state, dispatch } = editorView;
|
|
279
282
|
insertColumnWithAnalytics(
|