@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/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, dismiss = () => {
1135
+ const id = params.id || generateToastId(), duration = params.duration || 5e3;
1136
+ return react.startTransition(() => {
1136
1137
  setState((prevState) => {
1137
- const idx = prevState.findIndex((t) => t.id === id);
1138
- if (idx > -1) {
1139
- const toasts = prevState.slice(0);
1140
- return toasts.splice(idx, 1), toasts;
1141
- }
1142
- return prevState;
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;