@underverse-ui/underverse 2.0.36 → 2.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-reference.json +1 -1
- package/dist/{chunk-V4VZZHV7.js → chunk-GZ7EDNGF.js} +202 -184
- package/dist/chunk-GZ7EDNGF.js.map +1 -0
- package/dist/{chunk-SCW2XGCE.js → chunk-R27HNUZQ.js} +23 -17
- package/dist/chunk-R27HNUZQ.js.map +1 -0
- package/dist/index.cjs +497 -465
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/{menu-bar-MX3LXG6T.js → menu-bar-VXAMTP3E.js} +2 -2
- package/dist/ueditor.cjs +509 -477
- package/dist/ueditor.cjs.map +1 -1
- package/dist/ueditor.d.cts +2 -0
- package/dist/ueditor.d.ts +2 -0
- package/dist/ueditor.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-SCW2XGCE.js.map +0 -1
- package/dist/chunk-V4VZZHV7.js.map +0 -1
- /package/dist/{menu-bar-MX3LXG6T.js.map → menu-bar-VXAMTP3E.js.map} +0 -0
package/dist/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,
|
|
@@ -17524,6 +17549,7 @@ function buildUEditorExtensions({
|
|
|
17524
17549
|
fallbackToDataUrl,
|
|
17525
17550
|
onImageUploadError,
|
|
17526
17551
|
editable = true,
|
|
17552
|
+
enableAutocomplete = true,
|
|
17527
17553
|
fetchMetadata
|
|
17528
17554
|
}) {
|
|
17529
17555
|
return [
|
|
@@ -17650,12 +17676,14 @@ function buildUEditorExtensions({
|
|
|
17650
17676
|
return true;
|
|
17651
17677
|
}
|
|
17652
17678
|
}),
|
|
17653
|
-
|
|
17654
|
-
|
|
17655
|
-
|
|
17656
|
-
|
|
17657
|
-
|
|
17658
|
-
|
|
17679
|
+
...enableAutocomplete ? [
|
|
17680
|
+
SlashCommand.configure({
|
|
17681
|
+
messages: buildSlashCommandMessages(translate),
|
|
17682
|
+
getPortalContainer
|
|
17683
|
+
}),
|
|
17684
|
+
FormulaSuggestion.configure({ getPortalContainer }),
|
|
17685
|
+
EmojiSuggestion.configure({ getPortalContainer })
|
|
17686
|
+
] : [],
|
|
17659
17687
|
Callout,
|
|
17660
17688
|
Bookmark.configure({
|
|
17661
17689
|
fetchMetadata
|
|
@@ -17860,7 +17888,8 @@ function subscribeSharedGlobalEvent(target, type, listener, options) {
|
|
|
17860
17888
|
|
|
17861
17889
|
// src/components/UEditor/menus.tsx
|
|
17862
17890
|
init_portal_context();
|
|
17863
|
-
|
|
17891
|
+
init_table_vertical_align_icons();
|
|
17892
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
17864
17893
|
var FloatingSlashCommandMenu = ({ editor, onClose }) => {
|
|
17865
17894
|
const t = useSmartTranslations("UEditor");
|
|
17866
17895
|
const messages = (0, import_react40.useMemo)(() => buildSlashCommandMessages(t), [t]);
|
|
@@ -17883,7 +17912,7 @@ var FloatingSlashCommandMenu = ({ editor, onClose }) => {
|
|
|
17883
17912
|
if (!portalDocument) return;
|
|
17884
17913
|
return subscribeSharedGlobalEvent(portalDocument, "keydown", handleKeyDown2);
|
|
17885
17914
|
}, [onClose, portalDocument]);
|
|
17886
|
-
return /* @__PURE__ */ (0,
|
|
17915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
17887
17916
|
SlashCommandList,
|
|
17888
17917
|
{
|
|
17889
17918
|
ref: listRef,
|
|
@@ -17900,17 +17929,17 @@ var FloatingMenuContent = ({ editor }) => {
|
|
|
17900
17929
|
const t = useSmartTranslations("UEditor");
|
|
17901
17930
|
const [showCommands, setShowCommands] = (0, import_react40.useState)(false);
|
|
17902
17931
|
if (showCommands) {
|
|
17903
|
-
return /* @__PURE__ */ (0,
|
|
17932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FloatingSlashCommandMenu, { editor, onClose: () => setShowCommands(false) });
|
|
17904
17933
|
}
|
|
17905
|
-
return /* @__PURE__ */ (0,
|
|
17934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
17906
17935
|
"button",
|
|
17907
17936
|
{
|
|
17908
17937
|
type: "button",
|
|
17909
17938
|
onClick: () => setShowCommands(true),
|
|
17910
17939
|
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
17940
|
children: [
|
|
17912
|
-
/* @__PURE__ */ (0,
|
|
17913
|
-
/* @__PURE__ */ (0,
|
|
17941
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Plus, { className: "w-4 h-4 text-muted-foreground group-hover:text-foreground" }),
|
|
17942
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-sm text-muted-foreground group-hover:text-foreground", children: t("floatingMenu.addBlock") })
|
|
17914
17943
|
]
|
|
17915
17944
|
}
|
|
17916
17945
|
);
|
|
@@ -17942,7 +17971,7 @@ function applyTableCellAttribute2(editor, name, value, options = {}) {
|
|
|
17942
17971
|
}
|
|
17943
17972
|
function BorderStylePreviewIcon({ style }) {
|
|
17944
17973
|
const isNone = style === "none";
|
|
17945
|
-
return /* @__PURE__ */ (0,
|
|
17974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
17946
17975
|
"span",
|
|
17947
17976
|
{
|
|
17948
17977
|
"aria-hidden": "true",
|
|
@@ -17954,7 +17983,7 @@ function BorderStylePreviewIcon({ style }) {
|
|
|
17954
17983
|
borderStyle: style,
|
|
17955
17984
|
borderWidth: style === "double" ? 3 : 2
|
|
17956
17985
|
},
|
|
17957
|
-
children: isNone && /* @__PURE__ */ (0,
|
|
17986
|
+
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
17987
|
}
|
|
17959
17988
|
);
|
|
17960
17989
|
}
|
|
@@ -17965,8 +17994,8 @@ function BorderPositionPreviewIcon({ position }) {
|
|
|
17965
17994
|
const showLeft = position === "all" || position === "outer" || position === "left";
|
|
17966
17995
|
const showHorizontal = position === "all" || position === "inner" || position === "horizontal";
|
|
17967
17996
|
const showVertical = position === "all" || position === "inner" || position === "vertical";
|
|
17968
|
-
return /* @__PURE__ */ (0,
|
|
17969
|
-
/* @__PURE__ */ (0,
|
|
17997
|
+
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: [
|
|
17998
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
17970
17999
|
"path",
|
|
17971
18000
|
{
|
|
17972
18001
|
d: "M2 2H18V18H2Z M2 10H18 M10 2V18",
|
|
@@ -17976,12 +18005,12 @@ function BorderPositionPreviewIcon({ position }) {
|
|
|
17976
18005
|
strokeWidth: "1.25"
|
|
17977
18006
|
}
|
|
17978
18007
|
),
|
|
17979
|
-
showTop && /* @__PURE__ */ (0,
|
|
17980
|
-
showRight && /* @__PURE__ */ (0,
|
|
17981
|
-
showBottom && /* @__PURE__ */ (0,
|
|
17982
|
-
showLeft && /* @__PURE__ */ (0,
|
|
17983
|
-
showHorizontal && /* @__PURE__ */ (0,
|
|
17984
|
-
showVertical && /* @__PURE__ */ (0,
|
|
18008
|
+
showTop && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M2 2H18", strokeWidth: "2" }),
|
|
18009
|
+
showRight && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M18 2V18", strokeWidth: "2" }),
|
|
18010
|
+
showBottom && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M2 18H18", strokeWidth: "2" }),
|
|
18011
|
+
showLeft && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M2 2V18", strokeWidth: "2" }),
|
|
18012
|
+
showHorizontal && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M2 10H18", strokeWidth: "2" }),
|
|
18013
|
+
showVertical && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M10 2V18", strokeWidth: "2" })
|
|
17985
18014
|
] });
|
|
17986
18015
|
}
|
|
17987
18016
|
function getBubbleMenuPosition({
|
|
@@ -18213,7 +18242,7 @@ var BubbleMenuContent = ({
|
|
|
18213
18242
|
};
|
|
18214
18243
|
}, [editor, showLinkInput]);
|
|
18215
18244
|
if (showLinkInput) {
|
|
18216
|
-
return /* @__PURE__ */ (0,
|
|
18245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18217
18246
|
LinkInput,
|
|
18218
18247
|
{
|
|
18219
18248
|
initialUrl: editor.getAttributes("link").href || "",
|
|
@@ -18233,12 +18262,12 @@ var BubbleMenuContent = ({
|
|
|
18233
18262
|
const isTextPalette = activeColorPalette === "text";
|
|
18234
18263
|
const isHighlightPalette = activeColorPalette === "highlight";
|
|
18235
18264
|
if (activeColorPalette === "cell-border") {
|
|
18236
|
-
return /* @__PURE__ */ (0,
|
|
18237
|
-
/* @__PURE__ */ (0,
|
|
18238
|
-
/* @__PURE__ */ (0,
|
|
18239
|
-
/* @__PURE__ */ (0,
|
|
18240
|
-
/* @__PURE__ */ (0,
|
|
18241
|
-
/* @__PURE__ */ (0,
|
|
18265
|
+
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: [
|
|
18266
|
+
/* @__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" }),
|
|
18267
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex gap-2", children: [
|
|
18268
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
18269
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { className: "mb-1 block text-xs text-muted-foreground", children: t("tableMenu.borderPosition") || "Border placement" }),
|
|
18270
|
+
/* @__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
18271
|
[
|
|
18243
18272
|
["all", "borderAll"],
|
|
18244
18273
|
["outer", "borderOuter"],
|
|
@@ -18251,7 +18280,7 @@ var BubbleMenuContent = ({
|
|
|
18251
18280
|
["left", "borderLeft"]
|
|
18252
18281
|
].map(([position, labelKey]) => {
|
|
18253
18282
|
const label = t(`tableMenu.${labelKey}`) || position;
|
|
18254
|
-
return /* @__PURE__ */ (0,
|
|
18283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18255
18284
|
"button",
|
|
18256
18285
|
{
|
|
18257
18286
|
type: "button",
|
|
@@ -18263,12 +18292,12 @@ var BubbleMenuContent = ({
|
|
|
18263
18292
|
"inline-flex h-8 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted hover:text-primary",
|
|
18264
18293
|
activeBorderPosition === position ? "bg-primary/10 text-primary" : "bg-muted/40"
|
|
18265
18294
|
),
|
|
18266
|
-
children: /* @__PURE__ */ (0,
|
|
18295
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(BorderPositionPreviewIcon, { position })
|
|
18267
18296
|
},
|
|
18268
18297
|
position
|
|
18269
18298
|
);
|
|
18270
18299
|
}),
|
|
18271
|
-
/* @__PURE__ */ (0,
|
|
18300
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18272
18301
|
"button",
|
|
18273
18302
|
{
|
|
18274
18303
|
type: "button",
|
|
@@ -18277,13 +18306,13 @@ var BubbleMenuContent = ({
|
|
|
18277
18306
|
onMouseDown: (event) => event.preventDefault(),
|
|
18278
18307
|
onClick: clearTableCellBorders,
|
|
18279
18308
|
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,
|
|
18309
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(BorderStylePreviewIcon, { style: "none" })
|
|
18281
18310
|
}
|
|
18282
18311
|
)
|
|
18283
18312
|
] })
|
|
18284
18313
|
] }),
|
|
18285
|
-
/* @__PURE__ */ (0,
|
|
18286
|
-
/* @__PURE__ */ (0,
|
|
18314
|
+
/* @__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: [
|
|
18315
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18287
18316
|
"button",
|
|
18288
18317
|
{
|
|
18289
18318
|
type: "button",
|
|
@@ -18295,10 +18324,10 @@ var BubbleMenuContent = ({
|
|
|
18295
18324
|
"inline-flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:bg-muted",
|
|
18296
18325
|
borderEditMode === "draw" ? "bg-primary/10 text-primary" : "text-muted-foreground"
|
|
18297
18326
|
),
|
|
18298
|
-
children: /* @__PURE__ */ (0,
|
|
18327
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Edit2, { className: "h-4 w-4" })
|
|
18299
18328
|
}
|
|
18300
18329
|
),
|
|
18301
|
-
/* @__PURE__ */ (0,
|
|
18330
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18302
18331
|
"button",
|
|
18303
18332
|
{
|
|
18304
18333
|
type: "button",
|
|
@@ -18310,19 +18339,19 @@ var BubbleMenuContent = ({
|
|
|
18310
18339
|
"inline-flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:bg-muted",
|
|
18311
18340
|
borderEditMode === "erase" ? "bg-destructive/10 text-destructive" : "text-muted-foreground"
|
|
18312
18341
|
),
|
|
18313
|
-
children: /* @__PURE__ */ (0,
|
|
18342
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Eraser, { className: "h-4 w-4" })
|
|
18314
18343
|
}
|
|
18315
18344
|
)
|
|
18316
18345
|
] })
|
|
18317
18346
|
] }),
|
|
18318
|
-
/* @__PURE__ */ (0,
|
|
18319
|
-
/* @__PURE__ */ (0,
|
|
18320
|
-
/* @__PURE__ */ (0,
|
|
18347
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
18348
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderStyle") || "Border Style" }),
|
|
18349
|
+
/* @__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
18350
|
["solid", "Solid"],
|
|
18322
18351
|
["dashed", "Dashed"],
|
|
18323
18352
|
["dotted", "Dotted"],
|
|
18324
18353
|
["double", "Double"]
|
|
18325
|
-
].map(([style, label]) => /* @__PURE__ */ (0,
|
|
18354
|
+
].map(([style, label]) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
18326
18355
|
"button",
|
|
18327
18356
|
{
|
|
18328
18357
|
type: "button",
|
|
@@ -18333,16 +18362,16 @@ var BubbleMenuContent = ({
|
|
|
18333
18362
|
borderStyleDraft === style ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
|
|
18334
18363
|
),
|
|
18335
18364
|
children: [
|
|
18336
|
-
/* @__PURE__ */ (0,
|
|
18337
|
-
/* @__PURE__ */ (0,
|
|
18365
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(BorderStylePreviewIcon, { style }),
|
|
18366
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: label })
|
|
18338
18367
|
]
|
|
18339
18368
|
},
|
|
18340
18369
|
style
|
|
18341
18370
|
)) })
|
|
18342
18371
|
] }),
|
|
18343
|
-
/* @__PURE__ */ (0,
|
|
18344
|
-
/* @__PURE__ */ (0,
|
|
18345
|
-
/* @__PURE__ */ (0,
|
|
18372
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
18373
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderWidth") || "Border Width" }),
|
|
18374
|
+
/* @__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
18375
|
"button",
|
|
18347
18376
|
{
|
|
18348
18377
|
type: "button",
|
|
@@ -18357,15 +18386,15 @@ var BubbleMenuContent = ({
|
|
|
18357
18386
|
width
|
|
18358
18387
|
)) })
|
|
18359
18388
|
] }),
|
|
18360
|
-
/* @__PURE__ */ (0,
|
|
18389
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
18361
18390
|
"button",
|
|
18362
18391
|
{
|
|
18363
18392
|
type: "button",
|
|
18364
18393
|
onClick: () => setActiveColorPalette("cell-border-color"),
|
|
18365
18394
|
className: "flex items-center justify-between w-full h-8 px-2 rounded-md border border-input hover:bg-accent text-xs",
|
|
18366
18395
|
children: [
|
|
18367
|
-
/* @__PURE__ */ (0,
|
|
18368
|
-
/* @__PURE__ */ (0,
|
|
18396
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: t("tableMenu.borderColor") || "Border Color" }),
|
|
18397
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18369
18398
|
"span",
|
|
18370
18399
|
{
|
|
18371
18400
|
className: "w-4 h-4 rounded-full border border-border",
|
|
@@ -18380,7 +18409,7 @@ var BubbleMenuContent = ({
|
|
|
18380
18409
|
] });
|
|
18381
18410
|
}
|
|
18382
18411
|
if (activeColorPalette === "cell-border-color") {
|
|
18383
|
-
return /* @__PURE__ */ (0,
|
|
18412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18384
18413
|
EditorColorPalette,
|
|
18385
18414
|
{
|
|
18386
18415
|
colors: borderColors,
|
|
@@ -18390,7 +18419,7 @@ var BubbleMenuContent = ({
|
|
|
18390
18419
|
}
|
|
18391
18420
|
) });
|
|
18392
18421
|
}
|
|
18393
|
-
return /* @__PURE__ */ (0,
|
|
18422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18394
18423
|
EditorColorPalette,
|
|
18395
18424
|
{
|
|
18396
18425
|
colors: isTextPalette ? textColors : highlightColors,
|
|
@@ -18402,32 +18431,32 @@ var BubbleMenuContent = ({
|
|
|
18402
18431
|
) });
|
|
18403
18432
|
}
|
|
18404
18433
|
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,
|
|
18434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-0.5 p-1", children: [
|
|
18435
|
+
/* @__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" }) }),
|
|
18436
|
+
/* @__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" }) }),
|
|
18437
|
+
/* @__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" }) }),
|
|
18438
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
18439
|
+
/* @__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" }) }),
|
|
18440
|
+
/* @__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" }) }),
|
|
18441
|
+
/* @__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" }) }),
|
|
18442
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
18443
|
+
/* @__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" }) }),
|
|
18444
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18416
18445
|
ToolbarButton,
|
|
18417
18446
|
{
|
|
18418
18447
|
onClick: () => deleteSelectedImage(editor),
|
|
18419
18448
|
title: t("toolbar.imageDelete"),
|
|
18420
18449
|
className: "text-destructive hover:text-destructive",
|
|
18421
|
-
children: /* @__PURE__ */ (0,
|
|
18450
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Trash2, { className: "w-4 h-4" })
|
|
18422
18451
|
}
|
|
18423
18452
|
)
|
|
18424
18453
|
] });
|
|
18425
18454
|
}
|
|
18426
18455
|
if (showFormulaPanel && isInTable3) {
|
|
18427
|
-
return /* @__PURE__ */ (0,
|
|
18428
|
-
/* @__PURE__ */ (0,
|
|
18429
|
-
/* @__PURE__ */ (0,
|
|
18430
|
-
/* @__PURE__ */ (0,
|
|
18456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "w-72 p-2", children: [
|
|
18457
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
|
|
18458
|
+
/* @__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" }),
|
|
18459
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18431
18460
|
"button",
|
|
18432
18461
|
{
|
|
18433
18462
|
type: "button",
|
|
@@ -18440,7 +18469,7 @@ var BubbleMenuContent = ({
|
|
|
18440
18469
|
}
|
|
18441
18470
|
)
|
|
18442
18471
|
] }),
|
|
18443
|
-
/* @__PURE__ */ (0,
|
|
18472
|
+
/* @__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
18473
|
"input",
|
|
18445
18474
|
{
|
|
18446
18475
|
value: formulaDraft,
|
|
@@ -18461,15 +18490,15 @@ var BubbleMenuContent = ({
|
|
|
18461
18490
|
className: "h-full min-w-0 flex-1 bg-transparent px-2 text-sm font-medium text-foreground outline-none"
|
|
18462
18491
|
}
|
|
18463
18492
|
) }),
|
|
18464
|
-
/* @__PURE__ */ (0,
|
|
18465
|
-
/* @__PURE__ */ (0,
|
|
18466
|
-
/* @__PURE__ */ (0,
|
|
18493
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mt-2", children: [
|
|
18494
|
+
/* @__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" }),
|
|
18495
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "grid grid-cols-5 gap-1", children: [
|
|
18467
18496
|
["text", "Text"],
|
|
18468
18497
|
["number", "123"],
|
|
18469
18498
|
["currency", "$"],
|
|
18470
18499
|
["percent", "%"],
|
|
18471
18500
|
["date", "Date"]
|
|
18472
|
-
].map(([format, label]) => /* @__PURE__ */ (0,
|
|
18501
|
+
].map(([format, label]) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18473
18502
|
"button",
|
|
18474
18503
|
{
|
|
18475
18504
|
type: "button",
|
|
@@ -18483,8 +18512,8 @@ var BubbleMenuContent = ({
|
|
|
18483
18512
|
format
|
|
18484
18513
|
)) })
|
|
18485
18514
|
] }),
|
|
18486
|
-
/* @__PURE__ */ (0,
|
|
18487
|
-
/* @__PURE__ */ (0,
|
|
18515
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mt-2 grid grid-cols-3 gap-1", children: [
|
|
18516
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18488
18517
|
"button",
|
|
18489
18518
|
{
|
|
18490
18519
|
type: "button",
|
|
@@ -18497,7 +18526,7 @@ var BubbleMenuContent = ({
|
|
|
18497
18526
|
children: t("tableMenu.apply") || "Apply"
|
|
18498
18527
|
}
|
|
18499
18528
|
),
|
|
18500
|
-
/* @__PURE__ */ (0,
|
|
18529
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18501
18530
|
"button",
|
|
18502
18531
|
{
|
|
18503
18532
|
type: "button",
|
|
@@ -18509,7 +18538,7 @@ var BubbleMenuContent = ({
|
|
|
18509
18538
|
children: t("tableMenu.clear") || "Clear"
|
|
18510
18539
|
}
|
|
18511
18540
|
),
|
|
18512
|
-
/* @__PURE__ */ (0,
|
|
18541
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18513
18542
|
"button",
|
|
18514
18543
|
{
|
|
18515
18544
|
type: "button",
|
|
@@ -18522,10 +18551,10 @@ var BubbleMenuContent = ({
|
|
|
18522
18551
|
] });
|
|
18523
18552
|
}
|
|
18524
18553
|
if (showTypographyPanel) {
|
|
18525
|
-
return /* @__PURE__ */ (0,
|
|
18526
|
-
/* @__PURE__ */ (0,
|
|
18527
|
-
/* @__PURE__ */ (0,
|
|
18528
|
-
/* @__PURE__ */ (0,
|
|
18554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "w-72 p-2", children: [
|
|
18555
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
|
|
18556
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("toolbar.textStyle") }),
|
|
18557
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18529
18558
|
"button",
|
|
18530
18559
|
{
|
|
18531
18560
|
type: "button",
|
|
@@ -18535,11 +18564,11 @@ var BubbleMenuContent = ({
|
|
|
18535
18564
|
}
|
|
18536
18565
|
)
|
|
18537
18566
|
] }),
|
|
18538
|
-
/* @__PURE__ */ (0,
|
|
18539
|
-
/* @__PURE__ */ (0,
|
|
18540
|
-
/* @__PURE__ */ (0,
|
|
18541
|
-
/* @__PURE__ */ (0,
|
|
18542
|
-
/* @__PURE__ */ (0,
|
|
18567
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "space-y-2", children: [
|
|
18568
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
|
|
18569
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.fontSize") }),
|
|
18570
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: cn("flex h-9 items-center overflow-hidden rounded-md bg-muted/40", formControlGroupOutlineClass), children: [
|
|
18571
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18543
18572
|
"input",
|
|
18544
18573
|
{
|
|
18545
18574
|
type: "number",
|
|
@@ -18563,8 +18592,8 @@ var BubbleMenuContent = ({
|
|
|
18563
18592
|
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
18593
|
}
|
|
18565
18594
|
),
|
|
18566
|
-
/* @__PURE__ */ (0,
|
|
18567
|
-
/* @__PURE__ */ (0,
|
|
18595
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "border-l border-border/50 px-2 text-[11px] text-muted-foreground", children: "px" }),
|
|
18596
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18568
18597
|
"button",
|
|
18569
18598
|
{
|
|
18570
18599
|
type: "button",
|
|
@@ -18574,12 +18603,12 @@ var BubbleMenuContent = ({
|
|
|
18574
18603
|
"flex h-full w-9 items-center justify-center border-l border-border/50 transition-colors hover:bg-muted",
|
|
18575
18604
|
showFontSizeOptions && "bg-primary/10 text-primary"
|
|
18576
18605
|
),
|
|
18577
|
-
children: /* @__PURE__ */ (0,
|
|
18606
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.ChevronDown, { className: "h-4 w-4" })
|
|
18578
18607
|
}
|
|
18579
18608
|
)
|
|
18580
18609
|
] }),
|
|
18581
|
-
showFontSizeOptions && /* @__PURE__ */ (0,
|
|
18582
|
-
/* @__PURE__ */ (0,
|
|
18610
|
+
showFontSizeOptions && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mt-1 grid grid-cols-4 gap-1", children: [
|
|
18611
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18583
18612
|
"button",
|
|
18584
18613
|
{
|
|
18585
18614
|
type: "button",
|
|
@@ -18594,7 +18623,7 @@ var BubbleMenuContent = ({
|
|
|
18594
18623
|
children: "A"
|
|
18595
18624
|
}
|
|
18596
18625
|
),
|
|
18597
|
-
quickFontSizes.map((option) => /* @__PURE__ */ (0,
|
|
18626
|
+
quickFontSizes.map((option) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18598
18627
|
"button",
|
|
18599
18628
|
{
|
|
18600
18629
|
type: "button",
|
|
@@ -18612,10 +18641,10 @@ var BubbleMenuContent = ({
|
|
|
18612
18641
|
))
|
|
18613
18642
|
] })
|
|
18614
18643
|
] }),
|
|
18615
|
-
/* @__PURE__ */ (0,
|
|
18616
|
-
/* @__PURE__ */ (0,
|
|
18617
|
-
/* @__PURE__ */ (0,
|
|
18618
|
-
/* @__PURE__ */ (0,
|
|
18644
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
|
|
18645
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.lineHeight") }),
|
|
18646
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "grid grid-cols-4 gap-1", children: [
|
|
18647
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18619
18648
|
"button",
|
|
18620
18649
|
{
|
|
18621
18650
|
type: "button",
|
|
@@ -18627,7 +18656,7 @@ var BubbleMenuContent = ({
|
|
|
18627
18656
|
children: "LH"
|
|
18628
18657
|
}
|
|
18629
18658
|
),
|
|
18630
|
-
quickLineHeights.map((option) => /* @__PURE__ */ (0,
|
|
18659
|
+
quickLineHeights.map((option) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18631
18660
|
"button",
|
|
18632
18661
|
{
|
|
18633
18662
|
type: "button",
|
|
@@ -18642,8 +18671,8 @@ var BubbleMenuContent = ({
|
|
|
18642
18671
|
))
|
|
18643
18672
|
] })
|
|
18644
18673
|
] }),
|
|
18645
|
-
/* @__PURE__ */ (0,
|
|
18646
|
-
/* @__PURE__ */ (0,
|
|
18674
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "grid grid-cols-2 gap-1 border-t border-border/40 pt-2", children: [
|
|
18675
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
18647
18676
|
"button",
|
|
18648
18677
|
{
|
|
18649
18678
|
type: "button",
|
|
@@ -18653,12 +18682,12 @@ var BubbleMenuContent = ({
|
|
|
18653
18682
|
editor.isActive("subscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
|
|
18654
18683
|
),
|
|
18655
18684
|
children: [
|
|
18656
|
-
/* @__PURE__ */ (0,
|
|
18685
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Subscript, { className: "h-4 w-4" }),
|
|
18657
18686
|
t("toolbar.subscript")
|
|
18658
18687
|
]
|
|
18659
18688
|
}
|
|
18660
18689
|
),
|
|
18661
|
-
/* @__PURE__ */ (0,
|
|
18690
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
18662
18691
|
"button",
|
|
18663
18692
|
{
|
|
18664
18693
|
type: "button",
|
|
@@ -18668,7 +18697,7 @@ var BubbleMenuContent = ({
|
|
|
18668
18697
|
editor.isActive("superscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
|
|
18669
18698
|
),
|
|
18670
18699
|
children: [
|
|
18671
|
-
/* @__PURE__ */ (0,
|
|
18700
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Superscript, { className: "h-4 w-4" }),
|
|
18672
18701
|
t("toolbar.superscript")
|
|
18673
18702
|
]
|
|
18674
18703
|
}
|
|
@@ -18677,20 +18706,20 @@ var BubbleMenuContent = ({
|
|
|
18677
18706
|
] })
|
|
18678
18707
|
] });
|
|
18679
18708
|
}
|
|
18680
|
-
const VerticalAlignActiveIcon = currentCellVerticalAlign === "middle" ?
|
|
18709
|
+
const VerticalAlignActiveIcon = currentCellVerticalAlign === "middle" ? TableVerticalAlignMiddleIcon : currentCellVerticalAlign === "bottom" ? TableVerticalAlignBottomIcon : TableVerticalAlignTopIcon;
|
|
18681
18710
|
if (isTableCellSelection) {
|
|
18682
|
-
return /* @__PURE__ */ (0,
|
|
18683
|
-
/* @__PURE__ */ (0,
|
|
18711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-0.5 p-1", "data-ueditor-cell-inspector": "", children: [
|
|
18712
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18684
18713
|
ToolbarButton,
|
|
18685
18714
|
{
|
|
18686
18715
|
onMouseDown: () => onKeepOpenChange?.(true),
|
|
18687
18716
|
onClick: () => setActiveColorPalette("cell-bg"),
|
|
18688
18717
|
active: Boolean(currentCellBgColor),
|
|
18689
18718
|
title: t("tableMenu.cellBackground") || "Cell background",
|
|
18690
|
-
children: /* @__PURE__ */ (0,
|
|
18719
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CellBgColorIcon, { color: currentCellBgColor })
|
|
18691
18720
|
}
|
|
18692
18721
|
),
|
|
18693
|
-
/* @__PURE__ */ (0,
|
|
18722
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18694
18723
|
ToolbarButton,
|
|
18695
18724
|
{
|
|
18696
18725
|
onMouseDown: () => onKeepOpenChange?.(true),
|
|
@@ -18699,7 +18728,7 @@ var BubbleMenuContent = ({
|
|
|
18699
18728
|
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
18729
|
),
|
|
18701
18730
|
title: t("tableMenu.cellBorder") || "Cell border",
|
|
18702
|
-
children: /* @__PURE__ */ (0,
|
|
18731
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18703
18732
|
CellBorderIcon,
|
|
18704
18733
|
{
|
|
18705
18734
|
color: editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor
|
|
@@ -18707,7 +18736,7 @@ var BubbleMenuContent = ({
|
|
|
18707
18736
|
)
|
|
18708
18737
|
}
|
|
18709
18738
|
),
|
|
18710
|
-
/* @__PURE__ */ (0,
|
|
18739
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18711
18740
|
ToolbarButton,
|
|
18712
18741
|
{
|
|
18713
18742
|
onMouseDown: () => onKeepOpenChange?.(true),
|
|
@@ -18717,10 +18746,10 @@ var BubbleMenuContent = ({
|
|
|
18717
18746
|
},
|
|
18718
18747
|
active: Boolean(currentCellFormula),
|
|
18719
18748
|
title: t("tableMenu.formula") || "Formula",
|
|
18720
|
-
children: /* @__PURE__ */ (0,
|
|
18749
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Sigma, { className: "w-4 h-4" })
|
|
18721
18750
|
}
|
|
18722
18751
|
),
|
|
18723
|
-
/* @__PURE__ */ (0,
|
|
18752
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18724
18753
|
ToolbarButton,
|
|
18725
18754
|
{
|
|
18726
18755
|
onClick: () => {
|
|
@@ -18733,10 +18762,10 @@ var BubbleMenuContent = ({
|
|
|
18733
18762
|
active: canSplitCell,
|
|
18734
18763
|
disabled: !canMergeCells && !canSplitCell,
|
|
18735
18764
|
title: canSplitCell ? t("tableMenu.splitCell") || "Split cell" : t("tableMenu.mergeCells") || "Merge cells",
|
|
18736
|
-
children: /* @__PURE__ */ (0,
|
|
18765
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.TableCellsMerge, { className: "w-4 h-4" })
|
|
18737
18766
|
}
|
|
18738
18767
|
),
|
|
18739
|
-
/* @__PURE__ */ (0,
|
|
18768
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18740
18769
|
ToolbarButton,
|
|
18741
18770
|
{
|
|
18742
18771
|
onClick: () => applyTableCellAttribute2(
|
|
@@ -18747,14 +18776,14 @@ var BubbleMenuContent = ({
|
|
|
18747
18776
|
),
|
|
18748
18777
|
active: currentCellTextWrap !== "nowrap",
|
|
18749
18778
|
title: currentCellTextWrap === "nowrap" ? t("tableMenu.wrapText") : t("tableMenu.noWrapText"),
|
|
18750
|
-
children: /* @__PURE__ */ (0,
|
|
18779
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.WrapText, { className: "h-4 w-4" })
|
|
18751
18780
|
}
|
|
18752
18781
|
),
|
|
18753
|
-
/* @__PURE__ */ (0,
|
|
18782
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
18754
18783
|
DropdownMenu,
|
|
18755
18784
|
{
|
|
18756
18785
|
onOpenChange: onKeepOpenChange,
|
|
18757
|
-
trigger: /* @__PURE__ */ (0,
|
|
18786
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
18758
18787
|
ToolbarButton,
|
|
18759
18788
|
{
|
|
18760
18789
|
onMouseDown: () => onKeepOpenChange?.(true),
|
|
@@ -18762,34 +18791,34 @@ var BubbleMenuContent = ({
|
|
|
18762
18791
|
},
|
|
18763
18792
|
title: t("tableMenu.alignVertical") || "Vertical alignment",
|
|
18764
18793
|
children: [
|
|
18765
|
-
/* @__PURE__ */ (0,
|
|
18766
|
-
/* @__PURE__ */ (0,
|
|
18794
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(VerticalAlignActiveIcon, { className: "w-4 h-4" }),
|
|
18795
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.ChevronDown, { className: "w-3 h-3" })
|
|
18767
18796
|
]
|
|
18768
18797
|
}
|
|
18769
18798
|
),
|
|
18770
18799
|
children: [
|
|
18771
|
-
/* @__PURE__ */ (0,
|
|
18800
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18772
18801
|
DropdownMenuItem,
|
|
18773
18802
|
{
|
|
18774
|
-
icon:
|
|
18803
|
+
icon: TableVerticalAlignTopIcon,
|
|
18775
18804
|
label: t("tableMenu.alignVerticalTop") || "Align top",
|
|
18776
18805
|
onClick: () => applyTableCellAttribute2(editor, "verticalAlign", "top", { focus: false }),
|
|
18777
18806
|
active: currentCellVerticalAlign === "top"
|
|
18778
18807
|
}
|
|
18779
18808
|
),
|
|
18780
|
-
/* @__PURE__ */ (0,
|
|
18809
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18781
18810
|
DropdownMenuItem,
|
|
18782
18811
|
{
|
|
18783
|
-
icon:
|
|
18812
|
+
icon: TableVerticalAlignMiddleIcon,
|
|
18784
18813
|
label: t("tableMenu.alignVerticalMiddle") || "Align middle",
|
|
18785
18814
|
onClick: () => applyTableCellAttribute2(editor, "verticalAlign", "middle", { focus: false }),
|
|
18786
18815
|
active: currentCellVerticalAlign === "middle"
|
|
18787
18816
|
}
|
|
18788
18817
|
),
|
|
18789
|
-
/* @__PURE__ */ (0,
|
|
18818
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18790
18819
|
DropdownMenuItem,
|
|
18791
18820
|
{
|
|
18792
|
-
icon:
|
|
18821
|
+
icon: TableVerticalAlignBottomIcon,
|
|
18793
18822
|
label: t("tableMenu.alignVerticalBottom") || "Align bottom",
|
|
18794
18823
|
onClick: () => applyTableCellAttribute2(editor, "verticalAlign", "bottom", { focus: false }),
|
|
18795
18824
|
active: currentCellVerticalAlign === "bottom"
|
|
@@ -18798,11 +18827,11 @@ var BubbleMenuContent = ({
|
|
|
18798
18827
|
]
|
|
18799
18828
|
}
|
|
18800
18829
|
),
|
|
18801
|
-
/* @__PURE__ */ (0,
|
|
18830
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
18802
18831
|
DropdownMenu,
|
|
18803
18832
|
{
|
|
18804
18833
|
onOpenChange: onKeepOpenChange,
|
|
18805
|
-
trigger: /* @__PURE__ */ (0,
|
|
18834
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
18806
18835
|
ToolbarButton,
|
|
18807
18836
|
{
|
|
18808
18837
|
onMouseDown: () => onKeepOpenChange?.(true),
|
|
@@ -18810,13 +18839,13 @@ var BubbleMenuContent = ({
|
|
|
18810
18839
|
},
|
|
18811
18840
|
title: t("tableMenu.textDirection"),
|
|
18812
18841
|
children: [
|
|
18813
|
-
currentCellTextDirection === "vertical" ? /* @__PURE__ */ (0,
|
|
18814
|
-
/* @__PURE__ */ (0,
|
|
18842
|
+
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" }),
|
|
18843
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.ChevronDown, { className: "w-3 h-3" })
|
|
18815
18844
|
]
|
|
18816
18845
|
}
|
|
18817
18846
|
),
|
|
18818
18847
|
children: [
|
|
18819
|
-
/* @__PURE__ */ (0,
|
|
18848
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18820
18849
|
DropdownMenuItem,
|
|
18821
18850
|
{
|
|
18822
18851
|
icon: import_lucide_react16.ArrowRight,
|
|
@@ -18825,7 +18854,7 @@ var BubbleMenuContent = ({
|
|
|
18825
18854
|
active: currentCellTextDirection === "horizontal"
|
|
18826
18855
|
}
|
|
18827
18856
|
),
|
|
18828
|
-
/* @__PURE__ */ (0,
|
|
18857
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18829
18858
|
DropdownMenuItem,
|
|
18830
18859
|
{
|
|
18831
18860
|
icon: import_lucide_react16.ArrowDown,
|
|
@@ -18839,22 +18868,22 @@ var BubbleMenuContent = ({
|
|
|
18839
18868
|
)
|
|
18840
18869
|
] });
|
|
18841
18870
|
}
|
|
18842
|
-
return /* @__PURE__ */ (0,
|
|
18843
|
-
/* @__PURE__ */ (0,
|
|
18844
|
-
/* @__PURE__ */ (0,
|
|
18845
|
-
/* @__PURE__ */ (0,
|
|
18871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-0.5 p-1", children: [
|
|
18872
|
+
/* @__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" }) }),
|
|
18873
|
+
/* @__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" }) }),
|
|
18874
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18846
18875
|
ToolbarButton,
|
|
18847
18876
|
{
|
|
18848
18877
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
18849
18878
|
active: editor.isActive("underline"),
|
|
18850
18879
|
title: t("toolbar.underline"),
|
|
18851
|
-
children: /* @__PURE__ */ (0,
|
|
18880
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Underline, { className: "w-4 h-4" })
|
|
18852
18881
|
}
|
|
18853
18882
|
),
|
|
18854
|
-
/* @__PURE__ */ (0,
|
|
18855
|
-
/* @__PURE__ */ (0,
|
|
18856
|
-
/* @__PURE__ */ (0,
|
|
18857
|
-
/* @__PURE__ */ (0,
|
|
18883
|
+
/* @__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" }) }),
|
|
18884
|
+
/* @__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" }) }),
|
|
18885
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
18886
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18858
18887
|
ToolbarButton,
|
|
18859
18888
|
{
|
|
18860
18889
|
onMouseDown: () => {
|
|
@@ -18865,18 +18894,18 @@ var BubbleMenuContent = ({
|
|
|
18865
18894
|
},
|
|
18866
18895
|
active: editor.isActive("link"),
|
|
18867
18896
|
title: t("toolbar.link"),
|
|
18868
|
-
children: /* @__PURE__ */ (0,
|
|
18897
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Link, { className: "w-4 h-4" })
|
|
18869
18898
|
}
|
|
18870
18899
|
),
|
|
18871
|
-
/* @__PURE__ */ (0,
|
|
18872
|
-
/* @__PURE__ */ (0,
|
|
18873
|
-
/* @__PURE__ */ (0,
|
|
18900
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolbarButton, { onClick: () => setActiveColorPalette("text"), title: t("colors.textColor"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TextColorIcon, { color: currentTextColor }) }),
|
|
18901
|
+
/* @__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 }) }),
|
|
18902
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18874
18903
|
ToolbarButton,
|
|
18875
18904
|
{
|
|
18876
18905
|
onClick: () => setShowTypographyPanel(true),
|
|
18877
18906
|
active: Boolean(currentFontSize || currentLineHeight || editor.isActive("subscript") || editor.isActive("superscript")),
|
|
18878
18907
|
title: t("toolbar.textStyle"),
|
|
18879
|
-
children: /* @__PURE__ */ (0,
|
|
18908
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Type, { className: "w-4 h-4" })
|
|
18880
18909
|
}
|
|
18881
18910
|
)
|
|
18882
18911
|
] });
|
|
@@ -18891,12 +18920,12 @@ var LinkPreviewContent = ({ editor, onEdit }) => {
|
|
|
18891
18920
|
const handleUnlink = () => {
|
|
18892
18921
|
editor.chain().focus().unsetLink().run();
|
|
18893
18922
|
};
|
|
18894
|
-
return /* @__PURE__ */ (0,
|
|
18895
|
-
/* @__PURE__ */ (0,
|
|
18896
|
-
/* @__PURE__ */ (0,
|
|
18897
|
-
/* @__PURE__ */ (0,
|
|
18898
|
-
/* @__PURE__ */ (0,
|
|
18899
|
-
/* @__PURE__ */ (0,
|
|
18923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-1 p-1 max-w-sm", children: [
|
|
18924
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-xs text-muted-foreground font-mono px-2 truncate max-w-45", children: url }),
|
|
18925
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
18926
|
+
/* @__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" }) }),
|
|
18927
|
+
/* @__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" }) }),
|
|
18928
|
+
/* @__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
18929
|
] });
|
|
18901
18930
|
};
|
|
18902
18931
|
var CustomBubbleMenu = ({
|
|
@@ -19091,7 +19120,7 @@ var CustomBubbleMenu = ({
|
|
|
19091
19120
|
const context = getBubbleMenuContext(editor);
|
|
19092
19121
|
if (context === "none") return null;
|
|
19093
19122
|
return (0, import_react_dom3.createPortal)(
|
|
19094
|
-
/* @__PURE__ */ (0,
|
|
19123
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
19095
19124
|
"div",
|
|
19096
19125
|
{
|
|
19097
19126
|
ref: menuRef,
|
|
@@ -19115,7 +19144,7 @@ var CustomBubbleMenu = ({
|
|
|
19115
19144
|
}
|
|
19116
19145
|
e.preventDefault();
|
|
19117
19146
|
},
|
|
19118
|
-
children: context === "link" && !keepOpen && !linkInputOpen ? /* @__PURE__ */ (0,
|
|
19147
|
+
children: context === "link" && !keepOpen && !linkInputOpen ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
19119
19148
|
LinkPreviewContent,
|
|
19120
19149
|
{
|
|
19121
19150
|
editor,
|
|
@@ -19124,7 +19153,7 @@ var CustomBubbleMenu = ({
|
|
|
19124
19153
|
setKeepOpen(true);
|
|
19125
19154
|
}
|
|
19126
19155
|
}
|
|
19127
|
-
) : /* @__PURE__ */ (0,
|
|
19156
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
19128
19157
|
BubbleMenuContent,
|
|
19129
19158
|
{
|
|
19130
19159
|
editor,
|
|
@@ -19189,7 +19218,7 @@ var CustomFloatingMenu = ({ editor }) => {
|
|
|
19189
19218
|
}, [editor, editorWindow]);
|
|
19190
19219
|
if (!isVisible || !portalContainer) return null;
|
|
19191
19220
|
return (0, import_react_dom3.createPortal)(
|
|
19192
|
-
/* @__PURE__ */ (0,
|
|
19221
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
19193
19222
|
"div",
|
|
19194
19223
|
{
|
|
19195
19224
|
"data-popover": true,
|
|
@@ -19200,7 +19229,7 @@ var CustomFloatingMenu = ({ editor }) => {
|
|
|
19200
19229
|
transform: "translate(-50%, -100%)"
|
|
19201
19230
|
},
|
|
19202
19231
|
onMouseDown: (e) => e.preventDefault(),
|
|
19203
|
-
children: /* @__PURE__ */ (0,
|
|
19232
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FloatingMenuContent, { editor })
|
|
19204
19233
|
}
|
|
19205
19234
|
),
|
|
19206
19235
|
portalContainer
|
|
@@ -19211,7 +19240,7 @@ var CustomFloatingMenu = ({ editor }) => {
|
|
|
19211
19240
|
init_useSmartTranslations();
|
|
19212
19241
|
var import_react41 = require("@tiptap/react");
|
|
19213
19242
|
init_cn();
|
|
19214
|
-
var
|
|
19243
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
19215
19244
|
var CharacterCountDisplay = ({ editor, maxCharacters }) => {
|
|
19216
19245
|
const t = useSmartTranslations("UEditor");
|
|
19217
19246
|
const { characterCount, wordCount } = (0, import_react41.useEditorState)({
|
|
@@ -19225,18 +19254,18 @@ var CharacterCountDisplay = ({ editor, maxCharacters }) => {
|
|
|
19225
19254
|
}
|
|
19226
19255
|
});
|
|
19227
19256
|
const percentage = maxCharacters ? Math.round(characterCount / maxCharacters * 100) : 0;
|
|
19228
|
-
return /* @__PURE__ */ (0,
|
|
19229
|
-
/* @__PURE__ */ (0,
|
|
19257
|
+
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: [
|
|
19258
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
19230
19259
|
wordCount,
|
|
19231
19260
|
" ",
|
|
19232
19261
|
t("words")
|
|
19233
19262
|
] }),
|
|
19234
|
-
/* @__PURE__ */ (0,
|
|
19263
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
19235
19264
|
characterCount,
|
|
19236
19265
|
" ",
|
|
19237
19266
|
t("characters")
|
|
19238
19267
|
] }),
|
|
19239
|
-
maxCharacters && /* @__PURE__ */ (0,
|
|
19268
|
+
maxCharacters && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: cn(percentage > 90 && "text-destructive", percentage > 100 && "font-bold"), children: [
|
|
19240
19269
|
characterCount,
|
|
19241
19270
|
"/",
|
|
19242
19271
|
maxCharacters
|
|
@@ -24210,7 +24239,7 @@ function buildTableHoverState({
|
|
|
24210
24239
|
}
|
|
24211
24240
|
|
|
24212
24241
|
// src/components/UEditor/table-drag-preview.tsx
|
|
24213
|
-
var
|
|
24242
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
24214
24243
|
function TableDragPreview({
|
|
24215
24244
|
columnDragLabel,
|
|
24216
24245
|
dragPreview,
|
|
@@ -24221,9 +24250,9 @@ function TableDragPreview({
|
|
|
24221
24250
|
const expandPreviewWidth = dragPreview.kind === "add-column" ? layout.tableWidth + dragPreview.previewCols * layout.avgColumnWidth : layout.tableWidth;
|
|
24222
24251
|
const expandPreviewHeight = dragPreview.kind === "add-row" ? layout.tableHeight + dragPreview.previewRows * layout.avgRowHeight : layout.tableHeight;
|
|
24223
24252
|
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,
|
|
24253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
24254
|
+
dragPreview.kind === "row" && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
24255
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
24227
24256
|
"div",
|
|
24228
24257
|
{
|
|
24229
24258
|
"aria-hidden": "true",
|
|
@@ -24236,7 +24265,7 @@ function TableDragPreview({
|
|
|
24236
24265
|
}
|
|
24237
24266
|
}
|
|
24238
24267
|
),
|
|
24239
|
-
/* @__PURE__ */ (0,
|
|
24268
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
24240
24269
|
"div",
|
|
24241
24270
|
{
|
|
24242
24271
|
"aria-hidden": "true",
|
|
@@ -24250,8 +24279,8 @@ function TableDragPreview({
|
|
|
24250
24279
|
}
|
|
24251
24280
|
)
|
|
24252
24281
|
] }),
|
|
24253
|
-
dragPreview.kind === "column" && /* @__PURE__ */ (0,
|
|
24254
|
-
/* @__PURE__ */ (0,
|
|
24282
|
+
dragPreview.kind === "column" && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
24283
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
24255
24284
|
"div",
|
|
24256
24285
|
{
|
|
24257
24286
|
"aria-hidden": "true",
|
|
@@ -24264,7 +24293,7 @@ function TableDragPreview({
|
|
|
24264
24293
|
}
|
|
24265
24294
|
}
|
|
24266
24295
|
),
|
|
24267
|
-
/* @__PURE__ */ (0,
|
|
24296
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
24268
24297
|
"div",
|
|
24269
24298
|
{
|
|
24270
24299
|
"aria-hidden": "true",
|
|
@@ -24278,7 +24307,7 @@ function TableDragPreview({
|
|
|
24278
24307
|
}
|
|
24279
24308
|
)
|
|
24280
24309
|
] }),
|
|
24281
|
-
(dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */ (0,
|
|
24310
|
+
(dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
24282
24311
|
"div",
|
|
24283
24312
|
{
|
|
24284
24313
|
"aria-hidden": "true",
|
|
@@ -24291,7 +24320,7 @@ function TableDragPreview({
|
|
|
24291
24320
|
}
|
|
24292
24321
|
}
|
|
24293
24322
|
),
|
|
24294
|
-
/* @__PURE__ */ (0,
|
|
24323
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
24295
24324
|
"div",
|
|
24296
24325
|
{
|
|
24297
24326
|
role: "status",
|
|
@@ -24309,7 +24338,7 @@ function TableDragPreview({
|
|
|
24309
24338
|
// src/components/UEditor/table-add-rails.tsx
|
|
24310
24339
|
init_cn();
|
|
24311
24340
|
init_Tooltip();
|
|
24312
|
-
var
|
|
24341
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
24313
24342
|
var ADD_COLUMN_RAIL_GAP = 4;
|
|
24314
24343
|
var ADD_ROW_RAIL_GAP = 4;
|
|
24315
24344
|
var BUTTON_LONG_SIZE = 36;
|
|
@@ -24334,13 +24363,13 @@ function TableAddRails({
|
|
|
24334
24363
|
const rowRailLeft = visibleBounds.left + Math.max(0, (visibleBounds.width - BUTTON_LONG_SIZE) / 2);
|
|
24335
24364
|
const showColumnRail = controlsVisible || addColumnVisible;
|
|
24336
24365
|
const showRowRail = controlsVisible || addRowVisible;
|
|
24337
|
-
return /* @__PURE__ */ (0,
|
|
24338
|
-
/* @__PURE__ */ (0,
|
|
24366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
24367
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
24339
24368
|
Tooltip,
|
|
24340
24369
|
{
|
|
24341
24370
|
placement: "right",
|
|
24342
|
-
content: /* @__PURE__ */ (0,
|
|
24343
|
-
children: /* @__PURE__ */ (0,
|
|
24371
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xs font-medium", children: quickAddColumnLabel }),
|
|
24372
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
24344
24373
|
"button",
|
|
24345
24374
|
{
|
|
24346
24375
|
type: "button",
|
|
@@ -24368,17 +24397,17 @@ function TableAddRails({
|
|
|
24368
24397
|
transform: showColumnRail ? "scale(1)" : "scale(0.85)",
|
|
24369
24398
|
pointerEvents: showColumnRail ? "auto" : "none"
|
|
24370
24399
|
},
|
|
24371
|
-
children: /* @__PURE__ */ (0,
|
|
24400
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm font-medium leading-none", children: "+" })
|
|
24372
24401
|
}
|
|
24373
24402
|
)
|
|
24374
24403
|
}
|
|
24375
24404
|
),
|
|
24376
|
-
/* @__PURE__ */ (0,
|
|
24405
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
24377
24406
|
Tooltip,
|
|
24378
24407
|
{
|
|
24379
24408
|
placement: "bottom",
|
|
24380
|
-
content: /* @__PURE__ */ (0,
|
|
24381
|
-
children: /* @__PURE__ */ (0,
|
|
24409
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xs font-medium", children: quickAddRowLabel }),
|
|
24410
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
24382
24411
|
"button",
|
|
24383
24412
|
{
|
|
24384
24413
|
type: "button",
|
|
@@ -24404,7 +24433,7 @@ function TableAddRails({
|
|
|
24404
24433
|
transform: showRowRail ? "scale(1)" : "scale(0.85)",
|
|
24405
24434
|
pointerEvents: showRowRail ? "auto" : "none"
|
|
24406
24435
|
},
|
|
24407
|
-
children: /* @__PURE__ */ (0,
|
|
24436
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm font-medium leading-none", children: "+" })
|
|
24408
24437
|
}
|
|
24409
24438
|
)
|
|
24410
24439
|
}
|
|
@@ -24417,7 +24446,7 @@ var import_lucide_react17 = require("lucide-react");
|
|
|
24417
24446
|
init_cn();
|
|
24418
24447
|
init_DropdownMenu();
|
|
24419
24448
|
init_Tooltip();
|
|
24420
|
-
var
|
|
24449
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
24421
24450
|
function TableControlMenu({
|
|
24422
24451
|
controlsVisible,
|
|
24423
24452
|
isOpen,
|
|
@@ -24429,7 +24458,7 @@ function TableControlMenu({
|
|
|
24429
24458
|
top
|
|
24430
24459
|
}) {
|
|
24431
24460
|
const shown = controlsVisible || menuVisible || isOpen;
|
|
24432
|
-
return /* @__PURE__ */ (0,
|
|
24461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
24433
24462
|
"div",
|
|
24434
24463
|
{
|
|
24435
24464
|
className: "absolute z-30",
|
|
@@ -24438,13 +24467,13 @@ function TableControlMenu({
|
|
|
24438
24467
|
top,
|
|
24439
24468
|
left
|
|
24440
24469
|
},
|
|
24441
|
-
children: /* @__PURE__ */ (0,
|
|
24470
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
24442
24471
|
Tooltip,
|
|
24443
24472
|
{
|
|
24444
24473
|
placement: "top",
|
|
24445
24474
|
disabled: isOpen,
|
|
24446
|
-
content: /* @__PURE__ */ (0,
|
|
24447
|
-
children: /* @__PURE__ */ (0,
|
|
24475
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-xs font-medium", children: label }),
|
|
24476
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
24448
24477
|
DropdownMenu,
|
|
24449
24478
|
{
|
|
24450
24479
|
placement: "bottom-start",
|
|
@@ -24452,7 +24481,7 @@ function TableControlMenu({
|
|
|
24452
24481
|
onOpenChange,
|
|
24453
24482
|
contentClassName: "p-2",
|
|
24454
24483
|
items,
|
|
24455
|
-
trigger: /* @__PURE__ */ (0,
|
|
24484
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
24456
24485
|
"button",
|
|
24457
24486
|
{
|
|
24458
24487
|
type: "button",
|
|
@@ -24468,7 +24497,7 @@ function TableControlMenu({
|
|
|
24468
24497
|
transform: shown ? "scale(1)" : "scale(0.82)",
|
|
24469
24498
|
pointerEvents: shown ? "auto" : "none"
|
|
24470
24499
|
},
|
|
24471
|
-
children: /* @__PURE__ */ (0,
|
|
24500
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react17.MoreHorizontal, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
24472
24501
|
}
|
|
24473
24502
|
)
|
|
24474
24503
|
}
|
|
@@ -24484,7 +24513,7 @@ var import_lucide_react18 = require("lucide-react");
|
|
|
24484
24513
|
init_cn();
|
|
24485
24514
|
init_DropdownMenu();
|
|
24486
24515
|
init_Tooltip();
|
|
24487
|
-
var
|
|
24516
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
24488
24517
|
var IDLE_HANDLE_SCALE = "0.78";
|
|
24489
24518
|
function TableRowHandles({
|
|
24490
24519
|
activeRowIndex,
|
|
@@ -24499,12 +24528,12 @@ function TableRowHandles({
|
|
|
24499
24528
|
rowHandleLeft,
|
|
24500
24529
|
rowHandles
|
|
24501
24530
|
}) {
|
|
24502
|
-
return /* @__PURE__ */ (0,
|
|
24531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, { children: rowHandles.map((rowHandle) => {
|
|
24503
24532
|
const menuKey = `row:${rowHandle.index}`;
|
|
24504
24533
|
const isActive = rowHandle.index === activeRowIndex;
|
|
24505
24534
|
const visible = controlsVisible || hoverRowHandleIndex === rowHandle.index || openMenuKey === menuKey;
|
|
24506
24535
|
const isShown = visible || isActive;
|
|
24507
|
-
return /* @__PURE__ */ (0,
|
|
24536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
24508
24537
|
"div",
|
|
24509
24538
|
{
|
|
24510
24539
|
className: "absolute z-30",
|
|
@@ -24514,13 +24543,13 @@ function TableRowHandles({
|
|
|
24514
24543
|
left: rowHandleLeft,
|
|
24515
24544
|
pointerEvents: visible ? "auto" : "none"
|
|
24516
24545
|
},
|
|
24517
|
-
children: /* @__PURE__ */ (0,
|
|
24546
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
24518
24547
|
Tooltip,
|
|
24519
24548
|
{
|
|
24520
24549
|
placement: "right",
|
|
24521
24550
|
disabled: openMenuKey === menuKey || !visible && isActive,
|
|
24522
|
-
content: /* @__PURE__ */ (0,
|
|
24523
|
-
children: /* @__PURE__ */ (0,
|
|
24551
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-xs font-medium", children: `${rowDragLabel} ${rowHandle.index + 1}` }),
|
|
24552
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
24524
24553
|
DropdownMenu,
|
|
24525
24554
|
{
|
|
24526
24555
|
placement: "right",
|
|
@@ -24528,7 +24557,7 @@ function TableRowHandles({
|
|
|
24528
24557
|
onOpenChange: (open) => onOpenMenuChange(menuKey, open),
|
|
24529
24558
|
contentClassName: "p-2",
|
|
24530
24559
|
items: getMenuItems(rowHandle),
|
|
24531
|
-
trigger: /* @__PURE__ */ (0,
|
|
24560
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
24532
24561
|
"button",
|
|
24533
24562
|
{
|
|
24534
24563
|
type: "button",
|
|
@@ -24553,7 +24582,7 @@ function TableRowHandles({
|
|
|
24553
24582
|
// selection near the first character of a table cell.
|
|
24554
24583
|
pointerEvents: visible ? "auto" : "none"
|
|
24555
24584
|
},
|
|
24556
|
-
children: visible ? /* @__PURE__ */ (0,
|
|
24585
|
+
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
24586
|
}
|
|
24558
24587
|
)
|
|
24559
24588
|
}
|
|
@@ -24578,12 +24607,12 @@ function TableColumnHandles({
|
|
|
24578
24607
|
onStartDrag,
|
|
24579
24608
|
openMenuKey
|
|
24580
24609
|
}) {
|
|
24581
|
-
return /* @__PURE__ */ (0,
|
|
24610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, { children: columnHandles.map((columnHandle) => {
|
|
24582
24611
|
const menuKey = `column:${columnHandle.index}`;
|
|
24583
24612
|
const isActive = columnHandle.index === activeColumnIndex;
|
|
24584
24613
|
const visible = controlsVisible || hoverColumnHandleIndex === columnHandle.index || openMenuKey === menuKey;
|
|
24585
24614
|
const isShown = visible || isActive;
|
|
24586
|
-
return /* @__PURE__ */ (0,
|
|
24615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
24587
24616
|
"div",
|
|
24588
24617
|
{
|
|
24589
24618
|
className: "absolute z-30",
|
|
@@ -24593,13 +24622,13 @@ function TableColumnHandles({
|
|
|
24593
24622
|
left: Math.max(8, columnHandle.center - 12),
|
|
24594
24623
|
pointerEvents: visible ? "auto" : "none"
|
|
24595
24624
|
},
|
|
24596
|
-
children: /* @__PURE__ */ (0,
|
|
24625
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
24597
24626
|
Tooltip,
|
|
24598
24627
|
{
|
|
24599
24628
|
placement: "top",
|
|
24600
24629
|
disabled: openMenuKey === menuKey || !visible && isActive,
|
|
24601
|
-
content: /* @__PURE__ */ (0,
|
|
24602
|
-
children: /* @__PURE__ */ (0,
|
|
24630
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-xs font-medium", children: `${columnDragLabel} ${columnHandle.index + 1}` }),
|
|
24631
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
24603
24632
|
DropdownMenu,
|
|
24604
24633
|
{
|
|
24605
24634
|
placement: "bottom-start",
|
|
@@ -24607,7 +24636,7 @@ function TableColumnHandles({
|
|
|
24607
24636
|
onOpenChange: (open) => onOpenMenuChange(menuKey, open),
|
|
24608
24637
|
contentClassName: "p-2",
|
|
24609
24638
|
items: getMenuItems(columnHandle),
|
|
24610
|
-
trigger: /* @__PURE__ */ (0,
|
|
24639
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
24611
24640
|
"button",
|
|
24612
24641
|
{
|
|
24613
24642
|
type: "button",
|
|
@@ -24629,7 +24658,7 @@ function TableColumnHandles({
|
|
|
24629
24658
|
transform: isShown ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`,
|
|
24630
24659
|
pointerEvents: visible ? "auto" : "none"
|
|
24631
24660
|
},
|
|
24632
|
-
children: visible ? /* @__PURE__ */ (0,
|
|
24661
|
+
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
24662
|
}
|
|
24634
24663
|
)
|
|
24635
24664
|
}
|
|
@@ -24646,7 +24675,7 @@ function TableColumnHandles({
|
|
|
24646
24675
|
var import_lucide_react19 = require("lucide-react");
|
|
24647
24676
|
init_cn();
|
|
24648
24677
|
init_table_width_model();
|
|
24649
|
-
var
|
|
24678
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
24650
24679
|
var EDGE_HANDLE_CLASS = cn(
|
|
24651
24680
|
"pointer-events-auto absolute top-0 z-10 h-full w-2 touch-none cursor-col-resize bg-transparent p-0",
|
|
24652
24681
|
"border-transparent transition-colors duration-150 hover:border-primary",
|
|
@@ -24679,7 +24708,7 @@ function TableResizeHandles({
|
|
|
24679
24708
|
onStartResize,
|
|
24680
24709
|
resizeBothLabel
|
|
24681
24710
|
}) {
|
|
24682
|
-
return /* @__PURE__ */ (0,
|
|
24711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
24683
24712
|
"div",
|
|
24684
24713
|
{
|
|
24685
24714
|
ref: frameRef,
|
|
@@ -24696,8 +24725,8 @@ function TableResizeHandles({
|
|
|
24696
24725
|
height: layout.tableHeight
|
|
24697
24726
|
},
|
|
24698
24727
|
children: [
|
|
24699
|
-
layout.widthMode === "responsive" ? /* @__PURE__ */ (0,
|
|
24700
|
-
/* @__PURE__ */ (0,
|
|
24728
|
+
layout.widthMode === "responsive" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
24729
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
24701
24730
|
"button",
|
|
24702
24731
|
{
|
|
24703
24732
|
type: "button",
|
|
@@ -24712,7 +24741,7 @@ function TableResizeHandles({
|
|
|
24712
24741
|
onKeyDown: (event) => onKeyboardResize(event, "left")
|
|
24713
24742
|
}
|
|
24714
24743
|
),
|
|
24715
|
-
/* @__PURE__ */ (0,
|
|
24744
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
24716
24745
|
"button",
|
|
24717
24746
|
{
|
|
24718
24747
|
type: "button",
|
|
@@ -24728,7 +24757,7 @@ function TableResizeHandles({
|
|
|
24728
24757
|
}
|
|
24729
24758
|
)
|
|
24730
24759
|
] }) : null,
|
|
24731
|
-
/* @__PURE__ */ (0,
|
|
24760
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
24732
24761
|
"button",
|
|
24733
24762
|
{
|
|
24734
24763
|
type: "button",
|
|
@@ -24746,10 +24775,10 @@ function TableResizeHandles({
|
|
|
24746
24775
|
},
|
|
24747
24776
|
onPointerDown: (event) => onStartResize(event, "both"),
|
|
24748
24777
|
onKeyDown: (event) => onKeyboardResize(event, "both"),
|
|
24749
|
-
children: /* @__PURE__ */ (0,
|
|
24778
|
+
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
24779
|
}
|
|
24751
24780
|
),
|
|
24752
|
-
active ? /* @__PURE__ */ (0,
|
|
24781
|
+
active ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
24753
24782
|
"span",
|
|
24754
24783
|
{
|
|
24755
24784
|
role: "status",
|
|
@@ -25003,7 +25032,7 @@ function applyTableSize(editor, snapshot, dimensions, options = {}) {
|
|
|
25003
25032
|
// src/components/UEditor/table-controls.tsx
|
|
25004
25033
|
init_table_width_model();
|
|
25005
25034
|
init_table_formula_references();
|
|
25006
|
-
var
|
|
25035
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
25007
25036
|
var TABLE_MENU_TOP_OFFSET = 10;
|
|
25008
25037
|
var AXIS_HANDLE_RADIUS = 12;
|
|
25009
25038
|
function clamp4(value, min, max) {
|
|
@@ -25871,8 +25900,8 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
25871
25900
|
const menuLeft = Math.max(8, layout.tableLeft);
|
|
25872
25901
|
const rowHandleLeft = layout.tableLeft - AXIS_HANDLE_RADIUS;
|
|
25873
25902
|
const columnHandleTop = layout.tableTop - AXIS_HANDLE_RADIUS;
|
|
25874
|
-
return /* @__PURE__ */ (0,
|
|
25875
|
-
/* @__PURE__ */ (0,
|
|
25903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
25904
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
25876
25905
|
TableRowHandles,
|
|
25877
25906
|
{
|
|
25878
25907
|
activeRowIndex: layout.activeRowIndex,
|
|
@@ -25890,7 +25919,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
25890
25919
|
rowHandles: layout.rowHandles
|
|
25891
25920
|
}
|
|
25892
25921
|
),
|
|
25893
|
-
/* @__PURE__ */ (0,
|
|
25922
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
25894
25923
|
TableColumnHandles,
|
|
25895
25924
|
{
|
|
25896
25925
|
activeColumnIndex: layout.activeColumnIndex,
|
|
@@ -25908,7 +25937,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
25908
25937
|
openMenuKey
|
|
25909
25938
|
}
|
|
25910
25939
|
),
|
|
25911
|
-
/* @__PURE__ */ (0,
|
|
25940
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
25912
25941
|
TableControlMenu,
|
|
25913
25942
|
{
|
|
25914
25943
|
controlsVisible,
|
|
@@ -25923,7 +25952,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
25923
25952
|
top: menuTop
|
|
25924
25953
|
}
|
|
25925
25954
|
),
|
|
25926
|
-
dragPreview === null && /* @__PURE__ */ (0,
|
|
25955
|
+
dragPreview === null && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
25927
25956
|
TableResizeHandles,
|
|
25928
25957
|
{
|
|
25929
25958
|
active: tableResizeActive,
|
|
@@ -25936,7 +25965,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
25936
25965
|
resizeBothLabel: t("tableMenu.resizeBoth")
|
|
25937
25966
|
}
|
|
25938
25967
|
),
|
|
25939
|
-
/* @__PURE__ */ (0,
|
|
25968
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
25940
25969
|
TableAddRails,
|
|
25941
25970
|
{
|
|
25942
25971
|
addColumnVisible: hoverState.addColumnVisible,
|
|
@@ -25952,7 +25981,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
|
|
|
25952
25981
|
quickAddRowLabel: t("tableMenu.quickAddRowAfter")
|
|
25953
25982
|
}
|
|
25954
25983
|
),
|
|
25955
|
-
/* @__PURE__ */ (0,
|
|
25984
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
25956
25985
|
TableDragPreview,
|
|
25957
25986
|
{
|
|
25958
25987
|
columnDragLabel: t("tableMenu.dragColumn"),
|
|
@@ -26986,7 +27015,7 @@ var import_lucide_react21 = require("lucide-react");
|
|
|
26986
27015
|
init_useSmartTranslations();
|
|
26987
27016
|
init_table_dom_utils();
|
|
26988
27017
|
init_form_control_size();
|
|
26989
|
-
var
|
|
27018
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
26990
27019
|
function TableFormulaBar({ editor }) {
|
|
26991
27020
|
const t = useSmartTranslations("UEditor");
|
|
26992
27021
|
const inputRef = (0, import_react46.useRef)(null);
|
|
@@ -27049,7 +27078,7 @@ function TableFormulaBar({ editor }) {
|
|
|
27049
27078
|
if (!editor.isDestroyed) editor.commands.focus();
|
|
27050
27079
|
}, 0);
|
|
27051
27080
|
};
|
|
27052
|
-
return /* @__PURE__ */ (0,
|
|
27081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
27053
27082
|
"div",
|
|
27054
27083
|
{
|
|
27055
27084
|
"data-ueditor-formula-bar": "",
|
|
@@ -27057,7 +27086,7 @@ function TableFormulaBar({ editor }) {
|
|
|
27057
27086
|
"aria-label": t("tableMenu.formulaBar"),
|
|
27058
27087
|
className: "flex min-h-10 items-center gap-2 border-b border-border/60 bg-muted/25 px-2 py-1.5",
|
|
27059
27088
|
children: [
|
|
27060
|
-
/* @__PURE__ */ (0,
|
|
27089
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
27061
27090
|
"span",
|
|
27062
27091
|
{
|
|
27063
27092
|
"data-ueditor-formula-cell-label": "",
|
|
@@ -27065,8 +27094,8 @@ function TableFormulaBar({ editor }) {
|
|
|
27065
27094
|
children: selectedCell.label
|
|
27066
27095
|
}
|
|
27067
27096
|
),
|
|
27068
|
-
/* @__PURE__ */ (0,
|
|
27069
|
-
/* @__PURE__ */ (0,
|
|
27097
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Sigma, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 text-primary" }),
|
|
27098
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
27070
27099
|
"input",
|
|
27071
27100
|
{
|
|
27072
27101
|
ref: inputRef,
|
|
@@ -27087,18 +27116,18 @@ function TableFormulaBar({ editor }) {
|
|
|
27087
27116
|
className: `h-7 min-w-0 flex-1 rounded-md bg-background px-2 font-mono text-sm text-foreground ${formControlOutlineClass}`
|
|
27088
27117
|
}
|
|
27089
27118
|
),
|
|
27090
|
-
selectedCell.formulaState === "error" && /* @__PURE__ */ (0,
|
|
27119
|
+
selectedCell.formulaState === "error" && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
27091
27120
|
"span",
|
|
27092
27121
|
{
|
|
27093
27122
|
role: "status",
|
|
27094
27123
|
className: "hidden shrink-0 items-center gap-1 text-xs font-medium text-destructive sm:inline-flex",
|
|
27095
27124
|
children: [
|
|
27096
|
-
/* @__PURE__ */ (0,
|
|
27125
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.AlertCircle, { "aria-hidden": "true", className: "h-3.5 w-3.5" }),
|
|
27097
27126
|
t("tableMenu.formulaError")
|
|
27098
27127
|
]
|
|
27099
27128
|
}
|
|
27100
27129
|
),
|
|
27101
|
-
/* @__PURE__ */ (0,
|
|
27130
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
27102
27131
|
"button",
|
|
27103
27132
|
{
|
|
27104
27133
|
type: "button",
|
|
@@ -27106,10 +27135,10 @@ function TableFormulaBar({ editor }) {
|
|
|
27106
27135
|
"aria-label": t("tableMenu.apply"),
|
|
27107
27136
|
title: t("tableMenu.apply"),
|
|
27108
27137
|
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,
|
|
27138
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Check, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
27110
27139
|
}
|
|
27111
27140
|
),
|
|
27112
|
-
/* @__PURE__ */ (0,
|
|
27141
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
27113
27142
|
"button",
|
|
27114
27143
|
{
|
|
27115
27144
|
type: "button",
|
|
@@ -27120,10 +27149,10 @@ function TableFormulaBar({ editor }) {
|
|
|
27120
27149
|
"aria-label": t("tableMenu.convertToValue"),
|
|
27121
27150
|
title: t("tableMenu.convertToValue"),
|
|
27122
27151
|
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,
|
|
27152
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Hash, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
27124
27153
|
}
|
|
27125
27154
|
),
|
|
27126
|
-
/* @__PURE__ */ (0,
|
|
27155
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
27127
27156
|
"button",
|
|
27128
27157
|
{
|
|
27129
27158
|
type: "button",
|
|
@@ -27134,7 +27163,7 @@ function TableFormulaBar({ editor }) {
|
|
|
27134
27163
|
"aria-label": t("tableMenu.clearCell"),
|
|
27135
27164
|
title: t("tableMenu.clearCell"),
|
|
27136
27165
|
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,
|
|
27166
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Trash2, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
27138
27167
|
}
|
|
27139
27168
|
)
|
|
27140
27169
|
]
|
|
@@ -27218,7 +27247,7 @@ function useUEditorOutput({
|
|
|
27218
27247
|
|
|
27219
27248
|
// src/components/UEditor/UEditor.tsx
|
|
27220
27249
|
init_portal_context();
|
|
27221
|
-
var
|
|
27250
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
27222
27251
|
var LazyMenuBar = import_react49.default.lazy(async () => {
|
|
27223
27252
|
const { MenuBar: MenuBar2 } = await Promise.resolve().then(() => (init_menu_bar(), menu_bar_exports));
|
|
27224
27253
|
return { default: MenuBar2 };
|
|
@@ -27249,6 +27278,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27249
27278
|
showBubbleMenu = true,
|
|
27250
27279
|
bubbleMenuPlacement = "auto",
|
|
27251
27280
|
showFloatingMenu = false,
|
|
27281
|
+
enableAutocomplete = true,
|
|
27252
27282
|
showCharacterCount = true,
|
|
27253
27283
|
showFooter = true,
|
|
27254
27284
|
maxCharacters,
|
|
@@ -27331,11 +27361,12 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27331
27361
|
fallbackToDataUrl,
|
|
27332
27362
|
onImageUploadError,
|
|
27333
27363
|
editable,
|
|
27364
|
+
enableAutocomplete,
|
|
27334
27365
|
fetchMetadata
|
|
27335
27366
|
}),
|
|
27336
27367
|
...extraExtensions ?? []
|
|
27337
27368
|
],
|
|
27338
|
-
[getPortalContainer, effectivePlaceholder, t, maxCharacters, uploadImage, resolvedUploadFile, imageInsertMode, maxImageFileSize, allowedImageMimeTypes, fallbackToDataUrl, onImageUploadError, editable, fetchMetadata, extraExtensions]
|
|
27369
|
+
[getPortalContainer, effectivePlaceholder, t, maxCharacters, uploadImage, resolvedUploadFile, imageInsertMode, maxImageFileSize, allowedImageMimeTypes, fallbackToDataUrl, onImageUploadError, editable, enableAutocomplete, fetchMetadata, extraExtensions]
|
|
27339
27370
|
);
|
|
27340
27371
|
const syncFormulaRangeHighlight = import_react49.default.useCallback((pickState) => {
|
|
27341
27372
|
const container = formulaRangeSurfaceRef.current;
|
|
@@ -27347,6 +27378,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27347
27378
|
content,
|
|
27348
27379
|
editable,
|
|
27349
27380
|
autofocus,
|
|
27381
|
+
enableInputRules: enableAutocomplete,
|
|
27350
27382
|
editorProps: {
|
|
27351
27383
|
handleDOMEvents: {
|
|
27352
27384
|
mousedown: (view, event) => {
|
|
@@ -27534,7 +27566,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27534
27566
|
}
|
|
27535
27567
|
}, [content, editor]);
|
|
27536
27568
|
if (!editor) {
|
|
27537
|
-
return /* @__PURE__ */ (0,
|
|
27569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(UEditorPortalProvider, { getPortalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27538
27570
|
"div",
|
|
27539
27571
|
{
|
|
27540
27572
|
role: "status",
|
|
@@ -27545,7 +27577,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27545
27577
|
}
|
|
27546
27578
|
) });
|
|
27547
27579
|
}
|
|
27548
|
-
return /* @__PURE__ */ (0,
|
|
27580
|
+
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
27581
|
"div",
|
|
27550
27582
|
{
|
|
27551
27583
|
className: cn(
|
|
@@ -27561,8 +27593,8 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27561
27593
|
className
|
|
27562
27594
|
),
|
|
27563
27595
|
children: [
|
|
27564
|
-
editable && (showMenuBar || showToolbar || showBubbleMenu) ? /* @__PURE__ */ (0,
|
|
27565
|
-
isMenuBarVisible && /* @__PURE__ */ (0,
|
|
27596
|
+
editable && (showMenuBar || showToolbar || showBubbleMenu) ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(EditorUiRenderStateProvider, { editor, children: [
|
|
27597
|
+
isMenuBarVisible && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react49.default.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27566
27598
|
LazyMenuBar,
|
|
27567
27599
|
{
|
|
27568
27600
|
editor,
|
|
@@ -27580,7 +27612,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27580
27612
|
showPreviewButton
|
|
27581
27613
|
}
|
|
27582
27614
|
) }),
|
|
27583
|
-
showToolbar && /* @__PURE__ */ (0,
|
|
27615
|
+
showToolbar && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27584
27616
|
EditorToolbar,
|
|
27585
27617
|
{
|
|
27586
27618
|
editor,
|
|
@@ -27600,8 +27632,8 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27600
27632
|
letterSpacings
|
|
27601
27633
|
}
|
|
27602
27634
|
),
|
|
27603
|
-
/* @__PURE__ */ (0,
|
|
27604
|
-
showBubbleMenu && /* @__PURE__ */ (0,
|
|
27635
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TableFormulaBar, { editor }),
|
|
27636
|
+
showBubbleMenu && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27605
27637
|
CustomBubbleMenu,
|
|
27606
27638
|
{
|
|
27607
27639
|
editor,
|
|
@@ -27610,9 +27642,9 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27610
27642
|
lineHeights
|
|
27611
27643
|
}
|
|
27612
27644
|
)
|
|
27613
|
-
] }) : editable ? /* @__PURE__ */ (0,
|
|
27614
|
-
editable && showFloatingMenu && /* @__PURE__ */ (0,
|
|
27615
|
-
/* @__PURE__ */ (0,
|
|
27645
|
+
] }) : editable ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TableFormulaBar, { editor }) : null,
|
|
27646
|
+
editable && showFloatingMenu && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CustomFloatingMenu, { editor }),
|
|
27647
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
27616
27648
|
"div",
|
|
27617
27649
|
{
|
|
27618
27650
|
ref: (node) => {
|
|
@@ -27630,7 +27662,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27630
27662
|
"--ueditor-table-cell-padding-x": `${resolvedTableCellHorizontalPadding}px`
|
|
27631
27663
|
},
|
|
27632
27664
|
children: [
|
|
27633
|
-
/* @__PURE__ */ (0,
|
|
27665
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27634
27666
|
"span",
|
|
27635
27667
|
{
|
|
27636
27668
|
ref: tableColumnGuideRef,
|
|
@@ -27638,7 +27670,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27638
27670
|
className: "pointer-events-none absolute z-20 bg-primary/50 opacity-0 transition-opacity duration-200 delay-100 ease-out"
|
|
27639
27671
|
}
|
|
27640
27672
|
),
|
|
27641
|
-
/* @__PURE__ */ (0,
|
|
27673
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27642
27674
|
"span",
|
|
27643
27675
|
{
|
|
27644
27676
|
ref: tableRowGuideRef,
|
|
@@ -27646,7 +27678,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27646
27678
|
className: "pointer-events-none absolute z-20 bg-primary/50 opacity-0 transition-opacity duration-200 delay-100 ease-out"
|
|
27647
27679
|
}
|
|
27648
27680
|
),
|
|
27649
|
-
/* @__PURE__ */ (0,
|
|
27681
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27650
27682
|
"span",
|
|
27651
27683
|
{
|
|
27652
27684
|
ref: activeTableCellHighlightRef,
|
|
@@ -27655,7 +27687,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27655
27687
|
className: "pointer-events-none hidden absolute z-20 rounded-[2px] border border-primary/50 bg-primary/5"
|
|
27656
27688
|
}
|
|
27657
27689
|
),
|
|
27658
|
-
/* @__PURE__ */ (0,
|
|
27690
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27659
27691
|
"div",
|
|
27660
27692
|
{
|
|
27661
27693
|
ref: formulaCoordinateOverlayRef,
|
|
@@ -27663,7 +27695,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27663
27695
|
className: "pointer-events-none absolute inset-0 z-[35] hidden overflow-visible"
|
|
27664
27696
|
}
|
|
27665
27697
|
),
|
|
27666
|
-
formulaRangeHighlight && /* @__PURE__ */ (0,
|
|
27698
|
+
formulaRangeHighlight && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27667
27699
|
"span",
|
|
27668
27700
|
{
|
|
27669
27701
|
"aria-hidden": "true",
|
|
@@ -27681,7 +27713,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27681
27713
|
}
|
|
27682
27714
|
}
|
|
27683
27715
|
),
|
|
27684
|
-
editable && /* @__PURE__ */ (0,
|
|
27716
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27685
27717
|
TableControls,
|
|
27686
27718
|
{
|
|
27687
27719
|
editor,
|
|
@@ -27689,7 +27721,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27689
27721
|
showCellInspector: showBubbleMenu
|
|
27690
27722
|
}
|
|
27691
27723
|
),
|
|
27692
|
-
/* @__PURE__ */ (0,
|
|
27724
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
27693
27725
|
import_react50.EditorContent,
|
|
27694
27726
|
{
|
|
27695
27727
|
editor,
|
|
@@ -27699,7 +27731,7 @@ var UEditor = import_react49.default.forwardRef(({
|
|
|
27699
27731
|
]
|
|
27700
27732
|
}
|
|
27701
27733
|
),
|
|
27702
|
-
showFooter && showCharacterCount && /* @__PURE__ */ (0,
|
|
27734
|
+
showFooter && showCharacterCount && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CharacterCountDisplay, { editor, maxCharacters })
|
|
27703
27735
|
]
|
|
27704
27736
|
}
|
|
27705
27737
|
) }) });
|