@lobehub/editor 4.17.0 → 4.17.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/es/headless.js
CHANGED
|
@@ -6852,10 +6852,12 @@ function ensureTableControllerDOM(element) {
|
|
|
6852
6852
|
if (legacyPlainToolbar instanceof HTMLElement) {
|
|
6853
6853
|
legacyPlainToolbar.className = "toolbar-row";
|
|
6854
6854
|
markTableControllerHost(legacyPlainToolbar, true);
|
|
6855
|
-
|
|
6855
|
+
scrollWrapper.append(legacyPlainToolbar);
|
|
6856
6856
|
}
|
|
6857
|
+
const legacyOuterRowToolbar = element.querySelector(":scope > .toolbar-row");
|
|
6858
|
+
if (legacyOuterRowToolbar instanceof HTMLElement) scrollWrapper.append(legacyOuterRowToolbar);
|
|
6857
6859
|
ensureToolbar(scrollWrapper, "toolbar-col", true);
|
|
6858
|
-
ensureToolbar(
|
|
6860
|
+
ensureToolbar(scrollWrapper, "toolbar-row", true);
|
|
6859
6861
|
ensureTableScrollIndicators(scrollWrapper);
|
|
6860
6862
|
}
|
|
6861
6863
|
function reconcileTableDecorator(editor, node, decorator) {
|
|
@@ -86,10 +86,12 @@ function ensureTableControllerDOM(element) {
|
|
|
86
86
|
if (legacyPlainToolbar instanceof HTMLElement) {
|
|
87
87
|
legacyPlainToolbar.className = "toolbar-row";
|
|
88
88
|
markTableControllerHost(legacyPlainToolbar, true);
|
|
89
|
-
|
|
89
|
+
scrollWrapper.append(legacyPlainToolbar);
|
|
90
90
|
}
|
|
91
|
+
const legacyOuterRowToolbar = element.querySelector(":scope > .toolbar-row");
|
|
92
|
+
if (legacyOuterRowToolbar instanceof HTMLElement) scrollWrapper.append(legacyOuterRowToolbar);
|
|
91
93
|
ensureToolbar(scrollWrapper, "toolbar-col", true);
|
|
92
|
-
ensureToolbar(
|
|
94
|
+
ensureToolbar(scrollWrapper, "toolbar-row", true);
|
|
93
95
|
ensureTableScrollIndicators(scrollWrapper);
|
|
94
96
|
}
|
|
95
97
|
function reconcileTableDecorator(editor, node, decorator) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTranslation } from "../../../../editor-kernel/react/useTranslation.js";
|
|
2
2
|
import { $canUnmerge, $selectLastDescendant, computeSelectionCount, currentCellBackgroundColor } from "./utils.js";
|
|
3
|
-
import {
|
|
3
|
+
import { DropdownMenu } from "@lobehub/ui";
|
|
4
4
|
import { Grid2X2XIcon, PanelBottomCloseIcon, PanelLeftCloseIcon, PanelRightCloseIcon, PanelTopCloseIcon, TableColumnsSplitIcon, TableRowsSplitIcon } from "lucide-react";
|
|
5
5
|
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -221,8 +221,8 @@ const TableActionMenu = memo(({ editor, tableCellNode: _tableCellNode, cellMerge
|
|
|
221
221
|
tableCellNode,
|
|
222
222
|
clearTableSelection
|
|
223
223
|
]);
|
|
224
|
-
return /* @__PURE__ */ jsx(
|
|
225
|
-
|
|
224
|
+
return /* @__PURE__ */ jsx(DropdownMenu, {
|
|
225
|
+
items: useMemo(() => {
|
|
226
226
|
return [
|
|
227
227
|
{
|
|
228
228
|
icon: PanelTopCloseIcon,
|
|
@@ -287,7 +287,7 @@ const TableActionMenu = memo(({ editor, tableCellNode: _tableCellNode, cellMerge
|
|
|
287
287
|
renderDeleteMenuLabel,
|
|
288
288
|
toggleTableRowIsHeader,
|
|
289
289
|
toggleTableColumnIsHeader
|
|
290
|
-
])
|
|
290
|
+
]),
|
|
291
291
|
children
|
|
292
292
|
});
|
|
293
293
|
});
|
|
@@ -9,6 +9,7 @@ const styles = createStaticStyles(({ css, cssVar }) => css`
|
|
|
9
9
|
.lobe-editor-table-scroll-wrapper {
|
|
10
10
|
position: relative;
|
|
11
11
|
overflow: auto visible;
|
|
12
|
+
margin-inline: calc(var(--lobe-block-anchor-padding, 54px) * -1);
|
|
12
13
|
padding-block-start: 14px;
|
|
13
14
|
}
|
|
14
15
|
|
|
@@ -62,6 +63,11 @@ const styles = createStaticStyles(({ css, cssVar }) => css`
|
|
|
62
63
|
height: 0;
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
.toolbar-col,
|
|
67
|
+
.toolbar-row {
|
|
68
|
+
inset-inline-start: var(--lobe-block-anchor-padding, 54px);
|
|
69
|
+
}
|
|
70
|
+
|
|
65
71
|
.table-controller,
|
|
66
72
|
.table-controller-col,
|
|
67
73
|
.table-controller-row {
|
|
@@ -83,6 +89,7 @@ const styles = createStaticStyles(({ css, cssVar }) => css`
|
|
|
83
89
|
border-collapse: collapse;
|
|
84
90
|
|
|
85
91
|
width: fit-content;
|
|
92
|
+
margin-inline: var(--lobe-block-anchor-padding, 54px);
|
|
86
93
|
|
|
87
94
|
text-align: start;
|
|
88
95
|
text-indent: initial;
|
package/package.json
CHANGED