@versini/ui-liveregion 3.2.3 → 3.2.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.
Files changed (2) hide show
  1. package/dist/index.js +12 -10
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,19 +1,15 @@
1
1
  /*!
2
- @versini/ui-liveregion v3.2.3
3
- © 2025 gizmette.com
2
+ @versini/ui-liveregion v3.2.4
3
+ © 2026 gizmette.com
4
4
  */
5
5
 
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import clsx from "clsx";
8
8
  import { useEffect, useReducer, useRef } from "react";
9
9
 
10
- ;// CONCATENATED MODULE: external "react/jsx-runtime"
11
10
 
12
- ;// CONCATENATED MODULE: external "clsx"
13
11
 
14
- ;// CONCATENATED MODULE: external "react"
15
12
 
16
- ;// CONCATENATED MODULE: ./src/components/LiveRegion/constants.ts
17
13
  const ACTION_SET_ANNOUNCEMENT = "SET_ANNOUNCEMENT";
18
14
  const ACTION_CLEAR_ANNOUNCEMENT = "CLEAR_ANNOUNCEMENT";
19
15
  /**
@@ -111,7 +107,6 @@ const ACTION_CLEAR_ANNOUNCEMENT = "CLEAR_ANNOUNCEMENT";
111
107
  */ TIMER: "timer"
112
108
  }));
113
109
 
114
- ;// CONCATENATED MODULE: ./src/components/LiveRegion/reducer.ts
115
110
 
116
111
  const reducer = (state, action)=>{
117
112
  switch(action?.type){
@@ -130,7 +125,6 @@ const reducer = (state, action)=>{
130
125
  }
131
126
  };
132
127
 
133
- ;// CONCATENATED MODULE: ./src/components/LiveRegion/utilities.ts
134
128
 
135
129
  /**
136
130
  * Removes the content from the live region.
@@ -184,7 +178,6 @@ const reducer = (state, action)=>{
184
178
  }
185
179
  };
186
180
 
187
- ;// CONCATENATED MODULE: ./src/components/LiveRegion/LiveRegion.tsx
188
181
 
189
182
 
190
183
 
@@ -219,6 +212,16 @@ const reducer = (state, action)=>{
219
212
  onAnnouncementClear,
220
213
  dispatch
221
214
  });
215
+ // Cleanup timeouts on unmount to prevent "window is not defined" errors
216
+ // when the component unmounts before the timeout fires (e.g., in tests)
217
+ return ()=>{
218
+ if (announcementTimeoutRef.current) {
219
+ clearTimeout(announcementTimeoutRef.current);
220
+ }
221
+ if (clearAnnouncementTimeoutRef.current) {
222
+ clearTimeout(clearAnnouncementTimeoutRef.current);
223
+ }
224
+ };
222
225
  }, [
223
226
  children,
224
227
  announcementDelay,
@@ -239,7 +242,6 @@ const reducer = (state, action)=>{
239
242
  });
240
243
  }
241
244
 
242
- ;// CONCATENATED MODULE: ./src/components/index.ts
243
245
  /* v8 ignore start */ /* v8 ignore stop */
244
246
 
245
247
  export { LiveRegion };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-liveregion",
3
- "version": "3.2.3",
3
+ "version": "3.2.4",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -43,5 +43,5 @@
43
43
  "sideEffects": [
44
44
  "**/*.css"
45
45
  ],
46
- "gitHead": "fae53f4bd56440f7a72ed63b1a2a02b0c3b5a7e6"
46
+ "gitHead": "a7e1c5706d488dd4c81926c01c17552d60eb1b31"
47
47
  }