@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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@underverse-ui/underverse",
3
- "version": "1.0.76",
3
+ "version": "1.0.77",
4
4
  "sourceEntry": "src/index.ts",
5
5
  "totalExports": 225,
6
6
  "exports": [
package/dist/index.cjs CHANGED
@@ -3945,7 +3945,8 @@ var EmojiPicker = ({
3945
3945
  showSearch = true,
3946
3946
  showCategoryNav = true,
3947
3947
  columns = 9,
3948
- maxHeight = "20rem"
3948
+ maxHeight = "20rem",
3949
+ chrome = "standalone"
3949
3950
  }) => {
3950
3951
  const t = useSmartTranslations("UEditor");
3951
3952
  const [search, setSearch] = (0, import_react6.useState)("");
@@ -3956,6 +3957,11 @@ var EmojiPicker = ({
3956
3957
  const resolvedSearchPlaceholder = searchPlaceholder ?? t("emojiPicker.searchPlaceholder");
3957
3958
  const resolvedEmptyText = emptyText ?? t("emojiPicker.noResults");
3958
3959
  const resolvedEmptyHint = emptyHint ?? t("emojiPicker.tryDifferentSearch");
3960
+ const resolvedColumns = Math.max(1, Math.floor(columns));
3961
+ const isEmbedded = chrome === "embedded";
3962
+ const gridStyle = {
3963
+ gridTemplateColumns: `repeat(${resolvedColumns}, minmax(0, 1fr))`
3964
+ };
3959
3965
  const filteredCategories = (0, import_react6.useMemo)(() => {
3960
3966
  if (!search.trim()) return EMOJI_LIST;
3961
3967
  const query = search.toLowerCase();
@@ -3995,7 +4001,6 @@ var EmojiPicker = ({
3995
4001
  (0, import_react6.useEffect)(() => {
3996
4002
  isUserScrolling.current = true;
3997
4003
  }, []);
3998
- const gridColsClass = `grid-cols-${columns}`;
3999
4004
  const renderEmojiCategory = (category, assignRef2 = false) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
4000
4005
  "div",
4001
4006
  {
@@ -4004,7 +4009,7 @@ var EmojiPicker = ({
4004
4009
  } : void 0,
4005
4010
  children: [
4006
4011
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "sticky top-0 z-10 bg-card py-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: category.name }),
4007
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: cn("grid gap-1", gridColsClass), children: category.emojis.map((emoji) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4012
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "grid gap-1", style: gridStyle, children: category.emojis.map((emoji) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4008
4013
  EmojiGridButton,
4009
4014
  {
4010
4015
  emoji: emoji.emoji,
@@ -4037,50 +4042,60 @@ var EmojiPicker = ({
4037
4042
  isUserScrolling.current = true;
4038
4043
  }, 500);
4039
4044
  };
4040
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn("flex max-h-128 w-96 flex-col overflow-hidden rounded-2xl border border-border bg-card shadow-xl", className), children: [
4041
- showSearch && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "shrink-0 border-b bg-muted/30 p-3", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative", children: [
4042
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
4043
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4044
- "input",
4045
- {
4046
- type: "text",
4047
- placeholder: resolvedSearchPlaceholder,
4048
- value: search,
4049
- onChange: (e) => setSearch(e.target.value),
4050
- className: cn(
4051
- "w-full rounded-lg border border-border bg-background py-2 pl-9 pr-9 text-sm",
4052
- "placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20"
4053
- )
4054
- }
4045
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
4046
+ "div",
4047
+ {
4048
+ className: cn(
4049
+ "flex max-h-128 w-96 flex-col overflow-hidden",
4050
+ isEmbedded ? "bg-transparent" : "rounded-2xl border border-border bg-card shadow-xl",
4051
+ className
4055
4052
  ),
4056
- search && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4057
- "button",
4058
- {
4059
- type: "button",
4060
- onClick: () => setSearch(""),
4061
- className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",
4062
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.X, { className: "h-4 w-4" })
4063
- }
4064
- )
4065
- ] }) }),
4066
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ref: scrollContainerRef, className: "shrink overflow-y-auto px-3 py-2", style: { height: maxHeight }, children: search ? searchResultContent : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "space-y-4", children: EMOJI_LIST.map((category) => renderEmojiCategory(category, true)) }) }),
4067
- !search && showCategoryNav && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex shrink-0 items-center justify-around border-t bg-muted/30 px-2 py-2", children: EMOJI_LIST.map((category) => {
4068
- const IconComponent = CATEGORY_ICONS[category.id] || import_lucide_react4.Smile;
4069
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4070
- "button",
4071
- {
4072
- type: "button",
4073
- onClick: () => handleCategoryClick(category.id),
4074
- className: cn(
4075
- "rounded-lg p-2 transition-colors",
4076
- activeCategory === category.id ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-accent hover:text-foreground"
4053
+ children: [
4054
+ showSearch && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: cn("shrink-0 border-b p-3", isEmbedded ? "bg-transparent" : "bg-muted/30"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative", children: [
4055
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
4056
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4057
+ "input",
4058
+ {
4059
+ type: "text",
4060
+ placeholder: resolvedSearchPlaceholder,
4061
+ value: search,
4062
+ onChange: (e) => setSearch(e.target.value),
4063
+ className: cn(
4064
+ "w-full rounded-lg border border-border bg-background py-2 pl-9 pr-9 text-sm",
4065
+ "placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20"
4066
+ )
4067
+ }
4077
4068
  ),
4078
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Tooltip, { placement: "top", content: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-xs font-medium", children: category.name }), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconComponent, { className: "h-5 w-5" }) }) })
4079
- },
4080
- category.id
4081
- );
4082
- }) })
4083
- ] });
4069
+ search && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4070
+ "button",
4071
+ {
4072
+ type: "button",
4073
+ onClick: () => setSearch(""),
4074
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",
4075
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.X, { className: "h-4 w-4" })
4076
+ }
4077
+ )
4078
+ ] }) }),
4079
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ref: scrollContainerRef, className: "shrink overflow-y-auto px-3 py-2", style: { height: maxHeight }, children: search ? searchResultContent : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "space-y-4", children: EMOJI_LIST.map((category) => renderEmojiCategory(category, true)) }) }),
4080
+ !search && showCategoryNav && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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) => {
4081
+ const IconComponent = CATEGORY_ICONS[category.id] || import_lucide_react4.Smile;
4082
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4083
+ "button",
4084
+ {
4085
+ type: "button",
4086
+ onClick: () => handleCategoryClick(category.id),
4087
+ className: cn(
4088
+ "rounded-lg p-2 transition-colors",
4089
+ activeCategory === category.id ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-accent hover:text-foreground"
4090
+ ),
4091
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Tooltip, { placement: "top", content: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-xs font-medium", children: category.name }), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconComponent, { className: "h-5 w-5" }) }) })
4092
+ },
4093
+ category.id
4094
+ );
4095
+ }) })
4096
+ ]
4097
+ }
4098
+ );
4084
4099
  };
4085
4100
  var EmojiPicker_default = EmojiPicker;
4086
4101
 
@@ -23882,7 +23897,7 @@ var ImageInput = ({ onSubmit, onCancel }) => {
23882
23897
  // src/components/UEditor/emoji-picker.tsx
23883
23898
  var import_jsx_runtime79 = require("react/jsx-runtime");
23884
23899
  var EmojiPicker2 = ({ onSelect }) => {
23885
- return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(EmojiPicker, { onEmojiSelect: onSelect });
23900
+ return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(EmojiPicker, { onEmojiSelect: onSelect, chrome: "embedded" });
23886
23901
  };
23887
23902
 
23888
23903
  // src/components/UEditor/typography-options.ts
@@ -24411,6 +24426,7 @@ var EditorToolbar = ({
24411
24426
  /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
24412
24427
  DropdownMenu,
24413
24428
  {
24429
+ contentClassName: "p-0 overflow-hidden",
24414
24430
  trigger: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(ToolbarButton, { onClick: () => {
24415
24431
  }, title: t("toolbar.emoji"), children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_lucide_react44.Smile, { className: "w-4 h-4" }) }),
24416
24432
  children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(