@underverse-ui/underverse 2.0.15 → 2.0.17
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-WEGE3MZ5.js → chunk-23VKHYEB.js} +46 -16
- package/dist/chunk-23VKHYEB.js.map +1 -0
- package/dist/{chunk-D22TNGE5.js → chunk-HEXF4EOB.js} +2 -2
- package/dist/{chunk-NWVDNVLR.js → chunk-YM56RXIZ.js} +3 -3
- package/dist/index.cjs +58 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +16 -19
- package/dist/index.js.map +1 -1
- package/dist/{menu-bar-YMEOEYJS.js → menu-bar-7MPCNTHR.js} +3 -3
- package/dist/ueditor.cjs +45 -15
- package/dist/ueditor.cjs.map +1 -1
- package/dist/ueditor.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-WEGE3MZ5.js.map +0 -1
- /package/dist/{chunk-D22TNGE5.js.map → chunk-HEXF4EOB.js.map} +0 -0
- /package/dist/{chunk-NWVDNVLR.js.map → chunk-YM56RXIZ.js.map} +0 -0
- /package/dist/{menu-bar-YMEOEYJS.js.map → menu-bar-7MPCNTHR.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Modal_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HEXF4EOB.js";
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_TABLE_ROW_HEIGHT,
|
|
7
7
|
DEFAULT_UEDITOR_IMAGE_MAX_FILE_SIZE,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
sanitizeUEditorUrl,
|
|
22
22
|
useDropdownMenuClose,
|
|
23
23
|
useSharedEditorUiRenderState
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-23VKHYEB.js";
|
|
25
25
|
import {
|
|
26
26
|
cn,
|
|
27
27
|
useSmartTranslations
|
|
@@ -945,4 +945,4 @@ var MenuBar = ({
|
|
|
945
945
|
export {
|
|
946
946
|
MenuBar
|
|
947
947
|
};
|
|
948
|
-
//# sourceMappingURL=menu-bar-
|
|
948
|
+
//# sourceMappingURL=menu-bar-7MPCNTHR.js.map
|
package/dist/ueditor.cjs
CHANGED
|
@@ -7054,6 +7054,8 @@ var init_toolbar = __esm({
|
|
|
7054
7054
|
const [showImageInput, setShowImageInput] = (0, import_react33.useState)(false);
|
|
7055
7055
|
const [showLinkInput, setShowLinkInput] = (0, import_react33.useState)(false);
|
|
7056
7056
|
const [isTableMenuOpen, setIsTableMenuOpen] = (0, import_react33.useState)(false);
|
|
7057
|
+
const [fontSizeDraft, setFontSizeDraft] = (0, import_react33.useState)("");
|
|
7058
|
+
const [isEditingFontSize, setIsEditingFontSize] = (0, import_react33.useState)(false);
|
|
7057
7059
|
const fileInputRef = (0, import_react33.useRef)(null);
|
|
7058
7060
|
const [isUploadingImage, setIsUploadingImage] = (0, import_react33.useState)(false);
|
|
7059
7061
|
const [imageUploadError, setImageUploadError] = (0, import_react33.useState)(null);
|
|
@@ -7083,7 +7085,7 @@ var init_toolbar = __esm({
|
|
|
7083
7085
|
const availableLetterSpacings = import_react33.default.useMemo(() => letterSpacings ?? getDefaultLetterSpacings(), [letterSpacings]);
|
|
7084
7086
|
const currentFontFamilyDisplayValue = currentFontFamily.split(",")[0]?.trim() ?? currentFontFamily;
|
|
7085
7087
|
const currentFontFamilyLabel = availableFontFamilies.find((option) => normalizeStyleValue(option.value) === currentFontFamily)?.label ?? (currentFontFamilyDisplayValue || t("toolbar.fontDefault"));
|
|
7086
|
-
const currentFontSizeLabel = availableFontSizes.find((option) => normalizeStyleValue(option.value) === currentFontSize)?.label ?? "13";
|
|
7088
|
+
const currentFontSizeLabel = availableFontSizes.find((option) => normalizeStyleValue(option.value) === currentFontSize)?.label ?? (currentFontSize.replace(/px$/i, "") || "13");
|
|
7087
7089
|
const currentLineHeightLabel = availableLineHeights.find((option) => normalizeStyleValue(option.value) === currentLineHeight)?.label ?? t("toolbar.lineHeightDefault");
|
|
7088
7090
|
const currentLetterSpacingLabel = availableLetterSpacings.find((option) => normalizeStyleValue(option.value) === currentLetterSpacing)?.label ?? t("toolbar.letterSpacingDefault");
|
|
7089
7091
|
const defaultFontFamilyOption = availableFontFamilies.find((opt) => normalizeStyleValue(opt.value) === normalizeStyleValue(defaultFontFamily)) ?? availableFontFamilies[0];
|
|
@@ -7095,6 +7097,12 @@ var init_toolbar = __esm({
|
|
|
7095
7097
|
const isMedium = variant === "medium";
|
|
7096
7098
|
const isMediumFull = variant === "medium-full";
|
|
7097
7099
|
const isFull = variant === "default" || variant === "full" || variant === "notion" || !variant;
|
|
7100
|
+
const applyFontSizeDraft = () => {
|
|
7101
|
+
const parsed = Number.parseFloat(fontSizeDraft);
|
|
7102
|
+
if (!Number.isFinite(parsed)) return;
|
|
7103
|
+
editor.chain().focus().setFontSize(`${parsed}px`).run();
|
|
7104
|
+
setFontSizeDraft(String(parsed));
|
|
7105
|
+
};
|
|
7098
7106
|
const insertImageFiles = async (files) => {
|
|
7099
7107
|
if (files.length === 0) return;
|
|
7100
7108
|
setIsUploadingImage(true);
|
|
@@ -7263,25 +7271,47 @@ var init_toolbar = __esm({
|
|
|
7263
7271
|
(isMediumFull || isFull) && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7264
7272
|
DropdownMenu,
|
|
7265
7273
|
{
|
|
7266
|
-
trigger: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7274
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime26.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: [
|
|
7275
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7276
|
+
"input",
|
|
7277
|
+
{
|
|
7278
|
+
type: "number",
|
|
7279
|
+
step: 1,
|
|
7280
|
+
value: isEditingFontSize ? fontSizeDraft : displayedFontSizeLabel,
|
|
7281
|
+
onFocus: () => {
|
|
7282
|
+
setFontSizeDraft(displayedFontSizeLabel);
|
|
7283
|
+
setIsEditingFontSize(true);
|
|
7284
|
+
},
|
|
7285
|
+
onChange: (event) => setFontSizeDraft(event.target.value),
|
|
7286
|
+
onBlur: () => {
|
|
7287
|
+
applyFontSizeDraft();
|
|
7288
|
+
setIsEditingFontSize(false);
|
|
7289
|
+
},
|
|
7290
|
+
onMouseDown: (event) => event.stopPropagation(),
|
|
7291
|
+
onClick: (event) => event.stopPropagation(),
|
|
7292
|
+
onKeyDown: (event) => {
|
|
7293
|
+
event.stopPropagation();
|
|
7294
|
+
if (event.key === "Enter") {
|
|
7295
|
+
event.preventDefault();
|
|
7296
|
+
applyFontSizeDraft();
|
|
7297
|
+
setIsEditingFontSize(false);
|
|
7298
|
+
}
|
|
7299
|
+
},
|
|
7300
|
+
"aria-label": t("toolbar.fontSize"),
|
|
7301
|
+
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"
|
|
7302
|
+
}
|
|
7303
|
+
),
|
|
7304
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("button", { type: "button", "aria-label": t("toolbar.fontSize"), title: t("toolbar.fontSize"), className: "px-1 text-[#7B8184]", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FigmaChevronDownIcon, { className: "h-3 w-3" }) })
|
|
7305
|
+
] }),
|
|
7279
7306
|
contentClassName: "max-h-80 overflow-y-auto min-w-32 p-2",
|
|
7280
7307
|
children: availableFontSizes.map((option) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7281
7308
|
DropdownMenuItem,
|
|
7282
7309
|
{
|
|
7283
7310
|
label: option.label,
|
|
7284
|
-
onClick: () =>
|
|
7311
|
+
onClick: () => {
|
|
7312
|
+
editor.chain().focus().setFontSize(option.value).run();
|
|
7313
|
+
setFontSizeDraft(option.label);
|
|
7314
|
+
},
|
|
7285
7315
|
active: normalizeStyleValue(option.value) === activeFontSize
|
|
7286
7316
|
},
|
|
7287
7317
|
option.value
|