@underverse-ui/underverse 1.0.76 → 1.0.77
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/index.cjs +62 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +62 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -3760,7 +3760,8 @@ var EmojiPicker = ({
|
|
|
3760
3760
|
showSearch = true,
|
|
3761
3761
|
showCategoryNav = true,
|
|
3762
3762
|
columns = 9,
|
|
3763
|
-
maxHeight = "20rem"
|
|
3763
|
+
maxHeight = "20rem",
|
|
3764
|
+
chrome = "standalone"
|
|
3764
3765
|
}) => {
|
|
3765
3766
|
const t = useSmartTranslations("UEditor");
|
|
3766
3767
|
const [search, setSearch] = useState5("");
|
|
@@ -3771,6 +3772,11 @@ var EmojiPicker = ({
|
|
|
3771
3772
|
const resolvedSearchPlaceholder = searchPlaceholder ?? t("emojiPicker.searchPlaceholder");
|
|
3772
3773
|
const resolvedEmptyText = emptyText ?? t("emojiPicker.noResults");
|
|
3773
3774
|
const resolvedEmptyHint = emptyHint ?? t("emojiPicker.tryDifferentSearch");
|
|
3775
|
+
const resolvedColumns = Math.max(1, Math.floor(columns));
|
|
3776
|
+
const isEmbedded = chrome === "embedded";
|
|
3777
|
+
const gridStyle = {
|
|
3778
|
+
gridTemplateColumns: `repeat(${resolvedColumns}, minmax(0, 1fr))`
|
|
3779
|
+
};
|
|
3774
3780
|
const filteredCategories = useMemo3(() => {
|
|
3775
3781
|
if (!search.trim()) return EMOJI_LIST;
|
|
3776
3782
|
const query = search.toLowerCase();
|
|
@@ -3810,7 +3816,6 @@ var EmojiPicker = ({
|
|
|
3810
3816
|
useEffect3(() => {
|
|
3811
3817
|
isUserScrolling.current = true;
|
|
3812
3818
|
}, []);
|
|
3813
|
-
const gridColsClass = `grid-cols-${columns}`;
|
|
3814
3819
|
const renderEmojiCategory = (category, assignRef2 = false) => /* @__PURE__ */ jsxs7(
|
|
3815
3820
|
"div",
|
|
3816
3821
|
{
|
|
@@ -3819,7 +3824,7 @@ var EmojiPicker = ({
|
|
|
3819
3824
|
} : void 0,
|
|
3820
3825
|
children: [
|
|
3821
3826
|
/* @__PURE__ */ jsx12("div", { className: "sticky top-0 z-10 bg-card py-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: category.name }),
|
|
3822
|
-
/* @__PURE__ */ jsx12("div", { className:
|
|
3827
|
+
/* @__PURE__ */ jsx12("div", { className: "grid gap-1", style: gridStyle, children: category.emojis.map((emoji) => /* @__PURE__ */ jsx12(
|
|
3823
3828
|
EmojiGridButton,
|
|
3824
3829
|
{
|
|
3825
3830
|
emoji: emoji.emoji,
|
|
@@ -3852,50 +3857,60 @@ var EmojiPicker = ({
|
|
|
3852
3857
|
isUserScrolling.current = true;
|
|
3853
3858
|
}, 500);
|
|
3854
3859
|
};
|
|
3855
|
-
return /* @__PURE__ */ jsxs7(
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
"
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
placeholder: resolvedSearchPlaceholder,
|
|
3863
|
-
value: search,
|
|
3864
|
-
onChange: (e) => setSearch(e.target.value),
|
|
3865
|
-
className: cn(
|
|
3866
|
-
"w-full rounded-lg border border-border bg-background py-2 pl-9 pr-9 text-sm",
|
|
3867
|
-
"placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
3868
|
-
)
|
|
3869
|
-
}
|
|
3860
|
+
return /* @__PURE__ */ jsxs7(
|
|
3861
|
+
"div",
|
|
3862
|
+
{
|
|
3863
|
+
className: cn(
|
|
3864
|
+
"flex max-h-128 w-96 flex-col overflow-hidden",
|
|
3865
|
+
isEmbedded ? "bg-transparent" : "rounded-2xl border border-border bg-card shadow-xl",
|
|
3866
|
+
className
|
|
3870
3867
|
),
|
|
3871
|
-
|
|
3872
|
-
"
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
{
|
|
3887
|
-
type: "button",
|
|
3888
|
-
onClick: () => handleCategoryClick(category.id),
|
|
3889
|
-
className: cn(
|
|
3890
|
-
"rounded-lg p-2 transition-colors",
|
|
3891
|
-
activeCategory === category.id ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-accent hover:text-foreground"
|
|
3868
|
+
children: [
|
|
3869
|
+
showSearch && /* @__PURE__ */ jsx12("div", { className: cn("shrink-0 border-b p-3", isEmbedded ? "bg-transparent" : "bg-muted/30"), children: /* @__PURE__ */ jsxs7("div", { className: "relative", children: [
|
|
3870
|
+
/* @__PURE__ */ jsx12(Search2, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
3871
|
+
/* @__PURE__ */ jsx12(
|
|
3872
|
+
"input",
|
|
3873
|
+
{
|
|
3874
|
+
type: "text",
|
|
3875
|
+
placeholder: resolvedSearchPlaceholder,
|
|
3876
|
+
value: search,
|
|
3877
|
+
onChange: (e) => setSearch(e.target.value),
|
|
3878
|
+
className: cn(
|
|
3879
|
+
"w-full rounded-lg border border-border bg-background py-2 pl-9 pr-9 text-sm",
|
|
3880
|
+
"placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
3881
|
+
)
|
|
3882
|
+
}
|
|
3892
3883
|
),
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3884
|
+
search && /* @__PURE__ */ jsx12(
|
|
3885
|
+
"button",
|
|
3886
|
+
{
|
|
3887
|
+
type: "button",
|
|
3888
|
+
onClick: () => setSearch(""),
|
|
3889
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",
|
|
3890
|
+
children: /* @__PURE__ */ jsx12(X2, { className: "h-4 w-4" })
|
|
3891
|
+
}
|
|
3892
|
+
)
|
|
3893
|
+
] }) }),
|
|
3894
|
+
/* @__PURE__ */ jsx12("div", { ref: scrollContainerRef, className: "shrink overflow-y-auto px-3 py-2", style: { height: maxHeight }, children: search ? searchResultContent : /* @__PURE__ */ jsx12("div", { className: "space-y-4", children: EMOJI_LIST.map((category) => renderEmojiCategory(category, true)) }) }),
|
|
3895
|
+
!search && showCategoryNav && /* @__PURE__ */ jsx12("div", { className: cn("flex shrink-0 items-center justify-around border-t px-2 py-2", isEmbedded ? "bg-transparent" : "bg-muted/30"), children: EMOJI_LIST.map((category) => {
|
|
3896
|
+
const IconComponent = CATEGORY_ICONS[category.id] || Smile;
|
|
3897
|
+
return /* @__PURE__ */ jsx12(
|
|
3898
|
+
"button",
|
|
3899
|
+
{
|
|
3900
|
+
type: "button",
|
|
3901
|
+
onClick: () => handleCategoryClick(category.id),
|
|
3902
|
+
className: cn(
|
|
3903
|
+
"rounded-lg p-2 transition-colors",
|
|
3904
|
+
activeCategory === category.id ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-accent hover:text-foreground"
|
|
3905
|
+
),
|
|
3906
|
+
children: /* @__PURE__ */ jsx12(Tooltip, { placement: "top", content: /* @__PURE__ */ jsx12("span", { className: "text-xs font-medium", children: category.name }), children: /* @__PURE__ */ jsx12("span", { className: "inline-flex", children: /* @__PURE__ */ jsx12(IconComponent, { className: "h-5 w-5" }) }) })
|
|
3907
|
+
},
|
|
3908
|
+
category.id
|
|
3909
|
+
);
|
|
3910
|
+
}) })
|
|
3911
|
+
]
|
|
3912
|
+
}
|
|
3913
|
+
);
|
|
3899
3914
|
};
|
|
3900
3915
|
var EmojiPicker_default = EmojiPicker;
|
|
3901
3916
|
|
|
@@ -23762,7 +23777,7 @@ var ImageInput = ({ onSubmit, onCancel }) => {
|
|
|
23762
23777
|
// src/components/UEditor/emoji-picker.tsx
|
|
23763
23778
|
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
23764
23779
|
var EmojiPicker2 = ({ onSelect }) => {
|
|
23765
|
-
return /* @__PURE__ */ jsx79(EmojiPicker, { onEmojiSelect: onSelect });
|
|
23780
|
+
return /* @__PURE__ */ jsx79(EmojiPicker, { onEmojiSelect: onSelect, chrome: "embedded" });
|
|
23766
23781
|
};
|
|
23767
23782
|
|
|
23768
23783
|
// src/components/UEditor/typography-options.ts
|
|
@@ -24291,6 +24306,7 @@ var EditorToolbar = ({
|
|
|
24291
24306
|
/* @__PURE__ */ jsx80(
|
|
24292
24307
|
DropdownMenu,
|
|
24293
24308
|
{
|
|
24309
|
+
contentClassName: "p-0 overflow-hidden",
|
|
24294
24310
|
trigger: /* @__PURE__ */ jsx80(ToolbarButton, { onClick: () => {
|
|
24295
24311
|
}, title: t("toolbar.emoji"), children: /* @__PURE__ */ jsx80(Smile3, { className: "w-4 h-4" }) }),
|
|
24296
24312
|
children: /* @__PURE__ */ jsx80(
|