@underverse-ui/underverse 1.0.94 → 1.0.95
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 +98 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +108 -96
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -465,7 +465,7 @@ declare const ToastProvider: React__default.FC<ToastProviderProps>;
|
|
|
465
465
|
|
|
466
466
|
type Side = "top" | "right" | "bottom" | "left";
|
|
467
467
|
type TooltipPlacement = Side;
|
|
468
|
-
|
|
468
|
+
declare const Tooltip: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLElement>, "children" | "content"> & {
|
|
469
469
|
children: React$1.ReactElement;
|
|
470
470
|
content: React$1.ReactNode;
|
|
471
471
|
placement?: TooltipPlacement;
|
|
@@ -478,8 +478,7 @@ interface TooltipProps {
|
|
|
478
478
|
variant?: "default" | "info" | "warning" | "error" | "success";
|
|
479
479
|
/** When true, augment the child directly instead of adding a wrapper. Default: true */
|
|
480
480
|
asChild?: boolean;
|
|
481
|
-
}
|
|
482
|
-
declare const Tooltip: React$1.FC<TooltipProps>;
|
|
481
|
+
} & React$1.RefAttributes<HTMLElement>>;
|
|
483
482
|
|
|
484
483
|
type PopoverPlacement = "top" | "bottom" | "left" | "right" | "top-start" | "bottom-start" | "top-end" | "bottom-end";
|
|
485
484
|
interface PopoverProps {
|
package/dist/index.d.ts
CHANGED
|
@@ -465,7 +465,7 @@ declare const ToastProvider: React__default.FC<ToastProviderProps>;
|
|
|
465
465
|
|
|
466
466
|
type Side = "top" | "right" | "bottom" | "left";
|
|
467
467
|
type TooltipPlacement = Side;
|
|
468
|
-
|
|
468
|
+
declare const Tooltip: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLElement>, "children" | "content"> & {
|
|
469
469
|
children: React$1.ReactElement;
|
|
470
470
|
content: React$1.ReactNode;
|
|
471
471
|
placement?: TooltipPlacement;
|
|
@@ -478,8 +478,7 @@ interface TooltipProps {
|
|
|
478
478
|
variant?: "default" | "info" | "warning" | "error" | "success";
|
|
479
479
|
/** When true, augment the child directly instead of adding a wrapper. Default: true */
|
|
480
480
|
asChild?: boolean;
|
|
481
|
-
}
|
|
482
|
-
declare const Tooltip: React$1.FC<TooltipProps>;
|
|
481
|
+
} & React$1.RefAttributes<HTMLElement>>;
|
|
483
482
|
|
|
484
483
|
type PopoverPlacement = "top" | "bottom" | "left" | "right" | "top-start" | "bottom-start" | "top-end" | "bottom-end";
|
|
485
484
|
interface PopoverProps {
|
package/dist/index.js
CHANGED
|
@@ -2745,20 +2745,10 @@ function useHydrated() {
|
|
|
2745
2745
|
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
2746
2746
|
}
|
|
2747
2747
|
|
|
2748
|
-
// src/
|
|
2749
|
-
|
|
2750
|
-
var variantStyles2 = {
|
|
2751
|
-
default: "bg-popover text-popover-foreground border-border/50",
|
|
2752
|
-
info: "bg-info text-info-foreground border-info/20",
|
|
2753
|
-
warning: "bg-warning text-warning-foreground border-warning/20",
|
|
2754
|
-
error: "bg-destructive text-destructive-foreground border-destructive/20",
|
|
2755
|
-
success: "bg-success text-success-foreground border-success/20"
|
|
2756
|
-
};
|
|
2757
|
-
var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
2758
|
-
function composeEventHandlers(theirHandler, ourHandler) {
|
|
2748
|
+
// src/utils/react-compose.ts
|
|
2749
|
+
function chainEventHandlers(...handlers) {
|
|
2759
2750
|
return (event) => {
|
|
2760
|
-
|
|
2761
|
-
ourHandler(event);
|
|
2751
|
+
handlers.forEach((handler) => handler?.(event));
|
|
2762
2752
|
};
|
|
2763
2753
|
}
|
|
2764
2754
|
function setRefValue(ref, value) {
|
|
@@ -2774,6 +2764,17 @@ function mergeRefs(...refs) {
|
|
|
2774
2764
|
refs.forEach((ref) => setRefValue(ref, value));
|
|
2775
2765
|
};
|
|
2776
2766
|
}
|
|
2767
|
+
|
|
2768
|
+
// src/components/Tooltip.tsx
|
|
2769
|
+
import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2770
|
+
var variantStyles2 = {
|
|
2771
|
+
default: "bg-popover text-popover-foreground border-border/50",
|
|
2772
|
+
info: "bg-info text-info-foreground border-info/20",
|
|
2773
|
+
warning: "bg-warning text-warning-foreground border-warning/20",
|
|
2774
|
+
error: "bg-destructive text-destructive-foreground border-destructive/20",
|
|
2775
|
+
success: "bg-success text-success-foreground border-success/20"
|
|
2776
|
+
};
|
|
2777
|
+
var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
2777
2778
|
function getTransformOrigin(side) {
|
|
2778
2779
|
switch (side) {
|
|
2779
2780
|
case "top":
|
|
@@ -2818,7 +2819,7 @@ function computeTooltipPosition(args) {
|
|
|
2818
2819
|
top = clamp(top, padding, viewport.height - contentSize.height - padding);
|
|
2819
2820
|
return { top, left, side };
|
|
2820
2821
|
}
|
|
2821
|
-
var Tooltip = ({
|
|
2822
|
+
var Tooltip = React9.forwardRef(({
|
|
2822
2823
|
children,
|
|
2823
2824
|
content,
|
|
2824
2825
|
placement = "top",
|
|
@@ -2826,8 +2827,9 @@ var Tooltip = ({
|
|
|
2826
2827
|
className,
|
|
2827
2828
|
disabled = false,
|
|
2828
2829
|
variant = "default",
|
|
2829
|
-
asChild = true
|
|
2830
|
-
|
|
2830
|
+
asChild = true,
|
|
2831
|
+
...triggerPassthroughProps
|
|
2832
|
+
}, forwardedRef) => {
|
|
2831
2833
|
const [isOpen, setIsOpen] = React9.useState(false);
|
|
2832
2834
|
const isMounted = useHydrated();
|
|
2833
2835
|
const triggerRef = React9.useRef(null);
|
|
@@ -2942,31 +2944,53 @@ var Tooltip = ({
|
|
|
2942
2944
|
if (panelRef.current) ro.observe(panelRef.current);
|
|
2943
2945
|
return () => ro.disconnect();
|
|
2944
2946
|
}, [isOpen, updatePosition]);
|
|
2947
|
+
const childProps = children.props;
|
|
2948
|
+
const childRef = childProps.ref;
|
|
2949
|
+
const passthroughRef = mergeRefs(forwardedRef, childRef, (node) => {
|
|
2950
|
+
triggerRef.current = node;
|
|
2951
|
+
});
|
|
2945
2952
|
if (disabled || !content) {
|
|
2946
|
-
return children;
|
|
2953
|
+
if (!asChild) return children;
|
|
2954
|
+
return React9.cloneElement(children, {
|
|
2955
|
+
...triggerPassthroughProps,
|
|
2956
|
+
ref: passthroughRef
|
|
2957
|
+
});
|
|
2947
2958
|
}
|
|
2948
|
-
const childProps = children.props;
|
|
2949
|
-
const childRef = children.ref ?? childProps.ref;
|
|
2950
2959
|
const triggerProps = {
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
}),
|
|
2960
|
+
...triggerPassthroughProps,
|
|
2961
|
+
ref: passthroughRef,
|
|
2954
2962
|
"data-underverse-tooltip-trigger": triggerSelector,
|
|
2955
|
-
onMouseEnter:
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2963
|
+
onMouseEnter: chainEventHandlers(
|
|
2964
|
+
triggerPassthroughProps.onMouseEnter,
|
|
2965
|
+
childProps.onMouseEnter,
|
|
2966
|
+
(e) => {
|
|
2967
|
+
triggerRef.current = e.currentTarget;
|
|
2968
|
+
handleMouseEnter();
|
|
2969
|
+
}
|
|
2970
|
+
),
|
|
2971
|
+
onMouseLeave: chainEventHandlers(
|
|
2972
|
+
triggerPassthroughProps.onMouseLeave,
|
|
2973
|
+
childProps.onMouseLeave,
|
|
2974
|
+
(e) => {
|
|
2975
|
+
triggerRef.current = e.currentTarget;
|
|
2976
|
+
handleMouseLeave();
|
|
2977
|
+
}
|
|
2978
|
+
),
|
|
2979
|
+
onFocus: chainEventHandlers(
|
|
2980
|
+
triggerPassthroughProps.onFocus,
|
|
2981
|
+
childProps.onFocus,
|
|
2982
|
+
(e) => {
|
|
2983
|
+
triggerRef.current = e.currentTarget;
|
|
2984
|
+
handleFocus();
|
|
2985
|
+
}
|
|
2986
|
+
),
|
|
2987
|
+
onBlur: chainEventHandlers(
|
|
2988
|
+
triggerPassthroughProps.onBlur,
|
|
2989
|
+
childProps.onBlur,
|
|
2990
|
+
(e) => {
|
|
2991
|
+
handleBlur();
|
|
2992
|
+
}
|
|
2993
|
+
)
|
|
2970
2994
|
};
|
|
2971
2995
|
const trigger = asChild ? React9.cloneElement(children, triggerProps) : /* @__PURE__ */ jsx10("span", { ...triggerProps, children });
|
|
2972
2996
|
return /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
@@ -3010,7 +3034,8 @@ var Tooltip = ({
|
|
|
3010
3034
|
document.body
|
|
3011
3035
|
)
|
|
3012
3036
|
] });
|
|
3013
|
-
};
|
|
3037
|
+
});
|
|
3038
|
+
Tooltip.displayName = "Tooltip";
|
|
3014
3039
|
|
|
3015
3040
|
// src/components/emoji-ui.tsx
|
|
3016
3041
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
@@ -3978,10 +4003,10 @@ var EmojiPicker = ({
|
|
|
3978
4003
|
var EmojiPicker_default = EmojiPicker;
|
|
3979
4004
|
|
|
3980
4005
|
// src/components/TagInput.tsx
|
|
3981
|
-
import { forwardRef as
|
|
4006
|
+
import { forwardRef as forwardRef5, useState as useState7, useRef as useRef5, useId as useId3 } from "react";
|
|
3982
4007
|
import { X as X3, Search as Search3, Loader2 as Loader22 } from "lucide-react";
|
|
3983
4008
|
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3984
|
-
var TagInput =
|
|
4009
|
+
var TagInput = forwardRef5(
|
|
3985
4010
|
({
|
|
3986
4011
|
value = [],
|
|
3987
4012
|
onChange,
|
|
@@ -5935,36 +5960,32 @@ var Popover = ({
|
|
|
5935
5960
|
) : null;
|
|
5936
5961
|
return /* @__PURE__ */ jsxs15(Fragment4, { children: [
|
|
5937
5962
|
(() => {
|
|
5938
|
-
const TriggerComponent = trigger.type;
|
|
5939
5963
|
const triggerProps = trigger.props;
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5964
|
+
const childRef = triggerProps.ref;
|
|
5965
|
+
return React18.cloneElement(trigger, {
|
|
5966
|
+
...triggerProps,
|
|
5967
|
+
ref: mergeRefs(childRef, (node) => {
|
|
5968
|
+
triggerRef.current = node;
|
|
5969
|
+
}),
|
|
5970
|
+
"data-underverse-popover-trigger": triggerSelector,
|
|
5971
|
+
onClick: chainEventHandlers(
|
|
5972
|
+
(e) => {
|
|
5946
5973
|
triggerRef.current = e.currentTarget;
|
|
5947
5974
|
e.preventDefault();
|
|
5948
5975
|
e.stopPropagation();
|
|
5949
5976
|
handleTriggerClick();
|
|
5950
|
-
if (typeof triggerProps.onClick === "function") {
|
|
5951
|
-
triggerProps.onClick(e);
|
|
5952
|
-
}
|
|
5953
5977
|
},
|
|
5954
|
-
|
|
5978
|
+
triggerProps.onClick
|
|
5979
|
+
),
|
|
5980
|
+
onFocus: chainEventHandlers(
|
|
5981
|
+
(e) => {
|
|
5955
5982
|
triggerRef.current = e.currentTarget;
|
|
5956
|
-
if (typeof triggerProps.onFocus === "function") {
|
|
5957
|
-
triggerProps.onFocus(e);
|
|
5958
|
-
}
|
|
5959
5983
|
},
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
)
|
|
5966
|
-
}
|
|
5967
|
-
);
|
|
5984
|
+
triggerProps.onFocus
|
|
5985
|
+
),
|
|
5986
|
+
"aria-expanded": isOpen,
|
|
5987
|
+
"aria-haspopup": triggerProps["aria-haspopup"] ?? "dialog"
|
|
5988
|
+
});
|
|
5968
5989
|
})(),
|
|
5969
5990
|
popoverContent
|
|
5970
5991
|
] });
|
|
@@ -6843,17 +6864,18 @@ var DropdownMenu = ({
|
|
|
6843
6864
|
index
|
|
6844
6865
|
);
|
|
6845
6866
|
}) : children });
|
|
6846
|
-
const TriggerComponent = trigger.type;
|
|
6847
6867
|
const triggerProps = trigger.props;
|
|
6848
|
-
const
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6868
|
+
const childRef = triggerProps.ref;
|
|
6869
|
+
const enhancedTrigger = React23.cloneElement(trigger, {
|
|
6870
|
+
...triggerProps,
|
|
6871
|
+
ref: mergeRefs(childRef, (node) => {
|
|
6872
|
+
triggerRef.current = node;
|
|
6873
|
+
}),
|
|
6874
|
+
"aria-haspopup": "menu",
|
|
6875
|
+
"aria-expanded": open,
|
|
6876
|
+
onKeyDown: chainEventHandlers((e) => {
|
|
6877
|
+
triggerRef.current = e.currentTarget;
|
|
6878
|
+
if (!disabled) {
|
|
6857
6879
|
if (e.key === "ArrowDown") {
|
|
6858
6880
|
e.preventDefault();
|
|
6859
6881
|
setOpen(true);
|
|
@@ -6869,22 +6891,12 @@ var DropdownMenu = ({
|
|
|
6869
6891
|
e.preventDefault();
|
|
6870
6892
|
setOpen(false);
|
|
6871
6893
|
}
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
if (typeof triggerProps.onFocus === "function") {
|
|
6879
|
-
triggerProps.onFocus(e);
|
|
6880
|
-
}
|
|
6881
|
-
},
|
|
6882
|
-
className: cn(
|
|
6883
|
-
triggerProps.className,
|
|
6884
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
|
|
6885
|
-
)
|
|
6886
|
-
}
|
|
6887
|
-
);
|
|
6894
|
+
}
|
|
6895
|
+
}, triggerProps.onKeyDown),
|
|
6896
|
+
onFocus: chainEventHandlers((e) => {
|
|
6897
|
+
triggerRef.current = e.currentTarget;
|
|
6898
|
+
}, triggerProps.onFocus)
|
|
6899
|
+
});
|
|
6888
6900
|
return /* @__PURE__ */ jsx28(
|
|
6889
6901
|
Popover,
|
|
6890
6902
|
{
|
|
@@ -7816,7 +7828,7 @@ Section.displayName = "Section";
|
|
|
7816
7828
|
var Section_default = Section;
|
|
7817
7829
|
|
|
7818
7830
|
// src/components/ScrollArea.tsx
|
|
7819
|
-
import { forwardRef as
|
|
7831
|
+
import { forwardRef as forwardRef7, useRef as useRef11 } from "react";
|
|
7820
7832
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
7821
7833
|
var variantClasses2 = {
|
|
7822
7834
|
default: "bg-background",
|
|
@@ -7824,7 +7836,7 @@ var variantClasses2 = {
|
|
|
7824
7836
|
primary: "bg-primary/5",
|
|
7825
7837
|
accent: "bg-accent/10"
|
|
7826
7838
|
};
|
|
7827
|
-
var ScrollArea =
|
|
7839
|
+
var ScrollArea = forwardRef7(
|
|
7828
7840
|
({
|
|
7829
7841
|
className,
|
|
7830
7842
|
contentClassName,
|
|
@@ -7851,9 +7863,9 @@ var ScrollArea = forwardRef6(
|
|
|
7851
7863
|
ScrollArea.displayName = "ScrollArea";
|
|
7852
7864
|
|
|
7853
7865
|
// src/components/OverlayScrollArea.tsx
|
|
7854
|
-
import { forwardRef as
|
|
7866
|
+
import { forwardRef as forwardRef8, useRef as useRef12 } from "react";
|
|
7855
7867
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
7856
|
-
var OverlayScrollArea =
|
|
7868
|
+
var OverlayScrollArea = forwardRef8(
|
|
7857
7869
|
({ className, viewportClassName, viewportProps, enabled = true, overflowHidden = true, overlayScrollbarOptions, children, ...props }, ref) => {
|
|
7858
7870
|
const viewportRef = useRef12(null);
|
|
7859
7871
|
useOverlayScrollbarTarget(viewportRef, {
|
|
@@ -22931,7 +22943,7 @@ import { common, createLowlight } from "lowlight";
|
|
|
22931
22943
|
import { Extension } from "@tiptap/core";
|
|
22932
22944
|
import Suggestion from "@tiptap/suggestion";
|
|
22933
22945
|
import { ReactRenderer } from "@tiptap/react";
|
|
22934
|
-
import React66, { forwardRef as
|
|
22946
|
+
import React66, { forwardRef as forwardRef14, useEffect as useEffect31, useImperativeHandle, useRef as useRef26 } from "react";
|
|
22935
22947
|
import {
|
|
22936
22948
|
FileCode as FileCode2,
|
|
22937
22949
|
Heading1,
|
|
@@ -23135,7 +23147,7 @@ function buildSlashCommandItems({
|
|
|
23135
23147
|
}
|
|
23136
23148
|
].filter((item) => item.title.toLowerCase().includes(query.toLowerCase()));
|
|
23137
23149
|
}
|
|
23138
|
-
var SlashCommandList =
|
|
23150
|
+
var SlashCommandList = forwardRef14((props, ref) => {
|
|
23139
23151
|
const [selectedIndex, setSelectedIndex] = useResettingIndex2(props.items);
|
|
23140
23152
|
const listRef = useRef26(null);
|
|
23141
23153
|
useEffect31(() => {
|
|
@@ -23376,7 +23388,7 @@ import { Extension as Extension3 } from "@tiptap/core";
|
|
|
23376
23388
|
import Suggestion2 from "@tiptap/suggestion";
|
|
23377
23389
|
import { ReactRenderer as ReactRenderer2 } from "@tiptap/react";
|
|
23378
23390
|
import { PluginKey } from "@tiptap/pm/state";
|
|
23379
|
-
import React67, { forwardRef as
|
|
23391
|
+
import React67, { forwardRef as forwardRef15, useImperativeHandle as useImperativeHandle2 } from "react";
|
|
23380
23392
|
import { Smile as Smile2 } from "lucide-react";
|
|
23381
23393
|
import { jsx as jsx75, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
23382
23394
|
function useResettingIndex3(resetToken) {
|
|
@@ -23393,7 +23405,7 @@ function useResettingIndex3(resetToken) {
|
|
|
23393
23405
|
}, [resetToken]);
|
|
23394
23406
|
return [selectedIndex, setSelectedIndex];
|
|
23395
23407
|
}
|
|
23396
|
-
var EmojiList =
|
|
23408
|
+
var EmojiList = forwardRef15((props, ref) => {
|
|
23397
23409
|
const t = useSmartTranslations("UEditor");
|
|
23398
23410
|
const [selectedIndex, setSelectedIndex] = useResettingIndex3(props.items);
|
|
23399
23411
|
const showingCountLabel = formatEmojiCountLabel(t("emojiSuggestion.showingCount"), 64, props.items.length);
|