@underverse-ui/underverse 1.0.194 → 1.0.196
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 +1475 -1334
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1311 -1182
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -70,6 +70,13 @@ function getBorderRadiusClass(borderMode = "full") {
|
|
|
70
70
|
}
|
|
71
71
|
return borderMode;
|
|
72
72
|
}
|
|
73
|
+
function getPanelBorderRadiusClass(borderMode = "lg") {
|
|
74
|
+
const resolved = borderMode ?? "lg";
|
|
75
|
+
if (resolved === "full" || resolved === "infiniq") {
|
|
76
|
+
return "rounded-2xl";
|
|
77
|
+
}
|
|
78
|
+
return getBorderRadiusClass(resolved);
|
|
79
|
+
}
|
|
73
80
|
|
|
74
81
|
// src/contexts/UnderverseConfigContext.tsx
|
|
75
82
|
import * as React from "react";
|
|
@@ -501,7 +508,7 @@ var Card = React4.forwardRef(
|
|
|
501
508
|
ref,
|
|
502
509
|
className: cn(
|
|
503
510
|
"group bg-card text-card-foreground transition-[transform,box-shadow,border-color,background-color] duration-300 ease-soft",
|
|
504
|
-
resolvedBorderMode ?
|
|
511
|
+
resolvedBorderMode ? getPanelBorderRadiusClass(resolvedBorderMode) : "rounded-2xl md:rounded-3xl max-md:rounded-xl",
|
|
505
512
|
"border border-border/50 shadow-sm backdrop-blur-sm",
|
|
506
513
|
hoverable && "md:hover:-translate-y-0.5 md:hover:border-primary/15 md:hover:shadow-md",
|
|
507
514
|
clickable && "cursor-pointer active:translate-y-px active:bg-accent/5 md:hover:bg-accent/5 md:hover:shadow-md",
|
|
@@ -519,7 +526,7 @@ var Card = React4.forwardRef(
|
|
|
519
526
|
role: isInteractive ? role ?? "button" : role,
|
|
520
527
|
tabIndex: isInteractive ? tabIndex ?? 0 : tabIndex,
|
|
521
528
|
...rest,
|
|
522
|
-
children: /* @__PURE__ */ jsxs3("div", { className: cn("relative overflow-hidden", resolvedBorderMode ?
|
|
529
|
+
children: /* @__PURE__ */ jsxs3("div", { className: cn("relative overflow-hidden", resolvedBorderMode ? getPanelBorderRadiusClass(resolvedBorderMode) : "rounded-2xl md:rounded-3xl max-md:rounded-xl", innerClassName), children: [
|
|
523
530
|
(hoverable || clickable) && /* @__PURE__ */ jsx5(
|
|
524
531
|
"div",
|
|
525
532
|
{
|
|
@@ -6938,7 +6945,7 @@ var Modal = ({
|
|
|
6938
6945
|
ref: modalContentRef,
|
|
6939
6946
|
className: cn(
|
|
6940
6947
|
"relative w-full border border-border/40 bg-card text-card-foreground shadow-xl",
|
|
6941
|
-
resolvedBorderMode ?
|
|
6948
|
+
resolvedBorderMode ? getPanelBorderRadiusClass(resolvedBorderMode) : "rounded-2xl md:rounded-3xl",
|
|
6942
6949
|
"transition-all duration-200 ease-out",
|
|
6943
6950
|
maxWidthClass,
|
|
6944
6951
|
fullWidth && "mx-0",
|
|
@@ -7638,7 +7645,7 @@ var Popover = ({
|
|
|
7638
7645
|
{
|
|
7639
7646
|
...contentProps,
|
|
7640
7647
|
className: cn(
|
|
7641
|
-
resolvedBorderMode ?
|
|
7648
|
+
resolvedBorderMode ? getPanelBorderRadiusClass(resolvedBorderMode) : "rounded-2xl md:rounded-3xl",
|
|
7642
7649
|
"border bg-popover text-popover-foreground shadow-md",
|
|
7643
7650
|
"backdrop-blur-sm bg-popover/95 border-border/60 p-4",
|
|
7644
7651
|
contentProps?.className,
|
|
@@ -9233,7 +9240,7 @@ var Combobox = ({
|
|
|
9233
9240
|
{
|
|
9234
9241
|
"data-combobox-dropdown": true,
|
|
9235
9242
|
"data-state": open ? "open" : "closed",
|
|
9236
|
-
className: cn("w-full overflow-hidden",
|
|
9243
|
+
className: cn("w-full overflow-hidden", getPanelBorderRadiusClass(resolvedBorderMode)),
|
|
9237
9244
|
children: [
|
|
9238
9245
|
enableSearch && /* @__PURE__ */ jsx33("div", { className: cn("relative border-b border-border/30", size === "sm" ? "p-2" : size === "lg" ? "p-3" : "p-2.5"), children: /* @__PURE__ */ jsxs23("div", { className: "relative", children: [
|
|
9239
9246
|
/* @__PURE__ */ jsx33(
|
|
@@ -9429,8 +9436,9 @@ var Combobox = ({
|
|
|
9429
9436
|
}
|
|
9430
9437
|
},
|
|
9431
9438
|
className: cn(
|
|
9432
|
-
"opacity-0 group-hover:opacity-100 transition-all duration-200",
|
|
9433
|
-
"p-1 rounded-lg hover:bg-destructive/10 text-muted-foreground hover:text-destructive"
|
|
9439
|
+
"opacity-0 group-hover:opacity-100 focus-visible:opacity-100 transition-all duration-200",
|
|
9440
|
+
"p-1 rounded-lg hover:bg-destructive/10 text-muted-foreground hover:text-destructive",
|
|
9441
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-destructive/50 focus-visible:ring-offset-1"
|
|
9434
9442
|
),
|
|
9435
9443
|
children: /* @__PURE__ */ jsx33(X10, { className: "h-3.5 w-3.5" })
|
|
9436
9444
|
}
|
|
@@ -9504,14 +9512,14 @@ var Combobox = ({
|
|
|
9504
9512
|
trigger: triggerButtonForPopover,
|
|
9505
9513
|
placement: "bottom-start",
|
|
9506
9514
|
matchTriggerWidth: true,
|
|
9507
|
-
className: "z-
|
|
9515
|
+
className: "z-50",
|
|
9508
9516
|
borderMode: resolvedBorderMode,
|
|
9509
9517
|
contentClassName: "p-0 overflow-hidden",
|
|
9510
9518
|
children: dropdownBody
|
|
9511
9519
|
}
|
|
9512
9520
|
) : /* @__PURE__ */ jsxs23("div", { className: "relative", children: [
|
|
9513
9521
|
triggerButtonInline,
|
|
9514
|
-
open && /* @__PURE__ */ jsx33("div", { className: "absolute left-0 top-full mt-1 z-50 w-full", children: /* @__PURE__ */ jsx33("div", { className: cn("overflow-hidden border text-popover-foreground shadow-md backdrop-blur-sm bg-popover/95 border-border/60",
|
|
9522
|
+
open && /* @__PURE__ */ jsx33("div", { className: "absolute left-0 top-full mt-1 z-50 w-full", children: /* @__PURE__ */ jsx33("div", { className: cn("overflow-hidden border text-popover-foreground shadow-md backdrop-blur-sm bg-popover/95 border-border/60", getPanelBorderRadiusClass(resolvedBorderMode)), children: dropdownBody }) })
|
|
9515
9523
|
] }),
|
|
9516
9524
|
(helperText || effectiveError) && /* @__PURE__ */ jsxs23(
|
|
9517
9525
|
"p",
|
|
@@ -10484,32 +10492,6 @@ var DatePicker = ({
|
|
|
10484
10492
|
const node = el;
|
|
10485
10493
|
return node.scrollHeight > node.clientHeight + 1;
|
|
10486
10494
|
};
|
|
10487
|
-
React34.useEffect(() => {
|
|
10488
|
-
if (!isOpen) return;
|
|
10489
|
-
const container = wheelContainerRef.current;
|
|
10490
|
-
if (!container) return;
|
|
10491
|
-
const onWheel = (event) => {
|
|
10492
|
-
if (!container.contains(event.target)) return;
|
|
10493
|
-
if (event.ctrlKey) return;
|
|
10494
|
-
let node = event.target;
|
|
10495
|
-
while (node && node !== container) {
|
|
10496
|
-
if (isElementVerticallyScrollable(node)) return;
|
|
10497
|
-
node = node.parentElement;
|
|
10498
|
-
}
|
|
10499
|
-
if (isElementVerticallyScrollable(container)) return;
|
|
10500
|
-
event.preventDefault();
|
|
10501
|
-
event.stopPropagation();
|
|
10502
|
-
wheelDeltaRef.current += event.deltaY;
|
|
10503
|
-
const threshold = 70;
|
|
10504
|
-
if (Math.abs(wheelDeltaRef.current) < threshold) return;
|
|
10505
|
-
const steps = Math.trunc(wheelDeltaRef.current / threshold);
|
|
10506
|
-
wheelDeltaRef.current -= steps * threshold;
|
|
10507
|
-
const direction = steps > 0 ? "next" : "prev";
|
|
10508
|
-
for (let i = 0; i < Math.abs(steps); i++) navigateMonth(direction);
|
|
10509
|
-
};
|
|
10510
|
-
container.addEventListener("wheel", onWheel, { passive: false });
|
|
10511
|
-
return () => container.removeEventListener("wheel", onWheel);
|
|
10512
|
-
}, [isOpen, navigateMonth]);
|
|
10513
10495
|
const renderCalendar = () => {
|
|
10514
10496
|
const daysInMonth = getDaysInMonth(viewDate);
|
|
10515
10497
|
const firstDayOfMonth = getFirstDayOfMonth(viewDate);
|
|
@@ -10536,10 +10518,10 @@ var DatePicker = ({
|
|
|
10536
10518
|
},
|
|
10537
10519
|
className: cn(
|
|
10538
10520
|
sizeStyles8[size].dayCell,
|
|
10539
|
-
"datepicker-day rounded-lg
|
|
10540
|
-
"transition-all duration-200 font-medium",
|
|
10541
|
-
isDisabled && "opacity-30 cursor-not-allowed text-muted-foreground",
|
|
10542
|
-
isSelected ? "bg-linear-to-br from-primary to-primary/80 text-primary-foreground font-bold shadow-lg shadow-primary/30 scale-110 z-10 hover:from-primary hover:to-primary/70" : !isDisabled && "hover:bg-accent/80 hover:text-accent-foreground hover:scale-105 focus:
|
|
10521
|
+
"datepicker-day rounded-lg relative cursor-pointer",
|
|
10522
|
+
"transition-all duration-200 font-medium active:scale-95",
|
|
10523
|
+
isDisabled && "opacity-30 cursor-not-allowed text-muted-foreground active:scale-100",
|
|
10524
|
+
isSelected ? "bg-linear-to-br from-primary to-primary/80 text-primary-foreground font-bold shadow-lg shadow-primary/30 scale-110 z-10 hover:from-primary hover:to-primary/70 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus:outline-none" : !isDisabled && "hover:bg-accent/80 hover:text-accent-foreground hover:scale-105 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus:outline-none focus:bg-accent/90",
|
|
10543
10525
|
isToday2 && !isSelected && "bg-primary/15 text-primary font-bold ring-2 ring-primary/30"
|
|
10544
10526
|
),
|
|
10545
10527
|
children: [
|
|
@@ -10566,7 +10548,7 @@ var DatePicker = ({
|
|
|
10566
10548
|
setViewMode("calendar");
|
|
10567
10549
|
},
|
|
10568
10550
|
className: cn(
|
|
10569
|
-
"py-2 px-3 rounded-lg text-sm font-medium transition-all duration-200",
|
|
10551
|
+
"py-2 px-3 rounded-lg text-sm font-medium transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 active:scale-95",
|
|
10570
10552
|
isSelected ? "bg-primary text-primary-foreground shadow-md" : "hover:bg-accent/80 text-foreground hover:scale-105"
|
|
10571
10553
|
),
|
|
10572
10554
|
children: month
|
|
@@ -10590,7 +10572,7 @@ var DatePicker = ({
|
|
|
10590
10572
|
setViewMode("month");
|
|
10591
10573
|
},
|
|
10592
10574
|
className: cn(
|
|
10593
|
-
"py-2 px-3 rounded-lg text-sm font-medium transition-all duration-200",
|
|
10575
|
+
"py-2 px-3 rounded-lg text-sm font-medium transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 active:scale-95",
|
|
10594
10576
|
isSelected ? "bg-primary text-primary-foreground shadow-md" : "hover:bg-accent/80 text-foreground hover:scale-105"
|
|
10595
10577
|
),
|
|
10596
10578
|
children: year
|
|
@@ -19497,7 +19479,7 @@ var MultiCombobox = ({
|
|
|
19497
19479
|
item.value
|
|
19498
19480
|
);
|
|
19499
19481
|
};
|
|
19500
|
-
const dropdownBody = /* @__PURE__ */ jsxs37("div", { "data-combobox-dropdown": true, "data-state": open ? "open" : "closed", className: cn("w-full overflow-hidden",
|
|
19482
|
+
const dropdownBody = /* @__PURE__ */ jsxs37("div", { "data-combobox-dropdown": true, "data-state": open ? "open" : "closed", className: cn("w-full overflow-hidden", getPanelBorderRadiusClass(resolvedBorderMode)), children: [
|
|
19501
19483
|
value.length > 0 && /* @__PURE__ */ jsxs37("div", { className: "px-3 py-2 border-b border-border/40 flex items-center justify-between bg-muted/30", children: [
|
|
19502
19484
|
/* @__PURE__ */ jsx50("span", { className: "text-xs font-medium text-muted-foreground", children: maxSelected ? gi18n.selectedCountWithMax ? gi18n.selectedCountWithMax(value.length, maxSelected) : `${value.length} / ${maxSelected} max` : gi18n.itemSelectedCount ? gi18n.itemSelectedCount(value.length) : `${value.length} selected` }),
|
|
19503
19485
|
showClear && /* @__PURE__ */ jsxs37(
|
|
@@ -23113,7 +23095,7 @@ function Carousel({
|
|
|
23113
23095
|
{
|
|
23114
23096
|
onClick: () => scrollTo(idx),
|
|
23115
23097
|
className: cn(
|
|
23116
|
-
"rounded-full transition-all focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
23098
|
+
"rounded-full transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 active:scale-75 active:opacity-70",
|
|
23117
23099
|
"max-md:w-1.5 max-md:h-1.5",
|
|
23118
23100
|
isHorizontal ? "w-2 h-2" : "w-2 h-2",
|
|
23119
23101
|
idx === currentIndex ? `bg-primary ${isHorizontal ? "w-6 max-md:w-4" : "h-6 max-md:h-4"}` : "bg-muted-foreground/50 hover:bg-muted-foreground/75"
|
|
@@ -23139,7 +23121,7 @@ function Carousel({
|
|
|
23139
23121
|
{
|
|
23140
23122
|
onClick: () => scrollTo(idx),
|
|
23141
23123
|
className: cn(
|
|
23142
|
-
"shrink-0 w-16 h-16 rounded-lg overflow-hidden border-2 transition-all focus:
|
|
23124
|
+
"shrink-0 w-16 h-16 rounded-lg overflow-hidden border-2 transition-all focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus:outline-none active:scale-95",
|
|
23143
23125
|
"max-md:w-12 max-md:h-12",
|
|
23144
23126
|
idx === currentIndex ? "border-primary md:scale-110" : "border-transparent opacity-70 hover:opacity-100"
|
|
23145
23127
|
),
|
|
@@ -25424,7 +25406,7 @@ var TableContainer = React59.forwardRef(({ className, useOverlayScrollbar = fals
|
|
|
25424
25406
|
},
|
|
25425
25407
|
className: cn(
|
|
25426
25408
|
TABLE_CONTAINER_BASE_CLASS,
|
|
25427
|
-
resolvedBorderMode ?
|
|
25409
|
+
resolvedBorderMode ? getPanelBorderRadiusClass(resolvedBorderMode) : "rounded-2xl md:rounded-3xl",
|
|
25428
25410
|
className
|
|
25429
25411
|
),
|
|
25430
25412
|
...props
|
|
@@ -27824,7 +27806,7 @@ function useLocale2() {
|
|
|
27824
27806
|
}
|
|
27825
27807
|
|
|
27826
27808
|
// src/components/UEditor/UEditor.tsx
|
|
27827
|
-
import
|
|
27809
|
+
import React91, { useEffect as useEffect42, useImperativeHandle as useImperativeHandle4, useMemo as useMemo27, useRef as useRef41 } from "react";
|
|
27828
27810
|
import { useEditor, EditorContent } from "@tiptap/react";
|
|
27829
27811
|
|
|
27830
27812
|
// src/components/UEditor/extensions.ts
|
|
@@ -32459,7 +32441,7 @@ function buildUEditorExtensions({
|
|
|
32459
32441
|
}
|
|
32460
32442
|
|
|
32461
32443
|
// src/components/UEditor/toolbar.tsx
|
|
32462
|
-
import
|
|
32444
|
+
import React84, { useRef as useRef34, useState as useState50 } from "react";
|
|
32463
32445
|
import { useEditorState } from "@tiptap/react";
|
|
32464
32446
|
import {
|
|
32465
32447
|
AlignCenter,
|
|
@@ -32470,35 +32452,23 @@ import {
|
|
|
32470
32452
|
ArrowLeft,
|
|
32471
32453
|
ArrowRight,
|
|
32472
32454
|
ArrowUp,
|
|
32473
|
-
Bold as BoldIcon,
|
|
32474
32455
|
ChevronDown as ChevronDown8,
|
|
32475
|
-
ChevronsUpDown,
|
|
32476
32456
|
CircleCheckBig as CircleCheckBig2,
|
|
32477
|
-
Code as CodeIcon,
|
|
32478
32457
|
FileCode as FileCode3,
|
|
32479
32458
|
Heading1 as Heading1Icon,
|
|
32480
32459
|
Heading2 as Heading2Icon,
|
|
32481
32460
|
Heading3 as Heading3Icon,
|
|
32482
|
-
Image as ImageIcon2,
|
|
32483
|
-
Italic as ItalicIcon,
|
|
32484
32461
|
Link as LinkIcon,
|
|
32485
32462
|
List as ListIcon,
|
|
32486
32463
|
ListOrdered as ListOrderedIcon,
|
|
32487
32464
|
ListTodo as ListTodo2,
|
|
32488
32465
|
Quote as QuoteIcon,
|
|
32489
|
-
Redo as RedoIcon,
|
|
32490
32466
|
RotateCcw as RotateCcw2,
|
|
32491
|
-
Smile as Smile3,
|
|
32492
32467
|
SquareCheckBig,
|
|
32493
|
-
Strikethrough as StrikethroughIcon,
|
|
32494
|
-
Subscript as SubscriptIcon,
|
|
32495
|
-
Superscript as SuperscriptIcon,
|
|
32496
32468
|
Table as TableIcon,
|
|
32497
32469
|
TableCellsMerge,
|
|
32498
32470
|
Trash2 as Trash22,
|
|
32499
32471
|
Type as Type2,
|
|
32500
|
-
Underline as UnderlineIcon,
|
|
32501
|
-
Undo as UndoIcon,
|
|
32502
32472
|
Upload as Upload3,
|
|
32503
32473
|
AlignStartVertical,
|
|
32504
32474
|
AlignCenterVertical,
|
|
@@ -32508,13 +32478,158 @@ import { setCellAttr } from "@tiptap/pm/tables";
|
|
|
32508
32478
|
|
|
32509
32479
|
// src/components/UEditor/colors.tsx
|
|
32510
32480
|
import { useMemo as useMemo24, useRef as useRef32 } from "react";
|
|
32511
|
-
import { Check as Check12,
|
|
32512
|
-
|
|
32481
|
+
import { Check as Check12, Palette as Palette2, Paintbrush, Grid as Grid2 } from "lucide-react";
|
|
32482
|
+
|
|
32483
|
+
// src/components/UEditor/figma-toolbar-icons.tsx
|
|
32484
|
+
import React81 from "react";
|
|
32485
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
32486
|
+
function createToolbarIcon(displayName, width, height, path) {
|
|
32487
|
+
const Icon = React81.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx90(
|
|
32488
|
+
"svg",
|
|
32489
|
+
{
|
|
32490
|
+
ref,
|
|
32491
|
+
"aria-hidden": "true",
|
|
32492
|
+
focusable: "false",
|
|
32493
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
32494
|
+
className,
|
|
32495
|
+
fill: "currentColor",
|
|
32496
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
32497
|
+
...props,
|
|
32498
|
+
children: /* @__PURE__ */ jsx90("path", { d: path })
|
|
32499
|
+
}
|
|
32500
|
+
));
|
|
32501
|
+
Icon.displayName = displayName;
|
|
32502
|
+
return Icon;
|
|
32503
|
+
}
|
|
32504
|
+
var FigmaChevronDownIcon = createToolbarIcon(
|
|
32505
|
+
"FigmaChevronDownIcon",
|
|
32506
|
+
512,
|
|
32507
|
+
512,
|
|
32508
|
+
"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"
|
|
32509
|
+
);
|
|
32510
|
+
var FigmaTextStyleIcon = ({ className, ...props }) => /* @__PURE__ */ jsx90("svg", { "aria-hidden": "true", focusable: "false", viewBox: "0 0 24 24", className, fill: "currentColor", ...props, children: /* @__PURE__ */ jsx90("path", { d: "M4 4.25C4 3.56 4.56 3 5.25 3h13.5C19.44 3 20 3.56 20 4.25v2.5a1 1 0 1 1-2 0V5h-5v14h2a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2h2V5H6v1.75a1 1 0 1 1-2 0v-2.5Z" }) });
|
|
32511
|
+
var FigmaLineHeightIcon = createToolbarIcon(
|
|
32512
|
+
"FigmaLineHeightIcon",
|
|
32513
|
+
576,
|
|
32514
|
+
512,
|
|
32515
|
+
"M64 128l0-32 64 0 0 320-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-320 64 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48c0-26.5-21.5-48-48-48L160 32 48 32C21.5 32 0 53.5 0 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32zM502.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l32 0 0 192-32 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8l-32 0 0-192 32 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64z"
|
|
32516
|
+
);
|
|
32517
|
+
var FigmaLetterSpacingIcon = createToolbarIcon(
|
|
32518
|
+
"FigmaLetterSpacingIcon",
|
|
32519
|
+
448,
|
|
32520
|
+
512,
|
|
32521
|
+
"M64 128l0-32 128 0 0 128-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-16 0 0-128 128 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48c0-26.5-21.5-48-48-48L224 32 48 32C21.5 32 0 53.5 0 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32zM9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3l64 64c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-32 192 0 0 32c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 32-192 0 0-32c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-64 64z"
|
|
32522
|
+
);
|
|
32523
|
+
var FigmaBoldIcon = createToolbarIcon(
|
|
32524
|
+
"FigmaBoldIcon",
|
|
32525
|
+
384,
|
|
32526
|
+
512,
|
|
32527
|
+
"M0 64C0 46.3 14.3 32 32 32l48 0 16 0 128 0c70.7 0 128 57.3 128 128c0 31.3-11.3 60.1-30 82.3c37.1 22.4 62 63.1 62 109.7c0 70.7-57.3 128-128 128L96 480l-16 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-160L48 96 32 96C14.3 96 0 81.7 0 64zM224 224c35.3 0 64-28.7 64-64s-28.7-64-64-64L112 96l0 128 112 0zM112 288l0 128 144 0c35.3 0 64-28.7 64-64s-28.7-64-64-64l-32 0-112 0z"
|
|
32528
|
+
);
|
|
32529
|
+
var FigmaItalicIcon = createToolbarIcon(
|
|
32530
|
+
"FigmaItalicIcon",
|
|
32531
|
+
384,
|
|
32532
|
+
512,
|
|
32533
|
+
"M128 64c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-58.7 0L160 416l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l58.7 0L224 96l-64 0c-17.7 0-32-14.3-32-32z"
|
|
32534
|
+
);
|
|
32535
|
+
var FigmaUnderlineIcon = createToolbarIcon(
|
|
32536
|
+
"FigmaUnderlineIcon",
|
|
32537
|
+
448,
|
|
32538
|
+
512,
|
|
32539
|
+
"M16 64c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 128c0 53 43 96 96 96s96-43 96-96l0-128-16 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 128c0 88.4-71.6 160-160 160s-160-71.6-160-160L64 96 48 96C30.3 96 16 81.7 16 64zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32z"
|
|
32540
|
+
);
|
|
32541
|
+
var FigmaStrikeIcon = createToolbarIcon(
|
|
32542
|
+
"FigmaStrikeIcon",
|
|
32543
|
+
512,
|
|
32544
|
+
512,
|
|
32545
|
+
"M161.3 144c3.2-17.2 14-30.1 33.7-38.6c21.1-9 51.8-12.3 88.6-6.5c11.9 1.9 48.8 9.1 60.1 12c17.1 4.5 34.6-5.6 39.2-22.7s-5.6-34.6-22.7-39.2c-14.3-3.8-53.6-11.4-66.6-13.4c-44.7-7-88.3-4.2-123.7 10.9c-36.5 15.6-64.4 44.8-71.8 87.3c-.1 .6-.2 1.1-.2 1.7c-2.8 23.9 .5 45.6 10.1 64.6c4.5 9 10.2 16.9 16.7 23.9L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-209.9 0-.4-.1-1.1-.3c-36-10.8-65.2-19.6-85.2-33.1c-9.3-6.3-15-12.6-18.2-19.1c-3.1-6.1-5.2-14.6-3.8-27.4zM348.9 337.2c2.7 6.5 4.4 15.8 1.9 30.1c-3 17.6-13.8 30.8-33.9 39.4c-21.1 9-51.7 12.3-88.5 6.5c-18-2.9-49.1-13.5-74.4-22.1c-5.6-1.9-11-3.7-15.9-5.4c-16.8-5.6-34.9 3.5-40.5 20.3s3.5 34.9 20.3 40.5c3.6 1.2 7.9 2.7 12.7 4.3c24.9 8.5 63.6 21.7 87.6 25.6l.2 0c44.7 7 88.3 4.2 123.7-10.9c36.5-15.6 64.4-44.8 71.8-87.3c3.6-21 2.7-40.4-3.1-58.1l-75.7 0c7 5.6 11.4 11.2 13.9 17.2z"
|
|
32546
|
+
);
|
|
32547
|
+
var FigmaCodeIcon = createToolbarIcon(
|
|
32548
|
+
"FigmaCodeIcon",
|
|
32549
|
+
640,
|
|
32550
|
+
512,
|
|
32551
|
+
"M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"
|
|
32552
|
+
);
|
|
32553
|
+
var FigmaSubscriptIcon = createToolbarIcon(
|
|
32554
|
+
"FigmaSubscriptIcon",
|
|
32555
|
+
512,
|
|
32556
|
+
512,
|
|
32557
|
+
"M32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l15.3 0 89.6 128L47.3 384 32 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c10.4 0 20.2-5.1 26.2-13.6L176 311.8l85.8 122.6c6 8.6 15.8 13.6 26.2 13.6l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-15.3 0L215.1 256l89.6-128 15.3 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-10.4 0-20.2 5.1-26.2 13.6L176 200.2 90.2 77.6C84.2 69.1 74.4 64 64 64L32 64zM480 320c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4l-32 16c-15.8 7.9-22.2 27.1-14.3 42.9C393 361.5 404.3 368 416 368l0 80c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-128z"
|
|
32558
|
+
);
|
|
32559
|
+
var FigmaSuperscriptIcon = createToolbarIcon(
|
|
32560
|
+
"FigmaSuperscriptIcon",
|
|
32561
|
+
512,
|
|
32562
|
+
512,
|
|
32563
|
+
"M480 32c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4l-32 16c-15.8 7.9-22.2 27.1-14.3 42.9C393 73.5 404.3 80 416 80l0 80c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-128zM32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l15.3 0 89.6 128L47.3 384 32 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c10.4 0 20.2-5.1 26.2-13.6L176 311.8l85.8 122.6c6 8.6 15.8 13.6 26.2 13.6l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-15.3 0L215.1 256l89.6-128 15.3 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-10.4 0-20.2 5.1-26.2 13.6L176 200.2 90.2 77.6C84.2 69.1 74.4 64 64 64L32 64z"
|
|
32564
|
+
);
|
|
32565
|
+
var FigmaLinkIcon = createToolbarIcon(
|
|
32566
|
+
"FigmaLinkIcon",
|
|
32567
|
+
640,
|
|
32568
|
+
512,
|
|
32569
|
+
"M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"
|
|
32570
|
+
);
|
|
32571
|
+
var FigmaSmileIcon = createToolbarIcon(
|
|
32572
|
+
"FigmaSmileIcon",
|
|
32573
|
+
512,
|
|
32574
|
+
512,
|
|
32575
|
+
"M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm177.6 62.1C192.8 334.5 218.8 352 256 352s63.2-17.5 78.4-33.9c9-9.7 24.2-10.4 33.9-1.4s10.4 24.2 1.4 33.9c-22 23.8-60 49.4-113.6 49.4s-91.7-25.5-113.6-49.4c-9-9.7-8.4-24.9 1.4-33.9s24.9-8.4 33.9 1.4zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"
|
|
32576
|
+
);
|
|
32577
|
+
var FigmaAlignLeftIcon = createToolbarIcon(
|
|
32578
|
+
"FigmaAlignLeftIcon",
|
|
32579
|
+
448,
|
|
32580
|
+
512,
|
|
32581
|
+
"M288 64c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32L32 352c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"
|
|
32582
|
+
);
|
|
32583
|
+
var FigmaListIcon = createToolbarIcon(
|
|
32584
|
+
"FigmaListIcon",
|
|
32585
|
+
512,
|
|
32586
|
+
512,
|
|
32587
|
+
"M64 144a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM64 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm48-208a48 48 0 1 0-96 0 48 48 0 1 0 96 0z"
|
|
32588
|
+
);
|
|
32589
|
+
var FigmaQuoteIcon = createToolbarIcon(
|
|
32590
|
+
"FigmaQuoteIcon",
|
|
32591
|
+
448,
|
|
32592
|
+
512,
|
|
32593
|
+
"M0 216C0 149.7 53.7 96 120 96l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64l0-136zm256 0c0-66.3 53.7-120 120-120l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64l0-136z"
|
|
32594
|
+
);
|
|
32595
|
+
var FigmaImageIcon = createToolbarIcon(
|
|
32596
|
+
"FigmaImageIcon",
|
|
32597
|
+
512,
|
|
32598
|
+
512,
|
|
32599
|
+
"M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l336 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"
|
|
32600
|
+
);
|
|
32601
|
+
var FigmaTableIcon = createToolbarIcon(
|
|
32602
|
+
"FigmaTableIcon",
|
|
32603
|
+
512,
|
|
32604
|
+
512,
|
|
32605
|
+
"M64 256l0-96 160 0 0 96L64 256zm0 64l160 0 0 96L64 416l0-96zm224 96l0-96 160 0 0 96-160 0zM448 256l-160 0 0-96 160 0 0 96zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"
|
|
32606
|
+
);
|
|
32607
|
+
var FigmaUndoIcon = createToolbarIcon(
|
|
32608
|
+
"FigmaUndoIcon",
|
|
32609
|
+
512,
|
|
32610
|
+
512,
|
|
32611
|
+
"M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l41.6 41.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2S177.7 224 168 224L48.5 224z"
|
|
32612
|
+
);
|
|
32613
|
+
var FigmaRedoIcon = createToolbarIcon(
|
|
32614
|
+
"FigmaRedoIcon",
|
|
32615
|
+
512,
|
|
32616
|
+
512,
|
|
32617
|
+
"M463.5 224l8.5 0c13.3 0 24-10.7 24-24l0-128c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2l-41.6 41.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2S334.3 224 344 224l119.5 0z"
|
|
32618
|
+
);
|
|
32619
|
+
var FigmaHighlighterIcon = createToolbarIcon(
|
|
32620
|
+
"FigmaHighlighterIcon",
|
|
32621
|
+
576,
|
|
32622
|
+
512,
|
|
32623
|
+
"M315 315l158.4-215L444.1 70.6 229 229 315 315zm-187 5l0-71.7c0-15.3 7.2-29.6 19.5-38.6L420.6 8.4C428 2.9 437 0 446.2 0c11.4 0 22.4 4.5 30.5 12.6l54.8 54.8c8.1 8.1 12.6 19 12.6 30.5c0 9.2-2.9 18.2-8.4 25.6L334.4 396.5c-9 12.3-23.4 19.5-38.6 19.5L224 416l-25.4 25.4c-12.5 12.5-32.8 12.5-45.3 0l-50.7-50.7c-12.5-12.5-12.5-32.8 0-45.3L128 320zM7 466.3l63-63 70.6 70.6-31 31c-4.5 4.5-10.6 7-17 7L24 512c-13.3 0-24-10.7-24-24l0-4.7c0-6.4 2.5-12.5 7-17z"
|
|
32624
|
+
);
|
|
32625
|
+
|
|
32626
|
+
// src/components/UEditor/colors.tsx
|
|
32627
|
+
import { jsx as jsx91, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
32513
32628
|
var TextColorIcon = ({ color }) => {
|
|
32514
32629
|
const underlineColor = color && color !== "inherit" ? color : "currentColor";
|
|
32515
32630
|
return /* @__PURE__ */ jsxs73("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
|
|
32516
|
-
/* @__PURE__ */
|
|
32517
|
-
/* @__PURE__ */
|
|
32631
|
+
/* @__PURE__ */ jsx91("span", { className: "text-[15px] font-semibold leading-none", children: "A" }),
|
|
32632
|
+
/* @__PURE__ */ jsx91(
|
|
32518
32633
|
"span",
|
|
32519
32634
|
{
|
|
32520
32635
|
"aria-hidden": "true",
|
|
@@ -32527,8 +32642,8 @@ var TextColorIcon = ({ color }) => {
|
|
|
32527
32642
|
var HighlightColorIcon = ({ color }) => {
|
|
32528
32643
|
const underlineColor = color || "currentColor";
|
|
32529
32644
|
return /* @__PURE__ */ jsxs73("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
|
|
32530
|
-
/* @__PURE__ */
|
|
32531
|
-
/* @__PURE__ */
|
|
32645
|
+
/* @__PURE__ */ jsx91(FigmaHighlighterIcon, { className: "h-4 w-4" }),
|
|
32646
|
+
/* @__PURE__ */ jsx91(
|
|
32532
32647
|
"span",
|
|
32533
32648
|
{
|
|
32534
32649
|
"aria-hidden": "true",
|
|
@@ -32541,8 +32656,8 @@ var HighlightColorIcon = ({ color }) => {
|
|
|
32541
32656
|
var CellBgColorIcon = ({ color }) => {
|
|
32542
32657
|
const underlineColor = color && color !== "inherit" ? color : "currentColor";
|
|
32543
32658
|
return /* @__PURE__ */ jsxs73("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
|
|
32544
|
-
/* @__PURE__ */
|
|
32545
|
-
/* @__PURE__ */
|
|
32659
|
+
/* @__PURE__ */ jsx91(Paintbrush, { className: "h-4 w-4" }),
|
|
32660
|
+
/* @__PURE__ */ jsx91(
|
|
32546
32661
|
"span",
|
|
32547
32662
|
{
|
|
32548
32663
|
"aria-hidden": "true",
|
|
@@ -32555,8 +32670,8 @@ var CellBgColorIcon = ({ color }) => {
|
|
|
32555
32670
|
var CellBorderIcon = ({ color }) => {
|
|
32556
32671
|
const underlineColor = color && color !== "inherit" ? color : "currentColor";
|
|
32557
32672
|
return /* @__PURE__ */ jsxs73("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
|
|
32558
|
-
/* @__PURE__ */
|
|
32559
|
-
/* @__PURE__ */
|
|
32673
|
+
/* @__PURE__ */ jsx91(Grid2, { className: "h-4 w-4" }),
|
|
32674
|
+
/* @__PURE__ */ jsx91(
|
|
32560
32675
|
"span",
|
|
32561
32676
|
{
|
|
32562
32677
|
"aria-hidden": "true",
|
|
@@ -32684,7 +32799,7 @@ var EditorColorPalette = ({
|
|
|
32684
32799
|
const automaticColor = colors[0]?.color ?? "";
|
|
32685
32800
|
const paletteColors = colors.slice(1);
|
|
32686
32801
|
return /* @__PURE__ */ jsxs73("div", { className: "w-56 p-2", children: [
|
|
32687
|
-
/* @__PURE__ */
|
|
32802
|
+
/* @__PURE__ */ jsx91("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
|
|
32688
32803
|
/* @__PURE__ */ jsxs73(
|
|
32689
32804
|
"button",
|
|
32690
32805
|
{
|
|
@@ -32697,12 +32812,12 @@ var EditorColorPalette = ({
|
|
|
32697
32812
|
currentColor === automaticColor ? "border-primary text-primary" : "border-transparent text-foreground"
|
|
32698
32813
|
),
|
|
32699
32814
|
children: [
|
|
32700
|
-
/* @__PURE__ */
|
|
32701
|
-
/* @__PURE__ */
|
|
32815
|
+
/* @__PURE__ */ jsx91("span", { className: "flex h-5 w-5 items-center justify-center rounded border border-border bg-background", children: currentColor === automaticColor && /* @__PURE__ */ jsx91(Check12, { className: "h-3.5 w-3.5" }) }),
|
|
32816
|
+
/* @__PURE__ */ jsx91("span", { className: "flex-1 text-center", children: t("colors.automatic") })
|
|
32702
32817
|
]
|
|
32703
32818
|
}
|
|
32704
32819
|
),
|
|
32705
|
-
/* @__PURE__ */
|
|
32820
|
+
/* @__PURE__ */ jsx91("div", { className: "mt-2 grid grid-cols-8 gap-1", children: paletteColors.map((c) => /* @__PURE__ */ jsx91(Tooltip, { placement: "top", content: /* @__PURE__ */ jsx91("span", { className: "text-xs font-medium", children: c.name }), children: /* @__PURE__ */ jsx91(
|
|
32706
32821
|
"button",
|
|
32707
32822
|
{
|
|
32708
32823
|
type: "button",
|
|
@@ -32714,7 +32829,7 @@ var EditorColorPalette = ({
|
|
|
32714
32829
|
currentColor === c.color ? "border-primary ring-2 ring-primary/25" : "border-border/70"
|
|
32715
32830
|
),
|
|
32716
32831
|
style: { backgroundColor: c.color || "transparent" },
|
|
32717
|
-
children: currentColor === c.color && /* @__PURE__ */
|
|
32832
|
+
children: currentColor === c.color && /* @__PURE__ */ jsx91("span", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx91(Check12, { className: cn("h-3.5 w-3.5", getSwatchCheckClass(c.color)) }) })
|
|
32718
32833
|
}
|
|
32719
32834
|
) }, `${c.name}-${c.color}`)) }),
|
|
32720
32835
|
/* @__PURE__ */ jsxs73(
|
|
@@ -32725,7 +32840,7 @@ var EditorColorPalette = ({
|
|
|
32725
32840
|
onClick: () => colorInputRef.current?.click(),
|
|
32726
32841
|
className: "mt-3 flex h-9 w-full items-center gap-3 rounded-md px-2 text-sm text-foreground transition-colors hover:bg-muted",
|
|
32727
32842
|
children: [
|
|
32728
|
-
/* @__PURE__ */
|
|
32843
|
+
/* @__PURE__ */ jsx91(
|
|
32729
32844
|
"span",
|
|
32730
32845
|
{
|
|
32731
32846
|
"aria-hidden": "true",
|
|
@@ -32735,9 +32850,9 @@ var EditorColorPalette = ({
|
|
|
32735
32850
|
}
|
|
32736
32851
|
}
|
|
32737
32852
|
),
|
|
32738
|
-
/* @__PURE__ */
|
|
32739
|
-
/* @__PURE__ */
|
|
32740
|
-
/* @__PURE__ */
|
|
32853
|
+
/* @__PURE__ */ jsx91("span", { className: "flex-1 text-center", children: t("colors.moreColors") }),
|
|
32854
|
+
/* @__PURE__ */ jsx91(Palette2, { className: "h-4 w-4 text-muted-foreground" }),
|
|
32855
|
+
/* @__PURE__ */ jsx91(
|
|
32741
32856
|
"input",
|
|
32742
32857
|
{
|
|
32743
32858
|
ref: colorInputRef,
|
|
@@ -32884,7 +32999,7 @@ function deleteSelectedImage(editor) {
|
|
|
32884
32999
|
// src/components/UEditor/inputs.tsx
|
|
32885
33000
|
import { useEffect as useEffect37, useId as useId16, useRef as useRef33, useState as useState49 } from "react";
|
|
32886
33001
|
import { Check as Check13, X as X19 } from "lucide-react";
|
|
32887
|
-
import { jsx as
|
|
33002
|
+
import { jsx as jsx92, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
32888
33003
|
function normalizeUrl(raw) {
|
|
32889
33004
|
return sanitizeUEditorUrl(raw, "link");
|
|
32890
33005
|
}
|
|
@@ -32914,7 +33029,7 @@ var LinkInput = ({
|
|
|
32914
33029
|
};
|
|
32915
33030
|
return /* @__PURE__ */ jsxs74("form", { onSubmit: handleSubmit, className: "p-2", children: [
|
|
32916
33031
|
/* @__PURE__ */ jsxs74("div", { className: "flex items-center gap-2", children: [
|
|
32917
|
-
/* @__PURE__ */
|
|
33032
|
+
/* @__PURE__ */ jsx92(
|
|
32918
33033
|
"input",
|
|
32919
33034
|
{
|
|
32920
33035
|
ref: inputRef,
|
|
@@ -32930,10 +33045,10 @@ var LinkInput = ({
|
|
|
32930
33045
|
className: "flex-1 px-3 py-2 text-sm bg-muted/50 border-0 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/20 aria-invalid:ring-2 aria-invalid:ring-destructive/40"
|
|
32931
33046
|
}
|
|
32932
33047
|
),
|
|
32933
|
-
/* @__PURE__ */
|
|
32934
|
-
/* @__PURE__ */
|
|
33048
|
+
/* @__PURE__ */ jsx92("button", { type: "submit", className: "p-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors", children: /* @__PURE__ */ jsx92(Check13, { className: "w-4 h-4" }) }),
|
|
33049
|
+
/* @__PURE__ */ jsx92("button", { type: "button", onClick: onCancel, className: "p-2 rounded-lg hover:bg-muted transition-colors text-muted-foreground", children: /* @__PURE__ */ jsx92(X19, { className: "w-4 h-4" }) })
|
|
32935
33050
|
] }),
|
|
32936
|
-
error ? /* @__PURE__ */
|
|
33051
|
+
error ? /* @__PURE__ */ jsx92("p", { id: errorId, role: "alert", className: "mt-1.5 px-1 text-xs text-destructive", children: error }) : null
|
|
32937
33052
|
] });
|
|
32938
33053
|
};
|
|
32939
33054
|
var ImageInput = ({ onSubmit, onCancel }) => {
|
|
@@ -32953,8 +33068,8 @@ var ImageInput = ({ onSubmit, onCancel }) => {
|
|
|
32953
33068
|
};
|
|
32954
33069
|
return /* @__PURE__ */ jsxs74("form", { onSubmit: handleSubmit, className: "p-3 space-y-3", children: [
|
|
32955
33070
|
/* @__PURE__ */ jsxs74("div", { children: [
|
|
32956
|
-
/* @__PURE__ */
|
|
32957
|
-
/* @__PURE__ */
|
|
33071
|
+
/* @__PURE__ */ jsx92("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.urlLabel") }),
|
|
33072
|
+
/* @__PURE__ */ jsx92(
|
|
32958
33073
|
"input",
|
|
32959
33074
|
{
|
|
32960
33075
|
ref: inputRef,
|
|
@@ -32967,8 +33082,8 @@ var ImageInput = ({ onSubmit, onCancel }) => {
|
|
|
32967
33082
|
)
|
|
32968
33083
|
] }),
|
|
32969
33084
|
/* @__PURE__ */ jsxs74("div", { children: [
|
|
32970
|
-
/* @__PURE__ */
|
|
32971
|
-
/* @__PURE__ */
|
|
33085
|
+
/* @__PURE__ */ jsx92("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.altLabel") }),
|
|
33086
|
+
/* @__PURE__ */ jsx92(
|
|
32972
33087
|
"input",
|
|
32973
33088
|
{
|
|
32974
33089
|
type: "text",
|
|
@@ -32980,7 +33095,7 @@ var ImageInput = ({ onSubmit, onCancel }) => {
|
|
|
32980
33095
|
)
|
|
32981
33096
|
] }),
|
|
32982
33097
|
/* @__PURE__ */ jsxs74("div", { className: "flex gap-2", children: [
|
|
32983
|
-
/* @__PURE__ */
|
|
33098
|
+
/* @__PURE__ */ jsx92(
|
|
32984
33099
|
"button",
|
|
32985
33100
|
{
|
|
32986
33101
|
type: "submit",
|
|
@@ -32989,7 +33104,7 @@ var ImageInput = ({ onSubmit, onCancel }) => {
|
|
|
32989
33104
|
children: t("imageInput.addBtn")
|
|
32990
33105
|
}
|
|
32991
33106
|
),
|
|
32992
|
-
/* @__PURE__ */
|
|
33107
|
+
/* @__PURE__ */ jsx92("button", { type: "button", onClick: onCancel, className: "px-4 py-2 rounded-lg hover:bg-muted transition-colors text-muted-foreground", children: t("imageInput.cancelBtn") })
|
|
32993
33108
|
] })
|
|
32994
33109
|
] });
|
|
32995
33110
|
};
|
|
@@ -33305,6 +33420,7 @@ function normalizeStyleValue(value) {
|
|
|
33305
33420
|
}
|
|
33306
33421
|
function getDefaultFontFamilies(t) {
|
|
33307
33422
|
return [
|
|
33423
|
+
{ label: "Inter", value: '"Inter", "Noto Sans", "Noto Sans CJK KR", "Noto Sans CJK JP", "Segoe UI", sans-serif' },
|
|
33308
33424
|
{ label: "\uAD74\uB9BC", value: '"Gulim", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif' },
|
|
33309
33425
|
{ label: "\uAD74\uB9BC\uCCB4", value: '"GulimChe", "Gulim", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif' },
|
|
33310
33426
|
{ label: "\uAD81\uC11C", value: '"Gungsuh", "Nanum Myeongjo", serif' },
|
|
@@ -33315,7 +33431,6 @@ function getDefaultFontFamilies(t) {
|
|
|
33315
33431
|
{ label: "\uBC14\uD0D5\uCCB4", value: '"BatangChe", "Batang", "Nanum Myeongjo", serif' },
|
|
33316
33432
|
{ label: "\uB9D1\uC740\uACE0\uB515", value: '"Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif' },
|
|
33317
33433
|
{ label: "\uB098\uB214\uBA85\uC870", value: '"Nanum Myeongjo", "Batang", serif' },
|
|
33318
|
-
{ label: "Inter", value: '"Inter", "Noto Sans", "Noto Sans CJK KR", "Noto Sans CJK JP", "Segoe UI", sans-serif' },
|
|
33319
33434
|
{ label: "System UI", value: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif' },
|
|
33320
33435
|
{ label: "Roboto", value: '"Roboto", "Noto Sans", "Apple SD Gothic Neo", "Hiragino Kaku Gothic ProN", sans-serif' },
|
|
33321
33436
|
{ label: "Lexend", value: '"Lexend", "Be Vietnam Pro", "Segoe UI", sans-serif' },
|
|
@@ -33377,7 +33492,7 @@ function getDefaultLetterSpacings() {
|
|
|
33377
33492
|
}
|
|
33378
33493
|
|
|
33379
33494
|
// src/components/UEditor/toolbar.tsx
|
|
33380
|
-
import { Fragment as Fragment30, jsx as
|
|
33495
|
+
import { Fragment as Fragment30, jsx as jsx93, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
33381
33496
|
function getTableAnchorPos(editor) {
|
|
33382
33497
|
const tableInfo = findTableNodeInfoFromState(editor.state);
|
|
33383
33498
|
if (tableInfo) return editor.state.selection.from;
|
|
@@ -33407,8 +33522,8 @@ function fileToDataUrl2(file) {
|
|
|
33407
33522
|
function formatTableInsertLabel(template, rows, cols) {
|
|
33408
33523
|
return template.replace("{rows}", String(rows)).replace("{cols}", String(cols));
|
|
33409
33524
|
}
|
|
33410
|
-
var ToolbarButton =
|
|
33411
|
-
const button = /* @__PURE__ */
|
|
33525
|
+
var ToolbarButton = React84.forwardRef(({ onClick, onMouseDown, active, disabled, children, title, className }, ref) => {
|
|
33526
|
+
const button = /* @__PURE__ */ jsx93(
|
|
33412
33527
|
"button",
|
|
33413
33528
|
{
|
|
33414
33529
|
ref,
|
|
@@ -33421,40 +33536,40 @@ var ToolbarButton = React83.forwardRef(({ onClick, onMouseDown, active, disabled
|
|
|
33421
33536
|
onClick,
|
|
33422
33537
|
disabled,
|
|
33423
33538
|
className: cn(
|
|
33424
|
-
"flex items-center justify-center
|
|
33539
|
+
"flex h-8 w-8 shrink-0 items-center justify-center rounded-md transition-colors duration-150 cursor-pointer",
|
|
33425
33540
|
"gap-0.5 [&_svg+svg]:-ml-1",
|
|
33426
33541
|
"hover:bg-accent",
|
|
33427
33542
|
"focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
33428
33543
|
"disabled:opacity-40 disabled:cursor-not-allowed",
|
|
33429
|
-
active ? "bg-primary/10 text-primary shadow-sm" : "text-
|
|
33544
|
+
active ? "bg-primary/10 text-primary shadow-sm" : "text-[#7B8184] hover:text-foreground dark:text-muted-foreground",
|
|
33430
33545
|
className
|
|
33431
33546
|
),
|
|
33432
33547
|
children
|
|
33433
33548
|
}
|
|
33434
33549
|
);
|
|
33435
33550
|
if (title) {
|
|
33436
|
-
return /* @__PURE__ */
|
|
33551
|
+
return /* @__PURE__ */ jsx93(Tooltip, { content: title, placement: "top", delay: { open: 200, close: 0 }, children: button });
|
|
33437
33552
|
}
|
|
33438
33553
|
return button;
|
|
33439
33554
|
});
|
|
33440
33555
|
ToolbarButton.displayName = "ToolbarButton";
|
|
33441
|
-
var ToolbarDivider = () => /* @__PURE__ */
|
|
33556
|
+
var ToolbarDivider = () => /* @__PURE__ */ jsx93("div", { "aria-hidden": "true", className: "mx-2 h-9 w-px shrink-0 bg-[rgba(123,129,132,0.24)]" });
|
|
33442
33557
|
var TableInsertGrid = ({
|
|
33443
33558
|
insertLabel,
|
|
33444
33559
|
previewTemplate,
|
|
33445
33560
|
onInsert
|
|
33446
33561
|
}) => {
|
|
33447
|
-
const [selection, setSelection] =
|
|
33562
|
+
const [selection, setSelection] = React84.useState({ rows: 3, cols: 3 });
|
|
33448
33563
|
const maxRows = 8;
|
|
33449
33564
|
const maxCols = 8;
|
|
33450
33565
|
return /* @__PURE__ */ jsxs75("div", { className: "mb-2 rounded-xl border border-border/60 bg-muted/20 p-2", children: [
|
|
33451
|
-
/* @__PURE__ */
|
|
33452
|
-
/* @__PURE__ */
|
|
33566
|
+
/* @__PURE__ */ jsx93("div", { className: "mb-2 text-sm font-medium text-foreground", children: formatTableInsertLabel(previewTemplate, selection.rows, selection.cols) }),
|
|
33567
|
+
/* @__PURE__ */ jsx93("div", { className: "grid grid-cols-8 gap-1", onMouseLeave: () => setSelection((prev) => prev), children: Array.from({ length: maxRows }).map(
|
|
33453
33568
|
(_, rowIndex) => Array.from({ length: maxCols }).map((__, colIndex) => {
|
|
33454
33569
|
const rows = rowIndex + 1;
|
|
33455
33570
|
const cols = colIndex + 1;
|
|
33456
33571
|
const active = rows <= selection.rows && cols <= selection.cols;
|
|
33457
|
-
return /* @__PURE__ */
|
|
33572
|
+
return /* @__PURE__ */ jsx93(
|
|
33458
33573
|
"button",
|
|
33459
33574
|
{
|
|
33460
33575
|
type: "button",
|
|
@@ -33472,7 +33587,7 @@ var TableInsertGrid = ({
|
|
|
33472
33587
|
);
|
|
33473
33588
|
})
|
|
33474
33589
|
) }),
|
|
33475
|
-
/* @__PURE__ */
|
|
33590
|
+
/* @__PURE__ */ jsx93("div", { className: "mt-2 text-xs text-muted-foreground", children: insertLabel })
|
|
33476
33591
|
] });
|
|
33477
33592
|
};
|
|
33478
33593
|
function applyTableCellAttribute(editor, name, value) {
|
|
@@ -33531,10 +33646,10 @@ var EditorToolbar = ({
|
|
|
33531
33646
|
const currentHighlightColor = normalizeStyleValue(editor.getAttributes("highlight").color) || "";
|
|
33532
33647
|
const currentLineHeight = normalizeStyleValue(textStyleAttrs.lineHeight);
|
|
33533
33648
|
const currentLetterSpacing = normalizeStyleValue(textStyleAttrs.letterSpacing);
|
|
33534
|
-
const availableFontFamilies =
|
|
33535
|
-
const availableFontSizes =
|
|
33536
|
-
const availableLineHeights =
|
|
33537
|
-
const availableLetterSpacings =
|
|
33649
|
+
const availableFontFamilies = React84.useMemo(() => fontFamilies ?? getDefaultFontFamilies(t), [fontFamilies, t]);
|
|
33650
|
+
const availableFontSizes = React84.useMemo(() => fontSizes ?? getDefaultFontSizes(), [fontSizes]);
|
|
33651
|
+
const availableLineHeights = React84.useMemo(() => lineHeights ?? getDefaultLineHeights(), [lineHeights]);
|
|
33652
|
+
const availableLetterSpacings = React84.useMemo(() => letterSpacings ?? getDefaultLetterSpacings(), [letterSpacings]);
|
|
33538
33653
|
const currentFontFamilyDisplayValue = currentFontFamily.split(",")[0]?.trim() ?? currentFontFamily;
|
|
33539
33654
|
const currentFontFamilyLabel = availableFontFamilies.find((option) => normalizeStyleValue(option.value) === currentFontFamily)?.label ?? (currentFontFamilyDisplayValue || t("toolbar.fontDefault"));
|
|
33540
33655
|
const currentFontSizeLabel = availableFontSizes.find((option) => normalizeStyleValue(option.value) === currentFontSize)?.label ?? "13";
|
|
@@ -33572,18 +33687,18 @@ var EditorToolbar = ({
|
|
|
33572
33687
|
};
|
|
33573
33688
|
if (variant === "minimal") {
|
|
33574
33689
|
return /* @__PURE__ */ jsxs75("div", { className: "flex flex-wrap items-center gap-0.5 border-b border-border/35 bg-muted/30 p-1.5", children: [
|
|
33575
|
-
/* @__PURE__ */
|
|
33576
|
-
/* @__PURE__ */
|
|
33577
|
-
/* @__PURE__ */
|
|
33578
|
-
/* @__PURE__ */
|
|
33579
|
-
/* @__PURE__ */
|
|
33580
|
-
/* @__PURE__ */
|
|
33690
|
+
/* @__PURE__ */ jsx93(ToolbarButton, { onClick: () => editor.chain().focus().undo().run(), disabled: !editor.can().undo(), title: t("toolbar.undo"), children: /* @__PURE__ */ jsx93(FigmaUndoIcon, { className: "h-4 w-4" }) }),
|
|
33691
|
+
/* @__PURE__ */ jsx93(ToolbarButton, { onClick: () => editor.chain().focus().redo().run(), disabled: !editor.can().redo(), title: t("toolbar.redo"), children: /* @__PURE__ */ jsx93(FigmaRedoIcon, { className: "h-4 w-4" }) }),
|
|
33692
|
+
/* @__PURE__ */ jsx93(ToolbarDivider, {}),
|
|
33693
|
+
/* @__PURE__ */ jsx93(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx93(FigmaBoldIcon, { className: "h-4 w-4" }) }),
|
|
33694
|
+
/* @__PURE__ */ jsx93(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx93(FigmaItalicIcon, { className: "h-4 w-4" }) }),
|
|
33695
|
+
/* @__PURE__ */ jsx93(
|
|
33581
33696
|
ToolbarButton,
|
|
33582
33697
|
{
|
|
33583
33698
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
33584
33699
|
active: editor.isActive("bulletList"),
|
|
33585
33700
|
title: t("toolbar.bulletList"),
|
|
33586
|
-
children: /* @__PURE__ */
|
|
33701
|
+
children: /* @__PURE__ */ jsx93(FigmaListIcon, { className: "h-4 w-4" })
|
|
33587
33702
|
}
|
|
33588
33703
|
),
|
|
33589
33704
|
/* @__PURE__ */ jsxs75(
|
|
@@ -33591,11 +33706,11 @@ var EditorToolbar = ({
|
|
|
33591
33706
|
{
|
|
33592
33707
|
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
33593
33708
|
}, active: editor.isActive("formCheckbox"), title: t("slashCommand.formCheckbox"), children: [
|
|
33594
|
-
/* @__PURE__ */
|
|
33595
|
-
/* @__PURE__ */
|
|
33709
|
+
/* @__PURE__ */ jsx93(SquareCheckBig, { className: "w-4 h-4" }),
|
|
33710
|
+
/* @__PURE__ */ jsx93(ChevronDown8, { className: "w-3 h-3" })
|
|
33596
33711
|
] }),
|
|
33597
33712
|
children: [
|
|
33598
|
-
/* @__PURE__ */
|
|
33713
|
+
/* @__PURE__ */ jsx93(
|
|
33599
33714
|
DropdownMenuItem,
|
|
33600
33715
|
{
|
|
33601
33716
|
icon: SquareCheckBig,
|
|
@@ -33603,7 +33718,7 @@ var EditorToolbar = ({
|
|
|
33603
33718
|
onClick: () => editor.chain().focus().setFormCheckbox().run()
|
|
33604
33719
|
}
|
|
33605
33720
|
),
|
|
33606
|
-
/* @__PURE__ */
|
|
33721
|
+
/* @__PURE__ */ jsx93(
|
|
33607
33722
|
DropdownMenuItem,
|
|
33608
33723
|
{
|
|
33609
33724
|
icon: CircleCheckBig2,
|
|
@@ -33614,12 +33729,12 @@ var EditorToolbar = ({
|
|
|
33614
33729
|
]
|
|
33615
33730
|
}
|
|
33616
33731
|
),
|
|
33617
|
-
/* @__PURE__ */
|
|
33732
|
+
/* @__PURE__ */ jsx93(
|
|
33618
33733
|
DropdownMenu,
|
|
33619
33734
|
{
|
|
33620
33735
|
contentClassName: "min-w-72",
|
|
33621
|
-
trigger: /* @__PURE__ */
|
|
33622
|
-
children: showLinkInput ? /* @__PURE__ */
|
|
33736
|
+
trigger: /* @__PURE__ */ jsx93(ToolbarButton, { onClick: () => setShowLinkInput(!editor.isActive("link")), active: editor.isActive("link"), title: t("toolbar.link"), children: /* @__PURE__ */ jsx93(FigmaLinkIcon, { className: "h-4 w-4" }) }),
|
|
33737
|
+
children: showLinkInput ? /* @__PURE__ */ jsx93(
|
|
33623
33738
|
LinkInput,
|
|
33624
33739
|
{
|
|
33625
33740
|
initialUrl: String(editor.getAttributes("link").href ?? ""),
|
|
@@ -33630,7 +33745,7 @@ var EditorToolbar = ({
|
|
|
33630
33745
|
onCancel: () => setShowLinkInput(false)
|
|
33631
33746
|
}
|
|
33632
33747
|
) : /* @__PURE__ */ jsxs75(Fragment30, { children: [
|
|
33633
|
-
/* @__PURE__ */
|
|
33748
|
+
/* @__PURE__ */ jsx93(
|
|
33634
33749
|
DropdownMenuItem,
|
|
33635
33750
|
{
|
|
33636
33751
|
icon: LinkIcon,
|
|
@@ -33640,7 +33755,7 @@ var EditorToolbar = ({
|
|
|
33640
33755
|
closeOnSelect: false
|
|
33641
33756
|
}
|
|
33642
33757
|
),
|
|
33643
|
-
/* @__PURE__ */
|
|
33758
|
+
/* @__PURE__ */ jsx93(
|
|
33644
33759
|
DropdownMenuItem,
|
|
33645
33760
|
{
|
|
33646
33761
|
icon: Trash22,
|
|
@@ -33656,856 +33771,870 @@ var EditorToolbar = ({
|
|
|
33656
33771
|
] });
|
|
33657
33772
|
}
|
|
33658
33773
|
const VerticalAlignActiveIcon = currentCellVerticalAlign === "middle" ? AlignCenterVertical : currentCellVerticalAlign === "bottom" ? AlignEndVertical : AlignStartVertical;
|
|
33659
|
-
return /* @__PURE__ */ jsxs75(
|
|
33660
|
-
|
|
33661
|
-
|
|
33662
|
-
|
|
33663
|
-
|
|
33664
|
-
|
|
33665
|
-
|
|
33666
|
-
|
|
33667
|
-
] }),
|
|
33668
|
-
contentClassName: "max-h-80 overflow-y-auto min-w-56 p-2",
|
|
33669
|
-
children: availableFontFamilies.map((option) => /* @__PURE__ */ jsx92(
|
|
33670
|
-
DropdownMenuItem,
|
|
33671
|
-
{
|
|
33672
|
-
label: option.label,
|
|
33673
|
-
onClick: () => editor.chain().focus().setFontFamily(option.value).run(),
|
|
33674
|
-
active: normalizeStyleValue(option.value) === (currentFontFamily || normalizeStyleValue(defaultFontFamilyValue)),
|
|
33675
|
-
className: "font-medium"
|
|
33676
|
-
},
|
|
33677
|
-
option.value
|
|
33678
|
-
))
|
|
33679
|
-
}
|
|
33680
|
-
),
|
|
33681
|
-
(isMediumFull || isFull) && /* @__PURE__ */ jsx92(
|
|
33682
|
-
DropdownMenu,
|
|
33683
|
-
{
|
|
33684
|
-
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
33685
|
-
}, title: t("toolbar.fontSize"), className: "px-1.5 w-auto gap-1", children: [
|
|
33686
|
-
/* @__PURE__ */ jsxs75("div", { className: "flex items-center gap-0.5", children: [
|
|
33687
|
-
/* @__PURE__ */ jsx92(ChevronsUpDown, { className: "h-3 w-3 text-muted-foreground", strokeWidth: 2.5 }),
|
|
33688
|
-
/* @__PURE__ */ jsx92("span", { className: "min-w-4 text-center text-xs font-semibold leading-none", children: displayedFontSizeLabel })
|
|
33689
|
-
] }),
|
|
33690
|
-
/* @__PURE__ */ jsx92(ChevronDown8, { className: "h-3 w-3 text-muted-foreground" })
|
|
33691
|
-
] }),
|
|
33692
|
-
contentClassName: "max-h-80 overflow-y-auto min-w-32 p-2",
|
|
33693
|
-
children: availableFontSizes.map((option) => /* @__PURE__ */ jsx92(
|
|
33694
|
-
DropdownMenuItem,
|
|
33774
|
+
return /* @__PURE__ */ jsxs75(
|
|
33775
|
+
"div",
|
|
33776
|
+
{
|
|
33777
|
+
role: "toolbar",
|
|
33778
|
+
className: "flex min-h-[60px] flex-nowrap items-center gap-1 overflow-x-auto border-b border-[rgba(196,197,213,0.6)] bg-[#F4F4F4] px-3 py-3 dark:bg-muted/60",
|
|
33779
|
+
children: [
|
|
33780
|
+
isFull && /* @__PURE__ */ jsx93(
|
|
33781
|
+
DropdownMenu,
|
|
33695
33782
|
{
|
|
33696
|
-
|
|
33697
|
-
|
|
33698
|
-
active: normalizeStyleValue(option.value) === activeFontSize
|
|
33699
|
-
},
|
|
33700
|
-
option.value
|
|
33701
|
-
))
|
|
33702
|
-
}
|
|
33703
|
-
),
|
|
33704
|
-
/* @__PURE__ */ jsxs75(
|
|
33705
|
-
DropdownMenu,
|
|
33706
|
-
{
|
|
33707
|
-
contentClassName: "p-1",
|
|
33708
|
-
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
33709
|
-
}, title: t("toolbar.textStyle"), className: "px-1.5 w-auto gap-0.5", children: [
|
|
33710
|
-
/* @__PURE__ */ jsx92(Type2, { className: "w-4 h-4" }),
|
|
33711
|
-
/* @__PURE__ */ jsx92(ChevronDown8, { className: "h-3 w-3 text-muted-foreground" })
|
|
33712
|
-
] }),
|
|
33713
|
-
children: [
|
|
33714
|
-
/* @__PURE__ */ jsx92(
|
|
33715
|
-
DropdownMenuItem,
|
|
33716
|
-
{
|
|
33717
|
-
icon: Type2,
|
|
33718
|
-
label: t("toolbar.normal"),
|
|
33719
|
-
onClick: () => editor.chain().focus().setParagraph().run(),
|
|
33720
|
-
active: editor.isActive("paragraph")
|
|
33721
|
-
}
|
|
33722
|
-
),
|
|
33723
|
-
/* @__PURE__ */ jsx92(
|
|
33724
|
-
DropdownMenuItem,
|
|
33725
|
-
{
|
|
33726
|
-
icon: Heading1Icon,
|
|
33727
|
-
label: t("toolbar.heading1"),
|
|
33728
|
-
onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
33729
|
-
active: editor.isActive("heading", { level: 1 }),
|
|
33730
|
-
shortcut: "Ctrl+Alt+1"
|
|
33731
|
-
}
|
|
33732
|
-
),
|
|
33733
|
-
/* @__PURE__ */ jsx92(
|
|
33734
|
-
DropdownMenuItem,
|
|
33735
|
-
{
|
|
33736
|
-
icon: Heading2Icon,
|
|
33737
|
-
label: t("toolbar.heading2"),
|
|
33738
|
-
onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
33739
|
-
active: editor.isActive("heading", { level: 2 }),
|
|
33740
|
-
shortcut: "Ctrl+Alt+2"
|
|
33741
|
-
}
|
|
33742
|
-
),
|
|
33743
|
-
/* @__PURE__ */ jsx92(
|
|
33744
|
-
DropdownMenuItem,
|
|
33745
|
-
{
|
|
33746
|
-
icon: Heading3Icon,
|
|
33747
|
-
label: t("toolbar.heading3"),
|
|
33748
|
-
onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
33749
|
-
active: editor.isActive("heading", { level: 3 }),
|
|
33750
|
-
shortcut: "Ctrl+Alt+3"
|
|
33751
|
-
}
|
|
33752
|
-
)
|
|
33753
|
-
]
|
|
33754
|
-
}
|
|
33755
|
-
),
|
|
33756
|
-
isFull && /* @__PURE__ */ jsxs75(Fragment30, { children: [
|
|
33757
|
-
/* @__PURE__ */ jsxs75(
|
|
33758
|
-
DropdownMenu,
|
|
33759
|
-
{
|
|
33760
|
-
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
33761
|
-
}, title: t("toolbar.lineHeight"), className: "gap-0.5", children: [
|
|
33762
|
-
/* @__PURE__ */ jsx92(ArrowUp, { className: "w-3 h-3" }),
|
|
33763
|
-
/* @__PURE__ */ jsx92(ArrowDown, { className: "w-3 h-3" })
|
|
33764
|
-
] }),
|
|
33765
|
-
contentClassName: "max-h-72 overflow-y-auto p-1",
|
|
33766
|
-
children: [
|
|
33767
|
-
/* @__PURE__ */ jsx92(
|
|
33768
|
-
DropdownMenuItem,
|
|
33783
|
+
trigger: /* @__PURE__ */ jsxs75(
|
|
33784
|
+
ToolbarButton,
|
|
33769
33785
|
{
|
|
33770
|
-
|
|
33771
|
-
|
|
33772
|
-
|
|
33773
|
-
|
|
33786
|
+
onClick: () => {
|
|
33787
|
+
},
|
|
33788
|
+
title: t("toolbar.fontFamily"),
|
|
33789
|
+
className: "h-9 w-[200px] max-w-[200px] justify-between gap-3 rounded-lg border border-[rgba(196,197,213,0.6)] bg-white px-3 text-[#404040] shadow-[0_1px_2px_rgba(0,0,0,0.07)] hover:bg-white hover:text-[#404040] dark:bg-background dark:text-foreground",
|
|
33790
|
+
children: [
|
|
33791
|
+
/* @__PURE__ */ jsx93("span", { className: "min-w-0 flex-1 truncate text-left text-sm font-normal", style: { fontFamily: displayedFontFamilyValue || void 0 }, children: displayedFontFamilyLabel }),
|
|
33792
|
+
/* @__PURE__ */ jsx93(FigmaChevronDownIcon, { className: "h-3 w-3 shrink-0 text-[#7B8184]" })
|
|
33793
|
+
]
|
|
33774
33794
|
}
|
|
33775
33795
|
),
|
|
33776
|
-
|
|
33796
|
+
contentClassName: "max-h-80 overflow-y-auto min-w-56 p-2",
|
|
33797
|
+
children: availableFontFamilies.map((option) => /* @__PURE__ */ jsx93(
|
|
33777
33798
|
DropdownMenuItem,
|
|
33778
33799
|
{
|
|
33779
33800
|
label: option.label,
|
|
33780
|
-
onClick: () => editor.chain().focus().
|
|
33781
|
-
active: normalizeStyleValue(option.value) ===
|
|
33801
|
+
onClick: () => editor.chain().focus().setFontFamily(option.value).run(),
|
|
33802
|
+
active: normalizeStyleValue(option.value) === (currentFontFamily || normalizeStyleValue(defaultFontFamilyValue)),
|
|
33803
|
+
className: "font-medium"
|
|
33782
33804
|
},
|
|
33783
33805
|
option.value
|
|
33784
33806
|
))
|
|
33785
|
-
|
|
33786
|
-
|
|
33787
|
-
|
|
33788
|
-
|
|
33789
|
-
|
|
33790
|
-
|
|
33791
|
-
|
|
33792
|
-
}, title: t("toolbar.letterSpacing"), className: "gap-0.5", children: [
|
|
33793
|
-
/* @__PURE__ */ jsx92(ArrowLeft, { className: "w-3 h-3" }),
|
|
33794
|
-
/* @__PURE__ */ jsx92(ArrowRight, { className: "w-3 h-3" })
|
|
33795
|
-
] }),
|
|
33796
|
-
contentClassName: "max-h-72 overflow-y-auto p-1",
|
|
33797
|
-
children: [
|
|
33798
|
-
/* @__PURE__ */ jsx92(
|
|
33799
|
-
DropdownMenuItem,
|
|
33807
|
+
}
|
|
33808
|
+
),
|
|
33809
|
+
(isMediumFull || isFull) && /* @__PURE__ */ jsx93(
|
|
33810
|
+
DropdownMenu,
|
|
33811
|
+
{
|
|
33812
|
+
trigger: /* @__PURE__ */ jsxs75(
|
|
33813
|
+
ToolbarButton,
|
|
33800
33814
|
{
|
|
33801
|
-
|
|
33802
|
-
|
|
33803
|
-
|
|
33804
|
-
|
|
33815
|
+
onClick: () => {
|
|
33816
|
+
},
|
|
33817
|
+
title: t("toolbar.fontSize"),
|
|
33818
|
+
className: "h-9 w-20 justify-between gap-3 rounded-lg border border-[rgba(196,197,213,0.6)] bg-white px-3 text-[#404040] shadow-[0_1px_2px_rgba(0,0,0,0.07)] hover:bg-white hover:text-[#404040] dark:bg-background dark:text-foreground",
|
|
33819
|
+
children: [
|
|
33820
|
+
/* @__PURE__ */ jsx93("span", { className: "text-sm font-normal leading-none", children: displayedFontSizeLabel }),
|
|
33821
|
+
/* @__PURE__ */ jsx93(FigmaChevronDownIcon, { className: "h-3 w-3 shrink-0 text-[#7B8184]" })
|
|
33822
|
+
]
|
|
33805
33823
|
}
|
|
33806
33824
|
),
|
|
33807
|
-
|
|
33825
|
+
contentClassName: "max-h-80 overflow-y-auto min-w-32 p-2",
|
|
33826
|
+
children: availableFontSizes.map((option) => /* @__PURE__ */ jsx93(
|
|
33808
33827
|
DropdownMenuItem,
|
|
33809
33828
|
{
|
|
33810
33829
|
label: option.label,
|
|
33811
|
-
onClick: () => editor.chain().focus().
|
|
33812
|
-
active: normalizeStyleValue(option.value) ===
|
|
33830
|
+
onClick: () => editor.chain().focus().setFontSize(option.value).run(),
|
|
33831
|
+
active: normalizeStyleValue(option.value) === activeFontSize
|
|
33813
33832
|
},
|
|
33814
33833
|
option.value
|
|
33815
33834
|
))
|
|
33816
|
-
|
|
33817
|
-
|
|
33818
|
-
|
|
33819
|
-
|
|
33820
|
-
/* @__PURE__ */ jsx92(ToolbarDivider, {}),
|
|
33821
|
-
/* @__PURE__ */ jsx92(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx92(BoldIcon, { className: "w-4 h-4" }) }),
|
|
33822
|
-
/* @__PURE__ */ jsx92(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx92(ItalicIcon, { className: "w-4 h-4" }) }),
|
|
33823
|
-
/* @__PURE__ */ jsx92(
|
|
33824
|
-
ToolbarButton,
|
|
33825
|
-
{
|
|
33826
|
-
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
33827
|
-
active: editor.isActive("underline"),
|
|
33828
|
-
title: t("toolbar.underline"),
|
|
33829
|
-
children: /* @__PURE__ */ jsx92(UnderlineIcon, { className: "w-4 h-4" })
|
|
33830
|
-
}
|
|
33831
|
-
),
|
|
33832
|
-
/* @__PURE__ */ jsx92(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ jsx92(StrikethroughIcon, { className: "w-4 h-4" }) }),
|
|
33833
|
-
(isMediumFull || isFull) && /* @__PURE__ */ jsx92(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ jsx92(CodeIcon, { className: "w-4 h-4" }) }),
|
|
33834
|
-
isFull && /* @__PURE__ */ jsxs75(Fragment30, { children: [
|
|
33835
|
-
/* @__PURE__ */ jsx92(
|
|
33836
|
-
ToolbarButton,
|
|
33837
|
-
{
|
|
33838
|
-
onClick: () => editor.chain().focus().toggleSubscript().run(),
|
|
33839
|
-
active: editor.isActive("subscript"),
|
|
33840
|
-
title: t("toolbar.subscript"),
|
|
33841
|
-
children: /* @__PURE__ */ jsx92(SubscriptIcon, { className: "w-4 h-4" })
|
|
33842
|
-
}
|
|
33843
|
-
),
|
|
33844
|
-
/* @__PURE__ */ jsx92(
|
|
33845
|
-
ToolbarButton,
|
|
33846
|
-
{
|
|
33847
|
-
onClick: () => editor.chain().focus().toggleSuperscript().run(),
|
|
33848
|
-
active: editor.isActive("superscript"),
|
|
33849
|
-
title: t("toolbar.superscript"),
|
|
33850
|
-
children: /* @__PURE__ */ jsx92(SuperscriptIcon, { className: "w-4 h-4" })
|
|
33851
|
-
}
|
|
33852
|
-
)
|
|
33853
|
-
] }),
|
|
33854
|
-
/* @__PURE__ */ jsx92(
|
|
33855
|
-
DropdownMenu,
|
|
33856
|
-
{
|
|
33857
|
-
contentClassName: "min-w-72",
|
|
33858
|
-
trigger: /* @__PURE__ */ jsx92(ToolbarButton, { onClick: () => setShowLinkInput(!editor.isActive("link")), active: editor.isActive("link"), title: t("toolbar.link"), children: /* @__PURE__ */ jsx92(LinkIcon, { className: "w-4 h-4" }) }),
|
|
33859
|
-
children: showLinkInput ? /* @__PURE__ */ jsx92(
|
|
33860
|
-
LinkInput,
|
|
33835
|
+
}
|
|
33836
|
+
),
|
|
33837
|
+
/* @__PURE__ */ jsxs75(
|
|
33838
|
+
DropdownMenu,
|
|
33861
33839
|
{
|
|
33862
|
-
|
|
33863
|
-
|
|
33864
|
-
|
|
33865
|
-
|
|
33866
|
-
|
|
33867
|
-
|
|
33840
|
+
contentClassName: "p-1",
|
|
33841
|
+
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
33842
|
+
}, title: t("toolbar.textStyle"), className: "px-1.5 w-auto gap-0.5", children: [
|
|
33843
|
+
/* @__PURE__ */ jsx93(FigmaTextStyleIcon, { className: "h-4 w-4" }),
|
|
33844
|
+
/* @__PURE__ */ jsx93(FigmaChevronDownIcon, { className: "h-2.5 w-2.5" })
|
|
33845
|
+
] }),
|
|
33846
|
+
children: [
|
|
33847
|
+
/* @__PURE__ */ jsx93(
|
|
33848
|
+
DropdownMenuItem,
|
|
33849
|
+
{
|
|
33850
|
+
icon: Type2,
|
|
33851
|
+
label: t("toolbar.normal"),
|
|
33852
|
+
onClick: () => editor.chain().focus().setParagraph().run(),
|
|
33853
|
+
active: editor.isActive("paragraph")
|
|
33854
|
+
}
|
|
33855
|
+
),
|
|
33856
|
+
/* @__PURE__ */ jsx93(
|
|
33857
|
+
DropdownMenuItem,
|
|
33858
|
+
{
|
|
33859
|
+
icon: Heading1Icon,
|
|
33860
|
+
label: t("toolbar.heading1"),
|
|
33861
|
+
onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
33862
|
+
active: editor.isActive("heading", { level: 1 }),
|
|
33863
|
+
shortcut: "Ctrl+Alt+1"
|
|
33864
|
+
}
|
|
33865
|
+
),
|
|
33866
|
+
/* @__PURE__ */ jsx93(
|
|
33867
|
+
DropdownMenuItem,
|
|
33868
|
+
{
|
|
33869
|
+
icon: Heading2Icon,
|
|
33870
|
+
label: t("toolbar.heading2"),
|
|
33871
|
+
onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
33872
|
+
active: editor.isActive("heading", { level: 2 }),
|
|
33873
|
+
shortcut: "Ctrl+Alt+2"
|
|
33874
|
+
}
|
|
33875
|
+
),
|
|
33876
|
+
/* @__PURE__ */ jsx93(
|
|
33877
|
+
DropdownMenuItem,
|
|
33878
|
+
{
|
|
33879
|
+
icon: Heading3Icon,
|
|
33880
|
+
label: t("toolbar.heading3"),
|
|
33881
|
+
onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
33882
|
+
active: editor.isActive("heading", { level: 3 }),
|
|
33883
|
+
shortcut: "Ctrl+Alt+3"
|
|
33884
|
+
}
|
|
33885
|
+
)
|
|
33886
|
+
]
|
|
33868
33887
|
}
|
|
33869
|
-
)
|
|
33870
|
-
|
|
33871
|
-
|
|
33888
|
+
),
|
|
33889
|
+
isFull && /* @__PURE__ */ jsxs75(Fragment30, { children: [
|
|
33890
|
+
/* @__PURE__ */ jsxs75(
|
|
33891
|
+
DropdownMenu,
|
|
33872
33892
|
{
|
|
33873
|
-
|
|
33874
|
-
|
|
33875
|
-
|
|
33876
|
-
|
|
33877
|
-
|
|
33893
|
+
trigger: /* @__PURE__ */ jsx93(ToolbarButton, { onClick: () => {
|
|
33894
|
+
}, title: t("toolbar.lineHeight"), className: "gap-0.5", children: /* @__PURE__ */ jsx93(FigmaLineHeightIcon, { className: "h-4 w-4" }) }),
|
|
33895
|
+
contentClassName: "max-h-72 overflow-y-auto p-1",
|
|
33896
|
+
children: [
|
|
33897
|
+
/* @__PURE__ */ jsx93(
|
|
33898
|
+
DropdownMenuItem,
|
|
33899
|
+
{
|
|
33900
|
+
icon: Type2,
|
|
33901
|
+
label: t("toolbar.lineHeightDefault"),
|
|
33902
|
+
onClick: () => editor.chain().focus().unsetLineHeight().run(),
|
|
33903
|
+
active: !currentLineHeight
|
|
33904
|
+
}
|
|
33905
|
+
),
|
|
33906
|
+
availableLineHeights.map((option) => /* @__PURE__ */ jsx93(
|
|
33907
|
+
DropdownMenuItem,
|
|
33908
|
+
{
|
|
33909
|
+
label: option.label,
|
|
33910
|
+
onClick: () => editor.chain().focus().setLineHeight(option.value).run(),
|
|
33911
|
+
active: normalizeStyleValue(option.value) === currentLineHeight
|
|
33912
|
+
},
|
|
33913
|
+
option.value
|
|
33914
|
+
))
|
|
33915
|
+
]
|
|
33878
33916
|
}
|
|
33879
33917
|
),
|
|
33880
|
-
/* @__PURE__ */
|
|
33881
|
-
|
|
33918
|
+
/* @__PURE__ */ jsxs75(
|
|
33919
|
+
DropdownMenu,
|
|
33882
33920
|
{
|
|
33883
|
-
|
|
33884
|
-
|
|
33885
|
-
|
|
33886
|
-
|
|
33887
|
-
|
|
33921
|
+
trigger: /* @__PURE__ */ jsx93(ToolbarButton, { onClick: () => {
|
|
33922
|
+
}, title: t("toolbar.letterSpacing"), className: "gap-0.5", children: /* @__PURE__ */ jsx93(FigmaLetterSpacingIcon, { className: "h-4 w-4" }) }),
|
|
33923
|
+
contentClassName: "max-h-72 overflow-y-auto p-1",
|
|
33924
|
+
children: [
|
|
33925
|
+
/* @__PURE__ */ jsx93(
|
|
33926
|
+
DropdownMenuItem,
|
|
33927
|
+
{
|
|
33928
|
+
icon: Type2,
|
|
33929
|
+
label: t("toolbar.letterSpacingDefault"),
|
|
33930
|
+
onClick: () => editor.chain().focus().unsetLetterSpacing().run(),
|
|
33931
|
+
active: !currentLetterSpacing
|
|
33932
|
+
}
|
|
33933
|
+
),
|
|
33934
|
+
availableLetterSpacings.map((option) => /* @__PURE__ */ jsx93(
|
|
33935
|
+
DropdownMenuItem,
|
|
33936
|
+
{
|
|
33937
|
+
label: option.label,
|
|
33938
|
+
onClick: () => editor.chain().focus().setLetterSpacing(option.value).run(),
|
|
33939
|
+
active: normalizeStyleValue(option.value) === currentLetterSpacing
|
|
33940
|
+
},
|
|
33941
|
+
option.value
|
|
33942
|
+
))
|
|
33943
|
+
]
|
|
33888
33944
|
}
|
|
33889
33945
|
)
|
|
33890
|
-
] })
|
|
33891
|
-
}
|
|
33892
|
-
),
|
|
33893
|
-
/* @__PURE__ */ jsx92(ToolbarDivider, {}),
|
|
33894
|
-
/* @__PURE__ */ jsx92(
|
|
33895
|
-
DropdownMenu,
|
|
33896
|
-
{
|
|
33897
|
-
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
33898
|
-
}, title: t("colors.textColor"), children: [
|
|
33899
|
-
/* @__PURE__ */ jsx92(TextColorIcon, { color: currentTextColor }),
|
|
33900
|
-
/* @__PURE__ */ jsx92(ChevronDown8, { className: "w-3 h-3" })
|
|
33901
33946
|
] }),
|
|
33902
|
-
|
|
33903
|
-
|
|
33904
|
-
|
|
33905
|
-
|
|
33906
|
-
|
|
33907
|
-
onSelect: (color) => {
|
|
33908
|
-
if (color === "inherit") {
|
|
33909
|
-
editor.chain().focus().unsetColor().run();
|
|
33910
|
-
} else {
|
|
33911
|
-
editor.chain().focus().setColor(color).run();
|
|
33912
|
-
}
|
|
33913
|
-
},
|
|
33914
|
-
label: t("colors.textColor")
|
|
33915
|
-
}
|
|
33916
|
-
)
|
|
33917
|
-
}
|
|
33918
|
-
),
|
|
33919
|
-
/* @__PURE__ */ jsx92(
|
|
33920
|
-
DropdownMenu,
|
|
33921
|
-
{
|
|
33922
|
-
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
33923
|
-
}, active: editor.isActive("highlight"), title: t("colors.highlight"), children: [
|
|
33924
|
-
/* @__PURE__ */ jsx92(HighlightColorIcon, { color: currentHighlightColor }),
|
|
33925
|
-
/* @__PURE__ */ jsx92(ChevronDown8, { className: "w-3 h-3" })
|
|
33926
|
-
] }),
|
|
33927
|
-
children: /* @__PURE__ */ jsx92(
|
|
33928
|
-
EditorColorPalette,
|
|
33947
|
+
/* @__PURE__ */ jsx93(ToolbarDivider, {}),
|
|
33948
|
+
/* @__PURE__ */ jsx93(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx93(FigmaBoldIcon, { className: "h-4 w-4" }) }),
|
|
33949
|
+
/* @__PURE__ */ jsx93(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx93(FigmaItalicIcon, { className: "h-4 w-4" }) }),
|
|
33950
|
+
/* @__PURE__ */ jsx93(
|
|
33951
|
+
ToolbarButton,
|
|
33929
33952
|
{
|
|
33930
|
-
|
|
33931
|
-
|
|
33932
|
-
|
|
33933
|
-
|
|
33934
|
-
editor.chain().focus().unsetHighlight().run();
|
|
33935
|
-
} else {
|
|
33936
|
-
editor.chain().focus().toggleHighlight({ color }).run();
|
|
33937
|
-
}
|
|
33938
|
-
},
|
|
33939
|
-
label: t("colors.highlight")
|
|
33953
|
+
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
33954
|
+
active: editor.isActive("underline"),
|
|
33955
|
+
title: t("toolbar.underline"),
|
|
33956
|
+
children: /* @__PURE__ */ jsx93(FigmaUnderlineIcon, { className: "h-4 w-4" })
|
|
33940
33957
|
}
|
|
33941
|
-
)
|
|
33942
|
-
|
|
33943
|
-
|
|
33944
|
-
|
|
33945
|
-
|
|
33946
|
-
|
|
33947
|
-
DropdownMenu,
|
|
33948
|
-
{
|
|
33949
|
-
contentClassName: "p-0 overflow-hidden",
|
|
33950
|
-
trigger: /* @__PURE__ */ jsx92(ToolbarButton, { onClick: () => {
|
|
33951
|
-
}, title: t("toolbar.emoji"), children: /* @__PURE__ */ jsx92(Smile3, { className: "w-4 h-4" }) }),
|
|
33952
|
-
children: /* @__PURE__ */ jsx92(
|
|
33953
|
-
EmojiPicker2,
|
|
33958
|
+
),
|
|
33959
|
+
/* @__PURE__ */ jsx93(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ jsx93(FigmaStrikeIcon, { className: "h-4 w-4" }) }),
|
|
33960
|
+
(isMediumFull || isFull) && /* @__PURE__ */ jsx93(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ jsx93(FigmaCodeIcon, { className: "h-4 w-4" }) }),
|
|
33961
|
+
isFull && /* @__PURE__ */ jsxs75(Fragment30, { children: [
|
|
33962
|
+
/* @__PURE__ */ jsx93(
|
|
33963
|
+
ToolbarButton,
|
|
33954
33964
|
{
|
|
33955
|
-
|
|
33956
|
-
|
|
33957
|
-
|
|
33965
|
+
onClick: () => editor.chain().focus().toggleSubscript().run(),
|
|
33966
|
+
active: editor.isActive("subscript"),
|
|
33967
|
+
title: t("toolbar.subscript"),
|
|
33968
|
+
children: /* @__PURE__ */ jsx93(FigmaSubscriptIcon, { className: "h-4 w-4" })
|
|
33969
|
+
}
|
|
33970
|
+
),
|
|
33971
|
+
/* @__PURE__ */ jsx93(
|
|
33972
|
+
ToolbarButton,
|
|
33973
|
+
{
|
|
33974
|
+
onClick: () => editor.chain().focus().toggleSuperscript().run(),
|
|
33975
|
+
active: editor.isActive("superscript"),
|
|
33976
|
+
title: t("toolbar.superscript"),
|
|
33977
|
+
children: /* @__PURE__ */ jsx93(FigmaSuperscriptIcon, { className: "h-4 w-4" })
|
|
33958
33978
|
}
|
|
33959
33979
|
)
|
|
33960
|
-
}
|
|
33961
|
-
|
|
33962
|
-
|
|
33963
|
-
|
|
33964
|
-
|
|
33965
|
-
|
|
33966
|
-
|
|
33967
|
-
|
|
33968
|
-
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
33969
|
-
}, title: t("toolbar.alignment"), children: [
|
|
33970
|
-
/* @__PURE__ */ jsx92(AlignLeft, { className: "w-4 h-4" }),
|
|
33971
|
-
/* @__PURE__ */ jsx92(ChevronDown8, { className: "w-3 h-3" })
|
|
33972
|
-
] }),
|
|
33973
|
-
children: [
|
|
33974
|
-
/* @__PURE__ */ jsx92(
|
|
33975
|
-
DropdownMenuItem,
|
|
33976
|
-
{
|
|
33977
|
-
icon: AlignLeft,
|
|
33978
|
-
label: t("toolbar.alignLeft"),
|
|
33979
|
-
onClick: () => editor.chain().focus().setTextAlign("left").run(),
|
|
33980
|
-
active: editor.isActive({ textAlign: "left" })
|
|
33981
|
-
}
|
|
33982
|
-
),
|
|
33983
|
-
/* @__PURE__ */ jsx92(
|
|
33984
|
-
DropdownMenuItem,
|
|
33985
|
-
{
|
|
33986
|
-
icon: AlignCenter,
|
|
33987
|
-
label: t("toolbar.alignCenter"),
|
|
33988
|
-
onClick: () => editor.chain().focus().setTextAlign("center").run(),
|
|
33989
|
-
active: editor.isActive({ textAlign: "center" })
|
|
33990
|
-
}
|
|
33991
|
-
),
|
|
33992
|
-
/* @__PURE__ */ jsx92(
|
|
33993
|
-
DropdownMenuItem,
|
|
33994
|
-
{
|
|
33995
|
-
icon: AlignRight,
|
|
33996
|
-
label: t("toolbar.alignRight"),
|
|
33997
|
-
onClick: () => editor.chain().focus().setTextAlign("right").run(),
|
|
33998
|
-
active: editor.isActive({ textAlign: "right" })
|
|
33999
|
-
}
|
|
34000
|
-
),
|
|
34001
|
-
/* @__PURE__ */ jsx92(
|
|
34002
|
-
DropdownMenuItem,
|
|
33980
|
+
] }),
|
|
33981
|
+
/* @__PURE__ */ jsx93(
|
|
33982
|
+
DropdownMenu,
|
|
33983
|
+
{
|
|
33984
|
+
contentClassName: "min-w-72",
|
|
33985
|
+
trigger: /* @__PURE__ */ jsx93(ToolbarButton, { onClick: () => setShowLinkInput(!editor.isActive("link")), active: editor.isActive("link"), title: t("toolbar.link"), children: /* @__PURE__ */ jsx93(FigmaLinkIcon, { className: "h-4 w-4" }) }),
|
|
33986
|
+
children: showLinkInput ? /* @__PURE__ */ jsx93(
|
|
33987
|
+
LinkInput,
|
|
34003
33988
|
{
|
|
34004
|
-
|
|
34005
|
-
|
|
34006
|
-
|
|
34007
|
-
|
|
33989
|
+
initialUrl: String(editor.getAttributes("link").href ?? ""),
|
|
33990
|
+
onSubmit: (url) => {
|
|
33991
|
+
applyEditorLink(editor, url);
|
|
33992
|
+
setShowLinkInput(false);
|
|
33993
|
+
},
|
|
33994
|
+
onCancel: () => setShowLinkInput(false)
|
|
34008
33995
|
}
|
|
34009
|
-
),
|
|
34010
|
-
|
|
34011
|
-
/* @__PURE__ */ jsx92("div", { className: "my-1 border-t" }),
|
|
34012
|
-
/* @__PURE__ */ jsx92(
|
|
34013
|
-
DropdownMenuItem,
|
|
34014
|
-
{
|
|
34015
|
-
icon: AlignStartVertical,
|
|
34016
|
-
label: t("tableMenu.alignVerticalTop") || "Align top",
|
|
34017
|
-
onClick: () => applyTableCellAttribute(editor, "verticalAlign", "top"),
|
|
34018
|
-
active: currentCellVerticalAlign === "top"
|
|
34019
|
-
}
|
|
34020
|
-
),
|
|
34021
|
-
/* @__PURE__ */ jsx92(
|
|
33996
|
+
) : /* @__PURE__ */ jsxs75(Fragment30, { children: [
|
|
33997
|
+
/* @__PURE__ */ jsx93(
|
|
34022
33998
|
DropdownMenuItem,
|
|
34023
33999
|
{
|
|
34024
|
-
icon:
|
|
34025
|
-
label: t("
|
|
34026
|
-
onClick: () =>
|
|
34027
|
-
active:
|
|
34000
|
+
icon: LinkIcon,
|
|
34001
|
+
label: t("toolbar.link"),
|
|
34002
|
+
onClick: () => setShowLinkInput(true),
|
|
34003
|
+
active: editor.isActive("link"),
|
|
34004
|
+
closeOnSelect: false
|
|
34028
34005
|
}
|
|
34029
34006
|
),
|
|
34030
|
-
/* @__PURE__ */
|
|
34007
|
+
/* @__PURE__ */ jsx93(
|
|
34031
34008
|
DropdownMenuItem,
|
|
34032
34009
|
{
|
|
34033
|
-
icon:
|
|
34034
|
-
label: t("
|
|
34035
|
-
onClick: () =>
|
|
34036
|
-
|
|
34010
|
+
icon: Trash22,
|
|
34011
|
+
label: t("toolbar.removeLink"),
|
|
34012
|
+
onClick: () => editor.chain().focus().extendMarkRange("link").unsetLink().run(),
|
|
34013
|
+
disabled: !editor.isActive("link"),
|
|
34014
|
+
destructive: true
|
|
34037
34015
|
}
|
|
34038
34016
|
)
|
|
34039
34017
|
] })
|
|
34040
|
-
|
|
34041
|
-
|
|
34042
|
-
|
|
34043
|
-
|
|
34044
|
-
|
|
34045
|
-
|
|
34046
|
-
|
|
34047
|
-
|
|
34048
|
-
|
|
34049
|
-
|
|
34050
|
-
|
|
34051
|
-
|
|
34052
|
-
|
|
34053
|
-
DropdownMenuItem,
|
|
34018
|
+
}
|
|
34019
|
+
),
|
|
34020
|
+
/* @__PURE__ */ jsx93(ToolbarDivider, {}),
|
|
34021
|
+
/* @__PURE__ */ jsx93(
|
|
34022
|
+
DropdownMenu,
|
|
34023
|
+
{
|
|
34024
|
+
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
34025
|
+
}, title: t("colors.textColor"), children: [
|
|
34026
|
+
/* @__PURE__ */ jsx93(TextColorIcon, { color: currentTextColor }),
|
|
34027
|
+
/* @__PURE__ */ jsx93(FigmaChevronDownIcon, { className: "h-2.5 w-2.5" })
|
|
34028
|
+
] }),
|
|
34029
|
+
children: /* @__PURE__ */ jsx93(
|
|
34030
|
+
EditorColorPalette,
|
|
34054
34031
|
{
|
|
34055
|
-
|
|
34056
|
-
|
|
34057
|
-
|
|
34058
|
-
|
|
34032
|
+
colors: textColors,
|
|
34033
|
+
currentColor: currentTextColor,
|
|
34034
|
+
onSelect: (color) => {
|
|
34035
|
+
if (color === "inherit") {
|
|
34036
|
+
editor.chain().focus().unsetColor().run();
|
|
34037
|
+
} else {
|
|
34038
|
+
editor.chain().focus().setColor(color).run();
|
|
34039
|
+
}
|
|
34040
|
+
},
|
|
34041
|
+
label: t("colors.textColor")
|
|
34059
34042
|
}
|
|
34060
|
-
)
|
|
34061
|
-
|
|
34062
|
-
|
|
34043
|
+
)
|
|
34044
|
+
}
|
|
34045
|
+
),
|
|
34046
|
+
/* @__PURE__ */ jsx93(
|
|
34047
|
+
DropdownMenu,
|
|
34048
|
+
{
|
|
34049
|
+
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
34050
|
+
}, active: editor.isActive("highlight"), title: t("colors.highlight"), children: [
|
|
34051
|
+
/* @__PURE__ */ jsx93(HighlightColorIcon, { color: currentHighlightColor }),
|
|
34052
|
+
/* @__PURE__ */ jsx93(FigmaChevronDownIcon, { className: "h-2.5 w-2.5" })
|
|
34053
|
+
] }),
|
|
34054
|
+
children: /* @__PURE__ */ jsx93(
|
|
34055
|
+
EditorColorPalette,
|
|
34063
34056
|
{
|
|
34064
|
-
|
|
34065
|
-
|
|
34066
|
-
|
|
34067
|
-
|
|
34057
|
+
colors: highlightColors,
|
|
34058
|
+
currentColor: currentHighlightColor,
|
|
34059
|
+
onSelect: (color) => {
|
|
34060
|
+
if (color === "") {
|
|
34061
|
+
editor.chain().focus().unsetHighlight().run();
|
|
34062
|
+
} else {
|
|
34063
|
+
editor.chain().focus().toggleHighlight({ color }).run();
|
|
34064
|
+
}
|
|
34065
|
+
},
|
|
34066
|
+
label: t("colors.highlight")
|
|
34068
34067
|
}
|
|
34069
34068
|
)
|
|
34070
|
-
|
|
34071
|
-
|
|
34072
|
-
|
|
34073
|
-
|
|
34074
|
-
|
|
34075
|
-
|
|
34076
|
-
DropdownMenu,
|
|
34077
|
-
{
|
|
34078
|
-
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
34079
|
-
}, title: t("toolbar.bulletList"), children: [
|
|
34080
|
-
/* @__PURE__ */ jsx92(ListIcon, { className: "w-4 h-4" }),
|
|
34081
|
-
/* @__PURE__ */ jsx92(ChevronDown8, { className: "w-3 h-3" })
|
|
34082
|
-
] }),
|
|
34083
|
-
children: [
|
|
34084
|
-
/* @__PURE__ */ jsx92(
|
|
34085
|
-
DropdownMenuItem,
|
|
34086
|
-
{
|
|
34087
|
-
icon: ListIcon,
|
|
34088
|
-
label: t("toolbar.bulletList"),
|
|
34089
|
-
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
34090
|
-
active: editor.isActive("bulletList"),
|
|
34091
|
-
shortcut: "Ctrl+Shift+8"
|
|
34092
|
-
}
|
|
34093
|
-
),
|
|
34094
|
-
/* @__PURE__ */ jsx92(
|
|
34095
|
-
DropdownMenuItem,
|
|
34096
|
-
{
|
|
34097
|
-
icon: ListOrderedIcon,
|
|
34098
|
-
label: t("toolbar.orderedList"),
|
|
34099
|
-
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
34100
|
-
active: editor.isActive("orderedList"),
|
|
34101
|
-
shortcut: "Ctrl+Shift+7"
|
|
34102
|
-
}
|
|
34103
|
-
),
|
|
34104
|
-
/* @__PURE__ */ jsx92(
|
|
34105
|
-
DropdownMenuItem,
|
|
34106
|
-
{
|
|
34107
|
-
icon: ListTodo2,
|
|
34108
|
-
label: t("toolbar.taskList"),
|
|
34109
|
-
onClick: () => editor.chain().focus().toggleTaskList().run(),
|
|
34110
|
-
active: editor.isActive("taskList"),
|
|
34111
|
-
shortcut: "Ctrl+Shift+9"
|
|
34112
|
-
}
|
|
34113
|
-
)
|
|
34114
|
-
]
|
|
34115
|
-
}
|
|
34116
|
-
),
|
|
34117
|
-
/* @__PURE__ */ jsxs75(
|
|
34118
|
-
DropdownMenu,
|
|
34119
|
-
{
|
|
34120
|
-
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
34121
|
-
}, active: editor.isActive("formCheckbox"), title: t("slashCommand.formCheckbox"), children: [
|
|
34122
|
-
/* @__PURE__ */ jsx92(SquareCheckBig, { className: "w-4 h-4" }),
|
|
34123
|
-
/* @__PURE__ */ jsx92(ChevronDown8, { className: "w-3 h-3" })
|
|
34124
|
-
] }),
|
|
34125
|
-
children: [
|
|
34126
|
-
/* @__PURE__ */ jsx92(
|
|
34127
|
-
DropdownMenuItem,
|
|
34128
|
-
{
|
|
34129
|
-
icon: SquareCheckBig,
|
|
34130
|
-
label: t("slashCommand.formCheckbox"),
|
|
34131
|
-
onClick: () => editor.chain().focus().setFormCheckbox().run()
|
|
34132
|
-
}
|
|
34133
|
-
),
|
|
34134
|
-
/* @__PURE__ */ jsx92(
|
|
34135
|
-
DropdownMenuItem,
|
|
34069
|
+
}
|
|
34070
|
+
),
|
|
34071
|
+
(isMediumFull || isFull) && /* @__PURE__ */ jsxs75(Fragment30, { children: [
|
|
34072
|
+
/* @__PURE__ */ jsx93(ToolbarDivider, {}),
|
|
34073
|
+
/* @__PURE__ */ jsx93(
|
|
34074
|
+
DropdownMenu,
|
|
34136
34075
|
{
|
|
34137
|
-
|
|
34138
|
-
|
|
34139
|
-
|
|
34076
|
+
contentClassName: "p-0 overflow-hidden",
|
|
34077
|
+
trigger: /* @__PURE__ */ jsx93(ToolbarButton, { onClick: () => {
|
|
34078
|
+
}, title: t("toolbar.emoji"), children: /* @__PURE__ */ jsx93(FigmaSmileIcon, { className: "h-4 w-4" }) }),
|
|
34079
|
+
children: /* @__PURE__ */ jsx93(
|
|
34080
|
+
EmojiPicker2,
|
|
34081
|
+
{
|
|
34082
|
+
onSelect: (emoji) => {
|
|
34083
|
+
editor.chain().focus().insertContent(emoji).run();
|
|
34084
|
+
}
|
|
34085
|
+
}
|
|
34086
|
+
)
|
|
34140
34087
|
}
|
|
34141
34088
|
)
|
|
34142
|
-
]
|
|
34143
|
-
}
|
|
34144
|
-
),
|
|
34145
|
-
isMediumFull && /* @__PURE__ */ jsx92(ToolbarButton, { onClick: () => editor.chain().focus().toggleBlockquote().run(), active: editor.isActive("blockquote"), title: t("toolbar.quote"), children: /* @__PURE__ */ jsx92(QuoteIcon, { className: "w-4 h-4" }) }),
|
|
34146
|
-
isFull && /* @__PURE__ */ jsxs75(
|
|
34147
|
-
DropdownMenu,
|
|
34148
|
-
{
|
|
34149
|
-
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
34150
|
-
}, title: t("toolbar.quote"), children: [
|
|
34151
|
-
/* @__PURE__ */ jsx92(QuoteIcon, { className: "w-4 h-4" }),
|
|
34152
|
-
/* @__PURE__ */ jsx92(ChevronDown8, { className: "w-3 h-3" })
|
|
34153
34089
|
] }),
|
|
34154
|
-
children: [
|
|
34155
|
-
/* @__PURE__ */
|
|
34156
|
-
|
|
34090
|
+
(isMediumFull || isFull) && /* @__PURE__ */ jsxs75(Fragment30, { children: [
|
|
34091
|
+
/* @__PURE__ */ jsx93(ToolbarDivider, {}),
|
|
34092
|
+
/* @__PURE__ */ jsxs75(
|
|
34093
|
+
DropdownMenu,
|
|
34157
34094
|
{
|
|
34158
|
-
|
|
34159
|
-
|
|
34160
|
-
|
|
34161
|
-
|
|
34162
|
-
|
|
34095
|
+
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
34096
|
+
}, title: t("toolbar.alignment"), children: [
|
|
34097
|
+
/* @__PURE__ */ jsx93(FigmaAlignLeftIcon, { className: "h-4 w-4" }),
|
|
34098
|
+
/* @__PURE__ */ jsx93(FigmaChevronDownIcon, { className: "h-2.5 w-2.5" })
|
|
34099
|
+
] }),
|
|
34100
|
+
children: [
|
|
34101
|
+
/* @__PURE__ */ jsx93(
|
|
34102
|
+
DropdownMenuItem,
|
|
34103
|
+
{
|
|
34104
|
+
icon: AlignLeft,
|
|
34105
|
+
label: t("toolbar.alignLeft"),
|
|
34106
|
+
onClick: () => editor.chain().focus().setTextAlign("left").run(),
|
|
34107
|
+
active: editor.isActive({ textAlign: "left" })
|
|
34108
|
+
}
|
|
34109
|
+
),
|
|
34110
|
+
/* @__PURE__ */ jsx93(
|
|
34111
|
+
DropdownMenuItem,
|
|
34112
|
+
{
|
|
34113
|
+
icon: AlignCenter,
|
|
34114
|
+
label: t("toolbar.alignCenter"),
|
|
34115
|
+
onClick: () => editor.chain().focus().setTextAlign("center").run(),
|
|
34116
|
+
active: editor.isActive({ textAlign: "center" })
|
|
34117
|
+
}
|
|
34118
|
+
),
|
|
34119
|
+
/* @__PURE__ */ jsx93(
|
|
34120
|
+
DropdownMenuItem,
|
|
34121
|
+
{
|
|
34122
|
+
icon: AlignRight,
|
|
34123
|
+
label: t("toolbar.alignRight"),
|
|
34124
|
+
onClick: () => editor.chain().focus().setTextAlign("right").run(),
|
|
34125
|
+
active: editor.isActive({ textAlign: "right" })
|
|
34126
|
+
}
|
|
34127
|
+
),
|
|
34128
|
+
/* @__PURE__ */ jsx93(
|
|
34129
|
+
DropdownMenuItem,
|
|
34130
|
+
{
|
|
34131
|
+
icon: AlignJustify,
|
|
34132
|
+
label: t("toolbar.justify"),
|
|
34133
|
+
onClick: () => editor.chain().focus().setTextAlign("justify").run(),
|
|
34134
|
+
active: editor.isActive({ textAlign: "justify" })
|
|
34135
|
+
}
|
|
34136
|
+
),
|
|
34137
|
+
hasTableContext && /* @__PURE__ */ jsxs75(Fragment30, { children: [
|
|
34138
|
+
/* @__PURE__ */ jsx93("div", { className: "my-1 border-t" }),
|
|
34139
|
+
/* @__PURE__ */ jsx93(
|
|
34140
|
+
DropdownMenuItem,
|
|
34141
|
+
{
|
|
34142
|
+
icon: AlignStartVertical,
|
|
34143
|
+
label: t("tableMenu.alignVerticalTop") || "Align top",
|
|
34144
|
+
onClick: () => applyTableCellAttribute(editor, "verticalAlign", "top"),
|
|
34145
|
+
active: currentCellVerticalAlign === "top"
|
|
34146
|
+
}
|
|
34147
|
+
),
|
|
34148
|
+
/* @__PURE__ */ jsx93(
|
|
34149
|
+
DropdownMenuItem,
|
|
34150
|
+
{
|
|
34151
|
+
icon: AlignCenterVertical,
|
|
34152
|
+
label: t("tableMenu.alignVerticalMiddle") || "Align middle",
|
|
34153
|
+
onClick: () => applyTableCellAttribute(editor, "verticalAlign", "middle"),
|
|
34154
|
+
active: currentCellVerticalAlign === "middle"
|
|
34155
|
+
}
|
|
34156
|
+
),
|
|
34157
|
+
/* @__PURE__ */ jsx93(
|
|
34158
|
+
DropdownMenuItem,
|
|
34159
|
+
{
|
|
34160
|
+
icon: AlignEndVertical,
|
|
34161
|
+
label: t("tableMenu.alignVerticalBottom") || "Align bottom",
|
|
34162
|
+
onClick: () => applyTableCellAttribute(editor, "verticalAlign", "bottom"),
|
|
34163
|
+
active: currentCellVerticalAlign === "bottom"
|
|
34164
|
+
}
|
|
34165
|
+
)
|
|
34166
|
+
] })
|
|
34167
|
+
]
|
|
34163
34168
|
}
|
|
34164
34169
|
),
|
|
34165
|
-
/* @__PURE__ */
|
|
34166
|
-
|
|
34170
|
+
hasTableContext && /* @__PURE__ */ jsxs75(
|
|
34171
|
+
DropdownMenu,
|
|
34167
34172
|
{
|
|
34168
|
-
|
|
34169
|
-
|
|
34170
|
-
|
|
34171
|
-
|
|
34172
|
-
|
|
34173
|
+
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
34174
|
+
}, title: t("tableMenu.textDirection"), children: [
|
|
34175
|
+
currentCellTextDirection === "vertical" ? /* @__PURE__ */ jsx93(ArrowDown, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx93(ArrowRight, { className: "w-4 h-4" }),
|
|
34176
|
+
/* @__PURE__ */ jsx93(ChevronDown8, { className: "w-3 h-3" })
|
|
34177
|
+
] }),
|
|
34178
|
+
children: [
|
|
34179
|
+
/* @__PURE__ */ jsx93(
|
|
34180
|
+
DropdownMenuItem,
|
|
34181
|
+
{
|
|
34182
|
+
icon: ArrowRight,
|
|
34183
|
+
label: t("tableMenu.horizontalText"),
|
|
34184
|
+
onClick: () => applyTableCellAttribute(editor, "textDirection", null),
|
|
34185
|
+
active: currentCellTextDirection === "horizontal"
|
|
34186
|
+
}
|
|
34187
|
+
),
|
|
34188
|
+
/* @__PURE__ */ jsx93(
|
|
34189
|
+
DropdownMenuItem,
|
|
34190
|
+
{
|
|
34191
|
+
icon: ArrowDown,
|
|
34192
|
+
label: t("tableMenu.verticalText"),
|
|
34193
|
+
onClick: () => applyTableCellAttribute(editor, "textDirection", "vertical"),
|
|
34194
|
+
active: currentCellTextDirection === "vertical"
|
|
34195
|
+
}
|
|
34196
|
+
)
|
|
34197
|
+
]
|
|
34173
34198
|
}
|
|
34174
34199
|
)
|
|
34175
|
-
]
|
|
34176
|
-
}
|
|
34177
|
-
),
|
|
34178
|
-
(isMediumFull || isFull) && /* @__PURE__ */ jsx92(
|
|
34179
|
-
DropdownMenu,
|
|
34180
|
-
{
|
|
34181
|
-
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
34182
|
-
}, title: t("toolbar.image"), children: [
|
|
34183
|
-
/* @__PURE__ */ jsx92(ImageIcon2, { className: "w-4 h-4" }),
|
|
34184
|
-
/* @__PURE__ */ jsx92(ChevronDown8, { className: "w-3 h-3" })
|
|
34185
34200
|
] }),
|
|
34186
|
-
|
|
34187
|
-
|
|
34201
|
+
/* @__PURE__ */ jsx93(ToolbarDivider, {}),
|
|
34202
|
+
/* @__PURE__ */ jsxs75(
|
|
34203
|
+
DropdownMenu,
|
|
34188
34204
|
{
|
|
34189
|
-
|
|
34190
|
-
|
|
34191
|
-
|
|
34192
|
-
|
|
34193
|
-
|
|
34205
|
+
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
34206
|
+
}, title: t("toolbar.bulletList"), children: [
|
|
34207
|
+
/* @__PURE__ */ jsx93(FigmaListIcon, { className: "h-4 w-4" }),
|
|
34208
|
+
/* @__PURE__ */ jsx93(FigmaChevronDownIcon, { className: "h-2.5 w-2.5" })
|
|
34209
|
+
] }),
|
|
34210
|
+
children: [
|
|
34211
|
+
/* @__PURE__ */ jsx93(
|
|
34212
|
+
DropdownMenuItem,
|
|
34213
|
+
{
|
|
34214
|
+
icon: ListIcon,
|
|
34215
|
+
label: t("toolbar.bulletList"),
|
|
34216
|
+
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
34217
|
+
active: editor.isActive("bulletList"),
|
|
34218
|
+
shortcut: "Ctrl+Shift+8"
|
|
34219
|
+
}
|
|
34220
|
+
),
|
|
34221
|
+
/* @__PURE__ */ jsx93(
|
|
34222
|
+
DropdownMenuItem,
|
|
34223
|
+
{
|
|
34224
|
+
icon: ListOrderedIcon,
|
|
34225
|
+
label: t("toolbar.orderedList"),
|
|
34226
|
+
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
34227
|
+
active: editor.isActive("orderedList"),
|
|
34228
|
+
shortcut: "Ctrl+Shift+7"
|
|
34229
|
+
}
|
|
34230
|
+
),
|
|
34231
|
+
/* @__PURE__ */ jsx93(
|
|
34232
|
+
DropdownMenuItem,
|
|
34233
|
+
{
|
|
34234
|
+
icon: ListTodo2,
|
|
34235
|
+
label: t("toolbar.taskList"),
|
|
34236
|
+
onClick: () => editor.chain().focus().toggleTaskList().run(),
|
|
34237
|
+
active: editor.isActive("taskList"),
|
|
34238
|
+
shortcut: "Ctrl+Shift+9"
|
|
34239
|
+
}
|
|
34240
|
+
)
|
|
34241
|
+
]
|
|
34194
34242
|
}
|
|
34195
|
-
)
|
|
34196
|
-
|
|
34197
|
-
|
|
34198
|
-
|
|
34199
|
-
{
|
|
34200
|
-
|
|
34201
|
-
|
|
34202
|
-
|
|
34203
|
-
|
|
34204
|
-
|
|
34205
|
-
|
|
34206
|
-
|
|
34207
|
-
|
|
34208
|
-
|
|
34209
|
-
|
|
34210
|
-
|
|
34211
|
-
|
|
34212
|
-
|
|
34213
|
-
|
|
34214
|
-
|
|
34215
|
-
|
|
34216
|
-
|
|
34217
|
-
|
|
34218
|
-
|
|
34219
|
-
|
|
34220
|
-
|
|
34221
|
-
|
|
34222
|
-
|
|
34223
|
-
|
|
34224
|
-
|
|
34225
|
-
|
|
34226
|
-
|
|
34227
|
-
|
|
34228
|
-
|
|
34229
|
-
|
|
34230
|
-
|
|
34231
|
-
|
|
34232
|
-
}
|
|
34233
|
-
|
|
34234
|
-
|
|
34235
|
-
|
|
34236
|
-
|
|
34237
|
-
|
|
34238
|
-
|
|
34239
|
-
|
|
34240
|
-
|
|
34241
|
-
|
|
34242
|
-
|
|
34243
|
-
|
|
34244
|
-
|
|
34245
|
-
|
|
34246
|
-
|
|
34247
|
-
|
|
34248
|
-
|
|
34249
|
-
|
|
34250
|
-
|
|
34251
|
-
|
|
34252
|
-
|
|
34253
|
-
|
|
34254
|
-
|
|
34255
|
-
|
|
34256
|
-
|
|
34257
|
-
|
|
34258
|
-
|
|
34259
|
-
|
|
34260
|
-
|
|
34261
|
-
|
|
34262
|
-
|
|
34263
|
-
|
|
34264
|
-
|
|
34265
|
-
|
|
34266
|
-
|
|
34267
|
-
|
|
34268
|
-
|
|
34269
|
-
|
|
34270
|
-
|
|
34271
|
-
|
|
34272
|
-
|
|
34273
|
-
/* @__PURE__ */ jsx92(
|
|
34274
|
-
DropdownMenuItem,
|
|
34275
|
-
{
|
|
34276
|
-
label: t("toolbar.imageWidthLg"),
|
|
34277
|
-
onClick: () => applyImageWidthPreset(editor, "lg"),
|
|
34278
|
-
active: isImageSelected && imageWidthPreset === "lg",
|
|
34279
|
-
disabled: !isImageSelected
|
|
34280
|
-
}
|
|
34281
|
-
),
|
|
34282
|
-
/* @__PURE__ */ jsx92("div", { className: "my-1 border-t" }),
|
|
34283
|
-
/* @__PURE__ */ jsx92(
|
|
34284
|
-
DropdownMenuItem,
|
|
34285
|
-
{
|
|
34286
|
-
icon: RotateCcw2,
|
|
34287
|
-
label: t("toolbar.imageResetSize"),
|
|
34288
|
-
onClick: () => resetImageSize(editor),
|
|
34289
|
-
disabled: !isImageSelected
|
|
34290
|
-
}
|
|
34291
|
-
),
|
|
34292
|
-
/* @__PURE__ */ jsx92(
|
|
34293
|
-
DropdownMenuItem,
|
|
34294
|
-
{
|
|
34295
|
-
icon: Trash22,
|
|
34296
|
-
label: t("toolbar.imageDelete"),
|
|
34297
|
-
onClick: () => deleteSelectedImage(editor),
|
|
34298
|
-
disabled: !isImageSelected,
|
|
34299
|
-
destructive: true
|
|
34300
|
-
}
|
|
34301
|
-
)
|
|
34302
|
-
] })
|
|
34303
|
-
}
|
|
34304
|
-
),
|
|
34305
|
-
(isMediumFull || isFull) && /* @__PURE__ */ jsxs75(
|
|
34306
|
-
DropdownMenu,
|
|
34307
|
-
{
|
|
34308
|
-
isOpen: isTableMenuOpen,
|
|
34309
|
-
onOpenChange: (open) => {
|
|
34310
|
-
setIsTableMenuOpen(open);
|
|
34311
|
-
setPreservedTableAnchorPos(open ? getTableAnchorPos(editor) : null);
|
|
34312
|
-
},
|
|
34313
|
-
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
34314
|
-
}, title: t("toolbar.table"), children: [
|
|
34315
|
-
/* @__PURE__ */ jsx92(TableIcon, { className: "w-4 h-4" }),
|
|
34316
|
-
/* @__PURE__ */ jsx92(ChevronDown8, { className: "w-3 h-3" })
|
|
34317
|
-
] }),
|
|
34318
|
-
contentClassName: "p-2 min-w-56",
|
|
34319
|
-
children: [
|
|
34320
|
-
/* @__PURE__ */ jsx92(
|
|
34321
|
-
TableInsertGrid,
|
|
34322
|
-
{
|
|
34323
|
-
insertLabel: t("tableMenu.insertTable"),
|
|
34324
|
-
previewTemplate: t("tableMenu.gridPreview"),
|
|
34325
|
-
onInsert: (rows, cols) => {
|
|
34326
|
-
editor.chain().focus().insertTable({ rows, cols, withHeaderRow: true }).run();
|
|
34327
|
-
setIsTableMenuOpen(false);
|
|
34328
|
-
setPreservedTableAnchorPos(null);
|
|
34243
|
+
),
|
|
34244
|
+
/* @__PURE__ */ jsxs75(
|
|
34245
|
+
DropdownMenu,
|
|
34246
|
+
{
|
|
34247
|
+
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
34248
|
+
}, active: editor.isActive("formCheckbox"), title: t("slashCommand.formCheckbox"), children: [
|
|
34249
|
+
/* @__PURE__ */ jsx93(SquareCheckBig, { className: "w-4 h-4" }),
|
|
34250
|
+
/* @__PURE__ */ jsx93(ChevronDown8, { className: "w-3 h-3" })
|
|
34251
|
+
] }),
|
|
34252
|
+
children: [
|
|
34253
|
+
/* @__PURE__ */ jsx93(
|
|
34254
|
+
DropdownMenuItem,
|
|
34255
|
+
{
|
|
34256
|
+
icon: SquareCheckBig,
|
|
34257
|
+
label: t("slashCommand.formCheckbox"),
|
|
34258
|
+
onClick: () => editor.chain().focus().setFormCheckbox().run()
|
|
34259
|
+
}
|
|
34260
|
+
),
|
|
34261
|
+
/* @__PURE__ */ jsx93(
|
|
34262
|
+
DropdownMenuItem,
|
|
34263
|
+
{
|
|
34264
|
+
icon: CircleCheckBig2,
|
|
34265
|
+
label: t("slashCommand.roundCheckbox"),
|
|
34266
|
+
onClick: () => editor.chain().focus().setFormCheckbox({ variant: "circle" }).run()
|
|
34267
|
+
}
|
|
34268
|
+
)
|
|
34269
|
+
]
|
|
34270
|
+
}
|
|
34271
|
+
),
|
|
34272
|
+
isMediumFull && /* @__PURE__ */ jsx93(ToolbarButton, { onClick: () => editor.chain().focus().toggleBlockquote().run(), active: editor.isActive("blockquote"), title: t("toolbar.quote"), children: /* @__PURE__ */ jsx93(FigmaQuoteIcon, { className: "h-4 w-4" }) }),
|
|
34273
|
+
isFull && /* @__PURE__ */ jsxs75(
|
|
34274
|
+
DropdownMenu,
|
|
34275
|
+
{
|
|
34276
|
+
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
34277
|
+
}, title: t("toolbar.quote"), children: [
|
|
34278
|
+
/* @__PURE__ */ jsx93(FigmaQuoteIcon, { className: "h-4 w-4" }),
|
|
34279
|
+
/* @__PURE__ */ jsx93(FigmaChevronDownIcon, { className: "h-2.5 w-2.5" })
|
|
34280
|
+
] }),
|
|
34281
|
+
children: [
|
|
34282
|
+
/* @__PURE__ */ jsx93(
|
|
34283
|
+
DropdownMenuItem,
|
|
34284
|
+
{
|
|
34285
|
+
icon: QuoteIcon,
|
|
34286
|
+
label: t("toolbar.quote"),
|
|
34287
|
+
onClick: () => editor.chain().focus().toggleBlockquote().run(),
|
|
34288
|
+
active: editor.isActive("blockquote"),
|
|
34289
|
+
shortcut: "Ctrl+Shift+B"
|
|
34290
|
+
}
|
|
34291
|
+
),
|
|
34292
|
+
/* @__PURE__ */ jsx93(
|
|
34293
|
+
DropdownMenuItem,
|
|
34294
|
+
{
|
|
34295
|
+
icon: FileCode3,
|
|
34296
|
+
label: t("toolbar.codeBlock"),
|
|
34297
|
+
onClick: () => editor.chain().focus().toggleCodeBlock().run(),
|
|
34298
|
+
active: editor.isActive("codeBlock"),
|
|
34299
|
+
shortcut: "Ctrl+Alt+C"
|
|
34300
|
+
}
|
|
34301
|
+
)
|
|
34302
|
+
]
|
|
34303
|
+
}
|
|
34304
|
+
),
|
|
34305
|
+
(isMediumFull || isFull) && /* @__PURE__ */ jsx93(
|
|
34306
|
+
DropdownMenu,
|
|
34307
|
+
{
|
|
34308
|
+
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
34309
|
+
}, title: t("toolbar.image"), children: [
|
|
34310
|
+
/* @__PURE__ */ jsx93(FigmaImageIcon, { className: "h-4 w-4" }),
|
|
34311
|
+
/* @__PURE__ */ jsx93(FigmaChevronDownIcon, { className: "h-2.5 w-2.5" })
|
|
34312
|
+
] }),
|
|
34313
|
+
children: showImageInput ? /* @__PURE__ */ jsx93(
|
|
34314
|
+
ImageInput,
|
|
34315
|
+
{
|
|
34316
|
+
onSubmit: (url, alt) => {
|
|
34317
|
+
editor.chain().focus().setImage({ src: url, alt }).run();
|
|
34318
|
+
setShowImageInput(false);
|
|
34319
|
+
},
|
|
34320
|
+
onCancel: () => setShowImageInput(false)
|
|
34329
34321
|
}
|
|
34330
|
-
|
|
34331
|
-
|
|
34332
|
-
|
|
34333
|
-
|
|
34334
|
-
|
|
34335
|
-
|
|
34336
|
-
|
|
34337
|
-
|
|
34338
|
-
|
|
34339
|
-
|
|
34340
|
-
|
|
34341
|
-
|
|
34342
|
-
|
|
34343
|
-
|
|
34344
|
-
|
|
34345
|
-
|
|
34346
|
-
|
|
34347
|
-
|
|
34348
|
-
|
|
34349
|
-
|
|
34350
|
-
|
|
34351
|
-
|
|
34352
|
-
|
|
34353
|
-
|
|
34354
|
-
|
|
34355
|
-
|
|
34356
|
-
|
|
34357
|
-
|
|
34358
|
-
|
|
34359
|
-
|
|
34360
|
-
|
|
34361
|
-
|
|
34362
|
-
|
|
34363
|
-
|
|
34364
|
-
|
|
34365
|
-
|
|
34322
|
+
) : /* @__PURE__ */ jsxs75(Fragment30, { children: [
|
|
34323
|
+
/* @__PURE__ */ jsx93(DropdownMenuItem, { icon: LinkIcon, label: t("imageInput.addFromUrl"), onClick: () => setShowImageInput(true), closeOnSelect: false }),
|
|
34324
|
+
/* @__PURE__ */ jsx93(
|
|
34325
|
+
DropdownMenuItem,
|
|
34326
|
+
{
|
|
34327
|
+
icon: Upload3,
|
|
34328
|
+
label: isUploadingImage ? t("imageInput.uploading") : t("imageInput.uploadTab"),
|
|
34329
|
+
disabled: isUploadingImage,
|
|
34330
|
+
onClick: () => fileInputRef.current?.click(),
|
|
34331
|
+
closeOnSelect: false
|
|
34332
|
+
}
|
|
34333
|
+
),
|
|
34334
|
+
imageUploadError && /* @__PURE__ */ jsx93(DropdownMenuItem, { label: imageUploadError, disabled: true, destructive: true }),
|
|
34335
|
+
/* @__PURE__ */ jsx93(
|
|
34336
|
+
"input",
|
|
34337
|
+
{
|
|
34338
|
+
ref: fileInputRef,
|
|
34339
|
+
type: "file",
|
|
34340
|
+
accept: "image/*",
|
|
34341
|
+
multiple: true,
|
|
34342
|
+
className: "hidden",
|
|
34343
|
+
onChange: (e) => {
|
|
34344
|
+
const files = Array.from(e.target.files ?? []);
|
|
34345
|
+
e.target.value = "";
|
|
34346
|
+
void insertImageFiles(files);
|
|
34347
|
+
}
|
|
34348
|
+
}
|
|
34349
|
+
),
|
|
34350
|
+
/* @__PURE__ */ jsx93("div", { className: "my-1 border-t" }),
|
|
34351
|
+
/* @__PURE__ */ jsx93(
|
|
34352
|
+
DropdownMenuItem,
|
|
34353
|
+
{
|
|
34354
|
+
icon: AlignCenter,
|
|
34355
|
+
label: t("toolbar.imageLayoutBlock"),
|
|
34356
|
+
onClick: () => applyImageLayout(editor, "block"),
|
|
34357
|
+
active: isImageSelected && imageLayout === "block",
|
|
34358
|
+
disabled: !isImageSelected
|
|
34359
|
+
}
|
|
34360
|
+
),
|
|
34361
|
+
/* @__PURE__ */ jsx93(
|
|
34362
|
+
DropdownMenuItem,
|
|
34363
|
+
{
|
|
34364
|
+
icon: AlignLeft,
|
|
34365
|
+
label: t("toolbar.imageLayoutLeft"),
|
|
34366
|
+
onClick: () => applyImageLayout(editor, "left"),
|
|
34367
|
+
active: isImageSelected && imageLayout === "left",
|
|
34368
|
+
disabled: !isImageSelected
|
|
34369
|
+
}
|
|
34370
|
+
),
|
|
34371
|
+
/* @__PURE__ */ jsx93(
|
|
34372
|
+
DropdownMenuItem,
|
|
34373
|
+
{
|
|
34374
|
+
icon: AlignRight,
|
|
34375
|
+
label: t("toolbar.imageLayoutRight"),
|
|
34376
|
+
onClick: () => applyImageLayout(editor, "right"),
|
|
34377
|
+
active: isImageSelected && imageLayout === "right",
|
|
34378
|
+
disabled: !isImageSelected
|
|
34379
|
+
}
|
|
34380
|
+
),
|
|
34381
|
+
/* @__PURE__ */ jsx93("div", { className: "my-1 border-t" }),
|
|
34382
|
+
/* @__PURE__ */ jsx93(
|
|
34383
|
+
DropdownMenuItem,
|
|
34384
|
+
{
|
|
34385
|
+
label: t("toolbar.imageWidthSm"),
|
|
34386
|
+
onClick: () => applyImageWidthPreset(editor, "sm"),
|
|
34387
|
+
active: isImageSelected && imageWidthPreset === "sm",
|
|
34388
|
+
disabled: !isImageSelected
|
|
34389
|
+
}
|
|
34390
|
+
),
|
|
34391
|
+
/* @__PURE__ */ jsx93(
|
|
34392
|
+
DropdownMenuItem,
|
|
34393
|
+
{
|
|
34394
|
+
label: t("toolbar.imageWidthMd"),
|
|
34395
|
+
onClick: () => applyImageWidthPreset(editor, "md"),
|
|
34396
|
+
active: isImageSelected && imageWidthPreset === "md",
|
|
34397
|
+
disabled: !isImageSelected
|
|
34398
|
+
}
|
|
34399
|
+
),
|
|
34400
|
+
/* @__PURE__ */ jsx93(
|
|
34401
|
+
DropdownMenuItem,
|
|
34402
|
+
{
|
|
34403
|
+
label: t("toolbar.imageWidthLg"),
|
|
34404
|
+
onClick: () => applyImageWidthPreset(editor, "lg"),
|
|
34405
|
+
active: isImageSelected && imageWidthPreset === "lg",
|
|
34406
|
+
disabled: !isImageSelected
|
|
34407
|
+
}
|
|
34408
|
+
),
|
|
34409
|
+
/* @__PURE__ */ jsx93("div", { className: "my-1 border-t" }),
|
|
34410
|
+
/* @__PURE__ */ jsx93(
|
|
34411
|
+
DropdownMenuItem,
|
|
34412
|
+
{
|
|
34413
|
+
icon: RotateCcw2,
|
|
34414
|
+
label: t("toolbar.imageResetSize"),
|
|
34415
|
+
onClick: () => resetImageSize(editor),
|
|
34416
|
+
disabled: !isImageSelected
|
|
34417
|
+
}
|
|
34418
|
+
),
|
|
34419
|
+
/* @__PURE__ */ jsx93(
|
|
34420
|
+
DropdownMenuItem,
|
|
34421
|
+
{
|
|
34422
|
+
icon: Trash22,
|
|
34423
|
+
label: t("toolbar.imageDelete"),
|
|
34424
|
+
onClick: () => deleteSelectedImage(editor),
|
|
34425
|
+
disabled: !isImageSelected,
|
|
34426
|
+
destructive: true
|
|
34427
|
+
}
|
|
34428
|
+
)
|
|
34429
|
+
] })
|
|
34430
|
+
}
|
|
34431
|
+
),
|
|
34432
|
+
(isMediumFull || isFull) && /* @__PURE__ */ jsxs75(
|
|
34433
|
+
DropdownMenu,
|
|
34434
|
+
{
|
|
34435
|
+
isOpen: isTableMenuOpen,
|
|
34436
|
+
onOpenChange: (open) => {
|
|
34437
|
+
setIsTableMenuOpen(open);
|
|
34438
|
+
setPreservedTableAnchorPos(open ? getTableAnchorPos(editor) : null);
|
|
34439
|
+
},
|
|
34440
|
+
trigger: /* @__PURE__ */ jsxs75(ToolbarButton, { onClick: () => {
|
|
34441
|
+
}, title: t("toolbar.table"), children: [
|
|
34442
|
+
/* @__PURE__ */ jsx93(FigmaTableIcon, { className: "h-4 w-4" }),
|
|
34443
|
+
/* @__PURE__ */ jsx93(FigmaChevronDownIcon, { className: "h-2.5 w-2.5" })
|
|
34444
|
+
] }),
|
|
34445
|
+
contentClassName: "p-2 min-w-56",
|
|
34446
|
+
children: [
|
|
34447
|
+
/* @__PURE__ */ jsx93(
|
|
34448
|
+
TableInsertGrid,
|
|
34449
|
+
{
|
|
34450
|
+
insertLabel: t("tableMenu.insertTable"),
|
|
34451
|
+
previewTemplate: t("tableMenu.gridPreview"),
|
|
34452
|
+
onInsert: (rows, cols) => {
|
|
34453
|
+
editor.chain().focus().insertTable({ rows, cols, withHeaderRow: true }).run();
|
|
34454
|
+
setIsTableMenuOpen(false);
|
|
34455
|
+
setPreservedTableAnchorPos(null);
|
|
34456
|
+
}
|
|
34457
|
+
}
|
|
34458
|
+
),
|
|
34459
|
+
/* @__PURE__ */ jsx93("div", { className: "my-1 border-t" }),
|
|
34460
|
+
/* @__PURE__ */ jsx93(
|
|
34461
|
+
DropdownMenuItem,
|
|
34462
|
+
{
|
|
34463
|
+
icon: AlignLeft,
|
|
34464
|
+
label: t("tableMenu.alignLeft"),
|
|
34465
|
+
onClick: () => applyTableAlignment(editor, "left", tableCommandAnchorPos),
|
|
34466
|
+
active: hasTableContext && currentTableAlign === "left",
|
|
34467
|
+
disabled: !hasTableContext
|
|
34468
|
+
}
|
|
34469
|
+
),
|
|
34470
|
+
/* @__PURE__ */ jsx93(
|
|
34471
|
+
DropdownMenuItem,
|
|
34472
|
+
{
|
|
34473
|
+
icon: AlignCenter,
|
|
34474
|
+
label: t("tableMenu.alignCenter"),
|
|
34475
|
+
onClick: () => applyTableAlignment(editor, "center", tableCommandAnchorPos),
|
|
34476
|
+
active: hasTableContext && currentTableAlign === "center",
|
|
34477
|
+
disabled: !hasTableContext
|
|
34478
|
+
}
|
|
34479
|
+
),
|
|
34480
|
+
/* @__PURE__ */ jsx93(
|
|
34481
|
+
DropdownMenuItem,
|
|
34482
|
+
{
|
|
34483
|
+
icon: AlignRight,
|
|
34484
|
+
label: t("tableMenu.alignRight"),
|
|
34485
|
+
onClick: () => applyTableAlignment(editor, "right", tableCommandAnchorPos),
|
|
34486
|
+
active: hasTableContext && currentTableAlign === "right",
|
|
34487
|
+
disabled: !hasTableContext
|
|
34488
|
+
}
|
|
34489
|
+
),
|
|
34490
|
+
/* @__PURE__ */ jsx93("div", { className: "my-1 border-t" }),
|
|
34491
|
+
/* @__PURE__ */ jsx93(
|
|
34492
|
+
DropdownMenuItem,
|
|
34493
|
+
{
|
|
34494
|
+
icon: ArrowLeft,
|
|
34495
|
+
label: t("tableMenu.addColumnBefore"),
|
|
34496
|
+
onClick: () => editor.chain().focus().addColumnBefore().run(),
|
|
34497
|
+
disabled: !hasTableContext || !editor.can().addColumnBefore()
|
|
34498
|
+
}
|
|
34499
|
+
),
|
|
34500
|
+
/* @__PURE__ */ jsx93(
|
|
34501
|
+
DropdownMenuItem,
|
|
34502
|
+
{
|
|
34503
|
+
icon: ArrowDown,
|
|
34504
|
+
label: t("tableMenu.addColumnAfter"),
|
|
34505
|
+
onClick: () => editor.chain().focus().addColumnAfter().run(),
|
|
34506
|
+
disabled: !hasTableContext || !editor.can().addColumnAfter()
|
|
34507
|
+
}
|
|
34508
|
+
),
|
|
34509
|
+
/* @__PURE__ */ jsx93(
|
|
34510
|
+
DropdownMenuItem,
|
|
34511
|
+
{
|
|
34512
|
+
icon: ArrowUp,
|
|
34513
|
+
label: t("tableMenu.addRowBefore"),
|
|
34514
|
+
onClick: () => editor.chain().focus().addRowBefore().run(),
|
|
34515
|
+
disabled: !hasTableContext || !editor.can().addRowBefore()
|
|
34516
|
+
}
|
|
34517
|
+
),
|
|
34518
|
+
/* @__PURE__ */ jsx93(
|
|
34519
|
+
DropdownMenuItem,
|
|
34520
|
+
{
|
|
34521
|
+
icon: ArrowRight,
|
|
34522
|
+
label: t("tableMenu.addRowAfter"),
|
|
34523
|
+
onClick: () => editor.chain().focus().addRowAfter().run(),
|
|
34524
|
+
disabled: !hasTableContext || !editor.can().addRowAfter()
|
|
34525
|
+
}
|
|
34526
|
+
),
|
|
34527
|
+
/* @__PURE__ */ jsx93("div", { className: "my-1 border-t" }),
|
|
34528
|
+
/* @__PURE__ */ jsx93(
|
|
34529
|
+
DropdownMenuItem,
|
|
34530
|
+
{
|
|
34531
|
+
icon: TableIcon,
|
|
34532
|
+
label: t("tableMenu.toggleHeaderRow"),
|
|
34533
|
+
onClick: () => editor.chain().focus().toggleHeaderRow().run(),
|
|
34534
|
+
disabled: !hasTableContext || !editor.can().toggleHeaderRow()
|
|
34535
|
+
}
|
|
34536
|
+
),
|
|
34537
|
+
/* @__PURE__ */ jsx93(
|
|
34538
|
+
DropdownMenuItem,
|
|
34539
|
+
{
|
|
34540
|
+
icon: TableIcon,
|
|
34541
|
+
label: t("tableMenu.toggleHeaderColumn"),
|
|
34542
|
+
onClick: () => editor.chain().focus().toggleHeaderColumn().run(),
|
|
34543
|
+
disabled: !hasTableContext || !editor.can().toggleHeaderColumn()
|
|
34544
|
+
}
|
|
34545
|
+
),
|
|
34546
|
+
/* @__PURE__ */ jsx93("div", { className: "my-1 border-t" }),
|
|
34547
|
+
/* @__PURE__ */ jsx93(
|
|
34548
|
+
DropdownMenuItem,
|
|
34549
|
+
{
|
|
34550
|
+
icon: Trash22,
|
|
34551
|
+
label: t("tableMenu.deleteColumn"),
|
|
34552
|
+
onClick: () => editor.chain().focus().deleteColumn().run(),
|
|
34553
|
+
disabled: !hasTableContext || !editor.can().deleteColumn()
|
|
34554
|
+
}
|
|
34555
|
+
),
|
|
34556
|
+
/* @__PURE__ */ jsx93(
|
|
34557
|
+
DropdownMenuItem,
|
|
34558
|
+
{
|
|
34559
|
+
icon: Trash22,
|
|
34560
|
+
label: t("tableMenu.deleteRow"),
|
|
34561
|
+
onClick: () => editor.chain().focus().deleteRow().run(),
|
|
34562
|
+
disabled: !hasTableContext || !editor.can().deleteRow()
|
|
34563
|
+
}
|
|
34564
|
+
),
|
|
34565
|
+
/* @__PURE__ */ jsx93(
|
|
34566
|
+
DropdownMenuItem,
|
|
34567
|
+
{
|
|
34568
|
+
icon: Trash22,
|
|
34569
|
+
label: t("tableMenu.deleteTable"),
|
|
34570
|
+
onClick: () => editor.chain().focus().deleteTable().run(),
|
|
34571
|
+
disabled: !hasTableContext || !editor.can().deleteTable()
|
|
34572
|
+
}
|
|
34573
|
+
)
|
|
34574
|
+
]
|
|
34575
|
+
}
|
|
34576
|
+
),
|
|
34577
|
+
/* @__PURE__ */ jsx93(ToolbarDivider, {}),
|
|
34578
|
+
/* @__PURE__ */ jsx93(ToolbarButton, { onClick: () => editor.chain().focus().undo().run(), disabled: !editor.can().undo(), title: t("toolbar.undo"), children: /* @__PURE__ */ jsx93(FigmaUndoIcon, { className: "h-4 w-4" }) }),
|
|
34579
|
+
/* @__PURE__ */ jsx93(ToolbarButton, { onClick: () => editor.chain().focus().redo().run(), disabled: !editor.can().redo(), title: t("toolbar.redo"), children: /* @__PURE__ */ jsx93(FigmaRedoIcon, { className: "h-4 w-4" }) }),
|
|
34580
|
+
hasTableContext && /* @__PURE__ */ jsxs75(Fragment30, { children: [
|
|
34581
|
+
/* @__PURE__ */ jsx93(ToolbarDivider, {}),
|
|
34582
|
+
/* @__PURE__ */ jsx93(
|
|
34583
|
+
ToolbarButton,
|
|
34366
34584
|
{
|
|
34367
|
-
icon: ArrowLeft,
|
|
34368
|
-
label: t("tableMenu.addColumnBefore"),
|
|
34369
34585
|
onClick: () => editor.chain().focus().addColumnBefore().run(),
|
|
34370
|
-
disabled: !
|
|
34586
|
+
disabled: !editor.can().addColumnBefore(),
|
|
34587
|
+
title: t("tableMenu.addColumnBefore"),
|
|
34588
|
+
children: /* @__PURE__ */ jsx93(ArrowLeft, { className: "w-4 h-4" })
|
|
34371
34589
|
}
|
|
34372
34590
|
),
|
|
34373
|
-
/* @__PURE__ */
|
|
34374
|
-
|
|
34591
|
+
/* @__PURE__ */ jsx93(
|
|
34592
|
+
ToolbarButton,
|
|
34375
34593
|
{
|
|
34376
|
-
icon: ArrowDown,
|
|
34377
|
-
label: t("tableMenu.addColumnAfter"),
|
|
34378
34594
|
onClick: () => editor.chain().focus().addColumnAfter().run(),
|
|
34379
|
-
disabled: !
|
|
34595
|
+
disabled: !editor.can().addColumnAfter(),
|
|
34596
|
+
title: t("tableMenu.addColumnAfter"),
|
|
34597
|
+
children: /* @__PURE__ */ jsx93(ArrowRight, { className: "w-4 h-4" })
|
|
34380
34598
|
}
|
|
34381
34599
|
),
|
|
34382
|
-
/* @__PURE__ */
|
|
34383
|
-
|
|
34600
|
+
/* @__PURE__ */ jsx93(
|
|
34601
|
+
ToolbarButton,
|
|
34384
34602
|
{
|
|
34385
|
-
icon: ArrowUp,
|
|
34386
|
-
label: t("tableMenu.addRowBefore"),
|
|
34387
34603
|
onClick: () => editor.chain().focus().addRowBefore().run(),
|
|
34388
|
-
disabled: !
|
|
34604
|
+
disabled: !editor.can().addRowBefore(),
|
|
34605
|
+
title: t("tableMenu.addRowBefore"),
|
|
34606
|
+
children: /* @__PURE__ */ jsx93(ArrowUp, { className: "w-4 h-4" })
|
|
34389
34607
|
}
|
|
34390
34608
|
),
|
|
34391
|
-
/* @__PURE__ */
|
|
34392
|
-
|
|
34609
|
+
/* @__PURE__ */ jsx93(
|
|
34610
|
+
ToolbarButton,
|
|
34393
34611
|
{
|
|
34394
|
-
icon: ArrowRight,
|
|
34395
|
-
label: t("tableMenu.addRowAfter"),
|
|
34396
34612
|
onClick: () => editor.chain().focus().addRowAfter().run(),
|
|
34397
|
-
disabled: !
|
|
34398
|
-
|
|
34399
|
-
|
|
34400
|
-
/* @__PURE__ */ jsx92("div", { className: "my-1 border-t" }),
|
|
34401
|
-
/* @__PURE__ */ jsx92(
|
|
34402
|
-
DropdownMenuItem,
|
|
34403
|
-
{
|
|
34404
|
-
icon: TableIcon,
|
|
34405
|
-
label: t("tableMenu.toggleHeaderRow"),
|
|
34406
|
-
onClick: () => editor.chain().focus().toggleHeaderRow().run(),
|
|
34407
|
-
disabled: !hasTableContext || !editor.can().toggleHeaderRow()
|
|
34613
|
+
disabled: !editor.can().addRowAfter(),
|
|
34614
|
+
title: t("tableMenu.addRowAfter"),
|
|
34615
|
+
children: /* @__PURE__ */ jsx93(ArrowDown, { className: "w-4 h-4" })
|
|
34408
34616
|
}
|
|
34409
34617
|
),
|
|
34410
|
-
/* @__PURE__ */
|
|
34411
|
-
|
|
34412
|
-
{
|
|
34413
|
-
icon: TableIcon,
|
|
34414
|
-
label: t("tableMenu.toggleHeaderColumn"),
|
|
34415
|
-
onClick: () => editor.chain().focus().toggleHeaderColumn().run(),
|
|
34416
|
-
disabled: !hasTableContext || !editor.can().toggleHeaderColumn()
|
|
34417
|
-
}
|
|
34418
|
-
),
|
|
34419
|
-
/* @__PURE__ */ jsx92("div", { className: "my-1 border-t" }),
|
|
34420
|
-
/* @__PURE__ */ jsx92(
|
|
34421
|
-
DropdownMenuItem,
|
|
34422
|
-
{
|
|
34423
|
-
icon: Trash22,
|
|
34424
|
-
label: t("tableMenu.deleteColumn"),
|
|
34425
|
-
onClick: () => editor.chain().focus().deleteColumn().run(),
|
|
34426
|
-
disabled: !hasTableContext || !editor.can().deleteColumn()
|
|
34427
|
-
}
|
|
34428
|
-
),
|
|
34429
|
-
/* @__PURE__ */ jsx92(
|
|
34430
|
-
DropdownMenuItem,
|
|
34431
|
-
{
|
|
34432
|
-
icon: Trash22,
|
|
34433
|
-
label: t("tableMenu.deleteRow"),
|
|
34434
|
-
onClick: () => editor.chain().focus().deleteRow().run(),
|
|
34435
|
-
disabled: !hasTableContext || !editor.can().deleteRow()
|
|
34436
|
-
}
|
|
34437
|
-
),
|
|
34438
|
-
/* @__PURE__ */ jsx92(
|
|
34439
|
-
DropdownMenuItem,
|
|
34618
|
+
/* @__PURE__ */ jsx93(
|
|
34619
|
+
ToolbarButton,
|
|
34440
34620
|
{
|
|
34441
|
-
|
|
34442
|
-
|
|
34443
|
-
|
|
34444
|
-
|
|
34621
|
+
onClick: () => {
|
|
34622
|
+
if (canSplitCell) {
|
|
34623
|
+
editor.chain().focus().splitCell().run();
|
|
34624
|
+
return;
|
|
34625
|
+
}
|
|
34626
|
+
mergeTableCellsPreservingColumnWidths(editor);
|
|
34627
|
+
},
|
|
34628
|
+
active: canSplitCell,
|
|
34629
|
+
disabled: !canMergeCells && !canSplitCell,
|
|
34630
|
+
title: canSplitCell ? t("tableMenu.splitCell") : t("tableMenu.mergeCells"),
|
|
34631
|
+
children: /* @__PURE__ */ jsx93(TableCellsMerge, { className: "w-4 h-4" })
|
|
34445
34632
|
}
|
|
34446
34633
|
)
|
|
34447
|
-
]
|
|
34448
|
-
|
|
34449
|
-
|
|
34450
|
-
|
|
34451
|
-
/* @__PURE__ */ jsx92(ToolbarButton, { onClick: () => editor.chain().focus().undo().run(), disabled: !editor.can().undo(), title: t("toolbar.undo"), children: /* @__PURE__ */ jsx92(UndoIcon, { className: "w-4 h-4" }) }),
|
|
34452
|
-
/* @__PURE__ */ jsx92(ToolbarButton, { onClick: () => editor.chain().focus().redo().run(), disabled: !editor.can().redo(), title: t("toolbar.redo"), children: /* @__PURE__ */ jsx92(RedoIcon, { className: "w-4 h-4" }) }),
|
|
34453
|
-
hasTableContext && /* @__PURE__ */ jsxs75(Fragment30, { children: [
|
|
34454
|
-
/* @__PURE__ */ jsx92(ToolbarDivider, {}),
|
|
34455
|
-
/* @__PURE__ */ jsx92(
|
|
34456
|
-
ToolbarButton,
|
|
34457
|
-
{
|
|
34458
|
-
onClick: () => editor.chain().focus().addColumnBefore().run(),
|
|
34459
|
-
disabled: !editor.can().addColumnBefore(),
|
|
34460
|
-
title: t("tableMenu.addColumnBefore"),
|
|
34461
|
-
children: /* @__PURE__ */ jsx92(ArrowLeft, { className: "w-4 h-4" })
|
|
34462
|
-
}
|
|
34463
|
-
),
|
|
34464
|
-
/* @__PURE__ */ jsx92(
|
|
34465
|
-
ToolbarButton,
|
|
34466
|
-
{
|
|
34467
|
-
onClick: () => editor.chain().focus().addColumnAfter().run(),
|
|
34468
|
-
disabled: !editor.can().addColumnAfter(),
|
|
34469
|
-
title: t("tableMenu.addColumnAfter"),
|
|
34470
|
-
children: /* @__PURE__ */ jsx92(ArrowRight, { className: "w-4 h-4" })
|
|
34471
|
-
}
|
|
34472
|
-
),
|
|
34473
|
-
/* @__PURE__ */ jsx92(
|
|
34474
|
-
ToolbarButton,
|
|
34475
|
-
{
|
|
34476
|
-
onClick: () => editor.chain().focus().addRowBefore().run(),
|
|
34477
|
-
disabled: !editor.can().addRowBefore(),
|
|
34478
|
-
title: t("tableMenu.addRowBefore"),
|
|
34479
|
-
children: /* @__PURE__ */ jsx92(ArrowUp, { className: "w-4 h-4" })
|
|
34480
|
-
}
|
|
34481
|
-
),
|
|
34482
|
-
/* @__PURE__ */ jsx92(
|
|
34483
|
-
ToolbarButton,
|
|
34484
|
-
{
|
|
34485
|
-
onClick: () => editor.chain().focus().addRowAfter().run(),
|
|
34486
|
-
disabled: !editor.can().addRowAfter(),
|
|
34487
|
-
title: t("tableMenu.addRowAfter"),
|
|
34488
|
-
children: /* @__PURE__ */ jsx92(ArrowDown, { className: "w-4 h-4" })
|
|
34489
|
-
}
|
|
34490
|
-
),
|
|
34491
|
-
/* @__PURE__ */ jsx92(
|
|
34492
|
-
ToolbarButton,
|
|
34493
|
-
{
|
|
34494
|
-
onClick: () => {
|
|
34495
|
-
if (canSplitCell) {
|
|
34496
|
-
editor.chain().focus().splitCell().run();
|
|
34497
|
-
return;
|
|
34498
|
-
}
|
|
34499
|
-
mergeTableCellsPreservingColumnWidths(editor);
|
|
34500
|
-
},
|
|
34501
|
-
active: canSplitCell,
|
|
34502
|
-
disabled: !canMergeCells && !canSplitCell,
|
|
34503
|
-
title: canSplitCell ? t("tableMenu.splitCell") : t("tableMenu.mergeCells"),
|
|
34504
|
-
children: /* @__PURE__ */ jsx92(TableCellsMerge, { className: "w-4 h-4" })
|
|
34505
|
-
}
|
|
34506
|
-
)
|
|
34507
|
-
] })
|
|
34508
|
-
] });
|
|
34634
|
+
] })
|
|
34635
|
+
]
|
|
34636
|
+
}
|
|
34637
|
+
);
|
|
34509
34638
|
};
|
|
34510
34639
|
|
|
34511
34640
|
// src/components/UEditor/menus.tsx
|
|
@@ -34517,20 +34646,20 @@ import {
|
|
|
34517
34646
|
AlignCenter as AlignCenter2,
|
|
34518
34647
|
AlignLeft as AlignLeft2,
|
|
34519
34648
|
AlignRight as AlignRight2,
|
|
34520
|
-
Bold as
|
|
34649
|
+
Bold as BoldIcon,
|
|
34521
34650
|
ChevronDown as ChevronDown9,
|
|
34522
|
-
Code as
|
|
34523
|
-
Italic as
|
|
34651
|
+
Code as CodeIcon,
|
|
34652
|
+
Italic as ItalicIcon,
|
|
34524
34653
|
Link as LinkIcon2,
|
|
34525
34654
|
Plus as Plus3,
|
|
34526
34655
|
RotateCcw as RotateCcw3,
|
|
34527
|
-
Subscript as
|
|
34528
|
-
Superscript as
|
|
34656
|
+
Subscript as SubscriptIcon,
|
|
34657
|
+
Superscript as SuperscriptIcon,
|
|
34529
34658
|
TableCellsMerge as TableCellsMerge2,
|
|
34530
34659
|
Trash2 as Trash23,
|
|
34531
34660
|
Type as Type3,
|
|
34532
|
-
Underline as
|
|
34533
|
-
Strikethrough as
|
|
34661
|
+
Underline as UnderlineIcon,
|
|
34662
|
+
Strikethrough as StrikethroughIcon,
|
|
34534
34663
|
Edit2,
|
|
34535
34664
|
Eraser,
|
|
34536
34665
|
Unlink,
|
|
@@ -35613,7 +35742,7 @@ function recalculateAllTableFormulas(editor) {
|
|
|
35613
35742
|
}
|
|
35614
35743
|
|
|
35615
35744
|
// src/components/UEditor/menus.tsx
|
|
35616
|
-
import { Fragment as Fragment31, jsx as
|
|
35745
|
+
import { Fragment as Fragment31, jsx as jsx94, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
35617
35746
|
var FloatingSlashCommandMenu = ({ editor, onClose }) => {
|
|
35618
35747
|
const t = useSmartTranslations("UEditor");
|
|
35619
35748
|
const messages = useMemo25(() => buildSlashCommandMessages(t), [t]);
|
|
@@ -35634,7 +35763,7 @@ var FloatingSlashCommandMenu = ({ editor, onClose }) => {
|
|
|
35634
35763
|
document.addEventListener("keydown", handleKeyDown2);
|
|
35635
35764
|
return () => document.removeEventListener("keydown", handleKeyDown2);
|
|
35636
35765
|
}, [onClose]);
|
|
35637
|
-
return /* @__PURE__ */
|
|
35766
|
+
return /* @__PURE__ */ jsx94(
|
|
35638
35767
|
SlashCommandList,
|
|
35639
35768
|
{
|
|
35640
35769
|
ref: listRef,
|
|
@@ -35651,7 +35780,7 @@ var FloatingMenuContent = ({ editor }) => {
|
|
|
35651
35780
|
const t = useSmartTranslations("UEditor");
|
|
35652
35781
|
const [showCommands, setShowCommands] = useState51(false);
|
|
35653
35782
|
if (showCommands) {
|
|
35654
|
-
return /* @__PURE__ */
|
|
35783
|
+
return /* @__PURE__ */ jsx94(FloatingSlashCommandMenu, { editor, onClose: () => setShowCommands(false) });
|
|
35655
35784
|
}
|
|
35656
35785
|
return /* @__PURE__ */ jsxs76(
|
|
35657
35786
|
"button",
|
|
@@ -35660,8 +35789,8 @@ var FloatingMenuContent = ({ editor }) => {
|
|
|
35660
35789
|
onClick: () => setShowCommands(true),
|
|
35661
35790
|
className: "flex items-center gap-1 px-2 py-1.5 rounded-lg hover:bg-accent transition-all group",
|
|
35662
35791
|
children: [
|
|
35663
|
-
/* @__PURE__ */
|
|
35664
|
-
/* @__PURE__ */
|
|
35792
|
+
/* @__PURE__ */ jsx94(Plus3, { className: "w-4 h-4 text-muted-foreground group-hover:text-foreground" }),
|
|
35793
|
+
/* @__PURE__ */ jsx94("span", { className: "text-sm text-muted-foreground group-hover:text-foreground", children: t("floatingMenu.addBlock") })
|
|
35665
35794
|
]
|
|
35666
35795
|
}
|
|
35667
35796
|
);
|
|
@@ -35690,7 +35819,7 @@ function applyTableCellAttribute2(editor, name, value, options = {}) {
|
|
|
35690
35819
|
}
|
|
35691
35820
|
function BorderStylePreviewIcon({ style }) {
|
|
35692
35821
|
const isNone = style === "none";
|
|
35693
|
-
return /* @__PURE__ */
|
|
35822
|
+
return /* @__PURE__ */ jsx94(
|
|
35694
35823
|
"span",
|
|
35695
35824
|
{
|
|
35696
35825
|
"aria-hidden": "true",
|
|
@@ -35702,7 +35831,7 @@ function BorderStylePreviewIcon({ style }) {
|
|
|
35702
35831
|
borderStyle: style,
|
|
35703
35832
|
borderWidth: style === "double" ? 3 : 2
|
|
35704
35833
|
},
|
|
35705
|
-
children: isNone && /* @__PURE__ */
|
|
35834
|
+
children: isNone && /* @__PURE__ */ jsx94("span", { className: "absolute left-1/2 top-0 h-full w-px -translate-x-1/2 rotate-45 bg-muted-foreground/70" })
|
|
35706
35835
|
}
|
|
35707
35836
|
);
|
|
35708
35837
|
}
|
|
@@ -35714,7 +35843,7 @@ function BorderPositionPreviewIcon({ position }) {
|
|
|
35714
35843
|
const showHorizontal = position === "all" || position === "inner" || position === "horizontal";
|
|
35715
35844
|
const showVertical = position === "all" || position === "inner" || position === "vertical";
|
|
35716
35845
|
return /* @__PURE__ */ jsxs76("svg", { "aria-hidden": "true", viewBox: "0 0 20 20", className: "h-5 w-5 fill-none stroke-current", children: [
|
|
35717
|
-
/* @__PURE__ */
|
|
35846
|
+
/* @__PURE__ */ jsx94(
|
|
35718
35847
|
"path",
|
|
35719
35848
|
{
|
|
35720
35849
|
d: "M2 2H18V18H2Z M2 10H18 M10 2V18",
|
|
@@ -35724,12 +35853,12 @@ function BorderPositionPreviewIcon({ position }) {
|
|
|
35724
35853
|
strokeWidth: "1.25"
|
|
35725
35854
|
}
|
|
35726
35855
|
),
|
|
35727
|
-
showTop && /* @__PURE__ */
|
|
35728
|
-
showRight && /* @__PURE__ */
|
|
35729
|
-
showBottom && /* @__PURE__ */
|
|
35730
|
-
showLeft && /* @__PURE__ */
|
|
35731
|
-
showHorizontal && /* @__PURE__ */
|
|
35732
|
-
showVertical && /* @__PURE__ */
|
|
35856
|
+
showTop && /* @__PURE__ */ jsx94("path", { d: "M2 2H18", strokeWidth: "2" }),
|
|
35857
|
+
showRight && /* @__PURE__ */ jsx94("path", { d: "M18 2V18", strokeWidth: "2" }),
|
|
35858
|
+
showBottom && /* @__PURE__ */ jsx94("path", { d: "M2 18H18", strokeWidth: "2" }),
|
|
35859
|
+
showLeft && /* @__PURE__ */ jsx94("path", { d: "M2 2V18", strokeWidth: "2" }),
|
|
35860
|
+
showHorizontal && /* @__PURE__ */ jsx94("path", { d: "M2 10H18", strokeWidth: "2" }),
|
|
35861
|
+
showVertical && /* @__PURE__ */ jsx94("path", { d: "M10 2V18", strokeWidth: "2" })
|
|
35733
35862
|
] });
|
|
35734
35863
|
}
|
|
35735
35864
|
var BubbleMenuContent = ({
|
|
@@ -35926,7 +36055,7 @@ var BubbleMenuContent = ({
|
|
|
35926
36055
|
};
|
|
35927
36056
|
}, [editor, showLinkInput]);
|
|
35928
36057
|
if (showLinkInput) {
|
|
35929
|
-
return /* @__PURE__ */
|
|
36058
|
+
return /* @__PURE__ */ jsx94(
|
|
35930
36059
|
LinkInput,
|
|
35931
36060
|
{
|
|
35932
36061
|
initialUrl: editor.getAttributes("link").href || "",
|
|
@@ -35947,10 +36076,10 @@ var BubbleMenuContent = ({
|
|
|
35947
36076
|
const isHighlightPalette = activeColorPalette === "highlight";
|
|
35948
36077
|
if (activeColorPalette === "cell-border") {
|
|
35949
36078
|
return /* @__PURE__ */ jsxs76("div", { className: "flex w-72 flex-col gap-2 p-2 text-sm", "data-ueditor-keep-open": true, children: [
|
|
35950
|
-
/* @__PURE__ */
|
|
36079
|
+
/* @__PURE__ */ jsx94("div", { className: "font-semibold text-xs text-muted-foreground uppercase tracking-wider mb-1", children: t("tableMenu.cellBorder") || "Cell Borders" }),
|
|
35951
36080
|
/* @__PURE__ */ jsxs76("div", { className: "flex gap-2", children: [
|
|
35952
36081
|
/* @__PURE__ */ jsxs76("div", { className: "min-w-0 flex-1", children: [
|
|
35953
|
-
/* @__PURE__ */
|
|
36082
|
+
/* @__PURE__ */ jsx94("label", { className: "mb-1 block text-xs text-muted-foreground", children: t("tableMenu.borderPosition") || "Border placement" }),
|
|
35954
36083
|
/* @__PURE__ */ jsxs76("div", { className: "grid grid-cols-5 gap-1", role: "group", "aria-label": t("tableMenu.borderPosition") || "Border placement", children: [
|
|
35955
36084
|
[
|
|
35956
36085
|
["all", "borderAll"],
|
|
@@ -35964,7 +36093,7 @@ var BubbleMenuContent = ({
|
|
|
35964
36093
|
["left", "borderLeft"]
|
|
35965
36094
|
].map(([position, labelKey]) => {
|
|
35966
36095
|
const label = t(`tableMenu.${labelKey}`) || position;
|
|
35967
|
-
return /* @__PURE__ */
|
|
36096
|
+
return /* @__PURE__ */ jsx94(
|
|
35968
36097
|
"button",
|
|
35969
36098
|
{
|
|
35970
36099
|
type: "button",
|
|
@@ -35976,12 +36105,12 @@ var BubbleMenuContent = ({
|
|
|
35976
36105
|
"inline-flex h-8 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted hover:text-primary",
|
|
35977
36106
|
activeBorderPosition === position ? "bg-primary/10 text-primary" : "bg-muted/40"
|
|
35978
36107
|
),
|
|
35979
|
-
children: /* @__PURE__ */
|
|
36108
|
+
children: /* @__PURE__ */ jsx94(BorderPositionPreviewIcon, { position })
|
|
35980
36109
|
},
|
|
35981
36110
|
position
|
|
35982
36111
|
);
|
|
35983
36112
|
}),
|
|
35984
|
-
/* @__PURE__ */
|
|
36113
|
+
/* @__PURE__ */ jsx94(
|
|
35985
36114
|
"button",
|
|
35986
36115
|
{
|
|
35987
36116
|
type: "button",
|
|
@@ -35990,13 +36119,13 @@ var BubbleMenuContent = ({
|
|
|
35990
36119
|
onMouseDown: (event) => event.preventDefault(),
|
|
35991
36120
|
onClick: clearTableCellBorders,
|
|
35992
36121
|
className: "inline-flex h-8 items-center justify-center rounded-md bg-muted/40 text-destructive transition-colors hover:bg-destructive/10",
|
|
35993
|
-
children: /* @__PURE__ */
|
|
36122
|
+
children: /* @__PURE__ */ jsx94(BorderStylePreviewIcon, { style: "none" })
|
|
35994
36123
|
}
|
|
35995
36124
|
)
|
|
35996
36125
|
] })
|
|
35997
36126
|
] }),
|
|
35998
36127
|
/* @__PURE__ */ jsxs76("div", { className: "flex flex-col gap-1 border-l border-border pl-2 pt-5", role: "group", "aria-label": t("tableMenu.borderMode") || "Border mode", children: [
|
|
35999
|
-
/* @__PURE__ */
|
|
36128
|
+
/* @__PURE__ */ jsx94(
|
|
36000
36129
|
"button",
|
|
36001
36130
|
{
|
|
36002
36131
|
type: "button",
|
|
@@ -36008,10 +36137,10 @@ var BubbleMenuContent = ({
|
|
|
36008
36137
|
"inline-flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:bg-muted",
|
|
36009
36138
|
borderEditMode === "draw" ? "bg-primary/10 text-primary" : "text-muted-foreground"
|
|
36010
36139
|
),
|
|
36011
|
-
children: /* @__PURE__ */
|
|
36140
|
+
children: /* @__PURE__ */ jsx94(Edit2, { className: "h-4 w-4" })
|
|
36012
36141
|
}
|
|
36013
36142
|
),
|
|
36014
|
-
/* @__PURE__ */
|
|
36143
|
+
/* @__PURE__ */ jsx94(
|
|
36015
36144
|
"button",
|
|
36016
36145
|
{
|
|
36017
36146
|
type: "button",
|
|
@@ -36023,14 +36152,14 @@ var BubbleMenuContent = ({
|
|
|
36023
36152
|
"inline-flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:bg-muted",
|
|
36024
36153
|
borderEditMode === "erase" ? "bg-destructive/10 text-destructive" : "text-muted-foreground"
|
|
36025
36154
|
),
|
|
36026
|
-
children: /* @__PURE__ */
|
|
36155
|
+
children: /* @__PURE__ */ jsx94(Eraser, { className: "h-4 w-4" })
|
|
36027
36156
|
}
|
|
36028
36157
|
)
|
|
36029
36158
|
] })
|
|
36030
36159
|
] }),
|
|
36031
36160
|
/* @__PURE__ */ jsxs76("div", { className: "flex flex-col gap-1", children: [
|
|
36032
|
-
/* @__PURE__ */
|
|
36033
|
-
/* @__PURE__ */
|
|
36161
|
+
/* @__PURE__ */ jsx94("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderStyle") || "Border Style" }),
|
|
36162
|
+
/* @__PURE__ */ jsx94("div", { className: "grid grid-cols-4 gap-1.5", role: "group", "aria-label": t("tableMenu.borderStyle") || "Border Style", children: [
|
|
36034
36163
|
["solid", "Solid"],
|
|
36035
36164
|
["dashed", "Dashed"],
|
|
36036
36165
|
["dotted", "Dotted"],
|
|
@@ -36046,16 +36175,16 @@ var BubbleMenuContent = ({
|
|
|
36046
36175
|
borderStyleDraft === style ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
|
|
36047
36176
|
),
|
|
36048
36177
|
children: [
|
|
36049
|
-
/* @__PURE__ */
|
|
36050
|
-
/* @__PURE__ */
|
|
36178
|
+
/* @__PURE__ */ jsx94(BorderStylePreviewIcon, { style }),
|
|
36179
|
+
/* @__PURE__ */ jsx94("span", { children: label })
|
|
36051
36180
|
]
|
|
36052
36181
|
},
|
|
36053
36182
|
style
|
|
36054
36183
|
)) })
|
|
36055
36184
|
] }),
|
|
36056
36185
|
/* @__PURE__ */ jsxs76("div", { className: "flex flex-col gap-1", children: [
|
|
36057
|
-
/* @__PURE__ */
|
|
36058
|
-
/* @__PURE__ */
|
|
36186
|
+
/* @__PURE__ */ jsx94("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderWidth") || "Border Width" }),
|
|
36187
|
+
/* @__PURE__ */ jsx94("div", { className: "grid grid-cols-4 gap-1", role: "group", "aria-label": t("tableMenu.borderWidth") || "Border Width", children: ["1px", "2px", "3px", "4px"].map((width) => /* @__PURE__ */ jsx94(
|
|
36059
36188
|
"button",
|
|
36060
36189
|
{
|
|
36061
36190
|
type: "button",
|
|
@@ -36077,8 +36206,8 @@ var BubbleMenuContent = ({
|
|
|
36077
36206
|
onClick: () => setActiveColorPalette("cell-border-color"),
|
|
36078
36207
|
className: "flex items-center justify-between w-full h-8 px-2 rounded-md border border-input hover:bg-accent text-xs",
|
|
36079
36208
|
children: [
|
|
36080
|
-
/* @__PURE__ */
|
|
36081
|
-
/* @__PURE__ */
|
|
36209
|
+
/* @__PURE__ */ jsx94("span", { children: t("tableMenu.borderColor") || "Border Color" }),
|
|
36210
|
+
/* @__PURE__ */ jsx94(
|
|
36082
36211
|
"span",
|
|
36083
36212
|
{
|
|
36084
36213
|
className: "w-4 h-4 rounded-full border border-border",
|
|
@@ -36093,7 +36222,7 @@ var BubbleMenuContent = ({
|
|
|
36093
36222
|
] });
|
|
36094
36223
|
}
|
|
36095
36224
|
if (activeColorPalette === "cell-border-color") {
|
|
36096
|
-
return /* @__PURE__ */
|
|
36225
|
+
return /* @__PURE__ */ jsx94("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ jsx94(
|
|
36097
36226
|
EditorColorPalette,
|
|
36098
36227
|
{
|
|
36099
36228
|
colors: borderColors,
|
|
@@ -36103,7 +36232,7 @@ var BubbleMenuContent = ({
|
|
|
36103
36232
|
}
|
|
36104
36233
|
) });
|
|
36105
36234
|
}
|
|
36106
|
-
return /* @__PURE__ */
|
|
36235
|
+
return /* @__PURE__ */ jsx94("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ jsx94(
|
|
36107
36236
|
EditorColorPalette,
|
|
36108
36237
|
{
|
|
36109
36238
|
colors: isTextPalette ? textColors : highlightColors,
|
|
@@ -36115,22 +36244,22 @@ var BubbleMenuContent = ({
|
|
|
36115
36244
|
}
|
|
36116
36245
|
if (isImageSelected) {
|
|
36117
36246
|
return /* @__PURE__ */ jsxs76("div", { className: "flex items-center gap-0.5 p-1", children: [
|
|
36118
|
-
/* @__PURE__ */
|
|
36119
|
-
/* @__PURE__ */
|
|
36120
|
-
/* @__PURE__ */
|
|
36121
|
-
/* @__PURE__ */
|
|
36122
|
-
/* @__PURE__ */
|
|
36123
|
-
/* @__PURE__ */
|
|
36124
|
-
/* @__PURE__ */
|
|
36125
|
-
/* @__PURE__ */
|
|
36126
|
-
/* @__PURE__ */
|
|
36127
|
-
/* @__PURE__ */
|
|
36247
|
+
/* @__PURE__ */ jsx94(ToolbarButton, { onClick: () => applyImageLayout(editor, "block"), active: imageLayout === "block", title: t("toolbar.imageLayoutBlock"), children: /* @__PURE__ */ jsx94(AlignCenter2, { className: "w-4 h-4" }) }),
|
|
36248
|
+
/* @__PURE__ */ jsx94(ToolbarButton, { onClick: () => applyImageLayout(editor, "left"), active: imageLayout === "left", title: t("toolbar.imageLayoutLeft"), children: /* @__PURE__ */ jsx94(AlignLeft2, { className: "w-4 h-4" }) }),
|
|
36249
|
+
/* @__PURE__ */ jsx94(ToolbarButton, { onClick: () => applyImageLayout(editor, "right"), active: imageLayout === "right", title: t("toolbar.imageLayoutRight"), children: /* @__PURE__ */ jsx94(AlignRight2, { className: "w-4 h-4" }) }),
|
|
36250
|
+
/* @__PURE__ */ jsx94("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
36251
|
+
/* @__PURE__ */ jsx94(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "sm"), active: imageWidthPreset === "sm", title: t("toolbar.imageWidthSm"), children: /* @__PURE__ */ jsx94("span", { className: "text-[10px] font-semibold", children: "S" }) }),
|
|
36252
|
+
/* @__PURE__ */ jsx94(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "md"), active: imageWidthPreset === "md", title: t("toolbar.imageWidthMd"), children: /* @__PURE__ */ jsx94("span", { className: "text-[10px] font-semibold", children: "M" }) }),
|
|
36253
|
+
/* @__PURE__ */ jsx94(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "lg"), active: imageWidthPreset === "lg", title: t("toolbar.imageWidthLg"), children: /* @__PURE__ */ jsx94("span", { className: "text-[10px] font-semibold", children: "L" }) }),
|
|
36254
|
+
/* @__PURE__ */ jsx94("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
36255
|
+
/* @__PURE__ */ jsx94(ToolbarButton, { onClick: () => resetImageSize(editor), title: t("toolbar.imageResetSize"), children: /* @__PURE__ */ jsx94(RotateCcw3, { className: "w-4 h-4" }) }),
|
|
36256
|
+
/* @__PURE__ */ jsx94(
|
|
36128
36257
|
ToolbarButton,
|
|
36129
36258
|
{
|
|
36130
36259
|
onClick: () => deleteSelectedImage(editor),
|
|
36131
36260
|
title: t("toolbar.imageDelete"),
|
|
36132
36261
|
className: "text-destructive hover:text-destructive",
|
|
36133
|
-
children: /* @__PURE__ */
|
|
36262
|
+
children: /* @__PURE__ */ jsx94(Trash23, { className: "w-4 h-4" })
|
|
36134
36263
|
}
|
|
36135
36264
|
)
|
|
36136
36265
|
] });
|
|
@@ -36138,8 +36267,8 @@ var BubbleMenuContent = ({
|
|
|
36138
36267
|
if (showFormulaPanel && isInTable2) {
|
|
36139
36268
|
return /* @__PURE__ */ jsxs76("div", { className: "w-72 p-2", children: [
|
|
36140
36269
|
/* @__PURE__ */ jsxs76("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
|
|
36141
|
-
/* @__PURE__ */
|
|
36142
|
-
/* @__PURE__ */
|
|
36270
|
+
/* @__PURE__ */ jsx94("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("tableMenu.formula") || "Formula" }),
|
|
36271
|
+
/* @__PURE__ */ jsx94(
|
|
36143
36272
|
"button",
|
|
36144
36273
|
{
|
|
36145
36274
|
type: "button",
|
|
@@ -36152,7 +36281,7 @@ var BubbleMenuContent = ({
|
|
|
36152
36281
|
}
|
|
36153
36282
|
)
|
|
36154
36283
|
] }),
|
|
36155
|
-
/* @__PURE__ */
|
|
36284
|
+
/* @__PURE__ */ jsx94("div", { className: "flex h-9 items-center overflow-hidden rounded-md border border-border/60 bg-muted/40", children: /* @__PURE__ */ jsx94(
|
|
36156
36285
|
"input",
|
|
36157
36286
|
{
|
|
36158
36287
|
value: formulaDraft,
|
|
@@ -36174,14 +36303,14 @@ var BubbleMenuContent = ({
|
|
|
36174
36303
|
}
|
|
36175
36304
|
) }),
|
|
36176
36305
|
/* @__PURE__ */ jsxs76("div", { className: "mt-2", children: [
|
|
36177
|
-
/* @__PURE__ */
|
|
36178
|
-
/* @__PURE__ */
|
|
36306
|
+
/* @__PURE__ */ jsx94("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("tableMenu.numberFormat") || "Number format" }),
|
|
36307
|
+
/* @__PURE__ */ jsx94("div", { className: "grid grid-cols-5 gap-1", children: [
|
|
36179
36308
|
["text", "Text"],
|
|
36180
36309
|
["number", "123"],
|
|
36181
36310
|
["currency", "$"],
|
|
36182
36311
|
["percent", "%"],
|
|
36183
36312
|
["date", "Date"]
|
|
36184
|
-
].map(([format, label]) => /* @__PURE__ */
|
|
36313
|
+
].map(([format, label]) => /* @__PURE__ */ jsx94(
|
|
36185
36314
|
"button",
|
|
36186
36315
|
{
|
|
36187
36316
|
type: "button",
|
|
@@ -36196,7 +36325,7 @@ var BubbleMenuContent = ({
|
|
|
36196
36325
|
)) })
|
|
36197
36326
|
] }),
|
|
36198
36327
|
/* @__PURE__ */ jsxs76("div", { className: "mt-2 grid grid-cols-3 gap-1", children: [
|
|
36199
|
-
/* @__PURE__ */
|
|
36328
|
+
/* @__PURE__ */ jsx94(
|
|
36200
36329
|
"button",
|
|
36201
36330
|
{
|
|
36202
36331
|
type: "button",
|
|
@@ -36209,7 +36338,7 @@ var BubbleMenuContent = ({
|
|
|
36209
36338
|
children: t("tableMenu.apply") || "Apply"
|
|
36210
36339
|
}
|
|
36211
36340
|
),
|
|
36212
|
-
/* @__PURE__ */
|
|
36341
|
+
/* @__PURE__ */ jsx94(
|
|
36213
36342
|
"button",
|
|
36214
36343
|
{
|
|
36215
36344
|
type: "button",
|
|
@@ -36221,7 +36350,7 @@ var BubbleMenuContent = ({
|
|
|
36221
36350
|
children: t("tableMenu.clear") || "Clear"
|
|
36222
36351
|
}
|
|
36223
36352
|
),
|
|
36224
|
-
/* @__PURE__ */
|
|
36353
|
+
/* @__PURE__ */ jsx94(
|
|
36225
36354
|
"button",
|
|
36226
36355
|
{
|
|
36227
36356
|
type: "button",
|
|
@@ -36236,8 +36365,8 @@ var BubbleMenuContent = ({
|
|
|
36236
36365
|
if (showTypographyPanel) {
|
|
36237
36366
|
return /* @__PURE__ */ jsxs76("div", { className: "w-72 p-2", children: [
|
|
36238
36367
|
/* @__PURE__ */ jsxs76("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
|
|
36239
|
-
/* @__PURE__ */
|
|
36240
|
-
/* @__PURE__ */
|
|
36368
|
+
/* @__PURE__ */ jsx94("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("toolbar.textStyle") }),
|
|
36369
|
+
/* @__PURE__ */ jsx94(
|
|
36241
36370
|
"button",
|
|
36242
36371
|
{
|
|
36243
36372
|
type: "button",
|
|
@@ -36249,9 +36378,9 @@ var BubbleMenuContent = ({
|
|
|
36249
36378
|
] }),
|
|
36250
36379
|
/* @__PURE__ */ jsxs76("div", { className: "space-y-2", children: [
|
|
36251
36380
|
/* @__PURE__ */ jsxs76("div", { children: [
|
|
36252
|
-
/* @__PURE__ */
|
|
36381
|
+
/* @__PURE__ */ jsx94("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.fontSize") }),
|
|
36253
36382
|
/* @__PURE__ */ jsxs76("div", { className: "flex h-9 items-center overflow-hidden rounded-md border border-border/60 bg-muted/40", children: [
|
|
36254
|
-
/* @__PURE__ */
|
|
36383
|
+
/* @__PURE__ */ jsx94(
|
|
36255
36384
|
"input",
|
|
36256
36385
|
{
|
|
36257
36386
|
type: "number",
|
|
@@ -36275,8 +36404,8 @@ var BubbleMenuContent = ({
|
|
|
36275
36404
|
className: "h-full min-w-0 flex-1 bg-transparent px-2 text-center text-sm font-semibold text-foreground outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"
|
|
36276
36405
|
}
|
|
36277
36406
|
),
|
|
36278
|
-
/* @__PURE__ */
|
|
36279
|
-
/* @__PURE__ */
|
|
36407
|
+
/* @__PURE__ */ jsx94("span", { className: "border-l border-border/50 px-2 text-[11px] text-muted-foreground", children: "px" }),
|
|
36408
|
+
/* @__PURE__ */ jsx94(
|
|
36280
36409
|
"button",
|
|
36281
36410
|
{
|
|
36282
36411
|
type: "button",
|
|
@@ -36286,12 +36415,12 @@ var BubbleMenuContent = ({
|
|
|
36286
36415
|
"flex h-full w-9 items-center justify-center border-l border-border/50 transition-colors hover:bg-muted",
|
|
36287
36416
|
showFontSizeOptions && "bg-primary/10 text-primary"
|
|
36288
36417
|
),
|
|
36289
|
-
children: /* @__PURE__ */
|
|
36418
|
+
children: /* @__PURE__ */ jsx94(ChevronDown9, { className: "h-4 w-4" })
|
|
36290
36419
|
}
|
|
36291
36420
|
)
|
|
36292
36421
|
] }),
|
|
36293
36422
|
showFontSizeOptions && /* @__PURE__ */ jsxs76("div", { className: "mt-1 grid grid-cols-4 gap-1", children: [
|
|
36294
|
-
/* @__PURE__ */
|
|
36423
|
+
/* @__PURE__ */ jsx94(
|
|
36295
36424
|
"button",
|
|
36296
36425
|
{
|
|
36297
36426
|
type: "button",
|
|
@@ -36306,7 +36435,7 @@ var BubbleMenuContent = ({
|
|
|
36306
36435
|
children: "A"
|
|
36307
36436
|
}
|
|
36308
36437
|
),
|
|
36309
|
-
quickFontSizes.map((option) => /* @__PURE__ */
|
|
36438
|
+
quickFontSizes.map((option) => /* @__PURE__ */ jsx94(
|
|
36310
36439
|
"button",
|
|
36311
36440
|
{
|
|
36312
36441
|
type: "button",
|
|
@@ -36325,9 +36454,9 @@ var BubbleMenuContent = ({
|
|
|
36325
36454
|
] })
|
|
36326
36455
|
] }),
|
|
36327
36456
|
/* @__PURE__ */ jsxs76("div", { children: [
|
|
36328
|
-
/* @__PURE__ */
|
|
36457
|
+
/* @__PURE__ */ jsx94("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.lineHeight") }),
|
|
36329
36458
|
/* @__PURE__ */ jsxs76("div", { className: "grid grid-cols-4 gap-1", children: [
|
|
36330
|
-
/* @__PURE__ */
|
|
36459
|
+
/* @__PURE__ */ jsx94(
|
|
36331
36460
|
"button",
|
|
36332
36461
|
{
|
|
36333
36462
|
type: "button",
|
|
@@ -36339,7 +36468,7 @@ var BubbleMenuContent = ({
|
|
|
36339
36468
|
children: "LH"
|
|
36340
36469
|
}
|
|
36341
36470
|
),
|
|
36342
|
-
quickLineHeights.map((option) => /* @__PURE__ */
|
|
36471
|
+
quickLineHeights.map((option) => /* @__PURE__ */ jsx94(
|
|
36343
36472
|
"button",
|
|
36344
36473
|
{
|
|
36345
36474
|
type: "button",
|
|
@@ -36365,7 +36494,7 @@ var BubbleMenuContent = ({
|
|
|
36365
36494
|
editor.isActive("subscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
|
|
36366
36495
|
),
|
|
36367
36496
|
children: [
|
|
36368
|
-
/* @__PURE__ */
|
|
36497
|
+
/* @__PURE__ */ jsx94(SubscriptIcon, { className: "h-4 w-4" }),
|
|
36369
36498
|
t("toolbar.subscript")
|
|
36370
36499
|
]
|
|
36371
36500
|
}
|
|
@@ -36380,7 +36509,7 @@ var BubbleMenuContent = ({
|
|
|
36380
36509
|
editor.isActive("superscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
|
|
36381
36510
|
),
|
|
36382
36511
|
children: [
|
|
36383
|
-
/* @__PURE__ */
|
|
36512
|
+
/* @__PURE__ */ jsx94(SuperscriptIcon, { className: "h-4 w-4" }),
|
|
36384
36513
|
t("toolbar.superscript")
|
|
36385
36514
|
]
|
|
36386
36515
|
}
|
|
@@ -36391,21 +36520,21 @@ var BubbleMenuContent = ({
|
|
|
36391
36520
|
}
|
|
36392
36521
|
const VerticalAlignActiveIcon = currentCellVerticalAlign === "middle" ? AlignCenterVertical2 : currentCellVerticalAlign === "bottom" ? AlignEndVertical2 : AlignStartVertical2;
|
|
36393
36522
|
return /* @__PURE__ */ jsxs76("div", { className: "flex items-center gap-0.5 p-1", children: [
|
|
36394
|
-
/* @__PURE__ */
|
|
36395
|
-
/* @__PURE__ */
|
|
36396
|
-
/* @__PURE__ */
|
|
36523
|
+
/* @__PURE__ */ jsx94(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx94(BoldIcon, { className: "w-4 h-4" }) }),
|
|
36524
|
+
/* @__PURE__ */ jsx94(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx94(ItalicIcon, { className: "w-4 h-4" }) }),
|
|
36525
|
+
/* @__PURE__ */ jsx94(
|
|
36397
36526
|
ToolbarButton,
|
|
36398
36527
|
{
|
|
36399
36528
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
36400
36529
|
active: editor.isActive("underline"),
|
|
36401
36530
|
title: t("toolbar.underline"),
|
|
36402
|
-
children: /* @__PURE__ */
|
|
36531
|
+
children: /* @__PURE__ */ jsx94(UnderlineIcon, { className: "w-4 h-4" })
|
|
36403
36532
|
}
|
|
36404
36533
|
),
|
|
36405
|
-
/* @__PURE__ */
|
|
36406
|
-
/* @__PURE__ */
|
|
36407
|
-
/* @__PURE__ */
|
|
36408
|
-
/* @__PURE__ */
|
|
36534
|
+
/* @__PURE__ */ jsx94(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ jsx94(StrikethroughIcon, { className: "w-4 h-4" }) }),
|
|
36535
|
+
/* @__PURE__ */ jsx94(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ jsx94(CodeIcon, { className: "w-4 h-4" }) }),
|
|
36536
|
+
/* @__PURE__ */ jsx94("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
36537
|
+
/* @__PURE__ */ jsx94(
|
|
36409
36538
|
ToolbarButton,
|
|
36410
36539
|
{
|
|
36411
36540
|
onMouseDown: () => {
|
|
@@ -36416,22 +36545,22 @@ var BubbleMenuContent = ({
|
|
|
36416
36545
|
},
|
|
36417
36546
|
active: editor.isActive("link"),
|
|
36418
36547
|
title: t("toolbar.link"),
|
|
36419
|
-
children: /* @__PURE__ */
|
|
36548
|
+
children: /* @__PURE__ */ jsx94(LinkIcon2, { className: "w-4 h-4" })
|
|
36420
36549
|
}
|
|
36421
36550
|
),
|
|
36422
|
-
/* @__PURE__ */
|
|
36423
|
-
/* @__PURE__ */
|
|
36551
|
+
/* @__PURE__ */ jsx94(ToolbarButton, { onClick: () => setActiveColorPalette("text"), title: t("colors.textColor"), children: /* @__PURE__ */ jsx94(TextColorIcon, { color: currentTextColor }) }),
|
|
36552
|
+
/* @__PURE__ */ jsx94(ToolbarButton, { onClick: () => setActiveColorPalette("highlight"), active: editor.isActive("highlight"), title: t("colors.highlight"), children: /* @__PURE__ */ jsx94(HighlightColorIcon, { color: currentHighlightColor }) }),
|
|
36424
36553
|
isInTable2 && /* @__PURE__ */ jsxs76(Fragment31, { children: [
|
|
36425
|
-
/* @__PURE__ */
|
|
36554
|
+
/* @__PURE__ */ jsx94(
|
|
36426
36555
|
ToolbarButton,
|
|
36427
36556
|
{
|
|
36428
36557
|
onClick: () => setActiveColorPalette("cell-bg"),
|
|
36429
36558
|
active: Boolean(currentCellBgColor),
|
|
36430
36559
|
title: t("tableMenu.cellBackground") || "Cell background",
|
|
36431
|
-
children: /* @__PURE__ */
|
|
36560
|
+
children: /* @__PURE__ */ jsx94(CellBgColorIcon, { color: currentCellBgColor })
|
|
36432
36561
|
}
|
|
36433
36562
|
),
|
|
36434
|
-
/* @__PURE__ */
|
|
36563
|
+
/* @__PURE__ */ jsx94(
|
|
36435
36564
|
ToolbarButton,
|
|
36436
36565
|
{
|
|
36437
36566
|
onMouseDown: () => {
|
|
@@ -36442,7 +36571,7 @@ var BubbleMenuContent = ({
|
|
|
36442
36571
|
editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor || editor.getAttributes("tableCell").borderStyle || editor.getAttributes("tableHeader").borderStyle || editor.getAttributes("tableCell").borderWidth || editor.getAttributes("tableHeader").borderWidth
|
|
36443
36572
|
),
|
|
36444
36573
|
title: t("tableMenu.cellBorder") || "Cell border",
|
|
36445
|
-
children: /* @__PURE__ */
|
|
36574
|
+
children: /* @__PURE__ */ jsx94(
|
|
36446
36575
|
CellBorderIcon,
|
|
36447
36576
|
{
|
|
36448
36577
|
color: editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor
|
|
@@ -36450,7 +36579,7 @@ var BubbleMenuContent = ({
|
|
|
36450
36579
|
)
|
|
36451
36580
|
}
|
|
36452
36581
|
),
|
|
36453
|
-
/* @__PURE__ */
|
|
36582
|
+
/* @__PURE__ */ jsx94(
|
|
36454
36583
|
ToolbarButton,
|
|
36455
36584
|
{
|
|
36456
36585
|
onMouseDown: () => {
|
|
@@ -36462,10 +36591,10 @@ var BubbleMenuContent = ({
|
|
|
36462
36591
|
},
|
|
36463
36592
|
active: Boolean(currentCellFormula),
|
|
36464
36593
|
title: t("tableMenu.formula") || "Formula",
|
|
36465
|
-
children: /* @__PURE__ */
|
|
36594
|
+
children: /* @__PURE__ */ jsx94(Sigma2, { className: "w-4 h-4" })
|
|
36466
36595
|
}
|
|
36467
36596
|
),
|
|
36468
|
-
/* @__PURE__ */
|
|
36597
|
+
/* @__PURE__ */ jsx94(
|
|
36469
36598
|
ToolbarButton,
|
|
36470
36599
|
{
|
|
36471
36600
|
onClick: () => {
|
|
@@ -36478,7 +36607,7 @@ var BubbleMenuContent = ({
|
|
|
36478
36607
|
active: canSplitCell,
|
|
36479
36608
|
disabled: !canMergeCells && !canSplitCell,
|
|
36480
36609
|
title: canSplitCell ? t("tableMenu.splitCell") || "Split cell" : t("tableMenu.mergeCells") || "Merge cells",
|
|
36481
|
-
children: /* @__PURE__ */
|
|
36610
|
+
children: /* @__PURE__ */ jsx94(TableCellsMerge2, { className: "w-4 h-4" })
|
|
36482
36611
|
}
|
|
36483
36612
|
),
|
|
36484
36613
|
/* @__PURE__ */ jsxs76(
|
|
@@ -36497,13 +36626,13 @@ var BubbleMenuContent = ({
|
|
|
36497
36626
|
},
|
|
36498
36627
|
title: t("tableMenu.alignVertical") || "Vertical alignment",
|
|
36499
36628
|
children: [
|
|
36500
|
-
/* @__PURE__ */
|
|
36501
|
-
/* @__PURE__ */
|
|
36629
|
+
/* @__PURE__ */ jsx94(VerticalAlignActiveIcon, { className: "w-4 h-4" }),
|
|
36630
|
+
/* @__PURE__ */ jsx94(ChevronDown9, { className: "w-3 h-3" })
|
|
36502
36631
|
]
|
|
36503
36632
|
}
|
|
36504
36633
|
),
|
|
36505
36634
|
children: [
|
|
36506
|
-
/* @__PURE__ */
|
|
36635
|
+
/* @__PURE__ */ jsx94(
|
|
36507
36636
|
DropdownMenuItem,
|
|
36508
36637
|
{
|
|
36509
36638
|
icon: AlignStartVertical2,
|
|
@@ -36512,7 +36641,7 @@ var BubbleMenuContent = ({
|
|
|
36512
36641
|
active: currentCellVerticalAlign === "top"
|
|
36513
36642
|
}
|
|
36514
36643
|
),
|
|
36515
|
-
/* @__PURE__ */
|
|
36644
|
+
/* @__PURE__ */ jsx94(
|
|
36516
36645
|
DropdownMenuItem,
|
|
36517
36646
|
{
|
|
36518
36647
|
icon: AlignCenterVertical2,
|
|
@@ -36521,7 +36650,7 @@ var BubbleMenuContent = ({
|
|
|
36521
36650
|
active: currentCellVerticalAlign === "middle"
|
|
36522
36651
|
}
|
|
36523
36652
|
),
|
|
36524
|
-
/* @__PURE__ */
|
|
36653
|
+
/* @__PURE__ */ jsx94(
|
|
36525
36654
|
DropdownMenuItem,
|
|
36526
36655
|
{
|
|
36527
36656
|
icon: AlignEndVertical2,
|
|
@@ -36549,13 +36678,13 @@ var BubbleMenuContent = ({
|
|
|
36549
36678
|
},
|
|
36550
36679
|
title: t("tableMenu.textDirection"),
|
|
36551
36680
|
children: [
|
|
36552
|
-
currentCellTextDirection === "vertical" ? /* @__PURE__ */
|
|
36553
|
-
/* @__PURE__ */
|
|
36681
|
+
currentCellTextDirection === "vertical" ? /* @__PURE__ */ jsx94(ArrowDown2, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx94(ArrowRight2, { className: "w-4 h-4" }),
|
|
36682
|
+
/* @__PURE__ */ jsx94(ChevronDown9, { className: "w-3 h-3" })
|
|
36554
36683
|
]
|
|
36555
36684
|
}
|
|
36556
36685
|
),
|
|
36557
36686
|
children: [
|
|
36558
|
-
/* @__PURE__ */
|
|
36687
|
+
/* @__PURE__ */ jsx94(
|
|
36559
36688
|
DropdownMenuItem,
|
|
36560
36689
|
{
|
|
36561
36690
|
icon: ArrowRight2,
|
|
@@ -36564,7 +36693,7 @@ var BubbleMenuContent = ({
|
|
|
36564
36693
|
active: currentCellTextDirection === "horizontal"
|
|
36565
36694
|
}
|
|
36566
36695
|
),
|
|
36567
|
-
/* @__PURE__ */
|
|
36696
|
+
/* @__PURE__ */ jsx94(
|
|
36568
36697
|
DropdownMenuItem,
|
|
36569
36698
|
{
|
|
36570
36699
|
icon: ArrowDown2,
|
|
@@ -36577,13 +36706,13 @@ var BubbleMenuContent = ({
|
|
|
36577
36706
|
}
|
|
36578
36707
|
)
|
|
36579
36708
|
] }),
|
|
36580
|
-
/* @__PURE__ */
|
|
36709
|
+
/* @__PURE__ */ jsx94(
|
|
36581
36710
|
ToolbarButton,
|
|
36582
36711
|
{
|
|
36583
36712
|
onClick: () => setShowTypographyPanel(true),
|
|
36584
36713
|
active: Boolean(currentFontSize || currentLineHeight || editor.isActive("subscript") || editor.isActive("superscript")),
|
|
36585
36714
|
title: t("toolbar.textStyle"),
|
|
36586
|
-
children: /* @__PURE__ */
|
|
36715
|
+
children: /* @__PURE__ */ jsx94(Type3, { className: "w-4 h-4" })
|
|
36587
36716
|
}
|
|
36588
36717
|
)
|
|
36589
36718
|
] });
|
|
@@ -36599,11 +36728,11 @@ var LinkPreviewContent = ({ editor, onEdit }) => {
|
|
|
36599
36728
|
editor.chain().focus().unsetLink().run();
|
|
36600
36729
|
};
|
|
36601
36730
|
return /* @__PURE__ */ jsxs76("div", { className: "flex items-center gap-1 p-1 max-w-sm", children: [
|
|
36602
|
-
/* @__PURE__ */
|
|
36603
|
-
/* @__PURE__ */
|
|
36604
|
-
/* @__PURE__ */
|
|
36605
|
-
/* @__PURE__ */
|
|
36606
|
-
/* @__PURE__ */
|
|
36731
|
+
/* @__PURE__ */ jsx94("span", { className: "text-xs text-muted-foreground font-mono px-2 truncate max-w-45", children: url }),
|
|
36732
|
+
/* @__PURE__ */ jsx94("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
36733
|
+
/* @__PURE__ */ jsx94(ToolbarButton, { onClick: handleOpen, title: t("linkPreview.open") || "Open link", children: /* @__PURE__ */ jsx94(ExternalLink3, { className: "w-4 h-4" }) }),
|
|
36734
|
+
/* @__PURE__ */ jsx94(ToolbarButton, { onClick: onEdit, title: t("linkPreview.edit") || "Edit link", children: /* @__PURE__ */ jsx94(Edit2, { className: "w-4 h-4" }) }),
|
|
36735
|
+
/* @__PURE__ */ jsx94(ToolbarButton, { onClick: handleUnlink, title: t("linkPreview.unlink") || "Remove link", className: "text-destructive hover:text-destructive", children: /* @__PURE__ */ jsx94(Unlink, { className: "w-4 h-4" }) })
|
|
36607
36736
|
] });
|
|
36608
36737
|
};
|
|
36609
36738
|
var CustomBubbleMenu = ({
|
|
@@ -36763,7 +36892,7 @@ var CustomBubbleMenu = ({
|
|
|
36763
36892
|
}, [editor]);
|
|
36764
36893
|
if (!isVisible) return null;
|
|
36765
36894
|
return createPortal8(
|
|
36766
|
-
/* @__PURE__ */
|
|
36895
|
+
/* @__PURE__ */ jsx94(
|
|
36767
36896
|
"div",
|
|
36768
36897
|
{
|
|
36769
36898
|
ref: menuRef,
|
|
@@ -36783,7 +36912,7 @@ var CustomBubbleMenu = ({
|
|
|
36783
36912
|
}
|
|
36784
36913
|
e.preventDefault();
|
|
36785
36914
|
},
|
|
36786
|
-
children: editor.isActive("link") && !keepOpen && !linkInputOpen ? /* @__PURE__ */
|
|
36915
|
+
children: editor.isActive("link") && !keepOpen && !linkInputOpen ? /* @__PURE__ */ jsx94(
|
|
36787
36916
|
LinkPreviewContent,
|
|
36788
36917
|
{
|
|
36789
36918
|
editor,
|
|
@@ -36792,7 +36921,7 @@ var CustomBubbleMenu = ({
|
|
|
36792
36921
|
setKeepOpen(true);
|
|
36793
36922
|
}
|
|
36794
36923
|
}
|
|
36795
|
-
) : /* @__PURE__ */
|
|
36924
|
+
) : /* @__PURE__ */ jsx94(
|
|
36796
36925
|
BubbleMenuContent,
|
|
36797
36926
|
{
|
|
36798
36927
|
editor,
|
|
@@ -36841,7 +36970,7 @@ var CustomFloatingMenu = ({ editor }) => {
|
|
|
36841
36970
|
}, [editor]);
|
|
36842
36971
|
if (!isVisible) return null;
|
|
36843
36972
|
return createPortal8(
|
|
36844
|
-
/* @__PURE__ */
|
|
36973
|
+
/* @__PURE__ */ jsx94(
|
|
36845
36974
|
"div",
|
|
36846
36975
|
{
|
|
36847
36976
|
"data-popover": true,
|
|
@@ -36852,7 +36981,7 @@ var CustomFloatingMenu = ({ editor }) => {
|
|
|
36852
36981
|
transform: "translate(-50%, -100%)"
|
|
36853
36982
|
},
|
|
36854
36983
|
onMouseDown: (e) => e.preventDefault(),
|
|
36855
|
-
children: /* @__PURE__ */
|
|
36984
|
+
children: /* @__PURE__ */ jsx94(FloatingMenuContent, { editor })
|
|
36856
36985
|
}
|
|
36857
36986
|
),
|
|
36858
36987
|
document.body
|
|
@@ -37299,7 +37428,7 @@ async function prepareUEditorContentForSave({
|
|
|
37299
37428
|
}
|
|
37300
37429
|
|
|
37301
37430
|
// src/components/UEditor/table-controls.tsx
|
|
37302
|
-
import
|
|
37431
|
+
import React86 from "react";
|
|
37303
37432
|
|
|
37304
37433
|
// node_modules/prosemirror-model/dist/index.js
|
|
37305
37434
|
function findDiffStart(a, b, pos) {
|
|
@@ -41784,7 +41913,7 @@ function buildTableHoverState({
|
|
|
41784
41913
|
}
|
|
41785
41914
|
|
|
41786
41915
|
// src/components/UEditor/table-drag-preview.tsx
|
|
41787
|
-
import { Fragment as Fragment33, jsx as
|
|
41916
|
+
import { Fragment as Fragment33, jsx as jsx95, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
41788
41917
|
function TableDragPreview({
|
|
41789
41918
|
columnDragLabel,
|
|
41790
41919
|
dragPreview,
|
|
@@ -41797,7 +41926,7 @@ function TableDragPreview({
|
|
|
41797
41926
|
const dragStatusText = dragPreview.kind === "row" ? `${rowDragLabel} ${dragPreview.originIndex + 1} -> ${dragPreview.targetIndex + 1}` : dragPreview.kind === "column" ? `${columnDragLabel} ${dragPreview.originIndex + 1} -> ${dragPreview.targetIndex + 1}` : dragPreview.kind === "add-row" ? `+${dragPreview.previewRows}R` : `+${dragPreview.previewCols}C`;
|
|
41798
41927
|
return /* @__PURE__ */ jsxs78(Fragment33, { children: [
|
|
41799
41928
|
dragPreview.kind === "row" && /* @__PURE__ */ jsxs78(Fragment33, { children: [
|
|
41800
|
-
/* @__PURE__ */
|
|
41929
|
+
/* @__PURE__ */ jsx95(
|
|
41801
41930
|
"div",
|
|
41802
41931
|
{
|
|
41803
41932
|
"aria-hidden": "true",
|
|
@@ -41810,7 +41939,7 @@ function TableDragPreview({
|
|
|
41810
41939
|
}
|
|
41811
41940
|
}
|
|
41812
41941
|
),
|
|
41813
|
-
/* @__PURE__ */
|
|
41942
|
+
/* @__PURE__ */ jsx95(
|
|
41814
41943
|
"div",
|
|
41815
41944
|
{
|
|
41816
41945
|
"aria-hidden": "true",
|
|
@@ -41825,7 +41954,7 @@ function TableDragPreview({
|
|
|
41825
41954
|
)
|
|
41826
41955
|
] }),
|
|
41827
41956
|
dragPreview.kind === "column" && /* @__PURE__ */ jsxs78(Fragment33, { children: [
|
|
41828
|
-
/* @__PURE__ */
|
|
41957
|
+
/* @__PURE__ */ jsx95(
|
|
41829
41958
|
"div",
|
|
41830
41959
|
{
|
|
41831
41960
|
"aria-hidden": "true",
|
|
@@ -41838,7 +41967,7 @@ function TableDragPreview({
|
|
|
41838
41967
|
}
|
|
41839
41968
|
}
|
|
41840
41969
|
),
|
|
41841
|
-
/* @__PURE__ */
|
|
41970
|
+
/* @__PURE__ */ jsx95(
|
|
41842
41971
|
"div",
|
|
41843
41972
|
{
|
|
41844
41973
|
"aria-hidden": "true",
|
|
@@ -41852,7 +41981,7 @@ function TableDragPreview({
|
|
|
41852
41981
|
}
|
|
41853
41982
|
)
|
|
41854
41983
|
] }),
|
|
41855
|
-
(dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */
|
|
41984
|
+
(dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */ jsx95(
|
|
41856
41985
|
"div",
|
|
41857
41986
|
{
|
|
41858
41987
|
"aria-hidden": "true",
|
|
@@ -41865,7 +41994,7 @@ function TableDragPreview({
|
|
|
41865
41994
|
}
|
|
41866
41995
|
}
|
|
41867
41996
|
),
|
|
41868
|
-
/* @__PURE__ */
|
|
41997
|
+
/* @__PURE__ */ jsx95(
|
|
41869
41998
|
"div",
|
|
41870
41999
|
{
|
|
41871
42000
|
role: "status",
|
|
@@ -41881,7 +42010,7 @@ function TableDragPreview({
|
|
|
41881
42010
|
}
|
|
41882
42011
|
|
|
41883
42012
|
// src/components/UEditor/table-add-rails.tsx
|
|
41884
|
-
import { Fragment as Fragment34, jsx as
|
|
42013
|
+
import { Fragment as Fragment34, jsx as jsx96, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
41885
42014
|
var ADD_COLUMN_RAIL_GAP = 4;
|
|
41886
42015
|
var ADD_ROW_RAIL_GAP = 4;
|
|
41887
42016
|
function TableAddRails({
|
|
@@ -41903,12 +42032,12 @@ function TableAddRails({
|
|
|
41903
42032
|
const showColumnRail = controlsVisible || addColumnVisible;
|
|
41904
42033
|
const showRowRail = controlsVisible || addRowVisible;
|
|
41905
42034
|
return /* @__PURE__ */ jsxs79(Fragment34, { children: [
|
|
41906
|
-
/* @__PURE__ */
|
|
42035
|
+
/* @__PURE__ */ jsx96(
|
|
41907
42036
|
Tooltip,
|
|
41908
42037
|
{
|
|
41909
42038
|
placement: "right",
|
|
41910
|
-
content: /* @__PURE__ */
|
|
41911
|
-
children: /* @__PURE__ */
|
|
42039
|
+
content: /* @__PURE__ */ jsx96("span", { className: "text-xs font-medium", children: quickAddColumnLabel }),
|
|
42040
|
+
children: /* @__PURE__ */ jsx96(
|
|
41912
42041
|
"button",
|
|
41913
42042
|
{
|
|
41914
42043
|
type: "button",
|
|
@@ -41935,17 +42064,17 @@ function TableAddRails({
|
|
|
41935
42064
|
transform: showColumnRail ? "scale(1)" : "scale(0.92)",
|
|
41936
42065
|
pointerEvents: showColumnRail ? "auto" : "none"
|
|
41937
42066
|
},
|
|
41938
|
-
children: /* @__PURE__ */
|
|
42067
|
+
children: /* @__PURE__ */ jsx96("span", { className: "text-sm font-medium leading-none", children: "+" })
|
|
41939
42068
|
}
|
|
41940
42069
|
)
|
|
41941
42070
|
}
|
|
41942
42071
|
),
|
|
41943
|
-
/* @__PURE__ */
|
|
42072
|
+
/* @__PURE__ */ jsx96(
|
|
41944
42073
|
Tooltip,
|
|
41945
42074
|
{
|
|
41946
42075
|
placement: "bottom",
|
|
41947
|
-
content: /* @__PURE__ */
|
|
41948
|
-
children: /* @__PURE__ */
|
|
42076
|
+
content: /* @__PURE__ */ jsx96("span", { className: "text-xs font-medium", children: quickAddRowLabel }),
|
|
42077
|
+
children: /* @__PURE__ */ jsx96(
|
|
41949
42078
|
"button",
|
|
41950
42079
|
{
|
|
41951
42080
|
type: "button",
|
|
@@ -41972,7 +42101,7 @@ function TableAddRails({
|
|
|
41972
42101
|
transform: showRowRail ? "scale(1)" : "scale(0.92)",
|
|
41973
42102
|
pointerEvents: showRowRail ? "auto" : "none"
|
|
41974
42103
|
},
|
|
41975
|
-
children: /* @__PURE__ */
|
|
42104
|
+
children: /* @__PURE__ */ jsx96("span", { className: "text-sm font-medium leading-none", children: "+" })
|
|
41976
42105
|
}
|
|
41977
42106
|
)
|
|
41978
42107
|
}
|
|
@@ -41982,7 +42111,7 @@ function TableAddRails({
|
|
|
41982
42111
|
|
|
41983
42112
|
// src/components/UEditor/table-control-menu.tsx
|
|
41984
42113
|
import { MoreHorizontal as MoreHorizontal2 } from "lucide-react";
|
|
41985
|
-
import { jsx as
|
|
42114
|
+
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
41986
42115
|
function TableControlMenu({
|
|
41987
42116
|
controlsVisible,
|
|
41988
42117
|
isOpen,
|
|
@@ -41994,7 +42123,7 @@ function TableControlMenu({
|
|
|
41994
42123
|
top
|
|
41995
42124
|
}) {
|
|
41996
42125
|
const shown = controlsVisible || menuVisible || isOpen;
|
|
41997
|
-
return /* @__PURE__ */
|
|
42126
|
+
return /* @__PURE__ */ jsx97(
|
|
41998
42127
|
"div",
|
|
41999
42128
|
{
|
|
42000
42129
|
className: "absolute z-30",
|
|
@@ -42003,13 +42132,13 @@ function TableControlMenu({
|
|
|
42003
42132
|
top,
|
|
42004
42133
|
left
|
|
42005
42134
|
},
|
|
42006
|
-
children: /* @__PURE__ */
|
|
42135
|
+
children: /* @__PURE__ */ jsx97(
|
|
42007
42136
|
Tooltip,
|
|
42008
42137
|
{
|
|
42009
42138
|
placement: "top",
|
|
42010
42139
|
disabled: isOpen,
|
|
42011
|
-
content: /* @__PURE__ */
|
|
42012
|
-
children: /* @__PURE__ */
|
|
42140
|
+
content: /* @__PURE__ */ jsx97("span", { className: "text-xs font-medium", children: label }),
|
|
42141
|
+
children: /* @__PURE__ */ jsx97("span", { className: "inline-flex", children: /* @__PURE__ */ jsx97(
|
|
42013
42142
|
DropdownMenu,
|
|
42014
42143
|
{
|
|
42015
42144
|
placement: "bottom-start",
|
|
@@ -42017,7 +42146,7 @@ function TableControlMenu({
|
|
|
42017
42146
|
onOpenChange,
|
|
42018
42147
|
contentClassName: "p-2",
|
|
42019
42148
|
items,
|
|
42020
|
-
trigger: /* @__PURE__ */
|
|
42149
|
+
trigger: /* @__PURE__ */ jsx97(
|
|
42021
42150
|
"button",
|
|
42022
42151
|
{
|
|
42023
42152
|
type: "button",
|
|
@@ -42033,7 +42162,7 @@ function TableControlMenu({
|
|
|
42033
42162
|
transform: shown ? "scale(1)" : "scale(0.82)",
|
|
42034
42163
|
pointerEvents: shown ? "auto" : "none"
|
|
42035
42164
|
},
|
|
42036
|
-
children: /* @__PURE__ */
|
|
42165
|
+
children: /* @__PURE__ */ jsx97(MoreHorizontal2, { className: "h-4 w-4" })
|
|
42037
42166
|
}
|
|
42038
42167
|
)
|
|
42039
42168
|
}
|
|
@@ -42046,7 +42175,7 @@ function TableControlMenu({
|
|
|
42046
42175
|
|
|
42047
42176
|
// src/components/UEditor/table-axis-handles.tsx
|
|
42048
42177
|
import { GripHorizontal, GripVertical as GripVertical3 } from "lucide-react";
|
|
42049
|
-
import { Fragment as Fragment35, jsx as
|
|
42178
|
+
import { Fragment as Fragment35, jsx as jsx98 } from "react/jsx-runtime";
|
|
42050
42179
|
var IDLE_HANDLE_SCALE = "0.78";
|
|
42051
42180
|
function TableRowHandles({
|
|
42052
42181
|
activeRowIndex,
|
|
@@ -42060,12 +42189,12 @@ function TableRowHandles({
|
|
|
42060
42189
|
rowHandleLeft,
|
|
42061
42190
|
rowHandles
|
|
42062
42191
|
}) {
|
|
42063
|
-
return /* @__PURE__ */
|
|
42192
|
+
return /* @__PURE__ */ jsx98(Fragment35, { children: rowHandles.map((rowHandle) => {
|
|
42064
42193
|
const menuKey = `row:${rowHandle.index}`;
|
|
42065
42194
|
const isActive = rowHandle.index === activeRowIndex;
|
|
42066
42195
|
const visible = controlsVisible || hoverRowHandleIndex === rowHandle.index || openMenuKey === menuKey;
|
|
42067
42196
|
const isShown = visible || isActive;
|
|
42068
|
-
return /* @__PURE__ */
|
|
42197
|
+
return /* @__PURE__ */ jsx98(
|
|
42069
42198
|
"div",
|
|
42070
42199
|
{
|
|
42071
42200
|
className: "absolute z-30",
|
|
@@ -42074,13 +42203,13 @@ function TableRowHandles({
|
|
|
42074
42203
|
top: Math.max(8, rowHandle.center - 12),
|
|
42075
42204
|
left: rowHandleLeft
|
|
42076
42205
|
},
|
|
42077
|
-
children: /* @__PURE__ */
|
|
42206
|
+
children: /* @__PURE__ */ jsx98(
|
|
42078
42207
|
Tooltip,
|
|
42079
42208
|
{
|
|
42080
42209
|
placement: "right",
|
|
42081
42210
|
disabled: openMenuKey === menuKey || !visible && isActive,
|
|
42082
|
-
content: /* @__PURE__ */
|
|
42083
|
-
children: /* @__PURE__ */
|
|
42211
|
+
content: /* @__PURE__ */ jsx98("span", { className: "text-xs font-medium", children: `${rowDragLabel} ${rowHandle.index + 1}` }),
|
|
42212
|
+
children: /* @__PURE__ */ jsx98("span", { className: "inline-flex", children: /* @__PURE__ */ jsx98(
|
|
42084
42213
|
DropdownMenu,
|
|
42085
42214
|
{
|
|
42086
42215
|
placement: "right",
|
|
@@ -42088,7 +42217,7 @@ function TableRowHandles({
|
|
|
42088
42217
|
onOpenChange: (open) => onOpenMenuChange(menuKey, open),
|
|
42089
42218
|
contentClassName: "p-2",
|
|
42090
42219
|
items: getMenuItems(rowHandle),
|
|
42091
|
-
trigger: /* @__PURE__ */
|
|
42220
|
+
trigger: /* @__PURE__ */ jsx98(
|
|
42092
42221
|
"button",
|
|
42093
42222
|
{
|
|
42094
42223
|
type: "button",
|
|
@@ -42107,7 +42236,7 @@ function TableRowHandles({
|
|
|
42107
42236
|
transform: isShown ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`,
|
|
42108
42237
|
pointerEvents: isShown ? "auto" : "none"
|
|
42109
42238
|
},
|
|
42110
|
-
children: visible ? /* @__PURE__ */
|
|
42239
|
+
children: visible ? /* @__PURE__ */ jsx98(GripVertical3, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx98("div", { className: "h-3 w-1 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
|
|
42111
42240
|
}
|
|
42112
42241
|
)
|
|
42113
42242
|
}
|
|
@@ -42131,12 +42260,12 @@ function TableColumnHandles({
|
|
|
42131
42260
|
onStartDrag,
|
|
42132
42261
|
openMenuKey
|
|
42133
42262
|
}) {
|
|
42134
|
-
return /* @__PURE__ */
|
|
42263
|
+
return /* @__PURE__ */ jsx98(Fragment35, { children: columnHandles.map((columnHandle) => {
|
|
42135
42264
|
const menuKey = `column:${columnHandle.index}`;
|
|
42136
42265
|
const isActive = columnHandle.index === activeColumnIndex;
|
|
42137
42266
|
const visible = controlsVisible || hoverColumnHandleIndex === columnHandle.index || openMenuKey === menuKey;
|
|
42138
42267
|
const isShown = visible || isActive;
|
|
42139
|
-
return /* @__PURE__ */
|
|
42268
|
+
return /* @__PURE__ */ jsx98(
|
|
42140
42269
|
"div",
|
|
42141
42270
|
{
|
|
42142
42271
|
className: "absolute z-30",
|
|
@@ -42145,13 +42274,13 @@ function TableColumnHandles({
|
|
|
42145
42274
|
top: columnHandleTop,
|
|
42146
42275
|
left: Math.max(8, columnHandle.center - 12)
|
|
42147
42276
|
},
|
|
42148
|
-
children: /* @__PURE__ */
|
|
42277
|
+
children: /* @__PURE__ */ jsx98(
|
|
42149
42278
|
Tooltip,
|
|
42150
42279
|
{
|
|
42151
42280
|
placement: "top",
|
|
42152
42281
|
disabled: openMenuKey === menuKey || !visible && isActive,
|
|
42153
|
-
content: /* @__PURE__ */
|
|
42154
|
-
children: /* @__PURE__ */
|
|
42282
|
+
content: /* @__PURE__ */ jsx98("span", { className: "text-xs font-medium", children: `${columnDragLabel} ${columnHandle.index + 1}` }),
|
|
42283
|
+
children: /* @__PURE__ */ jsx98("span", { className: "inline-flex", children: /* @__PURE__ */ jsx98(
|
|
42155
42284
|
DropdownMenu,
|
|
42156
42285
|
{
|
|
42157
42286
|
placement: "bottom-start",
|
|
@@ -42159,7 +42288,7 @@ function TableColumnHandles({
|
|
|
42159
42288
|
onOpenChange: (open) => onOpenMenuChange(menuKey, open),
|
|
42160
42289
|
contentClassName: "p-2",
|
|
42161
42290
|
items: getMenuItems(columnHandle),
|
|
42162
|
-
trigger: /* @__PURE__ */
|
|
42291
|
+
trigger: /* @__PURE__ */ jsx98(
|
|
42163
42292
|
"button",
|
|
42164
42293
|
{
|
|
42165
42294
|
type: "button",
|
|
@@ -42178,7 +42307,7 @@ function TableColumnHandles({
|
|
|
42178
42307
|
transform: isShown ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`,
|
|
42179
42308
|
pointerEvents: isShown ? "auto" : "none"
|
|
42180
42309
|
},
|
|
42181
|
-
children: visible ? /* @__PURE__ */
|
|
42310
|
+
children: visible ? /* @__PURE__ */ jsx98(GripHorizontal, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx98("div", { className: "h-1 w-3 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
|
|
42182
42311
|
}
|
|
42183
42312
|
)
|
|
42184
42313
|
}
|
|
@@ -42192,7 +42321,7 @@ function TableColumnHandles({
|
|
|
42192
42321
|
}
|
|
42193
42322
|
|
|
42194
42323
|
// src/components/UEditor/table-controls.tsx
|
|
42195
|
-
import { Fragment as Fragment36, jsx as
|
|
42324
|
+
import { Fragment as Fragment36, jsx as jsx99, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
42196
42325
|
var TABLE_MENU_TOP_OFFSET = 10;
|
|
42197
42326
|
function nearestIndex(centers, position) {
|
|
42198
42327
|
let bestIndex = 0;
|
|
@@ -42218,17 +42347,17 @@ function getSelectedCell(editor) {
|
|
|
42218
42347
|
}
|
|
42219
42348
|
function TableControls({ editor, containerRef }) {
|
|
42220
42349
|
const t = useSmartTranslations("UEditor");
|
|
42221
|
-
const [layout, setLayout] =
|
|
42222
|
-
const [dragPreview, setDragPreview] =
|
|
42223
|
-
const [hoverState, setHoverState] =
|
|
42224
|
-
const [openMenuKey, setOpenMenuKey] =
|
|
42225
|
-
const layoutRef =
|
|
42226
|
-
const dragStateRef =
|
|
42227
|
-
const syncFrameRef =
|
|
42228
|
-
|
|
42350
|
+
const [layout, setLayout] = React86.useState(null);
|
|
42351
|
+
const [dragPreview, setDragPreview] = React86.useState(null);
|
|
42352
|
+
const [hoverState, setHoverState] = React86.useState(DEFAULT_TABLE_HOVER_STATE);
|
|
42353
|
+
const [openMenuKey, setOpenMenuKey] = React86.useState(null);
|
|
42354
|
+
const layoutRef = React86.useRef(null);
|
|
42355
|
+
const dragStateRef = React86.useRef(null);
|
|
42356
|
+
const syncFrameRef = React86.useRef(null);
|
|
42357
|
+
React86.useEffect(() => {
|
|
42229
42358
|
layoutRef.current = layout;
|
|
42230
42359
|
}, [layout]);
|
|
42231
|
-
const syncFromCell =
|
|
42360
|
+
const syncFromCell = React86.useCallback((cell) => {
|
|
42232
42361
|
const surface = containerRef.current;
|
|
42233
42362
|
if (!surface || !cell) {
|
|
42234
42363
|
setLayout(null);
|
|
@@ -42236,23 +42365,23 @@ function TableControls({ editor, containerRef }) {
|
|
|
42236
42365
|
}
|
|
42237
42366
|
setLayout(buildTableControlLayout(editor, surface, cell));
|
|
42238
42367
|
}, [containerRef, editor]);
|
|
42239
|
-
const syncFromSelection =
|
|
42368
|
+
const syncFromSelection = React86.useCallback(() => {
|
|
42240
42369
|
syncFromCell(getSelectedCell(editor));
|
|
42241
42370
|
}, [editor, syncFromCell]);
|
|
42242
|
-
const scheduleSyncFromSelection =
|
|
42371
|
+
const scheduleSyncFromSelection = React86.useCallback(() => {
|
|
42243
42372
|
if (syncFrameRef.current !== null) return;
|
|
42244
42373
|
syncFrameRef.current = window.requestAnimationFrame(() => {
|
|
42245
42374
|
syncFrameRef.current = null;
|
|
42246
42375
|
syncFromSelection();
|
|
42247
42376
|
});
|
|
42248
42377
|
}, [syncFromSelection]);
|
|
42249
|
-
|
|
42378
|
+
React86.useEffect(() => () => {
|
|
42250
42379
|
if (syncFrameRef.current !== null) {
|
|
42251
42380
|
window.cancelAnimationFrame(syncFrameRef.current);
|
|
42252
42381
|
syncFrameRef.current = null;
|
|
42253
42382
|
}
|
|
42254
42383
|
}, []);
|
|
42255
|
-
const refreshCurrentLayout =
|
|
42384
|
+
const refreshCurrentLayout = React86.useCallback(() => {
|
|
42256
42385
|
setLayout((prev) => {
|
|
42257
42386
|
if (!prev) return prev;
|
|
42258
42387
|
const surface = containerRef.current;
|
|
@@ -42262,12 +42391,12 @@ function TableControls({ editor, containerRef }) {
|
|
|
42262
42391
|
return cell ? buildTableControlLayout(editor, surface, cell) : null;
|
|
42263
42392
|
});
|
|
42264
42393
|
}, [containerRef, editor]);
|
|
42265
|
-
const clearDrag =
|
|
42394
|
+
const clearDrag = React86.useCallback(() => {
|
|
42266
42395
|
dragStateRef.current = null;
|
|
42267
42396
|
setDragPreview(null);
|
|
42268
42397
|
document.body.style.cursor = "";
|
|
42269
42398
|
}, []);
|
|
42270
|
-
const updateHoverState =
|
|
42399
|
+
const updateHoverState = React86.useCallback((event) => {
|
|
42271
42400
|
const activeLayout = layoutRef.current;
|
|
42272
42401
|
const surface = containerRef.current;
|
|
42273
42402
|
if (!activeLayout || !surface || dragStateRef.current) {
|
|
@@ -42283,7 +42412,7 @@ function TableControls({ editor, containerRef }) {
|
|
|
42283
42412
|
return areTableHoverStatesEqual(prev, nextState) ? prev : nextState;
|
|
42284
42413
|
});
|
|
42285
42414
|
}, [containerRef]);
|
|
42286
|
-
|
|
42415
|
+
React86.useEffect(() => {
|
|
42287
42416
|
const proseMirror = editor.view.dom;
|
|
42288
42417
|
const surface = containerRef.current;
|
|
42289
42418
|
if (!surface) return void 0;
|
|
@@ -42334,37 +42463,37 @@ function TableControls({ editor, containerRef }) {
|
|
|
42334
42463
|
editor.off("update", refreshCurrentLayout);
|
|
42335
42464
|
};
|
|
42336
42465
|
}, [clearDrag, containerRef, editor, refreshCurrentLayout, syncFromCell, syncFromSelection, updateHoverState]);
|
|
42337
|
-
const runAtCellPos =
|
|
42466
|
+
const runAtCellPos = React86.useCallback((cellPos, command, options) => {
|
|
42338
42467
|
const result = runTableCommandAtCellPos(editor, cellPos, command);
|
|
42339
42468
|
if (options?.sync !== false) {
|
|
42340
42469
|
scheduleSyncFromSelection();
|
|
42341
42470
|
}
|
|
42342
42471
|
return result;
|
|
42343
42472
|
}, [editor, scheduleSyncFromSelection]);
|
|
42344
|
-
const runAtActiveCell =
|
|
42473
|
+
const runAtActiveCell = React86.useCallback((command, options) => {
|
|
42345
42474
|
return runAtCellPos(layoutRef.current?.cellPos ?? null, command, options);
|
|
42346
42475
|
}, [runAtCellPos]);
|
|
42347
|
-
const duplicateRowAt =
|
|
42476
|
+
const duplicateRowAt = React86.useCallback((rowIndex, cellPos) => {
|
|
42348
42477
|
const result = duplicateTableRowAt(editor, rowIndex, cellPos);
|
|
42349
42478
|
scheduleSyncFromSelection();
|
|
42350
42479
|
return result;
|
|
42351
42480
|
}, [editor, scheduleSyncFromSelection]);
|
|
42352
|
-
const clearRowAt =
|
|
42481
|
+
const clearRowAt = React86.useCallback((rowIndex, cellPos) => {
|
|
42353
42482
|
const result = clearTableRowAt(editor, rowIndex, cellPos);
|
|
42354
42483
|
scheduleSyncFromSelection();
|
|
42355
42484
|
return result;
|
|
42356
42485
|
}, [editor, scheduleSyncFromSelection]);
|
|
42357
|
-
const duplicateColumnAt =
|
|
42486
|
+
const duplicateColumnAt = React86.useCallback((columnIndex, cellPos) => {
|
|
42358
42487
|
const result = duplicateTableColumnAt(editor, columnIndex, cellPos);
|
|
42359
42488
|
scheduleSyncFromSelection();
|
|
42360
42489
|
return result;
|
|
42361
42490
|
}, [editor, scheduleSyncFromSelection]);
|
|
42362
|
-
const clearColumnAt =
|
|
42491
|
+
const clearColumnAt = React86.useCallback((columnIndex, cellPos) => {
|
|
42363
42492
|
const result = clearTableColumnAt(editor, columnIndex, cellPos);
|
|
42364
42493
|
scheduleSyncFromSelection();
|
|
42365
42494
|
return result;
|
|
42366
42495
|
}, [editor, scheduleSyncFromSelection]);
|
|
42367
|
-
const expandTableBy =
|
|
42496
|
+
const expandTableBy = React86.useCallback((rows, cols) => {
|
|
42368
42497
|
const activeCellPos = layoutRef.current?.cellPos ?? editor.state.selection.from;
|
|
42369
42498
|
const result = expandTableFromCell(editor, activeCellPos, rows, cols);
|
|
42370
42499
|
scheduleSyncFromSelection();
|
|
@@ -42373,19 +42502,19 @@ function TableControls({ editor, containerRef }) {
|
|
|
42373
42502
|
const canExpandTable = Boolean(layout);
|
|
42374
42503
|
const controlsVisible = dragPreview !== null;
|
|
42375
42504
|
const tableMenuOpen = openMenuKey === "table";
|
|
42376
|
-
const startAddColumnDrag =
|
|
42505
|
+
const startAddColumnDrag = React86.useCallback(() => {
|
|
42377
42506
|
setOpenMenuKey(null);
|
|
42378
42507
|
dragStateRef.current = { kind: "add-column", previewCols: 1 };
|
|
42379
42508
|
setDragPreview({ kind: "add-column", previewCols: 1 });
|
|
42380
42509
|
document.body.style.cursor = "ew-resize";
|
|
42381
42510
|
}, []);
|
|
42382
|
-
const startAddRowDrag =
|
|
42511
|
+
const startAddRowDrag = React86.useCallback(() => {
|
|
42383
42512
|
setOpenMenuKey(null);
|
|
42384
42513
|
dragStateRef.current = { kind: "add-row", previewRows: 1 };
|
|
42385
42514
|
setDragPreview({ kind: "add-row", previewRows: 1 });
|
|
42386
42515
|
document.body.style.cursor = "ns-resize";
|
|
42387
42516
|
}, []);
|
|
42388
|
-
const startRowDrag =
|
|
42517
|
+
const startRowDrag = React86.useCallback((rowHandle) => {
|
|
42389
42518
|
setOpenMenuKey(null);
|
|
42390
42519
|
dragStateRef.current = {
|
|
42391
42520
|
kind: "row",
|
|
@@ -42402,7 +42531,7 @@ function TableControls({ editor, containerRef }) {
|
|
|
42402
42531
|
});
|
|
42403
42532
|
document.body.style.cursor = "grabbing";
|
|
42404
42533
|
}, []);
|
|
42405
|
-
const startColumnDrag =
|
|
42534
|
+
const startColumnDrag = React86.useCallback((columnHandle) => {
|
|
42406
42535
|
setOpenMenuKey(null);
|
|
42407
42536
|
dragStateRef.current = {
|
|
42408
42537
|
kind: "column",
|
|
@@ -42419,7 +42548,7 @@ function TableControls({ editor, containerRef }) {
|
|
|
42419
42548
|
});
|
|
42420
42549
|
document.body.style.cursor = "grabbing";
|
|
42421
42550
|
}, []);
|
|
42422
|
-
|
|
42551
|
+
React86.useEffect(() => {
|
|
42423
42552
|
const handleMouseMove2 = (event) => {
|
|
42424
42553
|
const dragState = dragStateRef.current;
|
|
42425
42554
|
const activeLayout = layoutRef.current;
|
|
@@ -42508,7 +42637,7 @@ function TableControls({ editor, containerRef }) {
|
|
|
42508
42637
|
window.removeEventListener("blur", clearDrag);
|
|
42509
42638
|
};
|
|
42510
42639
|
}, [clearDrag, containerRef, editor, expandTableBy, scheduleSyncFromSelection]);
|
|
42511
|
-
const menuItems =
|
|
42640
|
+
const menuItems = React86.useMemo(() => {
|
|
42512
42641
|
if (!layout) return [];
|
|
42513
42642
|
return [
|
|
42514
42643
|
{
|
|
@@ -42576,7 +42705,7 @@ function TableControls({ editor, containerRef }) {
|
|
|
42576
42705
|
}
|
|
42577
42706
|
];
|
|
42578
42707
|
}, [editor, layout, runAtActiveCell, t]);
|
|
42579
|
-
const getRowHandleMenuItems =
|
|
42708
|
+
const getRowHandleMenuItems = React86.useCallback((rowHandle) => [
|
|
42580
42709
|
{
|
|
42581
42710
|
label: t("tableMenu.addRowBefore"),
|
|
42582
42711
|
icon: ArrowUp2,
|
|
@@ -42604,7 +42733,7 @@ function TableControls({ editor, containerRef }) {
|
|
|
42604
42733
|
destructive: true
|
|
42605
42734
|
}
|
|
42606
42735
|
], [clearRowAt, duplicateRowAt, runAtCellPos, t]);
|
|
42607
|
-
const getColumnHandleMenuItems =
|
|
42736
|
+
const getColumnHandleMenuItems = React86.useCallback((columnHandle) => [
|
|
42608
42737
|
{
|
|
42609
42738
|
label: t("tableMenu.addColumnBefore"),
|
|
42610
42739
|
icon: ArrowLeft2,
|
|
@@ -42640,7 +42769,7 @@ function TableControls({ editor, containerRef }) {
|
|
|
42640
42769
|
const rowHandleLeft = layout.tableLeft - 12;
|
|
42641
42770
|
const columnHandleTop = layout.tableTop - 12;
|
|
42642
42771
|
return /* @__PURE__ */ jsxs80(Fragment36, { children: [
|
|
42643
|
-
/* @__PURE__ */
|
|
42772
|
+
/* @__PURE__ */ jsx99(
|
|
42644
42773
|
TableRowHandles,
|
|
42645
42774
|
{
|
|
42646
42775
|
activeRowIndex: layout.activeRowIndex,
|
|
@@ -42657,7 +42786,7 @@ function TableControls({ editor, containerRef }) {
|
|
|
42657
42786
|
rowHandles: layout.rowHandles
|
|
42658
42787
|
}
|
|
42659
42788
|
),
|
|
42660
|
-
/* @__PURE__ */
|
|
42789
|
+
/* @__PURE__ */ jsx99(
|
|
42661
42790
|
TableColumnHandles,
|
|
42662
42791
|
{
|
|
42663
42792
|
activeColumnIndex: layout.activeColumnIndex,
|
|
@@ -42674,7 +42803,7 @@ function TableControls({ editor, containerRef }) {
|
|
|
42674
42803
|
openMenuKey
|
|
42675
42804
|
}
|
|
42676
42805
|
),
|
|
42677
|
-
/* @__PURE__ */
|
|
42806
|
+
/* @__PURE__ */ jsx99(
|
|
42678
42807
|
TableControlMenu,
|
|
42679
42808
|
{
|
|
42680
42809
|
controlsVisible,
|
|
@@ -42689,7 +42818,7 @@ function TableControls({ editor, containerRef }) {
|
|
|
42689
42818
|
top: menuTop
|
|
42690
42819
|
}
|
|
42691
42820
|
),
|
|
42692
|
-
/* @__PURE__ */
|
|
42821
|
+
/* @__PURE__ */ jsx99(
|
|
42693
42822
|
TableAddRails,
|
|
42694
42823
|
{
|
|
42695
42824
|
addColumnVisible: hoverState.addColumnVisible,
|
|
@@ -42703,7 +42832,7 @@ function TableControls({ editor, containerRef }) {
|
|
|
42703
42832
|
quickAddRowLabel: t("tableMenu.quickAddRowAfter")
|
|
42704
42833
|
}
|
|
42705
42834
|
),
|
|
42706
|
-
/* @__PURE__ */
|
|
42835
|
+
/* @__PURE__ */ jsx99(
|
|
42707
42836
|
TableDragPreview,
|
|
42708
42837
|
{
|
|
42709
42838
|
columnDragLabel: t("tableMenu.dragColumn"),
|
|
@@ -42921,10 +43050,10 @@ var UEDITOR_PROSEMIRROR_CLASS_NAME = cn(
|
|
|
42921
43050
|
);
|
|
42922
43051
|
|
|
42923
43052
|
// src/components/UEditor/use-table-interactions.ts
|
|
42924
|
-
import
|
|
43053
|
+
import React88, { useEffect as useEffect39, useRef as useRef37 } from "react";
|
|
42925
43054
|
|
|
42926
43055
|
// src/components/UEditor/use-table-row-resize.ts
|
|
42927
|
-
import
|
|
43056
|
+
import React87, { useRef as useRef36 } from "react";
|
|
42928
43057
|
function useTableRowResize({
|
|
42929
43058
|
editor,
|
|
42930
43059
|
setHoveredTableCell,
|
|
@@ -42934,15 +43063,15 @@ function useTableRowResize({
|
|
|
42934
43063
|
scheduleTableLayoutSync
|
|
42935
43064
|
}) {
|
|
42936
43065
|
const stateRef = useRef36(null);
|
|
42937
|
-
const syncActiveGuide =
|
|
43066
|
+
const syncActiveGuide = React87.useCallback(() => {
|
|
42938
43067
|
const state = stateRef.current;
|
|
42939
43068
|
if (!state) return false;
|
|
42940
43069
|
setHoveredTableCell(state.cellElement);
|
|
42941
43070
|
showRowGuide(state.tableElement, state.rowElement, state.cellElement, state.pendingHeight);
|
|
42942
43071
|
return true;
|
|
42943
43072
|
}, [setHoveredTableCell, showRowGuide]);
|
|
42944
|
-
const isResizing =
|
|
42945
|
-
const beginResize =
|
|
43073
|
+
const isResizing = React87.useCallback(() => stateRef.current !== null, []);
|
|
43074
|
+
const beginResize = React87.useCallback((event, table, row, cell) => {
|
|
42946
43075
|
if (!editor || !isRowResizeHotspot(cell, event.clientX, event.clientY)) {
|
|
42947
43076
|
return false;
|
|
42948
43077
|
}
|
|
@@ -42968,7 +43097,7 @@ function useTableRowResize({
|
|
|
42968
43097
|
event.stopPropagation();
|
|
42969
43098
|
return true;
|
|
42970
43099
|
}, [editor, setHoveredTableCell, showRowGuide]);
|
|
42971
|
-
const handlePointerMove =
|
|
43100
|
+
const handlePointerMove = React87.useCallback((event) => {
|
|
42972
43101
|
const state = stateRef.current;
|
|
42973
43102
|
if (!state) return;
|
|
42974
43103
|
const nextHeight = Math.max(
|
|
@@ -42985,7 +43114,7 @@ function useTableRowResize({
|
|
|
42985
43114
|
document.body.style.cursor = "row-resize";
|
|
42986
43115
|
showRowGuide(state.tableElement, state.rowElement, state.cellElement, nextHeight);
|
|
42987
43116
|
}, [showRowGuide]);
|
|
42988
|
-
const handlePointerUp =
|
|
43117
|
+
const handlePointerUp = React87.useCallback((event) => {
|
|
42989
43118
|
if (!editor) return;
|
|
42990
43119
|
const state = stateRef.current;
|
|
42991
43120
|
if (!state) return;
|
|
@@ -43009,7 +43138,7 @@ function useTableRowResize({
|
|
|
43009
43138
|
clearAllTableResizeHover();
|
|
43010
43139
|
scheduleTableLayoutSync();
|
|
43011
43140
|
}, [clearAllTableResizeHover, clearHoveredTableCell, editor, scheduleTableLayoutSync]);
|
|
43012
|
-
const cancelResize =
|
|
43141
|
+
const cancelResize = React87.useCallback(() => {
|
|
43013
43142
|
if (!stateRef.current) return;
|
|
43014
43143
|
stateRef.current = null;
|
|
43015
43144
|
document.body.style.cursor = "";
|
|
@@ -43017,7 +43146,7 @@ function useTableRowResize({
|
|
|
43017
43146
|
clearAllTableResizeHover();
|
|
43018
43147
|
scheduleTableLayoutSync();
|
|
43019
43148
|
}, [clearAllTableResizeHover, clearHoveredTableCell, scheduleTableLayoutSync]);
|
|
43020
|
-
const cleanup =
|
|
43149
|
+
const cleanup = React87.useCallback(() => {
|
|
43021
43150
|
stateRef.current = null;
|
|
43022
43151
|
document.body.style.cursor = "";
|
|
43023
43152
|
}, []);
|
|
@@ -43042,16 +43171,16 @@ function useUEditorTableInteractions(editor, editable = true) {
|
|
|
43042
43171
|
const activeTableCellRef = useRef37(null);
|
|
43043
43172
|
const suppressActiveCellHighlightRef = useRef37(false);
|
|
43044
43173
|
const tableLayoutSyncFrameRef = useRef37(null);
|
|
43045
|
-
const getProseMirrorElement =
|
|
43174
|
+
const getProseMirrorElement = React88.useCallback(() => {
|
|
43046
43175
|
return editorContentRef.current?.querySelector(".ProseMirror");
|
|
43047
43176
|
}, []);
|
|
43048
|
-
const setEditorResizeCursor =
|
|
43177
|
+
const setEditorResizeCursor = React88.useCallback((cursor) => {
|
|
43049
43178
|
const proseMirror = getProseMirrorElement();
|
|
43050
43179
|
if (proseMirror) {
|
|
43051
43180
|
proseMirror.style.cursor = cursor;
|
|
43052
43181
|
}
|
|
43053
43182
|
}, [getProseMirrorElement]);
|
|
43054
|
-
const hideColumnGuide =
|
|
43183
|
+
const hideColumnGuide = React88.useCallback(() => {
|
|
43055
43184
|
editorContentRef.current?.classList.remove("resize-cursor");
|
|
43056
43185
|
getProseMirrorElement()?.classList.remove("resize-cursor");
|
|
43057
43186
|
const guide = tableColumnGuideRef.current;
|
|
@@ -43059,7 +43188,7 @@ function useUEditorTableInteractions(editor, editable = true) {
|
|
|
43059
43188
|
guide.style.opacity = "0";
|
|
43060
43189
|
}
|
|
43061
43190
|
}, [getProseMirrorElement]);
|
|
43062
|
-
const hideRowGuide =
|
|
43191
|
+
const hideRowGuide = React88.useCallback(() => {
|
|
43063
43192
|
editorContentRef.current?.classList.remove("resize-row-cursor");
|
|
43064
43193
|
getProseMirrorElement()?.classList.remove("resize-row-cursor");
|
|
43065
43194
|
const guide = tableRowGuideRef.current;
|
|
@@ -43067,12 +43196,12 @@ function useUEditorTableInteractions(editor, editable = true) {
|
|
|
43067
43196
|
guide.style.opacity = "0";
|
|
43068
43197
|
}
|
|
43069
43198
|
}, [getProseMirrorElement]);
|
|
43070
|
-
const clearAllTableResizeHover =
|
|
43199
|
+
const clearAllTableResizeHover = React88.useCallback(() => {
|
|
43071
43200
|
setEditorResizeCursor("");
|
|
43072
43201
|
hideColumnGuide();
|
|
43073
43202
|
hideRowGuide();
|
|
43074
43203
|
}, [hideColumnGuide, hideRowGuide, setEditorResizeCursor]);
|
|
43075
|
-
const updateActiveCellHighlight =
|
|
43204
|
+
const updateActiveCellHighlight = React88.useCallback((cell) => {
|
|
43076
43205
|
const surface = editorContentRef.current;
|
|
43077
43206
|
const highlight = activeTableCellHighlightRef.current;
|
|
43078
43207
|
if (!highlight) return;
|
|
@@ -43087,7 +43216,7 @@ function useUEditorTableInteractions(editor, editable = true) {
|
|
|
43087
43216
|
highlight.style.width = `${metrics.width}px`;
|
|
43088
43217
|
highlight.style.height = `${metrics.height}px`;
|
|
43089
43218
|
}, []);
|
|
43090
|
-
const scheduleTableLayoutSync =
|
|
43219
|
+
const scheduleTableLayoutSync = React88.useCallback(() => {
|
|
43091
43220
|
if (tableLayoutSyncFrameRef.current !== null) return;
|
|
43092
43221
|
tableLayoutSyncFrameRef.current = window.requestAnimationFrame(() => {
|
|
43093
43222
|
tableLayoutSyncFrameRef.current = null;
|
|
@@ -43095,7 +43224,7 @@ function useUEditorTableInteractions(editor, editable = true) {
|
|
|
43095
43224
|
editorContentRef.current?.dispatchEvent(new CustomEvent(UEDITOR_TABLE_LAYOUT_CHANGE_EVENT));
|
|
43096
43225
|
});
|
|
43097
43226
|
}, [updateActiveCellHighlight]);
|
|
43098
|
-
const setActiveTableCell =
|
|
43227
|
+
const setActiveTableCell = React88.useCallback((cell) => {
|
|
43099
43228
|
if (activeTableCellRef.current === cell) {
|
|
43100
43229
|
updateActiveCellHighlight(cell);
|
|
43101
43230
|
return;
|
|
@@ -43103,17 +43232,17 @@ function useUEditorTableInteractions(editor, editable = true) {
|
|
|
43103
43232
|
activeTableCellRef.current = cell;
|
|
43104
43233
|
updateActiveCellHighlight(activeTableCellRef.current);
|
|
43105
43234
|
}, [updateActiveCellHighlight]);
|
|
43106
|
-
const clearActiveTableCell =
|
|
43235
|
+
const clearActiveTableCell = React88.useCallback(() => {
|
|
43107
43236
|
activeTableCellRef.current = null;
|
|
43108
43237
|
updateActiveCellHighlight(null);
|
|
43109
43238
|
}, [updateActiveCellHighlight]);
|
|
43110
|
-
const setHoveredTableCell =
|
|
43239
|
+
const setHoveredTableCell = React88.useCallback((cell) => {
|
|
43111
43240
|
hoveredTableCellRef.current = cell;
|
|
43112
43241
|
}, []);
|
|
43113
|
-
const clearHoveredTableCell =
|
|
43242
|
+
const clearHoveredTableCell = React88.useCallback(() => {
|
|
43114
43243
|
hoveredTableCellRef.current = null;
|
|
43115
43244
|
}, []);
|
|
43116
|
-
const showColumnGuide =
|
|
43245
|
+
const showColumnGuide = React88.useCallback((table, row, cell) => {
|
|
43117
43246
|
const surface = editorContentRef.current;
|
|
43118
43247
|
const guide = tableColumnGuideRef.current;
|
|
43119
43248
|
if (!surface || !guide) return;
|
|
@@ -43127,7 +43256,7 @@ function useUEditorTableInteractions(editor, editable = true) {
|
|
|
43127
43256
|
getProseMirrorElement()?.classList.add("resize-cursor");
|
|
43128
43257
|
setEditorResizeCursor("col-resize");
|
|
43129
43258
|
}, [getProseMirrorElement, setEditorResizeCursor]);
|
|
43130
|
-
const showRowGuide =
|
|
43259
|
+
const showRowGuide = React88.useCallback((table, row, cell, previewHeight) => {
|
|
43131
43260
|
const surface = editorContentRef.current;
|
|
43132
43261
|
const guide = tableRowGuideRef.current;
|
|
43133
43262
|
if (!surface || !guide) return;
|
|
@@ -43159,7 +43288,7 @@ function useUEditorTableInteractions(editor, editable = true) {
|
|
|
43159
43288
|
clearAllTableResizeHover,
|
|
43160
43289
|
scheduleTableLayoutSync
|
|
43161
43290
|
});
|
|
43162
|
-
const syncActiveTableCellFromSelection =
|
|
43291
|
+
const syncActiveTableCellFromSelection = React88.useCallback(() => {
|
|
43163
43292
|
if (!editor) return;
|
|
43164
43293
|
if (!editor.isFocused) {
|
|
43165
43294
|
clearActiveTableCell();
|
|
@@ -43820,35 +43949,35 @@ function useFormulaCoordinateOverlay(editor, containerRef, labels) {
|
|
|
43820
43949
|
}
|
|
43821
43950
|
|
|
43822
43951
|
// src/components/UEditor/menu-bar.tsx
|
|
43823
|
-
import
|
|
43952
|
+
import React89, { useMemo as useMemo26, useRef as useRef39, useState as useState52 } from "react";
|
|
43824
43953
|
import { useEditorState as useEditorState3 } from "@tiptap/react";
|
|
43825
43954
|
import {
|
|
43826
43955
|
AlignCenter as AlignCenter4,
|
|
43827
43956
|
AlignJustify as AlignJustify2,
|
|
43828
43957
|
AlignLeft as AlignLeft4,
|
|
43829
43958
|
AlignRight as AlignRight4,
|
|
43830
|
-
Bold as
|
|
43831
|
-
Code as
|
|
43959
|
+
Bold as BoldIcon2,
|
|
43960
|
+
Code as CodeIcon2,
|
|
43832
43961
|
Eye as Eye3,
|
|
43833
43962
|
FileCode as FileCode4,
|
|
43834
43963
|
Heading1 as Heading1Icon2,
|
|
43835
43964
|
Heading2 as Heading2Icon2,
|
|
43836
43965
|
Heading3 as Heading3Icon2,
|
|
43837
|
-
Image as
|
|
43838
|
-
Italic as
|
|
43966
|
+
Image as ImageIcon2,
|
|
43967
|
+
Italic as ItalicIcon2,
|
|
43839
43968
|
Link as LinkIcon3,
|
|
43840
43969
|
ListTodo as ListTodo3,
|
|
43841
43970
|
Maximize2 as Maximize22,
|
|
43842
43971
|
Quote as QuoteIcon2,
|
|
43843
|
-
Redo as
|
|
43972
|
+
Redo as RedoIcon,
|
|
43844
43973
|
Scissors,
|
|
43845
|
-
Strikethrough as
|
|
43846
|
-
Subscript as
|
|
43847
|
-
Superscript as
|
|
43974
|
+
Strikethrough as StrikethroughIcon2,
|
|
43975
|
+
Subscript as SubscriptIcon2,
|
|
43976
|
+
Superscript as SuperscriptIcon2,
|
|
43848
43977
|
Table as TableIcon3,
|
|
43849
43978
|
Trash2 as Trash25,
|
|
43850
|
-
Underline as
|
|
43851
|
-
Undo as
|
|
43979
|
+
Underline as UnderlineIcon2,
|
|
43980
|
+
Undo as UndoIcon,
|
|
43852
43981
|
Square,
|
|
43853
43982
|
CircleDot as CircleDot2,
|
|
43854
43983
|
CircleCheckBig as CircleCheckBig3,
|
|
@@ -43992,14 +44121,14 @@ function prepareUEditorPreviewHtml(html) {
|
|
|
43992
44121
|
}
|
|
43993
44122
|
|
|
43994
44123
|
// src/components/UEditor/menu-bar.tsx
|
|
43995
|
-
import { Fragment as Fragment37, jsx as
|
|
44124
|
+
import { Fragment as Fragment37, jsx as jsx100, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
43996
44125
|
function MenuTableInsertGrid({
|
|
43997
44126
|
insertLabel,
|
|
43998
44127
|
previewTemplate,
|
|
43999
44128
|
onInsert
|
|
44000
44129
|
}) {
|
|
44001
44130
|
const closeMenu = useDropdownMenuClose();
|
|
44002
|
-
return /* @__PURE__ */
|
|
44131
|
+
return /* @__PURE__ */ jsx100(
|
|
44003
44132
|
TableInsertGrid,
|
|
44004
44133
|
{
|
|
44005
44134
|
insertLabel,
|
|
@@ -44015,9 +44144,9 @@ function renderMenuItems(items) {
|
|
|
44015
44144
|
return items.map((item, i) => {
|
|
44016
44145
|
switch (item.type) {
|
|
44017
44146
|
case "separator":
|
|
44018
|
-
return /* @__PURE__ */
|
|
44147
|
+
return /* @__PURE__ */ jsx100(DropdownMenuSeparator, {}, i);
|
|
44019
44148
|
case "action":
|
|
44020
|
-
return /* @__PURE__ */
|
|
44149
|
+
return /* @__PURE__ */ jsx100(
|
|
44021
44150
|
DropdownMenuItem,
|
|
44022
44151
|
{
|
|
44023
44152
|
label: item.label,
|
|
@@ -44031,9 +44160,9 @@ function renderMenuItems(items) {
|
|
|
44031
44160
|
i
|
|
44032
44161
|
);
|
|
44033
44162
|
case "sub":
|
|
44034
|
-
return /* @__PURE__ */
|
|
44163
|
+
return /* @__PURE__ */ jsx100(DropdownMenuSub, { label: item.label, icon: item.icon, disabled: item.disabled, children: renderMenuItems(item.items) }, i);
|
|
44035
44164
|
case "custom":
|
|
44036
|
-
return /* @__PURE__ */
|
|
44165
|
+
return /* @__PURE__ */ jsx100(React89.Fragment, { children: item.render() }, item.key);
|
|
44037
44166
|
}
|
|
44038
44167
|
});
|
|
44039
44168
|
}
|
|
@@ -44071,7 +44200,7 @@ function buildEditMenuItems(t, editor) {
|
|
|
44071
44200
|
{
|
|
44072
44201
|
type: "action",
|
|
44073
44202
|
label: t("menubar.undo"),
|
|
44074
|
-
icon:
|
|
44203
|
+
icon: UndoIcon,
|
|
44075
44204
|
shortcut: t("menubar.undoShortcut"),
|
|
44076
44205
|
onClick: () => editor.chain().focus().undo().run(),
|
|
44077
44206
|
disabled: !editor.can().undo()
|
|
@@ -44079,7 +44208,7 @@ function buildEditMenuItems(t, editor) {
|
|
|
44079
44208
|
{
|
|
44080
44209
|
type: "action",
|
|
44081
44210
|
label: t("menubar.redo"),
|
|
44082
|
-
icon:
|
|
44211
|
+
icon: RedoIcon,
|
|
44083
44212
|
shortcut: t("menubar.redoShortcut"),
|
|
44084
44213
|
onClick: () => editor.chain().focus().redo().run(),
|
|
44085
44214
|
disabled: !editor.can().redo()
|
|
@@ -44167,7 +44296,7 @@ function buildFormatMenuItems(t, editor) {
|
|
|
44167
44296
|
{
|
|
44168
44297
|
type: "action",
|
|
44169
44298
|
label: t("menubar.bold"),
|
|
44170
|
-
icon:
|
|
44299
|
+
icon: BoldIcon2,
|
|
44171
44300
|
shortcut: t("menubar.boldShortcut"),
|
|
44172
44301
|
active: editor.isActive("bold"),
|
|
44173
44302
|
onClick: () => editor.chain().focus().toggleBold().run()
|
|
@@ -44175,7 +44304,7 @@ function buildFormatMenuItems(t, editor) {
|
|
|
44175
44304
|
{
|
|
44176
44305
|
type: "action",
|
|
44177
44306
|
label: t("menubar.italic"),
|
|
44178
|
-
icon:
|
|
44307
|
+
icon: ItalicIcon2,
|
|
44179
44308
|
shortcut: t("menubar.italicShortcut"),
|
|
44180
44309
|
active: editor.isActive("italic"),
|
|
44181
44310
|
onClick: () => editor.chain().focus().toggleItalic().run()
|
|
@@ -44183,7 +44312,7 @@ function buildFormatMenuItems(t, editor) {
|
|
|
44183
44312
|
{
|
|
44184
44313
|
type: "action",
|
|
44185
44314
|
label: t("menubar.underline"),
|
|
44186
|
-
icon:
|
|
44315
|
+
icon: UnderlineIcon2,
|
|
44187
44316
|
shortcut: t("menubar.underlineShortcut"),
|
|
44188
44317
|
active: editor.isActive("underline"),
|
|
44189
44318
|
onClick: () => editor.chain().focus().toggleUnderline().run()
|
|
@@ -44191,28 +44320,28 @@ function buildFormatMenuItems(t, editor) {
|
|
|
44191
44320
|
{
|
|
44192
44321
|
type: "action",
|
|
44193
44322
|
label: t("menubar.strike"),
|
|
44194
|
-
icon:
|
|
44323
|
+
icon: StrikethroughIcon2,
|
|
44195
44324
|
active: editor.isActive("strike"),
|
|
44196
44325
|
onClick: () => editor.chain().focus().toggleStrike().run()
|
|
44197
44326
|
},
|
|
44198
44327
|
{
|
|
44199
44328
|
type: "action",
|
|
44200
44329
|
label: t("menubar.superscript"),
|
|
44201
|
-
icon:
|
|
44330
|
+
icon: SuperscriptIcon2,
|
|
44202
44331
|
active: editor.isActive("superscript"),
|
|
44203
44332
|
onClick: () => editor.chain().focus().toggleSuperscript().run()
|
|
44204
44333
|
},
|
|
44205
44334
|
{
|
|
44206
44335
|
type: "action",
|
|
44207
44336
|
label: t("menubar.subscript"),
|
|
44208
|
-
icon:
|
|
44337
|
+
icon: SubscriptIcon2,
|
|
44209
44338
|
active: editor.isActive("subscript"),
|
|
44210
44339
|
onClick: () => editor.chain().focus().toggleSubscript().run()
|
|
44211
44340
|
},
|
|
44212
44341
|
{
|
|
44213
44342
|
type: "action",
|
|
44214
44343
|
label: t("menubar.code"),
|
|
44215
|
-
icon:
|
|
44344
|
+
icon: CodeIcon2,
|
|
44216
44345
|
active: editor.isActive("code"),
|
|
44217
44346
|
onClick: () => editor.chain().focus().toggleCode().run()
|
|
44218
44347
|
},
|
|
@@ -44335,7 +44464,7 @@ function buildTableMenuItems(t, editor, onInsertTable) {
|
|
|
44335
44464
|
{
|
|
44336
44465
|
type: "custom",
|
|
44337
44466
|
key: "table-insert-grid",
|
|
44338
|
-
render: () => /* @__PURE__ */
|
|
44467
|
+
render: () => /* @__PURE__ */ jsx100(
|
|
44339
44468
|
MenuTableInsertGrid,
|
|
44340
44469
|
{
|
|
44341
44470
|
insertLabel: t("tableMenu.insertTable"),
|
|
@@ -44409,8 +44538,8 @@ function buildTableMenuItems(t, editor, onInsertTable) {
|
|
|
44409
44538
|
}
|
|
44410
44539
|
];
|
|
44411
44540
|
}
|
|
44412
|
-
var MenuBarTrigger =
|
|
44413
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
44541
|
+
var MenuBarTrigger = React89.forwardRef(
|
|
44542
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx100(
|
|
44414
44543
|
"button",
|
|
44415
44544
|
{
|
|
44416
44545
|
ref,
|
|
@@ -44513,9 +44642,9 @@ var MenuBar = ({
|
|
|
44513
44642
|
{
|
|
44514
44643
|
type: "custom",
|
|
44515
44644
|
key: "image",
|
|
44516
|
-
render: () => showImageInput ? /* @__PURE__ */
|
|
44517
|
-
/* @__PURE__ */
|
|
44518
|
-
/* @__PURE__ */
|
|
44645
|
+
render: () => showImageInput ? /* @__PURE__ */ jsx100(ImageInput, { onSubmit: handleImageUrl, onCancel: () => setShowImageInput(false) }) : /* @__PURE__ */ jsxs81(Fragment37, { children: [
|
|
44646
|
+
/* @__PURE__ */ jsx100(DropdownMenuItem, { label: t("menubar.image"), icon: ImageIcon2, onClick: () => setShowImageInput(true), closeOnSelect: false }),
|
|
44647
|
+
/* @__PURE__ */ jsx100(
|
|
44519
44648
|
DropdownMenuItem,
|
|
44520
44649
|
{
|
|
44521
44650
|
label: t("menubar.imageUpload"),
|
|
@@ -44530,7 +44659,7 @@ var MenuBar = ({
|
|
|
44530
44659
|
{
|
|
44531
44660
|
type: "custom",
|
|
44532
44661
|
key: "link",
|
|
44533
|
-
render: () => showLinkInput ? /* @__PURE__ */
|
|
44662
|
+
render: () => showLinkInput ? /* @__PURE__ */ jsx100(LinkInput, { onSubmit: handleLinkSubmit, onCancel: () => setShowLinkInput(false), initialUrl: editor.getAttributes("link").href ?? "" }) : /* @__PURE__ */ jsx100(
|
|
44534
44663
|
DropdownMenuItem,
|
|
44535
44664
|
{
|
|
44536
44665
|
label: t("menubar.link"),
|
|
@@ -44550,7 +44679,7 @@ var MenuBar = ({
|
|
|
44550
44679
|
{
|
|
44551
44680
|
type: "custom",
|
|
44552
44681
|
key: "table-grid",
|
|
44553
|
-
render: () => /* @__PURE__ */
|
|
44682
|
+
render: () => /* @__PURE__ */ jsx100(
|
|
44554
44683
|
MenuTableInsertGrid,
|
|
44555
44684
|
{
|
|
44556
44685
|
insertLabel: t("tableMenu.insertTable"),
|
|
@@ -44630,7 +44759,7 @@ var MenuBar = ({
|
|
|
44630
44759
|
{ label: t("menubar.table"), items: buildTableMenuItems(t, editor, handleInsertTable), open: void 0, onOpenChange: void 0 }
|
|
44631
44760
|
];
|
|
44632
44761
|
return /* @__PURE__ */ jsxs81(Fragment37, { children: [
|
|
44633
|
-
/* @__PURE__ */
|
|
44762
|
+
/* @__PURE__ */ jsx100(
|
|
44634
44763
|
"input",
|
|
44635
44764
|
{
|
|
44636
44765
|
ref: fileInputRef,
|
|
@@ -44642,10 +44771,10 @@ var MenuBar = ({
|
|
|
44642
44771
|
}
|
|
44643
44772
|
),
|
|
44644
44773
|
/* @__PURE__ */ jsxs81("div", { className: "flex items-center gap-0.5 border-b border-border/35 bg-muted/20 px-1.5 py-0.5", children: [
|
|
44645
|
-
menus.map(({ label, items, open, onOpenChange }) => /* @__PURE__ */
|
|
44774
|
+
menus.map(({ label, items, open, onOpenChange }) => /* @__PURE__ */ jsx100(
|
|
44646
44775
|
DropdownMenu,
|
|
44647
44776
|
{
|
|
44648
|
-
trigger: /* @__PURE__ */
|
|
44777
|
+
trigger: /* @__PURE__ */ jsx100(MenuBarTrigger, { children: label }),
|
|
44649
44778
|
placement: "bottom-start",
|
|
44650
44779
|
isOpen: open,
|
|
44651
44780
|
onOpenChange,
|
|
@@ -44653,7 +44782,7 @@ var MenuBar = ({
|
|
|
44653
44782
|
},
|
|
44654
44783
|
label
|
|
44655
44784
|
)),
|
|
44656
|
-
/* @__PURE__ */
|
|
44785
|
+
/* @__PURE__ */ jsx100(
|
|
44657
44786
|
"button",
|
|
44658
44787
|
{
|
|
44659
44788
|
type: "button",
|
|
@@ -44664,11 +44793,11 @@ var MenuBar = ({
|
|
|
44664
44793
|
"ml-auto inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors",
|
|
44665
44794
|
"hover:bg-accent hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1"
|
|
44666
44795
|
),
|
|
44667
|
-
children: /* @__PURE__ */
|
|
44796
|
+
children: /* @__PURE__ */ jsx100(Eye3, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
44668
44797
|
}
|
|
44669
44798
|
)
|
|
44670
44799
|
] }),
|
|
44671
|
-
/* @__PURE__ */
|
|
44800
|
+
/* @__PURE__ */ jsx100(
|
|
44672
44801
|
Modal_default,
|
|
44673
44802
|
{
|
|
44674
44803
|
isOpen: showSourceDialog,
|
|
@@ -44676,8 +44805,8 @@ var MenuBar = ({
|
|
|
44676
44805
|
title: t("menubar.sourceCode"),
|
|
44677
44806
|
size: "lg",
|
|
44678
44807
|
children: /* @__PURE__ */ jsxs81("div", { className: "space-y-3", children: [
|
|
44679
|
-
/* @__PURE__ */
|
|
44680
|
-
/* @__PURE__ */
|
|
44808
|
+
/* @__PURE__ */ jsx100("p", { className: "text-xs text-muted-foreground", children: t("menubar.sourceCodeHint") }),
|
|
44809
|
+
/* @__PURE__ */ jsx100(
|
|
44681
44810
|
"textarea",
|
|
44682
44811
|
{
|
|
44683
44812
|
"data-testid": "source-code-textarea",
|
|
@@ -44688,7 +44817,7 @@ var MenuBar = ({
|
|
|
44688
44817
|
}
|
|
44689
44818
|
),
|
|
44690
44819
|
/* @__PURE__ */ jsxs81("div", { className: "flex gap-2 justify-end", children: [
|
|
44691
|
-
/* @__PURE__ */
|
|
44820
|
+
/* @__PURE__ */ jsx100(
|
|
44692
44821
|
"button",
|
|
44693
44822
|
{
|
|
44694
44823
|
type: "button",
|
|
@@ -44697,7 +44826,7 @@ var MenuBar = ({
|
|
|
44697
44826
|
children: t("menubar.applySource")
|
|
44698
44827
|
}
|
|
44699
44828
|
),
|
|
44700
|
-
/* @__PURE__ */
|
|
44829
|
+
/* @__PURE__ */ jsx100(
|
|
44701
44830
|
"button",
|
|
44702
44831
|
{
|
|
44703
44832
|
type: "button",
|
|
@@ -44710,7 +44839,7 @@ var MenuBar = ({
|
|
|
44710
44839
|
] })
|
|
44711
44840
|
}
|
|
44712
44841
|
),
|
|
44713
|
-
/* @__PURE__ */
|
|
44842
|
+
/* @__PURE__ */ jsx100(
|
|
44714
44843
|
Modal_default,
|
|
44715
44844
|
{
|
|
44716
44845
|
isOpen: showPreviewDialog,
|
|
@@ -44721,12 +44850,12 @@ var MenuBar = ({
|
|
|
44721
44850
|
height: "min(860px, calc(100vh - 2rem))",
|
|
44722
44851
|
className: "flex flex-col overflow-hidden rounded-xl md:rounded-2xl",
|
|
44723
44852
|
contentClassName: "flex min-h-0 flex-1 overflow-hidden p-0",
|
|
44724
|
-
children: /* @__PURE__ */
|
|
44853
|
+
children: /* @__PURE__ */ jsx100(
|
|
44725
44854
|
"div",
|
|
44726
44855
|
{
|
|
44727
44856
|
"data-testid": "preview-content",
|
|
44728
44857
|
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain",
|
|
44729
|
-
children: editor.isEmpty ? /* @__PURE__ */
|
|
44858
|
+
children: editor.isEmpty ? /* @__PURE__ */ jsx100("p", { className: "text-muted-foreground text-sm", children: t("menubar.previewEmpty") }) : /* @__PURE__ */ jsx100(
|
|
44730
44859
|
"div",
|
|
44731
44860
|
{
|
|
44732
44861
|
className: UEDITOR_PROSEMIRROR_CLASS_NAME,
|
|
@@ -44744,7 +44873,7 @@ var MenuBar = ({
|
|
|
44744
44873
|
import { useEffect as useEffect41, useRef as useRef40, useState as useState53 } from "react";
|
|
44745
44874
|
import { useEditorState as useEditorState4 } from "@tiptap/react";
|
|
44746
44875
|
import { AlertCircle as AlertCircle5, Check as Check14, Hash as Hash2, Sigma as Sigma3, Trash2 as Trash26 } from "lucide-react";
|
|
44747
|
-
import { jsx as
|
|
44876
|
+
import { jsx as jsx101, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
44748
44877
|
function TableFormulaBar({ editor }) {
|
|
44749
44878
|
const t = useSmartTranslations("UEditor");
|
|
44750
44879
|
const inputRef = useRef40(null);
|
|
@@ -44802,7 +44931,7 @@ function TableFormulaBar({ editor }) {
|
|
|
44802
44931
|
"aria-label": t("tableMenu.formulaBar"),
|
|
44803
44932
|
className: "flex min-h-10 items-center gap-2 border-b border-border/60 bg-muted/25 px-2 py-1.5",
|
|
44804
44933
|
children: [
|
|
44805
|
-
/* @__PURE__ */
|
|
44934
|
+
/* @__PURE__ */ jsx101(
|
|
44806
44935
|
"span",
|
|
44807
44936
|
{
|
|
44808
44937
|
"data-ueditor-formula-cell-label": "",
|
|
@@ -44810,8 +44939,8 @@ function TableFormulaBar({ editor }) {
|
|
|
44810
44939
|
children: selectedCell.label
|
|
44811
44940
|
}
|
|
44812
44941
|
),
|
|
44813
|
-
/* @__PURE__ */
|
|
44814
|
-
/* @__PURE__ */
|
|
44942
|
+
/* @__PURE__ */ jsx101(Sigma3, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 text-primary" }),
|
|
44943
|
+
/* @__PURE__ */ jsx101(
|
|
44815
44944
|
"input",
|
|
44816
44945
|
{
|
|
44817
44946
|
ref: inputRef,
|
|
@@ -44838,12 +44967,12 @@ function TableFormulaBar({ editor }) {
|
|
|
44838
44967
|
role: "status",
|
|
44839
44968
|
className: "hidden shrink-0 items-center gap-1 text-xs font-medium text-destructive sm:inline-flex",
|
|
44840
44969
|
children: [
|
|
44841
|
-
/* @__PURE__ */
|
|
44970
|
+
/* @__PURE__ */ jsx101(AlertCircle5, { "aria-hidden": "true", className: "h-3.5 w-3.5" }),
|
|
44842
44971
|
t("tableMenu.formulaError")
|
|
44843
44972
|
]
|
|
44844
44973
|
}
|
|
44845
44974
|
),
|
|
44846
|
-
/* @__PURE__ */
|
|
44975
|
+
/* @__PURE__ */ jsx101(
|
|
44847
44976
|
"button",
|
|
44848
44977
|
{
|
|
44849
44978
|
type: "button",
|
|
@@ -44851,10 +44980,10 @@ function TableFormulaBar({ editor }) {
|
|
|
44851
44980
|
"aria-label": t("tableMenu.apply"),
|
|
44852
44981
|
title: t("tableMenu.apply"),
|
|
44853
44982
|
className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-primary text-primary-foreground transition-colors hover:bg-primary/90",
|
|
44854
|
-
children: /* @__PURE__ */
|
|
44983
|
+
children: /* @__PURE__ */ jsx101(Check14, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
44855
44984
|
}
|
|
44856
44985
|
),
|
|
44857
|
-
/* @__PURE__ */
|
|
44986
|
+
/* @__PURE__ */ jsx101(
|
|
44858
44987
|
"button",
|
|
44859
44988
|
{
|
|
44860
44989
|
type: "button",
|
|
@@ -44865,10 +44994,10 @@ function TableFormulaBar({ editor }) {
|
|
|
44865
44994
|
"aria-label": t("tableMenu.convertToValue"),
|
|
44866
44995
|
title: t("tableMenu.convertToValue"),
|
|
44867
44996
|
className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-border/60 bg-background text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
44868
|
-
children: /* @__PURE__ */
|
|
44997
|
+
children: /* @__PURE__ */ jsx101(Hash2, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
44869
44998
|
}
|
|
44870
44999
|
),
|
|
44871
|
-
/* @__PURE__ */
|
|
45000
|
+
/* @__PURE__ */ jsx101(
|
|
44872
45001
|
"button",
|
|
44873
45002
|
{
|
|
44874
45003
|
type: "button",
|
|
@@ -44879,7 +45008,7 @@ function TableFormulaBar({ editor }) {
|
|
|
44879
45008
|
"aria-label": t("tableMenu.clearCell"),
|
|
44880
45009
|
title: t("tableMenu.clearCell"),
|
|
44881
45010
|
className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-destructive/30 bg-background text-destructive transition-colors hover:bg-destructive/10",
|
|
44882
|
-
children: /* @__PURE__ */
|
|
45011
|
+
children: /* @__PURE__ */ jsx101(Trash26, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
44883
45012
|
}
|
|
44884
45013
|
)
|
|
44885
45014
|
]
|
|
@@ -44888,8 +45017,8 @@ function TableFormulaBar({ editor }) {
|
|
|
44888
45017
|
}
|
|
44889
45018
|
|
|
44890
45019
|
// src/components/UEditor/UEditor.tsx
|
|
44891
|
-
import { jsx as
|
|
44892
|
-
var UEditor =
|
|
45020
|
+
import { jsx as jsx102, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
45021
|
+
var UEditor = React91.forwardRef(({
|
|
44893
45022
|
content = "",
|
|
44894
45023
|
onChange,
|
|
44895
45024
|
onHtmlChange,
|
|
@@ -44937,8 +45066,8 @@ var UEditor = React90.forwardRef(({
|
|
|
44937
45066
|
const editorInstanceRef = useRef41(null);
|
|
44938
45067
|
const formulaRangePickRef = useRef41(null);
|
|
44939
45068
|
const formulaRangeSurfaceRef = useRef41(null);
|
|
44940
|
-
const [formulaRangeHighlight, setFormulaRangeHighlight] =
|
|
44941
|
-
const scheduleFormulaRecalculate =
|
|
45069
|
+
const [formulaRangeHighlight, setFormulaRangeHighlight] = React91.useState(null);
|
|
45070
|
+
const scheduleFormulaRecalculate = React91.useCallback((editor2, options) => {
|
|
44942
45071
|
if (editor2.isDestroyed || scheduledFormulaRecalculateRef.current) return;
|
|
44943
45072
|
if (!options?.force && isEditingTableFormulaText(editor2)) return;
|
|
44944
45073
|
scheduledFormulaRecalculateRef.current = true;
|
|
@@ -44978,7 +45107,7 @@ var UEditor = React90.forwardRef(({
|
|
|
44978
45107
|
],
|
|
44979
45108
|
[effectivePlaceholder, t, maxCharacters, uploadImage, resolvedUploadFile, imageInsertMode, maxImageFileSize, allowedImageMimeTypes, fallbackToDataUrl, editable, fetchMetadata, extraExtensions]
|
|
44980
45109
|
);
|
|
44981
|
-
const syncFormulaRangeHighlight =
|
|
45110
|
+
const syncFormulaRangeHighlight = React91.useCallback((pickState) => {
|
|
44982
45111
|
const container = formulaRangeSurfaceRef.current;
|
|
44983
45112
|
setFormulaRangeHighlight(container && pickState ? getFormulaRangePickHighlight(container, pickState) : null);
|
|
44984
45113
|
}, []);
|
|
@@ -45156,7 +45285,7 @@ var UEditor = React90.forwardRef(({
|
|
|
45156
45285
|
}
|
|
45157
45286
|
}, [content, editor]);
|
|
45158
45287
|
if (!editor) {
|
|
45159
|
-
return /* @__PURE__ */
|
|
45288
|
+
return /* @__PURE__ */ jsx102(
|
|
45160
45289
|
"div",
|
|
45161
45290
|
{
|
|
45162
45291
|
className: cn("w-full border bg-background flex items-center justify-center text-muted-foreground", className),
|
|
@@ -45181,7 +45310,7 @@ var UEditor = React90.forwardRef(({
|
|
|
45181
45310
|
className
|
|
45182
45311
|
),
|
|
45183
45312
|
children: [
|
|
45184
|
-
editable && showMenuBar && /* @__PURE__ */
|
|
45313
|
+
editable && showMenuBar && /* @__PURE__ */ jsx102(
|
|
45185
45314
|
MenuBar,
|
|
45186
45315
|
{
|
|
45187
45316
|
editor,
|
|
@@ -45196,7 +45325,7 @@ var UEditor = React90.forwardRef(({
|
|
|
45196
45325
|
onPreview
|
|
45197
45326
|
}
|
|
45198
45327
|
),
|
|
45199
|
-
editable && showToolbar && /* @__PURE__ */
|
|
45328
|
+
editable && showToolbar && /* @__PURE__ */ jsx102(
|
|
45200
45329
|
EditorToolbar,
|
|
45201
45330
|
{
|
|
45202
45331
|
editor,
|
|
@@ -45211,8 +45340,8 @@ var UEditor = React90.forwardRef(({
|
|
|
45211
45340
|
letterSpacings
|
|
45212
45341
|
}
|
|
45213
45342
|
),
|
|
45214
|
-
editable && /* @__PURE__ */
|
|
45215
|
-
editable && showBubbleMenu && /* @__PURE__ */
|
|
45343
|
+
editable && /* @__PURE__ */ jsx102(TableFormulaBar, { editor }),
|
|
45344
|
+
editable && showBubbleMenu && /* @__PURE__ */ jsx102(
|
|
45216
45345
|
CustomBubbleMenu,
|
|
45217
45346
|
{
|
|
45218
45347
|
editor,
|
|
@@ -45220,7 +45349,7 @@ var UEditor = React90.forwardRef(({
|
|
|
45220
45349
|
lineHeights
|
|
45221
45350
|
}
|
|
45222
45351
|
),
|
|
45223
|
-
editable && showFloatingMenu && /* @__PURE__ */
|
|
45352
|
+
editable && showFloatingMenu && /* @__PURE__ */ jsx102(CustomFloatingMenu, { editor }),
|
|
45224
45353
|
/* @__PURE__ */ jsxs83(
|
|
45225
45354
|
"div",
|
|
45226
45355
|
{
|
|
@@ -45234,7 +45363,7 @@ var UEditor = React90.forwardRef(({
|
|
|
45234
45363
|
maxHeight
|
|
45235
45364
|
},
|
|
45236
45365
|
children: [
|
|
45237
|
-
/* @__PURE__ */
|
|
45366
|
+
/* @__PURE__ */ jsx102(
|
|
45238
45367
|
"span",
|
|
45239
45368
|
{
|
|
45240
45369
|
ref: tableColumnGuideRef,
|
|
@@ -45242,7 +45371,7 @@ var UEditor = React90.forwardRef(({
|
|
|
45242
45371
|
className: "pointer-events-none absolute z-20 bg-primary opacity-0 transition-opacity duration-100"
|
|
45243
45372
|
}
|
|
45244
45373
|
),
|
|
45245
|
-
/* @__PURE__ */
|
|
45374
|
+
/* @__PURE__ */ jsx102(
|
|
45246
45375
|
"span",
|
|
45247
45376
|
{
|
|
45248
45377
|
ref: tableRowGuideRef,
|
|
@@ -45250,7 +45379,7 @@ var UEditor = React90.forwardRef(({
|
|
|
45250
45379
|
className: "pointer-events-none absolute z-20 bg-primary opacity-0 transition-opacity duration-100"
|
|
45251
45380
|
}
|
|
45252
45381
|
),
|
|
45253
|
-
/* @__PURE__ */
|
|
45382
|
+
/* @__PURE__ */ jsx102(
|
|
45254
45383
|
"span",
|
|
45255
45384
|
{
|
|
45256
45385
|
ref: activeTableCellHighlightRef,
|
|
@@ -45259,7 +45388,7 @@ var UEditor = React90.forwardRef(({
|
|
|
45259
45388
|
className: "pointer-events-none hidden absolute z-20 rounded-[2px] border-2 border-primary bg-primary/10"
|
|
45260
45389
|
}
|
|
45261
45390
|
),
|
|
45262
|
-
/* @__PURE__ */
|
|
45391
|
+
/* @__PURE__ */ jsx102(
|
|
45263
45392
|
"div",
|
|
45264
45393
|
{
|
|
45265
45394
|
ref: formulaCoordinateOverlayRef,
|
|
@@ -45267,7 +45396,7 @@ var UEditor = React90.forwardRef(({
|
|
|
45267
45396
|
className: "pointer-events-none absolute inset-0 z-[35] hidden overflow-visible"
|
|
45268
45397
|
}
|
|
45269
45398
|
),
|
|
45270
|
-
formulaRangeHighlight && /* @__PURE__ */
|
|
45399
|
+
formulaRangeHighlight && /* @__PURE__ */ jsx102(
|
|
45271
45400
|
"span",
|
|
45272
45401
|
{
|
|
45273
45402
|
"aria-hidden": "true",
|
|
@@ -45285,8 +45414,8 @@ var UEditor = React90.forwardRef(({
|
|
|
45285
45414
|
}
|
|
45286
45415
|
}
|
|
45287
45416
|
),
|
|
45288
|
-
editable && /* @__PURE__ */
|
|
45289
|
-
/* @__PURE__ */
|
|
45417
|
+
editable && /* @__PURE__ */ jsx102(TableControls, { editor, containerRef: editorContentRef }),
|
|
45418
|
+
/* @__PURE__ */ jsx102(
|
|
45290
45419
|
EditorContent,
|
|
45291
45420
|
{
|
|
45292
45421
|
editor,
|
|
@@ -45296,7 +45425,7 @@ var UEditor = React90.forwardRef(({
|
|
|
45296
45425
|
]
|
|
45297
45426
|
}
|
|
45298
45427
|
),
|
|
45299
|
-
showFooter && showCharacterCount && /* @__PURE__ */
|
|
45428
|
+
showFooter && showCharacterCount && /* @__PURE__ */ jsx102(CharacterCountDisplay, { editor, maxCharacters })
|
|
45300
45429
|
]
|
|
45301
45430
|
}
|
|
45302
45431
|
);
|