@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
|
import {
|
|
2
2
|
getPanelBorderRadiusClass,
|
|
3
3
|
useUnderverseUIConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-23VKHYEB.js";
|
|
5
5
|
import {
|
|
6
6
|
cn,
|
|
7
7
|
useGlobalI18n
|
|
@@ -196,4 +196,4 @@ var Modal_default = Modal;
|
|
|
196
196
|
export {
|
|
197
197
|
Modal_default
|
|
198
198
|
};
|
|
199
|
-
//# sourceMappingURL=chunk-
|
|
199
|
+
//# sourceMappingURL=chunk-HEXF4EOB.js.map
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
sanitizeUEditorUrl,
|
|
56
56
|
useEditorColors,
|
|
57
57
|
useSharedEditorUiRenderState
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-23VKHYEB.js";
|
|
59
59
|
import {
|
|
60
60
|
Tooltip,
|
|
61
61
|
UEditorPortalProvider,
|
|
@@ -14504,7 +14504,7 @@ function useUEditorOutput({
|
|
|
14504
14504
|
// src/components/UEditor/UEditor.tsx
|
|
14505
14505
|
import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
14506
14506
|
var LazyMenuBar = React15.lazy(async () => {
|
|
14507
|
-
const { MenuBar } = await import("./menu-bar-
|
|
14507
|
+
const { MenuBar } = await import("./menu-bar-7MPCNTHR.js");
|
|
14508
14508
|
return { default: MenuBar };
|
|
14509
14509
|
});
|
|
14510
14510
|
var UEditor = React15.forwardRef(({
|
|
@@ -14973,4 +14973,4 @@ export {
|
|
|
14973
14973
|
prepareUEditorContentForSave,
|
|
14974
14974
|
UEditor_default
|
|
14975
14975
|
};
|
|
14976
|
-
//# sourceMappingURL=chunk-
|
|
14976
|
+
//# sourceMappingURL=chunk-YM56RXIZ.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -7472,6 +7472,8 @@ var init_toolbar = __esm({
|
|
|
7472
7472
|
const [showImageInput, setShowImageInput] = (0, import_react73.useState)(false);
|
|
7473
7473
|
const [showLinkInput, setShowLinkInput] = (0, import_react73.useState)(false);
|
|
7474
7474
|
const [isTableMenuOpen, setIsTableMenuOpen] = (0, import_react73.useState)(false);
|
|
7475
|
+
const [fontSizeDraft, setFontSizeDraft] = (0, import_react73.useState)("");
|
|
7476
|
+
const [isEditingFontSize, setIsEditingFontSize] = (0, import_react73.useState)(false);
|
|
7475
7477
|
const fileInputRef = (0, import_react73.useRef)(null);
|
|
7476
7478
|
const [isUploadingImage, setIsUploadingImage] = (0, import_react73.useState)(false);
|
|
7477
7479
|
const [imageUploadError, setImageUploadError] = (0, import_react73.useState)(null);
|
|
@@ -7501,7 +7503,7 @@ var init_toolbar = __esm({
|
|
|
7501
7503
|
const availableLetterSpacings = import_react73.default.useMemo(() => letterSpacings ?? getDefaultLetterSpacings(), [letterSpacings]);
|
|
7502
7504
|
const currentFontFamilyDisplayValue = currentFontFamily.split(",")[0]?.trim() ?? currentFontFamily;
|
|
7503
7505
|
const currentFontFamilyLabel = availableFontFamilies.find((option) => normalizeStyleValue(option.value) === currentFontFamily)?.label ?? (currentFontFamilyDisplayValue || t("toolbar.fontDefault"));
|
|
7504
|
-
const currentFontSizeLabel = availableFontSizes.find((option) => normalizeStyleValue(option.value) === currentFontSize)?.label ?? "13";
|
|
7506
|
+
const currentFontSizeLabel = availableFontSizes.find((option) => normalizeStyleValue(option.value) === currentFontSize)?.label ?? (currentFontSize.replace(/px$/i, "") || "13");
|
|
7505
7507
|
const currentLineHeightLabel = availableLineHeights.find((option) => normalizeStyleValue(option.value) === currentLineHeight)?.label ?? t("toolbar.lineHeightDefault");
|
|
7506
7508
|
const currentLetterSpacingLabel = availableLetterSpacings.find((option) => normalizeStyleValue(option.value) === currentLetterSpacing)?.label ?? t("toolbar.letterSpacingDefault");
|
|
7507
7509
|
const defaultFontFamilyOption = availableFontFamilies.find((opt) => normalizeStyleValue(opt.value) === normalizeStyleValue(defaultFontFamily)) ?? availableFontFamilies[0];
|
|
@@ -7513,6 +7515,12 @@ var init_toolbar = __esm({
|
|
|
7513
7515
|
const isMedium = variant === "medium";
|
|
7514
7516
|
const isMediumFull = variant === "medium-full";
|
|
7515
7517
|
const isFull = variant === "default" || variant === "full" || variant === "notion" || !variant;
|
|
7518
|
+
const applyFontSizeDraft = () => {
|
|
7519
|
+
const parsed = Number.parseFloat(fontSizeDraft);
|
|
7520
|
+
if (!Number.isFinite(parsed)) return;
|
|
7521
|
+
editor.chain().focus().setFontSize(`${parsed}px`).run();
|
|
7522
|
+
setFontSizeDraft(String(parsed));
|
|
7523
|
+
};
|
|
7516
7524
|
const insertImageFiles = async (files) => {
|
|
7517
7525
|
if (files.length === 0) return;
|
|
7518
7526
|
setIsUploadingImage(true);
|
|
@@ -7681,25 +7689,47 @@ var init_toolbar = __esm({
|
|
|
7681
7689
|
(isMediumFull || isFull) && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
7682
7690
|
DropdownMenu,
|
|
7683
7691
|
{
|
|
7684
|
-
trigger: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
|
|
7692
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime94.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: [
|
|
7693
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
7694
|
+
"input",
|
|
7695
|
+
{
|
|
7696
|
+
type: "number",
|
|
7697
|
+
step: 1,
|
|
7698
|
+
value: isEditingFontSize ? fontSizeDraft : displayedFontSizeLabel,
|
|
7699
|
+
onFocus: () => {
|
|
7700
|
+
setFontSizeDraft(displayedFontSizeLabel);
|
|
7701
|
+
setIsEditingFontSize(true);
|
|
7702
|
+
},
|
|
7703
|
+
onChange: (event) => setFontSizeDraft(event.target.value),
|
|
7704
|
+
onBlur: () => {
|
|
7705
|
+
applyFontSizeDraft();
|
|
7706
|
+
setIsEditingFontSize(false);
|
|
7707
|
+
},
|
|
7708
|
+
onMouseDown: (event) => event.stopPropagation(),
|
|
7709
|
+
onClick: (event) => event.stopPropagation(),
|
|
7710
|
+
onKeyDown: (event) => {
|
|
7711
|
+
event.stopPropagation();
|
|
7712
|
+
if (event.key === "Enter") {
|
|
7713
|
+
event.preventDefault();
|
|
7714
|
+
applyFontSizeDraft();
|
|
7715
|
+
setIsEditingFontSize(false);
|
|
7716
|
+
}
|
|
7717
|
+
},
|
|
7718
|
+
"aria-label": t("toolbar.fontSize"),
|
|
7719
|
+
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"
|
|
7720
|
+
}
|
|
7721
|
+
),
|
|
7722
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("button", { type: "button", "aria-label": t("toolbar.fontSize"), title: t("toolbar.fontSize"), className: "px-1 text-[#7B8184]", children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(FigmaChevronDownIcon, { className: "h-3 w-3" }) })
|
|
7723
|
+
] }),
|
|
7697
7724
|
contentClassName: "max-h-80 overflow-y-auto min-w-32 p-2",
|
|
7698
7725
|
children: availableFontSizes.map((option) => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
7699
7726
|
DropdownMenuItem,
|
|
7700
7727
|
{
|
|
7701
7728
|
label: option.label,
|
|
7702
|
-
onClick: () =>
|
|
7729
|
+
onClick: () => {
|
|
7730
|
+
editor.chain().focus().setFontSize(option.value).run();
|
|
7731
|
+
setFontSizeDraft(option.label);
|
|
7732
|
+
},
|
|
7703
7733
|
active: normalizeStyleValue(option.value) === activeFontSize
|
|
7704
7734
|
},
|
|
7705
7735
|
option.value
|
|
@@ -31813,24 +31843,19 @@ function DataTablePagination({
|
|
|
31813
31843
|
pageSizeOptions,
|
|
31814
31844
|
setCurPageSize,
|
|
31815
31845
|
size,
|
|
31816
|
-
align
|
|
31846
|
+
align,
|
|
31847
|
+
paginationRange
|
|
31817
31848
|
}) {
|
|
31818
31849
|
const totalPages = Math.ceil(totalItems / curPageSize);
|
|
31819
31850
|
const pages = import_react35.default.useMemo(() => {
|
|
31820
|
-
const
|
|
31821
|
-
if (totalPages <=
|
|
31822
|
-
|
|
31823
|
-
|
|
31824
|
-
|
|
31825
|
-
|
|
31826
|
-
|
|
31827
|
-
|
|
31828
|
-
const end = Math.min(totalPages - 1, curPage + 1);
|
|
31829
|
-
for (let i = start; i <= end; i++) result.push(i);
|
|
31830
|
-
if (curPage < totalPages - 2) result.push("...");
|
|
31831
|
-
result.push(totalPages);
|
|
31832
|
-
return result;
|
|
31833
|
-
}, [curPage, totalPages]);
|
|
31851
|
+
const edgeCount = Math.max(1, Math.floor(paginationRange ?? (totalPages < 14 ? 3 : 5)));
|
|
31852
|
+
if (totalPages <= edgeCount * 2 + 3) return Array.from({ length: totalPages }, (_, index) => index + 1);
|
|
31853
|
+
const pageNumbers = /* @__PURE__ */ new Set();
|
|
31854
|
+
for (let page = 1; page <= edgeCount; page += 1) pageNumbers.add(page);
|
|
31855
|
+
for (let page = totalPages - edgeCount + 1; page <= totalPages; page += 1) pageNumbers.add(page);
|
|
31856
|
+
for (let page = Math.max(1, curPage - 1); page <= Math.min(totalPages, curPage + 1); page += 1) pageNumbers.add(page);
|
|
31857
|
+
return Array.from(pageNumbers).sort((a, b) => a - b).flatMap((page, index, sortedPages) => index > 0 && page - sortedPages[index - 1] > 1 ? ["...", page] : [page]);
|
|
31858
|
+
}, [curPage, paginationRange, totalPages]);
|
|
31834
31859
|
if (totalItems === 0) return null;
|
|
31835
31860
|
const controlButtonSize = size === "lg" ? "md" : "sm";
|
|
31836
31861
|
const navBtnClass = size === "sm" ? "h-6 w-6 p-0 rounded-full" : size === "lg" ? "h-8 w-8 p-0 rounded-full" : "h-7 w-7 p-0 rounded-full";
|
|
@@ -32616,6 +32641,7 @@ function DataTable({
|
|
|
32616
32641
|
estimatedRowHeight,
|
|
32617
32642
|
overscan = 8,
|
|
32618
32643
|
paginationAlign = "right",
|
|
32644
|
+
paginationRange,
|
|
32619
32645
|
enableHeaderAutoFit = true,
|
|
32620
32646
|
labels,
|
|
32621
32647
|
columnColorGroups,
|
|
@@ -32868,7 +32894,8 @@ function DataTable({
|
|
|
32868
32894
|
pageSizeOptions,
|
|
32869
32895
|
setCurPageSize,
|
|
32870
32896
|
size,
|
|
32871
|
-
align: paginationAlign
|
|
32897
|
+
align: paginationAlign,
|
|
32898
|
+
paginationRange
|
|
32872
32899
|
}
|
|
32873
32900
|
)
|
|
32874
32901
|
] });
|