@underverse-ui/underverse 2.0.33 → 2.0.35
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-OTPC2OTQ.js → chunk-F2P3DJSC.js} +3 -3
- package/dist/{chunk-OTPC2OTQ.js.map → chunk-F2P3DJSC.js.map} +1 -1
- package/dist/{chunk-FQVWYDKP.js → chunk-H4AVZA4K.js} +28 -94
- package/dist/chunk-H4AVZA4K.js.map +1 -0
- package/dist/{chunk-UHUKUI5S.js → chunk-WFQV7XFC.js} +2 -2
- package/dist/index.cjs +62 -132
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/{menu-bar-HZBBRX42.js → menu-bar-MUISXLMR.js} +3 -3
- package/dist/ueditor.cjs +77 -146
- package/dist/ueditor.cjs.map +1 -1
- package/dist/ueditor.d.cts +3 -1
- package/dist/ueditor.d.ts +3 -1
- package/dist/ueditor.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-FQVWYDKP.js.map +0 -1
- /package/dist/{chunk-UHUKUI5S.js.map → chunk-WFQV7XFC.js.map} +0 -0
- /package/dist/{menu-bar-HZBBRX42.js.map → menu-bar-MUISXLMR.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getPanelBorderRadiusClass,
|
|
3
3
|
useUnderverseUIConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-F2P3DJSC.js";
|
|
5
5
|
import {
|
|
6
6
|
cn,
|
|
7
7
|
useGlobalI18n
|
|
@@ -253,4 +253,4 @@ var Modal_default = Modal;
|
|
|
253
253
|
export {
|
|
254
254
|
Modal_default
|
|
255
255
|
};
|
|
256
|
-
//# sourceMappingURL=chunk-
|
|
256
|
+
//# sourceMappingURL=chunk-WFQV7XFC.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -9730,7 +9730,7 @@ var init_editor_styles = __esm({
|
|
|
9730
9730
|
"[&_td]:align-top",
|
|
9731
9731
|
"[&_td]:box-border",
|
|
9732
9732
|
"[&_td]:select-text",
|
|
9733
|
-
"[&_td]:px-
|
|
9733
|
+
"[&_td]:px-[var(--ueditor-table-cell-padding-x,0.5rem)]",
|
|
9734
9734
|
"[&_td]:py-0",
|
|
9735
9735
|
"[&_td]:whitespace-normal",
|
|
9736
9736
|
"[&_td]:wrap-anywhere",
|
|
@@ -9742,7 +9742,7 @@ var init_editor_styles = __esm({
|
|
|
9742
9742
|
"[&_th]:align-top",
|
|
9743
9743
|
"[&_th]:box-border",
|
|
9744
9744
|
"[&_th]:select-text",
|
|
9745
|
-
"[&_th]:px-
|
|
9745
|
+
"[&_th]:px-[var(--ueditor-table-cell-padding-x,0.5rem)]",
|
|
9746
9746
|
"[&_th]:py-0",
|
|
9747
9747
|
"[&_th]:whitespace-normal",
|
|
9748
9748
|
"[&_th]:wrap-anywhere",
|
|
@@ -10148,7 +10148,7 @@ function renderMenuItems(items) {
|
|
|
10148
10148
|
case "sub":
|
|
10149
10149
|
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(DropdownMenuSub, { label: item.label, icon: item.icon, disabled: item.disabled, children: renderMenuItems(item.items) }, i);
|
|
10150
10150
|
case "custom":
|
|
10151
|
-
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
10151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react84.default.Fragment, { children: item.render() }, item.key);
|
|
10152
10152
|
}
|
|
10153
10153
|
});
|
|
10154
10154
|
}
|
|
@@ -10531,12 +10531,12 @@ function buildTableMenuItems(t, editor, onInsertTable) {
|
|
|
10531
10531
|
}
|
|
10532
10532
|
];
|
|
10533
10533
|
}
|
|
10534
|
-
var
|
|
10534
|
+
var import_react84, import_lucide_react59, import_jsx_runtime104, MenuBarTrigger, MenuBar;
|
|
10535
10535
|
var init_menu_bar = __esm({
|
|
10536
10536
|
"src/components/UEditor/menu-bar.tsx"() {
|
|
10537
10537
|
"use strict";
|
|
10538
10538
|
"use client";
|
|
10539
|
-
|
|
10539
|
+
import_react84 = __toESM(require("react"), 1);
|
|
10540
10540
|
import_lucide_react59 = require("lucide-react");
|
|
10541
10541
|
init_useSmartTranslations();
|
|
10542
10542
|
init_cn();
|
|
@@ -10553,7 +10553,7 @@ var init_menu_bar = __esm({
|
|
|
10553
10553
|
init_async_insertion_position();
|
|
10554
10554
|
init_image_file_upload();
|
|
10555
10555
|
import_jsx_runtime104 = require("react/jsx-runtime");
|
|
10556
|
-
MenuBarTrigger =
|
|
10556
|
+
MenuBarTrigger = import_react84.default.forwardRef(
|
|
10557
10557
|
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
10558
10558
|
"button",
|
|
10559
10559
|
{
|
|
@@ -10590,25 +10590,25 @@ var init_menu_bar = __esm({
|
|
|
10590
10590
|
const t = useSmartTranslations("UEditor");
|
|
10591
10591
|
useSharedEditorUiRenderState(editor);
|
|
10592
10592
|
const getPortalContainer = useUEditorPortalContainerGetter();
|
|
10593
|
-
const fileInputRef = (0,
|
|
10594
|
-
const sourceTextareaRef = (0,
|
|
10595
|
-
const [showImageInput, setShowImageInput] = (0,
|
|
10596
|
-
const [showLinkInput, setShowLinkInput] = (0,
|
|
10597
|
-
const [isUploadingImage, setIsUploadingImage] = (0,
|
|
10598
|
-
const [imageUploadError, setImageUploadError] = (0,
|
|
10599
|
-
const [openMenuKey, setOpenMenuKey] = (0,
|
|
10600
|
-
const [showSourceDialog, setShowSourceDialog] = (0,
|
|
10601
|
-
const [sourceHtml, setSourceHtml] = (0,
|
|
10602
|
-
const [sourceError, setSourceError] = (0,
|
|
10603
|
-
const sourceErrorId =
|
|
10604
|
-
const [showPreviewDialog, setShowPreviewDialog] = (0,
|
|
10605
|
-
const [previewHtml, setPreviewHtml] = (0,
|
|
10593
|
+
const fileInputRef = (0, import_react84.useRef)(null);
|
|
10594
|
+
const sourceTextareaRef = (0, import_react84.useRef)(null);
|
|
10595
|
+
const [showImageInput, setShowImageInput] = (0, import_react84.useState)(false);
|
|
10596
|
+
const [showLinkInput, setShowLinkInput] = (0, import_react84.useState)(false);
|
|
10597
|
+
const [isUploadingImage, setIsUploadingImage] = (0, import_react84.useState)(false);
|
|
10598
|
+
const [imageUploadError, setImageUploadError] = (0, import_react84.useState)(null);
|
|
10599
|
+
const [openMenuKey, setOpenMenuKey] = (0, import_react84.useState)(null);
|
|
10600
|
+
const [showSourceDialog, setShowSourceDialog] = (0, import_react84.useState)(false);
|
|
10601
|
+
const [sourceHtml, setSourceHtml] = (0, import_react84.useState)("");
|
|
10602
|
+
const [sourceError, setSourceError] = (0, import_react84.useState)("");
|
|
10603
|
+
const sourceErrorId = import_react84.default.useId();
|
|
10604
|
+
const [showPreviewDialog, setShowPreviewDialog] = (0, import_react84.useState)(false);
|
|
10605
|
+
const [previewHtml, setPreviewHtml] = (0, import_react84.useState)("");
|
|
10606
10606
|
const modalPortalContainer = resolveUEditorPortalContainer(
|
|
10607
10607
|
getPortalContainer,
|
|
10608
10608
|
void 0,
|
|
10609
10609
|
editor.view.dom.ownerDocument
|
|
10610
10610
|
);
|
|
10611
|
-
(0,
|
|
10611
|
+
(0, import_react84.useEffect)(() => {
|
|
10612
10612
|
if (!showPreviewDialog) return;
|
|
10613
10613
|
const updatePreview = () => {
|
|
10614
10614
|
if (!editor.isDestroyed) {
|
|
@@ -33190,7 +33190,6 @@ function DataTableHeader({
|
|
|
33190
33190
|
"button",
|
|
33191
33191
|
{
|
|
33192
33192
|
type: "button",
|
|
33193
|
-
title: sortLabel,
|
|
33194
33193
|
className: cn(
|
|
33195
33194
|
"p-1 rounded-lg transition-all duration-200 hover:bg-foreground/10",
|
|
33196
33195
|
useEndIcon && isCenterAlign && "col-start-3 justify-self-end",
|
|
@@ -35298,9 +35297,9 @@ init_UnderverseConfigContext();
|
|
|
35298
35297
|
init_useSmartTranslations();
|
|
35299
35298
|
|
|
35300
35299
|
// src/components/UEditor/UEditor.tsx
|
|
35301
|
-
var
|
|
35300
|
+
var import_react85 = __toESM(require("react"), 1);
|
|
35302
35301
|
init_useSmartTranslations();
|
|
35303
|
-
var
|
|
35302
|
+
var import_react86 = require("@tiptap/react");
|
|
35304
35303
|
init_cn();
|
|
35305
35304
|
|
|
35306
35305
|
// src/components/UEditor/extensions.ts
|
|
@@ -47244,7 +47243,9 @@ function TableAddRails({
|
|
|
47244
47243
|
),
|
|
47245
47244
|
style: {
|
|
47246
47245
|
top: columnRailTop,
|
|
47247
|
-
|
|
47246
|
+
// An invisible rail must not sit outside the table: even at
|
|
47247
|
+
// opacity 0 its box would otherwise create a horizontal scrollbar.
|
|
47248
|
+
left: showColumnRail ? columnRailLeft : Math.max(visibleBounds.left, visibleBounds.right - BUTTON_SHORT_SIZE),
|
|
47248
47249
|
width: BUTTON_SHORT_SIZE,
|
|
47249
47250
|
height: BUTTON_LONG_SIZE,
|
|
47250
47251
|
opacity: showColumnRail ? 1 : 0,
|
|
@@ -47530,18 +47531,16 @@ var import_lucide_react56 = require("lucide-react");
|
|
|
47530
47531
|
init_cn();
|
|
47531
47532
|
init_table_width_model();
|
|
47532
47533
|
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
47533
|
-
var HANDLE_BASE_CLASS = cn(
|
|
47534
|
-
"pointer-events-auto absolute z-10 inline-flex touch-none items-center justify-center rounded-md",
|
|
47535
|
-
"bg-background/95 text-primary shadow-sm backdrop-blur-sm",
|
|
47536
|
-
"transition-[color,background-color,box-shadow,transform] duration-150",
|
|
47537
|
-
"hover:bg-primary hover:text-primary-foreground hover:shadow-md active:scale-95",
|
|
47538
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
|
47539
|
-
);
|
|
47540
47534
|
var EDGE_HANDLE_CLASS = cn(
|
|
47541
47535
|
"pointer-events-auto absolute top-0 z-10 h-full w-2 touch-none cursor-col-resize bg-transparent p-0",
|
|
47542
47536
|
"border-transparent transition-colors duration-150 hover:border-primary",
|
|
47543
47537
|
"focus-visible:border-primary focus-visible:outline-none"
|
|
47544
47538
|
);
|
|
47539
|
+
var CORNER_HANDLE_CLASS = cn(
|
|
47540
|
+
"pointer-events-auto absolute z-10 inline-flex touch-none items-center justify-center p-0",
|
|
47541
|
+
"text-primary/70 transition-[color,transform] duration-150 hover:text-primary active:scale-95",
|
|
47542
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
|
47543
|
+
);
|
|
47545
47544
|
function formatTableResizeDimensionLabel({
|
|
47546
47545
|
width,
|
|
47547
47546
|
height,
|
|
@@ -47621,9 +47620,9 @@ function TableResizeHandles({
|
|
|
47621
47620
|
title: `${resizeBothLabel}. ${ctrlHint}`,
|
|
47622
47621
|
"data-table-resize-handle": "both",
|
|
47623
47622
|
className: cn(
|
|
47624
|
-
|
|
47625
|
-
"bottom-[-28px] right-
|
|
47626
|
-
active && "
|
|
47623
|
+
CORNER_HANDLE_CLASS,
|
|
47624
|
+
"bottom-[-28px] right-0 h-6 w-6 cursor-nwse-resize",
|
|
47625
|
+
active && "text-primary"
|
|
47627
47626
|
),
|
|
47628
47627
|
onDoubleClick: onFitWidth,
|
|
47629
47628
|
onClick: (event) => {
|
|
@@ -50103,80 +50102,12 @@ function useUEditorOutput({
|
|
|
50103
50102
|
|
|
50104
50103
|
// src/components/UEditor/UEditor.tsx
|
|
50105
50104
|
init_portal_context();
|
|
50106
|
-
|
|
50107
|
-
// src/components/UEditor/use-wide-table-layout.ts
|
|
50108
|
-
var import_react84 = __toESM(require("react"), 1);
|
|
50109
|
-
init_table_dom_utils();
|
|
50110
|
-
function useWideTableLayout(editor, enabled, widthBoundaryRef, editorShellRef, editorSurfaceRef) {
|
|
50111
|
-
import_react84.default.useLayoutEffect(() => {
|
|
50112
|
-
const boundary = widthBoundaryRef.current;
|
|
50113
|
-
const shell = editorShellRef.current;
|
|
50114
|
-
const surface = editorSurfaceRef.current;
|
|
50115
|
-
if (!editor || !boundary || !shell || !surface) return;
|
|
50116
|
-
const editorDocument = editor.view.dom.ownerDocument;
|
|
50117
|
-
const editorWindow = editorDocument.defaultView;
|
|
50118
|
-
if (!editorWindow) return;
|
|
50119
|
-
const editorDom = editor.view.dom;
|
|
50120
|
-
let frame = 0;
|
|
50121
|
-
const resetWidths = () => {
|
|
50122
|
-
shell.style.removeProperty("width");
|
|
50123
|
-
editorDom.style.removeProperty("width");
|
|
50124
|
-
};
|
|
50125
|
-
const sync = () => {
|
|
50126
|
-
frame = 0;
|
|
50127
|
-
resetWidths();
|
|
50128
|
-
if (!enabled || editor.isDestroyed) return;
|
|
50129
|
-
const boundaryWidth = boundary.getBoundingClientRect().width || boundary.clientWidth;
|
|
50130
|
-
const surfaceWidth = surface.getBoundingClientRect().width || surface.clientWidth;
|
|
50131
|
-
if (boundaryWidth <= 0 || surfaceWidth <= 0) return;
|
|
50132
|
-
editorDom.style.width = `${surfaceWidth}px`;
|
|
50133
|
-
const shellRect = shell.getBoundingClientRect();
|
|
50134
|
-
let requiredWidth = boundaryWidth;
|
|
50135
|
-
editorDom.querySelectorAll("table").forEach((table) => {
|
|
50136
|
-
const tableRect = table.getBoundingClientRect();
|
|
50137
|
-
if (tableRect.width > 0) {
|
|
50138
|
-
requiredWidth = Math.max(requiredWidth, tableRect.right - shellRect.left + 32);
|
|
50139
|
-
return;
|
|
50140
|
-
}
|
|
50141
|
-
const widthBp = Number(table.getAttribute("data-table-width-bp"));
|
|
50142
|
-
if (Number.isFinite(widthBp) && widthBp > 1e4) {
|
|
50143
|
-
requiredWidth = Math.max(requiredWidth, surfaceWidth * widthBp / 1e4 + 32);
|
|
50144
|
-
}
|
|
50145
|
-
});
|
|
50146
|
-
if (requiredWidth <= boundaryWidth + 1) {
|
|
50147
|
-
editorDom.style.removeProperty("width");
|
|
50148
|
-
return;
|
|
50149
|
-
}
|
|
50150
|
-
shell.style.width = `${Math.ceil(requiredWidth)}px`;
|
|
50151
|
-
};
|
|
50152
|
-
const schedule = () => {
|
|
50153
|
-
if (frame) editorWindow.cancelAnimationFrame(frame);
|
|
50154
|
-
frame = editorWindow.requestAnimationFrame(sync);
|
|
50155
|
-
};
|
|
50156
|
-
const resizeObserver = typeof editorWindow.ResizeObserver === "function" ? new editorWindow.ResizeObserver(schedule) : null;
|
|
50157
|
-
resizeObserver?.observe(boundary);
|
|
50158
|
-
editor.on("transaction", schedule);
|
|
50159
|
-
surface.addEventListener(UEDITOR_TABLE_LAYOUT_CHANGE_EVENT, schedule);
|
|
50160
|
-
editorWindow.addEventListener("resize", schedule);
|
|
50161
|
-
schedule();
|
|
50162
|
-
return () => {
|
|
50163
|
-
if (frame) editorWindow.cancelAnimationFrame(frame);
|
|
50164
|
-
resizeObserver?.disconnect();
|
|
50165
|
-
editor.off("transaction", schedule);
|
|
50166
|
-
surface.removeEventListener(UEDITOR_TABLE_LAYOUT_CHANGE_EVENT, schedule);
|
|
50167
|
-
editorWindow.removeEventListener("resize", schedule);
|
|
50168
|
-
resetWidths();
|
|
50169
|
-
};
|
|
50170
|
-
}, [editor, editorShellRef, editorSurfaceRef, enabled, widthBoundaryRef]);
|
|
50171
|
-
}
|
|
50172
|
-
|
|
50173
|
-
// src/components/UEditor/UEditor.tsx
|
|
50174
50105
|
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
50175
|
-
var LazyMenuBar =
|
|
50106
|
+
var LazyMenuBar = import_react85.default.lazy(async () => {
|
|
50176
50107
|
const { MenuBar: MenuBar2 } = await Promise.resolve().then(() => (init_menu_bar(), menu_bar_exports));
|
|
50177
50108
|
return { default: MenuBar2 };
|
|
50178
50109
|
});
|
|
50179
|
-
var UEditor =
|
|
50110
|
+
var UEditor = import_react85.default.forwardRef(({
|
|
50180
50111
|
getPortalContainer,
|
|
50181
50112
|
content = "",
|
|
50182
50113
|
onChange,
|
|
@@ -50207,6 +50138,7 @@ var UEditor = import_react86.default.forwardRef(({
|
|
|
50207
50138
|
maxCharacters,
|
|
50208
50139
|
minHeight = "200px",
|
|
50209
50140
|
maxHeight = "auto",
|
|
50141
|
+
tableCellHorizontalPadding = 8,
|
|
50210
50142
|
expandWideTables = true,
|
|
50211
50143
|
variant = "default",
|
|
50212
50144
|
rounded = true,
|
|
@@ -50228,18 +50160,17 @@ var UEditor = import_react86.default.forwardRef(({
|
|
|
50228
50160
|
}, ref) => {
|
|
50229
50161
|
const t = useSmartTranslations("UEditor");
|
|
50230
50162
|
const effectivePlaceholder = placeholder ?? t("placeholder");
|
|
50231
|
-
const
|
|
50232
|
-
const
|
|
50233
|
-
const
|
|
50234
|
-
const
|
|
50235
|
-
const
|
|
50236
|
-
const
|
|
50237
|
-
const
|
|
50238
|
-
const
|
|
50239
|
-
const [
|
|
50240
|
-
const
|
|
50241
|
-
|
|
50242
|
-
(0, import_react86.useEffect)(() => {
|
|
50163
|
+
const resolvedTableCellHorizontalPadding = Number.isFinite(tableCellHorizontalPadding) ? Math.max(0, tableCellHorizontalPadding) : 8;
|
|
50164
|
+
const inFlightPrepareRef = (0, import_react85.useRef)(null);
|
|
50165
|
+
const lastAppliedContentRef = (0, import_react85.useRef)(content ?? "");
|
|
50166
|
+
const scheduledFormulaRecalculateRef = (0, import_react85.useRef)(false);
|
|
50167
|
+
const pendingFormulaTextRecalculateRef = (0, import_react85.useRef)(false);
|
|
50168
|
+
const editorInstanceRef = (0, import_react85.useRef)(null);
|
|
50169
|
+
const formulaRangePickRef = (0, import_react85.useRef)(null);
|
|
50170
|
+
const formulaRangeSurfaceRef = (0, import_react85.useRef)(null);
|
|
50171
|
+
const [formulaRangeHighlight, setFormulaRangeHighlight] = import_react85.default.useState(null);
|
|
50172
|
+
const [isMenuBarVisible, setIsMenuBarVisible] = import_react85.default.useState(showMenuBar);
|
|
50173
|
+
(0, import_react85.useEffect)(() => {
|
|
50243
50174
|
setIsMenuBarVisible(showMenuBar);
|
|
50244
50175
|
}, [showMenuBar]);
|
|
50245
50176
|
const { flushOutputUpdates, scheduleOutputUpdate } = useUEditorOutput({
|
|
@@ -50248,7 +50179,7 @@ var UEditor = import_react86.default.forwardRef(({
|
|
|
50248
50179
|
onJsonChange,
|
|
50249
50180
|
outputDebounceMs
|
|
50250
50181
|
});
|
|
50251
|
-
const scheduleFormulaRecalculate =
|
|
50182
|
+
const scheduleFormulaRecalculate = import_react85.default.useCallback((editor2, options) => {
|
|
50252
50183
|
if (editor2.isDestroyed || scheduledFormulaRecalculateRef.current) return;
|
|
50253
50184
|
if (!options?.force && isEditingTableFormulaText(editor2)) return;
|
|
50254
50185
|
scheduledFormulaRecalculateRef.current = true;
|
|
@@ -50259,7 +50190,7 @@ var UEditor = import_react86.default.forwardRef(({
|
|
|
50259
50190
|
}
|
|
50260
50191
|
});
|
|
50261
50192
|
}, []);
|
|
50262
|
-
const resolvedUploadFile = (0,
|
|
50193
|
+
const resolvedUploadFile = (0, import_react85.useMemo)(() => {
|
|
50263
50194
|
if (uploadFile) return uploadFile;
|
|
50264
50195
|
if (uploadFileForSave) {
|
|
50265
50196
|
return async (file) => {
|
|
@@ -50269,7 +50200,7 @@ var UEditor = import_react86.default.forwardRef(({
|
|
|
50269
50200
|
}
|
|
50270
50201
|
return uploadImage;
|
|
50271
50202
|
}, [uploadFile, uploadFileForSave, uploadImage]);
|
|
50272
|
-
const extensions = (0,
|
|
50203
|
+
const extensions = (0, import_react85.useMemo)(
|
|
50273
50204
|
() => [
|
|
50274
50205
|
...buildUEditorExtensions({
|
|
50275
50206
|
getPortalContainer,
|
|
@@ -50290,11 +50221,11 @@ var UEditor = import_react86.default.forwardRef(({
|
|
|
50290
50221
|
],
|
|
50291
50222
|
[getPortalContainer, effectivePlaceholder, t, maxCharacters, uploadImage, resolvedUploadFile, imageInsertMode, maxImageFileSize, allowedImageMimeTypes, fallbackToDataUrl, onImageUploadError, editable, fetchMetadata, extraExtensions]
|
|
50292
50223
|
);
|
|
50293
|
-
const syncFormulaRangeHighlight =
|
|
50224
|
+
const syncFormulaRangeHighlight = import_react85.default.useCallback((pickState) => {
|
|
50294
50225
|
const container = formulaRangeSurfaceRef.current;
|
|
50295
50226
|
setFormulaRangeHighlight(container && pickState ? getFormulaRangePickHighlight(container, pickState) : null);
|
|
50296
50227
|
}, []);
|
|
50297
|
-
const editor = (0,
|
|
50228
|
+
const editor = (0, import_react86.useEditor)({
|
|
50298
50229
|
immediatelyRender: false,
|
|
50299
50230
|
extensions,
|
|
50300
50231
|
content,
|
|
@@ -50415,7 +50346,7 @@ var UEditor = import_react86.default.forwardRef(({
|
|
|
50415
50346
|
queueMicrotask(flushOutputUpdates);
|
|
50416
50347
|
}
|
|
50417
50348
|
});
|
|
50418
|
-
(0,
|
|
50349
|
+
(0, import_react85.useEffect)(() => {
|
|
50419
50350
|
editorInstanceRef.current = editor;
|
|
50420
50351
|
return () => {
|
|
50421
50352
|
if (editorInstanceRef.current === editor) editorInstanceRef.current = null;
|
|
@@ -50431,8 +50362,7 @@ var UEditor = import_react86.default.forwardRef(({
|
|
|
50431
50362
|
apply: t("tableMenu.apply"),
|
|
50432
50363
|
cancel: t("imageInput.cancelBtn")
|
|
50433
50364
|
});
|
|
50434
|
-
|
|
50435
|
-
(0, import_react86.useImperativeHandle)(
|
|
50365
|
+
(0, import_react85.useImperativeHandle)(
|
|
50436
50366
|
ref,
|
|
50437
50367
|
() => ({
|
|
50438
50368
|
editor,
|
|
@@ -50461,7 +50391,7 @@ var UEditor = import_react86.default.forwardRef(({
|
|
|
50461
50391
|
}),
|
|
50462
50392
|
[content, editor, uploadImageForSave, uploadFileForSave, uploadImageConcurrency]
|
|
50463
50393
|
);
|
|
50464
|
-
(0,
|
|
50394
|
+
(0, import_react85.useEffect)(() => {
|
|
50465
50395
|
if (!editor) return;
|
|
50466
50396
|
queueMicrotask(() => {
|
|
50467
50397
|
if (!editor.isDestroyed) {
|
|
@@ -50469,7 +50399,7 @@ var UEditor = import_react86.default.forwardRef(({
|
|
|
50469
50399
|
}
|
|
50470
50400
|
});
|
|
50471
50401
|
}, [editor]);
|
|
50472
|
-
(0,
|
|
50402
|
+
(0, import_react85.useEffect)(() => {
|
|
50473
50403
|
if (!editor) return;
|
|
50474
50404
|
const nextContent = content ?? "";
|
|
50475
50405
|
if (lastAppliedContentRef.current === nextContent) return;
|
|
@@ -50499,10 +50429,9 @@ var UEditor = import_react86.default.forwardRef(({
|
|
|
50499
50429
|
}
|
|
50500
50430
|
) });
|
|
50501
50431
|
}
|
|
50502
|
-
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(UEditorPortalProvider, { getPortalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", {
|
|
50432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(UEditorPortalProvider, { getPortalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { "data-ueditor-width-boundary": "", className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
|
|
50503
50433
|
"div",
|
|
50504
50434
|
{
|
|
50505
|
-
ref: editorShellRef,
|
|
50506
50435
|
className: cn(
|
|
50507
50436
|
"group relative flex flex-col text-card-foreground",
|
|
50508
50437
|
editable ? [
|
|
@@ -50517,7 +50446,7 @@ var UEditor = import_react86.default.forwardRef(({
|
|
|
50517
50446
|
),
|
|
50518
50447
|
children: [
|
|
50519
50448
|
editable && (showMenuBar || showToolbar || showBubbleMenu) ? /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(EditorUiRenderStateProvider, { editor, children: [
|
|
50520
|
-
isMenuBarVisible && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
50449
|
+
isMenuBarVisible && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_react85.default.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
50521
50450
|
LazyMenuBar,
|
|
50522
50451
|
{
|
|
50523
50452
|
editor,
|
|
@@ -50575,13 +50504,14 @@ var UEditor = import_react86.default.forwardRef(({
|
|
|
50575
50504
|
formulaRangeSurfaceRef.current = node;
|
|
50576
50505
|
},
|
|
50577
50506
|
className: cn(
|
|
50578
|
-
"relative flex-1 overflow-y-auto",
|
|
50507
|
+
"relative flex-1 overflow-x-auto overflow-y-auto [scrollbar-width:thin] [scrollbar-color:hsl(var(--border))_transparent]",
|
|
50579
50508
|
expandWideTables && "[&_.tableWrapper]:!overflow-visible [&_.tableWrapper]:!pb-0"
|
|
50580
50509
|
),
|
|
50581
50510
|
style: {
|
|
50582
50511
|
fontFamily: defaultFontFamily,
|
|
50583
50512
|
minHeight: editable ? minHeight : void 0,
|
|
50584
|
-
maxHeight
|
|
50513
|
+
maxHeight,
|
|
50514
|
+
"--ueditor-table-cell-padding-x": `${resolvedTableCellHorizontalPadding}px`
|
|
50585
50515
|
},
|
|
50586
50516
|
children: [
|
|
50587
50517
|
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
@@ -50644,7 +50574,7 @@ var UEditor = import_react86.default.forwardRef(({
|
|
|
50644
50574
|
}
|
|
50645
50575
|
),
|
|
50646
50576
|
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
50647
|
-
|
|
50577
|
+
import_react86.EditorContent,
|
|
50648
50578
|
{
|
|
50649
50579
|
editor,
|
|
50650
50580
|
className: "min-h-full"
|