@underverse-ui/underverse 2.0.36 → 2.0.37
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-SCW2XGCE.js → chunk-6K6CKZUL.js} +10 -10
- package/dist/chunk-6K6CKZUL.js.map +1 -0
- package/dist/{chunk-V4VZZHV7.js → chunk-GZ7EDNGF.js} +202 -184
- package/dist/chunk-GZ7EDNGF.js.map +1 -0
- package/dist/index.cjs +484 -458
- 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 +496 -470
- package/dist/ueditor.cjs.map +1 -1
- 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/ueditor.cjs
CHANGED
|
@@ -9457,6 +9457,30 @@ var init_link_commands = __esm({
|
|
|
9457
9457
|
}
|
|
9458
9458
|
});
|
|
9459
9459
|
|
|
9460
|
+
// src/components/UEditor/table-vertical-align-icons.tsx
|
|
9461
|
+
function TableVerticalAlignIcon({ align, ...props }) {
|
|
9462
|
+
const [shortLine, longLine] = linePositions[align];
|
|
9463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.35", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [
|
|
9464
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("rect", { x: "2", y: "1.5", width: "12", height: "13", rx: "1", opacity: "0.55" }),
|
|
9465
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", { d: `M5 ${shortLine}h6M4 ${longLine}h8` })
|
|
9466
|
+
] });
|
|
9467
|
+
}
|
|
9468
|
+
var import_jsx_runtime28, linePositions, TableVerticalAlignTopIcon, TableVerticalAlignMiddleIcon, TableVerticalAlignBottomIcon;
|
|
9469
|
+
var init_table_vertical_align_icons = __esm({
|
|
9470
|
+
"src/components/UEditor/table-vertical-align-icons.tsx"() {
|
|
9471
|
+
"use strict";
|
|
9472
|
+
import_jsx_runtime28 = require("react/jsx-runtime");
|
|
9473
|
+
linePositions = {
|
|
9474
|
+
top: [4.5, 7],
|
|
9475
|
+
middle: [7, 9.5],
|
|
9476
|
+
bottom: [10, 12.5]
|
|
9477
|
+
};
|
|
9478
|
+
TableVerticalAlignTopIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableVerticalAlignIcon, { align: "top", ...props });
|
|
9479
|
+
TableVerticalAlignMiddleIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableVerticalAlignIcon, { align: "middle", ...props });
|
|
9480
|
+
TableVerticalAlignBottomIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableVerticalAlignIcon, { align: "bottom", ...props });
|
|
9481
|
+
}
|
|
9482
|
+
});
|
|
9483
|
+
|
|
9460
9484
|
// src/components/UEditor/typography-options.ts
|
|
9461
9485
|
function normalizeStyleValue(value) {
|
|
9462
9486
|
return typeof value === "string" ? value.trim().replace(/^['"]|['"]$/g, "") : "";
|
|
@@ -9633,7 +9657,7 @@ function EditorUiRenderStateProvider({
|
|
|
9633
9657
|
editor,
|
|
9634
9658
|
selector: ({ editor: currentEditor }) => getEditorUiRenderState(currentEditor)
|
|
9635
9659
|
});
|
|
9636
|
-
return /* @__PURE__ */ (0,
|
|
9660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(EditorUiRenderStateContext.Provider, { value: { editor, value }, children });
|
|
9637
9661
|
}
|
|
9638
9662
|
function useSharedEditorUiRenderState(editor) {
|
|
9639
9663
|
const context = import_react38.default.useContext(EditorUiRenderStateContext);
|
|
@@ -9654,7 +9678,7 @@ function applyTableCellAttribute(editor, name, value) {
|
|
|
9654
9678
|
}
|
|
9655
9679
|
editor.chain().focus().setCellAttribute(name, value).run();
|
|
9656
9680
|
}
|
|
9657
|
-
var import_react38, import_react39, import_lucide_react15, import_tables6,
|
|
9681
|
+
var import_react38, import_react39, import_lucide_react15, import_tables6, import_jsx_runtime29, EDITOR_UI_ACTIVE_MARKS, editorUiRenderStateCache, EditorUiRenderStateContext, ToolbarButton, ToolbarDivider, TableInsertGrid, EditorToolbar;
|
|
9658
9682
|
var init_toolbar = __esm({
|
|
9659
9683
|
"src/components/UEditor/toolbar.tsx"() {
|
|
9660
9684
|
"use strict";
|
|
@@ -9677,9 +9701,10 @@ var init_toolbar = __esm({
|
|
|
9677
9701
|
init_table_align_utils();
|
|
9678
9702
|
init_table_dom_utils();
|
|
9679
9703
|
init_table_cell_commands();
|
|
9704
|
+
init_table_vertical_align_icons();
|
|
9680
9705
|
init_figma_toolbar_icons();
|
|
9681
9706
|
init_typography_options();
|
|
9682
|
-
|
|
9707
|
+
import_jsx_runtime29 = require("react/jsx-runtime");
|
|
9683
9708
|
EDITOR_UI_ACTIVE_MARKS = [
|
|
9684
9709
|
"blockquote",
|
|
9685
9710
|
"bold",
|
|
@@ -9702,7 +9727,7 @@ var init_toolbar = __esm({
|
|
|
9702
9727
|
editorUiRenderStateCache = /* @__PURE__ */ new WeakMap();
|
|
9703
9728
|
EditorUiRenderStateContext = import_react38.default.createContext(null);
|
|
9704
9729
|
ToolbarButton = import_react38.default.forwardRef(({ onClick, onMouseDown, active, disabled, children, title, className }, ref) => {
|
|
9705
|
-
const button = /* @__PURE__ */ (0,
|
|
9730
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9706
9731
|
"button",
|
|
9707
9732
|
{
|
|
9708
9733
|
ref,
|
|
@@ -9727,12 +9752,12 @@ var init_toolbar = __esm({
|
|
|
9727
9752
|
}
|
|
9728
9753
|
);
|
|
9729
9754
|
if (title) {
|
|
9730
|
-
return /* @__PURE__ */ (0,
|
|
9755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Tooltip, { content: title, placement: "top", delay: { open: 200, close: 0 }, children: button });
|
|
9731
9756
|
}
|
|
9732
9757
|
return button;
|
|
9733
9758
|
});
|
|
9734
9759
|
ToolbarButton.displayName = "ToolbarButton";
|
|
9735
|
-
ToolbarDivider = () => /* @__PURE__ */ (0,
|
|
9760
|
+
ToolbarDivider = () => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { "aria-hidden": "true", className: "mx-1 h-5 w-px shrink-0 bg-[rgba(123,129,132,0.24)]" });
|
|
9736
9761
|
TableInsertGrid = ({
|
|
9737
9762
|
insertLabel,
|
|
9738
9763
|
previewTemplate,
|
|
@@ -9741,14 +9766,14 @@ var init_toolbar = __esm({
|
|
|
9741
9766
|
const [selection, setSelection] = import_react38.default.useState({ rows: 3, cols: 3 });
|
|
9742
9767
|
const maxRows = 8;
|
|
9743
9768
|
const maxCols = 8;
|
|
9744
|
-
return /* @__PURE__ */ (0,
|
|
9745
|
-
/* @__PURE__ */ (0,
|
|
9746
|
-
/* @__PURE__ */ (0,
|
|
9769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "mb-2 rounded-xl border border-border/60 bg-muted/20 p-2", children: [
|
|
9770
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "mb-2 text-sm font-medium text-foreground", children: formatTableInsertLabel(previewTemplate, selection.rows, selection.cols) }),
|
|
9771
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "grid grid-cols-8 gap-1", role: "grid", "aria-label": insertLabel, children: Array.from({ length: maxRows }).map(
|
|
9747
9772
|
(_, rowIndex) => Array.from({ length: maxCols }).map((__, colIndex) => {
|
|
9748
9773
|
const rows = rowIndex + 1;
|
|
9749
9774
|
const cols = colIndex + 1;
|
|
9750
9775
|
const active = rows <= selection.rows && cols <= selection.cols;
|
|
9751
|
-
return /* @__PURE__ */ (0,
|
|
9776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9752
9777
|
"button",
|
|
9753
9778
|
{
|
|
9754
9779
|
type: "button",
|
|
@@ -9778,7 +9803,7 @@ var init_toolbar = __esm({
|
|
|
9778
9803
|
);
|
|
9779
9804
|
})
|
|
9780
9805
|
) }),
|
|
9781
|
-
/* @__PURE__ */ (0,
|
|
9806
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "mt-2 text-xs text-muted-foreground", children: insertLabel })
|
|
9782
9807
|
] });
|
|
9783
9808
|
};
|
|
9784
9809
|
EditorToolbar = ({
|
|
@@ -9882,46 +9907,46 @@ var init_toolbar = __esm({
|
|
|
9882
9907
|
}
|
|
9883
9908
|
};
|
|
9884
9909
|
if (variant === "minimal") {
|
|
9885
|
-
return /* @__PURE__ */ (0,
|
|
9886
|
-
/* @__PURE__ */ (0,
|
|
9887
|
-
/* @__PURE__ */ (0,
|
|
9888
|
-
/* @__PURE__ */ (0,
|
|
9889
|
-
/* @__PURE__ */ (0,
|
|
9890
|
-
/* @__PURE__ */ (0,
|
|
9891
|
-
/* @__PURE__ */ (0,
|
|
9910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-wrap items-center gap-0.5 border-b border-border/35 bg-muted/30 p-1.5", children: [
|
|
9911
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().undo().run(), disabled: !editor.can().undo(), title: t("toolbar.undo"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaUndoIcon, { className: "h-4 w-4" }) }),
|
|
9912
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().redo().run(), disabled: !editor.can().redo(), title: t("toolbar.redo"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaRedoIcon, { className: "h-4 w-4" }) }),
|
|
9913
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarDivider, {}),
|
|
9914
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaBoldIcon, { className: "h-4 w-4" }) }),
|
|
9915
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaItalicIcon, { className: "h-4 w-4" }) }),
|
|
9916
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9892
9917
|
ToolbarButton,
|
|
9893
9918
|
{
|
|
9894
9919
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
9895
9920
|
active: editor.isActive("bulletList"),
|
|
9896
9921
|
title: t("toolbar.bulletList"),
|
|
9897
|
-
children: /* @__PURE__ */ (0,
|
|
9922
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaListIcon, { className: "h-4 w-4" })
|
|
9898
9923
|
}
|
|
9899
9924
|
),
|
|
9900
|
-
/* @__PURE__ */ (0,
|
|
9925
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9901
9926
|
ToolbarButton,
|
|
9902
9927
|
{
|
|
9903
9928
|
onClick: () => editor.chain().focus().decreaseIndent().run(),
|
|
9904
9929
|
disabled: !editorUiState.can.decreaseIndent,
|
|
9905
9930
|
title: t("toolbar.decreaseIndent"),
|
|
9906
|
-
children: /* @__PURE__ */ (0,
|
|
9931
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.IndentDecrease, { className: "h-4 w-4" })
|
|
9907
9932
|
}
|
|
9908
9933
|
),
|
|
9909
|
-
/* @__PURE__ */ (0,
|
|
9934
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9910
9935
|
ToolbarButton,
|
|
9911
9936
|
{
|
|
9912
9937
|
onClick: () => editor.chain().focus().increaseIndent().run(),
|
|
9913
9938
|
disabled: !editorUiState.can.increaseIndent,
|
|
9914
9939
|
title: t("toolbar.increaseIndent"),
|
|
9915
|
-
children: /* @__PURE__ */ (0,
|
|
9940
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.IndentIncrease, { className: "h-4 w-4" })
|
|
9916
9941
|
}
|
|
9917
9942
|
),
|
|
9918
|
-
/* @__PURE__ */ (0,
|
|
9943
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
9919
9944
|
DropdownMenu,
|
|
9920
9945
|
{
|
|
9921
|
-
trigger: /* @__PURE__ */ (0,
|
|
9922
|
-
}, active: editor.isActive("formCheckbox"), title: t("slashCommand.formCheckbox"), children: /* @__PURE__ */ (0,
|
|
9946
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => {
|
|
9947
|
+
}, active: editor.isActive("formCheckbox"), title: t("slashCommand.formCheckbox"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.SquareCheckBig, { className: "w-4 h-4" }) }),
|
|
9923
9948
|
children: [
|
|
9924
|
-
/* @__PURE__ */ (0,
|
|
9949
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9925
9950
|
DropdownMenuItem,
|
|
9926
9951
|
{
|
|
9927
9952
|
icon: import_lucide_react15.SquareCheckBig,
|
|
@@ -9929,7 +9954,7 @@ var init_toolbar = __esm({
|
|
|
9929
9954
|
onClick: () => editor.chain().focus().setFormCheckbox().run()
|
|
9930
9955
|
}
|
|
9931
9956
|
),
|
|
9932
|
-
/* @__PURE__ */ (0,
|
|
9957
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9933
9958
|
DropdownMenuItem,
|
|
9934
9959
|
{
|
|
9935
9960
|
icon: import_lucide_react15.CircleCheckBig,
|
|
@@ -9940,12 +9965,12 @@ var init_toolbar = __esm({
|
|
|
9940
9965
|
]
|
|
9941
9966
|
}
|
|
9942
9967
|
),
|
|
9943
|
-
/* @__PURE__ */ (0,
|
|
9968
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9944
9969
|
DropdownMenu,
|
|
9945
9970
|
{
|
|
9946
9971
|
contentClassName: "min-w-72",
|
|
9947
|
-
trigger: /* @__PURE__ */ (0,
|
|
9948
|
-
children: showLinkInput ? /* @__PURE__ */ (0,
|
|
9972
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => setShowLinkInput(!editor.isActive("link")), active: editor.isActive("link"), title: t("toolbar.link"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaLinkIcon, { className: "h-4 w-4" }) }),
|
|
9973
|
+
children: showLinkInput ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9949
9974
|
LinkInput,
|
|
9950
9975
|
{
|
|
9951
9976
|
initialUrl: String(editor.getAttributes("link").href ?? ""),
|
|
@@ -9955,8 +9980,8 @@ var init_toolbar = __esm({
|
|
|
9955
9980
|
},
|
|
9956
9981
|
onCancel: () => setShowLinkInput(false)
|
|
9957
9982
|
}
|
|
9958
|
-
) : /* @__PURE__ */ (0,
|
|
9959
|
-
/* @__PURE__ */ (0,
|
|
9983
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
9984
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9960
9985
|
DropdownMenuItem,
|
|
9961
9986
|
{
|
|
9962
9987
|
icon: import_lucide_react15.Link,
|
|
@@ -9966,7 +9991,7 @@ var init_toolbar = __esm({
|
|
|
9966
9991
|
closeOnSelect: false
|
|
9967
9992
|
}
|
|
9968
9993
|
),
|
|
9969
|
-
/* @__PURE__ */ (0,
|
|
9994
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9970
9995
|
DropdownMenuItem,
|
|
9971
9996
|
{
|
|
9972
9997
|
icon: import_lucide_react15.Trash2,
|
|
@@ -9979,28 +10004,28 @@ var init_toolbar = __esm({
|
|
|
9979
10004
|
] })
|
|
9980
10005
|
}
|
|
9981
10006
|
),
|
|
9982
|
-
onToggleMenuBar && /* @__PURE__ */ (0,
|
|
10007
|
+
onToggleMenuBar && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9983
10008
|
ToolbarButton,
|
|
9984
10009
|
{
|
|
9985
10010
|
onClick: onToggleMenuBar,
|
|
9986
10011
|
active: isMenuBarVisible,
|
|
9987
10012
|
title: t(isMenuBarVisible ? "toolbar.hideMenuBar" : "toolbar.showMenuBar"),
|
|
9988
|
-
children: isMenuBarVisible ? /* @__PURE__ */ (0,
|
|
10013
|
+
children: isMenuBarVisible ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.PanelTopClose, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.PanelTopOpen, { className: "h-4 w-4" })
|
|
9989
10014
|
}
|
|
9990
10015
|
)
|
|
9991
10016
|
] });
|
|
9992
10017
|
}
|
|
9993
|
-
const VerticalAlignActiveIcon = currentCellVerticalAlign === "middle" ?
|
|
9994
|
-
return /* @__PURE__ */ (0,
|
|
10018
|
+
const VerticalAlignActiveIcon = currentCellVerticalAlign === "middle" ? TableVerticalAlignMiddleIcon : currentCellVerticalAlign === "bottom" ? TableVerticalAlignBottomIcon : TableVerticalAlignTopIcon;
|
|
10019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
9995
10020
|
"div",
|
|
9996
10021
|
{
|
|
9997
10022
|
role: "toolbar",
|
|
9998
10023
|
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",
|
|
9999
10024
|
children: [
|
|
10000
|
-
isFull && /* @__PURE__ */ (0,
|
|
10025
|
+
isFull && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10001
10026
|
DropdownMenu,
|
|
10002
10027
|
{
|
|
10003
|
-
trigger: /* @__PURE__ */ (0,
|
|
10028
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
10004
10029
|
ToolbarButton,
|
|
10005
10030
|
{
|
|
10006
10031
|
onClick: () => {
|
|
@@ -10008,13 +10033,13 @@ var init_toolbar = __esm({
|
|
|
10008
10033
|
title: t("toolbar.fontFamily"),
|
|
10009
10034
|
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",
|
|
10010
10035
|
children: [
|
|
10011
|
-
/* @__PURE__ */ (0,
|
|
10012
|
-
/* @__PURE__ */ (0,
|
|
10036
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "min-w-0 flex-1 truncate text-left text-xs font-normal", style: { fontFamily: displayedFontFamilyValue || void 0 }, children: displayedFontFamilyLabel }),
|
|
10037
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaChevronDownIcon, { className: "h-3 w-3 shrink-0 text-[#7B8184]" })
|
|
10013
10038
|
]
|
|
10014
10039
|
}
|
|
10015
10040
|
),
|
|
10016
10041
|
contentClassName: "max-h-80 overflow-y-auto min-w-56 p-2",
|
|
10017
|
-
children: availableFontFamilies.map((option) => /* @__PURE__ */ (0,
|
|
10042
|
+
children: availableFontFamilies.map((option) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10018
10043
|
DropdownMenuItem,
|
|
10019
10044
|
{
|
|
10020
10045
|
label: option.label,
|
|
@@ -10026,11 +10051,11 @@ var init_toolbar = __esm({
|
|
|
10026
10051
|
))
|
|
10027
10052
|
}
|
|
10028
10053
|
),
|
|
10029
|
-
(isMediumFull || isFull) && /* @__PURE__ */ (0,
|
|
10054
|
+
(isMediumFull || isFull) && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10030
10055
|
DropdownMenu,
|
|
10031
10056
|
{
|
|
10032
|
-
trigger: /* @__PURE__ */ (0,
|
|
10033
|
-
/* @__PURE__ */ (0,
|
|
10057
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.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: [
|
|
10058
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10034
10059
|
"input",
|
|
10035
10060
|
{
|
|
10036
10061
|
type: "number",
|
|
@@ -10061,10 +10086,10 @@ var init_toolbar = __esm({
|
|
|
10061
10086
|
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"
|
|
10062
10087
|
}
|
|
10063
10088
|
),
|
|
10064
|
-
/* @__PURE__ */ (0,
|
|
10089
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", "aria-label": t("toolbar.fontSize"), title: t("toolbar.fontSize"), className: "px-1 text-[#7B8184]", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaChevronDownIcon, { className: "h-3 w-3" }) })
|
|
10065
10090
|
] }),
|
|
10066
10091
|
contentClassName: "max-h-80 overflow-y-auto min-w-32 p-2",
|
|
10067
|
-
children: availableFontSizes.map((option) => /* @__PURE__ */ (0,
|
|
10092
|
+
children: availableFontSizes.map((option) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10068
10093
|
DropdownMenuItem,
|
|
10069
10094
|
{
|
|
10070
10095
|
label: option.label,
|
|
@@ -10078,14 +10103,14 @@ var init_toolbar = __esm({
|
|
|
10078
10103
|
))
|
|
10079
10104
|
}
|
|
10080
10105
|
),
|
|
10081
|
-
/* @__PURE__ */ (0,
|
|
10106
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
10082
10107
|
DropdownMenu,
|
|
10083
10108
|
{
|
|
10084
10109
|
contentClassName: "p-1",
|
|
10085
|
-
trigger: /* @__PURE__ */ (0,
|
|
10086
|
-
}, title: t("toolbar.textStyle"), className: "px-1.5 w-auto gap-0.5", children: /* @__PURE__ */ (0,
|
|
10110
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => {
|
|
10111
|
+
}, title: t("toolbar.textStyle"), className: "px-1.5 w-auto gap-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaTextStyleIcon, { className: "h-4 w-4" }) }),
|
|
10087
10112
|
children: [
|
|
10088
|
-
/* @__PURE__ */ (0,
|
|
10113
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10089
10114
|
DropdownMenuItem,
|
|
10090
10115
|
{
|
|
10091
10116
|
icon: import_lucide_react15.Type,
|
|
@@ -10094,7 +10119,7 @@ var init_toolbar = __esm({
|
|
|
10094
10119
|
active: editor.isActive("paragraph")
|
|
10095
10120
|
}
|
|
10096
10121
|
),
|
|
10097
|
-
/* @__PURE__ */ (0,
|
|
10122
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10098
10123
|
DropdownMenuItem,
|
|
10099
10124
|
{
|
|
10100
10125
|
icon: import_lucide_react15.Heading1,
|
|
@@ -10104,7 +10129,7 @@ var init_toolbar = __esm({
|
|
|
10104
10129
|
shortcut: "Ctrl+Alt+1"
|
|
10105
10130
|
}
|
|
10106
10131
|
),
|
|
10107
|
-
/* @__PURE__ */ (0,
|
|
10132
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10108
10133
|
DropdownMenuItem,
|
|
10109
10134
|
{
|
|
10110
10135
|
icon: import_lucide_react15.Heading2,
|
|
@@ -10114,7 +10139,7 @@ var init_toolbar = __esm({
|
|
|
10114
10139
|
shortcut: "Ctrl+Alt+2"
|
|
10115
10140
|
}
|
|
10116
10141
|
),
|
|
10117
|
-
/* @__PURE__ */ (0,
|
|
10142
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10118
10143
|
DropdownMenuItem,
|
|
10119
10144
|
{
|
|
10120
10145
|
icon: import_lucide_react15.Heading3,
|
|
@@ -10127,15 +10152,15 @@ var init_toolbar = __esm({
|
|
|
10127
10152
|
]
|
|
10128
10153
|
}
|
|
10129
10154
|
),
|
|
10130
|
-
isFull && /* @__PURE__ */ (0,
|
|
10131
|
-
/* @__PURE__ */ (0,
|
|
10155
|
+
isFull && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
10156
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
10132
10157
|
DropdownMenu,
|
|
10133
10158
|
{
|
|
10134
|
-
trigger: /* @__PURE__ */ (0,
|
|
10135
|
-
}, title: t("toolbar.lineHeight"), className: "gap-0.5", children: /* @__PURE__ */ (0,
|
|
10159
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => {
|
|
10160
|
+
}, title: t("toolbar.lineHeight"), className: "gap-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaLineHeightIcon, { className: "h-4 w-4" }) }),
|
|
10136
10161
|
contentClassName: "max-h-72 overflow-y-auto p-1",
|
|
10137
10162
|
children: [
|
|
10138
|
-
/* @__PURE__ */ (0,
|
|
10163
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10139
10164
|
DropdownMenuItem,
|
|
10140
10165
|
{
|
|
10141
10166
|
icon: import_lucide_react15.Type,
|
|
@@ -10144,7 +10169,7 @@ var init_toolbar = __esm({
|
|
|
10144
10169
|
active: !currentLineHeight
|
|
10145
10170
|
}
|
|
10146
10171
|
),
|
|
10147
|
-
availableLineHeights.map((option) => /* @__PURE__ */ (0,
|
|
10172
|
+
availableLineHeights.map((option) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10148
10173
|
DropdownMenuItem,
|
|
10149
10174
|
{
|
|
10150
10175
|
label: option.label,
|
|
@@ -10156,14 +10181,14 @@ var init_toolbar = __esm({
|
|
|
10156
10181
|
]
|
|
10157
10182
|
}
|
|
10158
10183
|
),
|
|
10159
|
-
/* @__PURE__ */ (0,
|
|
10184
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
10160
10185
|
DropdownMenu,
|
|
10161
10186
|
{
|
|
10162
|
-
trigger: /* @__PURE__ */ (0,
|
|
10163
|
-
}, title: t("toolbar.letterSpacing"), className: "gap-0.5", children: /* @__PURE__ */ (0,
|
|
10187
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => {
|
|
10188
|
+
}, title: t("toolbar.letterSpacing"), className: "gap-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaLetterSpacingIcon, { className: "h-4 w-4" }) }),
|
|
10164
10189
|
contentClassName: "max-h-72 overflow-y-auto p-1",
|
|
10165
10190
|
children: [
|
|
10166
|
-
/* @__PURE__ */ (0,
|
|
10191
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10167
10192
|
DropdownMenuItem,
|
|
10168
10193
|
{
|
|
10169
10194
|
icon: import_lucide_react15.Type,
|
|
@@ -10172,7 +10197,7 @@ var init_toolbar = __esm({
|
|
|
10172
10197
|
active: !currentLetterSpacing
|
|
10173
10198
|
}
|
|
10174
10199
|
),
|
|
10175
|
-
availableLetterSpacings.map((option) => /* @__PURE__ */ (0,
|
|
10200
|
+
availableLetterSpacings.map((option) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10176
10201
|
DropdownMenuItem,
|
|
10177
10202
|
{
|
|
10178
10203
|
label: option.label,
|
|
@@ -10185,16 +10210,16 @@ var init_toolbar = __esm({
|
|
|
10185
10210
|
}
|
|
10186
10211
|
)
|
|
10187
10212
|
] }),
|
|
10188
|
-
/* @__PURE__ */ (0,
|
|
10189
|
-
(isMediumFull || isFull) && /* @__PURE__ */ (0,
|
|
10213
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarDivider, {}),
|
|
10214
|
+
(isMediumFull || isFull) && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10190
10215
|
DropdownMenu,
|
|
10191
10216
|
{
|
|
10192
10217
|
isOpen: isTableMenuOpen,
|
|
10193
10218
|
onOpenChange: setIsTableMenuOpen,
|
|
10194
|
-
trigger: /* @__PURE__ */ (0,
|
|
10195
|
-
}, title: t("toolbar.table"), children: /* @__PURE__ */ (0,
|
|
10219
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => {
|
|
10220
|
+
}, title: t("toolbar.table"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaTableIcon, { className: "h-4 w-4" }) }),
|
|
10196
10221
|
contentClassName: "p-2 min-w-56",
|
|
10197
|
-
children: /* @__PURE__ */ (0,
|
|
10222
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10198
10223
|
TableInsertGrid,
|
|
10199
10224
|
{
|
|
10200
10225
|
insertLabel: t("tableMenu.insertTable"),
|
|
@@ -10207,45 +10232,45 @@ var init_toolbar = __esm({
|
|
|
10207
10232
|
)
|
|
10208
10233
|
}
|
|
10209
10234
|
),
|
|
10210
|
-
/* @__PURE__ */ (0,
|
|
10211
|
-
/* @__PURE__ */ (0,
|
|
10212
|
-
/* @__PURE__ */ (0,
|
|
10235
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaBoldIcon, { className: "h-4 w-4" }) }),
|
|
10236
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaItalicIcon, { className: "h-4 w-4" }) }),
|
|
10237
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10213
10238
|
ToolbarButton,
|
|
10214
10239
|
{
|
|
10215
10240
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
10216
10241
|
active: editor.isActive("underline"),
|
|
10217
10242
|
title: t("toolbar.underline"),
|
|
10218
|
-
children: /* @__PURE__ */ (0,
|
|
10243
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaUnderlineIcon, { className: "h-4 w-4" })
|
|
10219
10244
|
}
|
|
10220
10245
|
),
|
|
10221
|
-
/* @__PURE__ */ (0,
|
|
10222
|
-
(isMediumFull || isFull) && /* @__PURE__ */ (0,
|
|
10223
|
-
isFull && /* @__PURE__ */ (0,
|
|
10224
|
-
/* @__PURE__ */ (0,
|
|
10246
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaStrikeIcon, { className: "h-4 w-4" }) }),
|
|
10247
|
+
(isMediumFull || isFull) && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaCodeIcon, { className: "h-4 w-4" }) }),
|
|
10248
|
+
isFull && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
10249
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10225
10250
|
ToolbarButton,
|
|
10226
10251
|
{
|
|
10227
10252
|
onClick: () => editor.chain().focus().toggleSubscript().run(),
|
|
10228
10253
|
active: editor.isActive("subscript"),
|
|
10229
10254
|
title: t("toolbar.subscript"),
|
|
10230
|
-
children: /* @__PURE__ */ (0,
|
|
10255
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaSubscriptIcon, { className: "h-4 w-4" })
|
|
10231
10256
|
}
|
|
10232
10257
|
),
|
|
10233
|
-
/* @__PURE__ */ (0,
|
|
10258
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10234
10259
|
ToolbarButton,
|
|
10235
10260
|
{
|
|
10236
10261
|
onClick: () => editor.chain().focus().toggleSuperscript().run(),
|
|
10237
10262
|
active: editor.isActive("superscript"),
|
|
10238
10263
|
title: t("toolbar.superscript"),
|
|
10239
|
-
children: /* @__PURE__ */ (0,
|
|
10264
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaSuperscriptIcon, { className: "h-4 w-4" })
|
|
10240
10265
|
}
|
|
10241
10266
|
)
|
|
10242
10267
|
] }),
|
|
10243
|
-
/* @__PURE__ */ (0,
|
|
10268
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10244
10269
|
DropdownMenu,
|
|
10245
10270
|
{
|
|
10246
10271
|
contentClassName: "min-w-72",
|
|
10247
|
-
trigger: /* @__PURE__ */ (0,
|
|
10248
|
-
children: showLinkInput ? /* @__PURE__ */ (0,
|
|
10272
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => setShowLinkInput(!editor.isActive("link")), active: editor.isActive("link"), title: t("toolbar.link"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaLinkIcon, { className: "h-4 w-4" }) }),
|
|
10273
|
+
children: showLinkInput ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10249
10274
|
LinkInput,
|
|
10250
10275
|
{
|
|
10251
10276
|
initialUrl: String(editor.getAttributes("link").href ?? ""),
|
|
@@ -10255,8 +10280,8 @@ var init_toolbar = __esm({
|
|
|
10255
10280
|
},
|
|
10256
10281
|
onCancel: () => setShowLinkInput(false)
|
|
10257
10282
|
}
|
|
10258
|
-
) : /* @__PURE__ */ (0,
|
|
10259
|
-
/* @__PURE__ */ (0,
|
|
10283
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
10284
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10260
10285
|
DropdownMenuItem,
|
|
10261
10286
|
{
|
|
10262
10287
|
icon: import_lucide_react15.Link,
|
|
@@ -10266,7 +10291,7 @@ var init_toolbar = __esm({
|
|
|
10266
10291
|
closeOnSelect: false
|
|
10267
10292
|
}
|
|
10268
10293
|
),
|
|
10269
|
-
/* @__PURE__ */ (0,
|
|
10294
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10270
10295
|
DropdownMenuItem,
|
|
10271
10296
|
{
|
|
10272
10297
|
icon: import_lucide_react15.Trash2,
|
|
@@ -10279,13 +10304,13 @@ var init_toolbar = __esm({
|
|
|
10279
10304
|
] })
|
|
10280
10305
|
}
|
|
10281
10306
|
),
|
|
10282
|
-
/* @__PURE__ */ (0,
|
|
10283
|
-
/* @__PURE__ */ (0,
|
|
10307
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarDivider, {}),
|
|
10308
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10284
10309
|
DropdownMenu,
|
|
10285
10310
|
{
|
|
10286
|
-
trigger: /* @__PURE__ */ (0,
|
|
10287
|
-
}, title: t("colors.textColor"), children: /* @__PURE__ */ (0,
|
|
10288
|
-
children: /* @__PURE__ */ (0,
|
|
10311
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => {
|
|
10312
|
+
}, title: t("colors.textColor"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TextColorIcon, { color: currentTextColor }) }),
|
|
10313
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10289
10314
|
EditorColorPalette,
|
|
10290
10315
|
{
|
|
10291
10316
|
colors: textColors,
|
|
@@ -10302,12 +10327,12 @@ var init_toolbar = __esm({
|
|
|
10302
10327
|
)
|
|
10303
10328
|
}
|
|
10304
10329
|
),
|
|
10305
|
-
/* @__PURE__ */ (0,
|
|
10330
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10306
10331
|
DropdownMenu,
|
|
10307
10332
|
{
|
|
10308
|
-
trigger: /* @__PURE__ */ (0,
|
|
10309
|
-
}, active: editor.isActive("highlight"), title: t("colors.highlight"), children: /* @__PURE__ */ (0,
|
|
10310
|
-
children: /* @__PURE__ */ (0,
|
|
10333
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => {
|
|
10334
|
+
}, active: editor.isActive("highlight"), title: t("colors.highlight"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(HighlightColorIcon, { color: currentHighlightColor }) }),
|
|
10335
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10311
10336
|
EditorColorPalette,
|
|
10312
10337
|
{
|
|
10313
10338
|
colors: highlightColors,
|
|
@@ -10324,15 +10349,15 @@ var init_toolbar = __esm({
|
|
|
10324
10349
|
)
|
|
10325
10350
|
}
|
|
10326
10351
|
),
|
|
10327
|
-
(isMediumFull || isFull) && /* @__PURE__ */ (0,
|
|
10328
|
-
/* @__PURE__ */ (0,
|
|
10329
|
-
/* @__PURE__ */ (0,
|
|
10352
|
+
(isMediumFull || isFull) && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
10353
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarDivider, {}),
|
|
10354
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
10330
10355
|
DropdownMenu,
|
|
10331
10356
|
{
|
|
10332
|
-
trigger: /* @__PURE__ */ (0,
|
|
10333
|
-
}, title: t("toolbar.alignment"), children: /* @__PURE__ */ (0,
|
|
10357
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => {
|
|
10358
|
+
}, title: t("toolbar.alignment"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaAlignLeftIcon, { className: "h-4 w-4" }) }),
|
|
10334
10359
|
children: [
|
|
10335
|
-
/* @__PURE__ */ (0,
|
|
10360
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10336
10361
|
DropdownMenuItem,
|
|
10337
10362
|
{
|
|
10338
10363
|
icon: import_lucide_react15.AlignLeft,
|
|
@@ -10341,7 +10366,7 @@ var init_toolbar = __esm({
|
|
|
10341
10366
|
active: editor.isActive({ textAlign: "left" })
|
|
10342
10367
|
}
|
|
10343
10368
|
),
|
|
10344
|
-
/* @__PURE__ */ (0,
|
|
10369
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10345
10370
|
DropdownMenuItem,
|
|
10346
10371
|
{
|
|
10347
10372
|
icon: import_lucide_react15.AlignCenter,
|
|
@@ -10350,7 +10375,7 @@ var init_toolbar = __esm({
|
|
|
10350
10375
|
active: editor.isActive({ textAlign: "center" })
|
|
10351
10376
|
}
|
|
10352
10377
|
),
|
|
10353
|
-
/* @__PURE__ */ (0,
|
|
10378
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10354
10379
|
DropdownMenuItem,
|
|
10355
10380
|
{
|
|
10356
10381
|
icon: import_lucide_react15.AlignRight,
|
|
@@ -10359,7 +10384,7 @@ var init_toolbar = __esm({
|
|
|
10359
10384
|
active: editor.isActive({ textAlign: "right" })
|
|
10360
10385
|
}
|
|
10361
10386
|
),
|
|
10362
|
-
/* @__PURE__ */ (0,
|
|
10387
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10363
10388
|
DropdownMenuItem,
|
|
10364
10389
|
{
|
|
10365
10390
|
icon: import_lucide_react15.AlignJustify,
|
|
@@ -10368,30 +10393,30 @@ var init_toolbar = __esm({
|
|
|
10368
10393
|
active: editor.isActive({ textAlign: "justify" })
|
|
10369
10394
|
}
|
|
10370
10395
|
),
|
|
10371
|
-
hasTableContext && /* @__PURE__ */ (0,
|
|
10372
|
-
/* @__PURE__ */ (0,
|
|
10373
|
-
/* @__PURE__ */ (0,
|
|
10396
|
+
hasTableContext && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
10397
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "my-1 border-t" }),
|
|
10398
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10374
10399
|
DropdownMenuItem,
|
|
10375
10400
|
{
|
|
10376
|
-
icon:
|
|
10401
|
+
icon: TableVerticalAlignTopIcon,
|
|
10377
10402
|
label: t("tableMenu.alignVerticalTop") || "Align top",
|
|
10378
10403
|
onClick: () => applyTableCellAttribute(editor, "verticalAlign", "top"),
|
|
10379
10404
|
active: currentCellVerticalAlign === "top"
|
|
10380
10405
|
}
|
|
10381
10406
|
),
|
|
10382
|
-
/* @__PURE__ */ (0,
|
|
10407
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10383
10408
|
DropdownMenuItem,
|
|
10384
10409
|
{
|
|
10385
|
-
icon:
|
|
10410
|
+
icon: TableVerticalAlignMiddleIcon,
|
|
10386
10411
|
label: t("tableMenu.alignVerticalMiddle") || "Align middle",
|
|
10387
10412
|
onClick: () => applyTableCellAttribute(editor, "verticalAlign", "middle"),
|
|
10388
10413
|
active: currentCellVerticalAlign === "middle"
|
|
10389
10414
|
}
|
|
10390
10415
|
),
|
|
10391
|
-
/* @__PURE__ */ (0,
|
|
10416
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10392
10417
|
DropdownMenuItem,
|
|
10393
10418
|
{
|
|
10394
|
-
icon:
|
|
10419
|
+
icon: TableVerticalAlignBottomIcon,
|
|
10395
10420
|
label: t("tableMenu.alignVerticalBottom") || "Align bottom",
|
|
10396
10421
|
onClick: () => applyTableCellAttribute(editor, "verticalAlign", "bottom"),
|
|
10397
10422
|
active: currentCellVerticalAlign === "bottom"
|
|
@@ -10401,14 +10426,14 @@ var init_toolbar = __esm({
|
|
|
10401
10426
|
]
|
|
10402
10427
|
}
|
|
10403
10428
|
),
|
|
10404
|
-
hasTableContext && /* @__PURE__ */ (0,
|
|
10405
|
-
/* @__PURE__ */ (0,
|
|
10429
|
+
hasTableContext && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
10430
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
10406
10431
|
DropdownMenu,
|
|
10407
10432
|
{
|
|
10408
|
-
trigger: /* @__PURE__ */ (0,
|
|
10409
|
-
}, title: t("tableMenu.textDirection"), children: currentCellTextDirection === "vertical" ? /* @__PURE__ */ (0,
|
|
10433
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => {
|
|
10434
|
+
}, title: t("tableMenu.textDirection"), children: currentCellTextDirection === "vertical" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.ArrowDown, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.ArrowRight, { className: "w-4 h-4" }) }),
|
|
10410
10435
|
children: [
|
|
10411
|
-
/* @__PURE__ */ (0,
|
|
10436
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10412
10437
|
DropdownMenuItem,
|
|
10413
10438
|
{
|
|
10414
10439
|
icon: import_lucide_react15.ArrowRight,
|
|
@@ -10417,7 +10442,7 @@ var init_toolbar = __esm({
|
|
|
10417
10442
|
active: currentCellTextDirection === "horizontal"
|
|
10418
10443
|
}
|
|
10419
10444
|
),
|
|
10420
|
-
/* @__PURE__ */ (0,
|
|
10445
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10421
10446
|
DropdownMenuItem,
|
|
10422
10447
|
{
|
|
10423
10448
|
icon: import_lucide_react15.ArrowDown,
|
|
@@ -10429,25 +10454,25 @@ var init_toolbar = __esm({
|
|
|
10429
10454
|
]
|
|
10430
10455
|
}
|
|
10431
10456
|
),
|
|
10432
|
-
/* @__PURE__ */ (0,
|
|
10457
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10433
10458
|
ToolbarButton,
|
|
10434
10459
|
{
|
|
10435
10460
|
onClick: () => applyTableCellAttribute(editor, "textWrap", currentCellTextWrap === "nowrap" ? "wrap" : "nowrap"),
|
|
10436
10461
|
active: currentCellTextWrap !== "nowrap",
|
|
10437
10462
|
title: currentCellTextWrap === "nowrap" ? t("tableMenu.wrapText") : t("tableMenu.noWrapText"),
|
|
10438
|
-
children: /* @__PURE__ */ (0,
|
|
10463
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.WrapText, { className: "h-4 w-4" })
|
|
10439
10464
|
}
|
|
10440
10465
|
)
|
|
10441
10466
|
] })
|
|
10442
10467
|
] }),
|
|
10443
|
-
/* @__PURE__ */ (0,
|
|
10444
|
-
/* @__PURE__ */ (0,
|
|
10468
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarDivider, {}),
|
|
10469
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
10445
10470
|
DropdownMenu,
|
|
10446
10471
|
{
|
|
10447
|
-
trigger: /* @__PURE__ */ (0,
|
|
10448
|
-
}, title: t("toolbar.bulletList"), children: /* @__PURE__ */ (0,
|
|
10472
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => {
|
|
10473
|
+
}, title: t("toolbar.bulletList"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaListIcon, { className: "h-4 w-4" }) }),
|
|
10449
10474
|
children: [
|
|
10450
|
-
/* @__PURE__ */ (0,
|
|
10475
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10451
10476
|
DropdownMenuItem,
|
|
10452
10477
|
{
|
|
10453
10478
|
icon: import_lucide_react15.List,
|
|
@@ -10457,7 +10482,7 @@ var init_toolbar = __esm({
|
|
|
10457
10482
|
shortcut: "Ctrl+Shift+8"
|
|
10458
10483
|
}
|
|
10459
10484
|
),
|
|
10460
|
-
/* @__PURE__ */ (0,
|
|
10485
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10461
10486
|
DropdownMenuItem,
|
|
10462
10487
|
{
|
|
10463
10488
|
icon: import_lucide_react15.ListOrdered,
|
|
@@ -10467,7 +10492,7 @@ var init_toolbar = __esm({
|
|
|
10467
10492
|
shortcut: "Ctrl+Shift+7"
|
|
10468
10493
|
}
|
|
10469
10494
|
),
|
|
10470
|
-
/* @__PURE__ */ (0,
|
|
10495
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10471
10496
|
DropdownMenuItem,
|
|
10472
10497
|
{
|
|
10473
10498
|
icon: import_lucide_react15.ListTodo,
|
|
@@ -10480,31 +10505,31 @@ var init_toolbar = __esm({
|
|
|
10480
10505
|
]
|
|
10481
10506
|
}
|
|
10482
10507
|
),
|
|
10483
|
-
/* @__PURE__ */ (0,
|
|
10508
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10484
10509
|
ToolbarButton,
|
|
10485
10510
|
{
|
|
10486
10511
|
onClick: () => editor.chain().focus().decreaseIndent().run(),
|
|
10487
10512
|
disabled: !editorUiState.can.decreaseIndent,
|
|
10488
10513
|
title: t("toolbar.decreaseIndent"),
|
|
10489
|
-
children: /* @__PURE__ */ (0,
|
|
10514
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.IndentDecrease, { className: "h-4 w-4" })
|
|
10490
10515
|
}
|
|
10491
10516
|
),
|
|
10492
|
-
/* @__PURE__ */ (0,
|
|
10517
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10493
10518
|
ToolbarButton,
|
|
10494
10519
|
{
|
|
10495
10520
|
onClick: () => editor.chain().focus().increaseIndent().run(),
|
|
10496
10521
|
disabled: !editorUiState.can.increaseIndent,
|
|
10497
10522
|
title: t("toolbar.increaseIndent"),
|
|
10498
|
-
children: /* @__PURE__ */ (0,
|
|
10523
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.IndentIncrease, { className: "h-4 w-4" })
|
|
10499
10524
|
}
|
|
10500
10525
|
),
|
|
10501
|
-
/* @__PURE__ */ (0,
|
|
10526
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
10502
10527
|
DropdownMenu,
|
|
10503
10528
|
{
|
|
10504
|
-
trigger: /* @__PURE__ */ (0,
|
|
10505
|
-
}, active: editor.isActive("formCheckbox"), title: t("slashCommand.formCheckbox"), children: /* @__PURE__ */ (0,
|
|
10529
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => {
|
|
10530
|
+
}, active: editor.isActive("formCheckbox"), title: t("slashCommand.formCheckbox"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.SquareCheckBig, { className: "w-4 h-4" }) }),
|
|
10506
10531
|
children: [
|
|
10507
|
-
/* @__PURE__ */ (0,
|
|
10532
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10508
10533
|
DropdownMenuItem,
|
|
10509
10534
|
{
|
|
10510
10535
|
icon: import_lucide_react15.SquareCheckBig,
|
|
@@ -10512,7 +10537,7 @@ var init_toolbar = __esm({
|
|
|
10512
10537
|
onClick: () => editor.chain().focus().setFormCheckbox().run()
|
|
10513
10538
|
}
|
|
10514
10539
|
),
|
|
10515
|
-
/* @__PURE__ */ (0,
|
|
10540
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10516
10541
|
DropdownMenuItem,
|
|
10517
10542
|
{
|
|
10518
10543
|
icon: import_lucide_react15.CircleCheckBig,
|
|
@@ -10523,14 +10548,14 @@ var init_toolbar = __esm({
|
|
|
10523
10548
|
]
|
|
10524
10549
|
}
|
|
10525
10550
|
),
|
|
10526
|
-
isMediumFull && /* @__PURE__ */ (0,
|
|
10527
|
-
isFull && /* @__PURE__ */ (0,
|
|
10551
|
+
isMediumFull && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleBlockquote().run(), active: editor.isActive("blockquote"), title: t("toolbar.quote"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaQuoteIcon, { className: "h-4 w-4" }) }),
|
|
10552
|
+
isFull && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
10528
10553
|
DropdownMenu,
|
|
10529
10554
|
{
|
|
10530
|
-
trigger: /* @__PURE__ */ (0,
|
|
10531
|
-
}, title: t("toolbar.quote"), children: /* @__PURE__ */ (0,
|
|
10555
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => {
|
|
10556
|
+
}, title: t("toolbar.quote"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaQuoteIcon, { className: "h-4 w-4" }) }),
|
|
10532
10557
|
children: [
|
|
10533
|
-
/* @__PURE__ */ (0,
|
|
10558
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10534
10559
|
DropdownMenuItem,
|
|
10535
10560
|
{
|
|
10536
10561
|
icon: import_lucide_react15.Quote,
|
|
@@ -10540,7 +10565,7 @@ var init_toolbar = __esm({
|
|
|
10540
10565
|
shortcut: "Ctrl+Shift+B"
|
|
10541
10566
|
}
|
|
10542
10567
|
),
|
|
10543
|
-
/* @__PURE__ */ (0,
|
|
10568
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10544
10569
|
DropdownMenuItem,
|
|
10545
10570
|
{
|
|
10546
10571
|
icon: import_lucide_react15.FileCode,
|
|
@@ -10553,12 +10578,12 @@ var init_toolbar = __esm({
|
|
|
10553
10578
|
]
|
|
10554
10579
|
}
|
|
10555
10580
|
),
|
|
10556
|
-
(isMediumFull || isFull) && /* @__PURE__ */ (0,
|
|
10581
|
+
(isMediumFull || isFull) && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10557
10582
|
DropdownMenu,
|
|
10558
10583
|
{
|
|
10559
|
-
trigger: /* @__PURE__ */ (0,
|
|
10560
|
-
}, title: t("toolbar.image"), children: /* @__PURE__ */ (0,
|
|
10561
|
-
children: showImageInput ? /* @__PURE__ */ (0,
|
|
10584
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => {
|
|
10585
|
+
}, title: t("toolbar.image"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaImageIcon, { className: "h-4 w-4" }) }),
|
|
10586
|
+
children: showImageInput ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10562
10587
|
ImageInput,
|
|
10563
10588
|
{
|
|
10564
10589
|
onSubmit: (url, alt) => {
|
|
@@ -10567,9 +10592,9 @@ var init_toolbar = __esm({
|
|
|
10567
10592
|
},
|
|
10568
10593
|
onCancel: () => setShowImageInput(false)
|
|
10569
10594
|
}
|
|
10570
|
-
) : /* @__PURE__ */ (0,
|
|
10571
|
-
/* @__PURE__ */ (0,
|
|
10572
|
-
/* @__PURE__ */ (0,
|
|
10595
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
10596
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DropdownMenuItem, { icon: import_lucide_react15.Link, label: t("imageInput.addFromUrl"), onClick: () => setShowImageInput(true), closeOnSelect: false }),
|
|
10597
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10573
10598
|
DropdownMenuItem,
|
|
10574
10599
|
{
|
|
10575
10600
|
icon: import_lucide_react15.Upload,
|
|
@@ -10579,8 +10604,8 @@ var init_toolbar = __esm({
|
|
|
10579
10604
|
closeOnSelect: false
|
|
10580
10605
|
}
|
|
10581
10606
|
),
|
|
10582
|
-
imageUploadError && /* @__PURE__ */ (0,
|
|
10583
|
-
/* @__PURE__ */ (0,
|
|
10607
|
+
imageUploadError && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DropdownMenuItem, { label: imageUploadError, disabled: true, destructive: true }),
|
|
10608
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10584
10609
|
"input",
|
|
10585
10610
|
{
|
|
10586
10611
|
ref: fileInputRef,
|
|
@@ -10595,8 +10620,8 @@ var init_toolbar = __esm({
|
|
|
10595
10620
|
}
|
|
10596
10621
|
}
|
|
10597
10622
|
),
|
|
10598
|
-
/* @__PURE__ */ (0,
|
|
10599
|
-
/* @__PURE__ */ (0,
|
|
10623
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "my-1 border-t" }),
|
|
10624
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10600
10625
|
DropdownMenuItem,
|
|
10601
10626
|
{
|
|
10602
10627
|
icon: import_lucide_react15.AlignCenter,
|
|
@@ -10606,7 +10631,7 @@ var init_toolbar = __esm({
|
|
|
10606
10631
|
disabled: !isImageSelected
|
|
10607
10632
|
}
|
|
10608
10633
|
),
|
|
10609
|
-
/* @__PURE__ */ (0,
|
|
10634
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10610
10635
|
DropdownMenuItem,
|
|
10611
10636
|
{
|
|
10612
10637
|
icon: import_lucide_react15.AlignLeft,
|
|
@@ -10616,7 +10641,7 @@ var init_toolbar = __esm({
|
|
|
10616
10641
|
disabled: !isImageSelected
|
|
10617
10642
|
}
|
|
10618
10643
|
),
|
|
10619
|
-
/* @__PURE__ */ (0,
|
|
10644
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10620
10645
|
DropdownMenuItem,
|
|
10621
10646
|
{
|
|
10622
10647
|
icon: import_lucide_react15.AlignRight,
|
|
@@ -10626,8 +10651,8 @@ var init_toolbar = __esm({
|
|
|
10626
10651
|
disabled: !isImageSelected
|
|
10627
10652
|
}
|
|
10628
10653
|
),
|
|
10629
|
-
/* @__PURE__ */ (0,
|
|
10630
|
-
/* @__PURE__ */ (0,
|
|
10654
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "my-1 border-t" }),
|
|
10655
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10631
10656
|
DropdownMenuItem,
|
|
10632
10657
|
{
|
|
10633
10658
|
label: t("toolbar.imageWidthSm"),
|
|
@@ -10636,7 +10661,7 @@ var init_toolbar = __esm({
|
|
|
10636
10661
|
disabled: !isImageSelected
|
|
10637
10662
|
}
|
|
10638
10663
|
),
|
|
10639
|
-
/* @__PURE__ */ (0,
|
|
10664
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10640
10665
|
DropdownMenuItem,
|
|
10641
10666
|
{
|
|
10642
10667
|
label: t("toolbar.imageWidthMd"),
|
|
@@ -10645,7 +10670,7 @@ var init_toolbar = __esm({
|
|
|
10645
10670
|
disabled: !isImageSelected
|
|
10646
10671
|
}
|
|
10647
10672
|
),
|
|
10648
|
-
/* @__PURE__ */ (0,
|
|
10673
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10649
10674
|
DropdownMenuItem,
|
|
10650
10675
|
{
|
|
10651
10676
|
label: t("toolbar.imageWidthLg"),
|
|
@@ -10654,8 +10679,8 @@ var init_toolbar = __esm({
|
|
|
10654
10679
|
disabled: !isImageSelected
|
|
10655
10680
|
}
|
|
10656
10681
|
),
|
|
10657
|
-
/* @__PURE__ */ (0,
|
|
10658
|
-
/* @__PURE__ */ (0,
|
|
10682
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "my-1 border-t" }),
|
|
10683
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10659
10684
|
DropdownMenuItem,
|
|
10660
10685
|
{
|
|
10661
10686
|
icon: import_lucide_react15.RotateCcw,
|
|
@@ -10664,7 +10689,7 @@ var init_toolbar = __esm({
|
|
|
10664
10689
|
disabled: !isImageSelected
|
|
10665
10690
|
}
|
|
10666
10691
|
),
|
|
10667
|
-
/* @__PURE__ */ (0,
|
|
10692
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10668
10693
|
DropdownMenuItem,
|
|
10669
10694
|
{
|
|
10670
10695
|
icon: import_lucide_react15.Trash2,
|
|
@@ -10677,48 +10702,48 @@ var init_toolbar = __esm({
|
|
|
10677
10702
|
] })
|
|
10678
10703
|
}
|
|
10679
10704
|
),
|
|
10680
|
-
/* @__PURE__ */ (0,
|
|
10681
|
-
/* @__PURE__ */ (0,
|
|
10682
|
-
/* @__PURE__ */ (0,
|
|
10683
|
-
hasTableContext && /* @__PURE__ */ (0,
|
|
10684
|
-
/* @__PURE__ */ (0,
|
|
10685
|
-
/* @__PURE__ */ (0,
|
|
10705
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarDivider, {}),
|
|
10706
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().undo().run(), disabled: !editor.can().undo(), title: t("toolbar.undo"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaUndoIcon, { className: "h-4 w-4" }) }),
|
|
10707
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().redo().run(), disabled: !editor.can().redo(), title: t("toolbar.redo"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FigmaRedoIcon, { className: "h-4 w-4" }) }),
|
|
10708
|
+
hasTableContext && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
10709
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolbarDivider, {}),
|
|
10710
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10686
10711
|
ToolbarButton,
|
|
10687
10712
|
{
|
|
10688
10713
|
onClick: () => editor.chain().focus().addColumnBefore().run(),
|
|
10689
10714
|
disabled: !editor.can().addColumnBefore(),
|
|
10690
10715
|
title: t("tableMenu.addColumnBefore"),
|
|
10691
|
-
children: /* @__PURE__ */ (0,
|
|
10716
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.ArrowLeft, { className: "w-4 h-4" })
|
|
10692
10717
|
}
|
|
10693
10718
|
),
|
|
10694
|
-
/* @__PURE__ */ (0,
|
|
10719
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10695
10720
|
ToolbarButton,
|
|
10696
10721
|
{
|
|
10697
10722
|
onClick: () => editor.chain().focus().addColumnAfter().run(),
|
|
10698
10723
|
disabled: !editor.can().addColumnAfter(),
|
|
10699
10724
|
title: t("tableMenu.addColumnAfter"),
|
|
10700
|
-
children: /* @__PURE__ */ (0,
|
|
10725
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.ArrowRight, { className: "w-4 h-4" })
|
|
10701
10726
|
}
|
|
10702
10727
|
),
|
|
10703
|
-
/* @__PURE__ */ (0,
|
|
10728
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10704
10729
|
ToolbarButton,
|
|
10705
10730
|
{
|
|
10706
10731
|
onClick: () => editor.chain().focus().addRowBefore().run(),
|
|
10707
10732
|
disabled: !editor.can().addRowBefore(),
|
|
10708
10733
|
title: t("tableMenu.addRowBefore"),
|
|
10709
|
-
children: /* @__PURE__ */ (0,
|
|
10734
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.ArrowUp, { className: "w-4 h-4" })
|
|
10710
10735
|
}
|
|
10711
10736
|
),
|
|
10712
|
-
/* @__PURE__ */ (0,
|
|
10737
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10713
10738
|
ToolbarButton,
|
|
10714
10739
|
{
|
|
10715
10740
|
onClick: () => editor.chain().focus().addRowAfter().run(),
|
|
10716
10741
|
disabled: !editor.can().addRowAfter(),
|
|
10717
10742
|
title: t("tableMenu.addRowAfter"),
|
|
10718
|
-
children: /* @__PURE__ */ (0,
|
|
10743
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.ArrowDown, { className: "w-4 h-4" })
|
|
10719
10744
|
}
|
|
10720
10745
|
),
|
|
10721
|
-
/* @__PURE__ */ (0,
|
|
10746
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10722
10747
|
ToolbarButton,
|
|
10723
10748
|
{
|
|
10724
10749
|
onClick: () => {
|
|
@@ -10731,17 +10756,17 @@ var init_toolbar = __esm({
|
|
|
10731
10756
|
active: canSplitCell,
|
|
10732
10757
|
disabled: !canMergeCells && !canSplitCell,
|
|
10733
10758
|
title: canSplitCell ? t("tableMenu.splitCell") : t("tableMenu.mergeCells"),
|
|
10734
|
-
children: /* @__PURE__ */ (0,
|
|
10759
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.TableCellsMerge, { className: "w-4 h-4" })
|
|
10735
10760
|
}
|
|
10736
10761
|
)
|
|
10737
10762
|
] }),
|
|
10738
|
-
onToggleMenuBar && /* @__PURE__ */ (0,
|
|
10763
|
+
onToggleMenuBar && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10739
10764
|
ToolbarButton,
|
|
10740
10765
|
{
|
|
10741
10766
|
onClick: onToggleMenuBar,
|
|
10742
10767
|
active: isMenuBarVisible,
|
|
10743
10768
|
title: t(isMenuBarVisible ? "toolbar.hideMenuBar" : "toolbar.showMenuBar"),
|
|
10744
|
-
children: isMenuBarVisible ? /* @__PURE__ */ (0,
|
|
10769
|
+
children: isMenuBarVisible ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.PanelTopClose, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.PanelTopOpen, { className: "h-4 w-4" })
|
|
10745
10770
|
}
|
|
10746
10771
|
)
|
|
10747
10772
|
]
|
|
@@ -10982,7 +11007,7 @@ function unlockBodyScroll(body) {
|
|
|
10982
11007
|
body.style.overflow = current.overflow;
|
|
10983
11008
|
bodyScrollLocks.delete(body);
|
|
10984
11009
|
}
|
|
10985
|
-
var React33, import_react_dom4, import_lucide_react22,
|
|
11010
|
+
var React33, import_react_dom4, import_lucide_react22, import_jsx_runtime39, bodyScrollLocks, sizeStyles, Modal, Modal_default;
|
|
10986
11011
|
var init_Modal = __esm({
|
|
10987
11012
|
"src/components/Modal.tsx"() {
|
|
10988
11013
|
"use strict";
|
|
@@ -10994,7 +11019,7 @@ var init_Modal = __esm({
|
|
|
10994
11019
|
init_GlobalI18nContext();
|
|
10995
11020
|
init_radius();
|
|
10996
11021
|
init_UnderverseConfigContext();
|
|
10997
|
-
|
|
11022
|
+
import_jsx_runtime39 = require("react/jsx-runtime");
|
|
10998
11023
|
bodyScrollLocks = /* @__PURE__ */ new WeakMap();
|
|
10999
11024
|
sizeStyles = {
|
|
11000
11025
|
sm: "max-w-md",
|
|
@@ -11142,7 +11167,7 @@ var init_Modal = __esm({
|
|
|
11142
11167
|
return null;
|
|
11143
11168
|
}
|
|
11144
11169
|
const maxWidthClass = width ? "max-w-none" : fullWidth ? "max-w-full" : sizeStyles[size];
|
|
11145
|
-
const modalContent = /* @__PURE__ */ (0,
|
|
11170
|
+
const modalContent = /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
11146
11171
|
"div",
|
|
11147
11172
|
{
|
|
11148
11173
|
className: cn("fixed inset-0 z-[9999] flex items-center justify-center p-4 md:p-6", overlayClassName),
|
|
@@ -11150,7 +11175,7 @@ var init_Modal = __esm({
|
|
|
11150
11175
|
onMouseDown: handleOverlayMouseDown,
|
|
11151
11176
|
onMouseUp: handleOverlayMouseUp,
|
|
11152
11177
|
children: [
|
|
11153
|
-
/* @__PURE__ */ (0,
|
|
11178
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
11154
11179
|
"div",
|
|
11155
11180
|
{
|
|
11156
11181
|
className: "absolute inset-0 bg-background/80 backdrop-blur-sm transition-opacity duration-200 ease-out",
|
|
@@ -11159,7 +11184,7 @@ var init_Modal = __esm({
|
|
|
11159
11184
|
}
|
|
11160
11185
|
}
|
|
11161
11186
|
),
|
|
11162
|
-
/* @__PURE__ */ (0,
|
|
11187
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
11163
11188
|
"div",
|
|
11164
11189
|
{
|
|
11165
11190
|
ref: modalContentRef,
|
|
@@ -11185,12 +11210,12 @@ var init_Modal = __esm({
|
|
|
11185
11210
|
},
|
|
11186
11211
|
onClick: (e) => e.stopPropagation(),
|
|
11187
11212
|
children: [
|
|
11188
|
-
(title || description || showCloseButton) && /* @__PURE__ */ (0,
|
|
11189
|
-
/* @__PURE__ */ (0,
|
|
11190
|
-
title && /* @__PURE__ */ (0,
|
|
11191
|
-
description && /* @__PURE__ */ (0,
|
|
11213
|
+
(title || description || showCloseButton) && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-start justify-between p-6 pb-0", children: [
|
|
11214
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "space-y-1.5", children: [
|
|
11215
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h2", { id: titleId, className: "text-lg font-semibold leading-none tracking-tight text-balance", children: title }),
|
|
11216
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { id: descriptionId, className: "text-sm text-muted-foreground", children: description })
|
|
11192
11217
|
] }),
|
|
11193
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
11218
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
11194
11219
|
"button",
|
|
11195
11220
|
{
|
|
11196
11221
|
type: "button",
|
|
@@ -11201,11 +11226,11 @@ var init_Modal = __esm({
|
|
|
11201
11226
|
"hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
11202
11227
|
"disabled:pointer-events-none "
|
|
11203
11228
|
),
|
|
11204
|
-
children: /* @__PURE__ */ (0,
|
|
11229
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react22.X, { className: "h-4 w-4 cursor-pointer", "aria-hidden": "true" })
|
|
11205
11230
|
}
|
|
11206
11231
|
)
|
|
11207
11232
|
] }),
|
|
11208
|
-
/* @__PURE__ */ (0,
|
|
11233
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: cn("p-6", noPadding && "p-0", contentClassName), children })
|
|
11209
11234
|
]
|
|
11210
11235
|
}
|
|
11211
11236
|
)
|
|
@@ -11458,7 +11483,7 @@ function MenuTableInsertGrid({
|
|
|
11458
11483
|
onInsert
|
|
11459
11484
|
}) {
|
|
11460
11485
|
const closeMenu = useDropdownMenuClose();
|
|
11461
|
-
return /* @__PURE__ */ (0,
|
|
11486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11462
11487
|
TableInsertGrid,
|
|
11463
11488
|
{
|
|
11464
11489
|
insertLabel,
|
|
@@ -11474,9 +11499,9 @@ function renderMenuItems(items) {
|
|
|
11474
11499
|
return items.map((item, i) => {
|
|
11475
11500
|
switch (item.type) {
|
|
11476
11501
|
case "separator":
|
|
11477
|
-
return /* @__PURE__ */ (0,
|
|
11502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DropdownMenuSeparator, {}, i);
|
|
11478
11503
|
case "action":
|
|
11479
|
-
return /* @__PURE__ */ (0,
|
|
11504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11480
11505
|
DropdownMenuItem,
|
|
11481
11506
|
{
|
|
11482
11507
|
label: item.label,
|
|
@@ -11490,9 +11515,9 @@ function renderMenuItems(items) {
|
|
|
11490
11515
|
i
|
|
11491
11516
|
);
|
|
11492
11517
|
case "sub":
|
|
11493
|
-
return /* @__PURE__ */ (0,
|
|
11518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DropdownMenuSub, { label: item.label, icon: item.icon, disabled: item.disabled, children: renderMenuItems(item.items) }, i);
|
|
11494
11519
|
case "custom":
|
|
11495
|
-
return /* @__PURE__ */ (0,
|
|
11520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react48.default.Fragment, { children: item.render() }, item.key);
|
|
11496
11521
|
}
|
|
11497
11522
|
});
|
|
11498
11523
|
}
|
|
@@ -11801,7 +11826,7 @@ function buildTableMenuItems(t, editor, onInsertTable) {
|
|
|
11801
11826
|
{
|
|
11802
11827
|
type: "custom",
|
|
11803
11828
|
key: "table-insert-grid",
|
|
11804
|
-
render: () => /* @__PURE__ */ (0,
|
|
11829
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11805
11830
|
MenuTableInsertGrid,
|
|
11806
11831
|
{
|
|
11807
11832
|
insertLabel: t("tableMenu.insertTable"),
|
|
@@ -11875,7 +11900,7 @@ function buildTableMenuItems(t, editor, onInsertTable) {
|
|
|
11875
11900
|
}
|
|
11876
11901
|
];
|
|
11877
11902
|
}
|
|
11878
|
-
var import_react48, import_lucide_react23,
|
|
11903
|
+
var import_react48, import_lucide_react23, import_jsx_runtime40, MenuBarTrigger, MenuBar;
|
|
11879
11904
|
var init_menu_bar = __esm({
|
|
11880
11905
|
"src/components/UEditor/menu-bar.tsx"() {
|
|
11881
11906
|
"use strict";
|
|
@@ -11896,9 +11921,9 @@ var init_menu_bar = __esm({
|
|
|
11896
11921
|
init_portal_context();
|
|
11897
11922
|
init_async_insertion_position();
|
|
11898
11923
|
init_image_file_upload();
|
|
11899
|
-
|
|
11924
|
+
import_jsx_runtime40 = require("react/jsx-runtime");
|
|
11900
11925
|
MenuBarTrigger = import_react48.default.forwardRef(
|
|
11901
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
11926
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11902
11927
|
"button",
|
|
11903
11928
|
{
|
|
11904
11929
|
ref,
|
|
@@ -12048,9 +12073,9 @@ var init_menu_bar = __esm({
|
|
|
12048
12073
|
{
|
|
12049
12074
|
type: "custom",
|
|
12050
12075
|
key: "image",
|
|
12051
|
-
render: () => showImageInput ? /* @__PURE__ */ (0,
|
|
12052
|
-
/* @__PURE__ */ (0,
|
|
12053
|
-
/* @__PURE__ */ (0,
|
|
12076
|
+
render: () => showImageInput ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ImageInput, { onSubmit: handleImageUrl, onCancel: () => setShowImageInput(false) }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
12077
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DropdownMenuItem, { label: t("menubar.image"), icon: import_lucide_react23.Image, onClick: () => setShowImageInput(true), closeOnSelect: false }),
|
|
12078
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12054
12079
|
DropdownMenuItem,
|
|
12055
12080
|
{
|
|
12056
12081
|
label: isUploadingImage ? t("imageInput.uploading") : t("menubar.imageUpload"),
|
|
@@ -12060,14 +12085,14 @@ var init_menu_bar = __esm({
|
|
|
12060
12085
|
disabled: isUploadingImage
|
|
12061
12086
|
}
|
|
12062
12087
|
),
|
|
12063
|
-
imageUploadError ? /* @__PURE__ */ (0,
|
|
12088
|
+
imageUploadError ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DropdownMenuItem, { label: imageUploadError, disabled: true, destructive: true }) : null
|
|
12064
12089
|
] })
|
|
12065
12090
|
},
|
|
12066
12091
|
{ type: "separator" },
|
|
12067
12092
|
{
|
|
12068
12093
|
type: "custom",
|
|
12069
12094
|
key: "link",
|
|
12070
|
-
render: () => showLinkInput ? /* @__PURE__ */ (0,
|
|
12095
|
+
render: () => showLinkInput ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(LinkInput, { onSubmit: handleLinkSubmit, onCancel: () => setShowLinkInput(false), initialUrl: editor.getAttributes("link").href ?? "" }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12071
12096
|
DropdownMenuItem,
|
|
12072
12097
|
{
|
|
12073
12098
|
label: t("menubar.link"),
|
|
@@ -12087,7 +12112,7 @@ var init_menu_bar = __esm({
|
|
|
12087
12112
|
{
|
|
12088
12113
|
type: "custom",
|
|
12089
12114
|
key: "table-grid",
|
|
12090
|
-
render: () => /* @__PURE__ */ (0,
|
|
12115
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12091
12116
|
MenuTableInsertGrid,
|
|
12092
12117
|
{
|
|
12093
12118
|
insertLabel: t("tableMenu.insertTable"),
|
|
@@ -12162,8 +12187,8 @@ var init_menu_bar = __esm({
|
|
|
12162
12187
|
},
|
|
12163
12188
|
{ key: "table", label: t("menubar.table"), items: buildTableMenuItems(t, editor, handleInsertTable) }
|
|
12164
12189
|
];
|
|
12165
|
-
return /* @__PURE__ */ (0,
|
|
12166
|
-
/* @__PURE__ */ (0,
|
|
12190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
12191
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12167
12192
|
"input",
|
|
12168
12193
|
{
|
|
12169
12194
|
ref: fileInputRef,
|
|
@@ -12178,11 +12203,11 @@ var init_menu_bar = __esm({
|
|
|
12178
12203
|
}
|
|
12179
12204
|
}
|
|
12180
12205
|
),
|
|
12181
|
-
/* @__PURE__ */ (0,
|
|
12182
|
-
menus.map(({ key, label, items }) => /* @__PURE__ */ (0,
|
|
12206
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.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: [
|
|
12207
|
+
menus.map(({ key, label, items }) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12183
12208
|
DropdownMenu,
|
|
12184
12209
|
{
|
|
12185
|
-
trigger: /* @__PURE__ */ (0,
|
|
12210
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(MenuBarTrigger, { children: label }),
|
|
12186
12211
|
placement: "bottom-start",
|
|
12187
12212
|
isOpen: openMenuKey === key,
|
|
12188
12213
|
onOpenChange: (open) => {
|
|
@@ -12197,7 +12222,7 @@ var init_menu_bar = __esm({
|
|
|
12197
12222
|
},
|
|
12198
12223
|
key
|
|
12199
12224
|
)),
|
|
12200
|
-
showPreviewButton && /* @__PURE__ */ (0,
|
|
12225
|
+
showPreviewButton && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12201
12226
|
"button",
|
|
12202
12227
|
{
|
|
12203
12228
|
type: "button",
|
|
@@ -12208,11 +12233,11 @@ var init_menu_bar = __esm({
|
|
|
12208
12233
|
"ml-auto inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors",
|
|
12209
12234
|
"hover:bg-accent hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1"
|
|
12210
12235
|
),
|
|
12211
|
-
children: /* @__PURE__ */ (0,
|
|
12236
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react23.Eye, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
12212
12237
|
}
|
|
12213
12238
|
)
|
|
12214
12239
|
] }),
|
|
12215
|
-
/* @__PURE__ */ (0,
|
|
12240
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12216
12241
|
Modal_default,
|
|
12217
12242
|
{
|
|
12218
12243
|
isOpen: showSourceDialog,
|
|
@@ -12220,9 +12245,9 @@ var init_menu_bar = __esm({
|
|
|
12220
12245
|
title: t("menubar.sourceCode"),
|
|
12221
12246
|
size: "lg",
|
|
12222
12247
|
portalContainer: modalPortalContainer,
|
|
12223
|
-
children: /* @__PURE__ */ (0,
|
|
12224
|
-
/* @__PURE__ */ (0,
|
|
12225
|
-
/* @__PURE__ */ (0,
|
|
12248
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "space-y-3", children: [
|
|
12249
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-xs text-muted-foreground", children: t("menubar.sourceCodeHint") }),
|
|
12250
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12226
12251
|
"textarea",
|
|
12227
12252
|
{
|
|
12228
12253
|
ref: sourceTextareaRef,
|
|
@@ -12240,9 +12265,9 @@ var init_menu_bar = __esm({
|
|
|
12240
12265
|
spellCheck: false
|
|
12241
12266
|
}
|
|
12242
12267
|
),
|
|
12243
|
-
sourceError ? /* @__PURE__ */ (0,
|
|
12244
|
-
/* @__PURE__ */ (0,
|
|
12245
|
-
/* @__PURE__ */ (0,
|
|
12268
|
+
sourceError ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { id: sourceErrorId, role: "alert", className: "text-xs text-destructive", children: sourceError }) : null,
|
|
12269
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex gap-2 justify-end", children: [
|
|
12270
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12246
12271
|
"button",
|
|
12247
12272
|
{
|
|
12248
12273
|
type: "button",
|
|
@@ -12251,7 +12276,7 @@ var init_menu_bar = __esm({
|
|
|
12251
12276
|
children: t("menubar.applySource")
|
|
12252
12277
|
}
|
|
12253
12278
|
),
|
|
12254
|
-
/* @__PURE__ */ (0,
|
|
12279
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12255
12280
|
"button",
|
|
12256
12281
|
{
|
|
12257
12282
|
type: "button",
|
|
@@ -12264,7 +12289,7 @@ var init_menu_bar = __esm({
|
|
|
12264
12289
|
] })
|
|
12265
12290
|
}
|
|
12266
12291
|
),
|
|
12267
|
-
/* @__PURE__ */ (0,
|
|
12292
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12268
12293
|
Modal_default,
|
|
12269
12294
|
{
|
|
12270
12295
|
isOpen: showPreviewDialog,
|
|
@@ -12276,12 +12301,12 @@ var init_menu_bar = __esm({
|
|
|
12276
12301
|
height: "min(860px, calc(100vh - 2rem))",
|
|
12277
12302
|
className: "flex flex-col overflow-hidden rounded-xl md:rounded-2xl",
|
|
12278
12303
|
contentClassName: "flex min-h-0 flex-1 overflow-hidden p-0",
|
|
12279
|
-
children: /* @__PURE__ */ (0,
|
|
12304
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12280
12305
|
"div",
|
|
12281
12306
|
{
|
|
12282
12307
|
"data-testid": "preview-content",
|
|
12283
12308
|
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain",
|
|
12284
|
-
children: editor.isEmpty ? /* @__PURE__ */ (0,
|
|
12309
|
+
children: editor.isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-muted-foreground text-sm", children: t("menubar.previewEmpty") }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12285
12310
|
"div",
|
|
12286
12311
|
{
|
|
12287
12312
|
className: UEDITOR_PROSEMIRROR_CLASS_NAME,
|
|
@@ -17860,7 +17885,8 @@ function subscribeSharedGlobalEvent(target, type, listener, options) {
|
|
|
17860
17885
|
|
|
17861
17886
|
// src/components/UEditor/menus.tsx
|
|
17862
17887
|
init_portal_context();
|
|
17863
|
-
|
|
17888
|
+
init_table_vertical_align_icons();
|
|
17889
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
17864
17890
|
var FloatingSlashCommandMenu = ({ editor, onClose }) => {
|
|
17865
17891
|
const t = useSmartTranslations("UEditor");
|
|
17866
17892
|
const messages = (0, import_react40.useMemo)(() => buildSlashCommandMessages(t), [t]);
|
|
@@ -17883,7 +17909,7 @@ var FloatingSlashCommandMenu = ({ editor, onClose }) => {
|
|
|
17883
17909
|
if (!portalDocument) return;
|
|
17884
17910
|
return subscribeSharedGlobalEvent(portalDocument, "keydown", handleKeyDown2);
|
|
17885
17911
|
}, [onClose, portalDocument]);
|
|
17886
|
-
return /* @__PURE__ */ (0,
|
|
17912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
17887
17913
|
SlashCommandList,
|
|
17888
17914
|
{
|
|
17889
17915
|
ref: listRef,
|
|
@@ -17900,17 +17926,17 @@ var FloatingMenuContent = ({ editor }) => {
|
|
|
17900
17926
|
const t = useSmartTranslations("UEditor");
|
|
17901
17927
|
const [showCommands, setShowCommands] = (0, import_react40.useState)(false);
|
|
17902
17928
|
if (showCommands) {
|
|
17903
|
-
return /* @__PURE__ */ (0,
|
|
17929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FloatingSlashCommandMenu, { editor, onClose: () => setShowCommands(false) });
|
|
17904
17930
|
}
|
|
17905
|
-
return /* @__PURE__ */ (0,
|
|
17931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
17906
17932
|
"button",
|
|
17907
17933
|
{
|
|
17908
17934
|
type: "button",
|
|
17909
17935
|
onClick: () => setShowCommands(true),
|
|
17910
17936
|
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",
|
|
17911
17937
|
children: [
|
|
17912
|
-
/* @__PURE__ */ (0,
|
|
17913
|
-
/* @__PURE__ */ (0,
|
|
17938
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Plus, { className: "w-4 h-4 text-muted-foreground group-hover:text-foreground" }),
|
|
17939
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-sm text-muted-foreground group-hover:text-foreground", children: t("floatingMenu.addBlock") })
|
|
17914
17940
|
]
|
|
17915
17941
|
}
|
|
17916
17942
|
);
|
|
@@ -17942,7 +17968,7 @@ function applyTableCellAttribute2(editor, name, value, options = {}) {
|
|
|
17942
17968
|
}
|
|
17943
17969
|
function BorderStylePreviewIcon({ style }) {
|
|
17944
17970
|
const isNone = style === "none";
|
|
17945
|
-
return /* @__PURE__ */ (0,
|
|
17971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
17946
17972
|
"span",
|
|
17947
17973
|
{
|
|
17948
17974
|
"aria-hidden": "true",
|
|
@@ -17954,7 +17980,7 @@ function BorderStylePreviewIcon({ style }) {
|
|
|
17954
17980
|
borderStyle: style,
|
|
17955
17981
|
borderWidth: style === "double" ? 3 : 2
|
|
17956
17982
|
},
|
|
17957
|
-
children: isNone && /* @__PURE__ */ (0,
|
|
17983
|
+
children: isNone && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "absolute left-1/2 top-0 h-full w-px -translate-x-1/2 rotate-45 bg-muted-foreground/70" })
|
|
17958
17984
|
}
|
|
17959
17985
|
);
|
|
17960
17986
|
}
|
|
@@ -17965,8 +17991,8 @@ function BorderPositionPreviewIcon({ position }) {
|
|
|
17965
17991
|
const showLeft = position === "all" || position === "outer" || position === "left";
|
|
17966
17992
|
const showHorizontal = position === "all" || position === "inner" || position === "horizontal";
|
|
17967
17993
|
const showVertical = position === "all" || position === "inner" || position === "vertical";
|
|
17968
|
-
return /* @__PURE__ */ (0,
|
|
17969
|
-
/* @__PURE__ */ (0,
|
|
17994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 20 20", className: "h-5 w-5 fill-none stroke-current", children: [
|
|
17995
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
17970
17996
|
"path",
|
|
17971
17997
|
{
|
|
17972
17998
|
d: "M2 2H18V18H2Z M2 10H18 M10 2V18",
|
|
@@ -17976,12 +18002,12 @@ function BorderPositionPreviewIcon({ position }) {
|
|
|
17976
18002
|
strokeWidth: "1.25"
|
|
17977
18003
|
}
|
|
17978
18004
|
),
|
|
17979
|
-
showTop && /* @__PURE__ */ (0,
|
|
17980
|
-
showRight && /* @__PURE__ */ (0,
|
|
17981
|
-
showBottom && /* @__PURE__ */ (0,
|
|
17982
|
-
showLeft && /* @__PURE__ */ (0,
|
|
17983
|
-
showHorizontal && /* @__PURE__ */ (0,
|
|
17984
|
-
showVertical && /* @__PURE__ */ (0,
|
|
18005
|
+
showTop && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M2 2H18", strokeWidth: "2" }),
|
|
18006
|
+
showRight && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M18 2V18", strokeWidth: "2" }),
|
|
18007
|
+
showBottom && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M2 18H18", strokeWidth: "2" }),
|
|
18008
|
+
showLeft && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M2 2V18", strokeWidth: "2" }),
|
|
18009
|
+
showHorizontal && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M2 10H18", strokeWidth: "2" }),
|
|
18010
|
+
showVertical && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M10 2V18", strokeWidth: "2" })
|
|
17985
18011
|
] });
|
|
17986
18012
|
}
|
|
17987
18013
|
function getBubbleMenuPosition({
|
|
@@ -18213,7 +18239,7 @@ var BubbleMenuContent = ({
|
|
|
18213
18239
|
};
|
|
18214
18240
|
}, [editor, showLinkInput]);
|
|
18215
18241
|
if (showLinkInput) {
|
|
18216
|
-
return /* @__PURE__ */ (0,
|
|
18242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18217
18243
|
LinkInput,
|
|
18218
18244
|
{
|
|
18219
18245
|
initialUrl: editor.getAttributes("link").href || "",
|
|
@@ -18233,12 +18259,12 @@ var BubbleMenuContent = ({
|
|
|
18233
18259
|
const isTextPalette = activeColorPalette === "text";
|
|
18234
18260
|
const isHighlightPalette = activeColorPalette === "highlight";
|
|
18235
18261
|
if (activeColorPalette === "cell-border") {
|
|
18236
|
-
return /* @__PURE__ */ (0,
|
|
18237
|
-
/* @__PURE__ */ (0,
|
|
18238
|
-
/* @__PURE__ */ (0,
|
|
18239
|
-
/* @__PURE__ */ (0,
|
|
18240
|
-
/* @__PURE__ */ (0,
|
|
18241
|
-
/* @__PURE__ */ (0,
|
|
18262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex w-72 flex-col gap-2 p-2 text-sm", "data-ueditor-keep-open": true, children: [
|
|
18263
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "font-semibold text-xs text-muted-foreground uppercase tracking-wider mb-1", children: t("tableMenu.cellBorder") || "Cell Borders" }),
|
|
18264
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex gap-2", children: [
|
|
18265
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
18266
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { className: "mb-1 block text-xs text-muted-foreground", children: t("tableMenu.borderPosition") || "Border placement" }),
|
|
18267
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "grid grid-cols-5 gap-1", role: "group", "aria-label": t("tableMenu.borderPosition") || "Border placement", children: [
|
|
18242
18268
|
[
|
|
18243
18269
|
["all", "borderAll"],
|
|
18244
18270
|
["outer", "borderOuter"],
|
|
@@ -18251,7 +18277,7 @@ var BubbleMenuContent = ({
|
|
|
18251
18277
|
["left", "borderLeft"]
|
|
18252
18278
|
].map(([position, labelKey]) => {
|
|
18253
18279
|
const label = t(`tableMenu.${labelKey}`) || position;
|
|
18254
|
-
return /* @__PURE__ */ (0,
|
|
18280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18255
18281
|
"button",
|
|
18256
18282
|
{
|
|
18257
18283
|
type: "button",
|
|
@@ -18263,12 +18289,12 @@ var BubbleMenuContent = ({
|
|
|
18263
18289
|
"inline-flex h-8 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted hover:text-primary",
|
|
18264
18290
|
activeBorderPosition === position ? "bg-primary/10 text-primary" : "bg-muted/40"
|
|
18265
18291
|
),
|
|
18266
|
-
children: /* @__PURE__ */ (0,
|
|
18292
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(BorderPositionPreviewIcon, { position })
|
|
18267
18293
|
},
|
|
18268
18294
|
position
|
|
18269
18295
|
);
|
|
18270
18296
|
}),
|
|
18271
|
-
/* @__PURE__ */ (0,
|
|
18297
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18272
18298
|
"button",
|
|
18273
18299
|
{
|
|
18274
18300
|
type: "button",
|
|
@@ -18277,13 +18303,13 @@ var BubbleMenuContent = ({
|
|
|
18277
18303
|
onMouseDown: (event) => event.preventDefault(),
|
|
18278
18304
|
onClick: clearTableCellBorders,
|
|
18279
18305
|
className: "inline-flex h-8 items-center justify-center rounded-md bg-muted/40 text-destructive transition-colors hover:bg-destructive/10",
|
|
18280
|
-
children: /* @__PURE__ */ (0,
|
|
18306
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(BorderStylePreviewIcon, { style: "none" })
|
|
18281
18307
|
}
|
|
18282
18308
|
)
|
|
18283
18309
|
] })
|
|
18284
18310
|
] }),
|
|
18285
|
-
/* @__PURE__ */ (0,
|
|
18286
|
-
/* @__PURE__ */ (0,
|
|
18311
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.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: [
|
|
18312
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18287
18313
|
"button",
|
|
18288
18314
|
{
|
|
18289
18315
|
type: "button",
|
|
@@ -18295,10 +18321,10 @@ var BubbleMenuContent = ({
|
|
|
18295
18321
|
"inline-flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:bg-muted",
|
|
18296
18322
|
borderEditMode === "draw" ? "bg-primary/10 text-primary" : "text-muted-foreground"
|
|
18297
18323
|
),
|
|
18298
|
-
children: /* @__PURE__ */ (0,
|
|
18324
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Edit2, { className: "h-4 w-4" })
|
|
18299
18325
|
}
|
|
18300
18326
|
),
|
|
18301
|
-
/* @__PURE__ */ (0,
|
|
18327
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18302
18328
|
"button",
|
|
18303
18329
|
{
|
|
18304
18330
|
type: "button",
|
|
@@ -18310,19 +18336,19 @@ var BubbleMenuContent = ({
|
|
|
18310
18336
|
"inline-flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:bg-muted",
|
|
18311
18337
|
borderEditMode === "erase" ? "bg-destructive/10 text-destructive" : "text-muted-foreground"
|
|
18312
18338
|
),
|
|
18313
|
-
children: /* @__PURE__ */ (0,
|
|
18339
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Eraser, { className: "h-4 w-4" })
|
|
18314
18340
|
}
|
|
18315
18341
|
)
|
|
18316
18342
|
] })
|
|
18317
18343
|
] }),
|
|
18318
|
-
/* @__PURE__ */ (0,
|
|
18319
|
-
/* @__PURE__ */ (0,
|
|
18320
|
-
/* @__PURE__ */ (0,
|
|
18344
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
18345
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderStyle") || "Border Style" }),
|
|
18346
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "grid grid-cols-4 gap-1.5", role: "group", "aria-label": t("tableMenu.borderStyle") || "Border Style", children: [
|
|
18321
18347
|
["solid", "Solid"],
|
|
18322
18348
|
["dashed", "Dashed"],
|
|
18323
18349
|
["dotted", "Dotted"],
|
|
18324
18350
|
["double", "Double"]
|
|
18325
|
-
].map(([style, label]) => /* @__PURE__ */ (0,
|
|
18351
|
+
].map(([style, label]) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
18326
18352
|
"button",
|
|
18327
18353
|
{
|
|
18328
18354
|
type: "button",
|
|
@@ -18333,16 +18359,16 @@ var BubbleMenuContent = ({
|
|
|
18333
18359
|
borderStyleDraft === style ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
|
|
18334
18360
|
),
|
|
18335
18361
|
children: [
|
|
18336
|
-
/* @__PURE__ */ (0,
|
|
18337
|
-
/* @__PURE__ */ (0,
|
|
18362
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(BorderStylePreviewIcon, { style }),
|
|
18363
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: label })
|
|
18338
18364
|
]
|
|
18339
18365
|
},
|
|
18340
18366
|
style
|
|
18341
18367
|
)) })
|
|
18342
18368
|
] }),
|
|
18343
|
-
/* @__PURE__ */ (0,
|
|
18344
|
-
/* @__PURE__ */ (0,
|
|
18345
|
-
/* @__PURE__ */ (0,
|
|
18369
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
18370
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderWidth") || "Border Width" }),
|
|
18371
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.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_runtime30.jsx)(
|
|
18346
18372
|
"button",
|
|
18347
18373
|
{
|
|
18348
18374
|
type: "button",
|
|
@@ -18357,15 +18383,15 @@ var BubbleMenuContent = ({
|
|
|
18357
18383
|
width
|
|
18358
18384
|
)) })
|
|
18359
18385
|
] }),
|
|
18360
|
-
/* @__PURE__ */ (0,
|
|
18386
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
18361
18387
|
"button",
|
|
18362
18388
|
{
|
|
18363
18389
|
type: "button",
|
|
18364
18390
|
onClick: () => setActiveColorPalette("cell-border-color"),
|
|
18365
18391
|
className: "flex items-center justify-between w-full h-8 px-2 rounded-md border border-input hover:bg-accent text-xs",
|
|
18366
18392
|
children: [
|
|
18367
|
-
/* @__PURE__ */ (0,
|
|
18368
|
-
/* @__PURE__ */ (0,
|
|
18393
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: t("tableMenu.borderColor") || "Border Color" }),
|
|
18394
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18369
18395
|
"span",
|
|
18370
18396
|
{
|
|
18371
18397
|
className: "w-4 h-4 rounded-full border border-border",
|
|
@@ -18380,7 +18406,7 @@ var BubbleMenuContent = ({
|
|
|
18380
18406
|
] });
|
|
18381
18407
|
}
|
|
18382
18408
|
if (activeColorPalette === "cell-border-color") {
|
|
18383
|
-
return /* @__PURE__ */ (0,
|
|
18409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18384
18410
|
EditorColorPalette,
|
|
18385
18411
|
{
|
|
18386
18412
|
colors: borderColors,
|
|
@@ -18390,7 +18416,7 @@ var BubbleMenuContent = ({
|
|
|
18390
18416
|
}
|
|
18391
18417
|
) });
|
|
18392
18418
|
}
|
|
18393
|
-
return /* @__PURE__ */ (0,
|
|
18419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18394
18420
|
EditorColorPalette,
|
|
18395
18421
|
{
|
|
18396
18422
|
colors: isTextPalette ? textColors : highlightColors,
|
|
@@ -18402,32 +18428,32 @@ var BubbleMenuContent = ({
|
|
|
18402
18428
|
) });
|
|
18403
18429
|
}
|
|
18404
18430
|
if (isImageSelected) {
|
|
18405
|
-
return /* @__PURE__ */ (0,
|
|
18406
|
-
/* @__PURE__ */ (0,
|
|
18407
|
-
/* @__PURE__ */ (0,
|
|
18408
|
-
/* @__PURE__ */ (0,
|
|
18409
|
-
/* @__PURE__ */ (0,
|
|
18410
|
-
/* @__PURE__ */ (0,
|
|
18411
|
-
/* @__PURE__ */ (0,
|
|
18412
|
-
/* @__PURE__ */ (0,
|
|
18413
|
-
/* @__PURE__ */ (0,
|
|
18414
|
-
/* @__PURE__ */ (0,
|
|
18415
|
-
/* @__PURE__ */ (0,
|
|
18431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-0.5 p-1", children: [
|
|
18432
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: () => applyImageLayout(editor, "block"), active: imageLayout === "block", title: t("toolbar.imageLayoutBlock"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.AlignCenter, { className: "w-4 h-4" }) }),
|
|
18433
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: () => applyImageLayout(editor, "left"), active: imageLayout === "left", title: t("toolbar.imageLayoutLeft"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.AlignLeft, { className: "w-4 h-4" }) }),
|
|
18434
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: () => applyImageLayout(editor, "right"), active: imageLayout === "right", title: t("toolbar.imageLayoutRight"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.AlignRight, { className: "w-4 h-4" }) }),
|
|
18435
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
18436
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "sm"), active: imageWidthPreset === "sm", title: t("toolbar.imageWidthSm"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-[10px] font-semibold", children: "S" }) }),
|
|
18437
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "md"), active: imageWidthPreset === "md", title: t("toolbar.imageWidthMd"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-[10px] font-semibold", children: "M" }) }),
|
|
18438
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "lg"), active: imageWidthPreset === "lg", title: t("toolbar.imageWidthLg"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-[10px] font-semibold", children: "L" }) }),
|
|
18439
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
18440
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: () => resetImageSize(editor), title: t("toolbar.imageResetSize"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.RotateCcw, { className: "w-4 h-4" }) }),
|
|
18441
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18416
18442
|
ToolbarButton,
|
|
18417
18443
|
{
|
|
18418
18444
|
onClick: () => deleteSelectedImage(editor),
|
|
18419
18445
|
title: t("toolbar.imageDelete"),
|
|
18420
18446
|
className: "text-destructive hover:text-destructive",
|
|
18421
|
-
children: /* @__PURE__ */ (0,
|
|
18447
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Trash2, { className: "w-4 h-4" })
|
|
18422
18448
|
}
|
|
18423
18449
|
)
|
|
18424
18450
|
] });
|
|
18425
18451
|
}
|
|
18426
18452
|
if (showFormulaPanel && isInTable3) {
|
|
18427
|
-
return /* @__PURE__ */ (0,
|
|
18428
|
-
/* @__PURE__ */ (0,
|
|
18429
|
-
/* @__PURE__ */ (0,
|
|
18430
|
-
/* @__PURE__ */ (0,
|
|
18453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "w-72 p-2", children: [
|
|
18454
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
|
|
18455
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("tableMenu.formula") || "Formula" }),
|
|
18456
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18431
18457
|
"button",
|
|
18432
18458
|
{
|
|
18433
18459
|
type: "button",
|
|
@@ -18440,7 +18466,7 @@ var BubbleMenuContent = ({
|
|
|
18440
18466
|
}
|
|
18441
18467
|
)
|
|
18442
18468
|
] }),
|
|
18443
|
-
/* @__PURE__ */ (0,
|
|
18469
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: cn("flex h-9 items-center overflow-hidden rounded-md bg-muted/40", formControlGroupOutlineClass), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18444
18470
|
"input",
|
|
18445
18471
|
{
|
|
18446
18472
|
value: formulaDraft,
|
|
@@ -18461,15 +18487,15 @@ var BubbleMenuContent = ({
|
|
|
18461
18487
|
className: "h-full min-w-0 flex-1 bg-transparent px-2 text-sm font-medium text-foreground outline-none"
|
|
18462
18488
|
}
|
|
18463
18489
|
) }),
|
|
18464
|
-
/* @__PURE__ */ (0,
|
|
18465
|
-
/* @__PURE__ */ (0,
|
|
18466
|
-
/* @__PURE__ */ (0,
|
|
18490
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mt-2", children: [
|
|
18491
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("tableMenu.numberFormat") || "Number format" }),
|
|
18492
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "grid grid-cols-5 gap-1", children: [
|
|
18467
18493
|
["text", "Text"],
|
|
18468
18494
|
["number", "123"],
|
|
18469
18495
|
["currency", "$"],
|
|
18470
18496
|
["percent", "%"],
|
|
18471
18497
|
["date", "Date"]
|
|
18472
|
-
].map(([format, label]) => /* @__PURE__ */ (0,
|
|
18498
|
+
].map(([format, label]) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18473
18499
|
"button",
|
|
18474
18500
|
{
|
|
18475
18501
|
type: "button",
|
|
@@ -18483,8 +18509,8 @@ var BubbleMenuContent = ({
|
|
|
18483
18509
|
format
|
|
18484
18510
|
)) })
|
|
18485
18511
|
] }),
|
|
18486
|
-
/* @__PURE__ */ (0,
|
|
18487
|
-
/* @__PURE__ */ (0,
|
|
18512
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mt-2 grid grid-cols-3 gap-1", children: [
|
|
18513
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18488
18514
|
"button",
|
|
18489
18515
|
{
|
|
18490
18516
|
type: "button",
|
|
@@ -18497,7 +18523,7 @@ var BubbleMenuContent = ({
|
|
|
18497
18523
|
children: t("tableMenu.apply") || "Apply"
|
|
18498
18524
|
}
|
|
18499
18525
|
),
|
|
18500
|
-
/* @__PURE__ */ (0,
|
|
18526
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18501
18527
|
"button",
|
|
18502
18528
|
{
|
|
18503
18529
|
type: "button",
|
|
@@ -18509,7 +18535,7 @@ var BubbleMenuContent = ({
|
|
|
18509
18535
|
children: t("tableMenu.clear") || "Clear"
|
|
18510
18536
|
}
|
|
18511
18537
|
),
|
|
18512
|
-
/* @__PURE__ */ (0,
|
|
18538
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18513
18539
|
"button",
|
|
18514
18540
|
{
|
|
18515
18541
|
type: "button",
|
|
@@ -18522,10 +18548,10 @@ var BubbleMenuContent = ({
|
|
|
18522
18548
|
] });
|
|
18523
18549
|
}
|
|
18524
18550
|
if (showTypographyPanel) {
|
|
18525
|
-
return /* @__PURE__ */ (0,
|
|
18526
|
-
/* @__PURE__ */ (0,
|
|
18527
|
-
/* @__PURE__ */ (0,
|
|
18528
|
-
/* @__PURE__ */ (0,
|
|
18551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "w-72 p-2", children: [
|
|
18552
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
|
|
18553
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("toolbar.textStyle") }),
|
|
18554
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18529
18555
|
"button",
|
|
18530
18556
|
{
|
|
18531
18557
|
type: "button",
|
|
@@ -18535,11 +18561,11 @@ var BubbleMenuContent = ({
|
|
|
18535
18561
|
}
|
|
18536
18562
|
)
|
|
18537
18563
|
] }),
|
|
18538
|
-
/* @__PURE__ */ (0,
|
|
18539
|
-
/* @__PURE__ */ (0,
|
|
18540
|
-
/* @__PURE__ */ (0,
|
|
18541
|
-
/* @__PURE__ */ (0,
|
|
18542
|
-
/* @__PURE__ */ (0,
|
|
18564
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "space-y-2", children: [
|
|
18565
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
|
|
18566
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.fontSize") }),
|
|
18567
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: cn("flex h-9 items-center overflow-hidden rounded-md bg-muted/40", formControlGroupOutlineClass), children: [
|
|
18568
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18543
18569
|
"input",
|
|
18544
18570
|
{
|
|
18545
18571
|
type: "number",
|
|
@@ -18563,8 +18589,8 @@ var BubbleMenuContent = ({
|
|
|
18563
18589
|
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"
|
|
18564
18590
|
}
|
|
18565
18591
|
),
|
|
18566
|
-
/* @__PURE__ */ (0,
|
|
18567
|
-
/* @__PURE__ */ (0,
|
|
18592
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "border-l border-border/50 px-2 text-[11px] text-muted-foreground", children: "px" }),
|
|
18593
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18568
18594
|
"button",
|
|
18569
18595
|
{
|
|
18570
18596
|
type: "button",
|
|
@@ -18574,12 +18600,12 @@ var BubbleMenuContent = ({
|
|
|
18574
18600
|
"flex h-full w-9 items-center justify-center border-l border-border/50 transition-colors hover:bg-muted",
|
|
18575
18601
|
showFontSizeOptions && "bg-primary/10 text-primary"
|
|
18576
18602
|
),
|
|
18577
|
-
children: /* @__PURE__ */ (0,
|
|
18603
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.ChevronDown, { className: "h-4 w-4" })
|
|
18578
18604
|
}
|
|
18579
18605
|
)
|
|
18580
18606
|
] }),
|
|
18581
|
-
showFontSizeOptions && /* @__PURE__ */ (0,
|
|
18582
|
-
/* @__PURE__ */ (0,
|
|
18607
|
+
showFontSizeOptions && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mt-1 grid grid-cols-4 gap-1", children: [
|
|
18608
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18583
18609
|
"button",
|
|
18584
18610
|
{
|
|
18585
18611
|
type: "button",
|
|
@@ -18594,7 +18620,7 @@ var BubbleMenuContent = ({
|
|
|
18594
18620
|
children: "A"
|
|
18595
18621
|
}
|
|
18596
18622
|
),
|
|
18597
|
-
quickFontSizes.map((option) => /* @__PURE__ */ (0,
|
|
18623
|
+
quickFontSizes.map((option) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18598
18624
|
"button",
|
|
18599
18625
|
{
|
|
18600
18626
|
type: "button",
|
|
@@ -18612,10 +18638,10 @@ var BubbleMenuContent = ({
|
|
|
18612
18638
|
))
|
|
18613
18639
|
] })
|
|
18614
18640
|
] }),
|
|
18615
|
-
/* @__PURE__ */ (0,
|
|
18616
|
-
/* @__PURE__ */ (0,
|
|
18617
|
-
/* @__PURE__ */ (0,
|
|
18618
|
-
/* @__PURE__ */ (0,
|
|
18641
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
|
|
18642
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.lineHeight") }),
|
|
18643
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "grid grid-cols-4 gap-1", children: [
|
|
18644
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18619
18645
|
"button",
|
|
18620
18646
|
{
|
|
18621
18647
|
type: "button",
|
|
@@ -18627,7 +18653,7 @@ var BubbleMenuContent = ({
|
|
|
18627
18653
|
children: "LH"
|
|
18628
18654
|
}
|
|
18629
18655
|
),
|
|
18630
|
-
quickLineHeights.map((option) => /* @__PURE__ */ (0,
|
|
18656
|
+
quickLineHeights.map((option) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18631
18657
|
"button",
|
|
18632
18658
|
{
|
|
18633
18659
|
type: "button",
|
|
@@ -18642,8 +18668,8 @@ var BubbleMenuContent = ({
|
|
|
18642
18668
|
))
|
|
18643
18669
|
] })
|
|
18644
18670
|
] }),
|
|
18645
|
-
/* @__PURE__ */ (0,
|
|
18646
|
-
/* @__PURE__ */ (0,
|
|
18671
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "grid grid-cols-2 gap-1 border-t border-border/40 pt-2", children: [
|
|
18672
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
18647
18673
|
"button",
|
|
18648
18674
|
{
|
|
18649
18675
|
type: "button",
|
|
@@ -18653,12 +18679,12 @@ var BubbleMenuContent = ({
|
|
|
18653
18679
|
editor.isActive("subscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
|
|
18654
18680
|
),
|
|
18655
18681
|
children: [
|
|
18656
|
-
/* @__PURE__ */ (0,
|
|
18682
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Subscript, { className: "h-4 w-4" }),
|
|
18657
18683
|
t("toolbar.subscript")
|
|
18658
18684
|
]
|
|
18659
18685
|
}
|
|
18660
18686
|
),
|
|
18661
|
-
/* @__PURE__ */ (0,
|
|
18687
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
18662
18688
|
"button",
|
|
18663
18689
|
{
|
|
18664
18690
|
type: "button",
|
|
@@ -18668,7 +18694,7 @@ var BubbleMenuContent = ({
|
|
|
18668
18694
|
editor.isActive("superscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
|
|
18669
18695
|
),
|
|
18670
18696
|
children: [
|
|
18671
|
-
/* @__PURE__ */ (0,
|
|
18697
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Superscript, { className: "h-4 w-4" }),
|
|
18672
18698
|
t("toolbar.superscript")
|
|
18673
18699
|
]
|
|
18674
18700
|
}
|
|
@@ -18677,20 +18703,20 @@ var BubbleMenuContent = ({
|
|
|
18677
18703
|
] })
|
|
18678
18704
|
] });
|
|
18679
18705
|
}
|
|
18680
|
-
const VerticalAlignActiveIcon = currentCellVerticalAlign === "middle" ?
|
|
18706
|
+
const VerticalAlignActiveIcon = currentCellVerticalAlign === "middle" ? TableVerticalAlignMiddleIcon : currentCellVerticalAlign === "bottom" ? TableVerticalAlignBottomIcon : TableVerticalAlignTopIcon;
|
|
18681
18707
|
if (isTableCellSelection) {
|
|
18682
|
-
return /* @__PURE__ */ (0,
|
|
18683
|
-
/* @__PURE__ */ (0,
|
|
18708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-0.5 p-1", "data-ueditor-cell-inspector": "", children: [
|
|
18709
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18684
18710
|
ToolbarButton,
|
|
18685
18711
|
{
|
|
18686
18712
|
onMouseDown: () => onKeepOpenChange?.(true),
|
|
18687
18713
|
onClick: () => setActiveColorPalette("cell-bg"),
|
|
18688
18714
|
active: Boolean(currentCellBgColor),
|
|
18689
18715
|
title: t("tableMenu.cellBackground") || "Cell background",
|
|
18690
|
-
children: /* @__PURE__ */ (0,
|
|
18716
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CellBgColorIcon, { color: currentCellBgColor })
|
|
18691
18717
|
}
|
|
18692
18718
|
),
|
|
18693
|
-
/* @__PURE__ */ (0,
|
|
18719
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18694
18720
|
ToolbarButton,
|
|
18695
18721
|
{
|
|
18696
18722
|
onMouseDown: () => onKeepOpenChange?.(true),
|
|
@@ -18699,7 +18725,7 @@ var BubbleMenuContent = ({
|
|
|
18699
18725
|
editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor || editor.getAttributes("tableCell").borderStyle || editor.getAttributes("tableHeader").borderStyle || editor.getAttributes("tableCell").borderWidth || editor.getAttributes("tableHeader").borderWidth
|
|
18700
18726
|
),
|
|
18701
18727
|
title: t("tableMenu.cellBorder") || "Cell border",
|
|
18702
|
-
children: /* @__PURE__ */ (0,
|
|
18728
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18703
18729
|
CellBorderIcon,
|
|
18704
18730
|
{
|
|
18705
18731
|
color: editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor
|
|
@@ -18707,7 +18733,7 @@ var BubbleMenuContent = ({
|
|
|
18707
18733
|
)
|
|
18708
18734
|
}
|
|
18709
18735
|
),
|
|
18710
|
-
/* @__PURE__ */ (0,
|
|
18736
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18711
18737
|
ToolbarButton,
|
|
18712
18738
|
{
|
|
18713
18739
|
onMouseDown: () => onKeepOpenChange?.(true),
|
|
@@ -18717,10 +18743,10 @@ var BubbleMenuContent = ({
|
|
|
18717
18743
|
},
|
|
18718
18744
|
active: Boolean(currentCellFormula),
|
|
18719
18745
|
title: t("tableMenu.formula") || "Formula",
|
|
18720
|
-
children: /* @__PURE__ */ (0,
|
|
18746
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Sigma, { className: "w-4 h-4" })
|
|
18721
18747
|
}
|
|
18722
18748
|
),
|
|
18723
|
-
/* @__PURE__ */ (0,
|
|
18749
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18724
18750
|
ToolbarButton,
|
|
18725
18751
|
{
|
|
18726
18752
|
onClick: () => {
|
|
@@ -18733,10 +18759,10 @@ var BubbleMenuContent = ({
|
|
|
18733
18759
|
active: canSplitCell,
|
|
18734
18760
|
disabled: !canMergeCells && !canSplitCell,
|
|
18735
18761
|
title: canSplitCell ? t("tableMenu.splitCell") || "Split cell" : t("tableMenu.mergeCells") || "Merge cells",
|
|
18736
|
-
children: /* @__PURE__ */ (0,
|
|
18762
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.TableCellsMerge, { className: "w-4 h-4" })
|
|
18737
18763
|
}
|
|
18738
18764
|
),
|
|
18739
|
-
/* @__PURE__ */ (0,
|
|
18765
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18740
18766
|
ToolbarButton,
|
|
18741
18767
|
{
|
|
18742
18768
|
onClick: () => applyTableCellAttribute2(
|
|
@@ -18747,14 +18773,14 @@ var BubbleMenuContent = ({
|
|
|
18747
18773
|
),
|
|
18748
18774
|
active: currentCellTextWrap !== "nowrap",
|
|
18749
18775
|
title: currentCellTextWrap === "nowrap" ? t("tableMenu.wrapText") : t("tableMenu.noWrapText"),
|
|
18750
|
-
children: /* @__PURE__ */ (0,
|
|
18776
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.WrapText, { className: "h-4 w-4" })
|
|
18751
18777
|
}
|
|
18752
18778
|
),
|
|
18753
|
-
/* @__PURE__ */ (0,
|
|
18779
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
18754
18780
|
DropdownMenu,
|
|
18755
18781
|
{
|
|
18756
18782
|
onOpenChange: onKeepOpenChange,
|
|
18757
|
-
trigger: /* @__PURE__ */ (0,
|
|
18783
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
18758
18784
|
ToolbarButton,
|
|
18759
18785
|
{
|
|
18760
18786
|
onMouseDown: () => onKeepOpenChange?.(true),
|
|
@@ -18762,34 +18788,34 @@ var BubbleMenuContent = ({
|
|
|
18762
18788
|
},
|
|
18763
18789
|
title: t("tableMenu.alignVertical") || "Vertical alignment",
|
|
18764
18790
|
children: [
|
|
18765
|
-
/* @__PURE__ */ (0,
|
|
18766
|
-
/* @__PURE__ */ (0,
|
|
18791
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(VerticalAlignActiveIcon, { className: "w-4 h-4" }),
|
|
18792
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.ChevronDown, { className: "w-3 h-3" })
|
|
18767
18793
|
]
|
|
18768
18794
|
}
|
|
18769
18795
|
),
|
|
18770
18796
|
children: [
|
|
18771
|
-
/* @__PURE__ */ (0,
|
|
18797
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18772
18798
|
DropdownMenuItem,
|
|
18773
18799
|
{
|
|
18774
|
-
icon:
|
|
18800
|
+
icon: TableVerticalAlignTopIcon,
|
|
18775
18801
|
label: t("tableMenu.alignVerticalTop") || "Align top",
|
|
18776
18802
|
onClick: () => applyTableCellAttribute2(editor, "verticalAlign", "top", { focus: false }),
|
|
18777
18803
|
active: currentCellVerticalAlign === "top"
|
|
18778
18804
|
}
|
|
18779
18805
|
),
|
|
18780
|
-
/* @__PURE__ */ (0,
|
|
18806
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18781
18807
|
DropdownMenuItem,
|
|
18782
18808
|
{
|
|
18783
|
-
icon:
|
|
18809
|
+
icon: TableVerticalAlignMiddleIcon,
|
|
18784
18810
|
label: t("tableMenu.alignVerticalMiddle") || "Align middle",
|
|
18785
18811
|
onClick: () => applyTableCellAttribute2(editor, "verticalAlign", "middle", { focus: false }),
|
|
18786
18812
|
active: currentCellVerticalAlign === "middle"
|
|
18787
18813
|
}
|
|
18788
18814
|
),
|
|
18789
|
-
/* @__PURE__ */ (0,
|
|
18815
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18790
18816
|
DropdownMenuItem,
|
|
18791
18817
|
{
|
|
18792
|
-
icon:
|
|
18818
|
+
icon: TableVerticalAlignBottomIcon,
|
|
18793
18819
|
label: t("tableMenu.alignVerticalBottom") || "Align bottom",
|
|
18794
18820
|
onClick: () => applyTableCellAttribute2(editor, "verticalAlign", "bottom", { focus: false }),
|
|
18795
18821
|
active: currentCellVerticalAlign === "bottom"
|
|
@@ -18798,11 +18824,11 @@ var BubbleMenuContent = ({
|
|
|
18798
18824
|
]
|
|
18799
18825
|
}
|
|
18800
18826
|
),
|
|
18801
|
-
/* @__PURE__ */ (0,
|
|
18827
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
18802
18828
|
DropdownMenu,
|
|
18803
18829
|
{
|
|
18804
18830
|
onOpenChange: onKeepOpenChange,
|
|
18805
|
-
trigger: /* @__PURE__ */ (0,
|
|
18831
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
18806
18832
|
ToolbarButton,
|
|
18807
18833
|
{
|
|
18808
18834
|
onMouseDown: () => onKeepOpenChange?.(true),
|
|
@@ -18810,13 +18836,13 @@ var BubbleMenuContent = ({
|
|
|
18810
18836
|
},
|
|
18811
18837
|
title: t("tableMenu.textDirection"),
|
|
18812
18838
|
children: [
|
|
18813
|
-
currentCellTextDirection === "vertical" ? /* @__PURE__ */ (0,
|
|
18814
|
-
/* @__PURE__ */ (0,
|
|
18839
|
+
currentCellTextDirection === "vertical" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.ArrowDown, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.ArrowRight, { className: "w-4 h-4" }),
|
|
18840
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.ChevronDown, { className: "w-3 h-3" })
|
|
18815
18841
|
]
|
|
18816
18842
|
}
|
|
18817
18843
|
),
|
|
18818
18844
|
children: [
|
|
18819
|
-
/* @__PURE__ */ (0,
|
|
18845
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18820
18846
|
DropdownMenuItem,
|
|
18821
18847
|
{
|
|
18822
18848
|
icon: import_lucide_react16.ArrowRight,
|
|
@@ -18825,7 +18851,7 @@ var BubbleMenuContent = ({
|
|
|
18825
18851
|
active: currentCellTextDirection === "horizontal"
|
|
18826
18852
|
}
|
|
18827
18853
|
),
|
|
18828
|
-
/* @__PURE__ */ (0,
|
|
18854
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18829
18855
|
DropdownMenuItem,
|
|
18830
18856
|
{
|
|
18831
18857
|
icon: import_lucide_react16.ArrowDown,
|
|
@@ -18839,22 +18865,22 @@ var BubbleMenuContent = ({
|
|
|
18839
18865
|
)
|
|
18840
18866
|
] });
|
|
18841
18867
|
}
|
|
18842
|
-
return /* @__PURE__ */ (0,
|
|
18843
|
-
/* @__PURE__ */ (0,
|
|
18844
|
-
/* @__PURE__ */ (0,
|
|
18845
|
-
/* @__PURE__ */ (0,
|
|
18868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-0.5 p-1", children: [
|
|
18869
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Bold, { className: "w-4 h-4" }) }),
|
|
18870
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Italic, { className: "w-4 h-4" }) }),
|
|
18871
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18846
18872
|
ToolbarButton,
|
|
18847
18873
|
{
|
|
18848
18874
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
18849
18875
|
active: editor.isActive("underline"),
|
|
18850
18876
|
title: t("toolbar.underline"),
|
|
18851
|
-
children: /* @__PURE__ */ (0,
|
|
18877
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Underline, { className: "w-4 h-4" })
|
|
18852
18878
|
}
|
|
18853
18879
|
),
|
|
18854
|
-
/* @__PURE__ */ (0,
|
|
18855
|
-
/* @__PURE__ */ (0,
|
|
18856
|
-
/* @__PURE__ */ (0,
|
|
18857
|
-
/* @__PURE__ */ (0,
|
|
18880
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Strikethrough, { className: "w-4 h-4" }) }),
|
|
18881
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Code, { className: "w-4 h-4" }) }),
|
|
18882
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
18883
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18858
18884
|
ToolbarButton,
|
|
18859
18885
|
{
|
|
18860
18886
|
onMouseDown: () => {
|
|
@@ -18865,18 +18891,18 @@ var BubbleMenuContent = ({
|
|
|
18865
18891
|
},
|
|
18866
18892
|
active: editor.isActive("link"),
|
|
18867
18893
|
title: t("toolbar.link"),
|
|
18868
|
-
children: /* @__PURE__ */ (0,
|
|
18894
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Link, { className: "w-4 h-4" })
|
|
18869
18895
|
}
|
|
18870
18896
|
),
|
|
18871
|
-
/* @__PURE__ */ (0,
|
|
18872
|
-
/* @__PURE__ */ (0,
|
|
18873
|
-
/* @__PURE__ */ (0,
|
|
18897
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: () => setActiveColorPalette("text"), title: t("colors.textColor"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TextColorIcon, { color: currentTextColor }) }),
|
|
18898
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: () => setActiveColorPalette("highlight"), active: editor.isActive("highlight"), title: t("colors.highlight"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(HighlightColorIcon, { color: currentHighlightColor }) }),
|
|
18899
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18874
18900
|
ToolbarButton,
|
|
18875
18901
|
{
|
|
18876
18902
|
onClick: () => setShowTypographyPanel(true),
|
|
18877
18903
|
active: Boolean(currentFontSize || currentLineHeight || editor.isActive("subscript") || editor.isActive("superscript")),
|
|
18878
18904
|
title: t("toolbar.textStyle"),
|
|
18879
|
-
children: /* @__PURE__ */ (0,
|
|
18905
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Type, { className: "w-4 h-4" })
|
|
18880
18906
|
}
|
|
18881
18907
|
)
|
|
18882
18908
|
] });
|
|
@@ -18891,12 +18917,12 @@ var LinkPreviewContent = ({ editor, onEdit }) => {
|
|
|
18891
18917
|
const handleUnlink = () => {
|
|
18892
18918
|
editor.chain().focus().unsetLink().run();
|
|
18893
18919
|
};
|
|
18894
|
-
return /* @__PURE__ */ (0,
|
|
18895
|
-
/* @__PURE__ */ (0,
|
|
18896
|
-
/* @__PURE__ */ (0,
|
|
18897
|
-
/* @__PURE__ */ (0,
|
|
18898
|
-
/* @__PURE__ */ (0,
|
|
18899
|
-
/* @__PURE__ */ (0,
|
|
18920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-1 p-1 max-w-sm", children: [
|
|
18921
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-xs text-muted-foreground font-mono px-2 truncate max-w-45", children: url }),
|
|
18922
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
18923
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: handleOpen, title: t("linkPreview.open") || "Open link", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.ExternalLink, { className: "w-4 h-4" }) }),
|
|
18924
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: onEdit, title: t("linkPreview.edit") || "Edit link", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Edit2, { className: "w-4 h-4" }) }),
|
|
18925
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: handleUnlink, title: t("linkPreview.unlink") || "Remove link", className: "text-destructive hover:text-destructive", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Unlink, { className: "w-4 h-4" }) })
|
|
18900
18926
|
] });
|
|
18901
18927
|
};
|
|
18902
18928
|
var CustomBubbleMenu = ({
|
|
@@ -19091,7 +19117,7 @@ var CustomBubbleMenu = ({
|
|
|
19091
19117
|
const context = getBubbleMenuContext(editor);
|
|
19092
19118
|
if (context === "none") return null;
|
|
19093
19119
|
return (0, import_react_dom3.createPortal)(
|
|
19094
|
-
/* @__PURE__ */ (0,
|
|
19120
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
19095
19121
|
"div",
|
|
19096
19122
|
{
|
|
19097
19123
|
ref: menuRef,
|
|
@@ -19115,7 +19141,7 @@ var CustomBubbleMenu = ({
|
|
|
19115
19141
|
}
|
|
19116
19142
|
e.preventDefault();
|
|
19117
19143
|
},
|
|
19118
|
-
children: context === "link" && !keepOpen && !linkInputOpen ? /* @__PURE__ */ (0,
|
|
19144
|
+
children: context === "link" && !keepOpen && !linkInputOpen ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
19119
19145
|
LinkPreviewContent,
|
|
19120
19146
|
{
|
|
19121
19147
|
editor,
|
|
@@ -19124,7 +19150,7 @@ var CustomBubbleMenu = ({
|
|
|
19124
19150
|
setKeepOpen(true);
|
|
19125
19151
|
}
|
|
19126
19152
|
}
|
|
19127
|
-
) : /* @__PURE__ */ (0,
|
|
19153
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
19128
19154
|
BubbleMenuContent,
|
|
19129
19155
|
{
|
|
19130
19156
|
editor,
|
|
@@ -19189,7 +19215,7 @@ var CustomFloatingMenu = ({ editor }) => {
|
|
|
19189
19215
|
}, [editor, editorWindow]);
|
|
19190
19216
|
if (!isVisible || !portalContainer) return null;
|
|
19191
19217
|
return (0, import_react_dom3.createPortal)(
|
|
19192
|
-
/* @__PURE__ */ (0,
|
|
19218
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
19193
19219
|
"div",
|
|
19194
19220
|
{
|
|
19195
19221
|
"data-popover": true,
|
|
@@ -19200,7 +19226,7 @@ var CustomFloatingMenu = ({ editor }) => {
|
|
|
19200
19226
|
transform: "translate(-50%, -100%)"
|
|
19201
19227
|
},
|
|
19202
19228
|
onMouseDown: (e) => e.preventDefault(),
|
|
19203
|
-
children: /* @__PURE__ */ (0,
|
|
19229
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FloatingMenuContent, { editor })
|
|
19204
19230
|
}
|
|
19205
19231
|
),
|
|
19206
19232
|
portalContainer
|
|
@@ -19211,7 +19237,7 @@ var CustomFloatingMenu = ({ editor }) => {
|
|
|
19211
19237
|
init_useSmartTranslations();
|
|
19212
19238
|
var import_react41 = require("@tiptap/react");
|
|
19213
19239
|
init_cn();
|
|
19214
|
-
var
|
|
19240
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
19215
19241
|
var CharacterCountDisplay = ({ editor, maxCharacters }) => {
|
|
19216
19242
|
const t = useSmartTranslations("UEditor");
|
|
19217
19243
|
const { characterCount, wordCount } = (0, import_react41.useEditorState)({
|
|
@@ -19225,18 +19251,18 @@ var CharacterCountDisplay = ({ editor, maxCharacters }) => {
|
|
|
19225
19251
|
}
|
|
19226
19252
|
});
|
|
19227
19253
|
const percentage = maxCharacters ? Math.round(characterCount / maxCharacters * 100) : 0;
|
|
19228
|
-
return /* @__PURE__ */ (0,
|
|
19229
|
-
/* @__PURE__ */ (0,
|
|
19254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.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: [
|
|
19255
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
19230
19256
|
wordCount,
|
|
19231
19257
|
" ",
|
|
19232
19258
|
t("words")
|
|
19233
19259
|
] }),
|
|
19234
|
-
/* @__PURE__ */ (0,
|
|
19260
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
19235
19261
|
characterCount,
|
|
19236
19262
|
" ",
|
|
19237
19263
|
t("characters")
|
|
19238
19264
|
] }),
|
|
19239
|
-
maxCharacters && /* @__PURE__ */ (0,
|
|
19265
|
+
maxCharacters && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: cn(percentage > 90 && "text-destructive", percentage > 100 && "font-bold"), children: [
|
|
19240
19266
|
characterCount,
|
|
19241
19267
|
"/",
|
|
19242
19268
|
maxCharacters
|
|
@@ -24210,7 +24236,7 @@ function buildTableHoverState({
|
|
|
24210
24236
|
}
|
|
24211
24237
|
|
|
24212
24238
|
// src/components/UEditor/table-drag-preview.tsx
|
|
24213
|
-
var
|
|
24239
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
24214
24240
|
function TableDragPreview({
|
|
24215
24241
|
columnDragLabel,
|
|
24216
24242
|
dragPreview,
|
|
@@ -24221,9 +24247,9 @@ function TableDragPreview({
|
|
|
24221
24247
|
const expandPreviewWidth = dragPreview.kind === "add-column" ? layout.tableWidth + dragPreview.previewCols * layout.avgColumnWidth : layout.tableWidth;
|
|
24222
24248
|
const expandPreviewHeight = dragPreview.kind === "add-row" ? layout.tableHeight + dragPreview.previewRows * layout.avgRowHeight : layout.tableHeight;
|
|
24223
24249
|
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`;
|
|
24224
|
-
return /* @__PURE__ */ (0,
|
|
24225
|
-
dragPreview.kind === "row" && /* @__PURE__ */ (0,
|
|
24226
|
-
/* @__PURE__ */ (0,
|
|
24250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
24251
|
+
dragPreview.kind === "row" && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
24252
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
24227
24253
|
"div",
|
|
24228
24254
|
{
|
|
24229
24255
|
"aria-hidden": "true",
|
|
@@ -24236,7 +24262,7 @@ function TableDragPreview({
|
|
|
24236
24262
|
}
|
|
24237
24263
|
}
|
|
24238
24264
|
),
|
|
24239
|
-
/* @__PURE__ */ (0,
|
|
24265
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
24240
24266
|
"div",
|
|
24241
24267
|
{
|
|
24242
24268
|
"aria-hidden": "true",
|
|
@@ -24250,8 +24276,8 @@ function TableDragPreview({
|
|
|
24250
24276
|
}
|
|
24251
24277
|
)
|
|
24252
24278
|
] }),
|
|
24253
|
-
dragPreview.kind === "column" && /* @__PURE__ */ (0,
|
|
24254
|
-
/* @__PURE__ */ (0,
|
|
24279
|
+
dragPreview.kind === "column" && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
24280
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
24255
24281
|
"div",
|
|
24256
24282
|
{
|
|
24257
24283
|
"aria-hidden": "true",
|
|
@@ -24264,7 +24290,7 @@ function TableDragPreview({
|
|
|
24264
24290
|
}
|
|
24265
24291
|
}
|
|
24266
24292
|
),
|
|
24267
|
-
/* @__PURE__ */ (0,
|
|
24293
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
24268
24294
|
"div",
|
|
24269
24295
|
{
|
|
24270
24296
|
"aria-hidden": "true",
|
|
@@ -24278,7 +24304,7 @@ function TableDragPreview({
|
|
|
24278
24304
|
}
|
|
24279
24305
|
)
|
|
24280
24306
|
] }),
|
|
24281
|
-
(dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */ (0,
|
|
24307
|
+
(dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
24282
24308
|
"div",
|
|
24283
24309
|
{
|
|
24284
24310
|
"aria-hidden": "true",
|
|
@@ -24291,7 +24317,7 @@ function TableDragPreview({
|
|
|
24291
24317
|
}
|
|
24292
24318
|
}
|
|
24293
24319
|
),
|
|
24294
|
-
/* @__PURE__ */ (0,
|
|
24320
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
24295
24321
|
"div",
|
|
24296
24322
|
{
|
|
24297
24323
|
role: "status",
|
|
@@ -24309,7 +24335,7 @@ function TableDragPreview({
|
|
|
24309
24335
|
// src/components/UEditor/table-add-rails.tsx
|
|
24310
24336
|
init_cn();
|
|
24311
24337
|
init_Tooltip();
|
|
24312
|
-
var
|
|
24338
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
24313
24339
|
var ADD_COLUMN_RAIL_GAP = 4;
|
|
24314
24340
|
var ADD_ROW_RAIL_GAP = 4;
|
|
24315
24341
|
var BUTTON_LONG_SIZE = 36;
|
|
@@ -24334,13 +24360,13 @@ function TableAddRails({
|
|
|
24334
24360
|
const rowRailLeft = visibleBounds.left + Math.max(0, (visibleBounds.width - BUTTON_LONG_SIZE) / 2);
|
|
24335
24361
|
const showColumnRail = controlsVisible || addColumnVisible;
|
|
24336
24362
|
const showRowRail = controlsVisible || addRowVisible;
|
|
24337
|
-
return /* @__PURE__ */ (0,
|
|
24338
|
-
/* @__PURE__ */ (0,
|
|
24363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
24364
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
24339
24365
|
Tooltip,
|
|
24340
24366
|
{
|
|
24341
24367
|
placement: "right",
|
|
24342
|
-
content: /* @__PURE__ */ (0,
|
|
24343
|
-
children: /* @__PURE__ */ (0,
|
|
24368
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xs font-medium", children: quickAddColumnLabel }),
|
|
24369
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
24344
24370
|
"button",
|
|
24345
24371
|
{
|
|
24346
24372
|
type: "button",
|
|
@@ -24368,17 +24394,17 @@ function TableAddRails({
|
|
|
24368
24394
|
transform: showColumnRail ? "scale(1)" : "scale(0.85)",
|
|
24369
24395
|
pointerEvents: showColumnRail ? "auto" : "none"
|
|
24370
24396
|
},
|
|
24371
|
-
children: /* @__PURE__ */ (0,
|
|
24397
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm font-medium leading-none", children: "+" })
|
|
24372
24398
|
}
|
|
24373
24399
|
)
|
|
24374
24400
|
}
|
|
24375
24401
|
),
|
|
24376
|
-
/* @__PURE__ */ (0,
|
|
24402
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
24377
24403
|
Tooltip,
|
|
24378
24404
|
{
|
|
24379
24405
|
placement: "bottom",
|
|
24380
|
-
content: /* @__PURE__ */ (0,
|
|
24381
|
-
children: /* @__PURE__ */ (0,
|
|
24406
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xs font-medium", children: quickAddRowLabel }),
|
|
24407
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
24382
24408
|
"button",
|
|
24383
24409
|
{
|
|
24384
24410
|
type: "button",
|
|
@@ -24404,7 +24430,7 @@ function TableAddRails({
|
|
|
24404
24430
|
transform: showRowRail ? "scale(1)" : "scale(0.85)",
|
|
24405
24431
|
pointerEvents: showRowRail ? "auto" : "none"
|
|
24406
24432
|
},
|
|
24407
|
-
children: /* @__PURE__ */ (0,
|
|
24433
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm font-medium leading-none", children: "+" })
|
|
24408
24434
|
}
|
|
24409
24435
|
)
|
|
24410
24436
|
}
|
|
@@ -24417,7 +24443,7 @@ var import_lucide_react17 = require("lucide-react");
|
|
|
24417
24443
|
init_cn();
|
|
24418
24444
|
init_DropdownMenu();
|
|
24419
24445
|
init_Tooltip();
|
|
24420
|
-
var
|
|
24446
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
24421
24447
|
function TableControlMenu({
|
|
24422
24448
|
controlsVisible,
|
|
24423
24449
|
isOpen,
|
|
@@ -24429,7 +24455,7 @@ function TableControlMenu({
|
|
|
24429
24455
|
top
|
|
24430
24456
|
}) {
|
|
24431
24457
|
const shown = controlsVisible || menuVisible || isOpen;
|
|
24432
|
-
return /* @__PURE__ */ (0,
|
|
24458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
24433
24459
|
"div",
|
|
24434
24460
|
{
|
|
24435
24461
|
className: "absolute z-30",
|
|
@@ -24438,13 +24464,13 @@ function TableControlMenu({
|
|
|
24438
24464
|
top,
|
|
24439
24465
|
left
|
|
24440
24466
|
},
|
|
24441
|
-
children: /* @__PURE__ */ (0,
|
|
24467
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
24442
24468
|
Tooltip,
|
|
24443
24469
|
{
|
|
24444
24470
|
placement: "top",
|
|
24445
24471
|
disabled: isOpen,
|
|
24446
|
-
content: /* @__PURE__ */ (0,
|
|
24447
|
-
children: /* @__PURE__ */ (0,
|
|
24472
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-xs font-medium", children: label }),
|
|
24473
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
24448
24474
|
DropdownMenu,
|
|
24449
24475
|
{
|
|
24450
24476
|
placement: "bottom-start",
|
|
@@ -24452,7 +24478,7 @@ function TableControlMenu({
|
|
|
24452
24478
|
onOpenChange,
|
|
24453
24479
|
contentClassName: "p-2",
|
|
24454
24480
|
items,
|
|
24455
|
-
trigger: /* @__PURE__ */ (0,
|
|
24481
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
24456
24482
|
"button",
|
|
24457
24483
|
{
|
|
24458
24484
|
type: "button",
|
|
@@ -24468,7 +24494,7 @@ function TableControlMenu({
|
|
|
24468
24494
|
transform: shown ? "scale(1)" : "scale(0.82)",
|
|
24469
24495
|
pointerEvents: shown ? "auto" : "none"
|
|
24470
24496
|
},
|
|
24471
|
-
children: /* @__PURE__ */ (0,
|
|
24497
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react17.MoreHorizontal, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
24472
24498
|
}
|
|
24473
24499
|
)
|
|
24474
24500
|
}
|
|
@@ -24484,7 +24510,7 @@ var import_lucide_react18 = require("lucide-react");
|
|
|
24484
24510
|
init_cn();
|
|
24485
24511
|
init_DropdownMenu();
|
|
24486
24512
|
init_Tooltip();
|
|
24487
|
-
var
|
|
24513
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
24488
24514
|
var IDLE_HANDLE_SCALE = "0.78";
|
|
24489
24515
|
function TableRowHandles({
|
|
24490
24516
|
activeRowIndex,
|
|
@@ -24499,12 +24525,12 @@ function TableRowHandles({
|
|
|
24499
24525
|
rowHandleLeft,
|
|
24500
24526
|
rowHandles
|
|
24501
24527
|
}) {
|
|
24502
|
-
return /* @__PURE__ */ (0,
|
|
24528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, { children: rowHandles.map((rowHandle) => {
|
|
24503
24529
|
const menuKey = `row:${rowHandle.index}`;
|
|
24504
24530
|
const isActive = rowHandle.index === activeRowIndex;
|
|
24505
24531
|
const visible = controlsVisible || hoverRowHandleIndex === rowHandle.index || openMenuKey === menuKey;
|
|
24506
24532
|
const isShown = visible || isActive;
|
|
24507
|
-
return /* @__PURE__ */ (0,
|
|
24533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
24508
24534
|
"div",
|
|
24509
24535
|
{
|
|
24510
24536
|
className: "absolute z-30",
|
|
@@ -24514,13 +24540,13 @@ function TableRowHandles({
|
|
|
24514
24540
|
left: rowHandleLeft,
|
|
24515
24541
|
pointerEvents: visible ? "auto" : "none"
|
|
24516
24542
|
},
|
|
24517
|
-
children: /* @__PURE__ */ (0,
|
|
24543
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
24518
24544
|
Tooltip,
|
|
24519
24545
|
{
|
|
24520
24546
|
placement: "right",
|
|
24521
24547
|
disabled: openMenuKey === menuKey || !visible && isActive,
|
|
24522
|
-
content: /* @__PURE__ */ (0,
|
|
24523
|
-
children: /* @__PURE__ */ (0,
|
|
24548
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-xs font-medium", children: `${rowDragLabel} ${rowHandle.index + 1}` }),
|
|
24549
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
24524
24550
|
DropdownMenu,
|
|
24525
24551
|
{
|
|
24526
24552
|
placement: "right",
|
|
@@ -24528,7 +24554,7 @@ function TableRowHandles({
|
|
|
24528
24554
|
onOpenChange: (open) => onOpenMenuChange(menuKey, open),
|
|
24529
24555
|
contentClassName: "p-2",
|
|
24530
24556
|
items: getMenuItems(rowHandle),
|
|
24531
|
-
trigger: /* @__PURE__ */ (0,
|
|
24557
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
24532
24558
|
"button",
|
|
24533
24559
|
{
|
|
24534
24560
|
type: "button",
|
|
@@ -24553,7 +24579,7 @@ function TableRowHandles({
|
|
|
24553
24579
|
// selection near the first character of a table cell.
|
|
24554
24580
|
pointerEvents: visible ? "auto" : "none"
|
|
24555
24581
|
},
|
|
24556
|
-
children: visible ? /* @__PURE__ */ (0,
|
|
24582
|
+
children: visible ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react18.GripVertical, { "aria-hidden": "true", className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "h-3 w-1 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
|
|
24557
24583
|
}
|
|
24558
24584
|
)
|
|
24559
24585
|
}
|
|
@@ -24578,12 +24604,12 @@ function TableColumnHandles({
|
|
|
24578
24604
|
onStartDrag,
|
|
24579
24605
|
openMenuKey
|
|
24580
24606
|
}) {
|
|
24581
|
-
return /* @__PURE__ */ (0,
|
|
24607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, { children: columnHandles.map((columnHandle) => {
|
|
24582
24608
|
const menuKey = `column:${columnHandle.index}`;
|
|
24583
24609
|
const isActive = columnHandle.index === activeColumnIndex;
|
|
24584
24610
|
const visible = controlsVisible || hoverColumnHandleIndex === columnHandle.index || openMenuKey === menuKey;
|
|
24585
24611
|
const isShown = visible || isActive;
|
|
24586
|
-
return /* @__PURE__ */ (0,
|
|
24612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
24587
24613
|
"div",
|
|
24588
24614
|
{
|
|
24589
24615
|
className: "absolute z-30",
|
|
@@ -24593,13 +24619,13 @@ function TableColumnHandles({
|
|
|
24593
24619
|
left: Math.max(8, columnHandle.center - 12),
|
|
24594
24620
|
pointerEvents: visible ? "auto" : "none"
|
|
24595
24621
|
},
|
|
24596
|
-
children: /* @__PURE__ */ (0,
|
|
24622
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
24597
24623
|
Tooltip,
|
|
24598
24624
|
{
|
|
24599
24625
|
placement: "top",
|
|
24600
24626
|
disabled: openMenuKey === menuKey || !visible && isActive,
|
|
24601
|
-
content: /* @__PURE__ */ (0,
|
|
24602
|
-
children: /* @__PURE__ */ (0,
|
|
24627
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-xs font-medium", children: `${columnDragLabel} ${columnHandle.index + 1}` }),
|
|
24628
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
24603
24629
|
DropdownMenu,
|
|
24604
24630
|
{
|
|
24605
24631
|
placement: "bottom-start",
|
|
@@ -24607,7 +24633,7 @@ function TableColumnHandles({
|
|
|
24607
24633
|
onOpenChange: (open) => onOpenMenuChange(menuKey, open),
|
|
24608
24634
|
contentClassName: "p-2",
|
|
24609
24635
|
items: getMenuItems(columnHandle),
|
|
24610
|
-
trigger: /* @__PURE__ */ (0,
|
|
24636
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
24611
24637
|
"button",
|
|
24612
24638
|
{
|
|
24613
24639
|
type: "button",
|
|
@@ -24629,7 +24655,7 @@ function TableColumnHandles({
|
|
|
24629
24655
|
transform: isShown ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`,
|
|
24630
24656
|
pointerEvents: visible ? "auto" : "none"
|
|
24631
24657
|
},
|
|
24632
|
-
children: visible ? /* @__PURE__ */ (0,
|
|
24658
|
+
children: visible ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react18.GripHorizontal, { "aria-hidden": "true", className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "h-1 w-3 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
|
|
24633
24659
|
}
|
|
24634
24660
|
)
|
|
24635
24661
|
}
|
|
@@ -24646,7 +24672,7 @@ function TableColumnHandles({
|
|
|
24646
24672
|
var import_lucide_react19 = require("lucide-react");
|
|
24647
24673
|
init_cn();
|
|
24648
24674
|
init_table_width_model();
|
|
24649
|
-
var
|
|
24675
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
24650
24676
|
var EDGE_HANDLE_CLASS = cn(
|
|
24651
24677
|
"pointer-events-auto absolute top-0 z-10 h-full w-2 touch-none cursor-col-resize bg-transparent p-0",
|
|
24652
24678
|
"border-transparent transition-colors duration-150 hover:border-primary",
|
|
@@ -24679,7 +24705,7 @@ function TableResizeHandles({
|
|
|
24679
24705
|
onStartResize,
|
|
24680
24706
|
resizeBothLabel
|
|
24681
24707
|
}) {
|
|
24682
|
-
return /* @__PURE__ */ (0,
|
|
24708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
24683
24709
|
"div",
|
|
24684
24710
|
{
|
|
24685
24711
|
ref: frameRef,
|
|
@@ -24696,8 +24722,8 @@ function TableResizeHandles({
|
|
|
24696
24722
|
height: layout.tableHeight
|
|
24697
24723
|
},
|
|
24698
24724
|
children: [
|
|
24699
|
-
layout.widthMode === "responsive" ? /* @__PURE__ */ (0,
|
|
24700
|
-
/* @__PURE__ */ (0,
|
|
24725
|
+
layout.widthMode === "responsive" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
24726
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
24701
24727
|
"button",
|
|
24702
24728
|
{
|
|
24703
24729
|
type: "button",
|
|
@@ -24712,7 +24738,7 @@ function TableResizeHandles({
|
|
|
24712
24738
|
onKeyDown: (event) => onKeyboardResize(event, "left")
|
|
24713
24739
|
}
|
|
24714
24740
|
),
|
|
24715
|
-
/* @__PURE__ */ (0,
|
|
24741
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
24716
24742
|
"button",
|
|
24717
24743
|
{
|
|
24718
24744
|
type: "button",
|
|
@@ -24728,7 +24754,7 @@ function TableResizeHandles({
|
|
|
24728
24754
|
}
|
|
24729
24755
|
)
|
|
24730
24756
|
] }) : null,
|
|
24731
|
-
/* @__PURE__ */ (0,
|
|
24757
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
24732
24758
|
"button",
|
|
24733
24759
|
{
|
|
24734
24760
|
type: "button",
|
|
@@ -24746,10 +24772,10 @@ function TableResizeHandles({
|
|
|
24746
24772
|
},
|
|
24747
24773
|
onPointerDown: (event) => onStartResize(event, "both"),
|
|
24748
24774
|
onKeyDown: (event) => onKeyboardResize(event, "both"),
|
|
24749
|
-
children: /* @__PURE__ */ (0,
|
|
24775
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react19.MoveDiagonal2, { "aria-hidden": "true", className: "h-3.5 w-3.5", strokeWidth: 2.25 })
|
|
24750
24776
|
}
|
|
24751
24777
|
),
|
|
24752
|
-
active ? /* @__PURE__ */ (0,
|
|
24778
|
+
active ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
24753
24779
|
"span",
|
|
24754
24780
|
{
|
|
24755
24781
|
role: "status",
|
|
@@ -25003,7 +25029,7 @@ function applyTableSize(editor, snapshot, dimensions, options = {}) {
|
|
|
25003
25029
|
// src/components/UEditor/table-controls.tsx
|
|
25004
25030
|
init_table_width_model();
|
|
25005
25031
|
init_table_formula_references();
|
|
25006
|
-
var
|
|
25032
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
25007
25033
|
var TABLE_MENU_TOP_OFFSET = 10;
|
|
25008
25034
|
var AXIS_HANDLE_RADIUS = 12;
|
|
25009
25035
|
function clamp4(value, min, max) {
|
|
@@ -25871,8 +25897,8 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
25871
25897
|
const menuLeft = Math.max(8, layout.tableLeft);
|
|
25872
25898
|
const rowHandleLeft = layout.tableLeft - AXIS_HANDLE_RADIUS;
|
|
25873
25899
|
const columnHandleTop = layout.tableTop - AXIS_HANDLE_RADIUS;
|
|
25874
|
-
return /* @__PURE__ */ (0,
|
|
25875
|
-
/* @__PURE__ */ (0,
|
|
25900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
25901
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
25876
25902
|
TableRowHandles,
|
|
25877
25903
|
{
|
|
25878
25904
|
activeRowIndex: layout.activeRowIndex,
|
|
@@ -25890,7 +25916,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
25890
25916
|
rowHandles: layout.rowHandles
|
|
25891
25917
|
}
|
|
25892
25918
|
),
|
|
25893
|
-
/* @__PURE__ */ (0,
|
|
25919
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
25894
25920
|
TableColumnHandles,
|
|
25895
25921
|
{
|
|
25896
25922
|
activeColumnIndex: layout.activeColumnIndex,
|
|
@@ -25908,7 +25934,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
25908
25934
|
openMenuKey
|
|
25909
25935
|
}
|
|
25910
25936
|
),
|
|
25911
|
-
/* @__PURE__ */ (0,
|
|
25937
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
25912
25938
|
TableControlMenu,
|
|
25913
25939
|
{
|
|
25914
25940
|
controlsVisible,
|
|
@@ -25923,7 +25949,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
25923
25949
|
top: menuTop
|
|
25924
25950
|
}
|
|
25925
25951
|
),
|
|
25926
|
-
dragPreview === null && /* @__PURE__ */ (0,
|
|
25952
|
+
dragPreview === null && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
25927
25953
|
TableResizeHandles,
|
|
25928
25954
|
{
|
|
25929
25955
|
active: tableResizeActive,
|
|
@@ -25936,7 +25962,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
25936
25962
|
resizeBothLabel: t("tableMenu.resizeBoth")
|
|
25937
25963
|
}
|
|
25938
25964
|
),
|
|
25939
|
-
/* @__PURE__ */ (0,
|
|
25965
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
25940
25966
|
TableAddRails,
|
|
25941
25967
|
{
|
|
25942
25968
|
addColumnVisible: hoverState.addColumnVisible,
|
|
@@ -25952,7 +25978,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
25952
25978
|
quickAddRowLabel: t("tableMenu.quickAddRowAfter")
|
|
25953
25979
|
}
|
|
25954
25980
|
),
|
|
25955
|
-
/* @__PURE__ */ (0,
|
|
25981
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
25956
25982
|
TableDragPreview,
|
|
25957
25983
|
{
|
|
25958
25984
|
columnDragLabel: t("tableMenu.dragColumn"),
|
|
@@ -26986,7 +27012,7 @@ var import_lucide_react21 = require("lucide-react");
|
|
|
26986
27012
|
init_useSmartTranslations();
|
|
26987
27013
|
init_table_dom_utils();
|
|
26988
27014
|
init_form_control_size();
|
|
26989
|
-
var
|
|
27015
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
26990
27016
|
function TableFormulaBar({ editor }) {
|
|
26991
27017
|
const t = useSmartTranslations("UEditor");
|
|
26992
27018
|
const inputRef = (0, import_react46.useRef)(null);
|
|
@@ -27049,7 +27075,7 @@ function TableFormulaBar({ editor }) {
|
|
|
27049
27075
|
if (!editor.isDestroyed) editor.commands.focus();
|
|
27050
27076
|
}, 0);
|
|
27051
27077
|
};
|
|
27052
|
-
return /* @__PURE__ */ (0,
|
|
27078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
27053
27079
|
"div",
|
|
27054
27080
|
{
|
|
27055
27081
|
"data-ueditor-formula-bar": "",
|
|
@@ -27057,7 +27083,7 @@ function TableFormulaBar({ editor }) {
|
|
|
27057
27083
|
"aria-label": t("tableMenu.formulaBar"),
|
|
27058
27084
|
className: "flex min-h-10 items-center gap-2 border-b border-border/60 bg-muted/25 px-2 py-1.5",
|
|
27059
27085
|
children: [
|
|
27060
|
-
/* @__PURE__ */ (0,
|
|
27086
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
27061
27087
|
"span",
|
|
27062
27088
|
{
|
|
27063
27089
|
"data-ueditor-formula-cell-label": "",
|
|
@@ -27065,8 +27091,8 @@ function TableFormulaBar({ editor }) {
|
|
|
27065
27091
|
children: selectedCell.label
|
|
27066
27092
|
}
|
|
27067
27093
|
),
|
|
27068
|
-
/* @__PURE__ */ (0,
|
|
27069
|
-
/* @__PURE__ */ (0,
|
|
27094
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Sigma, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 text-primary" }),
|
|
27095
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
27070
27096
|
"input",
|
|
27071
27097
|
{
|
|
27072
27098
|
ref: inputRef,
|
|
@@ -27087,18 +27113,18 @@ function TableFormulaBar({ editor }) {
|
|
|
27087
27113
|
className: `h-7 min-w-0 flex-1 rounded-md bg-background px-2 font-mono text-sm text-foreground ${formControlOutlineClass}`
|
|
27088
27114
|
}
|
|
27089
27115
|
),
|
|
27090
|
-
selectedCell.formulaState === "error" && /* @__PURE__ */ (0,
|
|
27116
|
+
selectedCell.formulaState === "error" && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
27091
27117
|
"span",
|
|
27092
27118
|
{
|
|
27093
27119
|
role: "status",
|
|
27094
27120
|
className: "hidden shrink-0 items-center gap-1 text-xs font-medium text-destructive sm:inline-flex",
|
|
27095
27121
|
children: [
|
|
27096
|
-
/* @__PURE__ */ (0,
|
|
27122
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.AlertCircle, { "aria-hidden": "true", className: "h-3.5 w-3.5" }),
|
|
27097
27123
|
t("tableMenu.formulaError")
|
|
27098
27124
|
]
|
|
27099
27125
|
}
|
|
27100
27126
|
),
|
|
27101
|
-
/* @__PURE__ */ (0,
|
|
27127
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
27102
27128
|
"button",
|
|
27103
27129
|
{
|
|
27104
27130
|
type: "button",
|
|
@@ -27106,10 +27132,10 @@ function TableFormulaBar({ editor }) {
|
|
|
27106
27132
|
"aria-label": t("tableMenu.apply"),
|
|
27107
27133
|
title: t("tableMenu.apply"),
|
|
27108
27134
|
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",
|
|
27109
|
-
children: /* @__PURE__ */ (0,
|
|
27135
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Check, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
27110
27136
|
}
|
|
27111
27137
|
),
|
|
27112
|
-
/* @__PURE__ */ (0,
|
|
27138
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
27113
27139
|
"button",
|
|
27114
27140
|
{
|
|
27115
27141
|
type: "button",
|
|
@@ -27120,10 +27146,10 @@ function TableFormulaBar({ editor }) {
|
|
|
27120
27146
|
"aria-label": t("tableMenu.convertToValue"),
|
|
27121
27147
|
title: t("tableMenu.convertToValue"),
|
|
27122
27148
|
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",
|
|
27123
|
-
children: /* @__PURE__ */ (0,
|
|
27149
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Hash, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
27124
27150
|
}
|
|
27125
27151
|
),
|
|
27126
|
-
/* @__PURE__ */ (0,
|
|
27152
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
27127
27153
|
"button",
|
|
27128
27154
|
{
|
|
27129
27155
|
type: "button",
|
|
@@ -27134,7 +27160,7 @@ function TableFormulaBar({ editor }) {
|
|
|
27134
27160
|
"aria-label": t("tableMenu.clearCell"),
|
|
27135
27161
|
title: t("tableMenu.clearCell"),
|
|
27136
27162
|
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",
|
|
27137
|
-
children: /* @__PURE__ */ (0,
|
|
27163
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Trash2, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
27138
27164
|
}
|
|
27139
27165
|
)
|
|
27140
27166
|
]
|
|
@@ -27218,7 +27244,7 @@ function useUEditorOutput({
|
|
|
27218
27244
|
|
|
27219
27245
|
// src/components/UEditor/UEditor.tsx
|
|
27220
27246
|
init_portal_context();
|
|
27221
|
-
var
|
|
27247
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
27222
27248
|
var LazyMenuBar = import_react49.default.lazy(async () => {
|
|
27223
27249
|
const { MenuBar: MenuBar2 } = await Promise.resolve().then(() => (init_menu_bar(), menu_bar_exports));
|
|
27224
27250
|
return { default: MenuBar2 };
|
|
@@ -27534,7 +27560,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27534
27560
|
}
|
|
27535
27561
|
}, [content, editor]);
|
|
27536
27562
|
if (!editor) {
|
|
27537
|
-
return /* @__PURE__ */ (0,
|
|
27563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(UEditorPortalProvider, { getPortalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27538
27564
|
"div",
|
|
27539
27565
|
{
|
|
27540
27566
|
role: "status",
|
|
@@ -27545,7 +27571,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27545
27571
|
}
|
|
27546
27572
|
) });
|
|
27547
27573
|
}
|
|
27548
|
-
return /* @__PURE__ */ (0,
|
|
27574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(UEditorPortalProvider, { getPortalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { "data-ueditor-width-boundary": "", className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
27549
27575
|
"div",
|
|
27550
27576
|
{
|
|
27551
27577
|
className: cn(
|
|
@@ -27561,8 +27587,8 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27561
27587
|
className
|
|
27562
27588
|
),
|
|
27563
27589
|
children: [
|
|
27564
|
-
editable && (showMenuBar || showToolbar || showBubbleMenu) ? /* @__PURE__ */ (0,
|
|
27565
|
-
isMenuBarVisible && /* @__PURE__ */ (0,
|
|
27590
|
+
editable && (showMenuBar || showToolbar || showBubbleMenu) ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(EditorUiRenderStateProvider, { editor, children: [
|
|
27591
|
+
isMenuBarVisible && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react49.default.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27566
27592
|
LazyMenuBar,
|
|
27567
27593
|
{
|
|
27568
27594
|
editor,
|
|
@@ -27580,7 +27606,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27580
27606
|
showPreviewButton
|
|
27581
27607
|
}
|
|
27582
27608
|
) }),
|
|
27583
|
-
showToolbar && /* @__PURE__ */ (0,
|
|
27609
|
+
showToolbar && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27584
27610
|
EditorToolbar,
|
|
27585
27611
|
{
|
|
27586
27612
|
editor,
|
|
@@ -27600,8 +27626,8 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27600
27626
|
letterSpacings
|
|
27601
27627
|
}
|
|
27602
27628
|
),
|
|
27603
|
-
/* @__PURE__ */ (0,
|
|
27604
|
-
showBubbleMenu && /* @__PURE__ */ (0,
|
|
27629
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TableFormulaBar, { editor }),
|
|
27630
|
+
showBubbleMenu && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27605
27631
|
CustomBubbleMenu,
|
|
27606
27632
|
{
|
|
27607
27633
|
editor,
|
|
@@ -27610,9 +27636,9 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27610
27636
|
lineHeights
|
|
27611
27637
|
}
|
|
27612
27638
|
)
|
|
27613
|
-
] }) : editable ? /* @__PURE__ */ (0,
|
|
27614
|
-
editable && showFloatingMenu && /* @__PURE__ */ (0,
|
|
27615
|
-
/* @__PURE__ */ (0,
|
|
27639
|
+
] }) : editable ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TableFormulaBar, { editor }) : null,
|
|
27640
|
+
editable && showFloatingMenu && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CustomFloatingMenu, { editor }),
|
|
27641
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
27616
27642
|
"div",
|
|
27617
27643
|
{
|
|
27618
27644
|
ref: (node) => {
|
|
@@ -27630,7 +27656,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27630
27656
|
"--ueditor-table-cell-padding-x": `${resolvedTableCellHorizontalPadding}px`
|
|
27631
27657
|
},
|
|
27632
27658
|
children: [
|
|
27633
|
-
/* @__PURE__ */ (0,
|
|
27659
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27634
27660
|
"span",
|
|
27635
27661
|
{
|
|
27636
27662
|
ref: tableColumnGuideRef,
|
|
@@ -27638,7 +27664,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27638
27664
|
className: "pointer-events-none absolute z-20 bg-primary/50 opacity-0 transition-opacity duration-200 delay-100 ease-out"
|
|
27639
27665
|
}
|
|
27640
27666
|
),
|
|
27641
|
-
/* @__PURE__ */ (0,
|
|
27667
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27642
27668
|
"span",
|
|
27643
27669
|
{
|
|
27644
27670
|
ref: tableRowGuideRef,
|
|
@@ -27646,7 +27672,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27646
27672
|
className: "pointer-events-none absolute z-20 bg-primary/50 opacity-0 transition-opacity duration-200 delay-100 ease-out"
|
|
27647
27673
|
}
|
|
27648
27674
|
),
|
|
27649
|
-
/* @__PURE__ */ (0,
|
|
27675
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27650
27676
|
"span",
|
|
27651
27677
|
{
|
|
27652
27678
|
ref: activeTableCellHighlightRef,
|
|
@@ -27655,7 +27681,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27655
27681
|
className: "pointer-events-none hidden absolute z-20 rounded-[2px] border border-primary/50 bg-primary/5"
|
|
27656
27682
|
}
|
|
27657
27683
|
),
|
|
27658
|
-
/* @__PURE__ */ (0,
|
|
27684
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27659
27685
|
"div",
|
|
27660
27686
|
{
|
|
27661
27687
|
ref: formulaCoordinateOverlayRef,
|
|
@@ -27663,7 +27689,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27663
27689
|
className: "pointer-events-none absolute inset-0 z-[35] hidden overflow-visible"
|
|
27664
27690
|
}
|
|
27665
27691
|
),
|
|
27666
|
-
formulaRangeHighlight && /* @__PURE__ */ (0,
|
|
27692
|
+
formulaRangeHighlight && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27667
27693
|
"span",
|
|
27668
27694
|
{
|
|
27669
27695
|
"aria-hidden": "true",
|
|
@@ -27681,7 +27707,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27681
27707
|
}
|
|
27682
27708
|
}
|
|
27683
27709
|
),
|
|
27684
|
-
editable && /* @__PURE__ */ (0,
|
|
27710
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27685
27711
|
TableControls,
|
|
27686
27712
|
{
|
|
27687
27713
|
editor,
|
|
@@ -27689,7 +27715,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27689
27715
|
showCellInspector: showBubbleMenu
|
|
27690
27716
|
}
|
|
27691
27717
|
),
|
|
27692
|
-
/* @__PURE__ */ (0,
|
|
27718
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27693
27719
|
import_react50.EditorContent,
|
|
27694
27720
|
{
|
|
27695
27721
|
editor,
|
|
@@ -27699,7 +27725,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27699
27725
|
]
|
|
27700
27726
|
}
|
|
27701
27727
|
),
|
|
27702
|
-
showFooter && showCharacterCount && /* @__PURE__ */ (0,
|
|
27728
|
+
showFooter && showCharacterCount && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CharacterCountDisplay, { editor, maxCharacters })
|
|
27703
27729
|
]
|
|
27704
27730
|
}
|
|
27705
27731
|
) }) });
|