@sanity/ui 2.13.3 → 2.13.4
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/dist/_chunks-cjs/_visual-editing.js +5 -6
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +5 -6
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_legacy/_visual-editing.esm.js +5 -6
- package/dist/_legacy/_visual-editing.esm.js.map +1 -1
- package/dist/index.esm.js +33 -37
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +33 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
- package/src/core/components/toast/toastProvider.tsx +6 -7
- package/src/core/constants.ts +9 -7
package/dist/index.js
CHANGED
|
@@ -1027,7 +1027,7 @@ const StyledToastProvider = styledComponents.styled(_visualEditing.Layer).withCo
|
|
|
1027
1027
|
componentId: "sc-17mn6j-1"
|
|
1028
1028
|
})`box-sizing:border-box;position:absolute;right:0;bottom:0;max-width:420px;width:100%;`;
|
|
1029
1029
|
function ToastProvider(props) {
|
|
1030
|
-
const $ = reactCompilerRuntime.c(
|
|
1030
|
+
const $ = reactCompilerRuntime.c(22), {
|
|
1031
1031
|
children,
|
|
1032
1032
|
padding: t0,
|
|
1033
1033
|
paddingX,
|
|
@@ -1040,40 +1040,36 @@ function ToastProvider(props) {
|
|
|
1040
1040
|
let t2;
|
|
1041
1041
|
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {}, $[1] = t2) : t2 = $[1];
|
|
1042
1042
|
const toastsRef = react.useRef(t2), mounted = useMounted(), prefersReducedMotion = _visualEditing.usePrefersReducedMotion();
|
|
1043
|
-
let t3, t4, t5;
|
|
1043
|
+
let t3, t4, t5, t6;
|
|
1044
1044
|
$[2] === Symbol.for("react.memo_cache_sentinel") ? (t4 = {
|
|
1045
1045
|
opacity: 0,
|
|
1046
|
-
[_visualEditing.POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]:
|
|
1046
|
+
[_visualEditing.POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: -1,
|
|
1047
1047
|
y: 32,
|
|
1048
1048
|
scale: 0.25,
|
|
1049
1049
|
willChange: "transform"
|
|
1050
|
-
}, t5 =
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
opacity: t5,
|
|
1054
|
-
[_visualEditing.POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [0, 0, 1],
|
|
1050
|
+
}, t5 = {
|
|
1051
|
+
opacity: 2,
|
|
1052
|
+
[_visualEditing.POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: 1,
|
|
1055
1053
|
y: 0,
|
|
1056
1054
|
scale: 1
|
|
1057
|
-
},
|
|
1055
|
+
}, t6 = {
|
|
1056
|
+
opacity: 0,
|
|
1057
|
+
[_visualEditing.POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: -1,
|
|
1058
|
+
scale: 0.5
|
|
1059
|
+
}, $[2] = t4, $[3] = t5, $[4] = t6) : (t4 = $[2], t5 = $[3], t6 = $[4]);
|
|
1060
|
+
const t7 = prefersReducedMotion ? 0 : 0.2;
|
|
1058
1061
|
let t8;
|
|
1059
|
-
$[
|
|
1060
|
-
const t9 = prefersReducedMotion ? 0 : 0.2;
|
|
1061
|
-
let t10;
|
|
1062
|
-
$[7] !== t9 ? (t10 = {
|
|
1062
|
+
$[5] !== t7 ? (t8 = {
|
|
1063
1063
|
initial: t4,
|
|
1064
|
-
animate:
|
|
1065
|
-
exit:
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
scale: 0.5,
|
|
1069
|
-
transition: {
|
|
1070
|
-
duration: t9
|
|
1071
|
-
}
|
|
1064
|
+
animate: t5,
|
|
1065
|
+
exit: t6,
|
|
1066
|
+
transition: {
|
|
1067
|
+
duration: t7
|
|
1072
1068
|
}
|
|
1073
|
-
}, $[
|
|
1069
|
+
}, $[5] = t7, $[6] = t8) : t8 = $[6], t3 = t8;
|
|
1074
1070
|
const variants = t3;
|
|
1075
|
-
let
|
|
1076
|
-
$[
|
|
1071
|
+
let t9, t10;
|
|
1072
|
+
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t10 = {
|
|
1077
1073
|
version: 0,
|
|
1078
1074
|
push: (params) => {
|
|
1079
1075
|
const setState = (state_0) => react.startTransition(() => _setState(state_0)), id = params.id || generateToastId(), duration = params.duration || 5e3, dismiss = () => {
|
|
@@ -1098,23 +1094,23 @@ function ToastProvider(props) {
|
|
|
1098
1094
|
timeoutId: setTimeout(dismiss, duration)
|
|
1099
1095
|
}, id;
|
|
1100
1096
|
}
|
|
1101
|
-
}, $[
|
|
1102
|
-
const value =
|
|
1103
|
-
let
|
|
1104
|
-
$[
|
|
1097
|
+
}, $[7] = t10) : t10 = $[7], t9 = t10;
|
|
1098
|
+
const value = t9;
|
|
1099
|
+
let t11, t12;
|
|
1100
|
+
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t11 = () => () => {
|
|
1105
1101
|
for (const {
|
|
1106
1102
|
timeoutId: timeoutId_0
|
|
1107
1103
|
} of Object.values(toastsRef.current))
|
|
1108
1104
|
clearTimeout(timeoutId_0);
|
|
1109
1105
|
toastsRef.current = {};
|
|
1110
|
-
},
|
|
1111
|
-
let
|
|
1112
|
-
$[
|
|
1106
|
+
}, t12 = [], $[8] = t11, $[9] = t12) : (t11 = $[8], t12 = $[9]), react.useEffect(t11, t12);
|
|
1107
|
+
let t13;
|
|
1108
|
+
$[10] !== mounted || $[11] !== padding || $[12] !== paddingX || $[13] !== paddingY || $[14] !== prefersReducedMotion || $[15] !== state || $[16] !== variants || $[17] !== zOffset ? (t13 = mounted && /* @__PURE__ */ jsxRuntime.jsx(StyledToastProvider, { "data-ui": "ToastProvider", zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(ToastContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { padding, paddingX, paddingY, children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: !1, children: state.map((t142) => {
|
|
1113
1109
|
const {
|
|
1114
1110
|
dismiss: dismiss_0,
|
|
1115
1111
|
id: id_0,
|
|
1116
1112
|
params: params_0
|
|
1117
|
-
} =
|
|
1113
|
+
} = t142;
|
|
1118
1114
|
return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.div, { layout: "position", initial: "initial", animate: "animate", exit: "exit", variants, transition: prefersReducedMotion ? {
|
|
1119
1115
|
duration: 0
|
|
1120
1116
|
} : {
|
|
@@ -1122,12 +1118,12 @@ function ToastProvider(props) {
|
|
|
1122
1118
|
damping: 30,
|
|
1123
1119
|
stiffness: 400
|
|
1124
1120
|
}, children: /* @__PURE__ */ jsxRuntime.jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration }) }, id_0);
|
|
1125
|
-
}) }) }) }) }), $[
|
|
1126
|
-
let
|
|
1127
|
-
return $[
|
|
1121
|
+
}) }) }) }) }), $[10] = mounted, $[11] = padding, $[12] = paddingX, $[13] = paddingY, $[14] = prefersReducedMotion, $[15] = state, $[16] = variants, $[17] = zOffset, $[18] = t13) : t13 = $[18];
|
|
1122
|
+
let t14;
|
|
1123
|
+
return $[19] !== children || $[20] !== t13 ? (t14 = /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
|
|
1128
1124
|
children,
|
|
1129
|
-
|
|
1130
|
-
] }), $[
|
|
1125
|
+
t13
|
|
1126
|
+
] }), $[19] = children, $[20] = t13, $[21] = t14) : t14 = $[21], t14;
|
|
1131
1127
|
}
|
|
1132
1128
|
ToastProvider.displayName = "ToastProvider";
|
|
1133
1129
|
function useToast() {
|