@livo-tv/blocks 0.0.1 → 1.0.0
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/README.md +6 -6
- package/dist/index.cjs +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2042,8 +2042,12 @@ function AvatarEditorDialog({
|
|
|
2042
2042
|
}) {
|
|
2043
2043
|
const [isOpen, setIsOpen] = useState(false);
|
|
2044
2044
|
const [editedValue, setEditedValue] = useState(value ?? null);
|
|
2045
|
+
const [displaySrc, setDisplaySrc] = useState(value ?? null);
|
|
2045
2046
|
const [isSaving, setIsSaving] = useState(false);
|
|
2046
2047
|
const [feedback, setFeedback] = useState(null);
|
|
2048
|
+
useEffect(() => {
|
|
2049
|
+
setDisplaySrc(value ?? null);
|
|
2050
|
+
}, [value]);
|
|
2047
2051
|
const isMobile = useMediaQuery("(max-width: 640px)");
|
|
2048
2052
|
const caption = (placeholder ?? "").trim();
|
|
2049
2053
|
const handleOpenChange = useCallback(
|
|
@@ -2064,6 +2068,7 @@ function AvatarEditorDialog({
|
|
|
2064
2068
|
if (onSave) {
|
|
2065
2069
|
const result = await onSave(editedValue);
|
|
2066
2070
|
if (result) {
|
|
2071
|
+
setDisplaySrc(editedValue);
|
|
2067
2072
|
onChange?.(editedValue);
|
|
2068
2073
|
setFeedback({ type: "success", message: successMessage });
|
|
2069
2074
|
setTimeout(() => {
|
|
@@ -2074,6 +2079,7 @@ function AvatarEditorDialog({
|
|
|
2074
2079
|
setFeedback({ type: "error", message: errorMessage });
|
|
2075
2080
|
}
|
|
2076
2081
|
} else {
|
|
2082
|
+
setDisplaySrc(editedValue);
|
|
2077
2083
|
onChange?.(editedValue);
|
|
2078
2084
|
setFeedback({ type: "success", message: successMessage });
|
|
2079
2085
|
setTimeout(() => {
|
|
@@ -2101,9 +2107,9 @@ function AvatarEditorDialog({
|
|
|
2101
2107
|
children: /* @__PURE__ */ jsx(
|
|
2102
2108
|
SafeImage,
|
|
2103
2109
|
{
|
|
2104
|
-
src:
|
|
2110
|
+
src: displaySrc,
|
|
2105
2111
|
alt: "Avatar",
|
|
2106
|
-
className: "absolute object-cover",
|
|
2112
|
+
className: "absolute inset-0 h-full w-full object-cover",
|
|
2107
2113
|
fallback: /* @__PURE__ */ jsxs(
|
|
2108
2114
|
"div",
|
|
2109
2115
|
{
|