@underverse-ui/underverse 1.0.73 → 1.0.74
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/api-reference.json +1 -1
- package/dist/index.cjs +300 -245
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +301 -246
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22487,16 +22487,22 @@ var EmojiList = forwardRef14((props, ref) => {
|
|
|
22487
22487
|
] }) }),
|
|
22488
22488
|
/* @__PURE__ */ jsxs63("div", { className: "p-3", children: [
|
|
22489
22489
|
/* @__PURE__ */ jsx74("div", { className: "grid grid-cols-8 gap-1", children: props.items.slice(0, 64).map((item, index) => /* @__PURE__ */ jsx74(
|
|
22490
|
-
|
|
22490
|
+
Tooltip,
|
|
22491
22491
|
{
|
|
22492
|
-
|
|
22493
|
-
|
|
22494
|
-
|
|
22495
|
-
"
|
|
22496
|
-
|
|
22497
|
-
|
|
22498
|
-
|
|
22499
|
-
|
|
22492
|
+
placement: "top",
|
|
22493
|
+
content: /* @__PURE__ */ jsx74("span", { className: "text-xs font-medium", children: item.name.replace(/_/g, " ") }),
|
|
22494
|
+
children: /* @__PURE__ */ jsx74(
|
|
22495
|
+
"button",
|
|
22496
|
+
{
|
|
22497
|
+
type: "button",
|
|
22498
|
+
onClick: () => props.command(item),
|
|
22499
|
+
className: cn(
|
|
22500
|
+
"w-9 h-9 flex items-center justify-center rounded-lg text-xl transition-colors",
|
|
22501
|
+
selectedIndex === index ? "bg-primary/10 ring-2 ring-primary/30" : "hover:bg-accent"
|
|
22502
|
+
),
|
|
22503
|
+
children: item.emoji
|
|
22504
|
+
}
|
|
22505
|
+
)
|
|
22500
22506
|
},
|
|
22501
22507
|
item.name
|
|
22502
22508
|
)) }),
|
|
@@ -23159,7 +23165,7 @@ var EditorColorPalette = ({
|
|
|
23159
23165
|
label
|
|
23160
23166
|
}) => /* @__PURE__ */ jsxs65("div", { className: "p-2", children: [
|
|
23161
23167
|
/* @__PURE__ */ jsx76("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider px-2", children: label }),
|
|
23162
|
-
/* @__PURE__ */ jsx76("div", { className: "grid grid-cols-4 gap-1.5 mt-2", children: colors.map((c) => /* @__PURE__ */ jsxs65(
|
|
23168
|
+
/* @__PURE__ */ jsx76("div", { className: "grid grid-cols-4 gap-1.5 mt-2", children: colors.map((c) => /* @__PURE__ */ jsx76(Tooltip, { placement: "top", content: /* @__PURE__ */ jsx76("span", { className: "text-xs font-medium", children: c.name }), children: /* @__PURE__ */ jsxs65(
|
|
23163
23169
|
"button",
|
|
23164
23170
|
{
|
|
23165
23171
|
type: "button",
|
|
@@ -23170,14 +23176,12 @@ var EditorColorPalette = ({
|
|
|
23170
23176
|
currentColor === c.color ? "border-primary ring-2 ring-primary/20" : "border-border/50 hover:border-primary/50"
|
|
23171
23177
|
),
|
|
23172
23178
|
style: { backgroundColor: c.color || "transparent" },
|
|
23173
|
-
title: c.name,
|
|
23174
23179
|
children: [
|
|
23175
23180
|
c.color === "" && /* @__PURE__ */ jsx76(X18, { className: "w-4 h-4 text-muted-foreground" }),
|
|
23176
23181
|
c.color === "inherit" && /* @__PURE__ */ jsx76("span", { className: "text-xs font-medium", children: "A" })
|
|
23177
23182
|
]
|
|
23178
|
-
}
|
|
23179
|
-
|
|
23180
|
-
)) })
|
|
23183
|
+
}
|
|
23184
|
+
) }, c.name)) })
|
|
23181
23185
|
] });
|
|
23182
23186
|
|
|
23183
23187
|
// src/components/UEditor/image-commands.ts
|
|
@@ -23372,17 +23376,17 @@ var ImageInput = ({ onSubmit, onCancel }) => {
|
|
|
23372
23376
|
};
|
|
23373
23377
|
|
|
23374
23378
|
// src/components/UEditor/emoji-picker.tsx
|
|
23375
|
-
import {
|
|
23376
|
-
import {
|
|
23379
|
+
import { Dumbbell as Dumbbell2, Flag as Flag2, Hash as Hash2, Leaf as Leaf2, Lightbulb as Lightbulb2, Search as Search7, Smile as Smile3, Utensils as Utensils2, X as X20 } from "lucide-react";
|
|
23380
|
+
import { useEffect as useEffect33, useMemo as useMemo23, useRef as useRef29, useState as useState43 } from "react";
|
|
23377
23381
|
import { jsx as jsx78, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
23378
23382
|
var CATEGORY_ICONS2 = {
|
|
23379
|
-
|
|
23380
|
-
|
|
23381
|
-
|
|
23382
|
-
|
|
23383
|
-
|
|
23384
|
-
|
|
23385
|
-
|
|
23383
|
+
smileys_people: Smile3,
|
|
23384
|
+
animals_nature: Leaf2,
|
|
23385
|
+
food_drink: Utensils2,
|
|
23386
|
+
activity: Dumbbell2,
|
|
23387
|
+
objects: Lightbulb2,
|
|
23388
|
+
symbols: Hash2,
|
|
23389
|
+
flags: Flag2
|
|
23386
23390
|
};
|
|
23387
23391
|
var EmojiPicker2 = ({ onSelect, onClose }) => {
|
|
23388
23392
|
const t = useSmartTranslations("UEditor");
|
|
@@ -23396,9 +23400,7 @@ var EmojiPicker2 = ({ onSelect, onClose }) => {
|
|
|
23396
23400
|
const query = search.toLowerCase();
|
|
23397
23401
|
return EMOJI_LIST.map((category) => ({
|
|
23398
23402
|
...category,
|
|
23399
|
-
emojis: category.emojis.filter(
|
|
23400
|
-
(emoji) => emoji.name.toLowerCase().includes(query) || emoji.emoji.includes(search)
|
|
23401
|
-
)
|
|
23403
|
+
emojis: category.emojis.filter((emoji) => emoji.name.toLowerCase().includes(query) || emoji.emoji.includes(search))
|
|
23402
23404
|
})).filter((category) => category.emojis.length > 0);
|
|
23403
23405
|
}, [search]);
|
|
23404
23406
|
const handleEmojiClick = (emoji) => {
|
|
@@ -23466,26 +23468,40 @@ var EmojiPicker2 = ({ onSelect, onClose }) => {
|
|
|
23466
23468
|
)
|
|
23467
23469
|
}
|
|
23468
23470
|
),
|
|
23469
|
-
search && /* @__PURE__ */ jsx78(
|
|
23470
|
-
"button",
|
|
23471
|
-
{
|
|
23472
|
-
onClick: () => setSearch(""),
|
|
23473
|
-
className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",
|
|
23474
|
-
children: /* @__PURE__ */ jsx78(X20, { className: "w-4 h-4" })
|
|
23475
|
-
}
|
|
23476
|
-
)
|
|
23471
|
+
search && /* @__PURE__ */ jsx78("button", { onClick: () => setSearch(""), className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ jsx78(X20, { className: "w-4 h-4" }) })
|
|
23477
23472
|
] }) }),
|
|
23478
|
-
/* @__PURE__ */ jsx78(
|
|
23479
|
-
|
|
23480
|
-
{
|
|
23481
|
-
|
|
23482
|
-
className: "
|
|
23483
|
-
|
|
23484
|
-
|
|
23485
|
-
|
|
23486
|
-
|
|
23487
|
-
|
|
23488
|
-
|
|
23473
|
+
/* @__PURE__ */ jsx78("div", { ref: scrollContainerRef, className: "overflow-y-auto px-3 py-2 shrink", style: { height: "20rem" }, children: search ? (
|
|
23474
|
+
// Search Results
|
|
23475
|
+
filteredCategories.length > 0 ? filteredCategories.map((category) => /* @__PURE__ */ jsxs67("div", { className: "mb-4", children: [
|
|
23476
|
+
/* @__PURE__ */ jsx78("div", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2 sticky top-0 bg-card py-1", children: category.name }),
|
|
23477
|
+
/* @__PURE__ */ jsx78("div", { className: "grid grid-cols-9 gap-1", children: category.emojis.map((emoji) => /* @__PURE__ */ jsx78(Tooltip, { placement: "top", content: /* @__PURE__ */ jsx78("span", { className: "text-xs font-medium", children: emoji.name.replace(/_/g, " ") }), children: /* @__PURE__ */ jsx78(
|
|
23478
|
+
"button",
|
|
23479
|
+
{
|
|
23480
|
+
onClick: () => handleEmojiClick(emoji.emoji),
|
|
23481
|
+
className: cn(
|
|
23482
|
+
"w-9 h-9 flex items-center justify-center rounded-lg",
|
|
23483
|
+
"text-2xl hover:bg-accent transition-colors",
|
|
23484
|
+
"focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
23485
|
+
),
|
|
23486
|
+
children: emoji.emoji
|
|
23487
|
+
}
|
|
23488
|
+
) }, emoji.name)) })
|
|
23489
|
+
] }, category.id)) : /* @__PURE__ */ jsxs67("div", { className: "flex flex-col items-center justify-center h-full text-center", children: [
|
|
23490
|
+
/* @__PURE__ */ jsx78("div", { className: "text-4xl mb-2", children: "\u{1F50D}" }),
|
|
23491
|
+
/* @__PURE__ */ jsx78("div", { className: "text-sm font-medium text-muted-foreground", children: t("emojiPicker.noResults") }),
|
|
23492
|
+
/* @__PURE__ */ jsx78("div", { className: "text-xs text-muted-foreground mt-1", children: t("emojiPicker.tryDifferentSearch") })
|
|
23493
|
+
] })
|
|
23494
|
+
) : (
|
|
23495
|
+
// All Categories - Messenger Style
|
|
23496
|
+
/* @__PURE__ */ jsx78("div", { className: "space-y-4", children: EMOJI_LIST.map((category) => /* @__PURE__ */ jsxs67(
|
|
23497
|
+
"div",
|
|
23498
|
+
{
|
|
23499
|
+
ref: (el) => {
|
|
23500
|
+
categoryRefs.current[category.id] = el;
|
|
23501
|
+
},
|
|
23502
|
+
children: [
|
|
23503
|
+
/* @__PURE__ */ jsx78("div", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2 sticky top-0 bg-card py-1 z-10", children: category.name }),
|
|
23504
|
+
/* @__PURE__ */ jsx78("div", { className: "grid grid-cols-9 gap-1", children: category.emojis.map((emoji) => /* @__PURE__ */ jsx78(Tooltip, { placement: "top", content: /* @__PURE__ */ jsx78("span", { className: "text-xs font-medium", children: emoji.name.replace(/_/g, " ") }), children: /* @__PURE__ */ jsx78(
|
|
23489
23505
|
"button",
|
|
23490
23506
|
{
|
|
23491
23507
|
onClick: () => handleEmojiClick(emoji.emoji),
|
|
@@ -23494,47 +23510,14 @@ var EmojiPicker2 = ({ onSelect, onClose }) => {
|
|
|
23494
23510
|
"text-2xl hover:bg-accent transition-colors",
|
|
23495
23511
|
"focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
23496
23512
|
),
|
|
23497
|
-
title: emoji.name.replace(/_/g, " "),
|
|
23498
23513
|
children: emoji.emoji
|
|
23499
|
-
}
|
|
23500
|
-
|
|
23501
|
-
|
|
23502
|
-
|
|
23503
|
-
|
|
23504
|
-
|
|
23505
|
-
|
|
23506
|
-
] })
|
|
23507
|
-
) : (
|
|
23508
|
-
// All Categories - Messenger Style
|
|
23509
|
-
/* @__PURE__ */ jsx78("div", { className: "space-y-4", children: EMOJI_LIST.map((category) => /* @__PURE__ */ jsxs67(
|
|
23510
|
-
"div",
|
|
23511
|
-
{
|
|
23512
|
-
ref: (el) => {
|
|
23513
|
-
categoryRefs.current[category.id] = el;
|
|
23514
|
-
},
|
|
23515
|
-
children: [
|
|
23516
|
-
/* @__PURE__ */ jsx78("div", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2 sticky top-0 bg-card py-1 z-10", children: category.name }),
|
|
23517
|
-
/* @__PURE__ */ jsx78("div", { className: "grid grid-cols-9 gap-1", children: category.emojis.map((emoji) => /* @__PURE__ */ jsx78(
|
|
23518
|
-
"button",
|
|
23519
|
-
{
|
|
23520
|
-
onClick: () => handleEmojiClick(emoji.emoji),
|
|
23521
|
-
className: cn(
|
|
23522
|
-
"w-9 h-9 flex items-center justify-center rounded-lg",
|
|
23523
|
-
"text-2xl hover:bg-accent transition-colors",
|
|
23524
|
-
"focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
23525
|
-
),
|
|
23526
|
-
title: emoji.name.replace(/_/g, " "),
|
|
23527
|
-
children: emoji.emoji
|
|
23528
|
-
},
|
|
23529
|
-
emoji.name
|
|
23530
|
-
)) })
|
|
23531
|
-
]
|
|
23532
|
-
},
|
|
23533
|
-
category.id
|
|
23534
|
-
)) })
|
|
23535
|
-
)
|
|
23536
|
-
}
|
|
23537
|
-
),
|
|
23514
|
+
}
|
|
23515
|
+
) }, emoji.name)) })
|
|
23516
|
+
]
|
|
23517
|
+
},
|
|
23518
|
+
category.id
|
|
23519
|
+
)) })
|
|
23520
|
+
) }),
|
|
23538
23521
|
!search && /* @__PURE__ */ jsx78("div", { className: "flex items-center justify-around px-2 py-2 border-t bg-muted/30 shrink-0", children: EMOJI_LIST.map((category) => {
|
|
23539
23522
|
const IconComponent = CATEGORY_ICONS2[category.id] || Smile3;
|
|
23540
23523
|
return /* @__PURE__ */ jsx78(
|
|
@@ -23545,8 +23528,7 @@ var EmojiPicker2 = ({ onSelect, onClose }) => {
|
|
|
23545
23528
|
"p-2 rounded-lg transition-colors",
|
|
23546
23529
|
activeCategory === category.id ? "text-primary bg-primary/10" : "text-muted-foreground hover:text-foreground hover:bg-accent"
|
|
23547
23530
|
),
|
|
23548
|
-
|
|
23549
|
-
children: /* @__PURE__ */ jsx78(IconComponent, { className: "w-5 h-5" })
|
|
23531
|
+
children: /* @__PURE__ */ jsx78(Tooltip, { placement: "top", content: /* @__PURE__ */ jsx78("span", { className: "text-xs font-medium", children: category.name }), children: /* @__PURE__ */ jsx78("span", { className: "inline-flex", children: /* @__PURE__ */ jsx78(IconComponent, { className: "w-5 h-5" }) }) })
|
|
23550
23532
|
},
|
|
23551
23533
|
category.id
|
|
23552
23534
|
);
|
|
@@ -29049,12 +29031,23 @@ function buildLayout(editor, surface, cell) {
|
|
|
29049
29031
|
}
|
|
29050
29032
|
const surfaceRect = surface.getBoundingClientRect();
|
|
29051
29033
|
const tableRect = table.getBoundingClientRect();
|
|
29034
|
+
const wrapperElement = table.closest(".tableWrapper");
|
|
29035
|
+
const wrapper = wrapperElement instanceof HTMLElement ? wrapperElement : null;
|
|
29036
|
+
const wrapperRect = wrapper?.getBoundingClientRect() ?? tableRect;
|
|
29052
29037
|
const tableLeft = tableRect.left - surfaceRect.left + surface.scrollLeft;
|
|
29053
29038
|
const tableTop = tableRect.top - surfaceRect.top + surface.scrollTop;
|
|
29054
29039
|
const avgRowHeight = metricOrFallback(tableRect.height / rows.length, FALLBACK_TABLE_ROW_HEIGHT);
|
|
29055
29040
|
const avgColumnWidth = metricOrFallback(tableRect.width / referenceCells.length, FALLBACK_TABLE_COLUMN_WIDTH);
|
|
29056
29041
|
const tableWidth = metricOrFallback(tableRect.width, avgColumnWidth * referenceCells.length);
|
|
29057
29042
|
const tableHeight = metricOrFallback(tableRect.height, avgRowHeight * rows.length);
|
|
29043
|
+
const wrapperLeft = wrapperRect.left - surfaceRect.left + surface.scrollLeft;
|
|
29044
|
+
const wrapperTop = wrapperRect.top - surfaceRect.top + surface.scrollTop;
|
|
29045
|
+
const wrapperWidth = metricOrFallback(wrapperRect.width, tableWidth);
|
|
29046
|
+
const wrapperHeight = metricOrFallback(wrapperRect.height, tableHeight);
|
|
29047
|
+
const viewportWidth = metricOrFallback(wrapper?.clientWidth ?? wrapperRect.width, tableWidth);
|
|
29048
|
+
const viewportHeight = metricOrFallback(wrapper?.clientHeight ?? wrapperRect.height, tableHeight);
|
|
29049
|
+
const verticalScrollbarWidth = Math.max(0, Math.round(wrapperWidth - viewportWidth));
|
|
29050
|
+
const horizontalScrollbarHeight = Math.max(0, Math.round(wrapperHeight - viewportHeight));
|
|
29058
29051
|
const rowHandles = rows.map((tableRow, index) => {
|
|
29059
29052
|
const rowRect = tableRow.getBoundingClientRect();
|
|
29060
29053
|
const anchorCell = tableRow.cells.item(0) ?? cornerCell;
|
|
@@ -29089,6 +29082,14 @@ function buildLayout(editor, surface, cell) {
|
|
|
29089
29082
|
tableTop,
|
|
29090
29083
|
tableWidth,
|
|
29091
29084
|
tableHeight,
|
|
29085
|
+
wrapperLeft,
|
|
29086
|
+
wrapperTop,
|
|
29087
|
+
wrapperWidth,
|
|
29088
|
+
wrapperHeight,
|
|
29089
|
+
viewportWidth,
|
|
29090
|
+
viewportHeight,
|
|
29091
|
+
horizontalScrollbarHeight,
|
|
29092
|
+
verticalScrollbarWidth,
|
|
29092
29093
|
avgRowHeight,
|
|
29093
29094
|
avgColumnWidth,
|
|
29094
29095
|
rowHandles,
|
|
@@ -29181,11 +29182,13 @@ function TableControls({ editor, containerRef }) {
|
|
|
29181
29182
|
const directAddRow = targetElement?.closest?.("[data-table-control='add-row']");
|
|
29182
29183
|
const directRowHandleIndex = directRowHandle instanceof HTMLElement ? Number.parseInt(directRowHandle.dataset.rowHandleIndex ?? "", 10) : Number.NaN;
|
|
29183
29184
|
const directColumnHandleIndex = directColumnHandle instanceof HTMLElement ? Number.parseInt(directColumnHandle.dataset.columnHandleIndex ?? "", 10) : Number.NaN;
|
|
29185
|
+
const visibleTableWidth2 = Math.min(activeLayout.tableWidth, activeLayout.viewportWidth);
|
|
29186
|
+
const visibleTableHeight2 = Math.min(activeLayout.tableHeight, activeLayout.viewportHeight);
|
|
29184
29187
|
const rowHandleIndex = Number.isFinite(directRowHandleIndex) ? directRowHandleIndex : activeLayout.rowHandles.find((rowHandle) => relativeX >= activeLayout.tableLeft - ROW_HANDLE_HOVER_WIDTH && relativeX <= activeLayout.tableLeft && Math.abs(relativeY - rowHandle.center) <= HANDLE_HOVER_RADIUS)?.index ?? null;
|
|
29185
29188
|
const columnHandleIndex = Number.isFinite(directColumnHandleIndex) ? directColumnHandleIndex : activeLayout.columnHandles.find((columnHandle) => relativeY >= activeLayout.tableTop - COLUMN_HANDLE_HOVER_HEIGHT && relativeY <= activeLayout.tableTop && Math.abs(relativeX - columnHandle.center) <= HANDLE_HOVER_RADIUS)?.index ?? null;
|
|
29186
29189
|
const menuVisible = Boolean(directTableMenu) || relativeX >= activeLayout.tableLeft - MENU_HOVER_PADDING && relativeX <= activeLayout.tableLeft + 42 && relativeY >= activeLayout.tableTop - COLUMN_HANDLE_HOVER_HEIGHT && relativeY <= activeLayout.tableTop + MENU_HOVER_PADDING;
|
|
29187
|
-
const addColumnVisible = Boolean(directAddColumn) || relativeX >= activeLayout.
|
|
29188
|
-
const addRowVisible = Boolean(directAddRow) || relativeY >= activeLayout.
|
|
29190
|
+
const addColumnVisible = Boolean(directAddColumn) || relativeX >= activeLayout.wrapperLeft + visibleTableWidth2 && relativeX <= activeLayout.wrapperLeft + visibleTableWidth2 + ADD_COLUMN_HOVER_WIDTH && relativeY >= activeLayout.wrapperTop && relativeY <= activeLayout.wrapperTop + visibleTableHeight2;
|
|
29191
|
+
const addRowVisible = Boolean(directAddRow) || relativeY >= activeLayout.wrapperTop + activeLayout.wrapperHeight && relativeY <= activeLayout.wrapperTop + activeLayout.wrapperHeight + ADD_ROW_HOVER_HEIGHT && relativeX >= activeLayout.wrapperLeft && relativeX <= activeLayout.wrapperLeft + visibleTableWidth2;
|
|
29189
29192
|
setHoverState((prev) => {
|
|
29190
29193
|
if (prev.menuVisible === menuVisible && prev.addColumnVisible === addColumnVisible && prev.addRowVisible === addRowVisible && prev.rowHandleIndex === rowHandleIndex && prev.columnHandleIndex === columnHandleIndex) {
|
|
29191
29194
|
return prev;
|
|
@@ -29538,10 +29541,12 @@ function TableControls({ editor, containerRef }) {
|
|
|
29538
29541
|
const menuLeft = Math.max(8, layout.tableLeft);
|
|
29539
29542
|
const rowHandleLeft = Math.max(8, layout.tableLeft - 66);
|
|
29540
29543
|
const columnHandleTop = Math.max(8, layout.tableTop - 14);
|
|
29541
|
-
const
|
|
29542
|
-
const
|
|
29543
|
-
const
|
|
29544
|
-
const
|
|
29544
|
+
const visibleTableWidth = Math.min(layout.tableWidth, layout.viewportWidth);
|
|
29545
|
+
const visibleTableHeight = Math.min(layout.tableHeight, layout.viewportHeight);
|
|
29546
|
+
const columnRailTop = layout.wrapperTop;
|
|
29547
|
+
const columnRailLeft = layout.wrapperLeft + visibleTableWidth + 8;
|
|
29548
|
+
const rowRailTop = layout.wrapperTop + layout.wrapperHeight + 8;
|
|
29549
|
+
const rowRailLeft = layout.wrapperLeft;
|
|
29545
29550
|
const expandPreviewWidth = dragPreview?.kind === "add-column" ? layout.tableWidth + dragPreview.previewCols * layout.avgColumnWidth : layout.tableWidth;
|
|
29546
29551
|
const expandPreviewHeight = dragPreview?.kind === "add-row" ? layout.tableHeight + dragPreview.previewRows * layout.avgRowHeight : layout.tableHeight;
|
|
29547
29552
|
const dragStatusText = dragPreview?.kind === "row" ? `${t("tableMenu.dragRow")} ${dragPreview.originIndex + 1} -> ${dragPreview.targetIndex + 1}` : dragPreview?.kind === "column" ? `${t("tableMenu.dragColumn")} ${dragPreview.originIndex + 1} -> ${dragPreview.targetIndex + 1}` : dragPreview?.kind === "add-row" ? `+${dragPreview.previewRows}R` : dragPreview?.kind === "add-column" ? `+${dragPreview.previewCols}C` : null;
|
|
@@ -29560,47 +29565,53 @@ function TableControls({ editor, containerRef }) {
|
|
|
29560
29565
|
left: rowHandleLeft
|
|
29561
29566
|
},
|
|
29562
29567
|
children: /* @__PURE__ */ jsx81(
|
|
29563
|
-
|
|
29568
|
+
Tooltip,
|
|
29564
29569
|
{
|
|
29565
29570
|
placement: "right",
|
|
29566
|
-
|
|
29567
|
-
|
|
29568
|
-
|
|
29569
|
-
},
|
|
29570
|
-
items: getRowHandleMenuItems(rowHandle),
|
|
29571
|
-
trigger: /* @__PURE__ */ jsx81(
|
|
29572
|
-
"button",
|
|
29571
|
+
content: /* @__PURE__ */ jsx81("span", { className: "text-xs font-medium", children: `${t("tableMenu.dragRow")} ${rowHandle.index + 1}` }),
|
|
29572
|
+
children: /* @__PURE__ */ jsx81("span", { className: "inline-flex", children: /* @__PURE__ */ jsx81(
|
|
29573
|
+
DropdownMenu,
|
|
29573
29574
|
{
|
|
29574
|
-
|
|
29575
|
-
|
|
29576
|
-
|
|
29577
|
-
|
|
29578
|
-
event.preventDefault();
|
|
29579
|
-
event.stopPropagation();
|
|
29580
|
-
setOpenMenuKey(null);
|
|
29581
|
-
dragStateRef.current = {
|
|
29582
|
-
kind: "row",
|
|
29583
|
-
originIndex: rowHandle.index,
|
|
29584
|
-
targetIndex: rowHandle.index,
|
|
29585
|
-
anchorPos: rowHandle.cellPos
|
|
29586
|
-
};
|
|
29587
|
-
setDragPreview({
|
|
29588
|
-
kind: "row",
|
|
29589
|
-
originIndex: rowHandle.index,
|
|
29590
|
-
targetIndex: rowHandle.index,
|
|
29591
|
-
targetStart: rowHandle.start,
|
|
29592
|
-
targetSize: rowHandle.size
|
|
29593
|
-
});
|
|
29594
|
-
document.body.style.cursor = "grabbing";
|
|
29575
|
+
placement: "right",
|
|
29576
|
+
isOpen: openMenuKey === menuKey,
|
|
29577
|
+
onOpenChange: (open) => {
|
|
29578
|
+
setOpenMenuKey((prev) => open ? menuKey : prev === menuKey ? null : prev);
|
|
29595
29579
|
},
|
|
29596
|
-
|
|
29597
|
-
|
|
29598
|
-
"
|
|
29599
|
-
|
|
29600
|
-
|
|
29601
|
-
|
|
29580
|
+
items: getRowHandleMenuItems(rowHandle),
|
|
29581
|
+
trigger: /* @__PURE__ */ jsx81(
|
|
29582
|
+
"button",
|
|
29583
|
+
{
|
|
29584
|
+
type: "button",
|
|
29585
|
+
"aria-label": `${t("tableMenu.dragRow")} ${rowHandle.index + 1}`,
|
|
29586
|
+
onMouseDown: (event) => {
|
|
29587
|
+
event.preventDefault();
|
|
29588
|
+
event.stopPropagation();
|
|
29589
|
+
setOpenMenuKey(null);
|
|
29590
|
+
dragStateRef.current = {
|
|
29591
|
+
kind: "row",
|
|
29592
|
+
originIndex: rowHandle.index,
|
|
29593
|
+
targetIndex: rowHandle.index,
|
|
29594
|
+
anchorPos: rowHandle.cellPos
|
|
29595
|
+
};
|
|
29596
|
+
setDragPreview({
|
|
29597
|
+
kind: "row",
|
|
29598
|
+
originIndex: rowHandle.index,
|
|
29599
|
+
targetIndex: rowHandle.index,
|
|
29600
|
+
targetStart: rowHandle.start,
|
|
29601
|
+
targetSize: rowHandle.size
|
|
29602
|
+
});
|
|
29603
|
+
document.body.style.cursor = "grabbing";
|
|
29604
|
+
},
|
|
29605
|
+
className: cn(
|
|
29606
|
+
"inline-flex h-6 w-6 items-center justify-center rounded-full",
|
|
29607
|
+
"border border-border/70 bg-background/95 text-muted-foreground shadow-sm backdrop-blur",
|
|
29608
|
+
"transition-[opacity,transform,colors] duration-150 hover:bg-accent hover:text-foreground"
|
|
29609
|
+
),
|
|
29610
|
+
children: /* @__PURE__ */ jsx81(GripVertical3, { className: "h-3.5 w-3.5" })
|
|
29611
|
+
}
|
|
29612
|
+
)
|
|
29602
29613
|
}
|
|
29603
|
-
)
|
|
29614
|
+
) })
|
|
29604
29615
|
}
|
|
29605
29616
|
)
|
|
29606
29617
|
},
|
|
@@ -29621,47 +29632,53 @@ function TableControls({ editor, containerRef }) {
|
|
|
29621
29632
|
left: Math.max(8, columnHandle.center - 12)
|
|
29622
29633
|
},
|
|
29623
29634
|
children: /* @__PURE__ */ jsx81(
|
|
29624
|
-
|
|
29635
|
+
Tooltip,
|
|
29625
29636
|
{
|
|
29626
|
-
placement: "
|
|
29627
|
-
|
|
29628
|
-
|
|
29629
|
-
|
|
29630
|
-
},
|
|
29631
|
-
items: getColumnHandleMenuItems(columnHandle),
|
|
29632
|
-
trigger: /* @__PURE__ */ jsx81(
|
|
29633
|
-
"button",
|
|
29637
|
+
placement: "top",
|
|
29638
|
+
content: /* @__PURE__ */ jsx81("span", { className: "text-xs font-medium", children: `${t("tableMenu.dragColumn")} ${columnHandle.index + 1}` }),
|
|
29639
|
+
children: /* @__PURE__ */ jsx81("span", { className: "inline-flex", children: /* @__PURE__ */ jsx81(
|
|
29640
|
+
DropdownMenu,
|
|
29634
29641
|
{
|
|
29635
|
-
|
|
29636
|
-
|
|
29637
|
-
|
|
29638
|
-
|
|
29639
|
-
event.preventDefault();
|
|
29640
|
-
event.stopPropagation();
|
|
29641
|
-
setOpenMenuKey(null);
|
|
29642
|
-
dragStateRef.current = {
|
|
29643
|
-
kind: "column",
|
|
29644
|
-
originIndex: columnHandle.index,
|
|
29645
|
-
targetIndex: columnHandle.index,
|
|
29646
|
-
anchorPos: columnHandle.cellPos
|
|
29647
|
-
};
|
|
29648
|
-
setDragPreview({
|
|
29649
|
-
kind: "column",
|
|
29650
|
-
originIndex: columnHandle.index,
|
|
29651
|
-
targetIndex: columnHandle.index,
|
|
29652
|
-
targetStart: columnHandle.start,
|
|
29653
|
-
targetSize: columnHandle.size
|
|
29654
|
-
});
|
|
29655
|
-
document.body.style.cursor = "grabbing";
|
|
29642
|
+
placement: "bottom-start",
|
|
29643
|
+
isOpen: openMenuKey === menuKey,
|
|
29644
|
+
onOpenChange: (open) => {
|
|
29645
|
+
setOpenMenuKey((prev) => open ? menuKey : prev === menuKey ? null : prev);
|
|
29656
29646
|
},
|
|
29657
|
-
|
|
29658
|
-
|
|
29659
|
-
"
|
|
29660
|
-
|
|
29661
|
-
|
|
29662
|
-
|
|
29647
|
+
items: getColumnHandleMenuItems(columnHandle),
|
|
29648
|
+
trigger: /* @__PURE__ */ jsx81(
|
|
29649
|
+
"button",
|
|
29650
|
+
{
|
|
29651
|
+
type: "button",
|
|
29652
|
+
"aria-label": `${t("tableMenu.dragColumn")} ${columnHandle.index + 1}`,
|
|
29653
|
+
onMouseDown: (event) => {
|
|
29654
|
+
event.preventDefault();
|
|
29655
|
+
event.stopPropagation();
|
|
29656
|
+
setOpenMenuKey(null);
|
|
29657
|
+
dragStateRef.current = {
|
|
29658
|
+
kind: "column",
|
|
29659
|
+
originIndex: columnHandle.index,
|
|
29660
|
+
targetIndex: columnHandle.index,
|
|
29661
|
+
anchorPos: columnHandle.cellPos
|
|
29662
|
+
};
|
|
29663
|
+
setDragPreview({
|
|
29664
|
+
kind: "column",
|
|
29665
|
+
originIndex: columnHandle.index,
|
|
29666
|
+
targetIndex: columnHandle.index,
|
|
29667
|
+
targetStart: columnHandle.start,
|
|
29668
|
+
targetSize: columnHandle.size
|
|
29669
|
+
});
|
|
29670
|
+
document.body.style.cursor = "grabbing";
|
|
29671
|
+
},
|
|
29672
|
+
className: cn(
|
|
29673
|
+
"inline-flex h-6 w-6 items-center justify-center rounded-full",
|
|
29674
|
+
"border border-border/70 bg-background/95 text-muted-foreground shadow-sm backdrop-blur",
|
|
29675
|
+
"transition-[opacity,transform,colors] duration-150 hover:bg-accent hover:text-foreground"
|
|
29676
|
+
),
|
|
29677
|
+
children: /* @__PURE__ */ jsx81(GripHorizontal, { className: "h-3.5 w-3.5" })
|
|
29678
|
+
}
|
|
29679
|
+
)
|
|
29663
29680
|
}
|
|
29664
|
-
)
|
|
29681
|
+
) })
|
|
29665
29682
|
}
|
|
29666
29683
|
)
|
|
29667
29684
|
},
|
|
@@ -29678,93 +29695,111 @@ function TableControls({ editor, containerRef }) {
|
|
|
29678
29695
|
left: menuLeft
|
|
29679
29696
|
},
|
|
29680
29697
|
children: /* @__PURE__ */ jsx81(
|
|
29681
|
-
|
|
29698
|
+
Tooltip,
|
|
29682
29699
|
{
|
|
29683
|
-
placement: "
|
|
29684
|
-
|
|
29685
|
-
|
|
29686
|
-
|
|
29687
|
-
},
|
|
29688
|
-
items: menuItems,
|
|
29689
|
-
trigger: /* @__PURE__ */ jsx81(
|
|
29690
|
-
"button",
|
|
29700
|
+
placement: "top",
|
|
29701
|
+
content: /* @__PURE__ */ jsx81("span", { className: "text-xs font-medium", children: t("tableMenu.openControls") }),
|
|
29702
|
+
children: /* @__PURE__ */ jsx81("span", { className: "inline-flex", children: /* @__PURE__ */ jsx81(
|
|
29703
|
+
DropdownMenu,
|
|
29691
29704
|
{
|
|
29692
|
-
|
|
29693
|
-
|
|
29694
|
-
|
|
29695
|
-
|
|
29696
|
-
|
|
29697
|
-
|
|
29698
|
-
|
|
29699
|
-
"
|
|
29700
|
-
|
|
29701
|
-
|
|
29705
|
+
placement: "bottom-start",
|
|
29706
|
+
isOpen: tableMenuOpen,
|
|
29707
|
+
onOpenChange: (open) => {
|
|
29708
|
+
setOpenMenuKey((prev) => open ? "table" : prev === "table" ? null : prev);
|
|
29709
|
+
},
|
|
29710
|
+
items: menuItems,
|
|
29711
|
+
trigger: /* @__PURE__ */ jsx81(
|
|
29712
|
+
"button",
|
|
29713
|
+
{
|
|
29714
|
+
type: "button",
|
|
29715
|
+
"aria-label": t("tableMenu.openControls"),
|
|
29716
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
29717
|
+
className: cn(
|
|
29718
|
+
"pointer-events-auto inline-flex h-7 w-7 items-center justify-center rounded-full",
|
|
29719
|
+
"border border-border/70 bg-background/95 text-muted-foreground shadow-sm backdrop-blur",
|
|
29720
|
+
"transition-[opacity,transform,colors] duration-150 hover:bg-accent hover:text-foreground"
|
|
29721
|
+
),
|
|
29722
|
+
children: /* @__PURE__ */ jsx81(MoreHorizontal2, { className: "h-4 w-4" })
|
|
29723
|
+
}
|
|
29724
|
+
)
|
|
29702
29725
|
}
|
|
29703
|
-
)
|
|
29726
|
+
) })
|
|
29704
29727
|
}
|
|
29705
29728
|
)
|
|
29706
29729
|
}
|
|
29707
29730
|
),
|
|
29708
29731
|
(controlsVisible || hoverState.addColumnVisible) && /* @__PURE__ */ jsx81(
|
|
29709
|
-
|
|
29732
|
+
Tooltip,
|
|
29710
29733
|
{
|
|
29711
|
-
|
|
29712
|
-
"
|
|
29713
|
-
|
|
29714
|
-
|
|
29715
|
-
|
|
29716
|
-
|
|
29717
|
-
|
|
29718
|
-
|
|
29719
|
-
|
|
29720
|
-
|
|
29721
|
-
|
|
29722
|
-
|
|
29723
|
-
|
|
29724
|
-
|
|
29725
|
-
|
|
29726
|
-
|
|
29727
|
-
|
|
29728
|
-
|
|
29729
|
-
|
|
29730
|
-
|
|
29731
|
-
|
|
29732
|
-
|
|
29733
|
-
|
|
29734
|
-
|
|
29735
|
-
|
|
29736
|
-
|
|
29734
|
+
placement: "right",
|
|
29735
|
+
content: /* @__PURE__ */ jsx81("span", { className: "text-xs font-medium", children: t("tableMenu.quickAddColumnAfter") }),
|
|
29736
|
+
children: /* @__PURE__ */ jsx81(
|
|
29737
|
+
"button",
|
|
29738
|
+
{
|
|
29739
|
+
type: "button",
|
|
29740
|
+
"data-table-control": "add-column",
|
|
29741
|
+
"aria-label": t("tableMenu.quickAddColumnAfter"),
|
|
29742
|
+
onMouseDown: (event) => {
|
|
29743
|
+
event.preventDefault();
|
|
29744
|
+
event.stopPropagation();
|
|
29745
|
+
setOpenMenuKey(null);
|
|
29746
|
+
if (!canExpandTable) return;
|
|
29747
|
+
dragStateRef.current = { kind: "add-column", previewCols: 1 };
|
|
29748
|
+
setDragPreview({ kind: "add-column", previewCols: 1 });
|
|
29749
|
+
document.body.style.cursor = "ew-resize";
|
|
29750
|
+
},
|
|
29751
|
+
disabled: !canExpandTable,
|
|
29752
|
+
className: cn(
|
|
29753
|
+
"absolute z-30 inline-flex items-center justify-center rounded-md",
|
|
29754
|
+
"border border-border/70 bg-muted/40 text-muted-foreground shadow-sm backdrop-blur",
|
|
29755
|
+
"transition-[opacity,transform,colors] duration-150 hover:bg-accent hover:text-foreground disabled:opacity-50 disabled:cursor-not-allowed"
|
|
29756
|
+
),
|
|
29757
|
+
style: {
|
|
29758
|
+
top: columnRailTop,
|
|
29759
|
+
left: columnRailLeft,
|
|
29760
|
+
width: 18,
|
|
29761
|
+
height: visibleTableHeight
|
|
29762
|
+
},
|
|
29763
|
+
children: /* @__PURE__ */ jsx81("span", { className: "text-sm font-medium leading-none", children: "+" })
|
|
29764
|
+
}
|
|
29765
|
+
)
|
|
29737
29766
|
}
|
|
29738
29767
|
),
|
|
29739
29768
|
(controlsVisible || hoverState.addRowVisible) && /* @__PURE__ */ jsx81(
|
|
29740
|
-
|
|
29769
|
+
Tooltip,
|
|
29741
29770
|
{
|
|
29742
|
-
|
|
29743
|
-
"
|
|
29744
|
-
|
|
29745
|
-
|
|
29746
|
-
|
|
29747
|
-
|
|
29748
|
-
|
|
29749
|
-
|
|
29750
|
-
|
|
29751
|
-
|
|
29752
|
-
|
|
29753
|
-
|
|
29754
|
-
|
|
29755
|
-
|
|
29756
|
-
|
|
29757
|
-
|
|
29758
|
-
|
|
29759
|
-
|
|
29760
|
-
|
|
29761
|
-
|
|
29762
|
-
|
|
29763
|
-
|
|
29764
|
-
|
|
29765
|
-
|
|
29766
|
-
|
|
29767
|
-
|
|
29771
|
+
placement: "bottom",
|
|
29772
|
+
content: /* @__PURE__ */ jsx81("span", { className: "text-xs font-medium", children: t("tableMenu.quickAddRowAfter") }),
|
|
29773
|
+
children: /* @__PURE__ */ jsx81(
|
|
29774
|
+
"button",
|
|
29775
|
+
{
|
|
29776
|
+
type: "button",
|
|
29777
|
+
"data-table-control": "add-row",
|
|
29778
|
+
"aria-label": t("tableMenu.quickAddRowAfter"),
|
|
29779
|
+
onMouseDown: (event) => {
|
|
29780
|
+
event.preventDefault();
|
|
29781
|
+
event.stopPropagation();
|
|
29782
|
+
setOpenMenuKey(null);
|
|
29783
|
+
if (!canExpandTable) return;
|
|
29784
|
+
dragStateRef.current = { kind: "add-row", previewRows: 1 };
|
|
29785
|
+
setDragPreview({ kind: "add-row", previewRows: 1 });
|
|
29786
|
+
document.body.style.cursor = "ns-resize";
|
|
29787
|
+
},
|
|
29788
|
+
disabled: !canExpandTable,
|
|
29789
|
+
className: cn(
|
|
29790
|
+
"absolute z-30 inline-flex items-center justify-center rounded-md",
|
|
29791
|
+
"border border-border/70 bg-muted/40 text-muted-foreground shadow-sm backdrop-blur",
|
|
29792
|
+
"transition-[opacity,transform,colors] duration-150 hover:bg-accent hover:text-foreground disabled:opacity-50 disabled:cursor-not-allowed"
|
|
29793
|
+
),
|
|
29794
|
+
style: {
|
|
29795
|
+
top: rowRailTop,
|
|
29796
|
+
left: rowRailLeft,
|
|
29797
|
+
width: visibleTableWidth,
|
|
29798
|
+
height: 16
|
|
29799
|
+
},
|
|
29800
|
+
children: /* @__PURE__ */ jsx81("span", { className: "text-sm font-medium leading-none", children: "+" })
|
|
29801
|
+
}
|
|
29802
|
+
)
|
|
29768
29803
|
}
|
|
29769
29804
|
),
|
|
29770
29805
|
dragPreview?.kind === "row" && /* @__PURE__ */ jsxs71(Fragment27, { children: [
|
|
@@ -30118,7 +30153,20 @@ var UEditor = React75.forwardRef(({
|
|
|
30118
30153
|
"[&_pre]:text-[#d4d4d4]!",
|
|
30119
30154
|
"[&_pre_code]:bg-transparent!",
|
|
30120
30155
|
"[&_.tableWrapper]:overflow-x-auto",
|
|
30156
|
+
"[&_.tableWrapper]:pb-1.5",
|
|
30121
30157
|
"[&_.tableWrapper]:select-text",
|
|
30158
|
+
"[&_.tableWrapper]:[scrollbar-width:thin]",
|
|
30159
|
+
"[&_.tableWrapper]:[scrollbar-color:hsl(var(--border))_transparent]",
|
|
30160
|
+
"[&_.tableWrapper::-webkit-scrollbar]:h-2",
|
|
30161
|
+
"[&_.tableWrapper::-webkit-scrollbar]:w-2",
|
|
30162
|
+
"[&_.tableWrapper::-webkit-scrollbar-track]:rounded-full",
|
|
30163
|
+
"[&_.tableWrapper::-webkit-scrollbar-track]:bg-transparent",
|
|
30164
|
+
"[&_.tableWrapper::-webkit-scrollbar-thumb]:rounded-full",
|
|
30165
|
+
"[&_.tableWrapper::-webkit-scrollbar-thumb]:border",
|
|
30166
|
+
"[&_.tableWrapper::-webkit-scrollbar-thumb]:border-solid",
|
|
30167
|
+
"[&_.tableWrapper::-webkit-scrollbar-thumb]:border-transparent",
|
|
30168
|
+
"[&_.tableWrapper::-webkit-scrollbar-thumb]:bg-border/70",
|
|
30169
|
+
"[&_.tableWrapper::-webkit-scrollbar-thumb:hover]:bg-muted-foreground/45",
|
|
30122
30170
|
"[&_table]:table-fixed",
|
|
30123
30171
|
"[&_table]:overflow-hidden",
|
|
30124
30172
|
"[&_table]:select-text",
|
|
@@ -30143,15 +30191,22 @@ var UEditor = React75.forwardRef(({
|
|
|
30143
30191
|
"[&_.column-resize-handle]:bottom-[-1px]",
|
|
30144
30192
|
"[&_.column-resize-handle]:right-[-5px]",
|
|
30145
30193
|
"[&_.column-resize-handle]:z-10",
|
|
30146
|
-
"[&_.column-resize-handle]:bg-primary/65",
|
|
30147
30194
|
"[&_.column-resize-handle]:w-2.5",
|
|
30148
|
-
"[&_.column-resize-handle]:
|
|
30195
|
+
"[&_.column-resize-handle]:bg-transparent",
|
|
30196
|
+
"[&_.column-resize-handle]:rounded-none",
|
|
30149
30197
|
"[&_.column-resize-handle]:opacity-0",
|
|
30150
|
-
"[&_.column-resize-handle]:
|
|
30151
|
-
"[&_.column-resize-handle]:
|
|
30198
|
+
"[&_.column-resize-handle]:transition-opacity",
|
|
30199
|
+
"[&_.column-resize-handle]:after:absolute",
|
|
30200
|
+
"[&_.column-resize-handle]:after:top-0",
|
|
30201
|
+
"[&_.column-resize-handle]:after:bottom-0",
|
|
30202
|
+
"[&_.column-resize-handle]:after:left-1/2",
|
|
30203
|
+
"[&_.column-resize-handle]:after:w-0.5",
|
|
30204
|
+
"[&_.column-resize-handle]:after:-translate-x-1/2",
|
|
30205
|
+
"[&_.column-resize-handle]:after:rounded-full",
|
|
30206
|
+
"[&_.column-resize-handle]:after:bg-primary/75",
|
|
30207
|
+
"[&_.column-resize-handle]:after:content-['']",
|
|
30152
30208
|
"[&.resize-cursor_.column-resize-handle]:opacity-100",
|
|
30153
|
-
"[&.resize-cursor_.column-resize-handle]:bg-primary",
|
|
30154
|
-
"[&.resize-cursor_.column-resize-handle]:shadow-md",
|
|
30209
|
+
"[&.resize-cursor_.column-resize-handle]:after:bg-primary",
|
|
30155
30210
|
"[&.resize-cursor]:cursor-col-resize",
|
|
30156
30211
|
"[&.resize-row-cursor]:cursor-row-resize",
|
|
30157
30212
|
"[&_img.ProseMirror-selectednode]:ring-2",
|