@sanity/ui 2.14.4-canary.0 → 2.14.4-canary.2
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 +4 -4
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +4 -4
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_legacy/_visual-editing.esm.js +4 -4
- package/dist/_legacy/_visual-editing.esm.js.map +1 -1
- package/dist/index.esm.js +25 -18
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +24 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/core/components/toast/toastProvider.tsx +24 -20
- package/src/core/constants.ts +2 -2
- package/src/core/hooks/useDelayedState.ts +1 -2
package/dist/index.js
CHANGED
|
@@ -1132,25 +1132,32 @@ function ToastProvider(props) {
|
|
|
1132
1132
|
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {
|
|
1133
1133
|
version: 0,
|
|
1134
1134
|
push: (params) => {
|
|
1135
|
-
const id = params.id || generateToastId(), duration = params.duration || 5e3
|
|
1135
|
+
const id = params.id || generateToastId(), duration = params.duration || 5e3;
|
|
1136
|
+
return react.startTransition(() => {
|
|
1136
1137
|
setState((prevState) => {
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1138
|
+
const dismiss = () => {
|
|
1139
|
+
react.startTransition(() => {
|
|
1140
|
+
setState((prevState_0) => {
|
|
1141
|
+
const idx = prevState_0.findIndex((t) => t.id === id);
|
|
1142
|
+
if (idx > -1) {
|
|
1143
|
+
const toasts = prevState_0.slice(0);
|
|
1144
|
+
return toasts.splice(idx, 1), toasts;
|
|
1145
|
+
}
|
|
1146
|
+
return prevState_0;
|
|
1147
|
+
});
|
|
1148
|
+
});
|
|
1149
|
+
};
|
|
1150
|
+
return prevState.filter((t_0) => t_0.id !== id).concat([{
|
|
1151
|
+
dismiss,
|
|
1152
|
+
id,
|
|
1153
|
+
updatedAt: Date.now(),
|
|
1154
|
+
params: {
|
|
1155
|
+
...params,
|
|
1156
|
+
duration
|
|
1157
|
+
}
|
|
1158
|
+
}]);
|
|
1143
1159
|
});
|
|
1144
|
-
};
|
|
1145
|
-
return setState((prevState_0) => prevState_0.filter((t_0) => t_0.id !== id).concat([{
|
|
1146
|
-
dismiss,
|
|
1147
|
-
id,
|
|
1148
|
-
updatedAt: Date.now(),
|
|
1149
|
-
params: {
|
|
1150
|
-
...params,
|
|
1151
|
-
duration
|
|
1152
|
-
}
|
|
1153
|
-
}])), id;
|
|
1160
|
+
}), id;
|
|
1154
1161
|
}
|
|
1155
1162
|
}, $[1] = t3) : t3 = $[1], t2 = t3;
|
|
1156
1163
|
const value = t2;
|