@react-stately/toast 3.0.0-nightly.4623 → 3.0.0-nightly.4629

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.
@@ -70,11 +70,11 @@ class $c995945a643dde76$export$f1f8569633bbbec4 {
70
70
  else low = mid + 1;
71
71
  }
72
72
  this.queue.splice(low, 0, toast);
73
- toast.animation = low < this.maxVisibleToasts ? "entering" : "queued";
73
+ toast.animation = low < this.maxVisibleToasts ? 'entering' : 'queued';
74
74
  let i = this.maxVisibleToasts;
75
- while(i < this.queue.length)this.queue[i++].animation = "queued";
75
+ while(i < this.queue.length)this.queue[i++].animation = 'queued';
76
76
  this.updateVisibleToasts({
77
- action: "add"
77
+ action: 'add'
78
78
  });
79
79
  return toastKey;
80
80
  }
@@ -89,31 +89,31 @@ class $c995945a643dde76$export$f1f8569633bbbec4 {
89
89
  this.queue.splice(index, 1);
90
90
  }
91
91
  this.updateVisibleToasts({
92
- action: "close",
92
+ action: 'close',
93
93
  key: key
94
94
  });
95
95
  }
96
96
  /** Removes a toast from the visible toasts after an exiting animation. */ remove(key) {
97
97
  this.updateVisibleToasts({
98
- action: "remove",
98
+ action: 'remove',
99
99
  key: key
100
100
  });
101
101
  }
102
102
  updateVisibleToasts(options) {
103
103
  let { action: action, key: key } = options;
104
104
  let toasts = this.queue.slice(0, this.maxVisibleToasts);
105
- if (action === "add" && this.hasExitAnimation) {
105
+ if (action === 'add' && this.hasExitAnimation) {
106
106
  let prevToasts = this.visibleToasts.filter((t)=>!toasts.some((t2)=>t.key === t2.key)).map((t)=>({
107
107
  ...t,
108
- animation: "exiting"
108
+ animation: 'exiting'
109
109
  }));
110
110
  this.visibleToasts = prevToasts.concat(toasts).sort((a, b)=>b.priority - a.priority);
111
- } else if (action === "close" && this.hasExitAnimation) // Cause a rerender to happen for exit animation
111
+ } else if (action === 'close' && this.hasExitAnimation) // Cause a rerender to happen for exit animation
112
112
  this.visibleToasts = this.visibleToasts.map((t)=>{
113
113
  if (t.key !== key) return t;
114
114
  else return {
115
115
  ...t,
116
- animation: "exiting"
116
+ animation: 'exiting'
117
117
  };
118
118
  });
119
119
  else this.visibleToasts = toasts;
@@ -62,11 +62,11 @@ class $77b352cf12efcf73$export$f1f8569633bbbec4 {
62
62
  else low = mid + 1;
63
63
  }
64
64
  this.queue.splice(low, 0, toast);
65
- toast.animation = low < this.maxVisibleToasts ? "entering" : "queued";
65
+ toast.animation = low < this.maxVisibleToasts ? 'entering' : 'queued';
66
66
  let i = this.maxVisibleToasts;
67
- while(i < this.queue.length)this.queue[i++].animation = "queued";
67
+ while(i < this.queue.length)this.queue[i++].animation = 'queued';
68
68
  this.updateVisibleToasts({
69
- action: "add"
69
+ action: 'add'
70
70
  });
71
71
  return toastKey;
72
72
  }
@@ -81,31 +81,31 @@ class $77b352cf12efcf73$export$f1f8569633bbbec4 {
81
81
  this.queue.splice(index, 1);
82
82
  }
83
83
  this.updateVisibleToasts({
84
- action: "close",
84
+ action: 'close',
85
85
  key: key
86
86
  });
87
87
  }
88
88
  /** Removes a toast from the visible toasts after an exiting animation. */ remove(key) {
89
89
  this.updateVisibleToasts({
90
- action: "remove",
90
+ action: 'remove',
91
91
  key: key
92
92
  });
93
93
  }
