@monolith-forensics/monolith-ui 1.9.1-dev.9 → 1.9.3-dev.1
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/dist/Charts/BarChart/BarChart.js +28 -14
- package/dist/Charts/BarChart/BarChart.styled.d.ts +7 -2
- package/dist/Charts/BarChart/BarChart.styled.js +5 -1
- package/dist/Charts/BarChart/BarChart.types.d.ts +13 -5
- package/dist/Charts/ChartUtils/chartSizing.d.ts +20 -0
- package/dist/Charts/ChartUtils/chartSizing.js +83 -0
- package/dist/Charts/ChartUtils/index.d.ts +1 -0
- package/dist/Charts/ChartUtils/index.js +1 -0
- package/dist/Charts/HeatMap/HeatMap.js +28 -7
- package/dist/Charts/HeatMap/HeatMap.styled.d.ts +6 -2
- package/dist/Charts/HeatMap/HeatMap.styled.js +3 -0
- package/dist/Charts/HeatMap/HeatMap.types.d.ts +7 -1
- package/dist/Charts/LineChart/LineChart.js +34 -15
- package/dist/Charts/LineChart/LineChart.styled.d.ts +7 -2
- package/dist/Charts/LineChart/LineChart.styled.js +5 -1
- package/dist/Charts/LineChart/LineChart.types.d.ts +13 -5
- package/dist/Charts/PieChart/PieChart.js +48 -33
- package/dist/Charts/PieChart/PieChart.styled.d.ts +7 -2
- package/dist/Charts/PieChart/PieChart.styled.js +6 -1
- package/dist/Charts/PieChart/PieChart.types.d.ts +7 -3
- package/dist/DropDownMenu/components/MenuItemList.js +32 -12
- package/dist/DropDownMenu/components/StyledContent.js +1 -1
- package/dist/DropDownMenu/components/StyledInnerItemContainer.js +1 -0
- package/dist/FieldLabel/FieldLabel.js +3 -18
- package/dist/FileViewer/FileViewer.js +32 -8
- package/dist/FileViewer/viewers/ImageViewer.d.ts +1 -0
- package/dist/FileViewer/viewers/ImageViewer.js +36 -15
- package/dist/MonolithUIProvider/MonolithUIProvider.d.ts +23 -0
- package/dist/RichTextEditor/Components/BubbleMenu.d.ts +3 -3
- package/dist/RichTextEditor/Components/BubbleMenu.js +190 -51
- package/dist/RichTextEditor/Components/CodeBlockBaseButton.d.ts +18 -0
- package/dist/RichTextEditor/Components/CodeBlockBaseButton.js +6 -0
- package/dist/RichTextEditor/Components/CodeBlockCopyButton.d.ts +9 -0
- package/dist/RichTextEditor/Components/CodeBlockCopyButton.js +42 -0
- package/dist/RichTextEditor/Components/CodeBlockFormatButton.d.ts +10 -0
- package/dist/RichTextEditor/Components/CodeBlockFormatButton.js +60 -0
- package/dist/RichTextEditor/Components/CodeBlockLanguageSelect.d.ts +9 -0
- package/dist/RichTextEditor/Components/CodeBlockLanguageSelect.js +30 -0
- package/dist/RichTextEditor/Components/CodeBlockNodeView.d.ts +3 -0
- package/dist/RichTextEditor/Components/CodeBlockNodeView.js +28 -0
- package/dist/RichTextEditor/Components/CodeBlockWrapButton.d.ts +10 -0
- package/dist/RichTextEditor/Components/CodeBlockWrapButton.js +17 -0
- package/dist/RichTextEditor/Components/LinkEditor.d.ts +8 -0
- package/dist/RichTextEditor/Components/LinkEditor.js +94 -0
- package/dist/RichTextEditor/Components/TableTools/TableCornerMenu.d.ts +2 -0
- package/dist/RichTextEditor/Components/TableTools/TableCornerMenu.js +19 -0
- package/dist/RichTextEditor/Components/TableTools/TableInsertControls.d.ts +2 -0
- package/dist/RichTextEditor/Components/TableTools/TableInsertControls.js +24 -0
- package/dist/RichTextEditor/Components/TableTools/TableRails.d.ts +2 -0
- package/dist/RichTextEditor/Components/TableTools/TableRails.js +180 -0
- package/dist/RichTextEditor/Components/TableTools/TableToolMenu.d.ts +5 -0
- package/dist/RichTextEditor/Components/TableTools/TableToolMenu.js +6 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.actions.d.ts +5 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.actions.js +183 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.commands.d.ts +16 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.commands.js +217 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.constants.d.ts +8 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.constants.js +11 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.d.ts +3 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.geometry.d.ts +23 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.geometry.js +75 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.js +3 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.selectors.d.ts +16 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.selectors.js +53 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.styled.d.ts +40 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.styled.js +167 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.types.d.ts +76 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.types.js +1 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.utils.d.ts +4 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.utils.js +4 -0
- package/dist/RichTextEditor/Components/TableTools/TableToolsPopover.d.ts +2 -0
- package/dist/RichTextEditor/Components/TableTools/TableToolsPopover.js +12 -0
- package/dist/RichTextEditor/Components/TableTools/index.d.ts +3 -0
- package/dist/RichTextEditor/Components/TableTools/index.js +2 -0
- package/dist/RichTextEditor/Enums/Controls.d.ts +7 -1
- package/dist/RichTextEditor/Enums/Controls.js +6 -0
- package/dist/RichTextEditor/Enums/Extensions.d.ts +4 -0
- package/dist/RichTextEditor/Enums/Extensions.js +4 -0
- package/dist/RichTextEditor/Enums/HighlightColors.d.ts +9 -0
- package/dist/RichTextEditor/Enums/HighlightColors.js +10 -0
- package/dist/RichTextEditor/Enums/SlashCommands.d.ts +4 -1
- package/dist/RichTextEditor/Enums/SlashCommands.js +3 -0
- package/dist/RichTextEditor/Extensions/SlashCommandList.js +0 -1
- package/dist/RichTextEditor/Extensions/getSlashCommand.d.ts +23 -3
- package/dist/RichTextEditor/Extensions/getSlashCommand.js +53 -7
- package/dist/RichTextEditor/Extensions/getTiptapExtensions.d.ts +15 -2
- package/dist/RichTextEditor/Extensions/getTiptapExtensions.js +159 -24
- package/dist/RichTextEditor/Plugins/ImageActionsPlugin.js +4 -7
- package/dist/RichTextEditor/RichTextEditor.d.ts +9 -4
- package/dist/RichTextEditor/RichTextEditor.js +352 -14
- package/dist/RichTextEditor/Toolbar/Control.d.ts +6 -2
- package/dist/RichTextEditor/Toolbar/Control.js +13 -6
- package/dist/RichTextEditor/Toolbar/Controls.d.ts +6 -0
- package/dist/RichTextEditor/Toolbar/Controls.js +118 -1
- package/dist/RichTextEditor/Toolbar/ControlsGroup.js +17 -6
- package/dist/RichTextEditor/Toolbar/Labels.d.ts +1 -0
- package/dist/RichTextEditor/Toolbar/Labels.js +1 -0
- package/dist/RichTextEditor/Toolbar/Toolbar.d.ts +1 -2
- package/dist/RichTextEditor/Toolbar/Toolbar.js +32 -67
- package/dist/RichTextEditor/Utils/codeBlockUtils.d.ts +20 -0
- package/dist/RichTextEditor/Utils/codeBlockUtils.js +137 -0
- package/dist/RichTextEditor/Utils/codeUtils.d.ts +3 -0
- package/dist/RichTextEditor/Utils/codeUtils.js +12 -0
- package/dist/RichTextEditor/Utils/linkUtils.d.ts +19 -0
- package/dist/RichTextEditor/Utils/linkUtils.js +57 -0
- package/dist/RichTextEditor/Utils/tableUtils.d.ts +1 -0
- package/dist/RichTextEditor/Utils/tableUtils.js +1 -0
- package/dist/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/SegmentedControl/SegmentedControl.styles.d.ts +1 -0
- package/dist/SegmentedControl/SegmentedControl.styles.js +30 -14
- package/dist/SegmentedControl/SegmentedControl.utils.d.ts +1 -0
- package/dist/SegmentedControl/SegmentedControl.utils.js +5 -2
- package/dist/Table/Table.js +4 -3
- package/dist/Table/TableComponents.d.ts +3 -0
- package/dist/Table/TableComponents.js +47 -0
- package/dist/Table/TableHeader.js +1 -1
- package/dist/Table/TableMenu/TableMenu.js +4 -3
- package/dist/Table/TableProvider.js +39 -0
- package/dist/Table/TableRow.js +1 -1
- package/dist/Table/types.d.ts +6 -0
- package/dist/Utilities/getImageTextContent.d.ts +78 -0
- package/dist/Utilities/getImageTextContent.js +222 -0
- package/dist/core/controlSizes.js +9 -9
- package/dist/theme/variants.js +46 -0
- package/package.json +8 -1
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowDownToLineIcon, ArrowLeftToLineIcon, ArrowRightToLineIcon, ArrowUpToLineIcon, CopyIcon, EraserIcon, MoveDownIcon, MoveLeftIcon, MoveRightIcon, MoveUpIcon, PanelTopIcon, Trash2Icon, } from "lucide-react";
|
|
3
|
+
import { clearTableContents, clearTargetContents, deleteColumnAt, deleteRowAt, deleteTable, duplicateColumn, duplicateRow, duplicateTable, insertColumnAt, insertRowAt, moveColumn, moveRow, toggleTopHeaderRow, } from "./TableTools.commands";
|
|
4
|
+
import { getTopRowIsHeader, hasRiskyMergedCells } from "./TableTools.selectors";
|
|
5
|
+
export const getColumnActionGroups = (editor, target) => {
|
|
6
|
+
const risky = hasRiskyMergedCells(target);
|
|
7
|
+
const lastColumn = target.tableContext.map.width - 1;
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
label: "Move",
|
|
11
|
+
actions: [
|
|
12
|
+
{
|
|
13
|
+
label: "Move column left",
|
|
14
|
+
leftSection: _jsx(MoveLeftIcon, { size: 14 }),
|
|
15
|
+
disabled: risky || target.colIndex === 0,
|
|
16
|
+
onClick: () => moveColumn(editor, target, -1),
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: "Move column right",
|
|
20
|
+
leftSection: _jsx(MoveRightIcon, { size: 14 }),
|
|
21
|
+
disabled: risky || target.colIndex === lastColumn,
|
|
22
|
+
onClick: () => moveColumn(editor, target, 1),
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: "Insert",
|
|
28
|
+
actions: [
|
|
29
|
+
{
|
|
30
|
+
label: "Insert column left",
|
|
31
|
+
leftSection: _jsx(ArrowLeftToLineIcon, { size: 14 }),
|
|
32
|
+
onClick: () => insertColumnAt(editor, target, target.colIndex),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: "Insert column right",
|
|
36
|
+
leftSection: _jsx(ArrowRightToLineIcon, { size: 14 }),
|
|
37
|
+
onClick: () => insertColumnAt(editor, target, target.colIndex + 1),
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: "Content",
|
|
43
|
+
actions: [
|
|
44
|
+
{
|
|
45
|
+
label: "Clear column contents",
|
|
46
|
+
leftSection: _jsx(EraserIcon, { size: 14 }),
|
|
47
|
+
disabled: risky,
|
|
48
|
+
onClick: () => clearTargetContents(editor, target),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: "Duplicate column",
|
|
52
|
+
leftSection: _jsx(CopyIcon, { size: 14 }),
|
|
53
|
+
disabled: risky,
|
|
54
|
+
onClick: () => duplicateColumn(editor, target),
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: "Delete",
|
|
60
|
+
actions: [
|
|
61
|
+
{
|
|
62
|
+
label: "Delete column",
|
|
63
|
+
leftSection: _jsx(Trash2Icon, { size: 14 }),
|
|
64
|
+
danger: true,
|
|
65
|
+
disabled: risky || target.tableContext.map.width <= 1,
|
|
66
|
+
onClick: () => deleteColumnAt(editor, target),
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
};
|
|
72
|
+
export const getRowActionGroups = (editor, target) => {
|
|
73
|
+
const risky = hasRiskyMergedCells(target);
|
|
74
|
+
const topRowIsHeader = getTopRowIsHeader(target);
|
|
75
|
+
const lastRow = target.tableContext.map.height - 1;
|
|
76
|
+
return [
|
|
77
|
+
{
|
|
78
|
+
label: "Header",
|
|
79
|
+
actions: [
|
|
80
|
+
{
|
|
81
|
+
label: topRowIsHeader ? "Unset header row" : "Set header row",
|
|
82
|
+
leftSection: _jsx(PanelTopIcon, { size: 14 }),
|
|
83
|
+
disabled: target.rowIndex !== 0,
|
|
84
|
+
onClick: () => toggleTopHeaderRow(editor, target),
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
label: "Move",
|
|
90
|
+
actions: [
|
|
91
|
+
{
|
|
92
|
+
label: "Move row up",
|
|
93
|
+
leftSection: _jsx(MoveUpIcon, { size: 14 }),
|
|
94
|
+
disabled: risky ||
|
|
95
|
+
target.rowIndex === 0 ||
|
|
96
|
+
(topRowIsHeader && target.rowIndex === 1),
|
|
97
|
+
onClick: () => moveRow(editor, target, -1),
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: "Move row down",
|
|
101
|
+
leftSection: _jsx(MoveDownIcon, { size: 14 }),
|
|
102
|
+
disabled: risky ||
|
|
103
|
+
target.rowIndex === lastRow ||
|
|
104
|
+
(topRowIsHeader && target.rowIndex === 0),
|
|
105
|
+
onClick: () => moveRow(editor, target, 1),
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
label: "Insert",
|
|
111
|
+
actions: [
|
|
112
|
+
{
|
|
113
|
+
label: "Insert row above",
|
|
114
|
+
leftSection: _jsx(ArrowUpToLineIcon, { size: 14 }),
|
|
115
|
+
disabled: topRowIsHeader && target.rowIndex === 0,
|
|
116
|
+
onClick: () => insertRowAt(editor, target, target.rowIndex),
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
label: "Insert row below",
|
|
120
|
+
leftSection: _jsx(ArrowDownToLineIcon, { size: 14 }),
|
|
121
|
+
onClick: () => insertRowAt(editor, target, target.rowIndex + 1),
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
label: "Content",
|
|
127
|
+
actions: [
|
|
128
|
+
{
|
|
129
|
+
label: "Clear row contents",
|
|
130
|
+
leftSection: _jsx(EraserIcon, { size: 14 }),
|
|
131
|
+
disabled: risky,
|
|
132
|
+
onClick: () => clearTargetContents(editor, target),
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
label: "Duplicate row",
|
|
136
|
+
leftSection: _jsx(CopyIcon, { size: 14 }),
|
|
137
|
+
disabled: risky,
|
|
138
|
+
onClick: () => duplicateRow(editor, target),
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
label: "Delete",
|
|
144
|
+
actions: [
|
|
145
|
+
{
|
|
146
|
+
label: "Delete row",
|
|
147
|
+
leftSection: _jsx(Trash2Icon, { size: 14 }),
|
|
148
|
+
danger: true,
|
|
149
|
+
disabled: risky || target.tableContext.map.height <= 1,
|
|
150
|
+
onClick: () => deleteRowAt(editor, target),
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
},
|
|
154
|
+
];
|
|
155
|
+
};
|
|
156
|
+
export const getTableActionGroups = (editor, target) => [
|
|
157
|
+
{
|
|
158
|
+
label: "Content",
|
|
159
|
+
actions: [
|
|
160
|
+
{
|
|
161
|
+
label: "Clear table contents",
|
|
162
|
+
leftSection: _jsx(EraserIcon, { size: 14 }),
|
|
163
|
+
onClick: () => clearTableContents(editor, target),
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
label: "Duplicate table",
|
|
167
|
+
leftSection: _jsx(CopyIcon, { size: 14 }),
|
|
168
|
+
onClick: () => duplicateTable(editor, target),
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
label: "Delete",
|
|
174
|
+
actions: [
|
|
175
|
+
{
|
|
176
|
+
label: "Delete table",
|
|
177
|
+
leftSection: _jsx(Trash2Icon, { size: 14 }),
|
|
178
|
+
danger: true,
|
|
179
|
+
onClick: () => deleteTable(editor, target),
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
},
|
|
183
|
+
];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
import type { RailTarget, TableRailTarget } from "./TableTools.types";
|
|
3
|
+
export declare const runTableCommand: (editor: Editor | null, command: string, args?: unknown[]) => void;
|
|
4
|
+
export declare const insertRowAt: (editor: Editor | null, target: RailTarget, row: number) => boolean;
|
|
5
|
+
export declare const insertColumnAt: (editor: Editor | null, target: RailTarget, column: number) => boolean;
|
|
6
|
+
export declare const deleteRowAt: (editor: Editor | null, target: RailTarget) => boolean;
|
|
7
|
+
export declare const deleteColumnAt: (editor: Editor | null, target: RailTarget) => boolean;
|
|
8
|
+
export declare const clearTargetContents: (editor: Editor | null, target: RailTarget) => boolean;
|
|
9
|
+
export declare const duplicateRow: (editor: Editor | null, target: RailTarget) => boolean;
|
|
10
|
+
export declare const duplicateColumn: (editor: Editor | null, target: RailTarget) => boolean;
|
|
11
|
+
export declare const moveRow: (editor: Editor | null, target: RailTarget, direction: -1 | 1) => boolean;
|
|
12
|
+
export declare const moveColumn: (editor: Editor | null, target: RailTarget, direction: -1 | 1) => boolean;
|
|
13
|
+
export declare const toggleTopHeaderRow: (editor: Editor | null, target: RailTarget) => boolean;
|
|
14
|
+
export declare const clearTableContents: (editor: Editor | null, target: TableRailTarget) => boolean;
|
|
15
|
+
export declare const duplicateTable: (editor: Editor | null, target: TableRailTarget) => boolean;
|
|
16
|
+
export declare const deleteTable: (editor: Editor | null, target: TableRailTarget) => boolean;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { Fragment } from "@tiptap/pm/model";
|
|
2
|
+
import { TextSelection } from "@tiptap/pm/state";
|
|
3
|
+
import { addColumn, addRow, removeColumn, removeRow } from "@tiptap/pm/tables";
|
|
4
|
+
import { getCellsInTableTarget, getCellsInTarget, getTopRowIsHeader, } from "./TableTools.selectors";
|
|
5
|
+
export const runTableCommand = (editor, command, args = []) => {
|
|
6
|
+
const chain = editor === null || editor === void 0 ? void 0 : editor.chain().focus();
|
|
7
|
+
if (!(chain === null || chain === void 0 ? void 0 : chain[command]))
|
|
8
|
+
return;
|
|
9
|
+
chain[command](...args).run();
|
|
10
|
+
};
|
|
11
|
+
const getTableRect = (tableContext) => ({
|
|
12
|
+
left: 0,
|
|
13
|
+
top: 0,
|
|
14
|
+
right: tableContext.map.width,
|
|
15
|
+
bottom: tableContext.map.height,
|
|
16
|
+
tableStart: tableContext.start,
|
|
17
|
+
map: tableContext.map,
|
|
18
|
+
table: tableContext.node,
|
|
19
|
+
});
|
|
20
|
+
const getRowStartOffset = (table, rowIndex) => {
|
|
21
|
+
let offset = 0;
|
|
22
|
+
for (let index = 0; index < rowIndex; index += 1) {
|
|
23
|
+
offset += table.child(index).nodeSize;
|
|
24
|
+
}
|
|
25
|
+
return offset;
|
|
26
|
+
};
|
|
27
|
+
const getCellChildIndex = (table, rowIndex, cellPos) => {
|
|
28
|
+
const row = table.child(rowIndex);
|
|
29
|
+
let offset = getRowStartOffset(table, rowIndex) + 1;
|
|
30
|
+
for (let index = 0; index < row.childCount; index += 1) {
|
|
31
|
+
if (offset === cellPos)
|
|
32
|
+
return index;
|
|
33
|
+
offset += row.child(index).nodeSize;
|
|
34
|
+
}
|
|
35
|
+
return -1;
|
|
36
|
+
};
|
|
37
|
+
export const insertRowAt = (editor, target, row) => {
|
|
38
|
+
if (!editor)
|
|
39
|
+
return false;
|
|
40
|
+
editor.view.dispatch(addRow(editor.state.tr, getTableRect(target.tableContext), row));
|
|
41
|
+
return true;
|
|
42
|
+
};
|
|
43
|
+
export const insertColumnAt = (editor, target, column) => {
|
|
44
|
+
if (!editor)
|
|
45
|
+
return false;
|
|
46
|
+
editor.view.dispatch(addColumn(editor.state.tr, getTableRect(target.tableContext), column));
|
|
47
|
+
return true;
|
|
48
|
+
};
|
|
49
|
+
export const deleteRowAt = (editor, target) => {
|
|
50
|
+
if (!editor || target.tableContext.map.height <= 1)
|
|
51
|
+
return false;
|
|
52
|
+
const tr = editor.state.tr;
|
|
53
|
+
removeRow(tr, getTableRect(target.tableContext), target.rowIndex);
|
|
54
|
+
editor.view.dispatch(tr);
|
|
55
|
+
return true;
|
|
56
|
+
};
|
|
57
|
+
export const deleteColumnAt = (editor, target) => {
|
|
58
|
+
if (!editor || target.tableContext.map.width <= 1)
|
|
59
|
+
return false;
|
|
60
|
+
const tr = editor.state.tr;
|
|
61
|
+
removeColumn(tr, getTableRect(target.tableContext), target.colIndex);
|
|
62
|
+
editor.view.dispatch(tr);
|
|
63
|
+
return true;
|
|
64
|
+
};
|
|
65
|
+
export const clearTargetContents = (editor, target) => {
|
|
66
|
+
if (!editor)
|
|
67
|
+
return false;
|
|
68
|
+
const paragraph = editor.state.schema.nodes.paragraph.createAndFill();
|
|
69
|
+
if (!paragraph)
|
|
70
|
+
return false;
|
|
71
|
+
const tr = editor.state.tr;
|
|
72
|
+
const cells = getCellsInTarget(target).sort((a, b) => b.pos - a.pos);
|
|
73
|
+
cells.forEach((cell) => {
|
|
74
|
+
const from = target.tableContext.start + cell.pos + 1;
|
|
75
|
+
const to = target.tableContext.start + cell.pos + cell.node.nodeSize - 1;
|
|
76
|
+
tr.replaceWith(from, to, paragraph);
|
|
77
|
+
});
|
|
78
|
+
editor.view.dispatch(tr);
|
|
79
|
+
return true;
|
|
80
|
+
};
|
|
81
|
+
export const duplicateRow = (editor, target) => {
|
|
82
|
+
if (!editor)
|
|
83
|
+
return false;
|
|
84
|
+
const row = target.tableContext.node.child(target.rowIndex);
|
|
85
|
+
const insertPosition = target.tableContext.start +
|
|
86
|
+
getRowStartOffset(target.tableContext.node, target.rowIndex + 1);
|
|
87
|
+
editor.view.dispatch(editor.state.tr.insert(insertPosition, row.copy(row.content)));
|
|
88
|
+
return true;
|
|
89
|
+
};
|
|
90
|
+
export const duplicateColumn = (editor, target) => {
|
|
91
|
+
if (!editor)
|
|
92
|
+
return false;
|
|
93
|
+
const tr = editor.state.tr;
|
|
94
|
+
const inserts = [];
|
|
95
|
+
for (let row = 0; row < target.tableContext.map.height; row += 1) {
|
|
96
|
+
const cellPos = target.tableContext.map.positionAt(row, target.colIndex, target.tableContext.node);
|
|
97
|
+
const cell = target.tableContext.node.nodeAt(cellPos);
|
|
98
|
+
if (cell) {
|
|
99
|
+
inserts.push({
|
|
100
|
+
pos: target.tableContext.start + cellPos + cell.nodeSize,
|
|
101
|
+
node: cell.copy(cell.content),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
inserts
|
|
106
|
+
.sort((a, b) => b.pos - a.pos)
|
|
107
|
+
.forEach((insert) => tr.insert(insert.pos, insert.node));
|
|
108
|
+
editor.view.dispatch(tr);
|
|
109
|
+
return true;
|
|
110
|
+
};
|
|
111
|
+
export const moveRow = (editor, target, direction) => {
|
|
112
|
+
if (!editor)
|
|
113
|
+
return false;
|
|
114
|
+
const to = target.rowIndex + direction;
|
|
115
|
+
if (to < 0 || to >= target.tableContext.map.height)
|
|
116
|
+
return false;
|
|
117
|
+
const rows = [];
|
|
118
|
+
target.tableContext.node.forEach((row) => {
|
|
119
|
+
rows.push(row);
|
|
120
|
+
});
|
|
121
|
+
const [row] = rows.splice(target.rowIndex, 1);
|
|
122
|
+
rows.splice(to, 0, row);
|
|
123
|
+
const nextTable = target.tableContext.node.copy(Fragment.from(rows));
|
|
124
|
+
editor.view.dispatch(editor.state.tr.replaceWith(target.tableContext.pos, target.tableContext.pos + target.tableContext.node.nodeSize, nextTable));
|
|
125
|
+
return true;
|
|
126
|
+
};
|
|
127
|
+
export const moveColumn = (editor, target, direction) => {
|
|
128
|
+
if (!editor)
|
|
129
|
+
return false;
|
|
130
|
+
const to = target.colIndex + direction;
|
|
131
|
+
if (to < 0 || to >= target.tableContext.map.width)
|
|
132
|
+
return false;
|
|
133
|
+
const rows = [];
|
|
134
|
+
for (let row = 0; row < target.tableContext.map.height; row += 1) {
|
|
135
|
+
const rowNode = target.tableContext.node.child(row);
|
|
136
|
+
const cells = [];
|
|
137
|
+
const cellPos = target.tableContext.map.positionAt(row, target.colIndex, target.tableContext.node);
|
|
138
|
+
const cellIndex = getCellChildIndex(target.tableContext.node, row, cellPos);
|
|
139
|
+
rowNode.forEach((cell) => {
|
|
140
|
+
cells.push(cell);
|
|
141
|
+
});
|
|
142
|
+
if (cellIndex < 0) {
|
|
143
|
+
rows.push(rowNode);
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
const [cell] = cells.splice(cellIndex, 1);
|
|
147
|
+
const insertIndex = direction > 0 ? cellIndex + 1 : cellIndex - 1;
|
|
148
|
+
cells.splice(insertIndex, 0, cell);
|
|
149
|
+
rows.push(rowNode.copy(Fragment.from(cells)));
|
|
150
|
+
}
|
|
151
|
+
const nextTable = target.tableContext.node.copy(Fragment.from(rows));
|
|
152
|
+
editor.view.dispatch(editor.state.tr.replaceWith(target.tableContext.pos, target.tableContext.pos + target.tableContext.node.nodeSize, nextTable));
|
|
153
|
+
return true;
|
|
154
|
+
};
|
|
155
|
+
export const toggleTopHeaderRow = (editor, target) => {
|
|
156
|
+
if (!editor || target.rowIndex !== 0)
|
|
157
|
+
return false;
|
|
158
|
+
const headerType = editor.state.schema.nodes.tableHeader;
|
|
159
|
+
const cellType = editor.state.schema.nodes.tableCell;
|
|
160
|
+
if (!headerType || !cellType)
|
|
161
|
+
return false;
|
|
162
|
+
const makeHeader = !getTopRowIsHeader(target);
|
|
163
|
+
const tr = editor.state.tr;
|
|
164
|
+
const cells = getCellsInTarget(target);
|
|
165
|
+
cells.forEach((cell) => {
|
|
166
|
+
tr.setNodeMarkup(target.tableContext.start + cell.pos, makeHeader ? headerType : cellType, cell.node.attrs);
|
|
167
|
+
});
|
|
168
|
+
editor.view.dispatch(tr);
|
|
169
|
+
return true;
|
|
170
|
+
};
|
|
171
|
+
export const clearTableContents = (editor, target) => {
|
|
172
|
+
if (!editor)
|
|
173
|
+
return false;
|
|
174
|
+
const paragraph = editor.state.schema.nodes.paragraph.createAndFill();
|
|
175
|
+
if (!paragraph)
|
|
176
|
+
return false;
|
|
177
|
+
const tr = editor.state.tr;
|
|
178
|
+
const cells = getCellsInTableTarget(target).sort((a, b) => b.pos - a.pos);
|
|
179
|
+
cells.forEach((cell) => {
|
|
180
|
+
const from = target.tableContext.start + cell.pos + 1;
|
|
181
|
+
const to = target.tableContext.start + cell.pos + cell.node.nodeSize - 1;
|
|
182
|
+
tr.replaceWith(from, to, paragraph);
|
|
183
|
+
});
|
|
184
|
+
editor.view.dispatch(tr);
|
|
185
|
+
return true;
|
|
186
|
+
};
|
|
187
|
+
export const duplicateTable = (editor, target) => {
|
|
188
|
+
if (!editor)
|
|
189
|
+
return false;
|
|
190
|
+
const { tableContext } = target;
|
|
191
|
+
const paragraph = editor.state.schema.nodes.paragraph.createAndFill();
|
|
192
|
+
if (!paragraph)
|
|
193
|
+
return false;
|
|
194
|
+
const insertPosition = tableContext.pos + tableContext.node.nodeSize;
|
|
195
|
+
const duplicatedTable = tableContext.node.copy(tableContext.node.content);
|
|
196
|
+
const tr = editor.state.tr.insert(insertPosition, [
|
|
197
|
+
paragraph,
|
|
198
|
+
duplicatedTable,
|
|
199
|
+
]);
|
|
200
|
+
const firstCellPosition = tableContext.map.positionAt(0, 0, duplicatedTable);
|
|
201
|
+
if (firstCellPosition !== null) {
|
|
202
|
+
const duplicatePosition = insertPosition + paragraph.nodeSize;
|
|
203
|
+
const firstCellContentPosition = duplicatePosition + 1 + firstCellPosition + 1;
|
|
204
|
+
tr.setSelection(TextSelection.near(tr.doc.resolve(firstCellContentPosition)));
|
|
205
|
+
}
|
|
206
|
+
editor.view.dispatch(tr.scrollIntoView());
|
|
207
|
+
return true;
|
|
208
|
+
};
|
|
209
|
+
export const deleteTable = (editor, target) => {
|
|
210
|
+
if (!editor)
|
|
211
|
+
return false;
|
|
212
|
+
const { tableContext } = target;
|
|
213
|
+
editor.view.dispatch(editor.state.tr
|
|
214
|
+
.delete(tableContext.pos, tableContext.pos + tableContext.node.nodeSize)
|
|
215
|
+
.scrollIntoView());
|
|
216
|
+
return true;
|
|
217
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TableInsertOptions } from "./TableTools.types";
|
|
2
|
+
export declare const DEFAULT_TABLE_OPTIONS: TableInsertOptions;
|
|
3
|
+
export declare const MIN_TABLE_SIZE = 1;
|
|
4
|
+
export declare const MAX_TABLE_SIZE = 20;
|
|
5
|
+
export declare const RAIL_THICKNESS = 8;
|
|
6
|
+
export declare const RAIL_HIDE_DELAY = 250;
|
|
7
|
+
export declare const VIEWPORT_PADDING = 8;
|
|
8
|
+
export declare const CORNER_BUTTON_SIZE = 18;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const DEFAULT_TABLE_OPTIONS = {
|
|
2
|
+
rows: 3,
|
|
3
|
+
cols: 3,
|
|
4
|
+
withHeaderRow: true,
|
|
5
|
+
};
|
|
6
|
+
export const MIN_TABLE_SIZE = 1;
|
|
7
|
+
export const MAX_TABLE_SIZE = 20;
|
|
8
|
+
export const RAIL_THICKNESS = 8;
|
|
9
|
+
export const RAIL_HIDE_DELAY = 250;
|
|
10
|
+
export const VIEWPORT_PADDING = 8;
|
|
11
|
+
export const CORNER_BUTTON_SIZE = 18;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TableMap } from "@tiptap/pm/tables";
|
|
2
|
+
import type { Editor } from "@tiptap/react";
|
|
3
|
+
import type { RailKind, RailRect, RailTarget, TableRailTarget } from "./TableTools.types";
|
|
4
|
+
export declare const getRailTargetFromCell: (editor: Editor, cell: HTMLTableCellElement) => {
|
|
5
|
+
kind: RailKind;
|
|
6
|
+
rowIndex: number;
|
|
7
|
+
colIndex: number;
|
|
8
|
+
tableElement: HTMLTableElement;
|
|
9
|
+
tableRect: RailRect;
|
|
10
|
+
tableContext: {
|
|
11
|
+
node: import("prosemirror-model").Node;
|
|
12
|
+
pos: number;
|
|
13
|
+
start: number;
|
|
14
|
+
map: TableMap;
|
|
15
|
+
};
|
|
16
|
+
rowRect: RailRect;
|
|
17
|
+
columnRect: RailRect;
|
|
18
|
+
} | null;
|
|
19
|
+
export declare const getRailRect: (target: RailTarget, kind: RailKind) => RailRect;
|
|
20
|
+
export declare const getCornerRect: (target: TableRailTarget) => {
|
|
21
|
+
top: number;
|
|
22
|
+
left: number;
|
|
23
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { findCellPos, findTable, TableMap } from "@tiptap/pm/tables";
|
|
2
|
+
import { CORNER_BUTTON_SIZE, RAIL_THICKNESS, VIEWPORT_PADDING, } from "./TableTools.constants";
|
|
3
|
+
const toRect = (rect) => ({
|
|
4
|
+
top: rect.top,
|
|
5
|
+
left: rect.left,
|
|
6
|
+
width: rect.width,
|
|
7
|
+
height: rect.height,
|
|
8
|
+
});
|
|
9
|
+
const clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
10
|
+
export const getRailTargetFromCell = (editor, cell) => {
|
|
11
|
+
const tableElement = cell.closest("table");
|
|
12
|
+
const rowElement = cell.closest("tr");
|
|
13
|
+
if (!tableElement || !rowElement || !editor.view.dom.contains(tableElement)) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const cellPosition = editor.view.posAtDOM(cell, 0);
|
|
17
|
+
const $cell = findCellPos(editor.state.doc, cellPosition);
|
|
18
|
+
if (!$cell)
|
|
19
|
+
return null;
|
|
20
|
+
const table = findTable($cell);
|
|
21
|
+
if (!table)
|
|
22
|
+
return null;
|
|
23
|
+
const map = TableMap.get(table.node);
|
|
24
|
+
const cellRect = map.findCell($cell.pos - table.start);
|
|
25
|
+
const tableRect = toRect(tableElement.getBoundingClientRect());
|
|
26
|
+
const rowRect = toRect(rowElement.getBoundingClientRect());
|
|
27
|
+
const columnRect = toRect(cell.getBoundingClientRect());
|
|
28
|
+
if (tableRect.width <= 0 ||
|
|
29
|
+
tableRect.height <= 0 ||
|
|
30
|
+
rowRect.width <= 0 ||
|
|
31
|
+
rowRect.height <= 0 ||
|
|
32
|
+
columnRect.width <= 0 ||
|
|
33
|
+
columnRect.height <= 0) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
kind: "column",
|
|
38
|
+
rowIndex: cellRect.top,
|
|
39
|
+
colIndex: cellRect.left,
|
|
40
|
+
tableElement,
|
|
41
|
+
tableRect,
|
|
42
|
+
tableContext: {
|
|
43
|
+
node: table.node,
|
|
44
|
+
pos: table.pos,
|
|
45
|
+
start: table.start,
|
|
46
|
+
map,
|
|
47
|
+
},
|
|
48
|
+
rowRect,
|
|
49
|
+
columnRect,
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export const getRailRect = (target, kind) => {
|
|
53
|
+
if (kind === "column") {
|
|
54
|
+
const width = target.columnRect.width;
|
|
55
|
+
const left = clamp(target.columnRect.left, VIEWPORT_PADDING, Math.max(VIEWPORT_PADDING, window.innerWidth - width - VIEWPORT_PADDING));
|
|
56
|
+
return {
|
|
57
|
+
top: Math.max(VIEWPORT_PADDING, target.tableRect.top - RAIL_THICKNESS),
|
|
58
|
+
left,
|
|
59
|
+
width,
|
|
60
|
+
height: RAIL_THICKNESS,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const height = target.rowRect.height;
|
|
64
|
+
const top = clamp(target.rowRect.top, VIEWPORT_PADDING, Math.max(VIEWPORT_PADDING, window.innerHeight - height - VIEWPORT_PADDING));
|
|
65
|
+
return {
|
|
66
|
+
top,
|
|
67
|
+
left: Math.max(VIEWPORT_PADDING, target.rowRect.left - RAIL_THICKNESS),
|
|
68
|
+
width: RAIL_THICKNESS,
|
|
69
|
+
height,
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export const getCornerRect = (target) => ({
|
|
73
|
+
top: Math.max(VIEWPORT_PADDING, target.tableRect.top - CORNER_BUTTON_SIZE),
|
|
74
|
+
left: Math.max(VIEWPORT_PADDING, target.tableRect.left - CORNER_BUTTON_SIZE),
|
|
75
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Node as ProseMirrorNode } from "@tiptap/pm/model";
|
|
2
|
+
import type { Editor } from "@tiptap/react";
|
|
3
|
+
import type { RailTarget } from "./TableTools.types";
|
|
4
|
+
export declare const clampTableSize: (value: number) => number;
|
|
5
|
+
export declare const hasTableExtension: (editor: Editor | null) => boolean;
|
|
6
|
+
export declare const isTableActive: (editor: Editor | null) => boolean;
|
|
7
|
+
export declare const getCellsInTarget: (target: RailTarget) => {
|
|
8
|
+
pos: number;
|
|
9
|
+
node: ProseMirrorNode;
|
|
10
|
+
}[];
|
|
11
|
+
export declare const getCellsInTableTarget: (target: RailTarget) => {
|
|
12
|
+
pos: number;
|
|
13
|
+
node: ProseMirrorNode;
|
|
14
|
+
}[];
|
|
15
|
+
export declare const hasRiskyMergedCells: (target: RailTarget) => boolean;
|
|
16
|
+
export declare const getTopRowIsHeader: (target: RailTarget) => boolean;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { rowIsHeader } from "@tiptap/pm/tables";
|
|
2
|
+
import { MAX_TABLE_SIZE, MIN_TABLE_SIZE } from "./TableTools.constants";
|
|
3
|
+
export const clampTableSize = (value) => {
|
|
4
|
+
if (Number.isNaN(value))
|
|
5
|
+
return MIN_TABLE_SIZE;
|
|
6
|
+
return Math.min(MAX_TABLE_SIZE, Math.max(MIN_TABLE_SIZE, value));
|
|
7
|
+
};
|
|
8
|
+
export const hasTableExtension = (editor) => Boolean(editor === null || editor === void 0 ? void 0 : editor.extensionManager.extensions.find((extension) => extension.name === "table"));
|
|
9
|
+
export const isTableActive = (editor) => Boolean((editor === null || editor === void 0 ? void 0 : editor.isActive("table")) ||
|
|
10
|
+
(editor === null || editor === void 0 ? void 0 : editor.isActive("tableRow")) ||
|
|
11
|
+
(editor === null || editor === void 0 ? void 0 : editor.isActive("tableCell")) ||
|
|
12
|
+
(editor === null || editor === void 0 ? void 0 : editor.isActive("tableHeader")));
|
|
13
|
+
export const getCellsInTarget = (target) => {
|
|
14
|
+
const { tableContext } = target;
|
|
15
|
+
return tableContext.map
|
|
16
|
+
.cellsInRect(target.kind === "row"
|
|
17
|
+
? {
|
|
18
|
+
left: 0,
|
|
19
|
+
right: tableContext.map.width,
|
|
20
|
+
top: target.rowIndex,
|
|
21
|
+
bottom: target.rowIndex + 1,
|
|
22
|
+
}
|
|
23
|
+
: {
|
|
24
|
+
left: target.colIndex,
|
|
25
|
+
right: target.colIndex + 1,
|
|
26
|
+
top: 0,
|
|
27
|
+
bottom: tableContext.map.height,
|
|
28
|
+
})
|
|
29
|
+
.map((pos) => ({
|
|
30
|
+
pos,
|
|
31
|
+
node: tableContext.node.nodeAt(pos),
|
|
32
|
+
}))
|
|
33
|
+
.filter((cell) => Boolean(cell.node));
|
|
34
|
+
};
|
|
35
|
+
export const getCellsInTableTarget = (target) => {
|
|
36
|
+
const { tableContext } = target;
|
|
37
|
+
return tableContext.map
|
|
38
|
+
.cellsInRect({
|
|
39
|
+
left: 0,
|
|
40
|
+
right: tableContext.map.width,
|
|
41
|
+
top: 0,
|
|
42
|
+
bottom: tableContext.map.height,
|
|
43
|
+
})
|
|
44
|
+
.map((pos) => ({
|
|
45
|
+
pos,
|
|
46
|
+
node: tableContext.node.nodeAt(pos),
|
|
47
|
+
}))
|
|
48
|
+
.filter((cell) => Boolean(cell.node));
|
|
49
|
+
};
|
|
50
|
+
export const hasRiskyMergedCells = (target) => {
|
|
51
|
+
return getCellsInTarget(target).some((cell) => cell.node.attrs.rowspan > 1 || cell.node.attrs.colspan > 1);
|
|
52
|
+
};
|
|
53
|
+
export const getTopRowIsHeader = (target) => rowIsHeader(target.tableContext.map, target.tableContext.node, 0);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { RailKind, RailRect } from "./TableTools.types";
|
|
2
|
+
export declare const TableToolsPanel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export declare const TableToolsSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
export declare const TableToolsSectionTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("../../../FieldLabel").FieldLabelProps, never>, never>> & string;
|
|
5
|
+
export declare const InsertGrid: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
6
|
+
export declare const Field: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
|
|
7
|
+
export declare const SwitchRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
8
|
+
export declare const RailRoot: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
9
|
+
$rect: RailRect;
|
|
10
|
+
$kind: RailKind;
|
|
11
|
+
}>> & string;
|
|
12
|
+
export declare const MenuPanel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
13
|
+
export declare const MenuDropdown: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("../../../Popover").PopoverDropdownProps, never>> & string & Omit<import("react").FC<import("../../../Popover").PopoverDropdownProps>, keyof import("react").Component<any, {}, any>>;
|
|
14
|
+
export declare const MenuGroup: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
15
|
+
$withDivider: boolean;
|
|
16
|
+
}>> & string;
|
|
17
|
+
export declare const MenuButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
18
|
+
ref?: import("react").RefObject<HTMLButtonElement>;
|
|
19
|
+
children?: import("react").ReactNode | string;
|
|
20
|
+
className?: string;
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
leftSection?: import("react").ReactNode;
|
|
23
|
+
rightSection?: import("react").ReactNode;
|
|
24
|
+
href?: string | null;
|
|
25
|
+
download?: string | null;
|
|
26
|
+
fullWidth?: boolean;
|
|
27
|
+
size?: import("../../../core").Size;
|
|
28
|
+
variant?: import("../../../core").Variant;
|
|
29
|
+
color?: import("../../../Button").ButtonColor;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
selected?: boolean;
|
|
32
|
+
justify?: "start" | "center" | "end";
|
|
33
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
34
|
+
}, {
|
|
35
|
+
$danger?: boolean;
|
|
36
|
+
}>> & string & Omit<import("react").FC<import("../../../Button").ButtonProps>, keyof import("react").Component<any, {}, any>>;
|
|
37
|
+
export declare const CornerRoot: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
38
|
+
$top: number;
|
|
39
|
+
$left: number;
|
|
40
|
+
}>> & string;
|