@underverse-ui/underverse 2.0.36 → 2.0.38
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/{chunk-V4VZZHV7.js → chunk-GZ7EDNGF.js} +202 -184
- package/dist/chunk-GZ7EDNGF.js.map +1 -0
- package/dist/{chunk-SCW2XGCE.js → chunk-R27HNUZQ.js} +23 -17
- package/dist/chunk-R27HNUZQ.js.map +1 -0
- package/dist/index.cjs +497 -465
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/{menu-bar-MX3LXG6T.js → menu-bar-VXAMTP3E.js} +2 -2
- package/dist/ueditor.cjs +509 -477
- package/dist/ueditor.cjs.map +1 -1
- package/dist/ueditor.d.cts +2 -0
- package/dist/ueditor.d.ts +2 -0
- package/dist/ueditor.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-SCW2XGCE.js.map +0 -1
- package/dist/chunk-V4VZZHV7.js.map +0 -1
- /package/dist/{menu-bar-MX3LXG6T.js.map → menu-bar-VXAMTP3E.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -10068,6 +10068,30 @@ var init_link_commands = __esm({
|
|
|
10068
10068
|
}
|
|
10069
10069
|
});
|
|
10070
10070
|
|
|
10071
|
+
// src/components/UEditor/table-vertical-align-icons.tsx
|
|
10072
|
+
function TableVerticalAlignIcon({ align, ...props }) {
|
|
10073
|
+
const [shortLine, longLine] = linePositions[align];
|
|
10074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.35", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [
|
|
10075
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("rect", { x: "2", y: "1.5", width: "12", height: "13", rx: "1", opacity: "0.55" }),
|
|
10076
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("path", { d: `M5 ${shortLine}h6M4 ${longLine}h8` })
|
|
10077
|
+
] });
|
|
10078
|
+
}
|
|
10079
|
+
var import_jsx_runtime95, linePositions, TableVerticalAlignTopIcon, TableVerticalAlignMiddleIcon, TableVerticalAlignBottomIcon;
|
|
10080
|
+
var init_table_vertical_align_icons = __esm({
|
|
10081
|
+
"src/components/UEditor/table-vertical-align-icons.tsx"() {
|
|
10082
|
+
"use strict";
|
|
10083
|
+
import_jsx_runtime95 = require("react/jsx-runtime");
|
|
10084
|
+
linePositions = {
|
|
10085
|
+
top: [4.5, 7],
|
|
10086
|
+
middle: [7, 9.5],
|
|
10087
|
+
bottom: [10, 12.5]
|
|
10088
|
+
};
|
|
10089
|
+
TableVerticalAlignTopIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(TableVerticalAlignIcon, { align: "top", ...props });
|
|
10090
|
+
TableVerticalAlignMiddleIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(TableVerticalAlignIcon, { align: "middle", ...props });
|
|
10091
|
+
TableVerticalAlignBottomIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(TableVerticalAlignIcon, { align: "bottom", ...props });
|
|
10092
|
+
}
|
|
10093
|
+
});
|
|
10094
|
+
|
|
10071
10095
|
// src/components/UEditor/typography-options.ts
|
|
10072
10096
|
function normalizeStyleValue(value) {
|
|
10073
10097
|
return typeof value === "string" ? value.trim().replace(/^['"]|['"]$/g, "") : "";
|
|
@@ -10244,7 +10268,7 @@ function EditorUiRenderStateProvider({
|
|
|
10244
10268
|
editor,
|
|
10245
10269
|
selector: ({ editor: currentEditor }) => getEditorUiRenderState(currentEditor)
|
|
10246
10270
|
});
|
|
10247
|
-
return /* @__PURE__ */ (0,
|
|
10271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(EditorUiRenderStateContext.Provider, { value: { editor, value }, children });
|
|
10248
10272
|
}
|
|
10249
10273
|
function useSharedEditorUiRenderState(editor) {
|
|
10250
10274
|
const context = import_react77.default.useContext(EditorUiRenderStateContext);
|
|
@@ -10265,7 +10289,7 @@ function applyTableCellAttribute(editor, name, value) {
|
|
|
10265
10289
|
}
|
|
10266
10290
|
editor.chain().focus().setCellAttribute(name, value).run();
|
|
10267
10291
|
}
|
|
10268
|
-
var import_react77, import_react78, import_lucide_react53, import_tables6,
|
|
10292
|
+
var import_react77, import_react78, import_lucide_react53, import_tables6, import_jsx_runtime96, EDITOR_UI_ACTIVE_MARKS, editorUiRenderStateCache, EditorUiRenderStateContext, ToolbarButton, ToolbarDivider, TableInsertGrid, EditorToolbar;
|
|
10269
10293
|
var init_toolbar = __esm({
|
|
10270
10294
|
"src/components/UEditor/toolbar.tsx"() {
|
|
10271
10295
|
"use strict";
|
|
@@ -10288,9 +10312,10 @@ var init_toolbar = __esm({
|
|
|
10288
10312
|
init_table_align_utils();
|
|
10289
10313
|
init_table_dom_utils();
|
|
10290
10314
|
init_table_cell_commands();
|
|
10315
|
+
init_table_vertical_align_icons();
|
|
10291
10316
|
init_figma_toolbar_icons();
|
|
10292
10317
|
init_typography_options();
|
|
10293
|
-
|
|
10318
|
+
import_jsx_runtime96 = require("react/jsx-runtime");
|
|
10294
10319
|
EDITOR_UI_ACTIVE_MARKS = [
|
|
10295
10320
|
"blockquote",
|
|
10296
10321
|
"bold",
|
|
@@ -10313,7 +10338,7 @@ var init_toolbar = __esm({
|
|
|
10313
10338
|
editorUiRenderStateCache = /* @__PURE__ */ new WeakMap();
|
|
10314
10339
|
EditorUiRenderStateContext = import_react77.default.createContext(null);
|
|
10315
10340
|
ToolbarButton = import_react77.default.forwardRef(({ onClick, onMouseDown, active, disabled, children, title, className }, ref) => {
|
|
10316
|
-
const button = /* @__PURE__ */ (0,
|
|
10341
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10317
10342
|
"button",
|
|
10318
10343
|
{
|
|
10319
10344
|
ref,
|
|
@@ -10338,12 +10363,12 @@ var init_toolbar = __esm({
|
|
|
10338
10363
|
}
|
|
10339
10364
|
);
|
|
10340
10365
|
if (title) {
|
|
10341
|
-
return /* @__PURE__ */ (0,
|
|
10366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Tooltip, { content: title, placement: "top", delay: { open: 200, close: 0 }, children: button });
|
|
10342
10367
|
}
|
|
10343
10368
|
return button;
|
|
10344
10369
|
});
|
|
10345
10370
|
ToolbarButton.displayName = "ToolbarButton";
|
|
10346
|
-
ToolbarDivider = () => /* @__PURE__ */ (0,
|
|
10371
|
+
ToolbarDivider = () => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { "aria-hidden": "true", className: "mx-1 h-5 w-px shrink-0 bg-[rgba(123,129,132,0.24)]" });
|
|
10347
10372
|
TableInsertGrid = ({
|
|
10348
10373
|
insertLabel,
|
|
10349
10374
|
previewTemplate,
|
|
@@ -10352,14 +10377,14 @@ var init_toolbar = __esm({
|
|
|
10352
10377
|
const [selection, setSelection] = import_react77.default.useState({ rows: 3, cols: 3 });
|
|
10353
10378
|
const maxRows = 8;
|
|
10354
10379
|
const maxCols = 8;
|
|
10355
|
-
return /* @__PURE__ */ (0,
|
|
10356
|
-
/* @__PURE__ */ (0,
|
|
10357
|
-
/* @__PURE__ */ (0,
|
|
10380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "mb-2 rounded-xl border border-border/60 bg-muted/20 p-2", children: [
|
|
10381
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "mb-2 text-sm font-medium text-foreground", children: formatTableInsertLabel(previewTemplate, selection.rows, selection.cols) }),
|
|
10382
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "grid grid-cols-8 gap-1", role: "grid", "aria-label": insertLabel, children: Array.from({ length: maxRows }).map(
|
|
10358
10383
|
(_, rowIndex) => Array.from({ length: maxCols }).map((__, colIndex) => {
|
|
10359
10384
|
const rows = rowIndex + 1;
|
|
10360
10385
|
const cols = colIndex + 1;
|
|
10361
10386
|
const active = rows <= selection.rows && cols <= selection.cols;
|
|
10362
|
-
return /* @__PURE__ */ (0,
|
|
10387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10363
10388
|
"button",
|
|
10364
10389
|
{
|
|
10365
10390
|
type: "button",
|
|
@@ -10389,7 +10414,7 @@ var init_toolbar = __esm({
|
|
|
10389
10414
|
);
|
|
10390
10415
|
})
|
|
10391
10416
|
) }),
|
|
10392
|
-
/* @__PURE__ */ (0,
|
|
10417
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "mt-2 text-xs text-muted-foreground", children: insertLabel })
|
|
10393
10418
|
] });
|
|
10394
10419
|
};
|
|
10395
10420
|
EditorToolbar = ({
|
|
@@ -10493,46 +10518,46 @@ var init_toolbar = __esm({
|
|
|
10493
10518
|
}
|
|
10494
10519
|
};
|
|
10495
10520
|
if (variant === "minimal") {
|
|
10496
|
-
return /* @__PURE__ */ (0,
|
|
10497
|
-
/* @__PURE__ */ (0,
|
|
10498
|
-
/* @__PURE__ */ (0,
|
|
10499
|
-
/* @__PURE__ */ (0,
|
|
10500
|
-
/* @__PURE__ */ (0,
|
|
10501
|
-
/* @__PURE__ */ (0,
|
|
10502
|
-
/* @__PURE__ */ (0,
|
|
10521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "flex flex-wrap items-center gap-0.5 border-b border-border/35 bg-muted/30 p-1.5", children: [
|
|
10522
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().undo().run(), disabled: !editor.can().undo(), title: t("toolbar.undo"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaUndoIcon, { className: "h-4 w-4" }) }),
|
|
10523
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().redo().run(), disabled: !editor.can().redo(), title: t("toolbar.redo"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaRedoIcon, { className: "h-4 w-4" }) }),
|
|
10524
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarDivider, {}),
|
|
10525
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaBoldIcon, { className: "h-4 w-4" }) }),
|
|
10526
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaItalicIcon, { className: "h-4 w-4" }) }),
|
|
10527
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10503
10528
|
ToolbarButton,
|
|
10504
10529
|
{
|
|
10505
10530
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
10506
10531
|
active: editor.isActive("bulletList"),
|
|
10507
10532
|
title: t("toolbar.bulletList"),
|
|
10508
|
-
children: /* @__PURE__ */ (0,
|
|
10533
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaListIcon, { className: "h-4 w-4" })
|
|
10509
10534
|
}
|
|
10510
10535
|
),
|
|
10511
|
-
/* @__PURE__ */ (0,
|
|
10536
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10512
10537
|
ToolbarButton,
|
|
10513
10538
|
{
|
|
10514
10539
|
onClick: () => editor.chain().focus().decreaseIndent().run(),
|
|
10515
10540
|
disabled: !editorUiState.can.decreaseIndent,
|
|
10516
10541
|
title: t("toolbar.decreaseIndent"),
|
|
10517
|
-
children: /* @__PURE__ */ (0,
|
|
10542
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.IndentDecrease, { className: "h-4 w-4" })
|
|
10518
10543
|
}
|
|
10519
10544
|
),
|
|
10520
|
-
/* @__PURE__ */ (0,
|
|
10545
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10521
10546
|
ToolbarButton,
|
|
10522
10547
|
{
|
|
10523
10548
|
onClick: () => editor.chain().focus().increaseIndent().run(),
|
|
10524
10549
|
disabled: !editorUiState.can.increaseIndent,
|
|
10525
10550
|
title: t("toolbar.increaseIndent"),
|
|
10526
|
-
children: /* @__PURE__ */ (0,
|
|
10551
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.IndentIncrease, { className: "h-4 w-4" })
|
|
10527
10552
|
}
|
|
10528
10553
|
),
|
|
10529
|
-
/* @__PURE__ */ (0,
|
|
10554
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
10530
10555
|
DropdownMenu,
|
|
10531
10556
|
{
|
|
10532
|
-
trigger: /* @__PURE__ */ (0,
|
|
10533
|
-
}, active: editor.isActive("formCheckbox"), title: t("slashCommand.formCheckbox"), children: /* @__PURE__ */ (0,
|
|
10557
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => {
|
|
10558
|
+
}, active: editor.isActive("formCheckbox"), title: t("slashCommand.formCheckbox"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.SquareCheckBig, { className: "w-4 h-4" }) }),
|
|
10534
10559
|
children: [
|
|
10535
|
-
/* @__PURE__ */ (0,
|
|
10560
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10536
10561
|
DropdownMenuItem,
|
|
10537
10562
|
{
|
|
10538
10563
|
icon: import_lucide_react53.SquareCheckBig,
|
|
@@ -10540,7 +10565,7 @@ var init_toolbar = __esm({
|
|
|
10540
10565
|
onClick: () => editor.chain().focus().setFormCheckbox().run()
|
|
10541
10566
|
}
|
|
10542
10567
|
),
|
|
10543
|
-
/* @__PURE__ */ (0,
|
|
10568
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10544
10569
|
DropdownMenuItem,
|
|
10545
10570
|
{
|
|
10546
10571
|
icon: import_lucide_react53.CircleCheckBig,
|
|
@@ -10551,12 +10576,12 @@ var init_toolbar = __esm({
|
|
|
10551
10576
|
]
|
|
10552
10577
|
}
|
|
10553
10578
|
),
|
|
10554
|
-
/* @__PURE__ */ (0,
|
|
10579
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10555
10580
|
DropdownMenu,
|
|
10556
10581
|
{
|
|
10557
10582
|
contentClassName: "min-w-72",
|
|
10558
|
-
trigger: /* @__PURE__ */ (0,
|
|
10559
|
-
children: showLinkInput ? /* @__PURE__ */ (0,
|
|
10583
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => setShowLinkInput(!editor.isActive("link")), active: editor.isActive("link"), title: t("toolbar.link"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaLinkIcon, { className: "h-4 w-4" }) }),
|
|
10584
|
+
children: showLinkInput ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10560
10585
|
LinkInput,
|
|
10561
10586
|
{
|
|
10562
10587
|
initialUrl: String(editor.getAttributes("link").href ?? ""),
|
|
@@ -10566,8 +10591,8 @@ var init_toolbar = __esm({
|
|
|
10566
10591
|
},
|
|
10567
10592
|
onCancel: () => setShowLinkInput(false)
|
|
10568
10593
|
}
|
|
10569
|
-
) : /* @__PURE__ */ (0,
|
|
10570
|
-
/* @__PURE__ */ (0,
|
|
10594
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
|
|
10595
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10571
10596
|
DropdownMenuItem,
|
|
10572
10597
|
{
|
|
10573
10598
|
icon: import_lucide_react53.Link,
|
|
@@ -10577,7 +10602,7 @@ var init_toolbar = __esm({
|
|
|
10577
10602
|
closeOnSelect: false
|
|
10578
10603
|
}
|
|
10579
10604
|
),
|
|
10580
|
-
/* @__PURE__ */ (0,
|
|
10605
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10581
10606
|
DropdownMenuItem,
|
|
10582
10607
|
{
|
|
10583
10608
|
icon: import_lucide_react53.Trash2,
|
|
@@ -10590,28 +10615,28 @@ var init_toolbar = __esm({
|
|
|
10590
10615
|
] })
|
|
10591
10616
|
}
|
|
10592
10617
|
),
|
|
10593
|
-
onToggleMenuBar && /* @__PURE__ */ (0,
|
|
10618
|
+
onToggleMenuBar && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10594
10619
|
ToolbarButton,
|
|
10595
10620
|
{
|
|
10596
10621
|
onClick: onToggleMenuBar,
|
|
10597
10622
|
active: isMenuBarVisible,
|
|
10598
10623
|
title: t(isMenuBarVisible ? "toolbar.hideMenuBar" : "toolbar.showMenuBar"),
|
|
10599
|
-
children: isMenuBarVisible ? /* @__PURE__ */ (0,
|
|
10624
|
+
children: isMenuBarVisible ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.PanelTopClose, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.PanelTopOpen, { className: "h-4 w-4" })
|
|
10600
10625
|
}
|
|
10601
10626
|
)
|
|
10602
10627
|
] });
|
|
10603
10628
|
}
|
|
10604
|
-
const VerticalAlignActiveIcon = currentCellVerticalAlign === "middle" ?
|
|
10605
|
-
return /* @__PURE__ */ (0,
|
|
10629
|
+
const VerticalAlignActiveIcon = currentCellVerticalAlign === "middle" ? TableVerticalAlignMiddleIcon : currentCellVerticalAlign === "bottom" ? TableVerticalAlignBottomIcon : TableVerticalAlignTopIcon;
|
|
10630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
10606
10631
|
"div",
|
|
10607
10632
|
{
|
|
10608
10633
|
role: "toolbar",
|
|
10609
10634
|
className: "flex min-h-9 flex-wrap items-center gap-0.5 border-b border-[rgba(196,197,213,0.6)] bg-[#F4F4F4] px-1.5 py-1 dark:bg-muted/60",
|
|
10610
10635
|
children: [
|
|
10611
|
-
isFull && /* @__PURE__ */ (0,
|
|
10636
|
+
isFull && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10612
10637
|
DropdownMenu,
|
|
10613
10638
|
{
|
|
10614
|
-
trigger: /* @__PURE__ */ (0,
|
|
10639
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
10615
10640
|
ToolbarButton,
|
|
10616
10641
|
{
|
|
10617
10642
|
onClick: () => {
|
|
@@ -10619,13 +10644,13 @@ var init_toolbar = __esm({
|
|
|
10619
10644
|
title: t("toolbar.fontFamily"),
|
|
10620
10645
|
className: "h-7 w-40 max-w-40 justify-between gap-1.5 border border-[rgba(196,197,213,0.6)] bg-white px-2 text-[#404040] shadow-[0_1px_2px_rgba(0,0,0,0.07)] hover:bg-white hover:text-[#404040] dark:bg-background dark:text-foreground",
|
|
10621
10646
|
children: [
|
|
10622
|
-
/* @__PURE__ */ (0,
|
|
10623
|
-
/* @__PURE__ */ (0,
|
|
10647
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "min-w-0 flex-1 truncate text-left text-xs font-normal", style: { fontFamily: displayedFontFamilyValue || void 0 }, children: displayedFontFamilyLabel }),
|
|
10648
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaChevronDownIcon, { className: "h-3 w-3 shrink-0 text-[#7B8184]" })
|
|
10624
10649
|
]
|
|
10625
10650
|
}
|
|
10626
10651
|
),
|
|
10627
10652
|
contentClassName: "max-h-80 overflow-y-auto min-w-56 p-2",
|
|
10628
|
-
children: availableFontFamilies.map((option) => /* @__PURE__ */ (0,
|
|
10653
|
+
children: availableFontFamilies.map((option) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10629
10654
|
DropdownMenuItem,
|
|
10630
10655
|
{
|
|
10631
10656
|
label: option.label,
|
|
@@ -10637,11 +10662,11 @@ var init_toolbar = __esm({
|
|
|
10637
10662
|
))
|
|
10638
10663
|
}
|
|
10639
10664
|
),
|
|
10640
|
-
(isMediumFull || isFull) && /* @__PURE__ */ (0,
|
|
10665
|
+
(isMediumFull || isFull) && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10641
10666
|
DropdownMenu,
|
|
10642
10667
|
{
|
|
10643
|
-
trigger: /* @__PURE__ */ (0,
|
|
10644
|
-
/* @__PURE__ */ (0,
|
|
10668
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "flex h-7 w-14 items-center rounded-md border border-[rgba(196,197,213,0.6)] bg-white text-[#404040] shadow-[0_1px_2px_rgba(0,0,0,0.07)] dark:bg-background dark:text-foreground", children: [
|
|
10669
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10645
10670
|
"input",
|
|
10646
10671
|
{
|
|
10647
10672
|
type: "number",
|
|
@@ -10672,10 +10697,10 @@ var init_toolbar = __esm({
|
|
|
10672
10697
|
className: "min-w-0 flex-1 bg-transparent px-2 text-xs font-normal leading-none outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"
|
|
10673
10698
|
}
|
|
10674
10699
|
),
|
|
10675
|
-
/* @__PURE__ */ (0,
|
|
10700
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("button", { type: "button", "aria-label": t("toolbar.fontSize"), title: t("toolbar.fontSize"), className: "px-1 text-[#7B8184]", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaChevronDownIcon, { className: "h-3 w-3" }) })
|
|
10676
10701
|
] }),
|
|
10677
10702
|
contentClassName: "max-h-80 overflow-y-auto min-w-32 p-2",
|
|
10678
|
-
children: availableFontSizes.map((option) => /* @__PURE__ */ (0,
|
|
10703
|
+
children: availableFontSizes.map((option) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10679
10704
|
DropdownMenuItem,
|
|
10680
10705
|
{
|
|
10681
10706
|
label: option.label,
|
|
@@ -10689,14 +10714,14 @@ var init_toolbar = __esm({
|
|
|
10689
10714
|
))
|
|
10690
10715
|
}
|
|
10691
10716
|
),
|
|
10692
|
-
/* @__PURE__ */ (0,
|
|
10717
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
10693
10718
|
DropdownMenu,
|
|
10694
10719
|
{
|
|
10695
10720
|
contentClassName: "p-1",
|
|
10696
|
-
trigger: /* @__PURE__ */ (0,
|
|
10697
|
-
}, title: t("toolbar.textStyle"), className: "px-1.5 w-auto gap-0.5", children: /* @__PURE__ */ (0,
|
|
10721
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => {
|
|
10722
|
+
}, title: t("toolbar.textStyle"), className: "px-1.5 w-auto gap-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaTextStyleIcon, { className: "h-4 w-4" }) }),
|
|
10698
10723
|
children: [
|
|
10699
|
-
/* @__PURE__ */ (0,
|
|
10724
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10700
10725
|
DropdownMenuItem,
|
|
10701
10726
|
{
|
|
10702
10727
|
icon: import_lucide_react53.Type,
|
|
@@ -10705,7 +10730,7 @@ var init_toolbar = __esm({
|
|
|
10705
10730
|
active: editor.isActive("paragraph")
|
|
10706
10731
|
}
|
|
10707
10732
|
),
|
|
10708
|
-
/* @__PURE__ */ (0,
|
|
10733
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10709
10734
|
DropdownMenuItem,
|
|
10710
10735
|
{
|
|
10711
10736
|
icon: import_lucide_react53.Heading1,
|
|
@@ -10715,7 +10740,7 @@ var init_toolbar = __esm({
|
|
|
10715
10740
|
shortcut: "Ctrl+Alt+1"
|
|
10716
10741
|
}
|
|
10717
10742
|
),
|
|
10718
|
-
/* @__PURE__ */ (0,
|
|
10743
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10719
10744
|
DropdownMenuItem,
|
|
10720
10745
|
{
|
|
10721
10746
|
icon: import_lucide_react53.Heading2,
|
|
@@ -10725,7 +10750,7 @@ var init_toolbar = __esm({
|
|
|
10725
10750
|
shortcut: "Ctrl+Alt+2"
|
|
10726
10751
|
}
|
|
10727
10752
|
),
|
|
10728
|
-
/* @__PURE__ */ (0,
|
|
10753
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10729
10754
|
DropdownMenuItem,
|
|
10730
10755
|
{
|
|
10731
10756
|
icon: import_lucide_react53.Heading3,
|
|
@@ -10738,15 +10763,15 @@ var init_toolbar = __esm({
|
|
|
10738
10763
|
]
|
|
10739
10764
|
}
|
|
10740
10765
|
),
|
|
10741
|
-
isFull && /* @__PURE__ */ (0,
|
|
10742
|
-
/* @__PURE__ */ (0,
|
|
10766
|
+
isFull && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
|
|
10767
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
10743
10768
|
DropdownMenu,
|
|
10744
10769
|
{
|
|
10745
|
-
trigger: /* @__PURE__ */ (0,
|
|
10746
|
-
}, title: t("toolbar.lineHeight"), className: "gap-0.5", children: /* @__PURE__ */ (0,
|
|
10770
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => {
|
|
10771
|
+
}, title: t("toolbar.lineHeight"), className: "gap-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaLineHeightIcon, { className: "h-4 w-4" }) }),
|
|
10747
10772
|
contentClassName: "max-h-72 overflow-y-auto p-1",
|
|
10748
10773
|
children: [
|
|
10749
|
-
/* @__PURE__ */ (0,
|
|
10774
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10750
10775
|
DropdownMenuItem,
|
|
10751
10776
|
{
|
|
10752
10777
|
icon: import_lucide_react53.Type,
|
|
@@ -10755,7 +10780,7 @@ var init_toolbar = __esm({
|
|
|
10755
10780
|
active: !currentLineHeight
|
|
10756
10781
|
}
|
|
10757
10782
|
),
|
|
10758
|
-
availableLineHeights.map((option) => /* @__PURE__ */ (0,
|
|
10783
|
+
availableLineHeights.map((option) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10759
10784
|
DropdownMenuItem,
|
|
10760
10785
|
{
|
|
10761
10786
|
label: option.label,
|
|
@@ -10767,14 +10792,14 @@ var init_toolbar = __esm({
|
|
|
10767
10792
|
]
|
|
10768
10793
|
}
|
|
10769
10794
|
),
|
|
10770
|
-
/* @__PURE__ */ (0,
|
|
10795
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
10771
10796
|
DropdownMenu,
|
|
10772
10797
|
{
|
|
10773
|
-
trigger: /* @__PURE__ */ (0,
|
|
10774
|
-
}, title: t("toolbar.letterSpacing"), className: "gap-0.5", children: /* @__PURE__ */ (0,
|
|
10798
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => {
|
|
10799
|
+
}, title: t("toolbar.letterSpacing"), className: "gap-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaLetterSpacingIcon, { className: "h-4 w-4" }) }),
|
|
10775
10800
|
contentClassName: "max-h-72 overflow-y-auto p-1",
|
|
10776
10801
|
children: [
|
|
10777
|
-
/* @__PURE__ */ (0,
|
|
10802
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10778
10803
|
DropdownMenuItem,
|
|
10779
10804
|
{
|
|
10780
10805
|
icon: import_lucide_react53.Type,
|
|
@@ -10783,7 +10808,7 @@ var init_toolbar = __esm({
|
|
|
10783
10808
|
active: !currentLetterSpacing
|
|
10784
10809
|
}
|
|
10785
10810
|
),
|
|
10786
|
-
availableLetterSpacings.map((option) => /* @__PURE__ */ (0,
|
|
10811
|
+
availableLetterSpacings.map((option) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10787
10812
|
DropdownMenuItem,
|
|
10788
10813
|
{
|
|
10789
10814
|
label: option.label,
|
|
@@ -10796,16 +10821,16 @@ var init_toolbar = __esm({
|
|
|
10796
10821
|
}
|
|
10797
10822
|
)
|
|
10798
10823
|
] }),
|
|
10799
|
-
/* @__PURE__ */ (0,
|
|
10800
|
-
(isMediumFull || isFull) && /* @__PURE__ */ (0,
|
|
10824
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarDivider, {}),
|
|
10825
|
+
(isMediumFull || isFull) && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10801
10826
|
DropdownMenu,
|
|
10802
10827
|
{
|
|
10803
10828
|
isOpen: isTableMenuOpen,
|
|
10804
10829
|
onOpenChange: setIsTableMenuOpen,
|
|
10805
|
-
trigger: /* @__PURE__ */ (0,
|
|
10806
|
-
}, title: t("toolbar.table"), children: /* @__PURE__ */ (0,
|
|
10830
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => {
|
|
10831
|
+
}, title: t("toolbar.table"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaTableIcon, { className: "h-4 w-4" }) }),
|
|
10807
10832
|
contentClassName: "p-2 min-w-56",
|
|
10808
|
-
children: /* @__PURE__ */ (0,
|
|
10833
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10809
10834
|
TableInsertGrid,
|
|
10810
10835
|
{
|
|
10811
10836
|
insertLabel: t("tableMenu.insertTable"),
|
|
@@ -10818,45 +10843,45 @@ var init_toolbar = __esm({
|
|
|
10818
10843
|
)
|
|
10819
10844
|
}
|
|
10820
10845
|
),
|
|
10821
|
-
/* @__PURE__ */ (0,
|
|
10822
|
-
/* @__PURE__ */ (0,
|
|
10823
|
-
/* @__PURE__ */ (0,
|
|
10846
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaBoldIcon, { className: "h-4 w-4" }) }),
|
|
10847
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaItalicIcon, { className: "h-4 w-4" }) }),
|
|
10848
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10824
10849
|
ToolbarButton,
|
|
10825
10850
|
{
|
|
10826
10851
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
10827
10852
|
active: editor.isActive("underline"),
|
|
10828
10853
|
title: t("toolbar.underline"),
|
|
10829
|
-
children: /* @__PURE__ */ (0,
|
|
10854
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaUnderlineIcon, { className: "h-4 w-4" })
|
|
10830
10855
|
}
|
|
10831
10856
|
),
|
|
10832
|
-
/* @__PURE__ */ (0,
|
|
10833
|
-
(isMediumFull || isFull) && /* @__PURE__ */ (0,
|
|
10834
|
-
isFull && /* @__PURE__ */ (0,
|
|
10835
|
-
/* @__PURE__ */ (0,
|
|
10857
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaStrikeIcon, { className: "h-4 w-4" }) }),
|
|
10858
|
+
(isMediumFull || isFull) && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaCodeIcon, { className: "h-4 w-4" }) }),
|
|
10859
|
+
isFull && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
|
|
10860
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10836
10861
|
ToolbarButton,
|
|
10837
10862
|
{
|
|
10838
10863
|
onClick: () => editor.chain().focus().toggleSubscript().run(),
|
|
10839
10864
|
active: editor.isActive("subscript"),
|
|
10840
10865
|
title: t("toolbar.subscript"),
|
|
10841
|
-
children: /* @__PURE__ */ (0,
|
|
10866
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaSubscriptIcon, { className: "h-4 w-4" })
|
|
10842
10867
|
}
|
|
10843
10868
|
),
|
|
10844
|
-
/* @__PURE__ */ (0,
|
|
10869
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10845
10870
|
ToolbarButton,
|
|
10846
10871
|
{
|
|
10847
10872
|
onClick: () => editor.chain().focus().toggleSuperscript().run(),
|
|
10848
10873
|
active: editor.isActive("superscript"),
|
|
10849
10874
|
title: t("toolbar.superscript"),
|
|
10850
|
-
children: /* @__PURE__ */ (0,
|
|
10875
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaSuperscriptIcon, { className: "h-4 w-4" })
|
|
10851
10876
|
}
|
|
10852
10877
|
)
|
|
10853
10878
|
] }),
|
|
10854
|
-
/* @__PURE__ */ (0,
|
|
10879
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10855
10880
|
DropdownMenu,
|
|
10856
10881
|
{
|
|
10857
10882
|
contentClassName: "min-w-72",
|
|
10858
|
-
trigger: /* @__PURE__ */ (0,
|
|
10859
|
-
children: showLinkInput ? /* @__PURE__ */ (0,
|
|
10883
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => setShowLinkInput(!editor.isActive("link")), active: editor.isActive("link"), title: t("toolbar.link"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaLinkIcon, { className: "h-4 w-4" }) }),
|
|
10884
|
+
children: showLinkInput ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10860
10885
|
LinkInput,
|
|
10861
10886
|
{
|
|
10862
10887
|
initialUrl: String(editor.getAttributes("link").href ?? ""),
|
|
@@ -10866,8 +10891,8 @@ var init_toolbar = __esm({
|
|
|
10866
10891
|
},
|
|
10867
10892
|
onCancel: () => setShowLinkInput(false)
|
|
10868
10893
|
}
|
|
10869
|
-
) : /* @__PURE__ */ (0,
|
|
10870
|
-
/* @__PURE__ */ (0,
|
|
10894
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
|
|
10895
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10871
10896
|
DropdownMenuItem,
|
|
10872
10897
|
{
|
|
10873
10898
|
icon: import_lucide_react53.Link,
|
|
@@ -10877,7 +10902,7 @@ var init_toolbar = __esm({
|
|
|
10877
10902
|
closeOnSelect: false
|
|
10878
10903
|
}
|
|
10879
10904
|
),
|
|
10880
|
-
/* @__PURE__ */ (0,
|
|
10905
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10881
10906
|
DropdownMenuItem,
|
|
10882
10907
|
{
|
|
10883
10908
|
icon: import_lucide_react53.Trash2,
|
|
@@ -10890,13 +10915,13 @@ var init_toolbar = __esm({
|
|
|
10890
10915
|
] })
|
|
10891
10916
|
}
|
|
10892
10917
|
),
|
|
10893
|
-
/* @__PURE__ */ (0,
|
|
10894
|
-
/* @__PURE__ */ (0,
|
|
10918
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarDivider, {}),
|
|
10919
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10895
10920
|
DropdownMenu,
|
|
10896
10921
|
{
|
|
10897
|
-
trigger: /* @__PURE__ */ (0,
|
|
10898
|
-
}, title: t("colors.textColor"), children: /* @__PURE__ */ (0,
|
|
10899
|
-
children: /* @__PURE__ */ (0,
|
|
10922
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => {
|
|
10923
|
+
}, title: t("colors.textColor"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TextColorIcon, { color: currentTextColor }) }),
|
|
10924
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10900
10925
|
EditorColorPalette,
|
|
10901
10926
|
{
|
|
10902
10927
|
colors: textColors,
|
|
@@ -10913,12 +10938,12 @@ var init_toolbar = __esm({
|
|
|
10913
10938
|
)
|
|
10914
10939
|
}
|
|
10915
10940
|
),
|
|
10916
|
-
/* @__PURE__ */ (0,
|
|
10941
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10917
10942
|
DropdownMenu,
|
|
10918
10943
|
{
|
|
10919
|
-
trigger: /* @__PURE__ */ (0,
|
|
10920
|
-
}, active: editor.isActive("highlight"), title: t("colors.highlight"), children: /* @__PURE__ */ (0,
|
|
10921
|
-
children: /* @__PURE__ */ (0,
|
|
10944
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => {
|
|
10945
|
+
}, active: editor.isActive("highlight"), title: t("colors.highlight"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(HighlightColorIcon, { color: currentHighlightColor }) }),
|
|
10946
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10922
10947
|
EditorColorPalette,
|
|
10923
10948
|
{
|
|
10924
10949
|
colors: highlightColors,
|
|
@@ -10935,15 +10960,15 @@ var init_toolbar = __esm({
|
|
|
10935
10960
|
)
|
|
10936
10961
|
}
|
|
10937
10962
|
),
|
|
10938
|
-
(isMediumFull || isFull) && /* @__PURE__ */ (0,
|
|
10939
|
-
/* @__PURE__ */ (0,
|
|
10940
|
-
/* @__PURE__ */ (0,
|
|
10963
|
+
(isMediumFull || isFull) && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
|
|
10964
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarDivider, {}),
|
|
10965
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
10941
10966
|
DropdownMenu,
|
|
10942
10967
|
{
|
|
10943
|
-
trigger: /* @__PURE__ */ (0,
|
|
10944
|
-
}, title: t("toolbar.alignment"), children: /* @__PURE__ */ (0,
|
|
10968
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => {
|
|
10969
|
+
}, title: t("toolbar.alignment"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaAlignLeftIcon, { className: "h-4 w-4" }) }),
|
|
10945
10970
|
children: [
|
|
10946
|
-
/* @__PURE__ */ (0,
|
|
10971
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10947
10972
|
DropdownMenuItem,
|
|
10948
10973
|
{
|
|
10949
10974
|
icon: import_lucide_react53.AlignLeft,
|
|
@@ -10952,7 +10977,7 @@ var init_toolbar = __esm({
|
|
|
10952
10977
|
active: editor.isActive({ textAlign: "left" })
|
|
10953
10978
|
}
|
|
10954
10979
|
),
|
|
10955
|
-
/* @__PURE__ */ (0,
|
|
10980
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10956
10981
|
DropdownMenuItem,
|
|
10957
10982
|
{
|
|
10958
10983
|
icon: import_lucide_react53.AlignCenter,
|
|
@@ -10961,7 +10986,7 @@ var init_toolbar = __esm({
|
|
|
10961
10986
|
active: editor.isActive({ textAlign: "center" })
|
|
10962
10987
|
}
|
|
10963
10988
|
),
|
|
10964
|
-
/* @__PURE__ */ (0,
|
|
10989
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10965
10990
|
DropdownMenuItem,
|
|
10966
10991
|
{
|
|
10967
10992
|
icon: import_lucide_react53.AlignRight,
|
|
@@ -10970,7 +10995,7 @@ var init_toolbar = __esm({
|
|
|
10970
10995
|
active: editor.isActive({ textAlign: "right" })
|
|
10971
10996
|
}
|
|
10972
10997
|
),
|
|
10973
|
-
/* @__PURE__ */ (0,
|
|
10998
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10974
10999
|
DropdownMenuItem,
|
|
10975
11000
|
{
|
|
10976
11001
|
icon: import_lucide_react53.AlignJustify,
|
|
@@ -10979,30 +11004,30 @@ var init_toolbar = __esm({
|
|
|
10979
11004
|
active: editor.isActive({ textAlign: "justify" })
|
|
10980
11005
|
}
|
|
10981
11006
|
),
|
|
10982
|
-
hasTableContext && /* @__PURE__ */ (0,
|
|
10983
|
-
/* @__PURE__ */ (0,
|
|
10984
|
-
/* @__PURE__ */ (0,
|
|
11007
|
+
hasTableContext && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
|
|
11008
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "my-1 border-t" }),
|
|
11009
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10985
11010
|
DropdownMenuItem,
|
|
10986
11011
|
{
|
|
10987
|
-
icon:
|
|
11012
|
+
icon: TableVerticalAlignTopIcon,
|
|
10988
11013
|
label: t("tableMenu.alignVerticalTop") || "Align top",
|
|
10989
11014
|
onClick: () => applyTableCellAttribute(editor, "verticalAlign", "top"),
|
|
10990
11015
|
active: currentCellVerticalAlign === "top"
|
|
10991
11016
|
}
|
|
10992
11017
|
),
|
|
10993
|
-
/* @__PURE__ */ (0,
|
|
11018
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10994
11019
|
DropdownMenuItem,
|
|
10995
11020
|
{
|
|
10996
|
-
icon:
|
|
11021
|
+
icon: TableVerticalAlignMiddleIcon,
|
|
10997
11022
|
label: t("tableMenu.alignVerticalMiddle") || "Align middle",
|
|
10998
11023
|
onClick: () => applyTableCellAttribute(editor, "verticalAlign", "middle"),
|
|
10999
11024
|
active: currentCellVerticalAlign === "middle"
|
|
11000
11025
|
}
|
|
11001
11026
|
),
|
|
11002
|
-
/* @__PURE__ */ (0,
|
|
11027
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11003
11028
|
DropdownMenuItem,
|
|
11004
11029
|
{
|
|
11005
|
-
icon:
|
|
11030
|
+
icon: TableVerticalAlignBottomIcon,
|
|
11006
11031
|
label: t("tableMenu.alignVerticalBottom") || "Align bottom",
|
|
11007
11032
|
onClick: () => applyTableCellAttribute(editor, "verticalAlign", "bottom"),
|
|
11008
11033
|
active: currentCellVerticalAlign === "bottom"
|
|
@@ -11012,14 +11037,14 @@ var init_toolbar = __esm({
|
|
|
11012
11037
|
]
|
|
11013
11038
|
}
|
|
11014
11039
|
),
|
|
11015
|
-
hasTableContext && /* @__PURE__ */ (0,
|
|
11016
|
-
/* @__PURE__ */ (0,
|
|
11040
|
+
hasTableContext && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
|
|
11041
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
11017
11042
|
DropdownMenu,
|
|
11018
11043
|
{
|
|
11019
|
-
trigger: /* @__PURE__ */ (0,
|
|
11020
|
-
}, title: t("tableMenu.textDirection"), children: currentCellTextDirection === "vertical" ? /* @__PURE__ */ (0,
|
|
11044
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => {
|
|
11045
|
+
}, title: t("tableMenu.textDirection"), children: currentCellTextDirection === "vertical" ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.ArrowDown, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.ArrowRight, { className: "w-4 h-4" }) }),
|
|
11021
11046
|
children: [
|
|
11022
|
-
/* @__PURE__ */ (0,
|
|
11047
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11023
11048
|
DropdownMenuItem,
|
|
11024
11049
|
{
|
|
11025
11050
|
icon: import_lucide_react53.ArrowRight,
|
|
@@ -11028,7 +11053,7 @@ var init_toolbar = __esm({
|
|
|
11028
11053
|
active: currentCellTextDirection === "horizontal"
|
|
11029
11054
|
}
|
|
11030
11055
|
),
|
|
11031
|
-
/* @__PURE__ */ (0,
|
|
11056
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11032
11057
|
DropdownMenuItem,
|
|
11033
11058
|
{
|
|
11034
11059
|
icon: import_lucide_react53.ArrowDown,
|
|
@@ -11040,25 +11065,25 @@ var init_toolbar = __esm({
|
|
|
11040
11065
|
]
|
|
11041
11066
|
}
|
|
11042
11067
|
),
|
|
11043
|
-
/* @__PURE__ */ (0,
|
|
11068
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11044
11069
|
ToolbarButton,
|
|
11045
11070
|
{
|
|
11046
11071
|
onClick: () => applyTableCellAttribute(editor, "textWrap", currentCellTextWrap === "nowrap" ? "wrap" : "nowrap"),
|
|
11047
11072
|
active: currentCellTextWrap !== "nowrap",
|
|
11048
11073
|
title: currentCellTextWrap === "nowrap" ? t("tableMenu.wrapText") : t("tableMenu.noWrapText"),
|
|
11049
|
-
children: /* @__PURE__ */ (0,
|
|
11074
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.WrapText, { className: "h-4 w-4" })
|
|
11050
11075
|
}
|
|
11051
11076
|
)
|
|
11052
11077
|
] })
|
|
11053
11078
|
] }),
|
|
11054
|
-
/* @__PURE__ */ (0,
|
|
11055
|
-
/* @__PURE__ */ (0,
|
|
11079
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarDivider, {}),
|
|
11080
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
11056
11081
|
DropdownMenu,
|
|
11057
11082
|
{
|
|
11058
|
-
trigger: /* @__PURE__ */ (0,
|
|
11059
|
-
}, title: t("toolbar.bulletList"), children: /* @__PURE__ */ (0,
|
|
11083
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => {
|
|
11084
|
+
}, title: t("toolbar.bulletList"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaListIcon, { className: "h-4 w-4" }) }),
|
|
11060
11085
|
children: [
|
|
11061
|
-
/* @__PURE__ */ (0,
|
|
11086
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11062
11087
|
DropdownMenuItem,
|
|
11063
11088
|
{
|
|
11064
11089
|
icon: import_lucide_react53.List,
|
|
@@ -11068,7 +11093,7 @@ var init_toolbar = __esm({
|
|
|
11068
11093
|
shortcut: "Ctrl+Shift+8"
|
|
11069
11094
|
}
|
|
11070
11095
|
),
|
|
11071
|
-
/* @__PURE__ */ (0,
|
|
11096
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11072
11097
|
DropdownMenuItem,
|
|
11073
11098
|
{
|
|
11074
11099
|
icon: import_lucide_react53.ListOrdered,
|
|
@@ -11078,7 +11103,7 @@ var init_toolbar = __esm({
|
|
|
11078
11103
|
shortcut: "Ctrl+Shift+7"
|
|
11079
11104
|
}
|
|
11080
11105
|
),
|
|
11081
|
-
/* @__PURE__ */ (0,
|
|
11106
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11082
11107
|
DropdownMenuItem,
|
|
11083
11108
|
{
|
|
11084
11109
|
icon: import_lucide_react53.ListTodo,
|
|
@@ -11091,31 +11116,31 @@ var init_toolbar = __esm({
|
|
|
11091
11116
|
]
|
|
11092
11117
|
}
|
|
11093
11118
|
),
|
|
11094
|
-
/* @__PURE__ */ (0,
|
|
11119
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11095
11120
|
ToolbarButton,
|
|
11096
11121
|
{
|
|
11097
11122
|
onClick: () => editor.chain().focus().decreaseIndent().run(),
|
|
11098
11123
|
disabled: !editorUiState.can.decreaseIndent,
|
|
11099
11124
|
title: t("toolbar.decreaseIndent"),
|
|
11100
|
-
children: /* @__PURE__ */ (0,
|
|
11125
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.IndentDecrease, { className: "h-4 w-4" })
|
|
11101
11126
|
}
|
|
11102
11127
|
),
|
|
11103
|
-
/* @__PURE__ */ (0,
|
|
11128
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11104
11129
|
ToolbarButton,
|
|
11105
11130
|
{
|
|
11106
11131
|
onClick: () => editor.chain().focus().increaseIndent().run(),
|
|
11107
11132
|
disabled: !editorUiState.can.increaseIndent,
|
|
11108
11133
|
title: t("toolbar.increaseIndent"),
|
|
11109
|
-
children: /* @__PURE__ */ (0,
|
|
11134
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.IndentIncrease, { className: "h-4 w-4" })
|
|
11110
11135
|
}
|
|
11111
11136
|
),
|
|
11112
|
-
/* @__PURE__ */ (0,
|
|
11137
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
11113
11138
|
DropdownMenu,
|
|
11114
11139
|
{
|
|
11115
|
-
trigger: /* @__PURE__ */ (0,
|
|
11116
|
-
}, active: editor.isActive("formCheckbox"), title: t("slashCommand.formCheckbox"), children: /* @__PURE__ */ (0,
|
|
11140
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => {
|
|
11141
|
+
}, active: editor.isActive("formCheckbox"), title: t("slashCommand.formCheckbox"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.SquareCheckBig, { className: "w-4 h-4" }) }),
|
|
11117
11142
|
children: [
|
|
11118
|
-
/* @__PURE__ */ (0,
|
|
11143
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11119
11144
|
DropdownMenuItem,
|
|
11120
11145
|
{
|
|
11121
11146
|
icon: import_lucide_react53.SquareCheckBig,
|
|
@@ -11123,7 +11148,7 @@ var init_toolbar = __esm({
|
|
|
11123
11148
|
onClick: () => editor.chain().focus().setFormCheckbox().run()
|
|
11124
11149
|
}
|
|
11125
11150
|
),
|
|
11126
|
-
/* @__PURE__ */ (0,
|
|
11151
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11127
11152
|
DropdownMenuItem,
|
|
11128
11153
|
{
|
|
11129
11154
|
icon: import_lucide_react53.CircleCheckBig,
|
|
@@ -11134,14 +11159,14 @@ var init_toolbar = __esm({
|
|
|
11134
11159
|
]
|
|
11135
11160
|
}
|
|
11136
11161
|
),
|
|
11137
|
-
isMediumFull && /* @__PURE__ */ (0,
|
|
11138
|
-
isFull && /* @__PURE__ */ (0,
|
|
11162
|
+
isMediumFull && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleBlockquote().run(), active: editor.isActive("blockquote"), title: t("toolbar.quote"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaQuoteIcon, { className: "h-4 w-4" }) }),
|
|
11163
|
+
isFull && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
11139
11164
|
DropdownMenu,
|
|
11140
11165
|
{
|
|
11141
|
-
trigger: /* @__PURE__ */ (0,
|
|
11142
|
-
}, title: t("toolbar.quote"), children: /* @__PURE__ */ (0,
|
|
11166
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => {
|
|
11167
|
+
}, title: t("toolbar.quote"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaQuoteIcon, { className: "h-4 w-4" }) }),
|
|
11143
11168
|
children: [
|
|
11144
|
-
/* @__PURE__ */ (0,
|
|
11169
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11145
11170
|
DropdownMenuItem,
|
|
11146
11171
|
{
|
|
11147
11172
|
icon: import_lucide_react53.Quote,
|
|
@@ -11151,7 +11176,7 @@ var init_toolbar = __esm({
|
|
|
11151
11176
|
shortcut: "Ctrl+Shift+B"
|
|
11152
11177
|
}
|
|
11153
11178
|
),
|
|
11154
|
-
/* @__PURE__ */ (0,
|
|
11179
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11155
11180
|
DropdownMenuItem,
|
|
11156
11181
|
{
|
|
11157
11182
|
icon: import_lucide_react53.FileCode,
|
|
@@ -11164,12 +11189,12 @@ var init_toolbar = __esm({
|
|
|
11164
11189
|
]
|
|
11165
11190
|
}
|
|
11166
11191
|
),
|
|
11167
|
-
(isMediumFull || isFull) && /* @__PURE__ */ (0,
|
|
11192
|
+
(isMediumFull || isFull) && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11168
11193
|
DropdownMenu,
|
|
11169
11194
|
{
|
|
11170
|
-
trigger: /* @__PURE__ */ (0,
|
|
11171
|
-
}, title: t("toolbar.image"), children: /* @__PURE__ */ (0,
|
|
11172
|
-
children: showImageInput ? /* @__PURE__ */ (0,
|
|
11195
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => {
|
|
11196
|
+
}, title: t("toolbar.image"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaImageIcon, { className: "h-4 w-4" }) }),
|
|
11197
|
+
children: showImageInput ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11173
11198
|
ImageInput,
|
|
11174
11199
|
{
|
|
11175
11200
|
onSubmit: (url, alt) => {
|
|
@@ -11178,9 +11203,9 @@ var init_toolbar = __esm({
|
|
|
11178
11203
|
},
|
|
11179
11204
|
onCancel: () => setShowImageInput(false)
|
|
11180
11205
|
}
|
|
11181
|
-
) : /* @__PURE__ */ (0,
|
|
11182
|
-
/* @__PURE__ */ (0,
|
|
11183
|
-
/* @__PURE__ */ (0,
|
|
11206
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
|
|
11207
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(DropdownMenuItem, { icon: import_lucide_react53.Link, label: t("imageInput.addFromUrl"), onClick: () => setShowImageInput(true), closeOnSelect: false }),
|
|
11208
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11184
11209
|
DropdownMenuItem,
|
|
11185
11210
|
{
|
|
11186
11211
|
icon: import_lucide_react53.Upload,
|
|
@@ -11190,8 +11215,8 @@ var init_toolbar = __esm({
|
|
|
11190
11215
|
closeOnSelect: false
|
|
11191
11216
|
}
|
|
11192
11217
|
),
|
|
11193
|
-
imageUploadError && /* @__PURE__ */ (0,
|
|
11194
|
-
/* @__PURE__ */ (0,
|
|
11218
|
+
imageUploadError && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(DropdownMenuItem, { label: imageUploadError, disabled: true, destructive: true }),
|
|
11219
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11195
11220
|
"input",
|
|
11196
11221
|
{
|
|
11197
11222
|
ref: fileInputRef,
|
|
@@ -11206,8 +11231,8 @@ var init_toolbar = __esm({
|
|
|
11206
11231
|
}
|
|
11207
11232
|
}
|
|
11208
11233
|
),
|
|
11209
|
-
/* @__PURE__ */ (0,
|
|
11210
|
-
/* @__PURE__ */ (0,
|
|
11234
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "my-1 border-t" }),
|
|
11235
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11211
11236
|
DropdownMenuItem,
|
|
11212
11237
|
{
|
|
11213
11238
|
icon: import_lucide_react53.AlignCenter,
|
|
@@ -11217,7 +11242,7 @@ var init_toolbar = __esm({
|
|
|
11217
11242
|
disabled: !isImageSelected
|
|
11218
11243
|
}
|
|
11219
11244
|
),
|
|
11220
|
-
/* @__PURE__ */ (0,
|
|
11245
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11221
11246
|
DropdownMenuItem,
|
|
11222
11247
|
{
|
|
11223
11248
|
icon: import_lucide_react53.AlignLeft,
|
|
@@ -11227,7 +11252,7 @@ var init_toolbar = __esm({
|
|
|
11227
11252
|
disabled: !isImageSelected
|
|
11228
11253
|
}
|
|
11229
11254
|
),
|
|
11230
|
-
/* @__PURE__ */ (0,
|
|
11255
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11231
11256
|
DropdownMenuItem,
|
|
11232
11257
|
{
|
|
11233
11258
|
icon: import_lucide_react53.AlignRight,
|
|
@@ -11237,8 +11262,8 @@ var init_toolbar = __esm({
|
|
|
11237
11262
|
disabled: !isImageSelected
|
|
11238
11263
|
}
|
|
11239
11264
|
),
|
|
11240
|
-
/* @__PURE__ */ (0,
|
|
11241
|
-
/* @__PURE__ */ (0,
|
|
11265
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "my-1 border-t" }),
|
|
11266
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11242
11267
|
DropdownMenuItem,
|
|
11243
11268
|
{
|
|
11244
11269
|
label: t("toolbar.imageWidthSm"),
|
|
@@ -11247,7 +11272,7 @@ var init_toolbar = __esm({
|
|
|
11247
11272
|
disabled: !isImageSelected
|
|
11248
11273
|
}
|
|
11249
11274
|
),
|
|
11250
|
-
/* @__PURE__ */ (0,
|
|
11275
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11251
11276
|
DropdownMenuItem,
|
|
11252
11277
|
{
|
|
11253
11278
|
label: t("toolbar.imageWidthMd"),
|
|
@@ -11256,7 +11281,7 @@ var init_toolbar = __esm({
|
|
|
11256
11281
|
disabled: !isImageSelected
|
|
11257
11282
|
}
|
|
11258
11283
|
),
|
|
11259
|
-
/* @__PURE__ */ (0,
|
|
11284
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11260
11285
|
DropdownMenuItem,
|
|
11261
11286
|
{
|
|
11262
11287
|
label: t("toolbar.imageWidthLg"),
|
|
@@ -11265,8 +11290,8 @@ var init_toolbar = __esm({
|
|
|
11265
11290
|
disabled: !isImageSelected
|
|
11266
11291
|
}
|
|
11267
11292
|
),
|
|
11268
|
-
/* @__PURE__ */ (0,
|
|
11269
|
-
/* @__PURE__ */ (0,
|
|
11293
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "my-1 border-t" }),
|
|
11294
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11270
11295
|
DropdownMenuItem,
|
|
11271
11296
|
{
|
|
11272
11297
|
icon: import_lucide_react53.RotateCcw,
|
|
@@ -11275,7 +11300,7 @@ var init_toolbar = __esm({
|
|
|
11275
11300
|
disabled: !isImageSelected
|
|
11276
11301
|
}
|
|
11277
11302
|
),
|
|
11278
|
-
/* @__PURE__ */ (0,
|
|
11303
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11279
11304
|
DropdownMenuItem,
|
|
11280
11305
|
{
|
|
11281
11306
|
icon: import_lucide_react53.Trash2,
|
|
@@ -11288,48 +11313,48 @@ var init_toolbar = __esm({
|
|
|
11288
11313
|
] })
|
|
11289
11314
|
}
|
|
11290
11315
|
),
|
|
11291
|
-
/* @__PURE__ */ (0,
|
|
11292
|
-
/* @__PURE__ */ (0,
|
|
11293
|
-
/* @__PURE__ */ (0,
|
|
11294
|
-
hasTableContext && /* @__PURE__ */ (0,
|
|
11295
|
-
/* @__PURE__ */ (0,
|
|
11296
|
-
/* @__PURE__ */ (0,
|
|
11316
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarDivider, {}),
|
|
11317
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().undo().run(), disabled: !editor.can().undo(), title: t("toolbar.undo"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaUndoIcon, { className: "h-4 w-4" }) }),
|
|
11318
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().redo().run(), disabled: !editor.can().redo(), title: t("toolbar.redo"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(FigmaRedoIcon, { className: "h-4 w-4" }) }),
|
|
11319
|
+
hasTableContext && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
|
|
11320
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarDivider, {}),
|
|
11321
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11297
11322
|
ToolbarButton,
|
|
11298
11323
|
{
|
|
11299
11324
|
onClick: () => editor.chain().focus().addColumnBefore().run(),
|
|
11300
11325
|
disabled: !editor.can().addColumnBefore(),
|
|
11301
11326
|
title: t("tableMenu.addColumnBefore"),
|
|
11302
|
-
children: /* @__PURE__ */ (0,
|
|
11327
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.ArrowLeft, { className: "w-4 h-4" })
|
|
11303
11328
|
}
|
|
11304
11329
|
),
|
|
11305
|
-
/* @__PURE__ */ (0,
|
|
11330
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11306
11331
|
ToolbarButton,
|
|
11307
11332
|
{
|
|
11308
11333
|
onClick: () => editor.chain().focus().addColumnAfter().run(),
|
|
11309
11334
|
disabled: !editor.can().addColumnAfter(),
|
|
11310
11335
|
title: t("tableMenu.addColumnAfter"),
|
|
11311
|
-
children: /* @__PURE__ */ (0,
|
|
11336
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.ArrowRight, { className: "w-4 h-4" })
|
|
11312
11337
|
}
|
|
11313
11338
|
),
|
|
11314
|
-
/* @__PURE__ */ (0,
|
|
11339
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11315
11340
|
ToolbarButton,
|
|
11316
11341
|
{
|
|
11317
11342
|
onClick: () => editor.chain().focus().addRowBefore().run(),
|
|
11318
11343
|
disabled: !editor.can().addRowBefore(),
|
|
11319
11344
|
title: t("tableMenu.addRowBefore"),
|
|
11320
|
-
children: /* @__PURE__ */ (0,
|
|
11345
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.ArrowUp, { className: "w-4 h-4" })
|
|
11321
11346
|
}
|
|
11322
11347
|
),
|
|
11323
|
-
/* @__PURE__ */ (0,
|
|
11348
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11324
11349
|
ToolbarButton,
|
|
11325
11350
|
{
|
|
11326
11351
|
onClick: () => editor.chain().focus().addRowAfter().run(),
|
|
11327
11352
|
disabled: !editor.can().addRowAfter(),
|
|
11328
11353
|
title: t("tableMenu.addRowAfter"),
|
|
11329
|
-
children: /* @__PURE__ */ (0,
|
|
11354
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.ArrowDown, { className: "w-4 h-4" })
|
|
11330
11355
|
}
|
|
11331
11356
|
),
|
|
11332
|
-
/* @__PURE__ */ (0,
|
|
11357
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11333
11358
|
ToolbarButton,
|
|
11334
11359
|
{
|
|
11335
11360
|
onClick: () => {
|
|
@@ -11342,17 +11367,17 @@ var init_toolbar = __esm({
|
|
|
11342
11367
|
active: canSplitCell,
|
|
11343
11368
|
disabled: !canMergeCells && !canSplitCell,
|
|
11344
11369
|
title: canSplitCell ? t("tableMenu.splitCell") : t("tableMenu.mergeCells"),
|
|
11345
|
-
children: /* @__PURE__ */ (0,
|
|
11370
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.TableCellsMerge, { className: "w-4 h-4" })
|
|
11346
11371
|
}
|
|
11347
11372
|
)
|
|
11348
11373
|
] }),
|
|
11349
|
-
onToggleMenuBar && /* @__PURE__ */ (0,
|
|
11374
|
+
onToggleMenuBar && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11350
11375
|
ToolbarButton,
|
|
11351
11376
|
{
|
|
11352
11377
|
onClick: onToggleMenuBar,
|
|
11353
11378
|
active: isMenuBarVisible,
|
|
11354
11379
|
title: t(isMenuBarVisible ? "toolbar.hideMenuBar" : "toolbar.showMenuBar"),
|
|
11355
|
-
children: isMenuBarVisible ? /* @__PURE__ */ (0,
|
|
11380
|
+
children: isMenuBarVisible ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.PanelTopClose, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react53.PanelTopOpen, { className: "h-4 w-4" })
|
|
11356
11381
|
}
|
|
11357
11382
|
)
|
|
11358
11383
|
]
|
|
@@ -11815,7 +11840,7 @@ function MenuTableInsertGrid({
|
|
|
11815
11840
|
onInsert
|
|
11816
11841
|
}) {
|
|
11817
11842
|
const closeMenu = useDropdownMenuClose();
|
|
11818
|
-
return /* @__PURE__ */ (0,
|
|
11843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
11819
11844
|
TableInsertGrid,
|
|
11820
11845
|
{
|
|
11821
11846
|
insertLabel,
|
|
@@ -11831,9 +11856,9 @@ function renderMenuItems(items) {
|
|
|
11831
11856
|
return items.map((item, i) => {
|
|
11832
11857
|
switch (item.type) {
|
|
11833
11858
|
case "separator":
|
|
11834
|
-
return /* @__PURE__ */ (0,
|
|
11859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(DropdownMenuSeparator, {}, i);
|
|
11835
11860
|
case "action":
|
|
11836
|
-
return /* @__PURE__ */ (0,
|
|
11861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
11837
11862
|
DropdownMenuItem,
|
|
11838
11863
|
{
|
|
11839
11864
|
label: item.label,
|
|
@@ -11847,9 +11872,9 @@ function renderMenuItems(items) {
|
|
|
11847
11872
|
i
|
|
11848
11873
|
);
|
|
11849
11874
|
case "sub":
|
|
11850
|
-
return /* @__PURE__ */ (0,
|
|
11875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(DropdownMenuSub, { label: item.label, icon: item.icon, disabled: item.disabled, children: renderMenuItems(item.items) }, i);
|
|
11851
11876
|
case "custom":
|
|
11852
|
-
return /* @__PURE__ */ (0,
|
|
11877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_react87.default.Fragment, { children: item.render() }, item.key);
|
|
11853
11878
|
}
|
|
11854
11879
|
});
|
|
11855
11880
|
}
|
|
@@ -12158,7 +12183,7 @@ function buildTableMenuItems(t, editor, onInsertTable) {
|
|
|
12158
12183
|
{
|
|
12159
12184
|
type: "custom",
|
|
12160
12185
|
key: "table-insert-grid",
|
|
12161
|
-
render: () => /* @__PURE__ */ (0,
|
|
12186
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
12162
12187
|
MenuTableInsertGrid,
|
|
12163
12188
|
{
|
|
12164
12189
|
insertLabel: t("tableMenu.insertTable"),
|
|
@@ -12232,7 +12257,7 @@ function buildTableMenuItems(t, editor, onInsertTable) {
|
|
|
12232
12257
|
}
|
|
12233
12258
|
];
|
|
12234
12259
|
}
|
|
12235
|
-
var import_react87, import_lucide_react60,
|
|
12260
|
+
var import_react87, import_lucide_react60, import_jsx_runtime106, MenuBarTrigger, MenuBar;
|
|
12236
12261
|
var init_menu_bar = __esm({
|
|
12237
12262
|
"src/components/UEditor/menu-bar.tsx"() {
|
|
12238
12263
|
"use strict";
|
|
@@ -12253,9 +12278,9 @@ var init_menu_bar = __esm({
|
|
|
12253
12278
|
init_portal_context();
|
|
12254
12279
|
init_async_insertion_position();
|
|
12255
12280
|
init_image_file_upload();
|
|
12256
|
-
|
|
12281
|
+
import_jsx_runtime106 = require("react/jsx-runtime");
|
|
12257
12282
|
MenuBarTrigger = import_react87.default.forwardRef(
|
|
12258
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
12283
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
12259
12284
|
"button",
|
|
12260
12285
|
{
|
|
12261
12286
|
ref,
|
|
@@ -12405,9 +12430,9 @@ var init_menu_bar = __esm({
|
|
|
12405
12430
|
{
|
|
12406
12431
|
type: "custom",
|
|
12407
12432
|
key: "image",
|
|
12408
|
-
render: () => showImageInput ? /* @__PURE__ */ (0,
|
|
12409
|
-
/* @__PURE__ */ (0,
|
|
12410
|
-
/* @__PURE__ */ (0,
|
|
12433
|
+
render: () => showImageInput ? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(ImageInput, { onSubmit: handleImageUrl, onCancel: () => setShowImageInput(false) }) : /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(import_jsx_runtime106.Fragment, { children: [
|
|
12434
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(DropdownMenuItem, { label: t("menubar.image"), icon: import_lucide_react60.Image, onClick: () => setShowImageInput(true), closeOnSelect: false }),
|
|
12435
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
12411
12436
|
DropdownMenuItem,
|
|
12412
12437
|
{
|
|
12413
12438
|
label: isUploadingImage ? t("imageInput.uploading") : t("menubar.imageUpload"),
|
|
@@ -12417,14 +12442,14 @@ var init_menu_bar = __esm({
|
|
|
12417
12442
|
disabled: isUploadingImage
|
|
12418
12443
|
}
|
|
12419
12444
|
),
|
|
12420
|
-
imageUploadError ? /* @__PURE__ */ (0,
|
|
12445
|
+
imageUploadError ? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(DropdownMenuItem, { label: imageUploadError, disabled: true, destructive: true }) : null
|
|
12421
12446
|
] })
|
|
12422
12447
|
},
|
|
12423
12448
|
{ type: "separator" },
|
|
12424
12449
|
{
|
|
12425
12450
|
type: "custom",
|
|
12426
12451
|
key: "link",
|
|
12427
|
-
render: () => showLinkInput ? /* @__PURE__ */ (0,
|
|
12452
|
+
render: () => showLinkInput ? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(LinkInput, { onSubmit: handleLinkSubmit, onCancel: () => setShowLinkInput(false), initialUrl: editor.getAttributes("link").href ?? "" }) : /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
12428
12453
|
DropdownMenuItem,
|
|
12429
12454
|
{
|
|
12430
12455
|
label: t("menubar.link"),
|
|
@@ -12444,7 +12469,7 @@ var init_menu_bar = __esm({
|
|
|
12444
12469
|
{
|
|
12445
12470
|
type: "custom",
|
|
12446
12471
|
key: "table-grid",
|
|
12447
|
-
render: () => /* @__PURE__ */ (0,
|
|
12472
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
12448
12473
|
MenuTableInsertGrid,
|
|
12449
12474
|
{
|
|
12450
12475
|
insertLabel: t("tableMenu.insertTable"),
|
|
@@ -12519,8 +12544,8 @@ var init_menu_bar = __esm({
|
|
|
12519
12544
|
},
|
|
12520
12545
|
{ key: "table", label: t("menubar.table"), items: buildTableMenuItems(t, editor, handleInsertTable) }
|
|
12521
12546
|
];
|
|
12522
|
-
return /* @__PURE__ */ (0,
|
|
12523
|
-
/* @__PURE__ */ (0,
|
|
12547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(import_jsx_runtime106.Fragment, { children: [
|
|
12548
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
12524
12549
|
"input",
|
|
12525
12550
|
{
|
|
12526
12551
|
ref: fileInputRef,
|
|
@@ -12535,11 +12560,11 @@ var init_menu_bar = __esm({
|
|
|
12535
12560
|
}
|
|
12536
12561
|
}
|
|
12537
12562
|
),
|
|
12538
|
-
/* @__PURE__ */ (0,
|
|
12539
|
-
menus.map(({ key, label, items }) => /* @__PURE__ */ (0,
|
|
12563
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("nav", { "aria-label": t("toolbar.showMenuBar"), className: "flex items-center gap-0.5 border-b border-border/35 bg-muted/20 px-1.5 py-0.5", children: [
|
|
12564
|
+
menus.map(({ key, label, items }) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
12540
12565
|
DropdownMenu,
|
|
12541
12566
|
{
|
|
12542
|
-
trigger: /* @__PURE__ */ (0,
|
|
12567
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(MenuBarTrigger, { children: label }),
|
|
12543
12568
|
placement: "bottom-start",
|
|
12544
12569
|
isOpen: openMenuKey === key,
|
|
12545
12570
|
onOpenChange: (open) => {
|
|
@@ -12554,7 +12579,7 @@ var init_menu_bar = __esm({
|
|
|
12554
12579
|
},
|
|
12555
12580
|
key
|
|
12556
12581
|
)),
|
|
12557
|
-
showPreviewButton && /* @__PURE__ */ (0,
|
|
12582
|
+
showPreviewButton && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
12558
12583
|
"button",
|
|
12559
12584
|
{
|
|
12560
12585
|
type: "button",
|
|
@@ -12565,11 +12590,11 @@ var init_menu_bar = __esm({
|
|
|
12565
12590
|
"ml-auto inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors",
|
|
12566
12591
|
"hover:bg-accent hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1"
|
|
12567
12592
|
),
|
|
12568
|
-
children: /* @__PURE__ */ (0,
|
|
12593
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_lucide_react60.Eye, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
12569
12594
|
}
|
|
12570
12595
|
)
|
|
12571
12596
|
] }),
|
|
12572
|
-
/* @__PURE__ */ (0,
|
|
12597
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
12573
12598
|
Modal_default,
|
|
12574
12599
|
{
|
|
12575
12600
|
isOpen: showSourceDialog,
|
|
@@ -12577,9 +12602,9 @@ var init_menu_bar = __esm({
|
|
|
12577
12602
|
title: t("menubar.sourceCode"),
|
|
12578
12603
|
size: "lg",
|
|
12579
12604
|
portalContainer: modalPortalContainer,
|
|
12580
|
-
children: /* @__PURE__ */ (0,
|
|
12581
|
-
/* @__PURE__ */ (0,
|
|
12582
|
-
/* @__PURE__ */ (0,
|
|
12605
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: "space-y-3", children: [
|
|
12606
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)("p", { className: "text-xs text-muted-foreground", children: t("menubar.sourceCodeHint") }),
|
|
12607
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
12583
12608
|
"textarea",
|
|
12584
12609
|
{
|
|
12585
12610
|
ref: sourceTextareaRef,
|
|
@@ -12597,9 +12622,9 @@ var init_menu_bar = __esm({
|
|
|
12597
12622
|
spellCheck: false
|
|
12598
12623
|
}
|
|
12599
12624
|
),
|
|
12600
|
-
sourceError ? /* @__PURE__ */ (0,
|
|
12601
|
-
/* @__PURE__ */ (0,
|
|
12602
|
-
/* @__PURE__ */ (0,
|
|
12625
|
+
sourceError ? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("p", { id: sourceErrorId, role: "alert", className: "text-xs text-destructive", children: sourceError }) : null,
|
|
12626
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: "flex gap-2 justify-end", children: [
|
|
12627
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
12603
12628
|
"button",
|
|
12604
12629
|
{
|
|
12605
12630
|
type: "button",
|
|
@@ -12608,7 +12633,7 @@ var init_menu_bar = __esm({
|
|
|
12608
12633
|
children: t("menubar.applySource")
|
|
12609
12634
|
}
|
|
12610
12635
|
),
|
|
12611
|
-
/* @__PURE__ */ (0,
|
|
12636
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
12612
12637
|
"button",
|
|
12613
12638
|
{
|
|
12614
12639
|
type: "button",
|
|
@@ -12621,7 +12646,7 @@ var init_menu_bar = __esm({
|
|
|
12621
12646
|
] })
|
|
12622
12647
|
}
|
|
12623
12648
|
),
|
|
12624
|
-
/* @__PURE__ */ (0,
|
|
12649
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
12625
12650
|
Modal_default,
|
|
12626
12651
|
{
|
|
12627
12652
|
isOpen: showPreviewDialog,
|
|
@@ -12633,12 +12658,12 @@ var init_menu_bar = __esm({
|
|
|
12633
12658
|
height: "min(860px, calc(100vh - 2rem))",
|
|
12634
12659
|
className: "flex flex-col overflow-hidden rounded-xl md:rounded-2xl",
|
|
12635
12660
|
contentClassName: "flex min-h-0 flex-1 overflow-hidden p-0",
|
|
12636
|
-
children: /* @__PURE__ */ (0,
|
|
12661
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
12637
12662
|
"div",
|
|
12638
12663
|
{
|
|
12639
12664
|
"data-testid": "preview-content",
|
|
12640
12665
|
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain",
|
|
12641
|
-
children: editor.isEmpty ? /* @__PURE__ */ (0,
|
|
12666
|
+
children: editor.isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("p", { className: "text-muted-foreground text-sm", children: t("menubar.previewEmpty") }) : /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
12642
12667
|
"div",
|
|
12643
12668
|
{
|
|
12644
12669
|
className: UEDITOR_PROSEMIRROR_CLASS_NAME,
|
|
@@ -40572,6 +40597,7 @@ function buildUEditorExtensions({
|
|
|
40572
40597
|
fallbackToDataUrl,
|
|
40573
40598
|
onImageUploadError,
|
|
40574
40599
|
editable = true,
|
|
40600
|
+
enableAutocomplete = true,
|
|
40575
40601
|
fetchMetadata
|
|
40576
40602
|
}) {
|
|
40577
40603
|
return [
|
|
@@ -40698,12 +40724,14 @@ function buildUEditorExtensions({
|
|
|
40698
40724
|
return true;
|
|
40699
40725
|
}
|
|
40700
40726
|
}),
|
|
40701
|
-
|
|
40702
|
-
|
|
40703
|
-
|
|
40704
|
-
|
|
40705
|
-
|
|
40706
|
-
|
|
40727
|
+
...enableAutocomplete ? [
|
|
40728
|
+
SlashCommand.configure({
|
|
40729
|
+
messages: buildSlashCommandMessages(translate),
|
|
40730
|
+
getPortalContainer
|
|
40731
|
+
}),
|
|
40732
|
+
FormulaSuggestion.configure({ getPortalContainer }),
|
|
40733
|
+
EmojiSuggestion.configure({ getPortalContainer })
|
|
40734
|
+
] : [],
|
|
40707
40735
|
Callout,
|
|
40708
40736
|
Bookmark.configure({
|
|
40709
40737
|
fetchMetadata
|
|
@@ -40908,7 +40936,8 @@ function subscribeSharedGlobalEvent(target, type, listener, options) {
|
|
|
40908
40936
|
|
|
40909
40937
|
// src/components/UEditor/menus.tsx
|
|
40910
40938
|
init_portal_context();
|
|
40911
|
-
|
|
40939
|
+
init_table_vertical_align_icons();
|
|
40940
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
40912
40941
|
var FloatingSlashCommandMenu = ({ editor, onClose }) => {
|
|
40913
40942
|
const t = useSmartTranslations("UEditor");
|
|
40914
40943
|
const messages = (0, import_react79.useMemo)(() => buildSlashCommandMessages(t), [t]);
|
|
@@ -40931,7 +40960,7 @@ var FloatingSlashCommandMenu = ({ editor, onClose }) => {
|
|
|
40931
40960
|
if (!portalDocument) return;
|
|
40932
40961
|
return subscribeSharedGlobalEvent(portalDocument, "keydown", handleKeyDown2);
|
|
40933
40962
|
}, [onClose, portalDocument]);
|
|
40934
|
-
return /* @__PURE__ */ (0,
|
|
40963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
40935
40964
|
SlashCommandList,
|
|
40936
40965
|
{
|
|
40937
40966
|
ref: listRef,
|
|
@@ -40948,17 +40977,17 @@ var FloatingMenuContent = ({ editor }) => {
|
|
|
40948
40977
|
const t = useSmartTranslations("UEditor");
|
|
40949
40978
|
const [showCommands, setShowCommands] = (0, import_react79.useState)(false);
|
|
40950
40979
|
if (showCommands) {
|
|
40951
|
-
return /* @__PURE__ */ (0,
|
|
40980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(FloatingSlashCommandMenu, { editor, onClose: () => setShowCommands(false) });
|
|
40952
40981
|
}
|
|
40953
|
-
return /* @__PURE__ */ (0,
|
|
40982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
40954
40983
|
"button",
|
|
40955
40984
|
{
|
|
40956
40985
|
type: "button",
|
|
40957
40986
|
onClick: () => setShowCommands(true),
|
|
40958
40987
|
className: "group flex items-center gap-1 rounded-lg px-2 py-1.5 transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30",
|
|
40959
40988
|
children: [
|
|
40960
|
-
/* @__PURE__ */ (0,
|
|
40961
|
-
/* @__PURE__ */ (0,
|
|
40989
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.Plus, { className: "w-4 h-4 text-muted-foreground group-hover:text-foreground" }),
|
|
40990
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "text-sm text-muted-foreground group-hover:text-foreground", children: t("floatingMenu.addBlock") })
|
|
40962
40991
|
]
|
|
40963
40992
|
}
|
|
40964
40993
|
);
|
|
@@ -40990,7 +41019,7 @@ function applyTableCellAttribute2(editor, name, value, options = {}) {
|
|
|
40990
41019
|
}
|
|
40991
41020
|
function BorderStylePreviewIcon({ style }) {
|
|
40992
41021
|
const isNone = style === "none";
|
|
40993
|
-
return /* @__PURE__ */ (0,
|
|
41022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
40994
41023
|
"span",
|
|
40995
41024
|
{
|
|
40996
41025
|
"aria-hidden": "true",
|
|
@@ -41002,7 +41031,7 @@ function BorderStylePreviewIcon({ style }) {
|
|
|
41002
41031
|
borderStyle: style,
|
|
41003
41032
|
borderWidth: style === "double" ? 3 : 2
|
|
41004
41033
|
},
|
|
41005
|
-
children: isNone && /* @__PURE__ */ (0,
|
|
41034
|
+
children: isNone && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "absolute left-1/2 top-0 h-full w-px -translate-x-1/2 rotate-45 bg-muted-foreground/70" })
|
|
41006
41035
|
}
|
|
41007
41036
|
);
|
|
41008
41037
|
}
|
|
@@ -41013,8 +41042,8 @@ function BorderPositionPreviewIcon({ position }) {
|
|
|
41013
41042
|
const showLeft = position === "all" || position === "outer" || position === "left";
|
|
41014
41043
|
const showHorizontal = position === "all" || position === "inner" || position === "horizontal";
|
|
41015
41044
|
const showVertical = position === "all" || position === "inner" || position === "vertical";
|
|
41016
|
-
return /* @__PURE__ */ (0,
|
|
41017
|
-
/* @__PURE__ */ (0,
|
|
41045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 20 20", className: "h-5 w-5 fill-none stroke-current", children: [
|
|
41046
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41018
41047
|
"path",
|
|
41019
41048
|
{
|
|
41020
41049
|
d: "M2 2H18V18H2Z M2 10H18 M10 2V18",
|
|
@@ -41024,12 +41053,12 @@ function BorderPositionPreviewIcon({ position }) {
|
|
|
41024
41053
|
strokeWidth: "1.25"
|
|
41025
41054
|
}
|
|
41026
41055
|
),
|
|
41027
|
-
showTop && /* @__PURE__ */ (0,
|
|
41028
|
-
showRight && /* @__PURE__ */ (0,
|
|
41029
|
-
showBottom && /* @__PURE__ */ (0,
|
|
41030
|
-
showLeft && /* @__PURE__ */ (0,
|
|
41031
|
-
showHorizontal && /* @__PURE__ */ (0,
|
|
41032
|
-
showVertical && /* @__PURE__ */ (0,
|
|
41056
|
+
showTop && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("path", { d: "M2 2H18", strokeWidth: "2" }),
|
|
41057
|
+
showRight && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("path", { d: "M18 2V18", strokeWidth: "2" }),
|
|
41058
|
+
showBottom && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("path", { d: "M2 18H18", strokeWidth: "2" }),
|
|
41059
|
+
showLeft && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("path", { d: "M2 2V18", strokeWidth: "2" }),
|
|
41060
|
+
showHorizontal && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("path", { d: "M2 10H18", strokeWidth: "2" }),
|
|
41061
|
+
showVertical && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("path", { d: "M10 2V18", strokeWidth: "2" })
|
|
41033
41062
|
] });
|
|
41034
41063
|
}
|
|
41035
41064
|
function getBubbleMenuPosition({
|
|
@@ -41261,7 +41290,7 @@ var BubbleMenuContent = ({
|
|
|
41261
41290
|
};
|
|
41262
41291
|
}, [editor, showLinkInput]);
|
|
41263
41292
|
if (showLinkInput) {
|
|
41264
|
-
return /* @__PURE__ */ (0,
|
|
41293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41265
41294
|
LinkInput,
|
|
41266
41295
|
{
|
|
41267
41296
|
initialUrl: editor.getAttributes("link").href || "",
|
|
@@ -41281,12 +41310,12 @@ var BubbleMenuContent = ({
|
|
|
41281
41310
|
const isTextPalette = activeColorPalette === "text";
|
|
41282
41311
|
const isHighlightPalette = activeColorPalette === "highlight";
|
|
41283
41312
|
if (activeColorPalette === "cell-border") {
|
|
41284
|
-
return /* @__PURE__ */ (0,
|
|
41285
|
-
/* @__PURE__ */ (0,
|
|
41286
|
-
/* @__PURE__ */ (0,
|
|
41287
|
-
/* @__PURE__ */ (0,
|
|
41288
|
-
/* @__PURE__ */ (0,
|
|
41289
|
-
/* @__PURE__ */ (0,
|
|
41313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "flex w-72 flex-col gap-2 p-2 text-sm", "data-ueditor-keep-open": true, children: [
|
|
41314
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "font-semibold text-xs text-muted-foreground uppercase tracking-wider mb-1", children: t("tableMenu.cellBorder") || "Cell Borders" }),
|
|
41315
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "flex gap-2", children: [
|
|
41316
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
41317
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("label", { className: "mb-1 block text-xs text-muted-foreground", children: t("tableMenu.borderPosition") || "Border placement" }),
|
|
41318
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "grid grid-cols-5 gap-1", role: "group", "aria-label": t("tableMenu.borderPosition") || "Border placement", children: [
|
|
41290
41319
|
[
|
|
41291
41320
|
["all", "borderAll"],
|
|
41292
41321
|
["outer", "borderOuter"],
|
|
@@ -41299,7 +41328,7 @@ var BubbleMenuContent = ({
|
|
|
41299
41328
|
["left", "borderLeft"]
|
|
41300
41329
|
].map(([position, labelKey]) => {
|
|
41301
41330
|
const label = t(`tableMenu.${labelKey}`) || position;
|
|
41302
|
-
return /* @__PURE__ */ (0,
|
|
41331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41303
41332
|
"button",
|
|
41304
41333
|
{
|
|
41305
41334
|
type: "button",
|
|
@@ -41311,12 +41340,12 @@ var BubbleMenuContent = ({
|
|
|
41311
41340
|
"inline-flex h-8 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted hover:text-primary",
|
|
41312
41341
|
activeBorderPosition === position ? "bg-primary/10 text-primary" : "bg-muted/40"
|
|
41313
41342
|
),
|
|
41314
|
-
children: /* @__PURE__ */ (0,
|
|
41343
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(BorderPositionPreviewIcon, { position })
|
|
41315
41344
|
},
|
|
41316
41345
|
position
|
|
41317
41346
|
);
|
|
41318
41347
|
}),
|
|
41319
|
-
/* @__PURE__ */ (0,
|
|
41348
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41320
41349
|
"button",
|
|
41321
41350
|
{
|
|
41322
41351
|
type: "button",
|
|
@@ -41325,13 +41354,13 @@ var BubbleMenuContent = ({
|
|
|
41325
41354
|
onMouseDown: (event) => event.preventDefault(),
|
|
41326
41355
|
onClick: clearTableCellBorders,
|
|
41327
41356
|
className: "inline-flex h-8 items-center justify-center rounded-md bg-muted/40 text-destructive transition-colors hover:bg-destructive/10",
|
|
41328
|
-
children: /* @__PURE__ */ (0,
|
|
41357
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(BorderStylePreviewIcon, { style: "none" })
|
|
41329
41358
|
}
|
|
41330
41359
|
)
|
|
41331
41360
|
] })
|
|
41332
41361
|
] }),
|
|
41333
|
-
/* @__PURE__ */ (0,
|
|
41334
|
-
/* @__PURE__ */ (0,
|
|
41362
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("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: [
|
|
41363
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41335
41364
|
"button",
|
|
41336
41365
|
{
|
|
41337
41366
|
type: "button",
|
|
@@ -41343,10 +41372,10 @@ var BubbleMenuContent = ({
|
|
|
41343
41372
|
"inline-flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:bg-muted",
|
|
41344
41373
|
borderEditMode === "draw" ? "bg-primary/10 text-primary" : "text-muted-foreground"
|
|
41345
41374
|
),
|
|
41346
|
-
children: /* @__PURE__ */ (0,
|
|
41375
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.Edit2, { className: "h-4 w-4" })
|
|
41347
41376
|
}
|
|
41348
41377
|
),
|
|
41349
|
-
/* @__PURE__ */ (0,
|
|
41378
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41350
41379
|
"button",
|
|
41351
41380
|
{
|
|
41352
41381
|
type: "button",
|
|
@@ -41358,19 +41387,19 @@ var BubbleMenuContent = ({
|
|
|
41358
41387
|
"inline-flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:bg-muted",
|
|
41359
41388
|
borderEditMode === "erase" ? "bg-destructive/10 text-destructive" : "text-muted-foreground"
|
|
41360
41389
|
),
|
|
41361
|
-
children: /* @__PURE__ */ (0,
|
|
41390
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.Eraser, { className: "h-4 w-4" })
|
|
41362
41391
|
}
|
|
41363
41392
|
)
|
|
41364
41393
|
] })
|
|
41365
41394
|
] }),
|
|
41366
|
-
/* @__PURE__ */ (0,
|
|
41367
|
-
/* @__PURE__ */ (0,
|
|
41368
|
-
/* @__PURE__ */ (0,
|
|
41395
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
41396
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderStyle") || "Border Style" }),
|
|
41397
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "grid grid-cols-4 gap-1.5", role: "group", "aria-label": t("tableMenu.borderStyle") || "Border Style", children: [
|
|
41369
41398
|
["solid", "Solid"],
|
|
41370
41399
|
["dashed", "Dashed"],
|
|
41371
41400
|
["dotted", "Dotted"],
|
|
41372
41401
|
["double", "Double"]
|
|
41373
|
-
].map(([style, label]) => /* @__PURE__ */ (0,
|
|
41402
|
+
].map(([style, label]) => /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
41374
41403
|
"button",
|
|
41375
41404
|
{
|
|
41376
41405
|
type: "button",
|
|
@@ -41381,16 +41410,16 @@ var BubbleMenuContent = ({
|
|
|
41381
41410
|
borderStyleDraft === style ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
|
|
41382
41411
|
),
|
|
41383
41412
|
children: [
|
|
41384
|
-
/* @__PURE__ */ (0,
|
|
41385
|
-
/* @__PURE__ */ (0,
|
|
41413
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(BorderStylePreviewIcon, { style }),
|
|
41414
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { children: label })
|
|
41386
41415
|
]
|
|
41387
41416
|
},
|
|
41388
41417
|
style
|
|
41389
41418
|
)) })
|
|
41390
41419
|
] }),
|
|
41391
|
-
/* @__PURE__ */ (0,
|
|
41392
|
-
/* @__PURE__ */ (0,
|
|
41393
|
-
/* @__PURE__ */ (0,
|
|
41420
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
41421
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderWidth") || "Border Width" }),
|
|
41422
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("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__ */ (0, import_jsx_runtime97.jsx)(
|
|
41394
41423
|
"button",
|
|
41395
41424
|
{
|
|
41396
41425
|
type: "button",
|
|
@@ -41405,15 +41434,15 @@ var BubbleMenuContent = ({
|
|
|
41405
41434
|
width
|
|
41406
41435
|
)) })
|
|
41407
41436
|
] }),
|
|
41408
|
-
/* @__PURE__ */ (0,
|
|
41437
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
41409
41438
|
"button",
|
|
41410
41439
|
{
|
|
41411
41440
|
type: "button",
|
|
41412
41441
|
onClick: () => setActiveColorPalette("cell-border-color"),
|
|
41413
41442
|
className: "flex items-center justify-between w-full h-8 px-2 rounded-md border border-input hover:bg-accent text-xs",
|
|
41414
41443
|
children: [
|
|
41415
|
-
/* @__PURE__ */ (0,
|
|
41416
|
-
/* @__PURE__ */ (0,
|
|
41444
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { children: t("tableMenu.borderColor") || "Border Color" }),
|
|
41445
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41417
41446
|
"span",
|
|
41418
41447
|
{
|
|
41419
41448
|
className: "w-4 h-4 rounded-full border border-border",
|
|
@@ -41428,7 +41457,7 @@ var BubbleMenuContent = ({
|
|
|
41428
41457
|
] });
|
|
41429
41458
|
}
|
|
41430
41459
|
if (activeColorPalette === "cell-border-color") {
|
|
41431
|
-
return /* @__PURE__ */ (0,
|
|
41460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41432
41461
|
EditorColorPalette,
|
|
41433
41462
|
{
|
|
41434
41463
|
colors: borderColors,
|
|
@@ -41438,7 +41467,7 @@ var BubbleMenuContent = ({
|
|
|
41438
41467
|
}
|
|
41439
41468
|
) });
|
|
41440
41469
|
}
|
|
41441
|
-
return /* @__PURE__ */ (0,
|
|
41470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41442
41471
|
EditorColorPalette,
|
|
41443
41472
|
{
|
|
41444
41473
|
colors: isTextPalette ? textColors : highlightColors,
|
|
@@ -41450,32 +41479,32 @@ var BubbleMenuContent = ({
|
|
|
41450
41479
|
) });
|
|
41451
41480
|
}
|
|
41452
41481
|
if (isImageSelected) {
|
|
41453
|
-
return /* @__PURE__ */ (0,
|
|
41454
|
-
/* @__PURE__ */ (0,
|
|
41455
|
-
/* @__PURE__ */ (0,
|
|
41456
|
-
/* @__PURE__ */ (0,
|
|
41457
|
-
/* @__PURE__ */ (0,
|
|
41458
|
-
/* @__PURE__ */ (0,
|
|
41459
|
-
/* @__PURE__ */ (0,
|
|
41460
|
-
/* @__PURE__ */ (0,
|
|
41461
|
-
/* @__PURE__ */ (0,
|
|
41462
|
-
/* @__PURE__ */ (0,
|
|
41463
|
-
/* @__PURE__ */ (0,
|
|
41482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "flex items-center gap-0.5 p-1", children: [
|
|
41483
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToolbarButton, { onClick: () => applyImageLayout(editor, "block"), active: imageLayout === "block", title: t("toolbar.imageLayoutBlock"), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.AlignCenter, { className: "w-4 h-4" }) }),
|
|
41484
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToolbarButton, { onClick: () => applyImageLayout(editor, "left"), active: imageLayout === "left", title: t("toolbar.imageLayoutLeft"), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.AlignLeft, { className: "w-4 h-4" }) }),
|
|
41485
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToolbarButton, { onClick: () => applyImageLayout(editor, "right"), active: imageLayout === "right", title: t("toolbar.imageLayoutRight"), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.AlignRight, { className: "w-4 h-4" }) }),
|
|
41486
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
41487
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "sm"), active: imageWidthPreset === "sm", title: t("toolbar.imageWidthSm"), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "text-[10px] font-semibold", children: "S" }) }),
|
|
41488
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "md"), active: imageWidthPreset === "md", title: t("toolbar.imageWidthMd"), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "text-[10px] font-semibold", children: "M" }) }),
|
|
41489
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "lg"), active: imageWidthPreset === "lg", title: t("toolbar.imageWidthLg"), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "text-[10px] font-semibold", children: "L" }) }),
|
|
41490
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
41491
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToolbarButton, { onClick: () => resetImageSize(editor), title: t("toolbar.imageResetSize"), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.RotateCcw, { className: "w-4 h-4" }) }),
|
|
41492
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41464
41493
|
ToolbarButton,
|
|
41465
41494
|
{
|
|
41466
41495
|
onClick: () => deleteSelectedImage(editor),
|
|
41467
41496
|
title: t("toolbar.imageDelete"),
|
|
41468
41497
|
className: "text-destructive hover:text-destructive",
|
|
41469
|
-
children: /* @__PURE__ */ (0,
|
|
41498
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.Trash2, { className: "w-4 h-4" })
|
|
41470
41499
|
}
|
|
41471
41500
|
)
|
|
41472
41501
|
] });
|
|
41473
41502
|
}
|
|
41474
41503
|
if (showFormulaPanel && isInTable3) {
|
|
41475
|
-
return /* @__PURE__ */ (0,
|
|
41476
|
-
/* @__PURE__ */ (0,
|
|
41477
|
-
/* @__PURE__ */ (0,
|
|
41478
|
-
/* @__PURE__ */ (0,
|
|
41504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "w-72 p-2", children: [
|
|
41505
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
|
|
41506
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("tableMenu.formula") || "Formula" }),
|
|
41507
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41479
41508
|
"button",
|
|
41480
41509
|
{
|
|
41481
41510
|
type: "button",
|
|
@@ -41488,7 +41517,7 @@ var BubbleMenuContent = ({
|
|
|
41488
41517
|
}
|
|
41489
41518
|
)
|
|
41490
41519
|
] }),
|
|
41491
|
-
/* @__PURE__ */ (0,
|
|
41520
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: cn("flex h-9 items-center overflow-hidden rounded-md bg-muted/40", formControlGroupOutlineClass), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41492
41521
|
"input",
|
|
41493
41522
|
{
|
|
41494
41523
|
value: formulaDraft,
|
|
@@ -41509,15 +41538,15 @@ var BubbleMenuContent = ({
|
|
|
41509
41538
|
className: "h-full min-w-0 flex-1 bg-transparent px-2 text-sm font-medium text-foreground outline-none"
|
|
41510
41539
|
}
|
|
41511
41540
|
) }),
|
|
41512
|
-
/* @__PURE__ */ (0,
|
|
41513
|
-
/* @__PURE__ */ (0,
|
|
41514
|
-
/* @__PURE__ */ (0,
|
|
41541
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "mt-2", children: [
|
|
41542
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("tableMenu.numberFormat") || "Number format" }),
|
|
41543
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "grid grid-cols-5 gap-1", children: [
|
|
41515
41544
|
["text", "Text"],
|
|
41516
41545
|
["number", "123"],
|
|
41517
41546
|
["currency", "$"],
|
|
41518
41547
|
["percent", "%"],
|
|
41519
41548
|
["date", "Date"]
|
|
41520
|
-
].map(([format, label]) => /* @__PURE__ */ (0,
|
|
41549
|
+
].map(([format, label]) => /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41521
41550
|
"button",
|
|
41522
41551
|
{
|
|
41523
41552
|
type: "button",
|
|
@@ -41531,8 +41560,8 @@ var BubbleMenuContent = ({
|
|
|
41531
41560
|
format
|
|
41532
41561
|
)) })
|
|
41533
41562
|
] }),
|
|
41534
|
-
/* @__PURE__ */ (0,
|
|
41535
|
-
/* @__PURE__ */ (0,
|
|
41563
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "mt-2 grid grid-cols-3 gap-1", children: [
|
|
41564
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41536
41565
|
"button",
|
|
41537
41566
|
{
|
|
41538
41567
|
type: "button",
|
|
@@ -41545,7 +41574,7 @@ var BubbleMenuContent = ({
|
|
|
41545
41574
|
children: t("tableMenu.apply") || "Apply"
|
|
41546
41575
|
}
|
|
41547
41576
|
),
|
|
41548
|
-
/* @__PURE__ */ (0,
|
|
41577
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41549
41578
|
"button",
|
|
41550
41579
|
{
|
|
41551
41580
|
type: "button",
|
|
@@ -41557,7 +41586,7 @@ var BubbleMenuContent = ({
|
|
|
41557
41586
|
children: t("tableMenu.clear") || "Clear"
|
|
41558
41587
|
}
|
|
41559
41588
|
),
|
|
41560
|
-
/* @__PURE__ */ (0,
|
|
41589
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41561
41590
|
"button",
|
|
41562
41591
|
{
|
|
41563
41592
|
type: "button",
|
|
@@ -41570,10 +41599,10 @@ var BubbleMenuContent = ({
|
|
|
41570
41599
|
] });
|
|
41571
41600
|
}
|
|
41572
41601
|
if (showTypographyPanel) {
|
|
41573
|
-
return /* @__PURE__ */ (0,
|
|
41574
|
-
/* @__PURE__ */ (0,
|
|
41575
|
-
/* @__PURE__ */ (0,
|
|
41576
|
-
/* @__PURE__ */ (0,
|
|
41602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "w-72 p-2", children: [
|
|
41603
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
|
|
41604
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("toolbar.textStyle") }),
|
|
41605
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41577
41606
|
"button",
|
|
41578
41607
|
{
|
|
41579
41608
|
type: "button",
|
|
@@ -41583,11 +41612,11 @@ var BubbleMenuContent = ({
|
|
|
41583
41612
|
}
|
|
41584
41613
|
)
|
|
41585
41614
|
] }),
|
|
41586
|
-
/* @__PURE__ */ (0,
|
|
41587
|
-
/* @__PURE__ */ (0,
|
|
41588
|
-
/* @__PURE__ */ (0,
|
|
41589
|
-
/* @__PURE__ */ (0,
|
|
41590
|
-
/* @__PURE__ */ (0,
|
|
41615
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "space-y-2", children: [
|
|
41616
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { children: [
|
|
41617
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.fontSize") }),
|
|
41618
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: cn("flex h-9 items-center overflow-hidden rounded-md bg-muted/40", formControlGroupOutlineClass), children: [
|
|
41619
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41591
41620
|
"input",
|
|
41592
41621
|
{
|
|
41593
41622
|
type: "number",
|
|
@@ -41611,8 +41640,8 @@ var BubbleMenuContent = ({
|
|
|
41611
41640
|
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"
|
|
41612
41641
|
}
|
|
41613
41642
|
),
|
|
41614
|
-
/* @__PURE__ */ (0,
|
|
41615
|
-
/* @__PURE__ */ (0,
|
|
41643
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "border-l border-border/50 px-2 text-[11px] text-muted-foreground", children: "px" }),
|
|
41644
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41616
41645
|
"button",
|
|
41617
41646
|
{
|
|
41618
41647
|
type: "button",
|
|
@@ -41622,12 +41651,12 @@ var BubbleMenuContent = ({
|
|
|
41622
41651
|
"flex h-full w-9 items-center justify-center border-l border-border/50 transition-colors hover:bg-muted",
|
|
41623
41652
|
showFontSizeOptions && "bg-primary/10 text-primary"
|
|
41624
41653
|
),
|
|
41625
|
-
children: /* @__PURE__ */ (0,
|
|
41654
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.ChevronDown, { className: "h-4 w-4" })
|
|
41626
41655
|
}
|
|
41627
41656
|
)
|
|
41628
41657
|
] }),
|
|
41629
|
-
showFontSizeOptions && /* @__PURE__ */ (0,
|
|
41630
|
-
/* @__PURE__ */ (0,
|
|
41658
|
+
showFontSizeOptions && /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "mt-1 grid grid-cols-4 gap-1", children: [
|
|
41659
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41631
41660
|
"button",
|
|
41632
41661
|
{
|
|
41633
41662
|
type: "button",
|
|
@@ -41642,7 +41671,7 @@ var BubbleMenuContent = ({
|
|
|
41642
41671
|
children: "A"
|
|
41643
41672
|
}
|
|
41644
41673
|
),
|
|
41645
|
-
quickFontSizes.map((option) => /* @__PURE__ */ (0,
|
|
41674
|
+
quickFontSizes.map((option) => /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41646
41675
|
"button",
|
|
41647
41676
|
{
|
|
41648
41677
|
type: "button",
|
|
@@ -41660,10 +41689,10 @@ var BubbleMenuContent = ({
|
|
|
41660
41689
|
))
|
|
41661
41690
|
] })
|
|
41662
41691
|
] }),
|
|
41663
|
-
/* @__PURE__ */ (0,
|
|
41664
|
-
/* @__PURE__ */ (0,
|
|
41665
|
-
/* @__PURE__ */ (0,
|
|
41666
|
-
/* @__PURE__ */ (0,
|
|
41692
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { children: [
|
|
41693
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.lineHeight") }),
|
|
41694
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "grid grid-cols-4 gap-1", children: [
|
|
41695
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41667
41696
|
"button",
|
|
41668
41697
|
{
|
|
41669
41698
|
type: "button",
|
|
@@ -41675,7 +41704,7 @@ var BubbleMenuContent = ({
|
|
|
41675
41704
|
children: "LH"
|
|
41676
41705
|
}
|
|
41677
41706
|
),
|
|
41678
|
-
quickLineHeights.map((option) => /* @__PURE__ */ (0,
|
|
41707
|
+
quickLineHeights.map((option) => /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41679
41708
|
"button",
|
|
41680
41709
|
{
|
|
41681
41710
|
type: "button",
|
|
@@ -41690,8 +41719,8 @@ var BubbleMenuContent = ({
|
|
|
41690
41719
|
))
|
|
41691
41720
|
] })
|
|
41692
41721
|
] }),
|
|
41693
|
-
/* @__PURE__ */ (0,
|
|
41694
|
-
/* @__PURE__ */ (0,
|
|
41722
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "grid grid-cols-2 gap-1 border-t border-border/40 pt-2", children: [
|
|
41723
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
41695
41724
|
"button",
|
|
41696
41725
|
{
|
|
41697
41726
|
type: "button",
|
|
@@ -41701,12 +41730,12 @@ var BubbleMenuContent = ({
|
|
|
41701
41730
|
editor.isActive("subscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
|
|
41702
41731
|
),
|
|
41703
41732
|
children: [
|
|
41704
|
-
/* @__PURE__ */ (0,
|
|
41733
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.Subscript, { className: "h-4 w-4" }),
|
|
41705
41734
|
t("toolbar.subscript")
|
|
41706
41735
|
]
|
|
41707
41736
|
}
|
|
41708
41737
|
),
|
|
41709
|
-
/* @__PURE__ */ (0,
|
|
41738
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
41710
41739
|
"button",
|
|
41711
41740
|
{
|
|
41712
41741
|
type: "button",
|
|
@@ -41716,7 +41745,7 @@ var BubbleMenuContent = ({
|
|
|
41716
41745
|
editor.isActive("superscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
|
|
41717
41746
|
),
|
|
41718
41747
|
children: [
|
|
41719
|
-
/* @__PURE__ */ (0,
|
|
41748
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.Superscript, { className: "h-4 w-4" }),
|
|
41720
41749
|
t("toolbar.superscript")
|
|
41721
41750
|
]
|
|
41722
41751
|
}
|
|
@@ -41725,20 +41754,20 @@ var BubbleMenuContent = ({
|
|
|
41725
41754
|
] })
|
|
41726
41755
|
] });
|
|
41727
41756
|
}
|
|
41728
|
-
const VerticalAlignActiveIcon = currentCellVerticalAlign === "middle" ?
|
|
41757
|
+
const VerticalAlignActiveIcon = currentCellVerticalAlign === "middle" ? TableVerticalAlignMiddleIcon : currentCellVerticalAlign === "bottom" ? TableVerticalAlignBottomIcon : TableVerticalAlignTopIcon;
|
|
41729
41758
|
if (isTableCellSelection) {
|
|
41730
|
-
return /* @__PURE__ */ (0,
|
|
41731
|
-
/* @__PURE__ */ (0,
|
|
41759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "flex items-center gap-0.5 p-1", "data-ueditor-cell-inspector": "", children: [
|
|
41760
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41732
41761
|
ToolbarButton,
|
|
41733
41762
|
{
|
|
41734
41763
|
onMouseDown: () => onKeepOpenChange?.(true),
|
|
41735
41764
|
onClick: () => setActiveColorPalette("cell-bg"),
|
|
41736
41765
|
active: Boolean(currentCellBgColor),
|
|
41737
41766
|
title: t("tableMenu.cellBackground") || "Cell background",
|
|
41738
|
-
children: /* @__PURE__ */ (0,
|
|
41767
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(CellBgColorIcon, { color: currentCellBgColor })
|
|
41739
41768
|
}
|
|
41740
41769
|
),
|
|
41741
|
-
/* @__PURE__ */ (0,
|
|
41770
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41742
41771
|
ToolbarButton,
|
|
41743
41772
|
{
|
|
41744
41773
|
onMouseDown: () => onKeepOpenChange?.(true),
|
|
@@ -41747,7 +41776,7 @@ var BubbleMenuContent = ({
|
|
|
41747
41776
|
editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor || editor.getAttributes("tableCell").borderStyle || editor.getAttributes("tableHeader").borderStyle || editor.getAttributes("tableCell").borderWidth || editor.getAttributes("tableHeader").borderWidth
|
|
41748
41777
|
),
|
|
41749
41778
|
title: t("tableMenu.cellBorder") || "Cell border",
|
|
41750
|
-
children: /* @__PURE__ */ (0,
|
|
41779
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41751
41780
|
CellBorderIcon,
|
|
41752
41781
|
{
|
|
41753
41782
|
color: editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor
|
|
@@ -41755,7 +41784,7 @@ var BubbleMenuContent = ({
|
|
|
41755
41784
|
)
|
|
41756
41785
|
}
|
|
41757
41786
|
),
|
|
41758
|
-
/* @__PURE__ */ (0,
|
|
41787
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41759
41788
|
ToolbarButton,
|
|
41760
41789
|
{
|
|
41761
41790
|
onMouseDown: () => onKeepOpenChange?.(true),
|
|
@@ -41765,10 +41794,10 @@ var BubbleMenuContent = ({
|
|
|
41765
41794
|
},
|
|
41766
41795
|
active: Boolean(currentCellFormula),
|
|
41767
41796
|
title: t("tableMenu.formula") || "Formula",
|
|
41768
|
-
children: /* @__PURE__ */ (0,
|
|
41797
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.Sigma, { className: "w-4 h-4" })
|
|
41769
41798
|
}
|
|
41770
41799
|
),
|
|
41771
|
-
/* @__PURE__ */ (0,
|
|
41800
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41772
41801
|
ToolbarButton,
|
|
41773
41802
|
{
|
|
41774
41803
|
onClick: () => {
|
|
@@ -41781,10 +41810,10 @@ var BubbleMenuContent = ({
|
|
|
41781
41810
|
active: canSplitCell,
|
|
41782
41811
|
disabled: !canMergeCells && !canSplitCell,
|
|
41783
41812
|
title: canSplitCell ? t("tableMenu.splitCell") || "Split cell" : t("tableMenu.mergeCells") || "Merge cells",
|
|
41784
|
-
children: /* @__PURE__ */ (0,
|
|
41813
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.TableCellsMerge, { className: "w-4 h-4" })
|
|
41785
41814
|
}
|
|
41786
41815
|
),
|
|
41787
|
-
/* @__PURE__ */ (0,
|
|
41816
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41788
41817
|
ToolbarButton,
|
|
41789
41818
|
{
|
|
41790
41819
|
onClick: () => applyTableCellAttribute2(
|
|
@@ -41795,14 +41824,14 @@ var BubbleMenuContent = ({
|
|
|
41795
41824
|
),
|
|
41796
41825
|
active: currentCellTextWrap !== "nowrap",
|
|
41797
41826
|
title: currentCellTextWrap === "nowrap" ? t("tableMenu.wrapText") : t("tableMenu.noWrapText"),
|
|
41798
|
-
children: /* @__PURE__ */ (0,
|
|
41827
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.WrapText, { className: "h-4 w-4" })
|
|
41799
41828
|
}
|
|
41800
41829
|
),
|
|
41801
|
-
/* @__PURE__ */ (0,
|
|
41830
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
41802
41831
|
DropdownMenu,
|
|
41803
41832
|
{
|
|
41804
41833
|
onOpenChange: onKeepOpenChange,
|
|
41805
|
-
trigger: /* @__PURE__ */ (0,
|
|
41834
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
41806
41835
|
ToolbarButton,
|
|
41807
41836
|
{
|
|
41808
41837
|
onMouseDown: () => onKeepOpenChange?.(true),
|
|
@@ -41810,34 +41839,34 @@ var BubbleMenuContent = ({
|
|
|
41810
41839
|
},
|
|
41811
41840
|
title: t("tableMenu.alignVertical") || "Vertical alignment",
|
|
41812
41841
|
children: [
|
|
41813
|
-
/* @__PURE__ */ (0,
|
|
41814
|
-
/* @__PURE__ */ (0,
|
|
41842
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(VerticalAlignActiveIcon, { className: "w-4 h-4" }),
|
|
41843
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.ChevronDown, { className: "w-3 h-3" })
|
|
41815
41844
|
]
|
|
41816
41845
|
}
|
|
41817
41846
|
),
|
|
41818
41847
|
children: [
|
|
41819
|
-
/* @__PURE__ */ (0,
|
|
41848
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41820
41849
|
DropdownMenuItem,
|
|
41821
41850
|
{
|
|
41822
|
-
icon:
|
|
41851
|
+
icon: TableVerticalAlignTopIcon,
|
|
41823
41852
|
label: t("tableMenu.alignVerticalTop") || "Align top",
|
|
41824
41853
|
onClick: () => applyTableCellAttribute2(editor, "verticalAlign", "top", { focus: false }),
|
|
41825
41854
|
active: currentCellVerticalAlign === "top"
|
|
41826
41855
|
}
|
|
41827
41856
|
),
|
|
41828
|
-
/* @__PURE__ */ (0,
|
|
41857
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41829
41858
|
DropdownMenuItem,
|
|
41830
41859
|
{
|
|
41831
|
-
icon:
|
|
41860
|
+
icon: TableVerticalAlignMiddleIcon,
|
|
41832
41861
|
label: t("tableMenu.alignVerticalMiddle") || "Align middle",
|
|
41833
41862
|
onClick: () => applyTableCellAttribute2(editor, "verticalAlign", "middle", { focus: false }),
|
|
41834
41863
|
active: currentCellVerticalAlign === "middle"
|
|
41835
41864
|
}
|
|
41836
41865
|
),
|
|
41837
|
-
/* @__PURE__ */ (0,
|
|
41866
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41838
41867
|
DropdownMenuItem,
|
|
41839
41868
|
{
|
|
41840
|
-
icon:
|
|
41869
|
+
icon: TableVerticalAlignBottomIcon,
|
|
41841
41870
|
label: t("tableMenu.alignVerticalBottom") || "Align bottom",
|
|
41842
41871
|
onClick: () => applyTableCellAttribute2(editor, "verticalAlign", "bottom", { focus: false }),
|
|
41843
41872
|
active: currentCellVerticalAlign === "bottom"
|
|
@@ -41846,11 +41875,11 @@ var BubbleMenuContent = ({
|
|
|
41846
41875
|
]
|
|
41847
41876
|
}
|
|
41848
41877
|
),
|
|
41849
|
-
/* @__PURE__ */ (0,
|
|
41878
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
41850
41879
|
DropdownMenu,
|
|
41851
41880
|
{
|
|
41852
41881
|
onOpenChange: onKeepOpenChange,
|
|
41853
|
-
trigger: /* @__PURE__ */ (0,
|
|
41882
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
41854
41883
|
ToolbarButton,
|
|
41855
41884
|
{
|
|
41856
41885
|
onMouseDown: () => onKeepOpenChange?.(true),
|
|
@@ -41858,13 +41887,13 @@ var BubbleMenuContent = ({
|
|
|
41858
41887
|
},
|
|
41859
41888
|
title: t("tableMenu.textDirection"),
|
|
41860
41889
|
children: [
|
|
41861
|
-
currentCellTextDirection === "vertical" ? /* @__PURE__ */ (0,
|
|
41862
|
-
/* @__PURE__ */ (0,
|
|
41890
|
+
currentCellTextDirection === "vertical" ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.ArrowDown, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.ArrowRight, { className: "w-4 h-4" }),
|
|
41891
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.ChevronDown, { className: "w-3 h-3" })
|
|
41863
41892
|
]
|
|
41864
41893
|
}
|
|
41865
41894
|
),
|
|
41866
41895
|
children: [
|
|
41867
|
-
/* @__PURE__ */ (0,
|
|
41896
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41868
41897
|
DropdownMenuItem,
|
|
41869
41898
|
{
|
|
41870
41899
|
icon: import_lucide_react54.ArrowRight,
|
|
@@ -41873,7 +41902,7 @@ var BubbleMenuContent = ({
|
|
|
41873
41902
|
active: currentCellTextDirection === "horizontal"
|
|
41874
41903
|
}
|
|
41875
41904
|
),
|
|
41876
|
-
/* @__PURE__ */ (0,
|
|
41905
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41877
41906
|
DropdownMenuItem,
|
|
41878
41907
|
{
|
|
41879
41908
|
icon: import_lucide_react54.ArrowDown,
|
|
@@ -41887,22 +41916,22 @@ var BubbleMenuContent = ({
|
|
|
41887
41916
|
)
|
|
41888
41917
|
] });
|
|
41889
41918
|
}
|
|
41890
|
-
return /* @__PURE__ */ (0,
|
|
41891
|
-
/* @__PURE__ */ (0,
|
|
41892
|
-
/* @__PURE__ */ (0,
|
|
41893
|
-
/* @__PURE__ */ (0,
|
|
41919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "flex items-center gap-0.5 p-1", children: [
|
|
41920
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.Bold, { className: "w-4 h-4" }) }),
|
|
41921
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.Italic, { className: "w-4 h-4" }) }),
|
|
41922
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41894
41923
|
ToolbarButton,
|
|
41895
41924
|
{
|
|
41896
41925
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
41897
41926
|
active: editor.isActive("underline"),
|
|
41898
41927
|
title: t("toolbar.underline"),
|
|
41899
|
-
children: /* @__PURE__ */ (0,
|
|
41928
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.Underline, { className: "w-4 h-4" })
|
|
41900
41929
|
}
|
|
41901
41930
|
),
|
|
41902
|
-
/* @__PURE__ */ (0,
|
|
41903
|
-
/* @__PURE__ */ (0,
|
|
41904
|
-
/* @__PURE__ */ (0,
|
|
41905
|
-
/* @__PURE__ */ (0,
|
|
41931
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.Strikethrough, { className: "w-4 h-4" }) }),
|
|
41932
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.Code, { className: "w-4 h-4" }) }),
|
|
41933
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
41934
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41906
41935
|
ToolbarButton,
|
|
41907
41936
|
{
|
|
41908
41937
|
onMouseDown: () => {
|
|
@@ -41913,18 +41942,18 @@ var BubbleMenuContent = ({
|
|
|
41913
41942
|
},
|
|
41914
41943
|
active: editor.isActive("link"),
|
|
41915
41944
|
title: t("toolbar.link"),
|
|
41916
|
-
children: /* @__PURE__ */ (0,
|
|
41945
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.Link, { className: "w-4 h-4" })
|
|
41917
41946
|
}
|
|
41918
41947
|
),
|
|
41919
|
-
/* @__PURE__ */ (0,
|
|
41920
|
-
/* @__PURE__ */ (0,
|
|
41921
|
-
/* @__PURE__ */ (0,
|
|
41948
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToolbarButton, { onClick: () => setActiveColorPalette("text"), title: t("colors.textColor"), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextColorIcon, { color: currentTextColor }) }),
|
|
41949
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToolbarButton, { onClick: () => setActiveColorPalette("highlight"), active: editor.isActive("highlight"), title: t("colors.highlight"), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(HighlightColorIcon, { color: currentHighlightColor }) }),
|
|
41950
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
41922
41951
|
ToolbarButton,
|
|
41923
41952
|
{
|
|
41924
41953
|
onClick: () => setShowTypographyPanel(true),
|
|
41925
41954
|
active: Boolean(currentFontSize || currentLineHeight || editor.isActive("subscript") || editor.isActive("superscript")),
|
|
41926
41955
|
title: t("toolbar.textStyle"),
|
|
41927
|
-
children: /* @__PURE__ */ (0,
|
|
41956
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.Type, { className: "w-4 h-4" })
|
|
41928
41957
|
}
|
|
41929
41958
|
)
|
|
41930
41959
|
] });
|
|
@@ -41939,12 +41968,12 @@ var LinkPreviewContent = ({ editor, onEdit }) => {
|
|
|
41939
41968
|
const handleUnlink = () => {
|
|
41940
41969
|
editor.chain().focus().unsetLink().run();
|
|
41941
41970
|
};
|
|
41942
|
-
return /* @__PURE__ */ (0,
|
|
41943
|
-
/* @__PURE__ */ (0,
|
|
41944
|
-
/* @__PURE__ */ (0,
|
|
41945
|
-
/* @__PURE__ */ (0,
|
|
41946
|
-
/* @__PURE__ */ (0,
|
|
41947
|
-
/* @__PURE__ */ (0,
|
|
41971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "flex items-center gap-1 p-1 max-w-sm", children: [
|
|
41972
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "text-xs text-muted-foreground font-mono px-2 truncate max-w-45", children: url }),
|
|
41973
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
41974
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToolbarButton, { onClick: handleOpen, title: t("linkPreview.open") || "Open link", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.ExternalLink, { className: "w-4 h-4" }) }),
|
|
41975
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToolbarButton, { onClick: onEdit, title: t("linkPreview.edit") || "Edit link", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.Edit2, { className: "w-4 h-4" }) }),
|
|
41976
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToolbarButton, { onClick: handleUnlink, title: t("linkPreview.unlink") || "Remove link", className: "text-destructive hover:text-destructive", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react54.Unlink, { className: "w-4 h-4" }) })
|
|
41948
41977
|
] });
|
|
41949
41978
|
};
|
|
41950
41979
|
var CustomBubbleMenu = ({
|
|
@@ -42139,7 +42168,7 @@ var CustomBubbleMenu = ({
|
|
|
42139
42168
|
const context = getBubbleMenuContext(editor);
|
|
42140
42169
|
if (context === "none") return null;
|
|
42141
42170
|
return (0, import_react_dom8.createPortal)(
|
|
42142
|
-
/* @__PURE__ */ (0,
|
|
42171
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
42143
42172
|
"div",
|
|
42144
42173
|
{
|
|
42145
42174
|
ref: menuRef,
|
|
@@ -42163,7 +42192,7 @@ var CustomBubbleMenu = ({
|
|
|
42163
42192
|
}
|
|
42164
42193
|
e.preventDefault();
|
|
42165
42194
|
},
|
|
42166
|
-
children: context === "link" && !keepOpen && !linkInputOpen ? /* @__PURE__ */ (0,
|
|
42195
|
+
children: context === "link" && !keepOpen && !linkInputOpen ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
42167
42196
|
LinkPreviewContent,
|
|
42168
42197
|
{
|
|
42169
42198
|
editor,
|
|
@@ -42172,7 +42201,7 @@ var CustomBubbleMenu = ({
|
|
|
42172
42201
|
setKeepOpen(true);
|
|
42173
42202
|
}
|
|
42174
42203
|
}
|
|
42175
|
-
) : /* @__PURE__ */ (0,
|
|
42204
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
42176
42205
|
BubbleMenuContent,
|
|
42177
42206
|
{
|
|
42178
42207
|
editor,
|
|
@@ -42237,7 +42266,7 @@ var CustomFloatingMenu = ({ editor }) => {
|
|
|
42237
42266
|
}, [editor, editorWindow]);
|
|
42238
42267
|
if (!isVisible || !portalContainer) return null;
|
|
42239
42268
|
return (0, import_react_dom8.createPortal)(
|
|
42240
|
-
/* @__PURE__ */ (0,
|
|
42269
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
42241
42270
|
"div",
|
|
42242
42271
|
{
|
|
42243
42272
|
"data-popover": true,
|
|
@@ -42248,7 +42277,7 @@ var CustomFloatingMenu = ({ editor }) => {
|
|
|
42248
42277
|
transform: "translate(-50%, -100%)"
|
|
42249
42278
|
},
|
|
42250
42279
|
onMouseDown: (e) => e.preventDefault(),
|
|
42251
|
-
children: /* @__PURE__ */ (0,
|
|
42280
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(FloatingMenuContent, { editor })
|
|
42252
42281
|
}
|
|
42253
42282
|
),
|
|
42254
42283
|
portalContainer
|
|
@@ -42259,7 +42288,7 @@ var CustomFloatingMenu = ({ editor }) => {
|
|
|
42259
42288
|
init_useSmartTranslations();
|
|
42260
42289
|
var import_react80 = require("@tiptap/react");
|
|
42261
42290
|
init_cn();
|
|
42262
|
-
var
|
|
42291
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
42263
42292
|
var CharacterCountDisplay = ({ editor, maxCharacters }) => {
|
|
42264
42293
|
const t = useSmartTranslations("UEditor");
|
|
42265
42294
|
const { characterCount, wordCount } = (0, import_react80.useEditorState)({
|
|
@@ -42273,18 +42302,18 @@ var CharacterCountDisplay = ({ editor, maxCharacters }) => {
|
|
|
42273
42302
|
}
|
|
42274
42303
|
});
|
|
42275
42304
|
const percentage = maxCharacters ? Math.round(characterCount / maxCharacters * 100) : 0;
|
|
42276
|
-
return /* @__PURE__ */ (0,
|
|
42277
|
-
/* @__PURE__ */ (0,
|
|
42305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "flex items-center gap-3 px-3 py-2 text-xs text-muted-foreground border-t border-border/30 bg-muted/20", children: [
|
|
42306
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("span", { children: [
|
|
42278
42307
|
wordCount,
|
|
42279
42308
|
" ",
|
|
42280
42309
|
t("words")
|
|
42281
42310
|
] }),
|
|
42282
|
-
/* @__PURE__ */ (0,
|
|
42311
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("span", { children: [
|
|
42283
42312
|
characterCount,
|
|
42284
42313
|
" ",
|
|
42285
42314
|
t("characters")
|
|
42286
42315
|
] }),
|
|
42287
|
-
maxCharacters && /* @__PURE__ */ (0,
|
|
42316
|
+
maxCharacters && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("span", { className: cn(percentage > 90 && "text-destructive", percentage > 100 && "font-bold"), children: [
|
|
42288
42317
|
characterCount,
|
|
42289
42318
|
"/",
|
|
42290
42319
|
maxCharacters
|
|
@@ -47258,7 +47287,7 @@ function buildTableHoverState({
|
|
|
47258
47287
|
}
|
|
47259
47288
|
|
|
47260
47289
|
// src/components/UEditor/table-drag-preview.tsx
|
|
47261
|
-
var
|
|
47290
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
47262
47291
|
function TableDragPreview({
|
|
47263
47292
|
columnDragLabel,
|
|
47264
47293
|
dragPreview,
|
|
@@ -47269,9 +47298,9 @@ function TableDragPreview({
|
|
|
47269
47298
|
const expandPreviewWidth = dragPreview.kind === "add-column" ? layout.tableWidth + dragPreview.previewCols * layout.avgColumnWidth : layout.tableWidth;
|
|
47270
47299
|
const expandPreviewHeight = dragPreview.kind === "add-row" ? layout.tableHeight + dragPreview.previewRows * layout.avgRowHeight : layout.tableHeight;
|
|
47271
47300
|
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`;
|
|
47272
|
-
return /* @__PURE__ */ (0,
|
|
47273
|
-
dragPreview.kind === "row" && /* @__PURE__ */ (0,
|
|
47274
|
-
/* @__PURE__ */ (0,
|
|
47301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_jsx_runtime99.Fragment, { children: [
|
|
47302
|
+
dragPreview.kind === "row" && /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_jsx_runtime99.Fragment, { children: [
|
|
47303
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
47275
47304
|
"div",
|
|
47276
47305
|
{
|
|
47277
47306
|
"aria-hidden": "true",
|
|
@@ -47284,7 +47313,7 @@ function TableDragPreview({
|
|
|
47284
47313
|
}
|
|
47285
47314
|
}
|
|
47286
47315
|
),
|
|
47287
|
-
/* @__PURE__ */ (0,
|
|
47316
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
47288
47317
|
"div",
|
|
47289
47318
|
{
|
|
47290
47319
|
"aria-hidden": "true",
|
|
@@ -47298,8 +47327,8 @@ function TableDragPreview({
|
|
|
47298
47327
|
}
|
|
47299
47328
|
)
|
|
47300
47329
|
] }),
|
|
47301
|
-
dragPreview.kind === "column" && /* @__PURE__ */ (0,
|
|
47302
|
-
/* @__PURE__ */ (0,
|
|
47330
|
+
dragPreview.kind === "column" && /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_jsx_runtime99.Fragment, { children: [
|
|
47331
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
47303
47332
|
"div",
|
|
47304
47333
|
{
|
|
47305
47334
|
"aria-hidden": "true",
|
|
@@ -47312,7 +47341,7 @@ function TableDragPreview({
|
|
|
47312
47341
|
}
|
|
47313
47342
|
}
|
|
47314
47343
|
),
|
|
47315
|
-
/* @__PURE__ */ (0,
|
|
47344
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
47316
47345
|
"div",
|
|
47317
47346
|
{
|
|
47318
47347
|
"aria-hidden": "true",
|
|
@@ -47326,7 +47355,7 @@ function TableDragPreview({
|
|
|
47326
47355
|
}
|
|
47327
47356
|
)
|
|
47328
47357
|
] }),
|
|
47329
|
-
(dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */ (0,
|
|
47358
|
+
(dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
47330
47359
|
"div",
|
|
47331
47360
|
{
|
|
47332
47361
|
"aria-hidden": "true",
|
|
@@ -47339,7 +47368,7 @@ function TableDragPreview({
|
|
|
47339
47368
|
}
|
|
47340
47369
|
}
|
|
47341
47370
|
),
|
|
47342
|
-
/* @__PURE__ */ (0,
|
|
47371
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
47343
47372
|
"div",
|
|
47344
47373
|
{
|
|
47345
47374
|
role: "status",
|
|
@@ -47357,7 +47386,7 @@ function TableDragPreview({
|
|
|
47357
47386
|
// src/components/UEditor/table-add-rails.tsx
|
|
47358
47387
|
init_cn();
|
|
47359
47388
|
init_Tooltip();
|
|
47360
|
-
var
|
|
47389
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
47361
47390
|
var ADD_COLUMN_RAIL_GAP = 4;
|
|
47362
47391
|
var ADD_ROW_RAIL_GAP = 4;
|
|
47363
47392
|
var BUTTON_LONG_SIZE = 36;
|
|
@@ -47382,13 +47411,13 @@ function TableAddRails({
|
|
|
47382
47411
|
const rowRailLeft = visibleBounds.left + Math.max(0, (visibleBounds.width - BUTTON_LONG_SIZE) / 2);
|
|
47383
47412
|
const showColumnRail = controlsVisible || addColumnVisible;
|
|
47384
47413
|
const showRowRail = controlsVisible || addRowVisible;
|
|
47385
|
-
return /* @__PURE__ */ (0,
|
|
47386
|
-
/* @__PURE__ */ (0,
|
|
47414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(import_jsx_runtime100.Fragment, { children: [
|
|
47415
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
47387
47416
|
Tooltip,
|
|
47388
47417
|
{
|
|
47389
47418
|
placement: "right",
|
|
47390
|
-
content: /* @__PURE__ */ (0,
|
|
47391
|
-
children: /* @__PURE__ */ (0,
|
|
47419
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("span", { className: "text-xs font-medium", children: quickAddColumnLabel }),
|
|
47420
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
47392
47421
|
"button",
|
|
47393
47422
|
{
|
|
47394
47423
|
type: "button",
|
|
@@ -47416,17 +47445,17 @@ function TableAddRails({
|
|
|
47416
47445
|
transform: showColumnRail ? "scale(1)" : "scale(0.85)",
|
|
47417
47446
|
pointerEvents: showColumnRail ? "auto" : "none"
|
|
47418
47447
|
},
|
|
47419
|
-
children: /* @__PURE__ */ (0,
|
|
47448
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("span", { className: "text-sm font-medium leading-none", children: "+" })
|
|
47420
47449
|
}
|
|
47421
47450
|
)
|
|
47422
47451
|
}
|
|
47423
47452
|
),
|
|
47424
|
-
/* @__PURE__ */ (0,
|
|
47453
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
47425
47454
|
Tooltip,
|
|
47426
47455
|
{
|
|
47427
47456
|
placement: "bottom",
|
|
47428
|
-
content: /* @__PURE__ */ (0,
|
|
47429
|
-
children: /* @__PURE__ */ (0,
|
|
47457
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("span", { className: "text-xs font-medium", children: quickAddRowLabel }),
|
|
47458
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
47430
47459
|
"button",
|
|
47431
47460
|
{
|
|
47432
47461
|
type: "button",
|
|
@@ -47452,7 +47481,7 @@ function TableAddRails({
|
|
|
47452
47481
|
transform: showRowRail ? "scale(1)" : "scale(0.85)",
|
|
47453
47482
|
pointerEvents: showRowRail ? "auto" : "none"
|
|
47454
47483
|
},
|
|
47455
|
-
children: /* @__PURE__ */ (0,
|
|
47484
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("span", { className: "text-sm font-medium leading-none", children: "+" })
|
|
47456
47485
|
}
|
|
47457
47486
|
)
|
|
47458
47487
|
}
|
|
@@ -47465,7 +47494,7 @@ var import_lucide_react55 = require("lucide-react");
|
|
|
47465
47494
|
init_cn();
|
|
47466
47495
|
init_DropdownMenu();
|
|
47467
47496
|
init_Tooltip();
|
|
47468
|
-
var
|
|
47497
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
47469
47498
|
function TableControlMenu({
|
|
47470
47499
|
controlsVisible,
|
|
47471
47500
|
isOpen,
|
|
@@ -47477,7 +47506,7 @@ function TableControlMenu({
|
|
|
47477
47506
|
top
|
|
47478
47507
|
}) {
|
|
47479
47508
|
const shown = controlsVisible || menuVisible || isOpen;
|
|
47480
|
-
return /* @__PURE__ */ (0,
|
|
47509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
47481
47510
|
"div",
|
|
47482
47511
|
{
|
|
47483
47512
|
className: "absolute z-30",
|
|
@@ -47486,13 +47515,13 @@ function TableControlMenu({
|
|
|
47486
47515
|
top,
|
|
47487
47516
|
left
|
|
47488
47517
|
},
|
|
47489
|
-
children: /* @__PURE__ */ (0,
|
|
47518
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
47490
47519
|
Tooltip,
|
|
47491
47520
|
{
|
|
47492
47521
|
placement: "top",
|
|
47493
47522
|
disabled: isOpen,
|
|
47494
|
-
content: /* @__PURE__ */ (0,
|
|
47495
|
-
children: /* @__PURE__ */ (0,
|
|
47523
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "text-xs font-medium", children: label }),
|
|
47524
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
47496
47525
|
DropdownMenu,
|
|
47497
47526
|
{
|
|
47498
47527
|
placement: "bottom-start",
|
|
@@ -47500,7 +47529,7 @@ function TableControlMenu({
|
|
|
47500
47529
|
onOpenChange,
|
|
47501
47530
|
contentClassName: "p-2",
|
|
47502
47531
|
items,
|
|
47503
|
-
trigger: /* @__PURE__ */ (0,
|
|
47532
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
47504
47533
|
"button",
|
|
47505
47534
|
{
|
|
47506
47535
|
type: "button",
|
|
@@ -47516,7 +47545,7 @@ function TableControlMenu({
|
|
|
47516
47545
|
transform: shown ? "scale(1)" : "scale(0.82)",
|
|
47517
47546
|
pointerEvents: shown ? "auto" : "none"
|
|
47518
47547
|
},
|
|
47519
|
-
children: /* @__PURE__ */ (0,
|
|
47548
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_lucide_react55.MoreHorizontal, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
47520
47549
|
}
|
|
47521
47550
|
)
|
|
47522
47551
|
}
|
|
@@ -47532,7 +47561,7 @@ var import_lucide_react56 = require("lucide-react");
|
|
|
47532
47561
|
init_cn();
|
|
47533
47562
|
init_DropdownMenu();
|
|
47534
47563
|
init_Tooltip();
|
|
47535
|
-
var
|
|
47564
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
47536
47565
|
var IDLE_HANDLE_SCALE = "0.78";
|
|
47537
47566
|
function TableRowHandles({
|
|
47538
47567
|
activeRowIndex,
|
|
@@ -47547,12 +47576,12 @@ function TableRowHandles({
|
|
|
47547
47576
|
rowHandleLeft,
|
|
47548
47577
|
rowHandles
|
|
47549
47578
|
}) {
|
|
47550
|
-
return /* @__PURE__ */ (0,
|
|
47579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_jsx_runtime102.Fragment, { children: rowHandles.map((rowHandle) => {
|
|
47551
47580
|
const menuKey = `row:${rowHandle.index}`;
|
|
47552
47581
|
const isActive = rowHandle.index === activeRowIndex;
|
|
47553
47582
|
const visible = controlsVisible || hoverRowHandleIndex === rowHandle.index || openMenuKey === menuKey;
|
|
47554
47583
|
const isShown = visible || isActive;
|
|
47555
|
-
return /* @__PURE__ */ (0,
|
|
47584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
47556
47585
|
"div",
|
|
47557
47586
|
{
|
|
47558
47587
|
className: "absolute z-30",
|
|
@@ -47562,13 +47591,13 @@ function TableRowHandles({
|
|
|
47562
47591
|
left: rowHandleLeft,
|
|
47563
47592
|
pointerEvents: visible ? "auto" : "none"
|
|
47564
47593
|
},
|
|
47565
|
-
children: /* @__PURE__ */ (0,
|
|
47594
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
47566
47595
|
Tooltip,
|
|
47567
47596
|
{
|
|
47568
47597
|
placement: "right",
|
|
47569
47598
|
disabled: openMenuKey === menuKey || !visible && isActive,
|
|
47570
|
-
content: /* @__PURE__ */ (0,
|
|
47571
|
-
children: /* @__PURE__ */ (0,
|
|
47599
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: "text-xs font-medium", children: `${rowDragLabel} ${rowHandle.index + 1}` }),
|
|
47600
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
47572
47601
|
DropdownMenu,
|
|
47573
47602
|
{
|
|
47574
47603
|
placement: "right",
|
|
@@ -47576,7 +47605,7 @@ function TableRowHandles({
|
|
|
47576
47605
|
onOpenChange: (open) => onOpenMenuChange(menuKey, open),
|
|
47577
47606
|
contentClassName: "p-2",
|
|
47578
47607
|
items: getMenuItems(rowHandle),
|
|
47579
|
-
trigger: /* @__PURE__ */ (0,
|
|
47608
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
47580
47609
|
"button",
|
|
47581
47610
|
{
|
|
47582
47611
|
type: "button",
|
|
@@ -47601,7 +47630,7 @@ function TableRowHandles({
|
|
|
47601
47630
|
// selection near the first character of a table cell.
|
|
47602
47631
|
pointerEvents: visible ? "auto" : "none"
|
|
47603
47632
|
},
|
|
47604
|
-
children: visible ? /* @__PURE__ */ (0,
|
|
47633
|
+
children: visible ? /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_lucide_react56.GripVertical, { "aria-hidden": "true", className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "h-3 w-1 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
|
|
47605
47634
|
}
|
|
47606
47635
|
)
|
|
47607
47636
|
}
|
|
@@ -47626,12 +47655,12 @@ function TableColumnHandles({
|
|
|
47626
47655
|
onStartDrag,
|
|
47627
47656
|
openMenuKey
|
|
47628
47657
|
}) {
|
|
47629
|
-
return /* @__PURE__ */ (0,
|
|
47658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_jsx_runtime102.Fragment, { children: columnHandles.map((columnHandle) => {
|
|
47630
47659
|
const menuKey = `column:${columnHandle.index}`;
|
|
47631
47660
|
const isActive = columnHandle.index === activeColumnIndex;
|
|
47632
47661
|
const visible = controlsVisible || hoverColumnHandleIndex === columnHandle.index || openMenuKey === menuKey;
|
|
47633
47662
|
const isShown = visible || isActive;
|
|
47634
|
-
return /* @__PURE__ */ (0,
|
|
47663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
47635
47664
|
"div",
|
|
47636
47665
|
{
|
|
47637
47666
|
className: "absolute z-30",
|
|
@@ -47641,13 +47670,13 @@ function TableColumnHandles({
|
|
|
47641
47670
|
left: Math.max(8, columnHandle.center - 12),
|
|
47642
47671
|
pointerEvents: visible ? "auto" : "none"
|
|
47643
47672
|
},
|
|
47644
|
-
children: /* @__PURE__ */ (0,
|
|
47673
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
47645
47674
|
Tooltip,
|
|
47646
47675
|
{
|
|
47647
47676
|
placement: "top",
|
|
47648
47677
|
disabled: openMenuKey === menuKey || !visible && isActive,
|
|
47649
|
-
content: /* @__PURE__ */ (0,
|
|
47650
|
-
children: /* @__PURE__ */ (0,
|
|
47678
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: "text-xs font-medium", children: `${columnDragLabel} ${columnHandle.index + 1}` }),
|
|
47679
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
47651
47680
|
DropdownMenu,
|
|
47652
47681
|
{
|
|
47653
47682
|
placement: "bottom-start",
|
|
@@ -47655,7 +47684,7 @@ function TableColumnHandles({
|
|
|
47655
47684
|
onOpenChange: (open) => onOpenMenuChange(menuKey, open),
|
|
47656
47685
|
contentClassName: "p-2",
|
|
47657
47686
|
items: getMenuItems(columnHandle),
|
|
47658
|
-
trigger: /* @__PURE__ */ (0,
|
|
47687
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
47659
47688
|
"button",
|
|
47660
47689
|
{
|
|
47661
47690
|
type: "button",
|
|
@@ -47677,7 +47706,7 @@ function TableColumnHandles({
|
|
|
47677
47706
|
transform: isShown ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`,
|
|
47678
47707
|
pointerEvents: visible ? "auto" : "none"
|
|
47679
47708
|
},
|
|
47680
|
-
children: visible ? /* @__PURE__ */ (0,
|
|
47709
|
+
children: visible ? /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_lucide_react56.GripHorizontal, { "aria-hidden": "true", className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "h-1 w-3 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
|
|
47681
47710
|
}
|
|
47682
47711
|
)
|
|
47683
47712
|
}
|
|
@@ -47694,7 +47723,7 @@ function TableColumnHandles({
|
|
|
47694
47723
|
var import_lucide_react57 = require("lucide-react");
|
|
47695
47724
|
init_cn();
|
|
47696
47725
|
init_table_width_model();
|
|
47697
|
-
var
|
|
47726
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
47698
47727
|
var EDGE_HANDLE_CLASS = cn(
|
|
47699
47728
|
"pointer-events-auto absolute top-0 z-10 h-full w-2 touch-none cursor-col-resize bg-transparent p-0",
|
|
47700
47729
|
"border-transparent transition-colors duration-150 hover:border-primary",
|
|
@@ -47727,7 +47756,7 @@ function TableResizeHandles({
|
|
|
47727
47756
|
onStartResize,
|
|
47728
47757
|
resizeBothLabel
|
|
47729
47758
|
}) {
|
|
47730
|
-
return /* @__PURE__ */ (0,
|
|
47759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(
|
|
47731
47760
|
"div",
|
|
47732
47761
|
{
|
|
47733
47762
|
ref: frameRef,
|
|
@@ -47744,8 +47773,8 @@ function TableResizeHandles({
|
|
|
47744
47773
|
height: layout.tableHeight
|
|
47745
47774
|
},
|
|
47746
47775
|
children: [
|
|
47747
|
-
layout.widthMode === "responsive" ? /* @__PURE__ */ (0,
|
|
47748
|
-
/* @__PURE__ */ (0,
|
|
47776
|
+
layout.widthMode === "responsive" ? /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(import_jsx_runtime103.Fragment, { children: [
|
|
47777
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
47749
47778
|
"button",
|
|
47750
47779
|
{
|
|
47751
47780
|
type: "button",
|
|
@@ -47760,7 +47789,7 @@ function TableResizeHandles({
|
|
|
47760
47789
|
onKeyDown: (event) => onKeyboardResize(event, "left")
|
|
47761
47790
|
}
|
|
47762
47791
|
),
|
|
47763
|
-
/* @__PURE__ */ (0,
|
|
47792
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
47764
47793
|
"button",
|
|
47765
47794
|
{
|
|
47766
47795
|
type: "button",
|
|
@@ -47776,7 +47805,7 @@ function TableResizeHandles({
|
|
|
47776
47805
|
}
|
|
47777
47806
|
)
|
|
47778
47807
|
] }) : null,
|
|
47779
|
-
/* @__PURE__ */ (0,
|
|
47808
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
47780
47809
|
"button",
|
|
47781
47810
|
{
|
|
47782
47811
|
type: "button",
|
|
@@ -47794,10 +47823,10 @@ function TableResizeHandles({
|
|
|
47794
47823
|
},
|
|
47795
47824
|
onPointerDown: (event) => onStartResize(event, "both"),
|
|
47796
47825
|
onKeyDown: (event) => onKeyboardResize(event, "both"),
|
|
47797
|
-
children: /* @__PURE__ */ (0,
|
|
47826
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_lucide_react57.MoveDiagonal2, { "aria-hidden": "true", className: "h-3.5 w-3.5", strokeWidth: 2.25 })
|
|
47798
47827
|
}
|
|
47799
47828
|
),
|
|
47800
|
-
active ? /* @__PURE__ */ (0,
|
|
47829
|
+
active ? /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
47801
47830
|
"span",
|
|
47802
47831
|
{
|
|
47803
47832
|
role: "status",
|
|
@@ -48051,7 +48080,7 @@ function applyTableSize(editor, snapshot, dimensions, options = {}) {
|
|
|
48051
48080
|
// src/components/UEditor/table-controls.tsx
|
|
48052
48081
|
init_table_width_model();
|
|
48053
48082
|
init_table_formula_references();
|
|
48054
|
-
var
|
|
48083
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
48055
48084
|
var TABLE_MENU_TOP_OFFSET = 10;
|
|
48056
48085
|
var AXIS_HANDLE_RADIUS = 12;
|
|
48057
48086
|
function clamp9(value, min, max) {
|
|
@@ -48919,8 +48948,8 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
48919
48948
|
const menuLeft = Math.max(8, layout.tableLeft);
|
|
48920
48949
|
const rowHandleLeft = layout.tableLeft - AXIS_HANDLE_RADIUS;
|
|
48921
48950
|
const columnHandleTop = layout.tableTop - AXIS_HANDLE_RADIUS;
|
|
48922
|
-
return /* @__PURE__ */ (0,
|
|
48923
|
-
/* @__PURE__ */ (0,
|
|
48951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(import_jsx_runtime104.Fragment, { children: [
|
|
48952
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
48924
48953
|
TableRowHandles,
|
|
48925
48954
|
{
|
|
48926
48955
|
activeRowIndex: layout.activeRowIndex,
|
|
@@ -48938,7 +48967,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
48938
48967
|
rowHandles: layout.rowHandles
|
|
48939
48968
|
}
|
|
48940
48969
|
),
|
|
48941
|
-
/* @__PURE__ */ (0,
|
|
48970
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
48942
48971
|
TableColumnHandles,
|
|
48943
48972
|
{
|
|
48944
48973
|
activeColumnIndex: layout.activeColumnIndex,
|
|
@@ -48956,7 +48985,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
48956
48985
|
openMenuKey
|
|
48957
48986
|
}
|
|
48958
48987
|
),
|
|
48959
|
-
/* @__PURE__ */ (0,
|
|
48988
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
48960
48989
|
TableControlMenu,
|
|
48961
48990
|
{
|
|
48962
48991
|
controlsVisible,
|
|
@@ -48971,7 +49000,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
48971
49000
|
top: menuTop
|
|
48972
49001
|
}
|
|
48973
49002
|
),
|
|
48974
|
-
dragPreview === null && /* @__PURE__ */ (0,
|
|
49003
|
+
dragPreview === null && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
48975
49004
|
TableResizeHandles,
|
|
48976
49005
|
{
|
|
48977
49006
|
active: tableResizeActive,
|
|
@@ -48984,7 +49013,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
48984
49013
|
resizeBothLabel: t("tableMenu.resizeBoth")
|
|
48985
49014
|
}
|
|
48986
49015
|
),
|
|
48987
|
-
/* @__PURE__ */ (0,
|
|
49016
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
48988
49017
|
TableAddRails,
|
|
48989
49018
|
{
|
|
48990
49019
|
addColumnVisible: hoverState.addColumnVisible,
|
|
@@ -49000,7 +49029,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
49000
49029
|
quickAddRowLabel: t("tableMenu.quickAddRowAfter")
|
|
49001
49030
|
}
|
|
49002
49031
|
),
|
|
49003
|
-
/* @__PURE__ */ (0,
|
|
49032
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
49004
49033
|
TableDragPreview,
|
|
49005
49034
|
{
|
|
49006
49035
|
columnDragLabel: t("tableMenu.dragColumn"),
|
|
@@ -50034,7 +50063,7 @@ var import_lucide_react59 = require("lucide-react");
|
|
|
50034
50063
|
init_useSmartTranslations();
|
|
50035
50064
|
init_table_dom_utils();
|
|
50036
50065
|
init_form_control_size();
|
|
50037
|
-
var
|
|
50066
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
50038
50067
|
function TableFormulaBar({ editor }) {
|
|
50039
50068
|
const t = useSmartTranslations("UEditor");
|
|
50040
50069
|
const inputRef = (0, import_react85.useRef)(null);
|
|
@@ -50097,7 +50126,7 @@ function TableFormulaBar({ editor }) {
|
|
|
50097
50126
|
if (!editor.isDestroyed) editor.commands.focus();
|
|
50098
50127
|
}, 0);
|
|
50099
50128
|
};
|
|
50100
|
-
return /* @__PURE__ */ (0,
|
|
50129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
|
|
50101
50130
|
"div",
|
|
50102
50131
|
{
|
|
50103
50132
|
"data-ueditor-formula-bar": "",
|
|
@@ -50105,7 +50134,7 @@ function TableFormulaBar({ editor }) {
|
|
|
50105
50134
|
"aria-label": t("tableMenu.formulaBar"),
|
|
50106
50135
|
className: "flex min-h-10 items-center gap-2 border-b border-border/60 bg-muted/25 px-2 py-1.5",
|
|
50107
50136
|
children: [
|
|
50108
|
-
/* @__PURE__ */ (0,
|
|
50137
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
50109
50138
|
"span",
|
|
50110
50139
|
{
|
|
50111
50140
|
"data-ueditor-formula-cell-label": "",
|
|
@@ -50113,8 +50142,8 @@ function TableFormulaBar({ editor }) {
|
|
|
50113
50142
|
children: selectedCell.label
|
|
50114
50143
|
}
|
|
50115
50144
|
),
|
|
50116
|
-
/* @__PURE__ */ (0,
|
|
50117
|
-
/* @__PURE__ */ (0,
|
|
50145
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react59.Sigma, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 text-primary" }),
|
|
50146
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
50118
50147
|
"input",
|
|
50119
50148
|
{
|
|
50120
50149
|
ref: inputRef,
|
|
@@ -50135,18 +50164,18 @@ function TableFormulaBar({ editor }) {
|
|
|
50135
50164
|
className: `h-7 min-w-0 flex-1 rounded-md bg-background px-2 font-mono text-sm text-foreground ${formControlOutlineClass}`
|
|
50136
50165
|
}
|
|
50137
50166
|
),
|
|
50138
|
-
selectedCell.formulaState === "error" && /* @__PURE__ */ (0,
|
|
50167
|
+
selectedCell.formulaState === "error" && /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
|
|
50139
50168
|
"span",
|
|
50140
50169
|
{
|
|
50141
50170
|
role: "status",
|
|
50142
50171
|
className: "hidden shrink-0 items-center gap-1 text-xs font-medium text-destructive sm:inline-flex",
|
|
50143
50172
|
children: [
|
|
50144
|
-
/* @__PURE__ */ (0,
|
|
50173
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react59.AlertCircle, { "aria-hidden": "true", className: "h-3.5 w-3.5" }),
|
|
50145
50174
|
t("tableMenu.formulaError")
|
|
50146
50175
|
]
|
|
50147
50176
|
}
|
|
50148
50177
|
),
|
|
50149
|
-
/* @__PURE__ */ (0,
|
|
50178
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
50150
50179
|
"button",
|
|
50151
50180
|
{
|
|
50152
50181
|
type: "button",
|
|
@@ -50154,10 +50183,10 @@ function TableFormulaBar({ editor }) {
|
|
|
50154
50183
|
"aria-label": t("tableMenu.apply"),
|
|
50155
50184
|
title: t("tableMenu.apply"),
|
|
50156
50185
|
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",
|
|
50157
|
-
children: /* @__PURE__ */ (0,
|
|
50186
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react59.Check, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
50158
50187
|
}
|
|
50159
50188
|
),
|
|
50160
|
-
/* @__PURE__ */ (0,
|
|
50189
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
50161
50190
|
"button",
|
|
50162
50191
|
{
|
|
50163
50192
|
type: "button",
|
|
@@ -50168,10 +50197,10 @@ function TableFormulaBar({ editor }) {
|
|
|
50168
50197
|
"aria-label": t("tableMenu.convertToValue"),
|
|
50169
50198
|
title: t("tableMenu.convertToValue"),
|
|
50170
50199
|
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",
|
|
50171
|
-
children: /* @__PURE__ */ (0,
|
|
50200
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react59.Hash, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
50172
50201
|
}
|
|
50173
50202
|
),
|
|
50174
|
-
/* @__PURE__ */ (0,
|
|
50203
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
50175
50204
|
"button",
|
|
50176
50205
|
{
|
|
50177
50206
|
type: "button",
|
|
@@ -50182,7 +50211,7 @@ function TableFormulaBar({ editor }) {
|
|
|
50182
50211
|
"aria-label": t("tableMenu.clearCell"),
|
|
50183
50212
|
title: t("tableMenu.clearCell"),
|
|
50184
50213
|
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",
|
|
50185
|
-
children: /* @__PURE__ */ (0,
|
|
50214
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react59.Trash2, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
50186
50215
|
}
|
|
50187
50216
|
)
|
|
50188
50217
|
]
|
|
@@ -50266,7 +50295,7 @@ function useUEditorOutput({
|
|
|
50266
50295
|
|
|
50267
50296
|
// src/components/UEditor/UEditor.tsx
|
|
50268
50297
|
init_portal_context();
|
|
50269
|
-
var
|
|
50298
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
50270
50299
|
var LazyMenuBar = import_react88.default.lazy(async () => {
|
|
50271
50300
|
const { MenuBar: MenuBar2 } = await Promise.resolve().then(() => (init_menu_bar(), menu_bar_exports));
|
|
50272
50301
|
return { default: MenuBar2 };
|
|
@@ -50297,6 +50326,7 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50297
50326
|
showBubbleMenu = true,
|
|
50298
50327
|
bubbleMenuPlacement = "auto",
|
|
50299
50328
|
showFloatingMenu = false,
|
|
50329
|
+
enableAutocomplete = true,
|
|
50300
50330
|
showCharacterCount = true,
|
|
50301
50331
|
showFooter = true,
|
|
50302
50332
|
maxCharacters,
|
|
@@ -50379,11 +50409,12 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50379
50409
|
fallbackToDataUrl,
|
|
50380
50410
|
onImageUploadError,
|
|
50381
50411
|
editable,
|
|
50412
|
+
enableAutocomplete,
|
|
50382
50413
|
fetchMetadata
|
|
50383
50414
|
}),
|
|
50384
50415
|
...extraExtensions ?? []
|
|
50385
50416
|
],
|
|
50386
|
-
[getPortalContainer, effectivePlaceholder, t, maxCharacters, uploadImage, resolvedUploadFile, imageInsertMode, maxImageFileSize, allowedImageMimeTypes, fallbackToDataUrl, onImageUploadError, editable, fetchMetadata, extraExtensions]
|
|
50417
|
+
[getPortalContainer, effectivePlaceholder, t, maxCharacters, uploadImage, resolvedUploadFile, imageInsertMode, maxImageFileSize, allowedImageMimeTypes, fallbackToDataUrl, onImageUploadError, editable, enableAutocomplete, fetchMetadata, extraExtensions]
|
|
50387
50418
|
);
|
|
50388
50419
|
const syncFormulaRangeHighlight = import_react88.default.useCallback((pickState) => {
|
|
50389
50420
|
const container = formulaRangeSurfaceRef.current;
|
|
@@ -50395,6 +50426,7 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50395
50426
|
content,
|
|
50396
50427
|
editable,
|
|
50397
50428
|
autofocus,
|
|
50429
|
+
enableInputRules: enableAutocomplete,
|
|
50398
50430
|
editorProps: {
|
|
50399
50431
|
handleDOMEvents: {
|
|
50400
50432
|
mousedown: (view, event) => {
|
|
@@ -50582,7 +50614,7 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50582
50614
|
}
|
|
50583
50615
|
}, [content, editor]);
|
|
50584
50616
|
if (!editor) {
|
|
50585
|
-
return /* @__PURE__ */ (0,
|
|
50617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(UEditorPortalProvider, { getPortalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
50586
50618
|
"div",
|
|
50587
50619
|
{
|
|
50588
50620
|
role: "status",
|
|
@@ -50593,7 +50625,7 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50593
50625
|
}
|
|
50594
50626
|
) });
|
|
50595
50627
|
}
|
|
50596
|
-
return /* @__PURE__ */ (0,
|
|
50628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(UEditorPortalProvider, { getPortalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { "data-ueditor-width-boundary": "", className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
|
|
50597
50629
|
"div",
|
|
50598
50630
|
{
|
|
50599
50631
|
className: cn(
|
|
@@ -50609,8 +50641,8 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50609
50641
|
className
|
|
50610
50642
|
),
|
|
50611
50643
|
children: [
|
|
50612
|
-
editable && (showMenuBar || showToolbar || showBubbleMenu) ? /* @__PURE__ */ (0,
|
|
50613
|
-
isMenuBarVisible && /* @__PURE__ */ (0,
|
|
50644
|
+
editable && (showMenuBar || showToolbar || showBubbleMenu) ? /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(EditorUiRenderStateProvider, { editor, children: [
|
|
50645
|
+
isMenuBarVisible && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_react88.default.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
50614
50646
|
LazyMenuBar,
|
|
50615
50647
|
{
|
|
50616
50648
|
editor,
|
|
@@ -50628,7 +50660,7 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50628
50660
|
showPreviewButton
|
|
50629
50661
|
}
|
|
50630
50662
|
) }),
|
|
50631
|
-
showToolbar && /* @__PURE__ */ (0,
|
|
50663
|
+
showToolbar && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
50632
50664
|
EditorToolbar,
|
|
50633
50665
|
{
|
|
50634
50666
|
editor,
|
|
@@ -50648,8 +50680,8 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50648
50680
|
letterSpacings
|
|
50649
50681
|
}
|
|
50650
50682
|
),
|
|
50651
|
-
/* @__PURE__ */ (0,
|
|
50652
|
-
showBubbleMenu && /* @__PURE__ */ (0,
|
|
50683
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(TableFormulaBar, { editor }),
|
|
50684
|
+
showBubbleMenu && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
50653
50685
|
CustomBubbleMenu,
|
|
50654
50686
|
{
|
|
50655
50687
|
editor,
|
|
@@ -50658,9 +50690,9 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50658
50690
|
lineHeights
|
|
50659
50691
|
}
|
|
50660
50692
|
)
|
|
50661
|
-
] }) : editable ? /* @__PURE__ */ (0,
|
|
50662
|
-
editable && showFloatingMenu && /* @__PURE__ */ (0,
|
|
50663
|
-
/* @__PURE__ */ (0,
|
|
50693
|
+
] }) : editable ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(TableFormulaBar, { editor }) : null,
|
|
50694
|
+
editable && showFloatingMenu && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(CustomFloatingMenu, { editor }),
|
|
50695
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
|
|
50664
50696
|
"div",
|
|
50665
50697
|
{
|
|
50666
50698
|
ref: (node) => {
|
|
@@ -50678,7 +50710,7 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50678
50710
|
"--ueditor-table-cell-padding-x": `${resolvedTableCellHorizontalPadding}px`
|
|
50679
50711
|
},
|
|
50680
50712
|
children: [
|
|
50681
|
-
/* @__PURE__ */ (0,
|
|
50713
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
50682
50714
|
"span",
|
|
50683
50715
|
{
|
|
50684
50716
|
ref: tableColumnGuideRef,
|
|
@@ -50686,7 +50718,7 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50686
50718
|
className: "pointer-events-none absolute z-20 bg-primary/50 opacity-0 transition-opacity duration-200 delay-100 ease-out"
|
|
50687
50719
|
}
|
|
50688
50720
|
),
|
|
50689
|
-
/* @__PURE__ */ (0,
|
|
50721
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
50690
50722
|
"span",
|
|
50691
50723
|
{
|
|
50692
50724
|
ref: tableRowGuideRef,
|
|
@@ -50694,7 +50726,7 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50694
50726
|
className: "pointer-events-none absolute z-20 bg-primary/50 opacity-0 transition-opacity duration-200 delay-100 ease-out"
|
|
50695
50727
|
}
|
|
50696
50728
|
),
|
|
50697
|
-
/* @__PURE__ */ (0,
|
|
50729
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
50698
50730
|
"span",
|
|
50699
50731
|
{
|
|
50700
50732
|
ref: activeTableCellHighlightRef,
|
|
@@ -50703,7 +50735,7 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50703
50735
|
className: "pointer-events-none hidden absolute z-20 rounded-[2px] border border-primary/50 bg-primary/5"
|
|
50704
50736
|
}
|
|
50705
50737
|
),
|
|
50706
|
-
/* @__PURE__ */ (0,
|
|
50738
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
50707
50739
|
"div",
|
|
50708
50740
|
{
|
|
50709
50741
|
ref: formulaCoordinateOverlayRef,
|
|
@@ -50711,7 +50743,7 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50711
50743
|
className: "pointer-events-none absolute inset-0 z-[35] hidden overflow-visible"
|
|
50712
50744
|
}
|
|
50713
50745
|
),
|
|
50714
|
-
formulaRangeHighlight && /* @__PURE__ */ (0,
|
|
50746
|
+
formulaRangeHighlight && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
50715
50747
|
"span",
|
|
50716
50748
|
{
|
|
50717
50749
|
"aria-hidden": "true",
|
|
@@ -50729,7 +50761,7 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50729
50761
|
}
|
|
50730
50762
|
}
|
|
50731
50763
|
),
|
|
50732
|
-
editable && /* @__PURE__ */ (0,
|
|
50764
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
50733
50765
|
TableControls,
|
|
50734
50766
|
{
|
|
50735
50767
|
editor,
|
|
@@ -50737,7 +50769,7 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50737
50769
|
showCellInspector: showBubbleMenu
|
|
50738
50770
|
}
|
|
50739
50771
|
),
|
|
50740
|
-
/* @__PURE__ */ (0,
|
|
50772
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
50741
50773
|
import_react89.EditorContent,
|
|
50742
50774
|
{
|
|
50743
50775
|
editor,
|
|
@@ -50747,7 +50779,7 @@ var UEditor = import_react88.default.forwardRef(({
|
|
|
50747
50779
|
]
|
|
50748
50780
|
}
|
|
50749
50781
|
),
|
|
50750
|
-
showFooter && showCharacterCount && /* @__PURE__ */ (0,
|
|
50782
|
+
showFooter && showCharacterCount && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(CharacterCountDisplay, { editor, maxCharacters })
|
|
50751
50783
|
]
|
|
50752
50784
|
}
|
|
50753
50785
|
) }) });
|