94
94
  updateVisibleToasts(options) {
95
95
  let { action: action, key: key } = options;
96
96
  let toasts = this.queue.slice(0, this.maxVisibleToasts);
97
- if (action === "add" && this.hasExitAnimation) {
97
+ if (action === 'add' && this.hasExitAnimation) {
98
98
  let prevToasts = this.visibleToasts.filter((t)=>!toasts.some((t2)=>t.key === t2.key)).map((t)=>({
99
99
  ...t,
100
- animation: "exiting"
100
+ animation: 'exiting'
101
101
  }));
102
102
  this.visibleToasts = prevToasts.concat(toasts).sort((a, b)=>b.priority - a.priority);
103
- } else if (action === "close" && this.hasExitAnimation) // Cause a rerender to happen for exit animation
103
+ } else if (action === 'close' && this.hasExitAnimation) // Cause a rerender to happen for exit animation
104
104
  this.visibleToasts = this.visibleToasts.map((t)=>{
105
105
  if (t.key !== key) return t;
106
106
  else return {
107
107
  ...t,
108
- animation: "exiting"
108
+ animation: 'exiting'
109
109
  };
110
110
  });
111
111
  else this.visibleToasts = toasts;
@@ -62,11 +62,11 @@ class $77b352cf12efcf73$export$f1f8569633bbbec4 {
62
62
  else low = mid + 1;
63
63
  }
64
64
  this.queue.splice(low, 0, toast);
65
- toast.animation = low < this.maxVisibleToasts ? "entering" : "queued";
65
+ toast.animation = low < this.maxVisibleToasts ? 'entering' : 'queued';
66
66
  let i = this.maxVisibleToasts;
67
- while(i < this.queue.length)this.queue[i++].animation = "queued";
67
+ while(i < this.queue.length)this.queue[i++].animation = 'queued';
68
68
  this.updateVisibleToasts({
69
- action: "add"
69
+ action: 'add'
70
70
  });
71
71
  return toastKey;
72
72
  }
@@ -81,31 +81,31 @@ class $77b352cf12efcf73$export$f1f8569633bbbec4 {
81
81
  this.queue.splice(index, 1);
82
82
  }
83
83
  this.updateVisibleToasts({
84
- action: "close",
84
+ action: 'close',
85
85
  key: key
86
86
  });
87
87
  }
88
88
  /** Removes a toast from the visible toasts after an exiting animation. */ remove(key) {
89
89
  this.updateVisibleToasts({
90
- action: "remove",
90
+ action: 'remove',
91
91
  key: key
92
92
  });
93
93
  }
94
94
  updateVisibleToasts(options) {
95
95
  let { action: action, key: key } = options;
96
96
  let toasts = this.queue.slice(0, this.maxVisibleToasts);
97
- if (action === "add" && this.hasExitAnimation) {
97
+ if (action === 'add' && this.hasExitAnimation) {
98
98
  let prevToasts = this.visibleToasts.filter((t)=>!toasts.some((t2)=>t.key === t2.key)).map((t)=>({
99
99
  ...t,
100
- animation: "exiting"
100
+ animation: 'exiting'
101
101
  }));
102
102
  this.visibleToasts = prevToasts.concat(toasts).sort((a, b)=>b.priority - a.priority);
103
- } else if (action === "close" && this.hasExitAnimation) // Cause a rerender to happen for exit animation
103
+ } else if (action === 'close' && this.hasExitAnimation) // Cause a rerender to happen for exit animation
104
104
  this.visibleToasts = this.visibleToasts.map((t)=>{
105
105
  if (t.key !== key) return t;
106
106
  else return {
107
107
  ...t,
108
- animation: "exiting"
108
+ animation: 'exiting'
109
109
  };
110
110
  });
111
111
  else this.visibleToasts = toasts;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-stately/toast",
3
- "version": "3.0.0-nightly.4623+b294de874",
3
+ "version": "3.0.0-nightly.4629+c34886769",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -34,5 +34,5 @@
34
34
  "publishConfig": {
35
35
  "access": "public"
36
36
  },
37
- "gitHead": "b294de874c16fad64bc4b930ccee1c9ffeb1c20f"
37
+ "gitHead": "c34886769d3e69bb56553a02eead6a0fd877e754"
38
38
  }